docs(core): npm workspace tutorial (#22018)
This commit is contained in:
parent
72681b4707
commit
650dcf31af
@ -17,12 +17,18 @@ We are generally following the [Diataxis](https://diataxis.fr) model where docum
|
||||
|
||||
We also have different audiences in mind when writing docs:
|
||||
|
||||
👶 New user
|
||||
👶 New user starting from scratch
|
||||
|
||||
- They know their framework of choice
|
||||
- They have probably heard the term monorepo but don't really know what it is
|
||||
- They're smart and eager to learn
|
||||
|
||||
👶 New user migrating an existing repo
|
||||
|
||||
- They know their framework of choice
|
||||
- They know how npm workspaces work
|
||||
- They're smart and eager to learn
|
||||
|
||||
👦 Intermediate User
|
||||
|
||||
- They know how to create an Nx repo or add Nx to an existing repo
|
||||
|
||||
@ -39,9 +39,9 @@
|
||||
"isExternal": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "Package-Based Monorepo",
|
||||
"path": "/getting-started/tutorials/package-based-repo-tutorial",
|
||||
"id": "package-based-repo-tutorial",
|
||||
"name": "NPM Workspaces Monorepo",
|
||||
"path": "/getting-started/tutorials/npm-workspaces-tutorial",
|
||||
"id": "npm-workspaces-tutorial",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
@ -131,9 +131,9 @@
|
||||
"isExternal": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "Package-Based Monorepo",
|
||||
"path": "/getting-started/tutorials/package-based-repo-tutorial",
|
||||
"id": "package-based-repo-tutorial",
|
||||
"name": "NPM Workspaces Monorepo",
|
||||
"path": "/getting-started/tutorials/npm-workspaces-tutorial",
|
||||
"id": "npm-workspaces-tutorial",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
@ -190,9 +190,9 @@
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Package-Based Monorepo",
|
||||
"path": "/getting-started/tutorials/package-based-repo-tutorial",
|
||||
"id": "package-based-repo-tutorial",
|
||||
"name": "NPM Workspaces Monorepo",
|
||||
"path": "/getting-started/tutorials/npm-workspaces-tutorial",
|
||||
"id": "npm-workspaces-tutorial",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
|
||||
@ -47,14 +47,14 @@
|
||||
"file": "",
|
||||
"itemList": [
|
||||
{
|
||||
"id": "package-based-repo-tutorial",
|
||||
"name": "Package-Based Monorepo",
|
||||
"id": "npm-workspaces-tutorial",
|
||||
"name": "NPM Workspaces Monorepo",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/npm-tutorial/package-based",
|
||||
"file": "shared/tutorials/npm-workspaces",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/getting-started/tutorials/package-based-repo-tutorial",
|
||||
"path": "/getting-started/tutorials/npm-workspaces-tutorial",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
@ -174,14 +174,14 @@
|
||||
"file": "",
|
||||
"itemList": [
|
||||
{
|
||||
"id": "package-based-repo-tutorial",
|
||||
"name": "Package-Based Monorepo",
|
||||
"id": "npm-workspaces-tutorial",
|
||||
"name": "NPM Workspaces Monorepo",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/npm-tutorial/package-based",
|
||||
"file": "shared/tutorials/npm-workspaces",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/getting-started/tutorials/package-based-repo-tutorial",
|
||||
"path": "/getting-started/tutorials/npm-workspaces-tutorial",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
@ -255,15 +255,15 @@
|
||||
"path": "/getting-started/tutorials",
|
||||
"tags": []
|
||||
},
|
||||
"/getting-started/tutorials/package-based-repo-tutorial": {
|
||||
"id": "package-based-repo-tutorial",
|
||||
"name": "Package-Based Monorepo",
|
||||
"/getting-started/tutorials/npm-workspaces-tutorial": {
|
||||
"id": "npm-workspaces-tutorial",
|
||||
"name": "NPM Workspaces Monorepo",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/npm-tutorial/package-based",
|
||||
"file": "shared/tutorials/npm-workspaces",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/getting-started/tutorials/package-based-repo-tutorial",
|
||||
"path": "/getting-started/tutorials/npm-workspaces-tutorial",
|
||||
"tags": []
|
||||
},
|
||||
"/getting-started/tutorials/integrated-repo-tutorial": {
|
||||
|
||||
@ -34,9 +34,9 @@
|
||||
"description": "Get started with basic information, concepts and tutorials.",
|
||||
"itemList": [
|
||||
{
|
||||
"name": "Package-Based Monorepo",
|
||||
"id": "package-based-repo-tutorial",
|
||||
"file": "shared/npm-tutorial/package-based"
|
||||
"name": "NPM Workspaces Monorepo",
|
||||
"id": "npm-workspaces-tutorial",
|
||||
"file": "shared/tutorials/npm-workspaces"
|
||||
},
|
||||
{
|
||||
"name": "Integrated Monorepo",
|
||||
|
||||
@ -27,7 +27,7 @@ Someone who appreciates the flexibility of a package-based repository will be mo
|
||||
- Easily create new projects or tools with [code generators](/features/generate-code)
|
||||
|
||||
{% cards %}
|
||||
{% card title="Tutorial: Getting Started with Package-Based Repos" description="Walkthrough for creating a package-based monorepo with Nx" type="documentation" url="/getting-started/tutorials/package-based-repo-tutorial" /%}
|
||||
{% card title="NPM Workspaces Tutorial" description="Add Nx to an existing NPM workspaces repo" type="documentation" url="/getting-started/tutorials/npm-workspaces-tutorial" /%}
|
||||
{% /cards %}
|
||||
|
||||
## Integrated Repos
|
||||
@ -43,7 +43,8 @@ Someone who appreciates the structure and consistency of an integrated repositor
|
||||
- [Automate updating dependencies](/features/automate-updating-dependencies) of the entire toolchain
|
||||
|
||||
{% cards %}
|
||||
{% card title="Tutorial: Getting Started with Integrated Repos" description="Walkthrough for creating an integrated monorepo with Nx" type="documentation" url="/getting-started/tutorials/integrated-repo-tutorial" /%}
|
||||
{% card title="Tutorial: React Monorepo" description="Create a React monorepo with Nx" type="documentation" url="/getting-started/tutorials/react-monorepo-tutorial" /%}
|
||||
{% card title="Tutorial: Angular Monorepo" description="Create an Angular monorepo with Nx" type="documentation" url="/getting-started/tutorials/angular-monorepo-tutorial" /%}
|
||||
{% /cards %}
|
||||
|
||||
## Standalone Applications
|
||||
|
||||
@ -35,7 +35,7 @@ npx create-nx-workspace@latest
|
||||
|
||||
{% cards cols="2" lgCols="5" mdCols="5" smCols="2" %}
|
||||
|
||||
{% link-card title="Package Based Monorepos" type="tutorial" url="/getting-started/tutorials/package-based-repo-tutorial" icon="jsMono" /%}
|
||||
{% link-card title="NPM Workspaces" type="tutorial" url="/getting-started/tutorials/npm-workspaces-tutorial" icon="jsMono" /%}
|
||||
|
||||
{% link-card title="Integrated Monorepos" type="tutorial" url="/getting-started/tutorials/integrated-repo-tutorial" icon="nx" /%}
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
Interested in migrating from [Lerna](https://github.com/lerna/lerna) in particular? In case you missed it, Lerna v6 is powering Nx underneath. As a result, Lerna gets all the modern features such as caching and task pipelines. Read more on [https://lerna.js.org/upgrade](https://lerna.js.org/upgrade).
|
||||
{% /callout %}
|
||||
|
||||
Nx has first-class support for [monorepos](/getting-started/tutorials/package-based-repo-tutorial). As a result, if you have an existing NPM/Yarn or PNPM-based monorepo setup, you can easily add Nx to get
|
||||
Nx has first-class support for [monorepos](/getting-started/tutorials/npm-workspaces-tutorial). As a result, if you have an existing NPM/Yarn or PNPM-based monorepo setup, you can easily add Nx to get
|
||||
|
||||
- fast [task scheduling](/features/run-tasks)
|
||||
- support for [task pipelines](/concepts/task-pipeline-configuration)
|
||||
|
||||
@ -1,293 +0,0 @@
|
||||
# Getting Started with Package-Based Repos
|
||||
|
||||
{% youtube
|
||||
src="https://www.youtube.com/embed/hzTMKuE3CDw"
|
||||
title="Tutorial: Getting Started with Package-Based Repos"
|
||||
/%}
|
||||
|
||||
{% github-repository url="https://github.com/nrwl/nx-recipes/tree/main/package-based" /%}
|
||||
|
||||
## Create a New Workspace
|
||||
|
||||
Start by creating a new workspace. We can use the following command that will help us set it up.
|
||||
|
||||
```shell
|
||||
npx create-nx-workspace@latest package-based --preset=npm
|
||||
```
|
||||
|
||||
The file structure should look like this:
|
||||
|
||||
```treeview
|
||||
package-based/
|
||||
├── packages/
|
||||
├── nx.json
|
||||
└── package.json
|
||||
```
|
||||
|
||||
## Create a Package
|
||||
|
||||
The `packages` folder is where we host our monorepo libraries. Create a new `is-even` folder with the following structure:
|
||||
|
||||
```treeview
|
||||
package-based/
|
||||
├── packages/
|
||||
│ └── is-even/
|
||||
│ ├── index.ts
|
||||
│ └── package.json
|
||||
├── nx.json
|
||||
└── package.json
|
||||
```
|
||||
|
||||
Update the content of the files to match the following:
|
||||
|
||||
{% tabs %}
|
||||
{% tab label="index.ts" %}
|
||||
|
||||
```ts {% fileName="packages/is-even/index.ts" %}
|
||||
export const isEven = (x: number) => x % 2 === 0;
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="package.json" %}
|
||||
|
||||
```json {% fileName="packages/is-even/package.json" %}
|
||||
{
|
||||
"name": "is-even",
|
||||
"version": "0.0.0",
|
||||
"main": "dist/index.js",
|
||||
"devDependencies": {},
|
||||
"scripts": {
|
||||
"build": "tsc index.ts --outDir dist"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% /tabs %}
|
||||
|
||||
Next install TypeScript (notice we're using `tsc` for the `build` script in `package.json` above). While we could install TypeScript at the package-level, it is more convenient to have it globally for the entire monorepo. Run the following command at the root of your workspace.
|
||||
|
||||
{% tabs %}
|
||||
{% tab label="npm" %}
|
||||
|
||||
```shell
|
||||
npm add -D typescript
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="yarn" %}
|
||||
|
||||
```shell
|
||||
yarn add -D typescript
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="pnpm" %}
|
||||
|
||||
```shell
|
||||
pnpm add -D typescript
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% /tabs %}
|
||||
|
||||
Next run your `build` script with:
|
||||
|
||||
```shell
|
||||
npx nx build is-even
|
||||
```
|
||||
|
||||
Your built package now exists in the `packages/is-even/dist` directory as expected.
|
||||
|
||||
## Local Linking of Packages
|
||||
|
||||
Linking packages locally in a package-based monorepo style is done with NPM/Yarn/PNPM workspaces. In this specific setup we use NPM workspaces (see the `workspaces` property of the `package.json` file at the root of your workspace).
|
||||
|
||||
To illustrate how packages can be linked locally, let's create another package called: `is-odd`. You can copy the existing `is-even` package:
|
||||
|
||||
```treeview
|
||||
package-based/
|
||||
├── packages/
|
||||
│ ├── is-even/
|
||||
│ │ ├── index.ts
|
||||
│ │ └── package.json
|
||||
│ └── is-odd/
|
||||
│ ├── index.ts
|
||||
│ └── package.json
|
||||
├── nx.json
|
||||
└── package.json
|
||||
```
|
||||
|
||||
Here's what the content of the files should look like:
|
||||
|
||||
{% tabs %}
|
||||
{% tab label="index.ts" %}
|
||||
|
||||
```ts {% fileName="packages/is-odd/index.ts" %}
|
||||
import { isEven } from 'is-even';
|
||||
|
||||
export const isOdd = (x: number) => !isEven(x);
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="package.json" %}
|
||||
|
||||
```json {% fileName="packages/is-odd/package.json" %}
|
||||
{
|
||||
"name": "is-odd",
|
||||
"version": "0.0.0",
|
||||
"main": "dist/index.js",
|
||||
"devDependencies": {},
|
||||
"scripts": {
|
||||
"build": "tsc index.ts --outDir dist"
|
||||
},
|
||||
"dependencies": {
|
||||
"is-even": "*"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% /tabs %}
|
||||
|
||||
`is-odd` imports the `isEven` function from your `is-even` package. Therefore its `package.json` file should list the `is-even` package in its `package.json` file as a dependency.
|
||||
|
||||
The `workspaces` property in the root-level `package.json` tells NPM to create links for all packages found in the `packages` directory. This removes the need to publish them first to a NPM registry. (Similar functionality exists for Yarn and PNPM workspaces as well.)
|
||||
|
||||
At the root of your workspace run:
|
||||
|
||||
{% tabs %}
|
||||
{% tab label="npm" %}
|
||||
|
||||
```shell
|
||||
npm install
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="yarn" %}
|
||||
|
||||
```shell
|
||||
yarn
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="pnpm" %}
|
||||
|
||||
```shell
|
||||
pnpm install
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% /tabs %}
|
||||
|
||||
NPM will create a Symbolic Link in your file system at: `node_modules/is-even` and `node_modules/is-odd`, so they reflect changes to your `packages/is-even` and `packages/is-odd` directories as they happen.
|
||||
|
||||
## Task Dependencies
|
||||
|
||||
Most monorepos have dependencies not only among different packages, but also among their tasks.
|
||||
|
||||
For example, whenever we build `is-odd` we need to ensure that `is-even` is built beforehand. Nx can define such task dependencies by adding a `targetDefaults` property to `nx.json`.
|
||||
|
||||
```json {% fileName="nx.json" %}
|
||||
{
|
||||
...
|
||||
"targetDefaults": {
|
||||
"build": {
|
||||
"dependsOn": ["^build"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This tells Nx to run the `build` target of all the dependent projects first, before the `build` target of the package itself is being run.
|
||||
|
||||
Remove any existing `dist` folder and run:
|
||||
|
||||
```shell
|
||||
npx nx build is-odd
|
||||
```
|
||||
|
||||
It will automatically first run `build` for the `is-even` package, and then the `build` for `is-odd`. Note that if `is-even` has been built before, it would just be restored out of the cache.
|
||||
|
||||
## Cache Build Results
|
||||
|
||||
Run the command:
|
||||
|
||||
```{% command="npx nx build is-even" %}
|
||||
> nx run is-even:build [existing outputs match the cache, left as is]
|
||||
|
||||
|
||||
> is-even@0.0.0 build
|
||||
> tsc index.ts --outDir dist
|
||||
|
||||
|
||||
——————————————————————————————————————————————————————————————————————————————————————————
|
||||
|
||||
NX Successfully ran target build for project is-even (33ms)
|
||||
|
||||
Nx read the output from the cache instead of running the command for 1 out of 1 tasks.
|
||||
|
||||
```
|
||||
|
||||
Note that the cache for the `build` script was already populated when we ran it previously in this tutorial.
|
||||
|
||||
## Running Multiple Tasks
|
||||
|
||||
To run the `build` target for all the packages in the workspace, use:
|
||||
|
||||
```{% command="npx nx run-many -t build" %}
|
||||
✔ nx run is-even:build [existing outputs match the cache, left as is]
|
||||
✔ nx run is-odd:build [existing outputs match the cache, left as is]
|
||||
|
||||
————————————————————————————————————————————————————————————————————————————————————————
|
||||
|
||||
NX Successfully ran target build for 2 projects (35ms)
|
||||
|
||||
Nx read the output from the cache instead of running the command for 2 out of 2 tasks.
|
||||
```
|
||||
|
||||
Notice that both builds are replayed from cache. We can skip the cache by adding the `--skip-nx-cache` option:
|
||||
|
||||
```{% command="npx nx run-many -t build --skip-nx-cache" %}
|
||||
✔ nx run is-even:build (1s)
|
||||
✔ nx run is-odd:build (1s)
|
||||
|
||||
———————————————————————————————————————————————————————————————————————
|
||||
|
||||
NX Successfully ran target build for 2 projects (2s)
|
||||
```
|
||||
|
||||
Notice that using this method, the `is-even` build ran before the `is-odd` build, and that the `is-even` build only happened once. This demonstrates how `run-many` is informed by the `targetDefaults` we set earlier.
|
||||
|
||||
You can also only run tasks on packages that got changed by using the command:
|
||||
|
||||
```{% command="npx nx affected -t build" %}
|
||||
|
||||
NX Affected criteria defaulted to --base=main --head=HEAD
|
||||
|
||||
|
||||
✔ nx run is-even:build [existing outputs match the cache, left as is]
|
||||
✔ nx run is-odd:build [existing outputs match the cache, left as is]
|
||||
|
||||
——————————————————————————————————————————————————————————————————————————————————————————————
|
||||
|
||||
NX Successfully ran target build for 2 projects (34ms)
|
||||
|
||||
Nx read the output from the cache instead of running the command for 2 out of 2 tasks.
|
||||
```
|
||||
|
||||
Notice that the `base` and `head` options were populated with their default values. You could provide your own options here as needed. Notice too that the cache is also used with the `affected` command.
|
||||
|
||||
## Learn More
|
||||
|
||||
{% cards %}
|
||||
|
||||
{% card title="Core Features" description="Read about the core features of Nx." url="/features" /%}
|
||||
|
||||
{% card title="Mental Model" description="Get a deeper understanding of the mental model." url="/concepts/mental-model" /%}
|
||||
|
||||
{% card title="Adopting Nx" description="Learn how to add Nx to your existing repo." url="/recipes/adopting-nx" /%}
|
||||
|
||||
{% card title="Integrated Repos vs Package-Based Repos" description="Learn about two styles of monorepos." url="/concepts/integrated-vs-package-based" /%}
|
||||
|
||||
{% /cards %}
|
||||
@ -5,7 +5,7 @@
|
||||
- [Installation](/getting-started/installation)
|
||||
- [Why Nx?](/getting-started/why-nx)
|
||||
- [Tutorials](/getting-started/tutorials)
|
||||
- [Package-Based Monorepo](/getting-started/tutorials/package-based-repo-tutorial)
|
||||
- [NPM Workspaces Monorepo](/getting-started/tutorials/npm-workspaces-tutorial)
|
||||
- [Integrated Monorepo](/getting-started/tutorials/integrated-repo-tutorial)
|
||||
- [React Standalone](/getting-started/tutorials/react-standalone-tutorial)
|
||||
- [React Monorepo](/getting-started/tutorials/react-monorepo-tutorial)
|
||||
|
||||
891
docs/shared/tutorials/npm-workspaces-build-tasks1.json
Normal file
891
docs/shared/tutorials/npm-workspaces-build-tasks1.json
Normal file
@ -0,0 +1,891 @@
|
||||
{
|
||||
"taskId": "@tuskdesign/demo:build",
|
||||
"projects": [
|
||||
{
|
||||
"name": "@tuskdesign/buttons",
|
||||
"type": "lib",
|
||||
"data": {
|
||||
"root": "packages/buttons",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "nx:run-script",
|
||||
"dependsOn": ["^build"],
|
||||
"outputs": ["{projectRoot}/dist"],
|
||||
"cache": true,
|
||||
"options": {
|
||||
"script": "build"
|
||||
},
|
||||
"configurations": {}
|
||||
},
|
||||
"typecheck": {
|
||||
"executor": "nx:run-script",
|
||||
"cache": true,
|
||||
"options": {
|
||||
"script": "typecheck"
|
||||
},
|
||||
"configurations": {}
|
||||
},
|
||||
"dev": {
|
||||
"executor": "nx:run-script",
|
||||
"options": {
|
||||
"script": "dev"
|
||||
},
|
||||
"configurations": {}
|
||||
},
|
||||
"nx-release-publish": {
|
||||
"dependsOn": ["^nx-release-publish"],
|
||||
"executor": "@nx/js:release-publish",
|
||||
"options": {},
|
||||
"configurations": {}
|
||||
}
|
||||
},
|
||||
"sourceRoot": "packages/buttons",
|
||||
"name": "@tuskdesign/buttons",
|
||||
"projectType": "library",
|
||||
"implicitDependencies": [],
|
||||
"tags": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@tuskdesign/forms",
|
||||
"type": "lib",
|
||||
"data": {
|
||||
"root": "packages/forms",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "nx:run-script",
|
||||
"dependsOn": ["^build"],
|
||||
"outputs": ["{projectRoot}/dist"],
|
||||
"cache": true,
|
||||
"options": {
|
||||
"script": "build"
|
||||
},
|
||||
"configurations": {}
|
||||
},
|
||||
"typecheck": {
|
||||
"executor": "nx:run-script",
|
||||
"cache": true,
|
||||
"options": {
|
||||
"script": "typecheck"
|
||||
},
|
||||
"configurations": {}
|
||||
},
|
||||
"dev": {
|
||||
"executor": "nx:run-script",
|
||||
"options": {
|
||||
"script": "dev"
|
||||
},
|
||||
"configurations": {}
|
||||
},
|
||||
"nx-release-publish": {
|
||||
"dependsOn": ["^nx-release-publish"],
|
||||
"executor": "@nx/js:release-publish",
|
||||
"options": {},
|
||||
"configurations": {}
|
||||
}
|
||||
},
|
||||
"sourceRoot": "packages/forms",
|
||||
"name": "@tuskdesign/forms",
|
||||
"projectType": "library",
|
||||
"implicitDependencies": [],
|
||||
"tags": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@tuskdesign/demo",
|
||||
"type": "lib",
|
||||
"data": {
|
||||
"root": "apps/demo",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "nx:run-script",
|
||||
"dependsOn": ["^build"],
|
||||
"outputs": ["{projectRoot}/dist"],
|
||||
"cache": true,
|
||||
"options": {
|
||||
"script": "build"
|
||||
},
|
||||
"configurations": {}
|
||||
},
|
||||
"typecheck": {
|
||||
"executor": "nx:run-script",
|
||||
"cache": true,
|
||||
"options": {
|
||||
"script": "typecheck"
|
||||
},
|
||||
"configurations": {}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "nx:run-script",
|
||||
"cache": true,
|
||||
"options": {
|
||||
"script": "lint"
|
||||
},
|
||||
"configurations": {}
|
||||
},
|
||||
"dev": {
|
||||
"executor": "nx:run-script",
|
||||
"options": {
|
||||
"script": "dev"
|
||||
},
|
||||
"configurations": {}
|
||||
},
|
||||
"prebuild": {
|
||||
"executor": "nx:run-script",
|
||||
"options": {
|
||||
"script": "prebuild"
|
||||
},
|
||||
"configurations": {}
|
||||
},
|
||||
"preview": {
|
||||
"executor": "nx:run-script",
|
||||
"options": {
|
||||
"script": "preview"
|
||||
},
|
||||
"configurations": {}
|
||||
}
|
||||
},
|
||||
"sourceRoot": "apps/demo",
|
||||
"name": "@tuskdesign/demo",
|
||||
"projectType": "library",
|
||||
"implicitDependencies": [],
|
||||
"tags": []
|
||||
}
|
||||
}
|
||||
],
|
||||
"taskGraphs": {
|
||||
"@tuskdesign/buttons:build": {
|
||||
"roots": ["@tuskdesign/buttons:build"],
|
||||
"tasks": {
|
||||
"@tuskdesign/buttons:build": {
|
||||
"id": "@tuskdesign/buttons:build",
|
||||
"target": {
|
||||
"project": "@tuskdesign/buttons",
|
||||
"target": "build"
|
||||
},
|
||||
"projectRoot": "packages/buttons",
|
||||
"overrides": {},
|
||||
"outputs": ["packages/buttons/dist"],
|
||||
"cache": true
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@tuskdesign/buttons:build": []
|
||||
}
|
||||
},
|
||||
"@tuskdesign/forms:build": {
|
||||
"roots": ["@tuskdesign/buttons:build"],
|
||||
"tasks": {
|
||||
"@tuskdesign/forms:build": {
|
||||
"id": "@tuskdesign/forms:build",
|
||||
"target": {
|
||||
"project": "@tuskdesign/forms",
|
||||
"target": "build"
|
||||
},
|
||||
"projectRoot": "packages/forms",
|
||||
"overrides": {},
|
||||
"outputs": ["packages/forms/dist"],
|
||||
"cache": true
|
||||
},
|
||||
"@tuskdesign/buttons:build": {
|
||||
"id": "@tuskdesign/buttons:build",
|
||||
"target": {
|
||||
"project": "@tuskdesign/buttons",
|
||||
"target": "build"
|
||||
},
|
||||
"projectRoot": "packages/buttons",
|
||||
"overrides": {
|
||||
"__overrides_unparsed__": []
|
||||
},
|
||||
"outputs": ["packages/buttons/dist"],
|
||||
"cache": true
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@tuskdesign/forms:build": ["@tuskdesign/buttons:build"],
|
||||
"@tuskdesign/buttons:build": []
|
||||
}
|
||||
},
|
||||
"@tuskdesign/demo:build": {
|
||||
"roots": ["@tuskdesign/buttons:build"],
|
||||
"tasks": {
|
||||
"@tuskdesign/demo:build": {
|
||||
"id": "@tuskdesign/demo:build",
|
||||
"target": {
|
||||
"project": "@tuskdesign/demo",
|
||||
"target": "build"
|
||||
},
|
||||
"projectRoot": "apps/demo",
|
||||
"overrides": {},
|
||||
"outputs": ["apps/demo/dist"],
|
||||
"cache": true
|
||||
},
|
||||
"@tuskdesign/buttons:build": {
|
||||
"id": "@tuskdesign/buttons:build",
|
||||
"target": {
|
||||
"project": "@tuskdesign/buttons",
|
||||
"target": "build"
|
||||
},
|
||||
"projectRoot": "packages/buttons",
|
||||
"overrides": {
|
||||
"__overrides_unparsed__": []
|
||||
},
|
||||
"outputs": ["packages/buttons/dist"],
|
||||
"cache": true
|
||||
},
|
||||
"@tuskdesign/forms:build": {
|
||||
"id": "@tuskdesign/forms:build",
|
||||
"target": {
|
||||
"project": "@tuskdesign/forms",
|
||||
"target": "build"
|
||||
},
|
||||
"projectRoot": "packages/forms",
|
||||
"overrides": {
|
||||
"__overrides_unparsed__": []
|
||||
},
|
||||
"outputs": ["packages/forms/dist"],
|
||||
"cache": true
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@tuskdesign/demo:build": [
|
||||
"@tuskdesign/buttons:build",
|
||||
"@tuskdesign/forms:build"
|
||||
],
|
||||
"@tuskdesign/buttons:build": [],
|
||||
"@tuskdesign/forms:build": ["@tuskdesign/buttons:build"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": {},
|
||||
"plans": {
|
||||
"@tuskdesign/buttons:build": [
|
||||
"{workspaceRoot}/.gitignore",
|
||||
"{workspaceRoot}/.nxignore",
|
||||
"{workspaceRoot}/nx.json",
|
||||
"@tuskdesign/buttons:{projectRoot}/**/*",
|
||||
"@tuskdesign/buttons:ProjectConfiguration",
|
||||
"@tuskdesign/buttons:TsConfig",
|
||||
"npm:@esbuild/android-arm",
|
||||
"npm:@esbuild/linux-loong64",
|
||||
"npm:@isaacs/cliui",
|
||||
"npm:@jridgewell/gen-mapping",
|
||||
"npm:@jridgewell/resolve-uri",
|
||||
"npm:@jridgewell/set-array",
|
||||
"npm:@jridgewell/sourcemap-codec",
|
||||
"npm:@jridgewell/trace-mapping",
|
||||
"npm:@nodelib/fs.scandir",
|
||||
"npm:@nodelib/fs.stat",
|
||||
"npm:@nodelib/fs.walk",
|
||||
"npm:@pkgjs/parseargs",
|
||||
"npm:ansi-regex",
|
||||
"npm:ansi-styles",
|
||||
"npm:any-promise",
|
||||
"npm:anymatch",
|
||||
"npm:array-union",
|
||||
"npm:balanced-match",
|
||||
"npm:binary-extensions",
|
||||
"npm:brace-expansion",
|
||||
"npm:braces",
|
||||
"npm:bundle-require",
|
||||
"npm:cac",
|
||||
"npm:chokidar",
|
||||
"npm:commander",
|
||||
"npm:cross-spawn",
|
||||
"npm:debug",
|
||||
"npm:dir-glob",
|
||||
"npm:eastasianwidth",
|
||||
"npm:emoji-regex",
|
||||
"npm:esbuild",
|
||||
"npm:esbuild-android-64",
|
||||
"npm:esbuild-android-arm64",
|
||||
"npm:esbuild-darwin-64",
|
||||
"npm:esbuild-darwin-arm64",
|
||||
"npm:esbuild-freebsd-64",
|
||||
"npm:esbuild-freebsd-arm64",
|
||||
"npm:esbuild-linux-32",
|
||||
"npm:esbuild-linux-64",
|
||||
"npm:esbuild-linux-arm",
|
||||
"npm:esbuild-linux-arm64",
|
||||
"npm:esbuild-linux-mips64le",
|
||||
"npm:esbuild-linux-ppc64le",
|
||||
"npm:esbuild-linux-riscv64",
|
||||
"npm:esbuild-linux-s390x",
|
||||
"npm:esbuild-netbsd-64",
|
||||
"npm:esbuild-openbsd-64",
|
||||
"npm:esbuild-sunos-64",
|
||||
"npm:esbuild-windows-32",
|
||||
"npm:esbuild-windows-64",
|
||||
"npm:esbuild-windows-arm64",
|
||||
"npm:execa",
|
||||
"npm:fast-glob",
|
||||
"npm:fastq",
|
||||
"npm:fill-range",
|
||||
"npm:foreground-child",
|
||||
"npm:fsevents",
|
||||
"npm:get-stream",
|
||||
"npm:glob",
|
||||
"npm:glob-parent",
|
||||
"npm:globby",
|
||||
"npm:human-signals",
|
||||
"npm:ignore",
|
||||
"npm:is-binary-path",
|
||||
"npm:is-extglob",
|
||||
"npm:is-glob",
|
||||
"npm:is-number",
|
||||
"npm:is-stream",
|
||||
"npm:isexe",
|
||||
"npm:jackspeak",
|
||||
"npm:joycon",
|
||||
"npm:js-tokens",
|
||||
"npm:lilconfig",
|
||||
"npm:lines-and-columns",
|
||||
"npm:load-tsconfig",
|
||||
"npm:lodash.sortby",
|
||||
"npm:loose-envify",
|
||||
"npm:lru-cache",
|
||||
"npm:merge-stream",
|
||||
"npm:merge2",
|
||||
"npm:micromatch",
|
||||
"npm:mimic-fn",
|
||||
"npm:minimatch",
|
||||
"npm:minipass",
|
||||
"npm:ms",
|
||||
"npm:mz",
|
||||
"npm:nanoid",
|
||||
"npm:normalize-path",
|
||||
"npm:npm-run-path",
|
||||
"npm:object-assign",
|
||||
"npm:onetime",
|
||||
"npm:path-key",
|
||||
"npm:path-scurry",
|
||||
"npm:path-type",
|
||||
"npm:picocolors",
|
||||
"npm:picomatch",
|
||||
"npm:pirates",
|
||||
"npm:postcss",
|
||||
"npm:postcss-load-config",
|
||||
"npm:punycode",
|
||||
"npm:queue-microtask",
|
||||
"npm:react",
|
||||
"npm:react-dom",
|
||||
"npm:readdirp",
|
||||
"npm:resolve-from",
|
||||
"npm:reusify",
|
||||
"npm:rollup",
|
||||
"npm:run-parallel",
|
||||
"npm:scheduler",
|
||||
"npm:shebang-command",
|
||||
"npm:shebang-regex",
|
||||
"npm:signal-exit",
|
||||
"npm:signal-exit@4.1.0",
|
||||
"npm:slash",
|
||||
"npm:source-map",
|
||||
"npm:source-map-js",
|
||||
"npm:string-width",
|
||||
"npm:strip-ansi",
|
||||
"npm:strip-final-newline",
|
||||
"npm:sucrase",
|
||||
"npm:thenify",
|
||||
"npm:thenify-all",
|
||||
"npm:to-regex-range",
|
||||
"npm:tr46",
|
||||
"npm:tree-kill",
|
||||
"npm:ts-interface-checker",
|
||||
"npm:tsup",
|
||||
"npm:typescript",
|
||||
"npm:webidl-conversions",
|
||||
"npm:whatwg-url",
|
||||
"npm:which",
|
||||
"npm:wrap-ansi",
|
||||
"npm:yaml",
|
||||
"AllExternalDependencies"
|
||||
],
|
||||
"@tuskdesign/forms:build": [
|
||||
"{workspaceRoot}/.gitignore",
|
||||
"{workspaceRoot}/.nxignore",
|
||||
"{workspaceRoot}/nx.json",
|
||||
"@tuskdesign/buttons:{projectRoot}/**/*",
|
||||
"@tuskdesign/forms:{projectRoot}/**/*",
|
||||
"@tuskdesign/buttons:ProjectConfiguration",
|
||||
"@tuskdesign/forms:ProjectConfiguration",
|
||||
"@tuskdesign/buttons:TsConfig",
|
||||
"@tuskdesign/forms:TsConfig",
|
||||
"npm:@esbuild/android-arm",
|
||||
"npm:@esbuild/linux-loong64",
|
||||
"npm:@isaacs/cliui",
|
||||
"npm:@jridgewell/gen-mapping",
|
||||
"npm:@jridgewell/resolve-uri",
|
||||
"npm:@jridgewell/set-array",
|
||||
"npm:@jridgewell/sourcemap-codec",
|
||||
"npm:@jridgewell/trace-mapping",
|
||||
"npm:@nodelib/fs.scandir",
|
||||
"npm:@nodelib/fs.stat",
|
||||
"npm:@nodelib/fs.walk",
|
||||
"npm:@pkgjs/parseargs",
|
||||
"npm:ansi-regex",
|
||||
"npm:ansi-styles",
|
||||
"npm:any-promise",
|
||||
"npm:anymatch",
|
||||
"npm:array-union",
|
||||
"npm:balanced-match",
|
||||
"npm:binary-extensions",
|
||||
"npm:brace-expansion",
|
||||
"npm:braces",
|
||||
"npm:bundle-require",
|
||||
"npm:cac",
|
||||
"npm:chokidar",
|
||||
"npm:commander",
|
||||
"npm:cross-spawn",
|
||||
"npm:debug",
|
||||
"npm:dir-glob",
|
||||
"npm:eastasianwidth",
|
||||
"npm:emoji-regex",
|
||||
"npm:esbuild",
|
||||
"npm:esbuild-android-64",
|
||||
"npm:esbuild-android-arm64",
|
||||
"npm:esbuild-darwin-64",
|
||||
"npm:esbuild-darwin-arm64",
|
||||
"npm:esbuild-freebsd-64",
|
||||
"npm:esbuild-freebsd-arm64",
|
||||
"npm:esbuild-linux-32",
|
||||
"npm:esbuild-linux-64",
|
||||
"npm:esbuild-linux-arm",
|
||||
"npm:esbuild-linux-arm64",
|
||||
"npm:esbuild-linux-mips64le",
|
||||
"npm:esbuild-linux-ppc64le",
|
||||
"npm:esbuild-linux-riscv64",
|
||||
"npm:esbuild-linux-s390x",
|
||||
"npm:esbuild-netbsd-64",
|
||||
"npm:esbuild-openbsd-64",
|
||||
"npm:esbuild-sunos-64",
|
||||
"npm:esbuild-windows-32",
|
||||
"npm:esbuild-windows-64",
|
||||
"npm:esbuild-windows-arm64",
|
||||
"npm:execa",
|
||||
"npm:fast-glob",
|
||||
"npm:fastq",
|
||||
"npm:fill-range",
|
||||
"npm:foreground-child",
|
||||
"npm:fsevents",
|
||||
"npm:get-stream",
|
||||
"npm:glob",
|
||||
"npm:glob-parent",
|
||||
"npm:globby",
|
||||
"npm:human-signals",
|
||||
"npm:ignore",
|
||||
"npm:is-binary-path",
|
||||
"npm:is-extglob",
|
||||
"npm:is-glob",
|
||||
"npm:is-number",
|
||||
"npm:is-stream",
|
||||
"npm:isexe",
|
||||
"npm:jackspeak",
|
||||
"npm:joycon",
|
||||
"npm:js-tokens",
|
||||
"npm:lilconfig",
|
||||
"npm:lines-and-columns",
|
||||
"npm:load-tsconfig",
|
||||
"npm:lodash.sortby",
|
||||
"npm:loose-envify",
|
||||
"npm:lru-cache",
|
||||
"npm:merge-stream",
|
||||
"npm:merge2",
|
||||
"npm:micromatch",
|
||||
"npm:mimic-fn",
|
||||
"npm:minimatch",
|
||||
"npm:minipass",
|
||||
"npm:ms",
|
||||
"npm:mz",
|
||||
"npm:nanoid",
|
||||
"npm:normalize-path",
|
||||
"npm:npm-run-path",
|
||||
"npm:object-assign",
|
||||
"npm:onetime",
|
||||
"npm:path-key",
|
||||
"npm:path-scurry",
|
||||
"npm:path-type",
|
||||
"npm:picocolors",
|
||||
"npm:picomatch",
|
||||
"npm:pirates",
|
||||
"npm:postcss",
|
||||
"npm:postcss-load-config",
|
||||
"npm:punycode",
|
||||
"npm:queue-microtask",
|
||||
"npm:react",
|
||||
"npm:react-dom",
|
||||
"npm:readdirp",
|
||||
"npm:resolve-from",
|
||||
"npm:reusify",
|
||||
"npm:rollup",
|
||||
"npm:run-parallel",
|
||||
"npm:scheduler",
|
||||
"npm:shebang-command",
|
||||
"npm:shebang-regex",
|
||||
"npm:signal-exit",
|
||||
"npm:signal-exit@4.1.0",
|
||||
"npm:slash",
|
||||
"npm:source-map",
|
||||
"npm:source-map-js",
|
||||
"npm:string-width",
|
||||
"npm:strip-ansi",
|
||||
"npm:strip-final-newline",
|
||||
"npm:sucrase",
|
||||
"npm:thenify",
|
||||
"npm:thenify-all",
|
||||
"npm:to-regex-range",
|
||||
"npm:tr46",
|
||||
"npm:tree-kill",
|
||||
"npm:ts-interface-checker",
|
||||
"npm:tsup",
|
||||
"npm:typescript",
|
||||
"npm:webidl-conversions",
|
||||
"npm:whatwg-url",
|
||||
"npm:which",
|
||||
"npm:wrap-ansi",
|
||||
"npm:yaml",
|
||||
"AllExternalDependencies"
|
||||
],
|
||||
"@tuskdesign/demo:build": [
|
||||
"{workspaceRoot}/.gitignore",
|
||||
"{workspaceRoot}/.nxignore",
|
||||
"{workspaceRoot}/nx.json",
|
||||
"@tuskdesign/buttons:{projectRoot}/**/*",
|
||||
"@tuskdesign/demo:{projectRoot}/**/*",
|
||||
"@tuskdesign/forms:{projectRoot}/**/*",
|
||||
"@tuskdesign/buttons:ProjectConfiguration",
|
||||
"@tuskdesign/demo:ProjectConfiguration",
|
||||
"@tuskdesign/forms:ProjectConfiguration",
|
||||
"@tuskdesign/buttons:TsConfig",
|
||||
"@tuskdesign/demo:TsConfig",
|
||||
"@tuskdesign/forms:TsConfig",
|
||||
"npm:@aashutoshrathi/word-wrap",
|
||||
"npm:@ampproject/remapping",
|
||||
"npm:@babel/code-frame",
|
||||
"npm:@babel/compat-data",
|
||||
"npm:@babel/core",
|
||||
"npm:@babel/generator",
|
||||
"npm:@babel/helper-compilation-targets",
|
||||
"npm:@babel/helper-environment-visitor",
|
||||
"npm:@babel/helper-function-name",
|
||||
"npm:@babel/helper-hoist-variables",
|
||||
"npm:@babel/helper-module-imports",
|
||||
"npm:@babel/helper-module-transforms",
|
||||
"npm:@babel/helper-plugin-utils",
|
||||
"npm:@babel/helper-simple-access",
|
||||
"npm:@babel/helper-split-export-declaration",
|
||||
"npm:@babel/helper-string-parser",
|
||||
"npm:@babel/helper-validator-identifier",
|
||||
"npm:@babel/helper-validator-option",
|
||||
"npm:@babel/helpers",
|
||||
"npm:@babel/highlight",
|
||||
"npm:@babel/parser",
|
||||
"npm:@babel/plugin-transform-react-jsx-self",
|
||||
"npm:@babel/plugin-transform-react-jsx-source",
|
||||
"npm:@babel/template",
|
||||
"npm:@babel/traverse",
|
||||
"npm:@babel/types",
|
||||
"npm:@esbuild/aix-ppc64",
|
||||
"npm:@esbuild/android-arm",
|
||||
"npm:@esbuild/android-arm64",
|
||||
"npm:@esbuild/android-arm@0.19.12",
|
||||
"npm:@esbuild/android-x64",
|
||||
"npm:@esbuild/darwin-arm64",
|
||||
"npm:@esbuild/darwin-x64",
|
||||
"npm:@esbuild/freebsd-arm64",
|
||||
"npm:@esbuild/freebsd-x64",
|
||||
"npm:@esbuild/linux-arm",
|
||||
"npm:@esbuild/linux-arm64",
|
||||
"npm:@esbuild/linux-ia32",
|
||||
"npm:@esbuild/linux-loong64",
|
||||
"npm:@esbuild/linux-loong64@0.19.12",
|
||||
"npm:@esbuild/linux-mips64el",
|
||||
"npm:@esbuild/linux-ppc64",
|
||||
"npm:@esbuild/linux-riscv64",
|
||||
"npm:@esbuild/linux-s390x",
|
||||
"npm:@esbuild/linux-x64",
|
||||
"npm:@esbuild/netbsd-x64",
|
||||
"npm:@esbuild/openbsd-x64",
|
||||
"npm:@esbuild/sunos-x64",
|
||||
"npm:@esbuild/win32-arm64",
|
||||
"npm:@esbuild/win32-ia32",
|
||||
"npm:@esbuild/win32-x64",
|
||||
"npm:@eslint-community/eslint-utils",
|
||||
"npm:@eslint-community/regexpp",
|
||||
"npm:@eslint/eslintrc",
|
||||
"npm:@eslint/js",
|
||||
"npm:@humanwhocodes/config-array",
|
||||
"npm:@humanwhocodes/module-importer",
|
||||
"npm:@humanwhocodes/object-schema",
|
||||
"npm:@isaacs/cliui",
|
||||
"npm:@jridgewell/gen-mapping",
|
||||
"npm:@jridgewell/resolve-uri",
|
||||
"npm:@jridgewell/set-array",
|
||||
"npm:@jridgewell/sourcemap-codec",
|
||||
"npm:@jridgewell/trace-mapping",
|
||||
"npm:@nodelib/fs.scandir",
|
||||
"npm:@nodelib/fs.stat",
|
||||
"npm:@nodelib/fs.walk",
|
||||
"npm:@pkgjs/parseargs",
|
||||
"npm:@rollup/rollup-android-arm-eabi",
|
||||
"npm:@rollup/rollup-android-arm64",
|
||||
"npm:@rollup/rollup-darwin-arm64",
|
||||
"npm:@rollup/rollup-darwin-x64",
|
||||
"npm:@rollup/rollup-linux-arm-gnueabihf",
|
||||
"npm:@rollup/rollup-linux-arm64-gnu",
|
||||
"npm:@rollup/rollup-linux-arm64-musl",
|
||||
"npm:@rollup/rollup-linux-riscv64-gnu",
|
||||
"npm:@rollup/rollup-linux-x64-gnu",
|
||||
"npm:@rollup/rollup-linux-x64-musl",
|
||||
"npm:@rollup/rollup-win32-arm64-msvc",
|
||||
"npm:@rollup/rollup-win32-ia32-msvc",
|
||||
"npm:@rollup/rollup-win32-x64-msvc",
|
||||
"npm:@types/babel__core",
|
||||
"npm:@types/babel__generator",
|
||||
"npm:@types/babel__template",
|
||||
"npm:@types/babel__traverse",
|
||||
"npm:@types/estree",
|
||||
"npm:@types/json-schema",
|
||||
"npm:@types/prop-types",
|
||||
"npm:@types/react",
|
||||
"npm:@types/react-dom",
|
||||
"npm:@types/scheduler",
|
||||
"npm:@types/semver",
|
||||
"npm:@typescript-eslint/eslint-plugin",
|
||||
"npm:@typescript-eslint/parser",
|
||||
"npm:@typescript-eslint/scope-manager",
|
||||
"npm:@typescript-eslint/type-utils",
|
||||
"npm:@typescript-eslint/types",
|
||||
"npm:@typescript-eslint/typescript-estree",
|
||||
"npm:@typescript-eslint/utils",
|
||||
"npm:@typescript-eslint/visitor-keys",
|
||||
"npm:@ungap/structured-clone",
|
||||
"npm:@vitejs/plugin-react",
|
||||
"npm:acorn",
|
||||
"npm:acorn-jsx",
|
||||
"npm:ajv",
|
||||
"npm:ansi-regex",
|
||||
"npm:ansi-regex@5.0.1",
|
||||
"npm:ansi-styles",
|
||||
"npm:ansi-styles@3.2.1",
|
||||
"npm:ansi-styles@4.3.0",
|
||||
"npm:any-promise",
|
||||
"npm:anymatch",
|
||||
"npm:argparse",
|
||||
"npm:array-union",
|
||||
"npm:balanced-match",
|
||||
"npm:binary-extensions",
|
||||
"npm:brace-expansion",
|
||||
"npm:brace-expansion@1.1.11",
|
||||
"npm:braces",
|
||||
"npm:browserslist",
|
||||
"npm:bundle-require",
|
||||
"npm:cac",
|
||||
"npm:callsites",
|
||||
"npm:caniuse-lite",
|
||||
"npm:chalk",
|
||||
"npm:chalk@4.1.2",
|
||||
"npm:chokidar",
|
||||
"npm:color-convert",
|
||||
"npm:color-convert@1.9.3",
|
||||
"npm:color-name",
|
||||
"npm:color-name@1.1.3",
|
||||
"npm:commander",
|
||||
"npm:concat-map",
|
||||
"npm:convert-source-map",
|
||||
"npm:cross-spawn",
|
||||
"npm:csstype",
|
||||
"npm:debug",
|
||||
"npm:deep-is",
|
||||
"npm:dir-glob",
|
||||
"npm:doctrine",
|
||||
"npm:eastasianwidth",
|
||||
"npm:electron-to-chromium",
|
||||
"npm:emoji-regex",
|
||||
"npm:esbuild",
|
||||
"npm:esbuild-android-64",
|
||||
"npm:esbuild-android-arm64",
|
||||
"npm:esbuild-darwin-64",
|
||||
"npm:esbuild-darwin-arm64",
|
||||
"npm:esbuild-freebsd-64",
|
||||
"npm:esbuild-freebsd-arm64",
|
||||
"npm:esbuild-linux-32",
|
||||
"npm:esbuild-linux-64",
|
||||
"npm:esbuild-linux-arm",
|
||||
"npm:esbuild-linux-arm64",
|
||||
"npm:esbuild-linux-mips64le",
|
||||
"npm:esbuild-linux-ppc64le",
|
||||
"npm:esbuild-linux-riscv64",
|
||||
"npm:esbuild-linux-s390x",
|
||||
"npm:esbuild-netbsd-64",
|
||||
"npm:esbuild-openbsd-64",
|
||||
"npm:esbuild-sunos-64",
|
||||
"npm:esbuild-windows-32",
|
||||
"npm:esbuild-windows-64",
|
||||
"npm:esbuild-windows-arm64",
|
||||
"npm:esbuild@0.19.12",
|
||||
"npm:escalade",
|
||||
"npm:escape-string-regexp",
|
||||
"npm:escape-string-regexp@4.0.0",
|
||||
"npm:eslint",
|
||||
"npm:eslint-plugin-react-hooks",
|
||||
"npm:eslint-plugin-react-refresh",
|
||||
"npm:eslint-scope",
|
||||
"npm:eslint-visitor-keys",
|
||||
"npm:espree",
|
||||
"npm:esquery",
|
||||
"npm:esrecurse",
|
||||
"npm:estraverse",
|
||||
"npm:esutils",
|
||||
"npm:execa",
|
||||
"npm:fast-deep-equal",
|
||||
"npm:fast-glob",
|
||||
"npm:fast-json-stable-stringify",
|
||||
"npm:fast-levenshtein",
|
||||
"npm:fastq",
|
||||
"npm:file-entry-cache",
|
||||
"npm:fill-range",
|
||||
"npm:find-up",
|
||||
"npm:flat-cache",
|
||||
"npm:flatted",
|
||||
"npm:foreground-child",
|
||||
"npm:fs.realpath",
|
||||
"npm:fsevents",
|
||||
"npm:gensync",
|
||||
"npm:get-stream",
|
||||
"npm:glob",
|
||||
"npm:glob-parent",
|
||||
"npm:glob-parent@6.0.2",
|
||||
"npm:glob@7.2.3",
|
||||
"npm:globals",
|
||||
"npm:globals@13.24.0",
|
||||
"npm:globby",
|
||||
"npm:graphemer",
|
||||
"npm:has-flag",
|
||||
"npm:has-flag@4.0.0",
|
||||
"npm:human-signals",
|
||||
"npm:ignore",
|
||||
"npm:import-fresh",
|
||||
"npm:imurmurhash",
|
||||
"npm:inflight",
|
||||
"npm:inherits",
|
||||
"npm:is-binary-path",
|
||||
"npm:is-extglob",
|
||||
"npm:is-glob",
|
||||
"npm:is-number",
|
||||
"npm:is-path-inside",
|
||||
"npm:is-stream",
|
||||
"npm:isexe",
|
||||
"npm:jackspeak",
|
||||
"npm:joycon",
|
||||
"npm:js-tokens",
|
||||
"npm:js-yaml",
|
||||
"npm:jsesc",
|
||||
"npm:json-buffer",
|
||||
"npm:json-schema-traverse",
|
||||
"npm:json-stable-stringify-without-jsonify",
|
||||
"npm:json5",
|
||||
"npm:keyv",
|
||||
"npm:levn",
|
||||
"npm:lilconfig",
|
||||
"npm:lines-and-columns",
|
||||
"npm:load-tsconfig",
|
||||
"npm:locate-path",
|
||||
"npm:lodash.merge",
|
||||
"npm:lodash.sortby",
|
||||
"npm:loose-envify",
|
||||
"npm:lru-cache",
|
||||
"npm:lru-cache@5.1.1",
|
||||
"npm:lru-cache@6.0.0",
|
||||
"npm:merge-stream",
|
||||
"npm:merge2",
|
||||
"npm:micromatch",
|
||||
"npm:mimic-fn",
|
||||
"npm:minimatch",
|
||||
"npm:minimatch@3.1.2",
|
||||
"npm:minipass",
|
||||
"npm:ms",
|
||||
"npm:mz",
|
||||
"npm:nanoid",
|
||||
"npm:natural-compare",
|
||||
"npm:node-releases",
|
||||
"npm:normalize-path",
|
||||
"npm:npm-run-path",
|
||||
"npm:object-assign",
|
||||
"npm:once",
|
||||
"npm:onetime",
|
||||
"npm:optionator",
|
||||
"npm:p-limit",
|
||||
"npm:p-locate",
|
||||
"npm:parent-module",
|
||||
"npm:path-exists",
|
||||
"npm:path-is-absolute",
|
||||
"npm:path-key",
|
||||
"npm:path-scurry",
|
||||
"npm:path-type",
|
||||
"npm:picocolors",
|
||||
"npm:picomatch",
|
||||
"npm:pirates",
|
||||
"npm:postcss",
|
||||
"npm:postcss-load-config",
|
||||
"npm:prelude-ls",
|
||||
"npm:punycode",
|
||||
"npm:queue-microtask",
|
||||
"npm:react",
|
||||
"npm:react-dom",
|
||||
"npm:react-refresh",
|
||||
"npm:readdirp",
|
||||
"npm:resolve-from",
|
||||
"npm:resolve-from@4.0.0",
|
||||
"npm:reusify",
|
||||
"npm:rimraf",
|
||||
"npm:rollup",
|
||||
"npm:rollup@4.12.0",
|
||||
"npm:run-parallel",
|
||||
"npm:scheduler",
|
||||
"npm:semver",
|
||||
"npm:semver@6.3.1",
|
||||
"npm:shebang-command",
|
||||
"npm:shebang-regex",
|
||||
"npm:signal-exit",
|
||||
"npm:signal-exit@4.1.0",
|
||||
"npm:slash",
|
||||
"npm:source-map",
|
||||
"npm:source-map-js",
|
||||
"npm:string-width",
|
||||
"npm:strip-ansi",
|
||||
"npm:strip-ansi@6.0.1",
|
||||
"npm:strip-final-newline",
|
||||
"npm:strip-json-comments",
|
||||
"npm:sucrase",
|
||||
"npm:supports-color",
|
||||
"npm:supports-color@7.2.0",
|
||||
"npm:text-table",
|
||||
"npm:thenify",
|
||||
"npm:thenify-all",
|
||||
"npm:to-fast-properties",
|
||||
"npm:to-regex-range",
|
||||
"npm:tr46",
|
||||
"npm:tree-kill",
|
||||
"npm:ts-api-utils",
|
||||
"npm:ts-interface-checker",
|
||||
"npm:tsup",
|
||||
"npm:type-check",
|
||||
"npm:type-fest",
|
||||
"npm:typescript",
|
||||
"npm:update-browserslist-db",
|
||||
"npm:uri-js",
|
||||
"npm:vite",
|
||||
"npm:webidl-conversions",
|
||||
"npm:whatwg-url",
|
||||
"npm:which",
|
||||
"npm:wrap-ansi",
|
||||
"npm:wrappy",
|
||||
"npm:yallist",
|
||||
"npm:yallist@4.0.0",
|
||||
"npm:yaml",
|
||||
"npm:yocto-queue",
|
||||
"AllExternalDependencies"
|
||||
]
|
||||
}
|
||||
}
|
||||
513
docs/shared/tutorials/npm-workspaces-build-tasks2.json
Normal file
513
docs/shared/tutorials/npm-workspaces-build-tasks2.json
Normal file
@ -0,0 +1,513 @@
|
||||
{
|
||||
"taskId": "@tuskdesign/demo:build",
|
||||
"projects": [
|
||||
{
|
||||
"name": "@tuskdesign/buttons",
|
||||
"type": "lib",
|
||||
"data": {
|
||||
"root": "packages/buttons",
|
||||
"targets": {
|
||||
"build": {},
|
||||
"typecheck": {},
|
||||
"dev": {},
|
||||
"nx-release-publish": {}
|
||||
},
|
||||
"sourceRoot": "packages/buttons",
|
||||
"name": "@tuskdesign/buttons",
|
||||
"projectType": "library",
|
||||
"implicitDependencies": [],
|
||||
"tags": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@tuskdesign/forms",
|
||||
"type": "lib",
|
||||
"data": {
|
||||
"root": "packages/forms",
|
||||
"targets": {
|
||||
"build": {},
|
||||
"typecheck": {},
|
||||
"dev": {},
|
||||
"nx-release-publish": {}
|
||||
},
|
||||
"sourceRoot": "packages/forms",
|
||||
"name": "@tuskdesign/forms",
|
||||
"projectType": "library",
|
||||
"implicitDependencies": [],
|
||||
"tags": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@tuskdesign/demo",
|
||||
"type": "lib",
|
||||
"data": {
|
||||
"root": "apps/demo",
|
||||
"targets": {
|
||||
"build": {},
|
||||
"typecheck": {},
|
||||
"lint": {},
|
||||
"dev": {},
|
||||
"prebuild": {},
|
||||
"preview": {}
|
||||
},
|
||||
"sourceRoot": "apps/demo",
|
||||
"name": "@tuskdesign/demo",
|
||||
"projectType": "library",
|
||||
"implicitDependencies": [],
|
||||
"tags": []
|
||||
}
|
||||
}
|
||||
],
|
||||
"taskGraphs": {
|
||||
"@tuskdesign/buttons:build": {
|
||||
"roots": ["@tuskdesign/buttons:typecheck"],
|
||||
"tasks": {
|
||||
"@tuskdesign/buttons:build": {
|
||||
"id": "@tuskdesign/buttons:build",
|
||||
"target": {
|
||||
"project": "@tuskdesign/buttons",
|
||||
"target": "build"
|
||||
},
|
||||
"projectRoot": "packages/buttons",
|
||||
"overrides": {},
|
||||
"outputs": [
|
||||
"dist/packages/buttons",
|
||||
"packages/buttons/dist",
|
||||
"packages/buttons/build",
|
||||
"packages/buttons/public"
|
||||
],
|
||||
"cache": true
|
||||
},
|
||||
"@tuskdesign/buttons:typecheck": {
|
||||
"id": "@tuskdesign/buttons:typecheck",
|
||||
"target": {
|
||||
"project": "@tuskdesign/buttons",
|
||||
"target": "typecheck"
|
||||
},
|
||||
"projectRoot": "packages/buttons",
|
||||
"overrides": {
|
||||
"__overrides_unparsed__": []
|
||||
},
|
||||
"outputs": [],
|
||||
"cache": true
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@tuskdesign/buttons:build": ["@tuskdesign/buttons:typecheck"],
|
||||
"@tuskdesign/buttons:typecheck": []
|
||||
}
|
||||
},
|
||||
"@tuskdesign/buttons:typecheck": {
|
||||
"roots": ["@tuskdesign/buttons:typecheck"],
|
||||
"tasks": {
|
||||
"@tuskdesign/buttons:typecheck": {
|
||||
"id": "@tuskdesign/buttons:typecheck",
|
||||
"target": {
|
||||
"project": "@tuskdesign/buttons",
|
||||
"target": "typecheck"
|
||||
},
|
||||
"projectRoot": "packages/buttons",
|
||||
"overrides": {},
|
||||
"outputs": [],
|
||||
"cache": true
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@tuskdesign/buttons:typecheck": []
|
||||
}
|
||||
},
|
||||
"@tuskdesign/buttons:dev": {
|
||||
"roots": ["@tuskdesign/buttons:dev"],
|
||||
"tasks": {
|
||||
"@tuskdesign/buttons:dev": {
|
||||
"id": "@tuskdesign/buttons:dev",
|
||||
"target": {
|
||||
"project": "@tuskdesign/buttons",
|
||||
"target": "dev"
|
||||
},
|
||||
"projectRoot": "packages/buttons",
|
||||
"overrides": {},
|
||||
"outputs": []
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@tuskdesign/buttons:dev": []
|
||||
}
|
||||
},
|
||||
"@tuskdesign/buttons:nx-release-publish": {
|
||||
"roots": ["@tuskdesign/buttons:nx-release-publish"],
|
||||
"tasks": {
|
||||
"@tuskdesign/buttons:nx-release-publish": {
|
||||
"id": "@tuskdesign/buttons:nx-release-publish",
|
||||
"target": {
|
||||
"project": "@tuskdesign/buttons",
|
||||
"target": "nx-release-publish"
|
||||
},
|
||||
"projectRoot": "packages/buttons",
|
||||
"overrides": {},
|
||||
"outputs": []
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@tuskdesign/buttons:nx-release-publish": []
|
||||
}
|
||||
},
|
||||
"@tuskdesign/forms:build": {
|
||||
"roots": ["@tuskdesign/buttons:typecheck", "@tuskdesign/forms:typecheck"],
|
||||
"tasks": {
|
||||
"@tuskdesign/forms:build": {
|
||||
"id": "@tuskdesign/forms:build",
|
||||
"target": {
|
||||
"project": "@tuskdesign/forms",
|
||||
"target": "build"
|
||||
},
|
||||
"projectRoot": "packages/forms",
|
||||
"overrides": {},
|
||||
"outputs": [
|
||||
"dist/packages/forms",
|
||||
"packages/forms/dist",
|
||||
"packages/forms/build",
|
||||
"packages/forms/public"
|
||||
],
|
||||
"cache": true
|
||||
},
|
||||
"@tuskdesign/buttons:build": {
|
||||
"id": "@tuskdesign/buttons:build",
|
||||
"target": {
|
||||
"project": "@tuskdesign/buttons",
|
||||
"target": "build"
|
||||
},
|
||||
"projectRoot": "packages/buttons",
|
||||
"overrides": {
|
||||
"__overrides_unparsed__": []
|
||||
},
|
||||
"outputs": [
|
||||
"dist/packages/buttons",
|
||||
"packages/buttons/dist",
|
||||
"packages/buttons/build",
|
||||
"packages/buttons/public"
|
||||
],
|
||||
"cache": true
|
||||
},
|
||||
"@tuskdesign/buttons:typecheck": {
|
||||
"id": "@tuskdesign/buttons:typecheck",
|
||||
"target": {
|
||||
"project": "@tuskdesign/buttons",
|
||||
"target": "typecheck"
|
||||
},
|
||||
"projectRoot": "packages/buttons",
|
||||
"overrides": {
|
||||
"__overrides_unparsed__": []
|
||||
},
|
||||
"outputs": [],
|
||||
"cache": true
|
||||
},
|
||||
"@tuskdesign/forms:typecheck": {
|
||||
"id": "@tuskdesign/forms:typecheck",
|
||||
"target": {
|
||||
"project": "@tuskdesign/forms",
|
||||
"target": "typecheck"
|
||||
},
|
||||
"projectRoot": "packages/forms",
|
||||
"overrides": {
|
||||
"__overrides_unparsed__": []
|
||||
},
|
||||
"outputs": [],
|
||||
"cache": true
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@tuskdesign/forms:build": [
|
||||
"@tuskdesign/buttons:build",
|
||||
"@tuskdesign/forms:typecheck"
|
||||
],
|
||||
"@tuskdesign/buttons:build": ["@tuskdesign/buttons:typecheck"],
|
||||
"@tuskdesign/buttons:typecheck": [],
|
||||
"@tuskdesign/forms:typecheck": []
|
||||
}
|
||||
},
|
||||
"@tuskdesign/forms:typecheck": {
|
||||
"roots": ["@tuskdesign/forms:typecheck"],
|
||||
"tasks": {
|
||||
"@tuskdesign/forms:typecheck": {
|
||||
"id": "@tuskdesign/forms:typecheck",
|
||||
"target": {
|
||||
"project": "@tuskdesign/forms",
|
||||
"target": "typecheck"
|
||||
},
|
||||
"projectRoot": "packages/forms",
|
||||
"overrides": {},
|
||||
"outputs": [],
|
||||
"cache": true
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@tuskdesign/forms:typecheck": []
|
||||
}
|
||||
},
|
||||
"@tuskdesign/forms:dev": {
|
||||
"roots": ["@tuskdesign/forms:dev"],
|
||||
"tasks": {
|
||||
"@tuskdesign/forms:dev": {
|
||||
"id": "@tuskdesign/forms:dev",
|
||||
"target": {
|
||||
"project": "@tuskdesign/forms",
|
||||
"target": "dev"
|
||||
},
|
||||
"projectRoot": "packages/forms",
|
||||
"overrides": {},
|
||||
"outputs": []
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@tuskdesign/forms:dev": []
|
||||
}
|
||||
},
|
||||
"@tuskdesign/forms:nx-release-publish": {
|
||||
"roots": ["@tuskdesign/buttons:nx-release-publish"],
|
||||
"tasks": {
|
||||
"@tuskdesign/forms:nx-release-publish": {
|
||||
"id": "@tuskdesign/forms:nx-release-publish",
|
||||
"target": {
|
||||
"project": "@tuskdesign/forms",
|
||||
"target": "nx-release-publish"
|
||||
},
|
||||
"projectRoot": "packages/forms",
|
||||
"overrides": {},
|
||||
"outputs": []
|
||||
},
|
||||
"@tuskdesign/buttons:nx-release-publish": {
|
||||
"id": "@tuskdesign/buttons:nx-release-publish",
|
||||
"target": {
|
||||
"project": "@tuskdesign/buttons",
|
||||
"target": "nx-release-publish"
|
||||
},
|
||||
"projectRoot": "packages/buttons",
|
||||
"overrides": {
|
||||
"__overrides_unparsed__": []
|
||||
},
|
||||
"outputs": []
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@tuskdesign/forms:nx-release-publish": [
|
||||
"@tuskdesign/buttons:nx-release-publish"
|
||||
],
|
||||
"@tuskdesign/buttons:nx-release-publish": []
|
||||
}
|
||||
},
|
||||
"@tuskdesign/demo:build": {
|
||||
"roots": [
|
||||
"@tuskdesign/buttons:typecheck",
|
||||
"@tuskdesign/forms:typecheck",
|
||||
"@tuskdesign/demo:typecheck"
|
||||
],
|
||||
"tasks": {
|
||||
"@tuskdesign/demo:build": {
|
||||
"id": "@tuskdesign/demo:build",
|
||||
"target": {
|
||||
"project": "@tuskdesign/demo",
|
||||
"target": "build"
|
||||
},
|
||||
"projectRoot": "apps/demo",
|
||||
"overrides": {},
|
||||
"outputs": [
|
||||
"dist/apps/demo",
|
||||
"apps/demo/dist",
|
||||
"apps/demo/build",
|
||||
"apps/demo/public"
|
||||
],
|
||||
"cache": true
|
||||
},
|
||||
"@tuskdesign/buttons:build": {
|
||||
"id": "@tuskdesign/buttons:build",
|
||||
"target": {
|
||||
"project": "@tuskdesign/buttons",
|
||||
"target": "build"
|
||||
},
|
||||
"projectRoot": "packages/buttons",
|
||||
"overrides": {
|
||||
"__overrides_unparsed__": []
|
||||
},
|
||||
"outputs": [
|
||||
"dist/packages/buttons",
|
||||
"packages/buttons/dist",
|
||||
"packages/buttons/build",
|
||||
"packages/buttons/public"
|
||||
],
|
||||
"cache": true
|
||||
},
|
||||
"@tuskdesign/buttons:typecheck": {
|
||||
"id": "@tuskdesign/buttons:typecheck",
|
||||
"target": {
|
||||
"project": "@tuskdesign/buttons",
|
||||
"target": "typecheck"
|
||||
},
|
||||
"projectRoot": "packages/buttons",
|
||||
"overrides": {
|
||||
"__overrides_unparsed__": []
|
||||
},
|
||||
"outputs": [],
|
||||
"cache": true
|
||||
},
|
||||
"@tuskdesign/forms:build": {
|
||||
"id": "@tuskdesign/forms:build",
|
||||
"target": {
|
||||
"project": "@tuskdesign/forms",
|
||||
"target": "build"
|
||||
},
|
||||
"projectRoot": "packages/forms",
|
||||
"overrides": {
|
||||
"__overrides_unparsed__": []
|
||||
},
|
||||
"outputs": [
|
||||
"dist/packages/forms",
|
||||
"packages/forms/dist",
|
||||
"packages/forms/build",
|
||||
"packages/forms/public"
|
||||
],
|
||||
"cache": true
|
||||
},
|
||||
"@tuskdesign/forms:typecheck": {
|
||||
"id": "@tuskdesign/forms:typecheck",
|
||||
"target": {
|
||||
"project": "@tuskdesign/forms",
|
||||
"target": "typecheck"
|
||||
},
|
||||
"projectRoot": "packages/forms",
|
||||
"overrides": {
|
||||
"__overrides_unparsed__": []
|
||||
},
|
||||
"outputs": [],
|
||||
"cache": true
|
||||
},
|
||||
"@tuskdesign/demo:typecheck": {
|
||||
"id": "@tuskdesign/demo:typecheck",
|
||||
"target": {
|
||||
"project": "@tuskdesign/demo",
|
||||
"target": "typecheck"
|
||||
},
|
||||
"projectRoot": "apps/demo",
|
||||
"overrides": {
|
||||
"__overrides_unparsed__": []
|
||||
},
|
||||
"outputs": [],
|
||||
"cache": true
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@tuskdesign/demo:build": [
|
||||
"@tuskdesign/buttons:build",
|
||||
"@tuskdesign/forms:build",
|
||||
"@tuskdesign/demo:typecheck"
|
||||
],
|
||||
"@tuskdesign/buttons:build": ["@tuskdesign/buttons:typecheck"],
|
||||
"@tuskdesign/buttons:typecheck": [],
|
||||
"@tuskdesign/forms:build": [
|
||||
"@tuskdesign/buttons:build",
|
||||
"@tuskdesign/forms:typecheck"
|
||||
],
|
||||
"@tuskdesign/forms:typecheck": [],
|
||||
"@tuskdesign/demo:typecheck": []
|
||||
}
|
||||
},
|
||||
"@tuskdesign/demo:serve": {
|
||||
"roots": ["@tuskdesign/demo:serve"],
|
||||
"tasks": {
|
||||
"@tuskdesign/demo:serve": {
|
||||
"id": "@tuskdesign/demo:serve",
|
||||
"target": {
|
||||
"project": "@tuskdesign/demo",
|
||||
"target": "serve"
|
||||
},
|
||||
"projectRoot": "apps/demo",
|
||||
"overrides": {},
|
||||
"outputs": []
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@tuskdesign/demo:serve": []
|
||||
}
|
||||
},
|
||||
"@tuskdesign/demo:preview": {
|
||||
"roots": ["@tuskdesign/demo:preview"],
|
||||
"tasks": {
|
||||
"@tuskdesign/demo:preview": {
|
||||
"id": "@tuskdesign/demo:preview",
|
||||
"target": {
|
||||
"project": "@tuskdesign/demo",
|
||||
"target": "preview"
|
||||
},
|
||||
"projectRoot": "apps/demo",
|
||||
"overrides": {},
|
||||
"outputs": []
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@tuskdesign/demo:preview": []
|
||||
}
|
||||
},
|
||||
"@tuskdesign/demo:serve-static": {
|
||||
"roots": ["@tuskdesign/demo:serve-static"],
|
||||
"tasks": {
|
||||
"@tuskdesign/demo:serve-static": {
|
||||
"id": "@tuskdesign/demo:serve-static",
|
||||
"target": {
|
||||
"project": "@tuskdesign/demo",
|
||||
"target": "serve-static"
|
||||
},
|
||||
"projectRoot": "apps/demo",
|
||||
"overrides": {},
|
||||
"outputs": []
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@tuskdesign/demo:serve-static": []
|
||||
}
|
||||
},
|
||||
"@tuskdesign/demo:lint": {
|
||||
"roots": ["@tuskdesign/demo:lint"],
|
||||
"tasks": {
|
||||
"@tuskdesign/demo:lint": {
|
||||
"id": "@tuskdesign/demo:lint",
|
||||
"target": {
|
||||
"project": "@tuskdesign/demo",
|
||||
"target": "lint"
|
||||
},
|
||||
"projectRoot": "apps/demo",
|
||||
"overrides": {},
|
||||
"outputs": [],
|
||||
"cache": true
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@tuskdesign/demo:lint": []
|
||||
}
|
||||
},
|
||||
"@tuskdesign/demo:typecheck": {
|
||||
"roots": ["@tuskdesign/demo:typecheck"],
|
||||
"tasks": {
|
||||
"@tuskdesign/demo:typecheck": {
|
||||
"id": "@tuskdesign/demo:typecheck",
|
||||
"target": {
|
||||
"project": "@tuskdesign/demo",
|
||||
"target": "typecheck"
|
||||
},
|
||||
"projectRoot": "apps/demo",
|
||||
"overrides": {},
|
||||
"outputs": [],
|
||||
"cache": true
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@tuskdesign/demo:typecheck": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": {},
|
||||
"plans": {
|
||||
"@tuskdesign/buttons:build": [],
|
||||
"@tuskdesign/forms:build": [],
|
||||
"@tuskdesign/demo:build": []
|
||||
}
|
||||
}
|
||||
70
docs/shared/tutorials/npm-workspaces-pdv.json
Normal file
70
docs/shared/tutorials/npm-workspaces-pdv.json
Normal file
@ -0,0 +1,70 @@
|
||||
{
|
||||
"project": {
|
||||
"name": "@tuskdesign/demo",
|
||||
"type": "lib",
|
||||
"data": {
|
||||
"root": "apps/demo",
|
||||
"targets": {
|
||||
"build": {
|
||||
"cache": true,
|
||||
"dependsOn": ["^build"],
|
||||
"inputs": [
|
||||
"default",
|
||||
"^default",
|
||||
{
|
||||
"externalDependencies": ["vite"]
|
||||
}
|
||||
],
|
||||
"outputs": ["{projectRoot}/dist"],
|
||||
"executor": "nx:run-commands",
|
||||
"options": {
|
||||
"cwd": "apps/demo",
|
||||
"command": "vite build"
|
||||
},
|
||||
"configurations": {}
|
||||
}
|
||||
},
|
||||
"sourceRoot": "apps/demo",
|
||||
"name": "@tuskdesign/demo",
|
||||
"projectType": "library",
|
||||
"includedScripts": [],
|
||||
"implicitDependencies": [],
|
||||
"tags": []
|
||||
}
|
||||
},
|
||||
"sourceMap": {
|
||||
"root": ["apps/demo/package.json", "nx/core/package-json-workspaces"],
|
||||
"targets": ["apps/demo/package.json", "nx/core/package-json-workspaces"],
|
||||
"targets.build": ["apps/demo/package.json", "nx/core/target-defaults"],
|
||||
"targets.build.options": ["apps/demo/vite.config.ts", "@nx/vite/plugin"],
|
||||
"targets.build.cache": [
|
||||
"apps/demo/package.json",
|
||||
"nx/core/target-defaults"
|
||||
],
|
||||
"targets.build.dependsOn": [
|
||||
"apps/demo/package.json",
|
||||
"nx/core/target-defaults"
|
||||
],
|
||||
"targets.build.inputs": ["apps/demo/vite.config.ts", "@nx/vite/plugin"],
|
||||
"targets.build.outputs": ["apps/demo/vite.config.ts", "@nx/vite/plugin"],
|
||||
"targets.build.executor": ["apps/demo/vite.config.ts", "@nx/vite/plugin"],
|
||||
"targets.build.options.cwd": [
|
||||
"apps/demo/vite.config.ts",
|
||||
"@nx/vite/plugin"
|
||||
],
|
||||
"targets.build.options.command": [
|
||||
"apps/demo/vite.config.ts",
|
||||
"@nx/vite/plugin"
|
||||
],
|
||||
"sourceRoot": ["apps/demo/package.json", "nx/core/package-json-workspaces"],
|
||||
"name": ["apps/demo/package.json", "nx/core/package-json-workspaces"],
|
||||
"projectType": [
|
||||
"apps/demo/package.json",
|
||||
"nx/core/package-json-workspaces"
|
||||
],
|
||||
"includedScripts": [
|
||||
"apps/demo/package.json",
|
||||
"nx/core/package-json-workspaces"
|
||||
]
|
||||
}
|
||||
}
|
||||
56
docs/shared/tutorials/npm-workspaces-project-graph.json
Normal file
56
docs/shared/tutorials/npm-workspaces-project-graph.json
Normal file
@ -0,0 +1,56 @@
|
||||
{
|
||||
"hash": "b403577d293fcd1162049fb6cd70752277d68eecc34268aa57452ce597b7352e",
|
||||
"projects": [
|
||||
{
|
||||
"name": "@tuskdesign/buttons",
|
||||
"type": "lib",
|
||||
"data": {
|
||||
"tags": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@tuskdesign/forms",
|
||||
"type": "lib",
|
||||
"data": {
|
||||
"tags": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@tuskdesign/demo",
|
||||
"type": "lib",
|
||||
"data": {
|
||||
"tags": []
|
||||
}
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"@tuskdesign/buttons": [],
|
||||
"@tuskdesign/forms": [
|
||||
{
|
||||
"source": "@tuskdesign/forms",
|
||||
"target": "@tuskdesign/buttons",
|
||||
"type": "static"
|
||||
}
|
||||
],
|
||||
"@tuskdesign/demo": [
|
||||
{
|
||||
"source": "@tuskdesign/demo",
|
||||
"target": "@tuskdesign/buttons",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"source": "@tuskdesign/demo",
|
||||
"target": "@tuskdesign/forms",
|
||||
"type": "static"
|
||||
}
|
||||
]
|
||||
},
|
||||
"workspaceLayout": {
|
||||
"appsDir": "apps",
|
||||
"libsDir": "packages"
|
||||
},
|
||||
"affectedProjectIds": [],
|
||||
"focus": null,
|
||||
"groupByFolder": false,
|
||||
"exclude": []
|
||||
}
|
||||
416
docs/shared/tutorials/npm-workspaces.md
Normal file
416
docs/shared/tutorials/npm-workspaces.md
Normal file
@ -0,0 +1,416 @@
|
||||
---
|
||||
title: 'NPM Workspaces Tutorial'
|
||||
description: In this tutorial you'll add Nx to an existing NPM workspaces repo
|
||||
---
|
||||
|
||||
# NPM Workspaces Tutorial
|
||||
|
||||
In this tutorial, you'll learn how to add Nx to a repository with an existing NPM workspaces setup. You'll see how Nx can provide immediate value with very little configuration and then you can gradually enable more features.
|
||||
|
||||
- Add Nx to the repository with a single command
|
||||
- Configure caching for your existing tasks
|
||||
- Configure a task pipeline
|
||||
- Use Nx Plugins to automatically configure caching
|
||||
|
||||
<!-- ## Final Source Code
|
||||
|
||||
Here's the source code of the final result for this tutorial.
|
||||
|
||||
{% github-repository url="https://github.com/nrwl/nx-recipes/tree/main/npm-workspaces" /%} -->
|
||||
|
||||
## Starting Repository
|
||||
|
||||
To get started, check out [the sample repository](https://github.com/nrwl/tuskydesigns) on your local machine:
|
||||
|
||||
```shell
|
||||
git clone https://github.com/nrwl/tuskydesign.git
|
||||
```
|
||||
|
||||
The repository has two React packages (under `packages/buttons` and `packages/forms`) that are used in a `demo` application (located in `apps/demo`) that was designed to be used with the Vite CLI. The root `package.json` has a `workspaces` property that tells NPM how to find the projects in the repository.
|
||||
|
||||
```json {% fileName="package.json" %}
|
||||
{
|
||||
"workspaces": ["packages/*", "apps/*"]
|
||||
}
|
||||
```
|
||||
|
||||
Because of this setting, when the install command is run at the root, the correct packages are installed for each project. NPM will create dedicated `node_modules` folders inside of each project folder where necessary.
|
||||
|
||||
```shell
|
||||
npm install
|
||||
```
|
||||
|
||||
Now let's try running some tasks. To lint the `demo` app, use the `lint` npm script:
|
||||
|
||||
```text {% command="npm run lint -w @tuskdesign/demo" path="~/tuskydesigns" %}
|
||||
> @tuskdesign/demo@0.0.0 lint
|
||||
> eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0
|
||||
```
|
||||
|
||||
If you try to build the `demo` app, it will fail.
|
||||
|
||||
```text {% command="npm run build -w @tuskdesign/demo" path="~/tuskydesigns" %}
|
||||
> @tuskdesign/demo@0.0.0 prebuild
|
||||
> npm run typecheck
|
||||
|
||||
> @tuskdesign/demo@0.0.0 typecheck
|
||||
> tsc
|
||||
|
||||
> @tuskdesign/demo@0.0.0 build
|
||||
> vite build
|
||||
|
||||
vite v5.0.12 building for production...
|
||||
✓ 4 modules transformed.
|
||||
[commonjs--resolver] Failed to resolve entry for package "@tuskdesign/buttons". The package may have incorrect main/module/exports specified in its package.json.
|
||||
error during build:
|
||||
Error: Failed to resolve entry for package "@tuskdesign/buttons". The package may have incorrect main/module/exports specified in its package.json.
|
||||
at packageEntryFailure (file:///Users/isaac/Documents/code/tuskydesign/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:29443:17)
|
||||
at resolvePackageEntry (file:///Users/isaac/Documents/code/tuskydesign/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:29440:5)
|
||||
at tryNodeResolve (file:///Users/isaac/Documents/code/tuskydesign/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:29210:20)
|
||||
at Object.resolveId (file:///Users/isaac/Documents/code/tuskydesign/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:28978:28)
|
||||
at file:///Users/isaac/Documents/code/tuskydesign/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:19579:40
|
||||
at async PluginDriver.hookFirstAndGetPlugin (file:///Users/isaac/Documents/code/tuskydesign/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:19479:28)
|
||||
at async resolveId (file:///Users/isaac/Documents/code/tuskydesign/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:18149:26)
|
||||
at async ModuleLoader.resolveId (file:///Users/isaac/Documents/code/tuskydesign/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:18563:15)
|
||||
at async Object.resolveId (file:///Users/isaac/Documents/code/tuskydesign/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:8141:10)
|
||||
at async PluginDriver.hookFirstAndGetPlugin (file:///Users/isaac/Documents/code/tuskydesign/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:19479:28)
|
||||
npm ERR! Lifecycle script `build` failed with error:
|
||||
npm ERR! Error: command failed
|
||||
npm ERR! in workspace: @tuskdesign/demo@0.0.0
|
||||
npm ERR! at location: /Users/isaac/Documents/code/tuskydesign/apps/demo
|
||||
```
|
||||
|
||||
The `build` script fails because it needs the `buttons` and `forms` projects to be built first in order to work correctly. To do this, lets return to the root of the repository and run the `build` task for every project in the repo:
|
||||
|
||||
```shell {% path="~/tuskydesigns" %}
|
||||
npm run build --ws
|
||||
```
|
||||
|
||||
When the `buttons` and `forms` projects are built first, the `demo` app can build successfully.
|
||||
|
||||
Now that you have a basic understanding of the repository we're working with, let's see how Nx can help us.
|
||||
|
||||
## Add Nx
|
||||
|
||||
Nx offers many features, but at its core, it is a task runner. Out of the box, it can cache your tasks and ensure those tasks are run in the correct order. After the initial set up, you can incrementally add on other features that would be helpful in your organization.
|
||||
|
||||
To enable Nx in your repository, run a single command:
|
||||
|
||||
```shell {% path="~/tuskydesigns" %}
|
||||
npx nx@latest init
|
||||
```
|
||||
|
||||
This command will download the latest version of Nx and help set up your repository to take advantage of it.
|
||||
|
||||
First, the script will propose installing some plugins based on the packages that are being used in your repository.
|
||||
|
||||
- Deselect both proposed plugins so that we can explore what Nx provides without any plugins.
|
||||
|
||||
Second, the script asks a series of questions to help set up caching for you.
|
||||
|
||||
- `Which scripts need to be run in order?` - Choose `build`
|
||||
- `Which scripts are cacheable?` - Choose `typecheck`, `build` and `lint`
|
||||
- `Does the "typecheck" script create any outputs?` - Enter nothing
|
||||
- `Does the "build" script create any outputs?` - Enter `dist`
|
||||
- `Does the "lint" script create any outputs?` - Enter nothing
|
||||
- `Would you like remote caching to make your build faster?` - Choose `Skip for now`
|
||||
|
||||
```text {% command="npx nx@latest init" path="~/tuskydesigns" %}
|
||||
NX Recommended Plugins:
|
||||
|
||||
Add these Nx plugins to integrate with the tools used in your workspace.
|
||||
|
||||
✔ Which plugins would you like to add? · No items were selected
|
||||
|
||||
NX 🐳 Nx initialization
|
||||
|
||||
NX 🧑🔧 Please answer the following questions about the scripts found in your workspace in order to generate task runner configuration
|
||||
|
||||
✔ Which scripts need to be run in order? (e.g. before building a project, dependent projects must be built) · build
|
||||
✔ Which scripts are cacheable? (Produce the same output given the same input, e.g. build, test and lint usually are, serve and start are not) · typecheck, build, lint
|
||||
✔ Does the "typecheck" script create any outputs? If not, leave blank, otherwise provide a path relative to a project root (e.g. dist, lib, build, coverage) ·
|
||||
✔ Does the "build" script create any outputs? If not, leave blank, otherwise provide a path relative to a project root (e.g. dist, lib, build, coverage) · dist
|
||||
✔ Does the "lint" script create any outputs? If not, leave blank, otherwise provide a path relative to a project root (e.g. dist, lib, build, coverage) ·
|
||||
✔ Would you like remote caching to make your build faster? · skip
|
||||
|
||||
...
|
||||
|
||||
NX 👀 Explore Your Workspace
|
||||
|
||||
Run "nx graph" to show the graph of the workspace. It will show tasks that you can run with Nx.
|
||||
Read this guide on exploring your workspace: https://nx.dev/features/explore-graph
|
||||
```
|
||||
|
||||
## Explore Your Workspace
|
||||
|
||||
If you run `nx graph` as instructed, you'll see the dependencies between your projects.
|
||||
|
||||
```shell {% path="~/tuskydesigns" %}
|
||||
npx nx graph
|
||||
```
|
||||
|
||||
{% graph title="Tusk Design" height="200px" jsonFile="shared/tutorials/npm-workspaces-project-graph.json" %}
|
||||
{% /graph %}
|
||||
|
||||
Nx uses this graph to determine the order tasks are run and enforce module boundaries. You can also leverage this graph to gain an accurate understanding of the architecture of your codebase. Part of what makes this graph invaluable is that it is derived directly from your codebase, so it will never become out of date.
|
||||
|
||||
## Caching Pre-configured
|
||||
|
||||
Nx has been configured to run your `build`, `typecheck` and `lint` tasks. You can run a single task like this:
|
||||
|
||||
```shell {% path="~/tuskydesigns" %}
|
||||
npx nx build @tuskdesign/demo
|
||||
```
|
||||
|
||||
Or all tasks with a certain name like this:
|
||||
|
||||
```shell {% path="~/tuskydesigns" %}
|
||||
npx nx run-many -t typecheck
|
||||
```
|
||||
|
||||
During the `init` script, Nx also configured caching for these tasks. You can see in the `nx.json` file that the `build`, `typecheck` and `lint` targets have the `cache` property set to `true` and the `build` target specifies that its output goes to the project's `dist` folder.
|
||||
|
||||
```json {% fileName="nx.json" %}
|
||||
{
|
||||
"$schema": "./node_modules/nx/schemas/nx-schema.json",
|
||||
"targetDefaults": {
|
||||
"build": {
|
||||
"dependsOn": ["^build"],
|
||||
"outputs": ["{projectRoot}/dist"],
|
||||
"cache": true
|
||||
},
|
||||
"typecheck": {
|
||||
"cache": true
|
||||
},
|
||||
"lint": {
|
||||
"cache": true
|
||||
}
|
||||
},
|
||||
"defaultBase": "main"
|
||||
}
|
||||
```
|
||||
|
||||
Try running `build` for the `demo` app a second time:
|
||||
|
||||
```shell {% path="~/tuskydesigns" %}
|
||||
npx nx build @tuskdesign/demo
|
||||
```
|
||||
|
||||
The first time `nx build` was run, it took about 5 seconds - just like running `npm run build`. But the second time you run `nx build`, it completes instantly and displays this message:
|
||||
|
||||
```text
|
||||
Nx read the output from the cache instead of running the command for 3 out of 3 tasks.
|
||||
```
|
||||
|
||||
You can see the same caching behavior working when you run `npx nx lint` or `npx nx typecheck`.
|
||||
|
||||
## Use Task Pipelines
|
||||
|
||||
You may be wondering why the caching message in the previous section mentioned 3 tasks when you only ran the `build` task from the terminal. When we said that `build` tasks must be run in order during the setup script, Nx created a simple task pipeline. You can see the configuration for it in the `nx.json` file:
|
||||
|
||||
```json {% fileName="nx.json" %}
|
||||
{
|
||||
"targetDefaults": {
|
||||
"build": {
|
||||
"dependsOn": ["^build"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This configuration means that if you run `build` on any project, Nx will first run `build` for the dependencies of that project and then run `build` on the project itself. The `^build` text means "the `build` tasks of the project's dependencies." You can visualize this in the Nx graph by selecting the `Tasks` dropdown in the top left and clicking `Show all tasks`:
|
||||
|
||||
```shell {% path="~/tuskydesigns" %}
|
||||
npx nx graph
|
||||
```
|
||||
|
||||
{% graph height="200px" title="Build Task Pipeline" type="task" jsonFile="shared/tutorials/npm-workspaces-build-tasks1.json" %}
|
||||
{% /graph %}
|
||||
|
||||
With this pipeline in place, you will never run into the error we hit at the beginning of the tutorial where the `forms` and `buttons` packages weren't built so the `demo` app couldn't build. Test this out by deleting the `packages/forms/dist` folder and then re-running the `build` task for the `demo` app.
|
||||
|
||||
```text {% command="npx nx build @tuskdesign/demo" path="~/tuskydesigns" %}
|
||||
...
|
||||
|
||||
NX Successfully ran target build for project @tuskdesign/demo and 2 tasks it depends on (40ms)
|
||||
|
||||
Nx read the output from the cache instead of running the command for 3 out of 3 tasks.
|
||||
```
|
||||
|
||||
Not only does the build complete successfully, but it finishes instantly and the `packages/forms/dist` folder is put back in place thanks to the caching.
|
||||
|
||||
## Create a Task Pipeline
|
||||
|
||||
You may have noticed in the `apps/demo/package.json` file, there is a `prebuild` script that runs `typecheck` before the `build` script in order to catch any type errors. Let's set up this same behavior in the Nx task pipeline as well.
|
||||
|
||||
```json {% fileName="nx.json" highlightLines=[5] %}
|
||||
{
|
||||
"$schema": "./node_modules/nx/schemas/nx-schema.json",
|
||||
"targetDefaults": {
|
||||
"build": {
|
||||
"dependsOn": ["^build", "typecheck"],
|
||||
"outputs": ["{projectRoot}/dist"],
|
||||
"cache": true
|
||||
},
|
||||
"typecheck": {
|
||||
"cache": true
|
||||
},
|
||||
"lint": {
|
||||
"cache": true
|
||||
}
|
||||
},
|
||||
"defaultBase": "main"
|
||||
}
|
||||
```
|
||||
|
||||
The `dependsOn` line makes Nx run the `typecheck` task for the current project and the `build` task for any dependencies before running the current project's `build` task. Now `nx build` will run the `typecheck` task just like `npm run build` does.
|
||||
|
||||
## Use Nx Plugins to Enhance Vite Tasks with Caching
|
||||
|
||||
You may remember that we defined the `outputs` property in `nx.json` when we were answering questions in the `nx init` script. The value is currently hard-coded so that if you change the output path in your `vite.config.ts`, you have to remember to also change the `outputs` array in the `build` task configuration. This is where plugins can help. They directly infer information from the actual tooling configuration files (`vite.config.ts` in this case).
|
||||
|
||||
Nx plugins can:
|
||||
|
||||
- automatically configure caching for you, including inputs and outputs based on the underlying tooling configuration
|
||||
- infer tasks that can be run on a project because of the tooling present
|
||||
- provide code generators to help scaffold out projects
|
||||
- automatically keep the tooling versions and configuration files up to date
|
||||
|
||||
For this tutorial, we'll just focus on the automatic caching configuration.
|
||||
|
||||
First, let's delete the `outputs` array from `nx.json` so that we don't override the inferred values from the plugin. Your `nx.json` should look like this:
|
||||
|
||||
```json {% fileName="nx.json" %}
|
||||
{
|
||||
"$schema": "./node_modules/nx/schemas/nx-schema.json",
|
||||
"targetDefaults": {
|
||||
"build": {
|
||||
"dependsOn": ["^build", "typecheck"],
|
||||
"cache": true
|
||||
},
|
||||
"typecheck": {
|
||||
"cache": true
|
||||
},
|
||||
"lint": {
|
||||
"cache": true
|
||||
}
|
||||
},
|
||||
"defaultBase": "main"
|
||||
}
|
||||
```
|
||||
|
||||
Now let's add the `@nx/vite` plugin:
|
||||
|
||||
```{% command="npx nx add @nx/vite" path="~/tuskydesign" %}
|
||||
✔ Installing @nx/vite@18.1.0...
|
||||
✔ Initializing @nx/vite...
|
||||
|
||||
NX Package @nx/vite added successfully.
|
||||
```
|
||||
|
||||
The `nx add` command installs the version of the plugin that matches your repo's Nx version and runs that plugin's initialization script. For `@nx/vite`, the initialization script registers the plugin in the `plugins` array of `nx.json` and updates any `package.json` scripts that execute Vite related tasks. Open the project details view for the `demo` app and look at the `build` task.
|
||||
|
||||
```shell {% path="~/tuskydesigns" %}
|
||||
npx nx show project @tuskdesign/demo --web
|
||||
```
|
||||
|
||||
{% project-details title="Project Details View" jsonFile="shared/tutorials/npm-workspaces-pdv.json" %}
|
||||
{% /project-details %}
|
||||
|
||||
If you hover over the settings for the `build` task, you can see where those settings come from. The `inputs` and `outputs` are defined by the `@nx/vite` plugin from the `vite.config.ts` file where as the `dependsOn` property we set earlier in the tutorial in the `targetDefaults` in the `nx.json` file.
|
||||
|
||||
Now let's change where the `build` results are output to in the `vite.config.ts` file.
|
||||
|
||||
```ts {% fileName="apps/demo/vite.config.ts" highlightLines=[7-9] %}
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
build: {
|
||||
outDir: '../../dist/demo',
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Now if you look at project details view again, you'll see that the `outputs` property for Nx's caching has been updated to stay in sync with the setting in the `vite.config.ts` file.
|
||||
|
||||
You can also add the `@nx/eslint` plugin to see how it infers `lint` tasks based on the ESLint configuration files.
|
||||
|
||||
## Summary
|
||||
|
||||
After following this tutorial, the repository is still using all the same tools to run tasks, but now Nx runs those tasks in a smarter way. The tasks are efficiently cached so that there is no repeated work and the cache configuration settings are automatically synced with your tooling configuration files by Nx plugins. Also, any task dependencies are automatically executed whenever needed because we configured task pipelines for the projects.
|
||||
|
||||
The final task graph for `demo` app's `build` task looks like this:
|
||||
|
||||
{% graph height="200px" title="Build Task Pipeline" type="task" jsonFile="shared/tutorials/npm-workspaces-build-tasks2.json" %}
|
||||
{% /graph %}
|
||||
|
||||
## Manage Releases
|
||||
|
||||
If you decide to publish the `forms` or `buttons` packages on NPM, Nx can also help you [manage the release process](/features/manage-releases). Release management involves updating the version of your package, populating a changelog, and publishing the new version to the NPM registry.
|
||||
|
||||
First you'll need to define which projects Nx should manage releases for by setting the `release.projects` property in `nx.json`:
|
||||
|
||||
```json {% fileName="nx.json" %}
|
||||
{
|
||||
"release": {
|
||||
"projects": ["packages/*"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Now you're ready to use the `nx release` command to publish the `forms` and `buttons` packages. The first time you run `nx release`, you need to add the `--first-release` flag so that Nx doesn't try to find the previous version to compare against. It's also recommended to use the `--dry-run` flag until you're sure about the results of the `nx release` command, then you can run it a final time without the `--dry-run` flag.
|
||||
|
||||
To preview your first release, run:
|
||||
|
||||
```shell
|
||||
nx release --first-release --dry-run
|
||||
```
|
||||
|
||||
The command will ask you a series of questions and then show you what the results would be. Once you are happy with the results, run it again without the `--dry-run` flag:
|
||||
|
||||
```shell
|
||||
nx release --first-release
|
||||
```
|
||||
|
||||
After this first release, you can remove the `--first-release` flag and just run `nx release --dry-run`. There is also a [dedicated feature page](/features/manage-releases) that goes into more detail about how to use the `nx release` command.
|
||||
|
||||
## Setup CI for Your NPM Workspace
|
||||
|
||||
This tutorial walked you through how Nx can improve the developer experience for local development, but Nx can also make a big difference in CI. Without adequate tooling, CI times tend to grow exponentially with the size of the codebase. Nx helps reduce wasted time in CI with the [`affected` command](/ci/features/affected) and Nx Replay's [remote caching](/ci/features/remote-cache). Nx also [efficiently parallelizes tasks across machines](/ci/concepts/parallelization-distribution) with Nx Agents.
|
||||
|
||||
To set up Nx Replay run:
|
||||
|
||||
```shell
|
||||
nx connect
|
||||
```
|
||||
|
||||
And click the link provided. You'll need to follow the instructions on the website to sign up for your account.
|
||||
|
||||
Then you can set up your CI with the following command:
|
||||
|
||||
```shell
|
||||
nx generate ci-workflow --ci=github
|
||||
```
|
||||
|
||||
{% callout type="note" title="Choose your CI provider" %}
|
||||
You can choose `github`, `circleci`, `azure`, `bitbucket-pipelines`, or `gitlab` for the `ci` flag.
|
||||
{% /callout %}
|
||||
|
||||
This will create a default CI configuration that sets up Nx Cloud to [use distributed task execution](/ci/features/distribute-task-execution). This automatically runs all tasks on separate machines in parallel wherever possible, without requiring you to manually coordinate copying the output from one machine to another.
|
||||
|
||||
Check out one of these detailed tutorials on setting up CI with Nx:
|
||||
|
||||
- [Circle CI with Nx](/ci/intro/tutorials/circle)
|
||||
- [GitHub Actions with Nx](/ci/intro/tutorials/github-actions)
|
||||
|
||||
## Next Steps
|
||||
|
||||
Connect with the rest of the Nx community with these resources:
|
||||
|
||||
- [Join the Official Nx Discord Server](https://go.nx.dev/community) to ask questions and find out the latest news about Nx.
|
||||
- [Follow Nx on Twitter](https://twitter.com/nxdevtools) to stay up to date with Nx news
|
||||
- [Read our Nx blog](https://blog.nrwl.io/)
|
||||
- [Subscribe to our Youtube channel](https://www.youtube.com/@nxdevtools) for demos and Nx insights
|
||||
@ -754,7 +754,9 @@ const conceptUrls = {
|
||||
'/concepts/more-concepts/global-nx':
|
||||
'/getting-started/installation#installing-nx-globally',
|
||||
'/getting-started/package-based-repo-tutorial':
|
||||
'/getting-started/tutorials/package-based-repo-tutorial',
|
||||
'/getting-started/tutorials/npm-workspaces-tutorial',
|
||||
'/getting-started/tutorials/package-based-repo-tutorial':
|
||||
'/getting-started/tutorials/npm-workspaces-tutorial',
|
||||
'/getting-started/integrated-repo-tutorial':
|
||||
'/getting-started/tutorials/integrated-repo-tutorial',
|
||||
'/getting-started/react-standalone-tutorial':
|
||||
@ -769,7 +771,7 @@ const conceptUrls = {
|
||||
|
||||
const nested5minuteTutorialUrls = {
|
||||
'/tutorials/package-based-repo-tutorial':
|
||||
'/getting-started/tutorials/package-based-repo-tutorial',
|
||||
'/getting-started/tutorials/npm-workspaces-tutorial',
|
||||
'/tutorials/integrated-repo-tutorial':
|
||||
'/getting-started/tutorials/integrated-repo-tutorial',
|
||||
'/tutorials/react-standalone-tutorial':
|
||||
|
||||
@ -67,7 +67,6 @@ describe('Redirect rules configuration', () => {
|
||||
|
||||
test('old tutorial links', () => {
|
||||
const oldTutorialUrls = [
|
||||
'/tutorials/package-based-repo-tutorial',
|
||||
'/tutorials/integrated-repo-tutorial',
|
||||
'/tutorials/react-standalone-tutorial',
|
||||
'/tutorials/angular-standalone-tutorial',
|
||||
|
||||
@ -9,7 +9,7 @@ export const fence: Schema = {
|
||||
highlightLines: { type: 'Array', default: [] },
|
||||
lineGroups: { type: 'Object', default: {} },
|
||||
command: { type: 'String', default: '' },
|
||||
path: { type: 'String', default: '~/workspace' },
|
||||
path: { type: 'String', default: '' },
|
||||
process: { type: 'Boolean', render: false, default: true },
|
||||
skipRescope: { type: 'Boolean', default: false },
|
||||
enableCopy: { type: 'Boolean', default: true },
|
||||
|
||||
@ -10,7 +10,7 @@ export function pointToTutorialAndCourse(preset: Preset) {
|
||||
output.note({
|
||||
title,
|
||||
bodyLines: [
|
||||
`https://nx.dev/getting-started/tutorials/package-based-repo-tutorial`,
|
||||
`https://nx.dev/getting-started/tutorials/npm-workspaces-tutorial`,
|
||||
],
|
||||
});
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user