diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 7c327307c..52d189d80 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -11,7 +11,6 @@ _A bug: please describe the error that you encountered_ _A feature: please describe your use case and motivation_ - #### How To Reproduce _A bug: please include instructions how to reproduce. Issues without reproduction are likely to receive no feedback._ @@ -20,8 +19,7 @@ _Can you reproduce the error in the integration tests in ng-packagr?_ _If possible, take a look at the [`integration/samples`](./integration/samples) and try to break one of these builds!_ _Is the error you faced in an application importing the library_ -_Try to break the Angular CLI app in [`integration/consumers/ng-cli`](./integration/consumers/ng-cli)!_ - +_Try to break the Angular CLI app in [`integration/consumers/ng-cli`](./integration/consumers/ng-cli)!_ #### Expected Behaviour @@ -29,7 +27,6 @@ _A bug: please describe what behaviour or result you expected_ _A feature: do you have a first draft or an idea how to implement?_ - #### Version Information ``` diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml new file mode 100644 index 000000000..5714e28e1 --- /dev/null +++ b/.github/workflows/lock.yml @@ -0,0 +1,25 @@ +name: 'Lock threads' + +on: + schedule: + - cron: '0 0 * * *' + +jobs: + lock: + runs-on: ubuntu-latest + steps: + - uses: dessant/lock-threads@v2 + with: + github-token: ${{ github.token }} + issue-lock-inactive-days: 30 + issue-lock-comment: > + This issue has been automatically locked due to inactivity.
+ Please file a new issue if you are encountering a similar or related problem.

+ _This action has been performed automatically by a bot._ + issue-lock-reason: '' + pr-lock-inactive-days: 30 + pr-lock-comment: > + This PR has been automatically locked due to inactivity.
+ Please file a new issue if you are encountering a similar or related problem.

+ _This action has been performed automatically by a bot._ + pr-lock-reason: '' diff --git a/.prettierrc b/.prettierrc index 4b9a2d97d..5a43c2d7b 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,6 @@ { "printWidth": 120, "singleQuote": true, - "trailingComma": "all" + "trailingComma": "all", + "arrowParens": "avoid" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 2138a8ae7..1f93e8720 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,182 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [10.1.2](https://github.com/ng-packagr/ng-packagr/compare/v10.1.1...v10.1.2) (2020-09-26) + + +### Bug Fixes + +* fix windows less spawn error ([9174c0b](https://github.com/ng-packagr/ng-packagr/commit/9174c0bca7290a4505f33f7fa13332785ea47459)) + +### [10.1.1](https://github.com/ng-packagr/ng-packagr/compare/v10.1.0...v10.1.1) (2020-09-25) + + +### Bug Fixes + +* add basePath as sourceRoot ([681fb1c](https://github.com/ng-packagr/ng-packagr/commit/681fb1c36b68efb3078dc3d846776e9e749ebf44)) +* replace execFile with execFileSync to fix a potential malicious cmd injection ([bda0fff](https://github.com/ng-packagr/ng-packagr/commit/bda0fff3443301f252930a73fdc8fb9502de596d)) + +## [10.1.0](https://github.com/ng-packagr/ng-packagr/compare/v10.0.4...v10.1.0) (2020-08-27) + + +### Features + +* add support for TypeScript 4 ([eb8b0c2](https://github.com/ng-packagr/ng-packagr/commit/eb8b0c2553aa1847f4ab42f29a1a25e67f644d29)) +* show warning on deprecated option usage ([551a4d9](https://github.com/ng-packagr/ng-packagr/commit/551a4d9a866a8c337189f807d755856b995ffc9b)) + + +### Bug Fixes + +* update commander to version ^6.0.0 ([ec736e5](https://github.com/ng-packagr/ng-packagr/commit/ec736e5df6978be79dca236683936941f349a8e5)) + + +### Performance + +* cache normalized paths ([92f68e3](https://github.com/ng-packagr/ng-packagr/commit/92f68e3f09f66c990413e09cda5d742ad00c5b7f)) + +### [10.0.4](https://github.com/ng-packagr/ng-packagr/compare/v10.0.3...v10.0.4) (2020-08-13) + + +### Bug Fixes + +* update @rollup/plugin-commonjs to version ^15.0.0 ([cc3254a](https://github.com/ng-packagr/ng-packagr/commit/cc3254aa230e1c94991514e780facc2eb19b4546)) +* update @rollup/plugin-node-resolve to version ^9.0.0 ([47606fd](https://github.com/ng-packagr/ng-packagr/commit/47606fd2ae254e024d9fdcac11489e114ced145a)) + +### [10.0.3](https://github.com/ng-packagr/ng-packagr/compare/v10.0.2...v10.0.3) (2020-07-22) + + +### Performance + +* implement rollup caching ([eb13316](https://github.com/ng-packagr/ng-packagr/commit/eb1331641b2828da0d188d5934f68f7307e6817b)), closes [#1580](https://github.com/ng-packagr/ng-packagr/issues/1580) + +### [10.0.2](https://github.com/ng-packagr/ng-packagr/compare/v10.0.1...v10.0.2) (2020-07-16) + + +### Bug Fixes + +* pass tsconfig path to ngcc ([fd18984](https://github.com/ng-packagr/ng-packagr/commit/fd18984e9e7e6b04b7fbbcd95c1adce5aff3c940)) +* update @rollup/plugin-commonjs to version ^14.0.0 ([6581390](https://github.com/ng-packagr/ng-packagr/commit/6581390f3f9140e7b4bd80312b1740821443132c)) + +### [10.0.1](https://github.com/ng-packagr/ng-packagr/compare/v10.0.0...v10.0.1) (2020-07-09) + + +### Bug Fixes + +* don't copy assets asynchronously ([374ec29](https://github.com/ng-packagr/ng-packagr/commit/374ec2964e8fbc49408462f4b4a936e4712e91ca)) +* update rxjs to version ~6.6.0 ([2ce95ab](https://github.com/ng-packagr/ng-packagr/commit/2ce95ab34f5cc0126a9c287163a3d43d6d3999b5)) + +## [10.0.0](https://github.com/ng-packagr/ng-packagr/compare/v10.0.0-rc.2...v10.0.0) (2020-06-24) + +## [10.0.0-rc.2](https://github.com/ng-packagr/ng-packagr/compare/v10.0.0-rc.1...v10.0.0-rc.2) (2020-06-12) + + +### Bug Fixes + +* issues with emitting declarationMap ([38ad52b](https://github.com/ng-packagr/ng-packagr/commit/38ad52b0980428a300126c4d8b83c5d06d552f29)), closes [#1464](https://github.com/ng-packagr/ng-packagr/issues/1464) + +## [10.0.0-rc.1](https://github.com/ng-packagr/ng-packagr/compare/v10.0.0-rc.0...v10.0.0-rc.1) (2020-06-10) + + +### Bug Fixes + +* disable CSS `calc` optimizations ([bdcc938](https://github.com/ng-packagr/ng-packagr/commit/bdcc938f765f3d58a79b395dcf7a749efddd3e94)) +* release commit message formatting ([300b4bf](https://github.com/ng-packagr/ng-packagr/commit/300b4bff0534d5fe1591063488b8ade3ef396900)) +* update @rollup/plugin-commonjs to version ^13.0.0 ([9413dbd](https://github.com/ng-packagr/ng-packagr/commit/9413dbd34f8d6a57abbfb9d71a72e97ecac47e1c)) +* watch assets files and re-copy on changes ([e7465c3](https://github.com/ng-packagr/ng-packagr/commit/e7465c3cbd5b0094af4739ec9250b34c4f3aad27)), closes [#1545](https://github.com/ng-packagr/ng-packagr/issues/1545) + +## [10.0.0-rc.0](https://github.com/ng-packagr/ng-packagr/compare/v10.0.0-next.2...v10.0.0-rc.0) (2020-05-28) + + +### Bug Fixes + +* remove custom namespaced sourceRoot in sourcemaps ([481dd8f](https://github.com/ng-packagr/ng-packagr/commit/481dd8f77c927b564e3d3eb8c79e6cecdc580b52)), closes [#1622](https://github.com/ng-packagr/ng-packagr/issues/1622) +* remove tslib from peerDependencies when adding it to dependencies ([2981f73](https://github.com/ng-packagr/ng-packagr/commit/2981f73ff264caca66886f4a62027d26e69e410b)) +* update @rollup/plugin-commonjs to version ^12.0.0 ([e89c5b1](https://github.com/ng-packagr/ng-packagr/commit/e89c5b1d325a83230428b1d8874d4a46fb6a0514)) +* update @rollup/plugin-node-resolve to version ^8.0.0 ([b2ac9a2](https://github.com/ng-packagr/ng-packagr/commit/b2ac9a291a1ce7bcdb33f00b04408ccc6c76e71c)) + + +### Performance + +* don't set setParentNodes for analyse sourcefiles ([d0ce240](https://github.com/ng-packagr/ng-packagr/commit/d0ce240130548b6633499f0685d6bbbff0cbb186)) + +## [10.0.0-next.2](https://github.com/ng-packagr/ng-packagr/compare/v10.0.0-next.1...v10.0.0-next.2) (2020-05-19) + + +### ⚠ BREAKING CHANGES + +* `cssUrl` option default value has been changed to `inline` +More info about this option can be found: https://github.com/ng-packagr/ng-packagr/blob/master/docs/embed-assets-css.md +* TypeScript 3.8 is no longer supported, please update to TypeScript 3.9 + +### Features + +* embed assets in css file using data uri by default ([d2a5731](https://github.com/ng-packagr/ng-packagr/commit/d2a573184dca47fbb0b0042614444e74e7e304b2)) + + +### Bug Fixes + +* auto add tslib as direct dependency ([4145af5](https://github.com/ng-packagr/ng-packagr/commit/4145af5588d57c6749535c3a3cbc242b296fae0a)) + + +* update to TypeScript 3.9 ([8524648](https://github.com/ng-packagr/ng-packagr/commit/8524648cad5ab8a24520c472304d533d28207b99)) + +## [10.0.0-next.1](https://github.com/ng-packagr/ng-packagr/compare/v10.0.0-next.0...v10.0.0-next.1) (2020-05-13) + + +### Performance + +* ignore node_modules from file watching ([74696e4](https://github.com/ng-packagr/ng-packagr/commit/74696e477070e47df3f118278f9220e269d885ab)), closes [#1583](https://github.com/ng-packagr/ng-packagr/issues/1583) +* use endsWith instead of complex RegExp during dependency analysis ([4f550be](https://github.com/ng-packagr/ng-packagr/commit/4f550be7376d90d9aef7a5fcdc269ec3a17f42d5)) + +## [10.0.0-next.0](https://github.com/ng-packagr/ng-packagr/compare/v9.1.2...v10.0.0-next.0) (2020-05-06) + + +### ⚠ BREAKING CHANGES + +* Deprecated `jsx` and `languageLevel` has been removed, Set these options in your `tsconfig.json` instead. +* esm5 and fesm5 formats are no longer generated. + +If you are not using Angular CLI to build your application or library, +and you need to be able to build es5 artifacts, then you will need to +downlevel the distributed Angular code to es5 on your own. + +Angular CLI will automatically downlevel the code to es5. + +### Features + +* add support for Angular version 10 ([cb984cd](https://github.com/ng-packagr/ng-packagr/commit/cb984cd161a3e7991a87dcd1315adfee10ae33ec)) +* replace css optimizer from clean-css with cssnano ([2c6160f](https://github.com/ng-packagr/ng-packagr/commit/2c6160f3d54e112bd8d465015ff24fe4b4db7530)), closes [#1607](https://github.com/ng-packagr/ng-packagr/issues/1607) +* update to APF version 10 ([d47ccd7](https://github.com/ng-packagr/ng-packagr/commit/d47ccd7fb1763af052d068ea84edc79981bd0c94)) + + +### Bug Fixes + +* update commander to version ^5.0.0 ([0ec80b5](https://github.com/ng-packagr/ng-packagr/commit/0ec80b56582112bcc851c35391acba283e2fb6dc)) +* update rollup to version 2.8.0 ([e7aa579](https://github.com/ng-packagr/ng-packagr/commit/e7aa579c94d66c8fa67fd1b40c86053bb3891841)) +* update rollup-plugin-sourcemaps to version ^0.6.0 ([f8c3459](https://github.com/ng-packagr/ng-packagr/commit/f8c3459af0a5d2125343ec0e737bcb7cc6b0c460)) + + +* remove deprecated jsx and languageLevel options ([7503bd4](https://github.com/ng-packagr/ng-packagr/commit/7503bd4a30f8218896a8ec502f42ac810cc4dd64)) + +### [9.1.2](https://github.com/ng-packagr/ng-packagr/compare/v9.1.1...v9.1.2) (2020-04-30) + + +### Bug Fixes + +* update rollup to version 2.7.5 ([0736ba9](https://github.com/ng-packagr/ng-packagr/commit/0736ba9)) + +### [9.1.1](https://github.com/ng-packagr/ng-packagr/compare/v9.1.0...v9.1.1) (2020-04-13) + + +### Bug Fixes + +* update chalk to version ^4.0.0 ([bbad22e](https://github.com/ng-packagr/ng-packagr/commit/bbad22e)) +* update rollup to version 2.3.1 ([dffe028](https://github.com/ng-packagr/ng-packagr/commit/dffe028)) +* update rollup to version 2.3.2 ([1ddc07b](https://github.com/ng-packagr/ng-packagr/commit/1ddc07b)) +* update rollup to version 2.3.4 ([4d056b1](https://github.com/ng-packagr/ng-packagr/commit/4d056b1)) +* update rollup to version 2.3.5 ([0c0672d](https://github.com/ng-packagr/ng-packagr/commit/0c0672d)) +* update rollup to version 2.6.1 ([4a95ddc](https://github.com/ng-packagr/ng-packagr/commit/4a95ddc)) + ## [9.1.0](https://github.com/ng-packagr/ng-packagr/compare/v9.0.3...v9.1.0) (2020-03-25) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f7d1aaa3e..780bd5147 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,7 +20,7 @@ Can you reproduce the error in the integration tests in ng-packagr? If possible, take a look at the [`integration/samples`](./integration/samples) and try to break one of these builds! Is the error you faced in an application importing the library? -Try to break the Angular CLI app in [`integration/consumers/ng-cli`](./integration/consumers/ng-cli)! +Try to break the Angular CLI app in [`integration/consumers/ng-cli`](./integration/consumers/ng-cli)! ## For Developers diff --git a/README.md b/README.md index c713e0cba..9154eb1be 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ Create one `package.json` per npm package, run _ng-packagr_ for each! ## Features * :gift: Implements [Angular Package Format](https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/preview) - * :checkered_flag: Bundles your library in FESM2015, FESM5, and UMD formats + * :checkered_flag: Bundles your library in FESM2015 and UMD formats * :school_satchel: npm package can be consumed by [Angular CLI](https://github.com/angular/angular-cli), [Webpack](https://github.com/webpack/webpack), or [SystemJS](https://github.com/systemjs/systemjs) * :dancer: Creates type definitions (`.d.ts`) * :runner: Generates [Ahead-of-Time](https://angular.io/guide/aot-compiler#why-do-aot-compilation) metadata (`.metadata.json`) @@ -99,9 +99,7 @@ Create one `package.json` per npm package, run _ng-packagr_ for each! - [Change Configuration Locations](docs/configuration-locations.md) - [Override tsconfig](docs/override-tsconfig.md) - [Add Style Include Paths](docs/style-include-paths.md) -- [Change ECMAScript Language Level](docs/language-level.md) - [Package Secondary Entrypoints (sub packages)](docs/secondary-entrypoints.md) -- [Enable JSX Templates, Bridging the Gap Between Angular and React](docs/jsx.md) ## Advanced Use Cases @@ -130,7 +128,7 @@ To orchestrate the different tools, ng-packagr features a [custom transformation ## Knowledge -[Angular Package Format v9.0](https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/preview), design document at Google Docs +[Angular Package Format v10.0](https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/preview), design document at Google Docs Packaging Angular Libraries - Jason Aden at Angular Mountain View Meetup ([Jan 2018, 45min talk](https://www.youtube.com/watch?v=QfvwQEJVOig&t=3612s)) diff --git a/docs/DESIGN.md b/docs/DESIGN.md index 6bb284145..6a5513fa1 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -12,18 +12,17 @@ The motivation is to help authors write libraries and generate the expected, dis According to [Angular Package Format](https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/preview), there need to be the following build artefacts: -* FESM2015 Bundle: `@/.js` in ES2015 syntax and ES2015 module format, a so-called Flat ECMAScript Module. It is referenced in the `es2015` property of `package.json`. -* FESM5 Bundle: `@/.es5.js` in ES5 syntax and ES2015 module format, a so-called Flat ECMAScript Module (ESM, or FESM5, or FESM2014). It is referenced in the `module` property of `package.json`. -* UMD Bundle: `@/.umd.js` in ES5 syntax and UMD module format, a so-called universal module definition format. It is referenced in the `main` property of `package.json`. -* Type definitions: an `index.d.ts` file is needed to support TypeScript debugging and rich developer experience. It is references in the `typings` property of `package.json` -* AoT Metadata: an `index.metadata.json` is needed for library consumers that wish to perform AoT compilation. The `*.metadata.json` file MUST have templates and stylesheets inlined. The `*.metadata.json` file MUST be located next to the type definitions file and MUST have the same base name (e.g. `index.d.ts` and `index.metadata.json`). -* A `package.json` file: it describes the structure of the library and serves as the entry point for library users, when resolving TypeScript import statements: `import { .. } from '@/'`. -* A `README.md` and `LICENSE` file for the library. These files should be located next to the `package.json` (and can be copied "as is" / static assets). +- FESM2015 Bundle: `@/.js` in ES2015 syntax and ES2015 module format, a so-called Flat ECMAScript Module. It is referenced in the `es2015` property of `package.json`. +- UMD Bundle: `@/.umd.js` in ES5 syntax and UMD module format, a so-called universal module definition format. It is referenced in the `main` property of `package.json`. +- Type definitions: an `index.d.ts` file is needed to support TypeScript debugging and rich developer experience. It is references in the `typings` property of `package.json` +- AoT Metadata: an `index.metadata.json` is needed for library consumers that wish to perform AoT compilation. The `*.metadata.json` file MUST have templates and stylesheets inlined. The `*.metadata.json` file MUST be located next to the type definitions file and MUST have the same base name (e.g. `index.d.ts` and `index.metadata.json`). +- A `package.json` file: it describes the structure of the library and serves as the entry point for library users, when resolving TypeScript import statements: `import { .. } from '@/'`. +- A `README.md` and `LICENSE` file for the library. These files should be located next to the `package.json` (and can be copied "as is" / static assets). **DO**: `ng-packagr` generates a TypeScript library in Angular Package Format. JavaScript bundles, type definitions and AoT metadata are auto-generated during build. -### Public API entry +### Public API entry Angular core libraries make heavy use of this pattern. They provide a `public_api.ts` file as entry point to their library. @@ -32,7 +31,7 @@ This pattern is also a recommended approach for building flat modules. **DO**: `ng-packagr` supports a single entry file to a library's public API. -### Package definition and library metadata +### Package definition and library metadata For consumers of a library, the package definition is provided in a `package.json` file, including `peerDependencies`, `name`, `version`, etc. Most important, the build artefacts (see above) are referenced in `package.json`. @@ -42,10 +41,10 @@ In this way, library consumers and build tools will pick-up the correct build ar To do so, it needs an input `package.json` that includes basic information like `name` and `version` and it will add references to the auto-generated build artefacts. A `package.json` also includes information needed to distribute and publish the library. -Typical steps in a publishing workflow are: verify or control version number (version bumping), generate a changelog, keep track of public API changes, tagging a release, publishing distributables to a registry. -A lot of tools exist for these kind of purposes. +Typical steps in a publishing workflow are: verify or control version number (version bumping), generate a changelog, keep track of public API changes, tagging a release, publishing to a registry. +A lot of tools exist for this kind of purposes. For example, [standard-version](https://github.com/conventional-changelog/standard-version) generates changelogs, manages semantic version numbers, and tags releases. -If neccessay, it's recommended that these tools pick up the `package.json` generated by `ng-packagr` and modify it (e.g. increase version number). +If necessary, it's recommended that these tools pick up the `package.json` generated by `ng-packagr` and modify it (e.g. increase version number). **DON'T**: `ng-packagr` **WILL NOT** implement a publishing workflow. @@ -54,7 +53,7 @@ If neccessay, it's recommended that these tools pick up the `package.json` gener Various folder layouts exist and are commonly used within the Angular community. The different styles are reflected in the [integration samples of ng-packagr](../integration). -First, the Angulare core package layout: +First, the Angular core package layout: ``` |- package.json @@ -91,7 +90,7 @@ Finally, a custom folder layout: |- foo |- foo.ts |- bar -      |- bar.ts + |- bar.ts ``` **DO**: `ng-packagr` supports different folder layouts by setting paths in a JSON configuration file (see below). @@ -114,10 +113,10 @@ To help writing the JSON file, a JSON schema ships with `ng-packagr`. From that deliberate design choice, the following considerations are derived. `ng-package.json`… -* …IS a declarative way of describing an Angular library. - * Multiple libraries are handled by writing one `ng-package.json` file per project and running `ng-packagr` for each project. -* …SHOULD describe the properties and characteristics of an Angular library . Library authors should take care of describing _WHAT_ their library looks like. -* …SHOULD NOT try to pass-up configuration of internal tools (e.g. `tsc` or `rollup` configs). This would put burden on library authors to take care of _HOW_ an internal build process is orchestrated. +- …IS a declarative way of describing an Angular library. + - Multiple libraries are handled by writing one `ng-package.json` file per project and running `ng-packagr` for each project. +- …SHOULD describe the properties and characteristics of an Angular library . Library authors should take care of describing _WHAT_ their library looks like. +- …SHOULD NOT try to pass-up configuration of internal tools (e.g. `tsc` or `rollup` configs). This would put burden on library authors to take care of _HOW_ an internal build process is orchestrated. --- @@ -127,7 +126,7 @@ Internally, `ng-packagr` is going to use several other tools to do the desired t Here is a trade-off decision: As first option, `ng-packagr` allows users to provide a full custom configuration for tools such as `ngc`, `rollup`, and so on. -This forces useer to write a configuration file for these tools and deal with configuration options. +This forces users to write a configuration file for these tools and deal with configuration options. Alternatively, `ng-packagr` will hide configuration and internals of tools such as `ngc`, `rollup`, and so on. In this case, the configuration of `ng-packagr` will only allow to configure a limited set of options that will be passed through to the tools. @@ -138,11 +137,9 @@ Right now, `@angular/tsc-wrapped` does not support the `"extends"` property of ` Because of that, `ng-packagr` needs to support self-contained JSON configuration files for ngc. If auto-generating a tsconfig, `ng-packagr` would need to read its default values, merge that with the custom user tsconfig and copy the result to its working directory. -The most important setting here is the `"files": []` property, which must contain exactly one file since `"flatModuleId"` and `"flatModuleOutFile"` options will also be used for flattended library indexes. +The most important setting here is the `"files": []` property, which must contain exactly one file since `"flatModuleId"` and `"flatModuleOutFile"` options will also be used for flattened library indexes. The value for `"flatModuleId"` could be inferred by the library's name as given in `package.json`, `"flatModuleOutFile"` could be statically set to `"index"`. -The `"lib"` property that denotes TypeScript language level support can be overriden through a `lib.languageLevel` property in `ng-package.json`. - Other configuration properties like `"target"` or `"module"` cannot be set by users since the order of transformations relies on certain settings. For example, `ngc` will need to compile to `"target": "es2015"` and `"module": "es2015"` in order to allow subsequent steps to happen. @@ -158,9 +155,9 @@ Reasonable default values should be shipped with `ng-packagr` without forcing us The default configuration should try to support `@angular/*` packages as well as `rxjs`, which is a transitive dependency in most cases and also requires special configuration in Rollup. Other configuration properties like `"entry"` or `"format"` cannot be set by users since their values depend on the order of transformations being applied. -For example, the transformation to UMD requires an FESM5 input file. -The FESM5 input file got created prior in the build process, thus `ng-packagr` will pass both the `"entry"` and `"format"` property to `rollup` without users being able to custimize. +For example, the transformation to UMD requires an FESM2015 input file. +The FESM2015 input file got created prior in the build process, thus `ng-packagr` will pass both the `"entry"` and `"format"` property to `rollup` without users being able to customize. -~If required, users should be able to provide a custom rollup configuration to `ng-packagr` by settings the `rollup.config` JSON configuation property.~ +~If required, users should be able to provide a custom rollup configuration to `ng-packagr` by settings the `rollup.config` JSON configuration property.~ --- diff --git a/docs/DEVELOP.md b/docs/DEVELOP.md index ad94fdd0a..4a4975de0 100644 --- a/docs/DEVELOP.md +++ b/docs/DEVELOP.md @@ -1,6 +1,4 @@ -Develop Guideline -================= - +# Develop Guideline ## Release & Publish Workflow @@ -19,7 +17,7 @@ $ git push --follow-tags origin master This pushes branch `master` and the `v{x}.{y}.{z}` tag to the GitHub repository, thus triggering a build on Circle CI. Circle CI will checkout the Git tag, build from sources (again), and automatically publish to the npm registry. -If neccessary, distributable artefacts can be created and published by hand: +If necessary, distributable artefacts can be created and published by hand: ```bash $ yarn pack dist diff --git a/docs/dependencies.md b/docs/dependencies.md index d9a9a133e..eebda3ded 100644 --- a/docs/dependencies.md +++ b/docs/dependencies.md @@ -40,7 +40,7 @@ in `package.json`: } ``` -If you'd like to turn off this feature completly, you can do so by providing a catch all RegExp as such; +If you'd like to turn off this feature completely, you can do so by providing a catch all RegExp as such; ```json { diff --git a/docs/embed-assets-css.md b/docs/embed-assets-css.md index e8984e150..0cf6f5c63 100644 --- a/docs/embed-assets-css.md +++ b/docs/embed-assets-css.md @@ -2,9 +2,9 @@ ## Why? -While developing a library you may want certain assets that are being used inside your components gets embedded into the outputted css as otherwise it can get rather tricky to implement something that will work for all module formats. +While developing a library you may want certain assets used inside your components to be embedded into the outputted css as otherwise it can get rather tricky to implement something that will work for all module formats. -A way to overcome this and include certain assets, is to use background images inside css and embed the assets with data URIs. +One way to overcome this and include certain assets, is to use background images inside css and embed the assets with data URIs. Something like the below: @@ -18,7 +18,7 @@ During build it will be resolved and the asset will be encoded into base64 forma background: url(data:image/png;base64, YSBzbGlnaHRseSBsb25nZXIgdGVzdCBmb3IgdGV2ZXIK); ``` -Note: it is important to keep the amount of embeeded file to a minimum and only embed small files. As this will increase in the final bundle size. +Note: it is important to keep the amount of embedded files to a minimum and only embed small files. As this will increase in the final bundle size. More information [in the CSS tricks website](https://css-tricks.com/data-uris) and [MDN web docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs). diff --git a/docs/ghpages/README.md b/docs/ghpages/README.md index bb6f3ecea..31b5bbfb7 100644 --- a/docs/ghpages/README.md +++ b/docs/ghpages/README.md @@ -10,7 +10,7 @@ Built with [WebSlides = Create stories with Karma](https://webslides.tv/#slide=1 ## Angular Package Format Distribute sources? No good. -Build tools are complex: JavaScript module formats, TypeScript declaration files, AoT metadata, +Build tools are complex: JavaScript module formats, TypeScript declaration files, AoT metadata, A wall of tools: webpack, rollup, gulp, angular CLI, ember CLI, system.js @@ -19,7 +19,7 @@ https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/ Purpose of Angular Package Format: is compatible w/ most build tool chains. E.g. `es5.js` for webpack / ng CLI. -`umd.js` for module loders, e.g. SystemJS. +`umd.js` for module loaders, e.g. SystemJS. Packaging Angular - Jason Aden at ng-conf: https://youtu.be/unICbsPGFIA diff --git a/docs/ghpages/index.html b/docs/ghpages/index.html index 364bc6183..8f39d7fe0 100644 --- a/docs/ghpages/index.html +++ b/docs/ghpages/index.html @@ -245,7 +245,7 @@

JavaScript Modules

- FESM2015, FESM5, UMD + FESM2015, UMD
  • @@ -266,7 +266,7 @@