|
1 | 1 | # ngx-deploy-npm 🚀 <!-- omit in toc -->
|
2 | 2 |
|
3 |
| -<!-- [![Nx supported versions][supported-nx-versions]][nx-url] --> |
4 |
| - |
5 | 3 | [![NPM version][npm-image]][npm-url]
|
6 | 4 | [![NPM donwoads][downloads-image]][npm-url]
|
7 | 5 | [![The MIT License][mit-licence-image]][mit-licence-url]
|
|
18 | 16 | [![Publishment Status][publishment-image]][publishment-link]
|
19 | 17 | [![Test nx@next][next-tests-image]][next-tests-link]
|
20 | 18 |
|
21 |
| -## Supported Library Generators |
22 |
| - |
23 |
| -[![Angular][angular-image]][angular-link] |
24 |
| -[![NestJS][nest-js-image]][nest-js-link] |
25 |
| -[![Next JS][next-js-image]][next-js-link] |
26 |
| -[![Node][node-image]][node-link] |
27 |
| -[![JS][js-image]][js-link] |
28 |
| -[![Nx Plugin][nx-image]][nx-plugin-link] |
29 |
| -[![React][react-image]][react-link] |
30 |
| -[![React Native][react-native-image]][react-native-link] |
31 |
| - |
32 | 19 | <!-- Images -->
|
33 | 20 |
|
34 | 21 | [sonar-reliability-image]: https://sonarcloud.io/api/project_badges/measure?project=bikecoders_ngx-deploy-npm&metric=reliability_rating
|
|
45 | 32 | [macos-image]: https://img.shields.io/badge/mac%20os-000000?style=flat&logo=macos&logoColor=F0F0F0
|
46 | 33 | [windows-image]: https://img.shields.io/badge/Windows-0078D6?style=flat&logo=windows&logoColor=white
|
47 | 34 |
|
48 |
| -<!-- Projects --> |
49 |
| - |
50 |
| -[angular-image]: https://img.shields.io/badge/angular-%23DD0031.svg?style=flat&logo=angular&logoColor=white |
51 |
| -[nest-js-image]: https://img.shields.io/badge/nestjs-%23E0234E.svg?style=flat&logo=nestjs&logoColor=white |
52 |
| -[next-js-image]: https://img.shields.io/badge/Next-black?style=flat&logo=next.js&logoColor=white |
53 |
| -[node-image]: https://img.shields.io/badge/node.js-6DA55F?style=flat&logo=node.js&logoColor=white |
54 |
| -[js-image]: https://img.shields.io/badge/javascript-%23323330.svg?style=flat&logo=javascript&logoColor=%23F7DF1E |
55 |
| -[nx-image]: https://img.shields.io/badge/nx-143055?style=flat&logo=nx&logoColor=white |
56 |
| -[react-image]: https://img.shields.io/badge/react-%2320232a.svg?style=flat&logo=react&logoColor=%2361DAFB |
57 |
| -[react-native-image]: https://img.shields.io/badge/react_native-%2320232a.svg?style=flat&logo=react&logoColor=%2361DAFB |
58 |
| - |
59 | 35 | <!-- URLs -->
|
60 | 36 |
|
61 | 37 | [sonar-link]: https://sonarcloud.io/summary/new_code?id=bikecoders_ngx-deploy-npm
|
|
64 | 40 | [mit-licence-url]: http://opensource.org/licenses/MIT
|
65 | 41 | [conventional-commits-url]: https://conventionalcommits.org
|
66 | 42 | [next-tests-link]: https://github.com/bikecoders/ngx-deploy-npm/actions/workflows/test-nx-next.yml
|
67 |
| -[nx-url]: https://nx.dev/ |
68 |
| - |
69 |
| -<!-- Projects --> |
70 |
| - |
71 |
| -[angular-link]: https://nx.dev/packages/angular |
72 |
| -[nest-js-link]: https://nx.dev/packages/nest |
73 |
| -[next-js-link]: https://nx.dev/packages/next |
74 |
| -[node-link]: https://nx.dev/packages/node |
75 |
| -[js-link]: https://nx.dev/packages/js |
76 |
| -[nx-plugin-link]: https://nx.dev/packages/nx-plugin |
77 |
| -[react-link]: https://nx.dev/packages/react |
78 |
| -[react-native-link]: https://nx.dev/packages/react-native |
79 | 43 |
|
80 | 44 | 
|
81 | 45 |
|
|
85 | 49 |
|
86 | 50 | - [🚀 Quick Start (local development)](#quick-start-local-development)
|
87 | 51 | - [🚀 Continuous Delivery](#continuous-delivery)
|
88 |
| -- [❓What is done when executing `nx deploy`](#what-is-done-when-executing-nx-deploy) |
89 | 52 | - [📦 Options](#options)
|
90 | 53 | - [install](#install)
|
91 |
| - - [`--projects`](#--projects) |
| 54 | + - [`--dist-folder-path`](#--dist-folder-path-install) |
| 55 | + - [`--project`](#--project) |
92 | 56 | - [`--access`](#--access-install)
|
93 | 57 | - [deploy](#deploy)
|
94 |
| - - [`--build-target`](#--build-target) |
95 |
| - - [`--no-build`](#--no-build) |
96 | 58 | - [`--package-version`](#--package-version)
|
97 | 59 | - [`--tag`](#--tag)
|
98 | 60 | - [`--access`](#--access)
|
@@ -173,63 +135,45 @@ jobs:
|
173 | 135 |
|
174 | 136 | > You can check the steps suggested in the [CircleCI's guide](https://circleci.com/blog/publishing-npm-packages-using-circleci-2-0/)
|
175 | 137 |
|
176 |
| -## ❓What is done when executing `nx deploy` <a name="what-is-done-when-executing-nx-deploy"></a> |
177 |
| -
|
178 |
| -1. Will build the application using the target `build` |
179 |
| - - This will be omitted if the parameter `--no-build` is set |
180 |
| -2. Execute `npm publish` |
| 138 | +## 📦 Options <a name="options"></a> |
181 | 139 |
|
182 |
| -The following is the activity diagram. |
| 140 | +### install |
183 | 141 |
|
184 |
| - |
| 142 | +#### `--dist-folder-path` <a name="--dist-folder-path-install"></a> |
185 | 143 |
|
186 |
| -## 📦 Options <a name="options"></a> |
| 144 | +- **required** |
| 145 | +- Example: |
| 146 | + - `nx generate ngx-deploy-npm:install --project=lib-1 --dist-folder-path="dist/libs/lib-1"` |
187 | 147 |
|
188 |
| -### install |
| 148 | +Indicates the dist folder path. The path where is located the bundle of your library. The path should be relative to the project's root. |
189 | 149 |
|
190 |
| -#### `--projects` |
| 150 | +#### `--project` |
191 | 151 |
|
192 |
| -- **optional** |
| 152 | +- **required** |
193 | 153 | - Example:
|
194 |
| - - `nx generate ngx-deploy-npm:install --projects=lib-1,lib-2` – Only `lib-1` and `lib-2` are going to configure |
| 154 | + - `nx generate ngx-deploy-npm:install --project=lib-1 --dist-folder-path="dist/libs/lib-1"` – `lib-1` will be configured. It will create the target deploy with the default options on the project `lib-1`. |
195 | 155 |
|
196 |
| -Specify which libraries should be configured. Useful when you have a workspace with several libraries and don't want to overwrite existing configuration |
197 |
| -Should be `,` separated, without spaces. |
| 156 | +Specify which library should be configured. |
198 | 157 |
|
199 | 158 | #### `--access` <a name="--access-install"></a>
|
200 | 159 |
|
201 | 160 | - **optional**
|
202 | 161 | - Default: `public`
|
203 | 162 | - Example:
|
204 |
| - - `nx generate ngx-deploy-npm:install --access=restricted` |
| 163 | + - `nx generate ngx-deploy-npm:install --access=restricted --project=lib-1 --dist-folder-path="dist/libs/lib-1"` |
205 | 164 |
|
206 | 165 | Tells the registry whether to publish the package as public or restricted. It only applies to scoped packages, which default to restricted. If you don't have a paid account, you must publish with --access public to publish scoped packages.
|
207 | 166 |
|
208 | 167 | ### deploy
|
209 | 168 |
|
210 |
| -#### `--build-target` |
211 |
| -
|
212 |
| -- **optional** |
213 |
| -- Example: |
214 |
| - - `nx deploy --build-target=production` – The configuration `production` is being used to build your package |
215 |
| -
|
216 |
| -The `buildTarget` points to an existing target configuration on your project, |
217 |
| -as specified in the `configurations` section of `workspace.json`. |
218 |
| -
|
219 |
| -This option is equivalent to calling the command `nx build --configuration=XXX`. |
220 |
| -This command has no effect if the option `--no-build` option is active. |
221 |
| -
|
222 |
| -#### `--no-build` |
| 169 | +#### `--dist-folder-path` |
223 | 170 |
|
224 |
| -- **optional** |
225 |
| -- Default: `false` (string) |
| 171 | +- **required** |
226 | 172 | - Example:
|
227 |
| - - `nx deploy` – The library is built in production mode before the deployment |
228 |
| - - `nx deploy --no-build` – The library is NOT built, but the deployment process is being made |
| 173 | + - `nx deploy --dist-folder-path='dist/libs/my-project'` |
229 | 174 |
|
230 |
| -Skip build process during deployment. |
231 |
| -This option is useful when the building process is handled by something else. |
232 |
| -This command causes the `--build-target` setting to have no effect. |
| 175 | +Indicate the dist folder path. |
| 176 | +The path must relative to project's root. |
233 | 177 |
|
234 | 178 | #### `--package-version`
|
235 | 179 |
|
@@ -281,20 +225,11 @@ Configure npm to use any compatible registry you like, and even run your own reg
|
281 | 225 |
|
282 | 226 | For testing: Run through without making any changes. Execute with `--dry-run`, and nothing will happen. It will show a list of the options used on the console.
|
283 | 227 |
|
284 |
| -#### `--dist-folder-path` |
285 |
| -
|
286 |
| -- **optional** |
287 |
| -- Example: |
288 |
| - - `nx deploy --dist-folder-path 'dist/my-unsupported-project'` |
289 |
| -
|
290 |
| -Indicate a custom dist folder path. |
291 |
| -The path must relative to project's root. |
292 |
| -Especially useful when ngx-deploy-npm can not detect your library dist folder path automatically. [Write us an issue](https://github.com/bikecoders/ngx-deploy-npm/issues/new) if you think we should support the library you are trying to publish |
293 |
| - |
294 | 228 | ## Compatibility overview with Nx
|
295 | 229 |
|
296 | 230 | | Version | Nx Workspace Version |
|
297 | 231 | | ------- | ---------------------- |
|
| 232 | +| v8.0.0 | `^16.0.0 \|\| ^17.0.0` | |
298 | 233 | | v7.1.0 | `^16.0.0 \|\| ^17.0.0` |
|
299 | 234 | | v7.0.1 | `^16.0.0` |
|
300 | 235 |
|
@@ -344,7 +279,7 @@ We use `@jscutlery/semver` here on `ngx-deploy-npm` to generate the package's ne
|
344 | 279 |
|
345 | 280 | ### Only publishable libraries are being configured <!-- omit in toc -->
|
346 | 281 |
|
347 |
| -For an Nx workspace, only publishable libraries are going to be configured. |
| 282 | +Only publishable libraries are going to be configured. |
348 | 283 |
|
349 | 284 | ## 🎉 Do you Want to Contribute? <a name="do-you-want-to-contribute"></a>
|
350 | 285 |
|
|
0 commit comments