-
Notifications
You must be signed in to change notification settings - Fork 3
Home
André Fernando Araújo de Carvalho edited this page Oct 4, 2019
·
1 revision
To keep generic and easy way to up the Terrabrasilis environment, some utilities require to use. As docker
to mount the environment and manage all services, we are using others ways like NPM modules to make more easy the install and setup Terrabrasilis webmap application.
The current modules to Terrabrasilis are located in: https://github.com/Terrabrasilis
To create and publish module on NPM repository, we did the follow steps:
- Need have Github, Gitlab or Bitbucket and create a public repository to manage the version of source-code;
- The README file need explain the concept and how use that module;
- Need have the LICENSE file to expose the license;
- Need have NPM account and in a terminal execute
npm login
to make login to be possible to publish later; - To work in the source code and publish, it's need:
- Create a local directory;
- Inside it, execute
npm init
; - Fill all informations asked by the npm init wizard. This process will generate the
package.json
in the end; - Create a source module using javascript;
- Add the GIT to manage this directory with:
-
git init
; -
git remote add origin "gitlab, github or bitbucket url repository"
; -
git add .
; -
git commit -m "some message"
; -
git push origin "branch"
;
-
- To publish in the end of the release closed just execute
npm publish --access=public
; - (if want attach
travis-ci
to realize the CI, just create a account there, point to the repository, create into source-code directory a file called.travis.yml
); - If want to tag a release use:
-
git tag "vx.x.x"
; -
git push origin "branch"
;
-
- To see the package on the NPM repository access
https://www.npmjs.com/package/"package_name"
; - To install the module in the application execute
npm i "module"@"version" --save (--save-dev)
ornpm i "module" --save (--save-dev)
;
- https://www.npmjs.com/package/terrabrasilis-api
- https://www.npmjs.com/package/terrabrasilis-jsonix
- https://www.npmjs.com/package/terrabrasilis-util
cd 'path to the npm module'
- execute
npm pack
the npm will package the module like when publish cd 'path to the project'
npm install '/path/npm/module/file-version.tgz'
- Inside the npm module folder, execute:
npm link
. This command will create a global npm link to use; - Go to the project folder and execute
npm link <module_npm_link_name>
. Done, it's working to require in the project; - To remove the link, inside the project, use:
npm unlink --no-save <module_npm_link_name>
; - To remove the global link, inside the module folder, execute:
npm unlink
;