Skip to content

Instantly share code, notes, and snippets.

@Amitesh
Last active May 15, 2018 17:05
Show Gist options
  • Save Amitesh/91fdba9e8d6bc36792c6615b11fdcb95 to your computer and use it in GitHub Desktop.
Save Amitesh/91fdba9e8d6bc36792c6615b11fdcb95 to your computer and use it in GitHub Desktop.
Steps to create a angular 6 project with lib
Amiteshs-MacBook-Pro:fiserv amitesh$ ng new simpleNgxDatagrid --directory simple-ngx-datagrid
CREATE simple-ngx-datagrid/README.md (1034 bytes)
CREATE simple-ngx-datagrid/angular.json (3492 bytes)
CREATE simple-ngx-datagrid/package.json (1323 bytes)
CREATE simple-ngx-datagrid/tsconfig.json (384 bytes)
CREATE simple-ngx-datagrid/tslint.json (2805 bytes)
CREATE simple-ngx-datagrid/.editorconfig (245 bytes)
CREATE simple-ngx-datagrid/.gitignore (503 bytes)
CREATE simple-ngx-datagrid/src/environments/environment.prod.ts (51 bytes)
CREATE simple-ngx-datagrid/src/environments/environment.ts (631 bytes)
CREATE simple-ngx-datagrid/src/favicon.ico (5430 bytes)
CREATE simple-ngx-datagrid/src/index.html (304 bytes)
CREATE simple-ngx-datagrid/src/main.ts (370 bytes)
CREATE simple-ngx-datagrid/src/polyfills.ts (3194 bytes)
CREATE simple-ngx-datagrid/src/test.ts (642 bytes)
CREATE simple-ngx-datagrid/src/assets/.gitkeep (0 bytes)
CREATE simple-ngx-datagrid/src/styles.css (80 bytes)
CREATE simple-ngx-datagrid/src/browserslist (375 bytes)
CREATE simple-ngx-datagrid/src/karma.conf.js (964 bytes)
CREATE simple-ngx-datagrid/src/tsconfig.app.json (194 bytes)
CREATE simple-ngx-datagrid/src/tsconfig.spec.json (282 bytes)
CREATE simple-ngx-datagrid/src/tslint.json (314 bytes)
CREATE simple-ngx-datagrid/src/app/app.module.ts (314 bytes)
CREATE simple-ngx-datagrid/src/app/app.component.css (0 bytes)
CREATE simple-ngx-datagrid/src/app/app.component.html (1141 bytes)
CREATE simple-ngx-datagrid/src/app/app.component.spec.ts (986 bytes)
CREATE simple-ngx-datagrid/src/app/app.component.ts (207 bytes)
CREATE simple-ngx-datagrid/e2e/protractor.conf.js (752 bytes)
CREATE simple-ngx-datagrid/e2e/src/app.e2e-spec.ts (299 bytes)
CREATE simple-ngx-datagrid/e2e/src/app.po.ts (208 bytes)
CREATE simple-ngx-datagrid/e2e/tsconfig.e2e.json (213 bytes)
> fsevents@1.2.3 install /Users/amitesh/ahome/projects/fiserv/simple-ngx-datagrid/node_modules/fsevents
> node install
[fsevents] Success: "/Users/amitesh/ahome/projects/fiserv/simple-ngx-datagrid/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
> node-sass@4.9.0 install /Users/amitesh/ahome/projects/fiserv/simple-ngx-datagrid/node_modules/node-sass
> node scripts/install.js
Cached binary found at /Users/amitesh/.npm/node-sass/4.9.0/darwin-x64-57_binding.node
> node-sass@4.9.0 postinstall /Users/amitesh/ahome/projects/fiserv/simple-ngx-datagrid/node_modules/node-sass
> node scripts/build.js
Binary found at /Users/amitesh/ahome/projects/fiserv/simple-ngx-datagrid/node_modules/node-sass/vendor/darwin-x64-57/binding.node
Testing binary
Binary is fine
> @angular/cli@6.0.1 postinstall /Users/amitesh/ahome/projects/fiserv/simple-ngx-datagrid/node_modules/@angular/cli
> node ./bin/ng-update-message.js
added 1148 packages in 25.319s
Directory is already under version control. Skipping initialization of git.
Amiteshs-MacBook-Pro:fiserv amitesh$ ng new simpleNgxDatagrid --directory simple-ngx-datagrid --prefix adl
CREATE simple-ngx-datagrid/README.md (1034 bytes)
CREATE simple-ngx-datagrid/angular.json (3492 bytes)
CREATE simple-ngx-datagrid/package.json (1323 bytes)
CREATE simple-ngx-datagrid/tsconfig.json (384 bytes)
CREATE simple-ngx-datagrid/tslint.json (2805 bytes)
CREATE simple-ngx-datagrid/.editorconfig (245 bytes)
CREATE simple-ngx-datagrid/.gitignore (503 bytes)
CREATE simple-ngx-datagrid/src/environments/environment.prod.ts (51 bytes)
CREATE simple-ngx-datagrid/src/environments/environment.ts (631 bytes)
CREATE simple-ngx-datagrid/src/favicon.ico (5430 bytes)
CREATE simple-ngx-datagrid/src/index.html (304 bytes)
CREATE simple-ngx-datagrid/src/main.ts (370 bytes)
CREATE simple-ngx-datagrid/src/polyfills.ts (3194 bytes)
CREATE simple-ngx-datagrid/src/test.ts (642 bytes)
CREATE simple-ngx-datagrid/src/assets/.gitkeep (0 bytes)
CREATE simple-ngx-datagrid/src/styles.css (80 bytes)
CREATE simple-ngx-datagrid/src/browserslist (375 bytes)
CREATE simple-ngx-datagrid/src/karma.conf.js (964 bytes)
CREATE simple-ngx-datagrid/src/tsconfig.app.json (194 bytes)
CREATE simple-ngx-datagrid/src/tsconfig.spec.json (282 bytes)
CREATE simple-ngx-datagrid/src/tslint.json (314 bytes)
CREATE simple-ngx-datagrid/src/app/app.module.ts (314 bytes)
CREATE simple-ngx-datagrid/src/app/app.component.css (0 bytes)
CREATE simple-ngx-datagrid/src/app/app.component.html (1141 bytes)
CREATE simple-ngx-datagrid/src/app/app.component.spec.ts (986 bytes)
CREATE simple-ngx-datagrid/src/app/app.component.ts (207 bytes)
CREATE simple-ngx-datagrid/e2e/protractor.conf.js (752 bytes)
CREATE simple-ngx-datagrid/e2e/src/app.e2e-spec.ts (299 bytes)
CREATE simple-ngx-datagrid/e2e/src/app.po.ts (208 bytes)
CREATE simple-ngx-datagrid/e2e/tsconfig.e2e.json (213 bytes)
> fsevents@1.2.3 install /Users/amitesh/ahome/projects/fiserv/simple-ngx-datagrid/node_modules/fsevents
> node install
[fsevents] Success: "/Users/amitesh/ahome/projects/fiserv/simple-ngx-datagrid/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
> node-sass@4.9.0 install /Users/amitesh/ahome/projects/fiserv/simple-ngx-datagrid/node_modules/node-sass
> node scripts/install.js
Cached binary found at /Users/amitesh/.npm/node-sass/4.9.0/darwin-x64-57_binding.node
> node-sass@4.9.0 postinstall /Users/amitesh/ahome/projects/fiserv/simple-ngx-datagrid/node_modules/node-sass
> node scripts/build.js
Binary found at /Users/amitesh/ahome/projects/fiserv/simple-ngx-datagrid/node_modules/node-sass/vendor/darwin-x64-57/binding.node
Testing binary
Binary is fine
> @angular/cli@6.0.1 postinstall /Users/amitesh/ahome/projects/fiserv/simple-ngx-datagrid/node_modules/@angular/cli
> node ./bin/ng-update-message.js
added 1148 packages in 26.473s
Directory is already under version control. Skipping initialization of git.
Amiteshs-MacBook-Pro:fiserv amitesh$ cd simple-ngx-datagrid/
Amiteshs-MacBook-Pro:simple-ngx-datagrid amitesh$
Amiteshs-MacBook-Pro:simple-ngx-datagrid amitesh$ ng generate library adl-ngx --prefix adl
CREATE projects/adl-ngx/karma.conf.js (968 bytes)
CREATE projects/adl-ngx/ng-package.json (183 bytes)
CREATE projects/adl-ngx/ng-package.prod.json (152 bytes)
CREATE projects/adl-ngx/package.json (167 bytes)
CREATE projects/adl-ngx/src/public_api.ts (159 bytes)
CREATE projects/adl-ngx/src/test.ts (700 bytes)
CREATE projects/adl-ngx/tsconfig.lib.json (769 bytes)
CREATE projects/adl-ngx/tsconfig.spec.json (246 bytes)
CREATE projects/adl-ngx/tslint.json (317 bytes)
CREATE projects/adl-ngx/src/lib/adl-ngx.module.ts (225 bytes)
CREATE projects/adl-ngx/src/lib/adl-ngx.component.spec.ts (629 bytes)
CREATE projects/adl-ngx/src/lib/adl-ngx.component.ts (258 bytes)
CREATE projects/adl-ngx/src/lib/adl-ngx.service.spec.ts (375 bytes)
CREATE projects/adl-ngx/src/lib/adl-ngx.service.ts (135 bytes)
UPDATE angular.json (4718 bytes)
UPDATE package.json (1456 bytes)
UPDATE tsconfig.json (455 bytes)
added 112 packages in 10.75s
Amiteshs-MacBook-Pro:simple-ngx-datagrid amitesh$ ng generate component datagrid --project=adl-ngx
CREATE projects/adl-ngx/src/lib/datagrid/datagrid.component.css (0 bytes)
CREATE projects/adl-ngx/src/lib/datagrid/datagrid.component.html (27 bytes)
CREATE projects/adl-ngx/src/lib/datagrid/datagrid.component.spec.ts (642 bytes)
CREATE projects/adl-ngx/src/lib/datagrid/datagrid.component.ts (277 bytes)
UPDATE projects/adl-ngx/src/lib/adl-ngx.module.ts (311 bytes)
Amiteshs-MacBook-Pro:simple-ngx-datagrid amitesh$
Amiteshs-MacBook-Pro:simple-ngx-datagrid amitesh$ ng build adl-ngx
Building Angular Package
Building entry point 'adl-ngx'
Rendering Stylesheets
Rendering Templates
Compiling TypeScript sources through ngc
Bundling to FESM2015
Bundling to FESM5
Bundling to UMD
Minifying UMD bundle
Copying declaration files
Writing package metadata
Removing scripts section in package.json as it's considered a potential security vulnerability.
Built adl-ngx
Built Angular Package!
- from: /Users/amitesh/ahome/projects/fiserv/simple-ngx-datagrid/projects/adl-ngx
- to: /Users/amitesh/ahome/projects/fiserv/simple-ngx-datagrid/dist/adl-ngx

https://medium.com/@tomsu/how-to-build-a-library-for-angular-apps-4f9b38b0ed11

  • ng new simpleNgxDatagrid --directory simple-ngx-datagrid --prefix adl

    It will create the main application which contain the different libs

  • ng generate library adl-ngx --prefix adl

    Create library project

  • ng generate component datagrid --project=adl-ngx

    Create component in library project

  • ng build adl-ngx

    Build library project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment