From 450db5cee4001daaed81b3c5da3a7be319be9cdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iva=CC=81n=20Zaera=20Avello=CC=81n?= Date: Tue, 22 Aug 2017 09:22:45 +0200 Subject: [PATCH 1/3] Add documentation for liferay-npm-bundler plugins --- .../README.md | 35 +++++++++++++++++++ .../README.md | 32 +++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 packages/liferay-npm-bundler-plugin-inject-angular-dependencies/README.md create mode 100644 packages/liferay-npm-bundler-plugin-replace-browser-modules/README.md diff --git a/packages/liferay-npm-bundler-plugin-inject-angular-dependencies/README.md b/packages/liferay-npm-bundler-plugin-inject-angular-dependencies/README.md new file mode 100644 index 00000000..c049f84e --- /dev/null +++ b/packages/liferay-npm-bundler-plugin-inject-angular-dependencies/README.md @@ -0,0 +1,35 @@ +# liferay-npm-bundler-plugin-inject-angular-dependencies + +> Inject some peer dependencies which are needed to make Angular work. + +## Details + +This plugin injects a dependency on `rxjs` in `@angular/forms` package. This is +needed for Angular to work correctly under Liferay Portal npm architecture. + +To determine the version of `rxjs` to use, the plugin scans the parent directory +of `@angular/forms` for the `rxjs` package. + +You can find more information about what happens with `rxjs` and +`@angular/forms` in +[this issue](https://github.com/angular/angular/issues/17917). + +## Installation + +``` +npm install --save-dev liferay-npm-bundler-plugin-inject-angular-dependencies +``` + +## Usage + +Add the following to your `.npmbundlerrc` file: + +``` +{ + "*": { + "plugins": [ + "inject-angular-dependencies" + ] + } +} +``` \ No newline at end of file diff --git a/packages/liferay-npm-bundler-plugin-replace-browser-modules/README.md b/packages/liferay-npm-bundler-plugin-replace-browser-modules/README.md new file mode 100644 index 00000000..3e59f9f9 --- /dev/null +++ b/packages/liferay-npm-bundler-plugin-replace-browser-modules/README.md @@ -0,0 +1,32 @@ +# liferay-npm-bundler-plugin-replace-browser-modules + +> Replace modules listed under `browser` section of `package.json` files. + +## Details + +This plugin scans `package.json` for a browser entry and copies browser modules +on top of server modules or deletes them when set to `false`. + +Please read the +[`browser` field specification](https://github.com/defunctzombie/package-browser-field-spec) +for more information. + +## Installation + +``` +npm install --save-dev liferay-npm-bundler-plugin-replace-browser-modules +``` + +## Usage + +Add the following to your `.npmbundlerrc` file: + +``` +{ + "*": { + "plugins": [ + "replace-browser-modules" + ] + } +} +``` \ No newline at end of file From 815da268d9de46b16e37f1946b122ac1e1073222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iva=CC=81n=20Zaera=20Avello=CC=81n?= Date: Tue, 22 Aug 2017 11:10:46 +0200 Subject: [PATCH 2/3] Move Details section down. --- .../README.md | 26 +++++++++---------- .../README.md | 21 ++++++++------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/packages/liferay-npm-bundler-plugin-inject-angular-dependencies/README.md b/packages/liferay-npm-bundler-plugin-inject-angular-dependencies/README.md index c049f84e..c7b5996d 100644 --- a/packages/liferay-npm-bundler-plugin-inject-angular-dependencies/README.md +++ b/packages/liferay-npm-bundler-plugin-inject-angular-dependencies/README.md @@ -2,18 +2,6 @@ > Inject some peer dependencies which are needed to make Angular work. -## Details - -This plugin injects a dependency on `rxjs` in `@angular/forms` package. This is -needed for Angular to work correctly under Liferay Portal npm architecture. - -To determine the version of `rxjs` to use, the plugin scans the parent directory -of `@angular/forms` for the `rxjs` package. - -You can find more information about what happens with `rxjs` and -`@angular/forms` in -[this issue](https://github.com/angular/angular/issues/17917). - ## Installation ``` @@ -32,4 +20,16 @@ Add the following to your `.npmbundlerrc` file: ] } } -``` \ No newline at end of file +``` + +## Technical Details + +This plugin injects a dependency on `rxjs` in `@angular/forms` package. This is +needed for Angular to work correctly under Liferay Portal npm architecture. + +To determine the version of `rxjs` to use, the plugin scans the parent directory +of `@angular/forms` for the `rxjs` package. + +You can find more information about what happens with `rxjs` and +`@angular/forms` in +[this issue](https://github.com/angular/angular/issues/17917). \ No newline at end of file diff --git a/packages/liferay-npm-bundler-plugin-replace-browser-modules/README.md b/packages/liferay-npm-bundler-plugin-replace-browser-modules/README.md index 3e59f9f9..c19b582d 100644 --- a/packages/liferay-npm-bundler-plugin-replace-browser-modules/README.md +++ b/packages/liferay-npm-bundler-plugin-replace-browser-modules/README.md @@ -2,15 +2,6 @@ > Replace modules listed under `browser` section of `package.json` files. -## Details - -This plugin scans `package.json` for a browser entry and copies browser modules -on top of server modules or deletes them when set to `false`. - -Please read the -[`browser` field specification](https://github.com/defunctzombie/package-browser-field-spec) -for more information. - ## Installation ``` @@ -29,4 +20,14 @@ Add the following to your `.npmbundlerrc` file: ] } } -``` \ No newline at end of file +``` + +## Technical Details + +This plugin scans `package.json` for a browser entry and copies browser modules +on top of server modules or deletes them when set to `false`. + +Please read the +[`browser` field specification](https://github.com/defunctzombie/package-browser-field-spec) +for more information. + From 40eb41cd64b26cfdf13ff0e5c9fa339e01f7380d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iva=CC=81n=20Zaera=20Avello=CC=81n?= Date: Tue, 22 Aug 2017 11:14:03 +0200 Subject: [PATCH 3/3] Add syntax highlighting. --- .../README.md | 4 ++-- .../README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/liferay-npm-bundler-plugin-inject-angular-dependencies/README.md b/packages/liferay-npm-bundler-plugin-inject-angular-dependencies/README.md index c7b5996d..2bfb52de 100644 --- a/packages/liferay-npm-bundler-plugin-inject-angular-dependencies/README.md +++ b/packages/liferay-npm-bundler-plugin-inject-angular-dependencies/README.md @@ -4,7 +4,7 @@ ## Installation -``` +```sh npm install --save-dev liferay-npm-bundler-plugin-inject-angular-dependencies ``` @@ -12,7 +12,7 @@ npm install --save-dev liferay-npm-bundler-plugin-inject-angular-dependencies Add the following to your `.npmbundlerrc` file: -``` +```json { "*": { "plugins": [ diff --git a/packages/liferay-npm-bundler-plugin-replace-browser-modules/README.md b/packages/liferay-npm-bundler-plugin-replace-browser-modules/README.md index c19b582d..c28041e2 100644 --- a/packages/liferay-npm-bundler-plugin-replace-browser-modules/README.md +++ b/packages/liferay-npm-bundler-plugin-replace-browser-modules/README.md @@ -4,7 +4,7 @@ ## Installation -``` +```sh npm install --save-dev liferay-npm-bundler-plugin-replace-browser-modules ``` @@ -12,7 +12,7 @@ npm install --save-dev liferay-npm-bundler-plugin-replace-browser-modules Add the following to your `.npmbundlerrc` file: -``` +```json { "*": { "plugins": [