Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@manekinekko/angular-library-starter

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@manekinekko/angular-library-starter

A Minimalist Starter for Angular (>=2) libraries with JIT and AOT support

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Build status CircleCI

🎩 Minimalist Angular Library Starter

This is a minimalist starter if you need to (quickly) create and ship a library for your Angular (v2+) applications.

Most Important Files

package.json
{
    "name": "@manekinekko/angular-library-starter",
    "version": "1.0.0",
    "main": "dist/index.js",
    "types": "dist/index.d.ts",
    "private": false,
    "scripts": {
        "build:aot": "ngc -p tsconfig.json",
    },
    //...
}
tsconfig.json
{
    "compilerOptions": {
        "target": "es5",
        "module": "es2015",
        "moduleResolution": "node",
        "declaration": true,
        "noImplicitAny": false,
        "sourceMap": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "skipLibCheck": true,
        "typeRoots": ["./node_modules/@types"],
        "types": ["node"],
        "lib": ["dom", "es2015"]
    },
    
    // this is for the AOT compiler
    "angularCompilerOptions": {
        "genDir": "tmp",
        "entryModule": "src/lib/app.module#AppModule"
    },
    //...
}

Using you library in another project

yarn or npm it in your package.json

"dependencies": {
  "@angular/common": "^2.3.1",
  "@angular/compiler": "^2.3.1",
  "@angular/core": "^2.3.1",
  //...
  "@manekinekko/angular-library-starter": "^1.0.0",
},
//...

import the AppModule from the library

import { NgModule } from '@angular/core';
import { AppModule } from '@manekinekko/angular-library-starter';

@NgModule({
  imports: [
    AppModule.forRoot()
  ],
  //...
})
export class AppModule { }

use it anywhere in your NgModules

import { Component } from '@angular/core';
import { AppService } from '@manekinekko/angular-library-starter';

// AppService and AppPipe are imported by the AppModule

@Component({
  selector: 'app-root',
  template: `
   {{ text | truncate }}
   <angular-library-component></angular-library-component>
  `
})
export class AppComponent {
  text = 'Lorem ipsum dolor sit amet';
  constructor(as: AppService) {
    this.date = as.getDate().toString();
  }
}

Custom types

If you have custom typings you want to include in your project, use the custom-typings.d.ts for that purpose.

Disclaimers

  1. This starter contains the minimum configuration for your library so it can be shared and used across other projects.
  2. Tests are not included in this starter!
  3. This starter is not compatible with the angular-cli YET.

Have a PR?

All contributions are welcome ;)

License

The MIT License (MIT) Copyright (c) 2017 - Wassim CHEGHAM

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Keywords

FAQs

Package last updated on 19 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc