From 5468e2cee76b572bef33e036ed3a9b816c40d84d Mon Sep 17 00:00:00 2001 From: Mahmoud Abduljawad Date: Fri, 14 May 2021 18:48:45 +0400 Subject: [PATCH 1/2] Update README.md - Specified versions for the different parts of the structure. - Added Using NativeScript plugins section --- packages/nx/README.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/packages/nx/README.md b/packages/nx/README.md index 9f9454e8e..c5797d3c9 100644 --- a/packages/nx/README.md +++ b/packages/nx/README.md @@ -9,6 +9,8 @@ +> Current version (1.0.x) of `@nativescript/nx` assumes you have NativeScript CLI v8.0.2. You can confirm your CLI version by running `ns --version`. + ## Table of Contents @@ -33,8 +35,10 @@ ### Create a new Nx workspace +> Nx workspace version must be on version 12.2, for that you need to append version number to `npx` command to avoid running `latest` version. + ```sh -npx create-nx-workspace --cli=nx --preset=empty +npx create-nx-workspace@12.2 --cli=nx --preset=empty ``` ### Install NativeScript plugin @@ -264,3 +268,23 @@ Which would generate a `buttons-nativescript` library. import { PrimaryButton } from '@myorg/buttons-nativescript'; ``` + +## Using NativeScript plugins + +NativeScript plugins can be used in Nx workspaces in one of the two following methods: + +### Installing NativeScript plugins at app-level + +If the plugin is needed by one app only, and not others, you can install it for the specific app: + +```sh +cd apps/ +ns plugin add +``` + +### Installing NativeScript plugins at workspace-level + +Alternatively, you can install the plugins at the workspace (root), so it is accesible to all your workspace apps: +```sh +npm install --save +``` From 6cb9455fff92bc4bbcaf6371a73a25b751e1ad36 Mon Sep 17 00:00:00 2001 From: Mahmoud Abduljawad Date: Sat, 15 May 2021 19:59:23 +0400 Subject: [PATCH 2/2] Update README.md - Applied comments by @/Github/NathanaelA. - Added Known issues section to Using NativeScript plugins. --- packages/nx/README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/nx/README.md b/packages/nx/README.md index c5797d3c9..152d21bfc 100644 --- a/packages/nx/README.md +++ b/packages/nx/README.md @@ -9,7 +9,7 @@ -> Current version (1.0.x) of `@nativescript/nx` assumes you have NativeScript CLI v8.0.2. You can confirm your CLI version by running `ns --version`. +> Requires at least NativeScript CLI v8.x.x or higher. You can confirm your CLI version by running `ns --version`. ## Table of Contents @@ -35,9 +35,10 @@ ### Create a new Nx workspace -> Nx workspace version must be on version 12.2, for that you need to append version number to `npx` command to avoid running `latest` version. - ```sh +npx create-nx-workspace@latest --cli=nx --preset=empty + +// If you run into any issue with latest Nx workspace version you may want to try the last known stable version with the following: npx create-nx-workspace@12.2 --cli=nx --preset=empty ``` @@ -288,3 +289,6 @@ Alternatively, you can install the plugins at the workspace (root), so it is acc ```sh npm install --save ``` + +### Known issues +If a plugin contains platforms folder with native includes, the plugin must be added to app package.json at moment. https://github.com/NativeScript/nx/issues/17#issuecomment-841680719