All Projects → zurfyx → Angular Library Starter Kit

zurfyx / Angular Library Starter Kit

Licence: mit
Angular 5 Library Starter Kit based on Angular-CLI

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Angular Library Starter Kit

Ngx Smart Modal
Modal/Dialog component crafted for Angular
Stars: ✭ 256 (+631.43%)
Mutual labels:  library, npm, angular5
Typescript Webpack Starter
⚡ create-ts-lib: A Starter Kit and a CLI to create your TypeScript / ES6 module bundled by Webpack without thinking about build or unit tests configurations. 🏠
Stars: ✭ 358 (+922.86%)
Mutual labels:  starter, npm
Length.js
📏 JavaScript library for length units conversion.
Stars: ✭ 292 (+734.29%)
Mutual labels:  library, npm
Use React Router
React Hook for pub-sub behavior using React Router.
Stars: ✭ 575 (+1542.86%)
Mutual labels:  npm, travis-ci
noise-php
A starter-kit for your PHP project.
Stars: ✭ 52 (+48.57%)
Mutual labels:  travis-ci, starter
aurelia-typescript-webpack-starter
A minimal Aurelia starter kit written in TypeScript and built using webpack.
Stars: ✭ 28 (-20%)
Mutual labels:  kit, starter
Fetch Suspense
A React hook compatible with React 16.6's Suspense component.
Stars: ✭ 479 (+1268.57%)
Mutual labels:  npm, travis-ci
Dotfiles
Configuration files for XMonad, Emacs, NixOS, Taffybar and more.
Stars: ✭ 127 (+262.86%)
Mutual labels:  github-pages, travis-ci
Lass
👧 Lass scaffolds a modern package boilerplate for Node.js
Stars: ✭ 615 (+1657.14%)
Mutual labels:  starter, npm
Rando.js
The world's easiest, most powerful random function.
Stars: ✭ 659 (+1782.86%)
Mutual labels:  library, npm
Functions.js
📦 A hub of numerous functions with various functionalities
Stars: ✭ 22 (-37.14%)
Mutual labels:  library, npm
originator
🌱 es6 starter - babel, tape, zuul, npm scripts
Stars: ✭ 12 (-65.71%)
Mutual labels:  travis-ci, starter
angular5-starter
⭐ An Angular5 Starter Kit :: Router, HttpClient, Forms, Services, Dev/Prod, HMR, Async/Lazy Routes and a very good structure for large applications by @naologic
Stars: ✭ 54 (+54.29%)
Mutual labels:  starter, angular5
Angular Skeleton App
Angular 7.x navigation skeleton project with styling which get you started faster.
Stars: ✭ 25 (-28.57%)
Mutual labels:  starter, angular5
Awesome Github
A curated list of awesome GitHub guides, articles, sites, tools, projects and resources. 收集这个列表,只是为了更好地使用GitHub,欢迎提交pr和issue。
Stars: ✭ 1,962 (+5505.71%)
Mutual labels:  github-pages, travis-ci
React Native Blurhash
🖼️ A library to show colorful blurry placeholders while your content loads.
Stars: ✭ 430 (+1128.57%)
Mutual labels:  library, npm
Angular Library Seed
🌾 Seed project for Angular libraries that are AOT/JIT compatible and that use external SCSS-styles and HTML-templates
Stars: ✭ 197 (+462.86%)
Mutual labels:  starter, library
Typescript Starter
Quickly create and configure a new library or Node.js project
Stars: ✭ 2,953 (+8337.14%)
Mutual labels:  starter, library
Create React Library
React NPM library starter kit based on Facebook's create react app
Stars: ✭ 597 (+1605.71%)
Mutual labels:  library, npm
Preppy
A simple and lightweight tool for preparing the publish of NPM packages.
Stars: ✭ 23 (-34.29%)
Mutual labels:  library, npm

Angular 5 Library Starter Kit

npm Version Build Status

Angular 5 Library Starter Kit based on Angular-CLI.

What you get out of the box

A NPM library such as:

npmjs.com/package/angular-library-starter-kit

Which can be installed and imported as easy as npm install your-library-name and import { MyModule } from 'your-library-name'

A demo page such as:

zurfyx.github.io/angular-library-starter-kit

Features

  • Based on angular-cli
  • Compatibility with Angular CLI, Webpack and SystemJS (built with ng-packgr)
  • Demo project (watch your library result as you develop)
  • Angular tests & E2E tests
  • Travis CI autodeploy to NPM
  • Travis CI demo autodeploy to GitHub Pages

Getting started

git clone https://github.com/zurfyx/angular-library-start-kit
npm install
npm start

Write your package metadata

Make this library yours. Edit package.json, .angular-cli.json and .travis.yml and replace all ocurrences of angular-library-starter-kit with your-module-name (make sure it doesn't exist on NPM yet).

For the package.json -> build-gh-pages make sure to change zurfyx with your GitHub name or organization name. It will be used to later deploy your demo page onto GitHub pages.

Same thing has to be done with .travis.yml -> after_sucess. We'll get into secure tokens in Setting up Continuous Integration.

Write your module

Edit src/ with your library contents. The current taggify.module.ts, taggify.pipe.ts, taggify.pipe.spec.ts and index.ts should be edited with your module stuff.

Everything you want the target users to be able to import directly should be added into index.ts. Remember that shared components or pipes should be written both into declarations and exports when defining your module.

Write your module demo

Edit example/app files just like if it was a normal angular-cli site. You might want to make use of import { YourModule } from '../../src' at some point to proof that your library works as expected.

Test your module

You can write both e2e test over your demo site, and unit tests on either the src and example/app.

You might want to check e2e/app.e2e-spec.ts and src/taggify.pipe.spec.ts as examples.

Upload your module onto NPM

This process can be done automatically with Travis CI. See Autodeploy to NPM.

npm run build

Browser into the dist/ folder, where the result is stored and publish it into NPM.

cd dist
npm publish

Your module should now be up and ready!

Folder structure

For the most part, the folder structure is identical to angular-cli's one.

|- example/app Your demo application (GH pages)
|- src All your library source code, which will get packaged and distributed.

Setting up Continuous Integration

While you can use any CI of your choice, Travis CI is already set up to do the demo deployment onto GitHub Pages and library into NPM for you.

Read over Write your package metadata first, if you haven't already.

First of all, activate Travis on your GitHub repository. You can do so on your Travis profile.

Autodeploy to GitHub Pages

In order to deploy to GitHub Pages we need a GitHub token of yours.

Generate a token here. Scopes: [x] repo.

Encrypt the token. On your source code folder run the following command:

travis encrypt GH_TOKEN=your_token_here

The result should be copy-pasted into env -> global -> secure.

Autodeploy to NPM

A similar thing to GitHub Pages can be done with NPM.

Generate a token with npm token create.

Encrypt the token. On your source code folder run the following command:

travis encrypt your_token_here

The result should be copy-pasted into deploy -> api_key -> secure.

Built with Angular Library Starter Kit

License

MIT © Gerard Rovira Sánchez

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].