ng2-sm

1.8.12 • Public • Published

NG2-SM

A tool for managing angular2 based npm modules written in typescript.

Release Information

Release : 1.4.0

Documentation Status : First Draft (Subject To Change)

Build Status : In Development But Stable

Insert Badges Here

Contents

Installation

// Either install globally (Prefered)
npm install -g ng2-sm
 
// or install locally
npm install --save-dev ng2-sm

Basic Usage

1. Create project

Your project should be structured like the following

ROOT/
    |--/ dist // output folder
    |--/ src // target module
       |-- package.json // module package.json
    |-- package.json // root package.json
2. Add some dependencies to our module

a) For Safety: add "private":true to your root package.json b) In our module package.json we should have the dependencies and peer dependencies of our module. Example module package.json

{
  "name": "ng2-bootstrap",
  "dependencies": {
    "moment": "*"
  },
  "peerDependencies": {
    "@angular/common": "*",
    "@angular/compiler": "*",
    "@angular/core": "*",
    "@angular/forms": "*"
  }
}
3. Adding advanced configuration options

(Coming Soon) Since every project is different there is a need for an option configuration to override some defaults or add addition configuration to webpack module builder, for these reasons there will be an addition configuration kept in either one of three locations.

Current options include:

  • package.json | Already within scope and easily implemented
  • addition json | An addition configuration file just for ng2-sm
  • within our angular cli configuration | Already within scope however not all packages will use angular-cli
4. Running NG2-SM

If you have NG2-SM globally installed then you can simply move to the root of your project(s) and run ng2-sm as follows

ng2-sm build -p src

alternatively use an npm script to use a local or global version on NG2-SM

{
  "scripts": {
    "build": "ng2-sm build -p src"
  }
}
  1. Now you can go to dist folder and do npm publish (will be added as a command later)

Commands & Flags

Build - Build our sub module from src to dist
 --watch   -w       | Watch our src folders
 --clean   -c       | Clean our target before new build
 --local   -l       | Use local dependency number (Mainly for publishing)
 --umd     -u       | Create UMD bundles for modules
 --main             | Specify a main entry point for UMD bundle
Link - Link our sub module for testing, development or usage
 --local   -l       | Use local dependency number (Mainly for publishing)
 --deep             | Will Update Later
 --yarn             | Will Update Later
 --here             | Will Update Later
Version - Update our sub module version
 --message          | Will Update Later
 --git-tag-version  | Will Update Later
 --yarn             | Will Update Later
 --skip-push        | Will Update Later
Dist Tag - Add a dist tag to our module
 --yarn             | Will Update Later
Publish - Publish our module to npm and git
 --tag              | Will Update Later
 --access           | Will Update Later
 --any-branch       | Will Update Later
 --skip-cleanup     | Will Update Later
 --skip-git-check   | Will Update Later
 --yarn             | Will Update Later
 --yolo             | Will Update Later
 --skip-publish     | Will Update Later

Contributing

Will Update Later

Contributors

Jay Demitri

Bugs and Feature Requests

Will Update later

Copyright and license

Code and documentation (c) Copyright 2016 Jay Demitri and London Development Studio.

Code released under the MIT License.

Docs released under Creative Commons.

Readme

Keywords

none

Package Sidebar

Install

npm i ng2-sm

Weekly Downloads

11

Version

1.8.12

License

MIT

Last publish

Collaborators

  • london-development-studio