diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000000..112a6ee1f32 --- /dev/null +++ b/.npmignore @@ -0,0 +1,16 @@ +/karma-conf.js +/lingua.cfg +/Makefile +/ngeo_deploy_key +/TODO.md +/npm.mk +/secrets.tar +/secrets.tar.enc +/test/ +/.build/ +/examples/ +/docs/ +/jsdoc/ +/contribs/gmf/examples/ +/contribs/gmf/apps/ +/contribs/gmf/build/ diff --git a/.travis.yml b/.travis.yml index a6914cd7d7c..45a5852f53b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,10 @@ sudo: false language: node_js env: - - CXX=g++-4.8 + global: + - CXX=g++-4.8 + - secure: "l/McmiK4djffT04/+5MxW9sy4yO80Rf6vq+nZb5P647A6pXpPLdoRLGo50CtYRiKnFLiChHk2QxUOspeKuIKE+UQAm9dGmyMgfYkj/jwxIBd0YQqavaGzoWo5U1ZSGKeVd3kJlIaUJyLlnKbBOmFCY00c4JLveAagsV53lbephY=" + addons: apt: sources: @@ -46,6 +49,11 @@ after_success: before_deploy: - export GIT_BRANCH=${TRAVIS_BRANCH} +- .build/python-venv/bin/pip install jsongrep +- echo "_auth = ${NPM_AUTH}" > ~/.npmrc +- echo "email = stephane.brunner@camptocamp.com" >> ~/.npmrc +- ls -l ~/.npmrc +- cat ~/.npmrc deploy: - provider: script @@ -55,6 +63,14 @@ deploy: repo: camptocamp/ngeo all_branches: true node: "0.10" +- provider: script + script: npm publish + skip_cleanup: true + on: + node: "0.10" + repo: camptocamp/ngeo + tags: true + condition: '"`.build/python-venv/bin/jsongrep -e version package.json`" == "${TRAVIS_TAG}"' - &transifex provider: script script: make transifex-send diff --git a/README.md b/README.md index 3a0e62e4fb8..1523751fc97 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,5 @@ # ngeo -[![Travis CI -Status](https://api.travis-ci.org/camptocamp/ngeo.svg?branch=master)](https://travis-ci.org/camptocamp/ngeo) - ngeo is a JS library that aims to ease the development of applications based on [AngularJS](https://angularjs.org/) and [OpenLayers 3](http://openlayers.org). @@ -38,4 +35,7 @@ Other docs: developers. * [Application development guidelines](docs/guidelines.md) – This guide is for application developers using ngeo. -* [Transifex](https://www.transifex.com/camptocamp/ngeo/) – Translation platform +* [npm](https://www.npmjs.com/package/ngeo) – Package on npm. +* [Transifex](https://www.transifex.com/camptocamp/ngeo/) – Translation platform. +* [Travis](https://travis-ci.org/camptocamp/ngeo) – Continus integration. +* [coveralls](https://coveralls.io/github/camptocamp/ngeo) – Test coverage. diff --git a/docs/developer-guide.md b/docs/developer-guide.md index bdc3e53f780..651b5e59254 100644 --- a/docs/developer-guide.md +++ b/docs/developer-guide.md @@ -216,6 +216,14 @@ fdescribe('...', function() { fit('...', function() { ``` +### Create a package on npm + +Set the version in the `package.json` file. + +Create a tag named the same as the version. + +Travis will create a new package on npm. + ### Create a new stabilisation branch When we create a new stabilisation branch we should also duplicate the localisation. diff --git a/package.json b/package.json index bd61ee3242a..e47f06c0d8a 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "ngeo", - "version": "0.0.1", + "version": "0.0.2", "description": "AngularJS OpenLayers 3 Library", "scripts": { - "install": "make -f npm.mk install" + "prepublish": "make -f npm.mk install" }, "repository": { "type": "git", @@ -16,13 +16,11 @@ "bin": { "compile-catalog": "buildtools/compile-catalog.js" }, - "dependencies": { + "devDependencies": { "svg2ttf": "4.0.0", "ttf2eot": "1.3.0", "ttf2woff": "2.0.1", - "async": "1.5.2" - }, - "devDependencies": { + "async": "1.5.2", "angular": "1.5.3", "angular-animate": "1.5.3", "angular-gettext": "2.2.1",