- Code Contributions
- Running Local Development Server
- Running Production Build
- Build Desktop Apps
- Localization
Fork the project on GitHub and check out your copy locally.
$ git clone git@github.com:yourusername/cnc.git
$ cd cnc
$ git remote add upstream git://github.com/cheton/cnc.git
Create a feature branch and before starting:
$ git checkout -b my-feature-branch -t origin/master
Run npm install
to install the dependencies in the local node_modules folder:
$ npm install -g npm # Install npm v3
$ npm install
Make sure git knows your name and email address:
$ git config --global user.name "User Name"
$ git config --global user.email "user.email@example.com"
Writing good commit logs is important. A commit log should describe what changed and why.
Use git rebase
(not git merge
) to sync your work from time to time.
$ git fetch upstream
$ git rebase upstream/master
Run npm run build
to make sure the build succeed:
$ npm run build
$ git push origin my-feature-branch
Go to https://github.com/yourusername/cnc and select your feature branch. Click on the New pull request button and fill out the form.
Make sure you have Node.js 4 or later verions installed, and run npm run dev
to start a local development server for development and testing. Every code changes will trigger webpack Hot Module Replacement (HMR) which will be really useful while developing in React.
$ npm install # Ensure that packages are installed
$ npm run dev # It may take several minutes...
: : :
Server is listening on 0.0.0.0:8000
Connect to http://localhost:8000 and wait until bundle finished.
webpack: wait until bundle finished: /__webpack_hmr
: : :
webpack: bundle is now VALID
Now you're ready to go!
$ npm install # Ensure that packages are installed
$ npm run prepublish
$ ./bin/cnc -vv
: : :
Server is listening on 0.0.0.0:8000
$ npm install # Ensure that packages are installed
$ npm run prepublish && npm run build:osx-x64
$ ls -al output/osx/
$ npm install # Ensure that packages are installed
$ npm run prepublish && npm run build:win-ia32
$ ls -al output/win-ia32/
$ npm install # Ensure that packages are installed
$ npm run prepublish && npm run build:win-x64
$ ls -al output/win/
$ npm install # Ensure that packages are installed
$ npm run prepublish && npm run build:linux-ia32
$ ls -al output/linux-ia32/
$ npm install # Ensure that packages are installed
$ npm run prepublish && npm run build:linux-x64
$ ls -al output/linux/
Find all resource strings stored in the resource.json file, which is located in the src/web/i18n directory. You can create a pull request to submit your changes.
Moreover, you can make translations during runtime by modifying resource.json from the installed directory. Note that your path may differ based on the Node installation path you have in place.
$ cd $(dirname `which cnc`)/../lib/node_modules/cncjs/dist/web/i18n/
$ pwd
/home/cheton/.nvm/versions/node/v4.4.3/lib/node_modules/cncjs/dist/web/i18n
To verify your changes during runtime, it's recommended that you open Developer Tools and disable browser cache. For example:
Now you can modify resource strings in the dist/cnc/web/i18n directory and refresh your browser to see the updates.
Note that you should not close DevTools to make sure your browser won't cache anything.