1.0.0 • Published 6 years ago

@drupsys/app v1.0.0

Weekly downloads
1
License
UNLICENSED
Repository
github
Last release
6 years ago

Node Package Starter

A starter project for node packages

1. Git setup

  1. Clone into a desired directory git clone git@github.com:drupsys/node_package_starter.git <package-name>
  2. Run sudo rm -r .git && git init to remove old git repository and create a new one
  3. Open https://github.com create new repository with your package name
  4. Add remote to your git setup with git remote add origin git@github.com:<username>/<repository>.git as instructed on the blank repository's page

2. NPM setup

  1. Run npm init and fill in project details
  2. Run git add ., git commit -m "Initial Commit" and git push -u origin master
  3. Run npm install to install dependencies

3. Circle Ci setup

  1. Open https://circleci.com/add-projects/gh/ find the git your package's git repository and press setup project
  2. Choose Linux OS, Platform 2.0, Language Node
  3. In the Next Steps section go straight to step 5 and press Start Building
  4. The build should fail on the tests section
  5. Circle Ci will need npm access token in order to push packages to your npm account, use the following tutorial to set it up https://circleci.com/docs/1.0/npm-continuous-deployment/

4. Folder setup

The following folder structure is needed in the root of the package for the circle ci deployment pipeline to work

src/
├── tests/
│   ├── some_folder/
│   ├── test_a.spec.ts
│   └── ...
├── some_folder/
├── file_a.ts

Tests should be stored in unit/func folders within the tests folder, each test file must end with *.spec.ts

src/
├── tests/
│   ├── unit/
│   ├── func/ 
...

All other typescript files must be placed in the src folder or other folders withing the src folder but not inside the tests folder