Commit c1e41a05 authored by Schoumi's avatar Schoumi

Init project in React

Menu are done
parents
Pipeline #287 failed with stages
root = true
[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
[*.{jade,pug}]
trim_trailing_whitespace = false
[*.styl]
indent_size = 4
{
"extends": ["cozy-app/react"]
}
*Please explain what this PR does here.*
#### Checklist
Before merging this PR, the following things must have been done:
- [ ] Faithful integration of the mockups at all screen sizes
- [ ] Tested on supported browsers, including responsive mode (IE11 and Edge, Chrome >= 42, 2 latest versions of Firefox and Safari)
- [ ] Localized in english and french
- [ ] All changes have test coverage
- [ ] Updated README, if necessary
- [ ] Make sure commit messages rely on the [Commitizen](http://commitizen.github.io/cz-cli/) format
If this PR relies on changes in one of our internal libraries (cozy-client-js or cozy-ui, for example), please also do the following things:
- [ ] The package.json and yarn.lock files include the correct dependency version, in those versions have been released
- [ ] [cozy-client-js](https://github.com/cozy/cozy-client-js) documentation and tests are up to date
- [ ] [cozy-ui](https://github.com/cozy/cozy-ui) documentation and style guides are up to date
*(If not, please remove this last section.)*
# NPM
node_modules/
npm-debug.log
yarn-error.log
# Build
build/
# Coverage
coverage/
# Locales
**/locales/*
!**/locales/en.json
# transifex
.transifexrc
# Coverage
coverage/
# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
desktop.ini
# Mobile
targets/mobile/hooks
targets/mobile/platforms
targets/mobile/plugins
targets/mobile/www
targets/mobile/keys
targets/mobile/res/icons
targets/mobile/res/screens
targets/mobile/icon.png
targets/mobile/store
# fastlane
mobile/fastlane/README.md
mobile/fastlane/report.xml
mobile/fastlane/Error*.png
mobile/fastlane/Preview.html
mobile/Preview.html
# Default
# /!\ KEEP THIS SECTION THE LAST ONE
!.gitkeep
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<JSCodeStyleSettings version="0">
<option name="USE_SEMICOLON_AFTER_STATEMENT" value="false" />
<option name="FORCE_SEMICOLON_STYLE" value="true" />
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
<option name="USE_DOUBLE_QUOTES" value="false" />
<option name="FORCE_QUOTE_STYlE" value="true" />
<option name="ENFORCE_TRAILING_COMMA" value="Remove" />
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
<option name="SPACES_WITHIN_IMPORTS" value="true" />
</JSCodeStyleSettings>
<TypeScriptCodeStyleSettings version="0">
<option name="USE_SEMICOLON_AFTER_STATEMENT" value="false" />
<option name="FORCE_SEMICOLON_STYLE" value="true" />
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
<option name="USE_DOUBLE_QUOTES" value="false" />
<option name="FORCE_QUOTE_STYlE" value="true" />
<option name="ENFORCE_TRAILING_COMMA" value="Remove" />
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
<option name="SPACES_WITHIN_IMPORTS" value="true" />
</TypeScriptCodeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="SOFT_MARGINS" value="80" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="TypeScript">
<option name="SOFT_MARGINS" value="80" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
</component>
\ No newline at end of file
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="JSX" />
</component>
<component name="NodePackageJsonFileManager">
<packageJsonPaths />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/cozy-music.iml" filepath="$PROJECT_DIR$/.idea/cozy-music.iml" />
</modules>
</component>
</project>
\ No newline at end of file
This diff is collapsed.
{
"semi": false,
"singleQuote": true
}
{
"blocks": "never",
"brackets": {
"expect": "never",
"error": true
},
"colons": {
"expect": "never",
"error": true
},
"colors": {
"expect": "always",
"error": true
},
"commaSpace": {
"expect": "always",
"error": true
},
"commentSpace": {
"expect": "always",
"error": true
},
"cssLiteral": "never",
"customProperties": [],
"depthLimit": 4,
"duplicates": {
"expect": true,
"error": true
},
"efficient": {
"expect": "always",
"error": true
},
"exclude": [],
"extendPref": "@extend",
"globalDupe": {
"expect": true,
"error": true
},
"groupOutputByFile": {
"expect": true,
"error": true
},
"indentPref": {
"expect": 4,
"error": true
},
"leadingZero": {
"expect": "never",
"error": true
},
"maxErrors": false,
"maxWarnings": false,
"mixed": {
"expect": true,
"error": true
},
"mixins": ["top-padded","right-padded","bottom-padded","left-padded","vertically-padded","horizontally-padded","padded","top-spaced","right-spaced","bottom-spaced","left-spaced","vertically-spaced","horizontally-spaced","spaced","hide","reset"],
"namingConvention": {
"expect": "lowercase-dash",
"error": true
},
"namingConventionStrict": false,
"none": {
"expect": "never",
"error": true
},
"noImportant": {
"expect": true,
"error": true
},
"parenSpace": {
"expect": "never",
"error": true
},
"placeholders": {
"expect": "always",
"error": true
},
"prefixVarsWithDollar": false,
"quotePref": {
"expect": "single",
"error": true
},
"reporterOptions": {
"columns": ["lineData", "severity", "description", "rule"],
"columnSplitter": " ",
"showHeaders": false,
"truncate": true
},
"semicolons": {
"expect": "never",
"error": true
},
"sortOrder": false,
"stackedProperties": {
"expect": "never",
"error": true
},
"trailingWhitespace": {
"expect": "never",
"error": true
},
"universal": {
"expect": "never",
"error": true
},
"valid": {
"expect": true,
"error": true
},
"zeroUnits": {
"expect": "never",
"error": true
},
"zIndexNormalize": {
"expect": 1,
"error": true
}
}
[https://www.transifex.com]
hostname = https://www.transifex.com
username =
token =
language: node_js
matrix:
fast_finish: true
node_js:
- '8'
branches:
except:
- build
env:
global:
- CXX=g++-4.8
# GITHUB_TOKEN for yarn deploy script
# to generate yours : travis encrypt GITHUB_TOKEN=<your_GITHUB_TOKEN> -r Schoumi/cozy-music --org
# REGISTRY_TOKEN for yarn cozyPublish script
# to generate yours : travis encrypt REGISTRY_TOKEN=<your_REGISTRY_TOKEN> -r Schoumi/cozy-music --org
# N.B.: the --org option is needed only for public repositories
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- deadsnakes
packages:
- g++-4.8
- python3.5
cache:
yarn: true
directories:
- node_modules
before_install:
- curl -fsSL https://bootstrap.pypa.io/get-pip.py | python3.5 - --user
- travis_retry pip3.5 install --user transifex-client
- install -m0644 .transifexrc.tpl ~/.transifexrc
- echo "password = $TX_PASSWD" >> ~/.transifexrc
script:
- yarn lint
- yarn test
- yarn build
deploy:
- provider: script
repo: Schoumi/cozy-music
skip-cleanup: true
# deploy the build on a build branch and publish to the Cozy registry
script: DEPLOY_BRANCH=build && yarn deploy && yarn cozyPublish
on:
branch: master
- provider: script
repo: Schoumi/cozy-music
skip-cleanup: true
# publish stable or beta versions using Github Releases (git tag)
script: DEPLOY_BRANCH=build && yarn cozyPublish
on:
tags: true
[main]
host = https://www.transifex.com
[<project_slug.resource_slug>]
file_filter = src/locales/<lang>.json
source_file = src/locales/en.json
source_lang = en
type = KEYVALUEJSON
# How to contribute to Cozy Music?
Thank you for your interest in contributing to this Cozy application! There are many ways to contribute, and we appreciate all of them.
## Security Issues
If you discover a security issue, please bring it to our attention right away! Please **DO NOT** file a public issue, instead send your report privately to security AT cozycloud DOT cc.
Security reports are greatly appreciated and we will publicly thank you for it. We currently do not offer a paid security bounty program, but are not ruling it out in the future.
## Bug Reports
While bugs are unfortunate, they're a reality in software. We can't fix what we don't know about, so please report liberally. If you're not sure if something is a bug or not, feel free to file a bug anyway.
Opening an issue is as easy as following [this link][issues] and filling out the fields. Here are some things you can write about your bug:
- A short summary
- What did you try, step by step?
- What did you expect?
- What did happen instead?
- What is the version of the Cozy Music app?
## Pull Requests
Please keep in mind that:
- Pull-Requests point to the `master` branch
- You need to cover your code and feature by tests
- You may add documentation in the `/docs` directory to explain your choices if needed
- We recommend to use [task lists][checkbox] to explain steps / features in your Pull-Request description
- you do _not_ need to build app to submit a PR
- you should update the Transifex source locale file if you modify it for your feature needs (see [Localization section in README][localization])
### Workflow
Pull requests are the primary mechanism we use to change Cozy. GitHub itself has some [great documentation][pr] on using the Pull Request feature. We use the _fork and pull_ model described there.
#### Step 1: Fork
Fork the project on GitHub and [check out your copy locally][forking].
```
$ git clone github.com/Schoumi/cozy-music.git
$ cd cozy-music
$ git remote add fork git://github.com/yourusername/cozy-music.git
```
#### Step 2: Branch
Create a branch and start hacking:
```
$ git checkout -b my-branch origin/master
```
#### Step 3: Code
Well, we think you know how to do that. Just be sure to follow the coding guidelines from the community ([standard JS][stdjs], comment the code, etc).
#### Step 4: Test
Don't forget to add tests and be sure they are green:
```
$ cd cozy-music
$ npm run test
```
#### Step 5: Commit
Writing [good commit messages][commitmsg] is important. A commit message should describe what changed and why.
#### Step 6: Rebase
Use `git rebase` (_not_ `git merge`) to sync your work from time to time.
```
$ git fetch origin
$ git rebase origin/master my-branch
```
#### Step 7: Push
```
$ git push -u fork my-branch
```
Go to https://github.com/yourusername/cozy-music and select your branch. Click the 'Pull Request' button and fill out the form.
Alternatively, you can use [hub] to open the pull request from your terminal:
```
$ git pull-request -b master -m "My PR message" -o
```
Pull requests are usually reviewed within a few days. If there are comments to address, apply your changes in a separate commit and push that to your branch. Post a comment in the pull request afterwards; GitHub doesn't send out notifications when you add commits.
## Writing documentation
Documentation improvements are very welcome. We try to keep a good documentation in the `/docs` folder. But, you know, we are developers, we can forget to document important stuff that look obvious to us. And documentation can always be improved.
## Translations
The Cozy Music is translated on a platform called [Transifex][tx]. [This tutorial][tx-start] can help you to learn how to make your first steps here. If you have any question, don't hesitate to ask us!
## Community
You can help us by making our community even more vibrant. For example, you can write a blog post, take some videos, answer the questions on [the forum][forum], organize new meetups, and speak about what you like in Cozy!
[issues]: https://github.com/Schoumi/cozy-music/issues/new
[pr]: https://help.github.com/categories/collaborating-with-issues-and-pull-requests/
[forking]: http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html
[stdjs]: http://standardjs.com/
[commitmsg]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[localization]: https://github.com/Schoumi/cozy-music/blob/master/README.md#localization
[hub]: https://hub.github.com/
[tx]: https://www.transifex.com/cozy/
[tx-start]: http://docs.transifex.com/getting-started/translators/
[forum]: https://forum.cozy.io/
This diff is collapsed.
[![Travis build status shield](https://img.shields.io/travis/Schoumi/cozy-music/master.svg)](https://travis-ci.org/Schoumi/cozy-music)
[![Github Release version shield](https://img.shields.io/github/tag/Schoumi/cozy-music.svg)](https://github.com/Schoumi/cozy-music/releases)
[![jest](https://facebook.github.io/jest/img/jest-badge.svg)](https://github.com/facebook/jest)
# Cozy Music
## What's Cozy Music?
<TODO>...
## Hack
_:pushpin: Note:_ we recommend to use [Yarn] instead of NPM for package management. Don't hesitate to [install][yarn-install] and use it for your Cozy projects, it's now our main node packages tool for Cozy official apps.
### Install
Hacking the Cozy Cozy Music app requires you to [setup a dev environment][setup].
You can then clone the app repository and install dependencies:
```sh
$ git clone https://github.com/Schoumi/cozy-music.git
$ cd cozy-music
$ yarn install
```
:pushpin: If you use a node environment wrapper like [nvm] or [ndenv], don't forget to set your local node version before doing a `yarn install`.
Cozy's apps use a standard set of _npm scripts_ to run common tasks, like watch, lint, test, build…
### Run it inside a Cozy using Docker
You can run your application inside a Cozy thanks to the [cozy-stack docker image][cozy-stack-docker]:
```sh
# in a terminal, run your app in watch mode with a docker running Cozy
$ cd cozy-music
$ yarn start
```
After the build and the stack launched, your app is now available at http://cozy-music.cozy.tools:8080.
### Living on the edge
[Cozy-ui] is our frontend stack library that provides common styles and components accross the whole Cozy's apps. You can use it for you own application to follow the official Cozy's guidelines and styles. If you need to develop / hack cozy-ui, it's sometimes more useful to develop on it through another app. You can do it by cloning cozy-ui locally and link it to yarn local index:
```sh
git clone https://github.com/cozy/cozy-ui.git
cd cozy-ui
yarn install
yarn link
```
then go back to your app project and replace the distributed cozy-ui module with the linked one:
```sh
cd cozy-drive
yarn link cozy-ui
```
[Cozy-client-js] is our API library that provides an unified API on top of the cozy-stack. If you need to develop / hack cozy-client-js in parallel of your application, you can use the same trick that we used with [cozy-ui]: yarn linking.
### Tests
Tests are run by [jest] under the hood. You can easily run the tests suite with:
```sh
$ cd cozy-music
$ yarn test
```
:pushpin: Don't forget to update / create new tests when you contribute to code to keep the app the consistent.
## Models
The Cozy datastore stores documents, which can be seen as JSON objects. A `doctype` is simply a declaration of the fields in a given JSON object, to store similar objects in an homogeneous fashion.
Cozy ships a [built-in list of `doctypes`][doctypes] for representation of most of the common documents (Bills, Contacts, Files, ...).
Whenever your app needs to use a given `doctype`, you should:
- Check if this is a standard `doctype` defined in Cozy itself. If this is the case, you should add a model declaration in your app containing at least the fields listed in the [main fields list for this `doctype`][doctypes]. Note that you can extend the Cozy-provided `doctype` with your own customs fields. This is typically what is done in [Konnectors] for the [Bill `doctype`][bill-doctype].
- If no standards `doctypes` fit your needs, you should define your own `doctype` in your app. In this case, you do not have to put any field you want in your model, but you should crosscheck other cozy apps to try to homogeneize the names of your fields, so that your `doctype` data could be reused by other apps. This is typically the case for the [Konnector `doctype`][konnector-doctype] in [Konnectors].
### Open a Pull-Request
If you want to work on Cozy Music and submit code modifications, feel free to open pull-requests! See the [contributing guide][contribute] for more information about how to properly open pull-requests.
## Community
### What's Cozy?
<div align="center">
<a href="https://cozy.io">
<img src="https://cdn.rawgit.com/cozy/cozy-site/master/src/images/cozy-logo-name-horizontal-blue.svg" alt="cozy" height="48" />
</a>
</div>
</br>
[Cozy] is a platform that brings all your web services in the same private space. With it, your webapps and your devices can share data easily, providing you with a new experience. You can install Cozy on your own hardware where no one's tracking you.
### Localization
Localization and translations are handled by [Transifex][tx], which is used by all Cozy's apps.
As a _translator_, you can login to [Transifex][tx-signin] (using your Github account) and claim an access to the [app repository][tx-app]. Locales are pulled when app is build before publishing.
As a _developer_, you must [configure the transifex client][tx-client], and claim an access as _maintainer_ to the [app repository][tx-app]. Then please **only update** the source locale file (usually `en.json` in client and/or server parts), and push it to Transifex repository using the `tx push -s` command.
### Maintainer
The lead maintainer for Cozy Music is [Schoumi](https://github.com/Schoumi), send him/her a :beers: to say hello!
### Get in touch
You can reach the Cozy Community by:
- Chatting with us on IRC [#cozycloud on Freenode][freenode]
- Posting on our [Forum][forum]
- Posting issues on the [Github repos][github]
- Say Hi! on [Twitter][twitter]
## License
Cozy Music is developed by Schoumi and distributed under the [AGPL v3 license][agpl-3.0].
[cozy]: https://cozy.io "Cozy Cloud"
[setup]: https://dev.cozy.io/#set-up-the-development-environment "Cozy dev docs: Set up the Development Environment"
[yarn]: https://yarnpkg.com/
[yarn-install]: https://yarnpkg.com/en/docs/install
[cozy-ui]: https://github.com/cozy/cozy-ui
[cozy-client-js]: https://github.com/cozy/cozy-client-js/
[cozy-stack-docker]: https://github.com/cozy/cozy-stack/blob/master/docs/client-app-dev.md#with-docker
[doctypes]: https://cozy.github.io/cozy-doctypes/
[bill-doctype]: https://github.com/cozy/cozy-konnector-libs/blob/master/models/bill.js
[konnector-doctype]: https://github.com/cozy/cozy-konnector-libs/blob/master/models/base_model.js
[konnectors]: https://github.com/cozy/cozy-konnector-libs
[agpl-3.0]: https://www.gnu.org/licenses/agpl-3.0.html
[contribute]: CONTRIBUTING.md
[tx]: https://www.transifex.com/cozy/
[tx-signin]: https://www.transifex.com/signin/
[tx-app]: https://www.transifex.com/cozy/<SLUG_TX>/dashboard/
[tx-client]: http://docs.transifex.com/client/
[freenode]: http://webchat.freenode.net/?randomnick=1&channels=%23cozycloud&uio=d4
[forum]: https://forum.cozy.io/
[github]: https://github.com/cozy/
[twitter]: https://twitter.com/cozycloud
[nvm]: https://github.com/creationix/nvm
[ndenv]: https://github.com/riywo/ndenv
[jest]: https://facebook.github.io/jest/
module.exports = {
presets: ['cozy-app']
}
module.exports = {
testURL: 'http://localhost/',
moduleFileExtensions: ['js', 'jsx', 'json', 'styl'],
setupFiles: ['<rootDir>/test/jestLib/setup.js'],
moduleDirectories: ['src', 'node_modules'],
moduleNameMapper: {
'\\.(png|gif|jpe?g|svg)$': '<rootDir>/test/__mocks__/fileMock.js',
// identity-obj-proxy module is installed by cozy-scripts
styles: 'identity-obj-proxy'
},
transformIgnorePatterns: ['node_modules/(?!cozy-ui)'],
globals: {
__ALLOW_HTTP__: false,
__TARGET__: 'browser',
cozy: {}
}
}
{
"name": "Cozy Music",
"slug": "music",
"icon": "icon.svg",
"categories": [],
"version": "0.1.0",
"licence": "AGPL-3.0",
"editor": "",
"source": "https://github.com/Schoumi/cozy-music.git@build",
"developer": {
"name": "Schoumi",
"url": ""
},
"routes": {
"/": {
"folder": "/",
"index": "index.html",
"public": false
}
},
"permissions": {
"apps": {
"description": "Required by the cozy-bar to display the icons of the apps",
"type": "io.cozy.apps",
"verbs": ["GET"]
},
"mocks todos": {
"description": "TO REMOVE: only used as demonstration about Cozy App data interactions",
"type": "io.mocks.todos"
}
}
}