Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

New cb third party lib #3411

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
76c99e9
docs(cb-third-party-lib) create a third party lib
thelgevold Oct 16, 2016
38a9000
addressing PR review items
thelgevold Nov 7, 2016
21bc5eb
minor copy-edits
filipesilva Feb 28, 2017
e1423e7
update example
filipesilva Mar 2, 2017
9435b65
add intro, download
filipesilva Mar 22, 2017
1f24d04
add core file descriptions
filipesilva Mar 22, 2017
ed14ce0
add entry points and build step
filipesilva Mar 22, 2017
423e6f5
add testing
filipesilva Mar 22, 2017
a73370f
add publishing
filipesilva Mar 22, 2017
4fce4b8
add AOT and JIT appendix
filipesilva Mar 22, 2017
8657312
remove old example
filipesilva Mar 22, 2017
9bbc128
whitespace
filipesilva Mar 22, 2017
274a207
add v4 message
filipesilva Mar 22, 2017
0f65921
add dep management
filipesilva Mar 22, 2017
e2e7738
whitespace
filipesilva Mar 22, 2017
aef571f
add externals/globals note
filipesilva Mar 22, 2017
5bf5337
fix headers
filipesilva Mar 22, 2017
3ef8d45
add example
filipesilva Mar 22, 2017
d38aedc
remove unused changes
filipesilva Mar 22, 2017
2e9bfbd
spelling
filipesilva Mar 23, 2017
97a7df0
line breaks
filipesilva Mar 23, 2017
24455bc
emphasize package format over starter
filipesilva Mar 23, 2017
d0f6209
put aot first
filipesilva Mar 23, 2017
50cbb91
add note about customization
filipesilva Mar 23, 2017
59a80e0
add preliminary folder structure
filipesilva Mar 23, 2017
c5e7de3
update folder struture
filipesilva Mar 23, 2017
e9e8898
add a couple more points to library maintenance
filipesilva Mar 23, 2017
9961bdc
rename a file
filipesilva Mar 23, 2017
c121cb3
add sourcemaps note
filipesilva Mar 23, 2017
31b1f50
add consumer table
filipesilva Mar 23, 2017
f801cfd
update layout, add checklist
filipesilva Mar 27, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update folder struture
  • Loading branch information
filipesilva committed Mar 27, 2017
commit c5e7de33afb3cb8b9114977883951b7698a7f7a5
6 changes: 3 additions & 3 deletions public/docs/_examples/quickstart-lib/ts/src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// #docregion
export { LibComponent } from './component/lib.component';
export { LibService } from './service/lib.service';
export { LibModule } from './module';
export { LibComponent } from './src/component/lib.component';
export { LibService } from './src/service/lib.service';
export { LibModule } from './src/module';
83 changes: 43 additions & 40 deletions public/docs/ts/latest/cookbook/third-party-lib.jade
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,27 @@ include ../_util-fns
A library should have the following file layout when published:

