generator-angular2-library | Yeoman generator to create an Angular library | Generator Utils library

 by   jvandemo JavaScript Version: Current License: MIT

kandi X-RAY | generator-angular2-library Summary

kandi X-RAY | generator-angular2-library Summary

generator-angular2-library is a JavaScript library typically used in Generator, Generator Utils, Angular, Webpack applications. generator-angular2-library has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can install using 'npm i generator-ng-cli-lib' or download it from GitHub, npm.

Yeoman generator to create a standalone Angular library in seconds. If you want to create an Angular library with directives, services and/or pipes, then this generator is just what you need. This generator aligns with the official Angular Package Format and automatically generates a Flat ES Module, a UMD bundle, a single metadata.json and type definitions to make your library ready for AOT compilation by the consuming Angular application. Watch Jason Aden's talk to learn more about the Angular Package Format.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              generator-angular2-library has a low active ecosystem.
              It has 757 star(s) with 124 fork(s). There are 35 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 79 open issues and 170 have been closed. On average issues are closed in 32 days. There are 7 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of generator-angular2-library is current.

            kandi-Quality Quality

              generator-angular2-library has 0 bugs and 0 code smells.

            kandi-Security Security

              generator-angular2-library has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              generator-angular2-library code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              generator-angular2-library is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              generator-angular2-library releases are not available. You will need to build from source code and install.
              Deployable package is available in npm.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed generator-angular2-library and discovered the below as its top functions. This is intended to give you an instant insight into generator-angular2-library implemented functionality, and help decide if they suit your requirements.
            • Traverse all templates and inline scripts .
            • Traverse inline stylesheet to inline content files
            • Build s css .
            • Turn a promise into a function .
            • Traverse inline content in a template directory .
            • Inspects text from a string .
            • Remove module id .
            • Delete a folder
            Get all kandi verified functions for this library.

            generator-angular2-library Key Features

            No Key Features are available at this moment for generator-angular2-library.

            generator-angular2-library Examples and Code Snippets

            No Code Snippets are available at this moment for generator-angular2-library.

            Community Discussions

            QUESTION

            Custom Angular Library Import multiple Modules not barrel
            Asked 2019-Jan-18 at 20:18

            Hi I am trying to build a custom Angular Library. Using yeoman-generator (link) I get a template to build upon, that works just fine. The problem is that it uses a (not anymore best practice) barrel index.ts, and what I want is to be able to have one module per component and import accordingly.

            ...

            ANSWER

            Answered 2017-Sep-07 at 05:28

            In case someone faces the same problem, here is how my files are now structured and connected:

            I have a component with the desired functionality HelloWorld

            Then a module for this component:

            Source https://stackoverflow.com/questions/46075235

            QUESTION

            Errors when using MomentJS in Angular Typescript library
            Asked 2019-Jan-05 at 12:20

            I'm building an Angular (2+) component library using jvandemo/generator-angular2-library as a starter, which uses Rollup as a module builder. The component I am creating in the library uses MomentJS.

            I've had various build issues with the inclusion of MomentJS.

            I first used import moment from 'moment'; to import moment into the component, but that produces the following error at build;

            ...

            ANSWER

            Answered 2017-Oct-25 at 21:59

            In the sample directive I had no problem compiling when I used the following:

            Source https://stackoverflow.com/questions/46876541

            QUESTION

            --prod Build giving warnings and deployed app not loading after upgrading to Angular 7
            Asked 2018-Oct-30 at 06:40

            I recently upgraded an existing Angular 6 App to Angular 7. Most of my App was built on Angular 6 and then I upgraded it.

            Here's my package.json:

            ...

            ANSWER

            Answered 2018-Oct-30 at 06:40

            I had the same WARNINGS and ERROR after upgrade from Angular 6 to Angular 7. I have deleted my node_modules folder then npm install again. Now the compilation succeeds without warnings and I have no more the error "Uncaught TypeError: e is not a constructor".

            Source https://stackoverflow.com/questions/52975243

            QUESTION

            Angular Library is not running ngOnInit when used
            Asked 2018-Jun-08 at 03:26

            I'm following the Angular CLI 6 instructions for creating a library here. I was able to make my library, and build it successfully. The library consists of a Component I am using for the UI and has an HTML selector.

            ...

            ANSWER

            Answered 2018-Jun-08 at 03:26

            Only issue i see is that your instance of the service also has the same name, change it as

            Source https://stackoverflow.com/questions/50752687

            QUESTION

            Angular 4 Library @Input
            Asked 2018-Mar-07 at 09:10

            Hi guys I need a bit of help, as I can't seem to get it to work. I think I might be using the incorrect syntax or something.

            I am currently building Angular 4 libraries using YO https://github.com/jvandemo/generator-angular2-library

            So everything is working except for the @Input decorators.

            Some simple code here

            ...

            ANSWER

            Answered 2018-Mar-07 at 09:10

            QUESTION

            Angular 2 external lib error
            Asked 2017-Nov-16 at 20:51

            I generate my angular 2 lib with yeoman generator and added to main angular project. If i compile app in dev mode i haven't error, but if i run prod mode, i get many errors:

            ...

            ANSWER

            Answered 2017-Nov-16 at 20:51

            Your intent was probably to export just what is needed, but you need to export everything from your src/index.ts file, including all the services, directives, and pipes.

            Source https://stackoverflow.com/questions/45615528

            QUESTION

            Setting up Karma for an angular library
            Asked 2017-Oct-18 at 19:13

            I am currently building an Angular library, and I wanted to be able to run some tests. After following these instructions I managed to set up everything properly and actually be able to run my tests.

            Main question

            Although everything runs properly something awkward happens. When I run npm test next to every .ts file a .js file is generated. Normally all the d.ts and the one big .js files go inside a dist folder that projects using the library use. So does anyone know from where could these javascript files are generated, and if they are indeed needed, since all this code already exists so to speak in the dist folder.

            Bonus question

            Not as important as the above, all the test results are displayed in the terminal, whereas the browser displays only:

            Karma v1.4.1 - connected Chrome 61.0.3163 (Mac OS X 10.12.6) is idle

            So is there a nice fix to display my test as nicely as the angular-cli does out of the box?

            Note that after doing my homework I did not find something relative online, and I don't want to upload a bunch of unpleasant jsons. If anyone has an idea on the direction of the problem I will be happy to include code.

            The basic structure of my library was generated by this

            Edit: karma.config.js

            ...

            ANSWER

            Answered 2017-Oct-18 at 16:06

            You are getting .js file for every .ts file because of your typescript configuration. You can change your configuration in tsconfig.json to tell compiler that write a single file or in a folder and add all script there.

            "outDir": "../out-tsc/spec" --> will add all output javascript files in a single folder.

            For your second question, When karma runs internally it runs webdriver and connect to the browser. That is the reason you see localhost:9876 or similar url open with a debug button at the right.

            While the webdriver is running you can also debug any bug situation in the browser and lot more.

            Source https://stackoverflow.com/questions/46813971

            QUESTION

            Create Angular 2 component library without inline styles
            Asked 2017-Sep-22 at 03:57

            I red this article about creating Angular 2 component library, and it uses inline styles. Is there a way to create a lib without inline styles in Angular 2?

            Also I saw this, but there is no word about styles, css.

            My problem is, I want to create a complex component with multiple components in it and I use SASS also.

            ...

            ANSWER

            Answered 2017-Sep-22 at 03:57

            The problem here is that when you compile your npm package the styles templates must be inline because when you load it as a npm package you won't be able to achieve the template/css path inside node_modules.

            The Angular Material 2 team used the follow gulp task to inline the css and template in its components:

            They have created this task file that

            1. Get external CSS and put inline;
            2. Get external Html and put inline;
            3. Removes the module.id from components;

            Finally, in the build process they call this task here.

            My approach of doing this:
            1. Install gulp, gulp-angular-embed-templates, gulp-inline-ng2-styles.

            2. Create a file called gulpfile.js at the root of your app

            3. add the following code to your gulpfile:

            Source https://stackoverflow.com/questions/41550388

            QUESTION

            Can't Resolve NPM Dependencies in Shared Angular 2 Library
            Asked 2017-Jul-27 at 16:03

            I am trying to create an Angular 2 library for services, components, and models I want to share between 3-4 different interfaces/apps that are frontends to the same database.

            I am using the very helpful Angular 2 generator library here.

            My services in the library are based around Apollo client and GraphQL.

            However, when I symlink the library build to import into my main project, the Apollo dependencies don't seem to resolve.

            I get the following two errors from my app build: Can't resolve 'apollo-angular/index' and Can't resolve 'graphql-tag/index'. This is in spite of the fact that both these libraries are installed to my node_modules in my app, however, they don't seem to transferred by the Gulp build into my dist directory of my library but I am not even sure they are meant to be.

            I have also tried to setup peer dependencies in my library's package.json as follows:

            ...

            ANSWER

            Answered 2017-Jul-27 at 16:03

            It might occur because of this issue.

            Try to define paths in your ts

            Source https://stackoverflow.com/questions/45319138

            QUESTION

            TsickleCompilerHost gives error when running ngc on Angular4 library
            Asked 2017-Jun-12 at 14:40

            I'm currently working on exporting an Angular 4 component library in the format described by the Angular Package Format. To simplify this, I generated a default setup using this Yeoman generator. Everything worked perfectly at first and I could generate a working library that I could import in another Angular application. I then updated our library files after fetching all the latest changes and tried to generate a new package. The build failed this time however, with an error that I couldn't link to one of the changes that I fetched.

            The message:

            ...

            ANSWER

            Answered 2017-Jun-12 at 14:40

            Turned out that a path in a // comment was being replaced during the build which caused it to point to a non-existing file. That led to the TsickleCompilerHost not finding a file, which in turn led to an undefined source file. Hence the TypeError: Cannot read property 'path' of undefined message.

            Source https://stackoverflow.com/questions/44435521

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install generator-angular2-library

            First, install Yeoman and generator-angular2-library using npm (assuming you already have node.js pre-installed).

            Support

            From the root of your library directory, run:. This will generate a docs directory with all documentation of your library.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/jvandemo/generator-angular2-library.git

          • CLI

            gh repo clone jvandemo/generator-angular2-library

          • sshUrl

            git@github.com:jvandemo/generator-angular2-library.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link