proactive-test-pkg
A simple test npm library for Promidea Proactive.
Follow these steps:
- open terminal (command propmpt)
- go to the folder you want to create the package into
- create folder <package-name> e.g. proactive-test-pkg
- go inside <pakage-name> folder - cd proactive-test-pkg
- run
npm init
and set the defaults, name, license, github url, test command etc.; this generates the package.json file
- in VS Code, open folder <package-name>
- create a tsconfig.json file (this one seems OK)
- create a README.md file
- create a src folder
- edit package.json and include at the end the following entry, required for intellisense
"typings": "dist/index.d.ts"
- create your library (add files to src folder, install packages, run tests etc.)
- in terminal, run tsc to build the library; fix potential errors
- publish using npm (from npm reference)
- from the terminal, login into npm
npm loginusername:password:
- inside the <package-name> folder run npm publish
npm publish
- for later updates, run npm version to increase the version in package.json, then publish
npm version 1.0.1
...
npm publish
- consume library
- create your application, for example using aurelia-skeleton (make sure the application is working, install packages, run tests, etc.)
- in the terminal, navigate to the application folder (cd <app-name>)
- run npm install for the package <package-name>
npm install <package-name> --save
or, if using jspm
jspm install npm:<package-name> -y
- import the class or classes you need from the library
;
- write the code to consume the imported classes - intellisense should be available:
; e.expression = 'a + b'; e.arguments =; e.eval; console.loge.result;
- run app, for example using
au watch
, orgulp watch
ornpm run
or whatever; in our example, the evaluator should calculatea + b
where a = 1 and b = 2 and display 3 in the console.