.filetree
.file node_modules/library-name
.file node_modules/angular-library-name
.children
.file dist
.children
.file library-subfolders/...
.file library-name.d.ts ('typings')
.file library-name.es5.js ('module')
.file library-name.js ('es2015')
.file library-name.metadata.json
.file library-name.umd.js ('main')
.file library-name.umd.min.js
.file index.d.ts
.file module.d.ts
.file bundles
.children
.file angular-library-name.umd.js ('main' entry point)
.file angular-library-name.umd.js.map
.file angular-library-name.umd.min.js
.file angular-library-name.umd.min.js.map
.file src/*.d.ts
.file angular-library-name.d.ts ('typings' entry point)
.file angular-library-name.es5.js ('module' entry point)
.file angular-library-name.es5.js.map
.file angular-library-name.js ('es2015' entry point)
.file angular-library-name.js.map
.file angular-library-name.metadata.json
.file index.d.ts
.file LICENSE
.file package.json
.file package.json (lists all entry points)
.file README.md




:marked
There is also a minified UMD bundle (`angular-quickstart-lib.umd.min.js`) for smaller payloads
in Plunkers and script tags.
Expand Down Expand Up @@ -195,29 +196,31 @@ a#seed
.file app.module.ts
.file lib
.children
.file component
.children
.file lib.component.ts
.file service
.file src
.children
.file lib.service.ts
.file component
.children
.file lib.component.ts
.file service
.children
.file lib.service.ts
.file module.ts
.file index.ts
.file module.ts

+makeTabs(`
quickstart-lib/ts/src/demo/app/app.component.ts,
quickstart-lib/ts/src/demo/app/app.module.ts,
quickstart-lib/ts/src/lib/component/lib.component.ts,
quickstart-lib/ts/src/lib/service/lib.service.ts,
quickstart-lib/ts/src/lib/src/component/lib.component.ts,
quickstart-lib/ts/src/lib/src/service/lib.service.ts,
quickstart-lib/ts/src/lib/src/module.ts
quickstart-lib/ts/src/lib/index.ts,
quickstart-lib/ts/src/lib/module.ts
`, '', `
src/demo/app/app.component.ts,
src/demo/app/app.module.ts,
src/lib/component/lib.component.ts,
src/lib/service/lib.service.ts,
src/lib/index.ts,
src/lib/module.ts
src/lib/src/component/lib.component.ts,
src/lib/src/service/lib.service.ts,
src/lib/src/module.ts,
src/lib/index.ts
`)(format='.')

:marked
Expand Down Expand Up @@ -254,25 +257,25 @@ table(width="100%")
:marked
A demo `NgModule` that imports the Library `LibModule`.
tr
td <ngio-ex>lib/component/app.component.ts</ngio-ex>
td <ngio-ex>lib/src/component/app.component.ts</ngio-ex>
td
:marked
A sample library component that renders an `<h2>` tag.
tr
td <code>lib/service/lib.service.ts</code>
td <code>lib/src/service/lib.service.ts</code>
td
:marked
A sample library service that exports a value.
tr
td <code>lib/index.ts</code>
td <code>lib/src/module.ts</code>
td
:marked
The public API of your library, where you choose what to export to consumers.
The library's main `NgModule`, `LibModule`.
tr
td <code>lib/module.ts</code>
td <code>lib/index.ts</code>
td
:marked
The library's main `NgModule`, `LibModule`.
The public API of your library, where you choose what to export to consumers.


.l-main-section
Expand All @@ -288,6 +291,7 @@ table(width="100%")
- Inline html and css inside the generated JavaScript files.
- Copy typings, metatada, html and css.
- Create each bundle using Rollup.
- Copy `LICENSE`, `package.json` and `README.md` files


.l-main-section
Expand Down Expand Up @@ -322,15 +326,13 @@ table(width="100%")

You can also test your library by installing it in another local repository you have.
To do so, first build your lib via `npm run build`.
Then install it from your other repo using a relative path: `npm install relative/path/to/lib`.
Then install it from your other repo using a relative path to the dist folder:
`npm install relative/path/to/library/dist`.

.l-main-section
:marked
## Publishing your library

The `.npmignore` file defines what files and folders will be published to NPM: `dist/`,
`LICENSE`, `package.json` and `README.md`.

Every package on NPM has a unique name, and so should yours.
If you haven't already, now is the time to change the name of your library.

Expand Down Expand Up @@ -358,8 +360,9 @@ table(width="100%")
After you have changed the package name, you can publish it to NPM (read
[this link](https://docs.npmjs.com/getting-started/publishing-npm-packages) for details).

You'll need to create a NPM account, login on your local machine, and then you can publish updated
by running `npm publish`.
First you'll need to create a NPM account and login on your local machine.
Then you can publish your package by running `npm publish dist/`.
Since your package is built on the `dist/` folder this is the one you should publish.

.l-sub-section
:marked
Expand Down