@@ -76,26 +76,27 @@ include ../_util-fns
7676 A library should have the following file layout when published:
7777
7878.filetree
79- .file node_modules/library-name
79+ .file node_modules/angular- library-name
8080.children
81- .file dist
82- .children
83- .file library-subfolders/...
84- .file library-name.d.ts ('typings')
85- .file library-name.es5.js ('module')
86- .file library-name.js ('es2015')
87- .file library-name.metadata.json
88- .file library-name.umd.js ('main')
89- .file library-name.umd.min.js
90- .file index.d.ts
91- .file module.d.ts
81+ .file bundles
82+ .children
83+ .file angular-library-name.umd.js ('main' entry point)
84+ .file angular-library-name.umd.js.map
85+ .file angular-library-name.umd.min.js
86+ .file angular-library-name.umd.min.js.map
87+ .file src/*.d.ts
88+ .file angular-library-name.d.ts ('typings' entry point)
89+ .file angular-library-name.es5.js ('module' entry point)
90+ .file angular-library-name.es5.js.map
91+ .file angular-library-name.js ('es2015' entry point)
92+ .file angular-library-name.js.map
93+ .file angular-library-name.metadata.json
94+ .file index.d.ts
9295 .file LICENSE
93- .file package.json
96+ .file package.json (lists all entry points)
9497 .file README.md
9598
9699
97-
98-
99100:marked
100101 There is also a minified UMD bundle (`angular-quickstart-lib.umd.min.js`) for smaller payloads
101102 in Plunkers and script tags.
@@ -195,29 +196,31 @@ a#seed
195196 .file app.module.ts
196197 .file lib
197198 .children
198- .file component
199- .children
200- .file lib.component.ts
201- .file service
199+ .file src
202200 .children
203- .file lib.service.ts
201+ .file component
202+ .children
203+ .file lib.component.ts
204+ .file service
205+ .children
206+ .file lib.service.ts
207+ .file module.ts
204208 .file index.ts
205- .file module.ts
206209
207210+ makeTabs(`
208211 quickstart-lib/ts/src/demo/app/app.component.ts,
209212 quickstart-lib/ts/src/demo/app/app.module.ts,
210- quickstart-lib/ts/src/lib/component/lib.component.ts,
211- quickstart-lib/ts/src/lib/service/lib.service.ts,
213+ quickstart-lib/ts/src/lib/src/component/lib.component.ts,
214+ quickstart-lib/ts/src/lib/src/service/lib.service.ts,
215+ quickstart-lib/ts/src/lib/src/module.ts
212216 quickstart-lib/ts/src/lib/index.ts,
213- quickstart-lib/ts/src/lib/module.ts
214217 ` , '' , `
215218 src/demo/app/app.component.ts,
216219 src/demo/app/app.module.ts,
217- src/lib/component/lib.component.ts,
218- src/lib/service/lib.service.ts,
219- src/lib/index .ts,
220- src/lib/module .ts
220+ src/lib/src/ component/lib.component.ts,
221+ src/lib/src/ service/lib.service.ts,
222+ src/lib/src/module .ts,
223+ src/lib/index .ts
221224 ` )( format ='.' )
222225
223226:marked
@@ -254,25 +257,25 @@ table(width="100%")
254257 :marked
255258 A demo `NgModule` that imports the Library `LibModule`.
256259 tr
257- td <ngio-ex >lib/component/app.component.ts</ngio-ex >
260+ td <ngio-ex >lib/src/ component/app.component.ts</ngio-ex >
258261 td
259262 :marked
260263 A sample library component that renders an `<h2>` tag.
261264 tr
262- td <code >lib/service/lib.service.ts</code >
265+ td <code >lib/src/ service/lib.service.ts</code >
263266 td
264267 :marked
265268 A sample library service that exports a value.
266269 tr
267- td <code >lib/index .ts</code >
270+ td <code >lib/src/module .ts</code >
268271 td
269272 :marked
270- The public API of your library, where you choose what to export to consumers .
273+ The library's main `NgModule`, `LibModule` .
271274 tr
272- td <code >lib/module .ts</code >
275+ td <code >lib/index .ts</code >
273276 td
274277 :marked
275- The library's main `NgModule`, `LibModule` .
278+ The public API of your library, where you choose what to export to consumers .
276279
277280
278281.l-main-section
@@ -288,6 +291,7 @@ table(width="100%")
288291 - Inline html and css inside the generated JavaScript files.
289292 - Copy typings, metatada, html and css.
290293 - Create each bundle using Rollup.
294+ - Copy `LICENSE`, `package.json` and `README.md` files
291295
292296
293297.l-main-section
@@ -322,15 +326,13 @@ table(width="100%")
322326
323327 You can also test your library by installing it in another local repository you have.
324328 To do so, first build your lib via `npm run build`.
325- Then install it from your other repo using a relative path: `npm install relative/path/to/lib`.
329+ Then install it from your other repo using a relative path to the dist folder:
330+ `npm install relative/path/to/library/dist`.
326331
327332.l-main-section
328333:marked
329334 ## Publishing your library
330335
331- The `.npmignore` file defines what files and folders will be published to NPM: `dist/`,
332- `LICENSE`, `package.json` and `README.md`.
333-
334336 Every package on NPM has a unique name, and so should yours.
335337 If you haven't already, now is the time to change the name of your library.
336338
@@ -358,8 +360,9 @@ table(width="100%")
358360 After you have changed the package name, you can publish it to NPM (read
359361 [this link](https://docs.npmjs.com/getting-started/publishing-npm-packages) for details).
360362
361- You'll need to create a NPM account, login on your local machine, and then you can publish updated
362- by running `npm publish`.
363+ First you'll need to create a NPM account and login on your local machine.
364+ Then you can publish your package by running `npm publish dist/`.
365+ Since your package is built on the `dist/` folder this is the one you should publish.
363366
364367.l-sub-section
365368 :marked
0 commit comments