cleanup(misc): remove add-nx-to-monorepo package (#15498)

This commit is contained in:
Leosvel Pérez Espinosa 2023-04-12 16:41:17 +01:00 committed by GitHub
parent cdc0906132
commit e5b48ac956
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 11 additions and 779 deletions

View File

@ -102,7 +102,6 @@ jobs:
- yarn
- pnpm
project:
- e2e-add-nx-to-monorepo
- e2e-angular-core
- e2e-angular-extensions
- e2e-cra-to-nx
@ -143,8 +142,6 @@ jobs:
- os: macos-latest
os_timeout: 90
# codeowner groups
- project: e2e-add-nx-to-monorepo
codeowners: 'S04SYHYKGNP'
- project: e2e-angular-core
codeowners: 'S04SS457V38'
- project: e2e-angular-extensions
@ -210,8 +207,6 @@ jobs:
- os: ubuntu-latest
project: e2e-expo
# exclude non-CNW/Lerna tests from non-LTS node versions
- node_version: 16
project: e2e-add-nx-to-monorepo
- node_version: 16
project: e2e-angular-core
- node_version: 16
@ -262,8 +257,6 @@ jobs:
project: e2e-vite
- node_version: 16
project: e2e-webpack
- node_version: 19
project: e2e-add-nx-to-monorepo
- node_version: 19
project: e2e-angular-core
- node_version: 19

View File

@ -73,7 +73,6 @@ jobs:
package_manager:
- npm
project:
- e2e-add-nx-to-monorepo
- e2e-angular-core
- e2e-angular-extensions
- e2e-cra-to-nx
@ -101,8 +100,6 @@ jobs:
- e2e-workspace-create-npm
include:
# codeowner groups
- project: e2e-add-nx-to-monorepo
codeowners: 'S04SYHYKGNP'
- project: e2e-angular-core
codeowners: 'S04SS457V38'
- project: e2e-angular-extensions
@ -155,8 +152,6 @@ jobs:
codeowners: 'S04SYHYKGNP'
exclude:
# exclude non-CNW/Lerna tests from non-LTS node versions
- node_version: 16
project: e2e-add-nx-to-monorepo
- node_version: 16
project: e2e-angular-core
- node_version: 16
@ -201,8 +196,6 @@ jobs:
project: e2e-vite
- node_version: 16
project: e2e-webpack
- node_version: 19
project: e2e-add-nx-to-monorepo
- node_version: 19
project: e2e-angular-core
- node_version: 19

View File

@ -140,9 +140,6 @@ yarn.lock @FrozenPandaz @vsavkin @AgentEnder @jaysoo @JamesHenry
/e2e/workspace-create/** @FrozenPandaz @AgentEnder @vsavkin
/e2e/workspace-create-npm/** @FrozenPandaz @vsavkin
/packages/add-nx-to-monorepo/** @vsavkin @FrozenPandaz @AgentEnder
/e2e/add-nx-to-monorepo/** @vsavkin @FrozenPandaz @AgentEnder
# Misc
/e2e/lerna-smoke-tests/** @vsavkin @JamesHenry
/e2e/utils/** @meeroslav @barbados-clemens @vsavkin @mandarini

View File

@ -3754,14 +3754,6 @@
{
"id": "packages",
"menu": [
{
"id": "add-nx-to-monorepo",
"path": "/packages/add-nx-to-monorepo",
"name": "add-nx-to-monorepo",
"children": [],
"isExternal": false,
"disableCollapsible": false
},
{
"id": "angular",
"path": "/packages/angular",

View File

@ -1,16 +1,4 @@
{
"add-nx-to-monorepo": {
"githubRoot": "https://github.com/nrwl/nx/blob/master",
"name": "add-nx-to-monorepo",
"packageName": "add-nx-to-monorepo",
"description": "Make any monorepo faster by adding Nx to it",
"documents": {},
"root": "/packages/add-nx-to-monorepo",
"source": "/packages/add-nx-to-monorepo/src",
"executors": {},
"generators": {},
"path": "/packages/add-nx-to-monorepo"
},
"angular": {
"githubRoot": "https://github.com/nrwl/nx/blob/master",
"name": "angular",

View File

@ -1,15 +1,4 @@
[
{
"description": "Make any monorepo faster by adding Nx to it",
"documents": [],
"executors": [],
"generators": [],
"githubRoot": "https://github.com/nrwl/nx/blob/master",
"name": "add-nx-to-monorepo",
"packageName": "add-nx-to-monorepo",
"root": "/packages/add-nx-to-monorepo",
"source": "/packages/add-nx-to-monorepo/src"
},
{
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
"documents": [

View File

@ -1,11 +1,4 @@
[
{
"name": "add-nx-to-monorepo",
"packageName": "add-nx-to-monorepo",
"description": "Make any monorepo faster by adding Nx to it",
"path": "generated/packages/add-nx-to-monorepo.json",
"schemas": { "executors": [], "generators": [] }
},
{
"name": "angular",
"packageName": "angular",

View File

@ -9,7 +9,7 @@ In this tutorial you:
- Used Nx's affected commands to only rebuild affected projects
- Used Nx's ability to automatically detect dependencies between js/ts projects
You created a workspace from scratch in this tutorial, but if you would like to add Nx to an existing repository, you can use the `npx add-nx-to-monorepo` terminal command to get started. For more information see the [Adding Nx to Lerna/Yarn/PNPM/NPM Workspace](migration/adding-to-monorepo) guide.
You created a workspace from scratch in this tutorial, but if you would like to add Nx to an existing repository, you can use the `npx nx@latest init` terminal command to get started. For more information see the [Adding Nx to Lerna/Yarn/PNPM/NPM Workspace](migration/adding-to-monorepo) guide.
## Learn more

View File

@ -809,135 +809,6 @@
}
}
},
{
"name": "add-nx-to-monorepo",
"type": "lib",
"data": {
"tags": [],
"root": "packages/add-nx-to-monorepo",
"files": [
{
"file": "packages/add-nx-to-monorepo/.eslintrc.json",
"hash": "fea46111a20ae8689af46385367f70421bb9b054"
},
{
"file": "packages/add-nx-to-monorepo/jest.config.ts",
"hash": "afbef505f1ec54cc514b99a9a17b28ae324fee9d"
},
{
"file": "packages/add-nx-to-monorepo/package.json",
"hash": "dd6e5957571f279d2d74f9b044a4625fb5effecb",
"deps": ["npm:enquirer", "npm:ignore", "nx", "npm:yargs-parser"]
},
{
"file": "packages/add-nx-to-monorepo/project.json",
"hash": "dc07d52c75ed78c70bb162b71fb616f9d4e43d99"
},
{
"file": "packages/add-nx-to-monorepo/README.md",
"hash": "4c9ccc040cce4906abe2bbd902ceaf82750b4303"
},
{
"file": "packages/add-nx-to-monorepo/src/add-nx-to-monorepo.ts",
"hash": "92676814246d70350360ac2012a3af4b70800ea7",
"deps": ["npm:enquirer", "nx", "npm:ignore", "npm:yargs-parser"]
},
{
"file": "packages/add-nx-to-monorepo/tsconfig.json",
"hash": "62ebbd946474cea997e774d20fffc4d585c184f3"
},
{
"file": "packages/add-nx-to-monorepo/tsconfig.lib.json",
"hash": "ddf3333d32bff44ffcf392ccdc3f72993ef14663"
},
{
"file": "packages/add-nx-to-monorepo/tsconfig.spec.json",
"hash": "831ab6481bfec07dac66b6f62828f76f898f0edf"
}
],
"targets": {
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["packages/add-nx-to-monorepo/**/*.ts"]
},
"inputs": [
"default",
"{workspaceRoot}/.eslintrc.json",
"{workspaceRoot}/tools/eslint-rules/**/*"
]
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["{workspaceRoot}/coverage/packages/add-nx-to-monorepo"],
"options": {
"jestConfig": "packages/add-nx-to-monorepo/jest.config.ts",
"passWithNoTests": true
},
"dependsOn": ["build"],
"inputs": [
"default",
"^production",
"{workspaceRoot}/jest.preset.js"
]
},
"build-base": {
"executor": "@nrwl/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "build/packages/add-nx-to-monorepo",
"tsConfig": "packages/add-nx-to-monorepo/tsconfig.lib.json",
"packageJson": "packages/add-nx-to-monorepo/package.json",
"main": "packages/add-nx-to-monorepo/src/index.ts",
"updateBuildableProjectDepsInPackageJson": false,
"assets": [
"packages/add-nx-to-monorepo/*.md",
{
"input": "",
"glob": "LICENSE",
"output": "/"
}
]
},
"dependsOn": ["^build-base"],
"inputs": ["production", "^production"]
},
"build": {
"executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/add-nx-to-monorepo"],
"options": {
"commands": [
{
"command": "node ./scripts/chmod build/packages/add-nx-to-monorepo/src/add-nx-to-monorepo.js"
},
{
"command": "node ./scripts/copy-readme.js add-nx-to-monorepo"
}
],
"parallel": false
},
"dependsOn": ["build-base"],
"inputs": ["production", "^production"]
},
"test-against-repo": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "nx build add-nx-to-monorepo",
"forwardAllArgs": false
},
{
"command": "export JS_SCRIPT=$PWD/dist/packages/add-nx-to-monorepo/src/add-nx-to-monorepo.js && cd {args.repo} && echo $PWD && node $JS_SCRIPT",
"forwardAllArgs": false
}
],
"parallel": false
}
}
}
}
},
{
"name": "nx-dev-feature-doc-viewer",
"type": "lib",
@ -1626,80 +1497,6 @@
}
}
},
{
"name": "e2e-add-nx-to-monorepo",
"type": "app",
"data": {
"tags": [],
"root": "e2e/add-nx-to-monorepo",
"files": [
{
"file": "e2e/add-nx-to-monorepo/jest.config.ts",
"hash": "cb1dea1f21be9ab44591f110ceca7aeda84a0de1"
},
{
"file": "e2e/add-nx-to-monorepo/project.json",
"hash": "8ff09d8d3c89b6754521cc8cc9add67b9a5bcefa"
},
{
"file": "e2e/add-nx-to-monorepo/src/add-nx-to-monorepo.test.ts",
"hash": "a1d3b330d0678eecf960b301067fd982c1d9d0b3",
"deps": ["e2e-utils", "nx"]
},
{
"file": "e2e/add-nx-to-monorepo/tsconfig.json",
"hash": "6d5abf84832009a8c70e7a910c49f332bf1f0612"
},
{
"file": "e2e/add-nx-to-monorepo/tsconfig.spec.json",
"hash": "1a24bfb0a13536cd17717808ca5609e15def438f"
}
],
"targets": {
"e2e": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "yarn e2e-start-local-registry"
},
{
"command": "yarn e2e-build-package-publish"
},
{
"command": "nx run-e2e-tests e2e-add-nx-to-monorepo"
}
],
"parallel": false
},
"inputs": [
"default",
"^production",
{
"env": "SELECTED_CLI"
},
{
"env": "NX_E2E_CI_CACHE_KEY"
}
]
},
"run-e2e-tests": {
"executor": "@nrwl/jest:jest",
"options": {
"jestConfig": "e2e/add-nx-to-monorepo/jest.config.ts",
"passWithNoTests": true,
"runInBand": true
},
"outputs": ["{workspaceRoot}/coverage/e2e/add-nx-to-monorepo"],
"inputs": [
"default",
"^production",
"{workspaceRoot}/jest.preset.js"
]
}
}
}
},
{
"name": "e2e-angular-extensions",
"type": "app",
@ -25830,10 +25627,6 @@
"file": "docs/generated/devkit/ngcli_adapter.md",
"hash": "dd62a5fbc75c8579574437234fb56436bb3a8d57"
},
{
"file": "docs/generated/packages/add-nx-to-monorepo.json",
"hash": "7e9b8a37307774034db7cf43ff2c66628e779002"
},
{
"file": "docs/generated/packages/angular.json",
"hash": "9dfbc789bcc954b861b2df7383ad440889bb1719"
@ -29353,150 +29146,6 @@
},
"dependencies": { "nx-dev-data-access-packages:test": [] }
},
"add-nx-to-monorepo:lint": {
"roots": ["add-nx-to-monorepo:lint"],
"tasks": {
"add-nx-to-monorepo:lint": {
"id": "add-nx-to-monorepo:lint",
"target": { "project": "add-nx-to-monorepo", "target": "lint" },
"projectRoot": "packages/add-nx-to-monorepo",
"overrides": {}
}
},
"dependencies": { "add-nx-to-monorepo:lint": [] }
},
"add-nx-to-monorepo:test": {
"roots": ["graph-client:build-base:release"],
"tasks": {
"add-nx-to-monorepo:test": {
"id": "add-nx-to-monorepo:test",
"target": { "project": "add-nx-to-monorepo", "target": "test" },
"projectRoot": "packages/add-nx-to-monorepo",
"overrides": {}
},
"add-nx-to-monorepo:build": {
"id": "add-nx-to-monorepo:build",
"target": { "project": "add-nx-to-monorepo", "target": "build" },
"projectRoot": "packages/add-nx-to-monorepo",
"overrides": { "__overrides_unparsed__": [] }
},
"add-nx-to-monorepo:build-base": {
"id": "add-nx-to-monorepo:build-base",
"target": { "project": "add-nx-to-monorepo", "target": "build-base" },
"projectRoot": "packages/add-nx-to-monorepo",
"overrides": { "__overrides_unparsed__": [] }
},
"nx:build-base": {
"id": "nx:build-base",
"target": { "project": "nx", "target": "build-base" },
"projectRoot": "packages/nx",
"overrides": { "__overrides_unparsed__": [] }
},
"graph-client:build-base:release": {
"id": "graph-client:build-base:release",
"target": {
"project": "graph-client",
"target": "build-base",
"configuration": "release"
},
"projectRoot": "graph/client",
"overrides": { "__overrides_unparsed__": [] }
}
},
"dependencies": {
"add-nx-to-monorepo:test": ["add-nx-to-monorepo:build"],
"add-nx-to-monorepo:build": ["add-nx-to-monorepo:build-base"],
"add-nx-to-monorepo:build-base": ["nx:build-base"],
"nx:build-base": ["graph-client:build-base:release"],
"graph-client:build-base:release": []
}
},
"add-nx-to-monorepo:build-base": {
"roots": ["graph-client:build-base:release"],
"tasks": {
"add-nx-to-monorepo:build-base": {
"id": "add-nx-to-monorepo:build-base",
"target": { "project": "add-nx-to-monorepo", "target": "build-base" },
"projectRoot": "packages/add-nx-to-monorepo",
"overrides": {}
},
"nx:build-base": {
"id": "nx:build-base",
"target": { "project": "nx", "target": "build-base" },
"projectRoot": "packages/nx",
"overrides": { "__overrides_unparsed__": [] }
},
"graph-client:build-base:release": {
"id": "graph-client:build-base:release",
"target": {
"project": "graph-client",
"target": "build-base",
"configuration": "release"
},
"projectRoot": "graph/client",
"overrides": { "__overrides_unparsed__": [] }
}
},
"dependencies": {
"add-nx-to-monorepo:build-base": ["nx:build-base"],
"nx:build-base": ["graph-client:build-base:release"],
"graph-client:build-base:release": []
}
},
"add-nx-to-monorepo:build": {
"roots": ["graph-client:build-base:release"],
"tasks": {
"add-nx-to-monorepo:build": {
"id": "add-nx-to-monorepo:build",
"target": { "project": "add-nx-to-monorepo", "target": "build" },
"projectRoot": "packages/add-nx-to-monorepo",
"overrides": {}
},
"add-nx-to-monorepo:build-base": {
"id": "add-nx-to-monorepo:build-base",
"target": { "project": "add-nx-to-monorepo", "target": "build-base" },
"projectRoot": "packages/add-nx-to-monorepo",
"overrides": { "__overrides_unparsed__": [] }
},
"nx:build-base": {
"id": "nx:build-base",
"target": { "project": "nx", "target": "build-base" },
"projectRoot": "packages/nx",
"overrides": { "__overrides_unparsed__": [] }
},
"graph-client:build-base:release": {
"id": "graph-client:build-base:release",
"target": {
"project": "graph-client",
"target": "build-base",
"configuration": "release"
},
"projectRoot": "graph/client",
"overrides": { "__overrides_unparsed__": [] }
}
},
"dependencies": {
"add-nx-to-monorepo:build": ["add-nx-to-monorepo:build-base"],
"add-nx-to-monorepo:build-base": ["nx:build-base"],
"nx:build-base": ["graph-client:build-base:release"],
"graph-client:build-base:release": []
}
},
"add-nx-to-monorepo:test-against-repo": {
"roots": ["add-nx-to-monorepo:test-against-repo"],
"tasks": {
"add-nx-to-monorepo:test-against-repo": {
"id": "add-nx-to-monorepo:test-against-repo",
"target": {
"project": "add-nx-to-monorepo",
"target": "test-against-repo"
},
"projectRoot": "packages/add-nx-to-monorepo",
"overrides": {}
}
},
"dependencies": { "add-nx-to-monorepo:test-against-repo": [] }
},
"nx-dev-feature-doc-viewer:lint": {
"roots": ["nx-dev-feature-doc-viewer:lint"],
"tasks": {
@ -30079,33 +29728,6 @@
},
"dependencies": { "nx-dev-data-access-menu:test": [] }
},
"e2e-add-nx-to-monorepo:e2e": {
"roots": ["e2e-add-nx-to-monorepo:e2e"],
"tasks": {
"e2e-add-nx-to-monorepo:e2e": {
"id": "e2e-add-nx-to-monorepo:e2e",
"target": { "project": "e2e-add-nx-to-monorepo", "target": "e2e" },
"projectRoot": "e2e/add-nx-to-monorepo",
"overrides": {}
}
},
"dependencies": { "e2e-add-nx-to-monorepo:e2e": [] }
},
"e2e-add-nx-to-monorepo:run-e2e-tests": {
"roots": ["e2e-add-nx-to-monorepo:run-e2e-tests"],
"tasks": {
"e2e-add-nx-to-monorepo:run-e2e-tests": {
"id": "e2e-add-nx-to-monorepo:run-e2e-tests",
"target": {
"project": "e2e-add-nx-to-monorepo",
"target": "run-e2e-tests"
},
"projectRoot": "e2e/add-nx-to-monorepo",
"overrides": {}
}
},
"dependencies": { "e2e-add-nx-to-monorepo:run-e2e-tests": [] }
},
"e2e-angular-extensions:e2e": {
"roots": ["e2e-angular-extensions:e2e"],
"tasks": {

View File

@ -63,7 +63,7 @@ By default `useNx` will be set to `false`, so you have to explicitly opt-in.
**3. Create a nx.json (optional but recommended)**
Nx works even without `nx.json` but to configure some more details such as the `cacheableOperations` of your monorepo in particular, create a `nx.json` at the root of the monorepo. Alternatively you can also just run `npx nx init` to have one generated. Specify the cacheable operations, usually something like `build`, `test`, `lint` etc, depending on your workspace setup:
Nx works even without `nx.json` but to configure some more details such as the `cacheableOperations` of your monorepo in particular, create a `nx.json` at the root of the monorepo. Alternatively you can also just run `npx nx@latest init` to have one generated. Specify the cacheable operations, usually something like `build`, `test`, `lint` etc, depending on your workspace setup:
```json {% fileName="nx.json" %}
{
@ -90,7 +90,7 @@ This does not include distributed caching or distributed task execution powered
Nx can be added to an existing Lerna monorepo by running the following command:
```shell
npx add-nx-to-monorepo
npx nx@latest init
```
This will

View File

@ -7,7 +7,7 @@ Within an Nx workspace, you gain many capabilities that help you build applicati
You can migrate to a [Standalone Angular App](/concepts/integrated-vs-package-based#standalone-applications) with the command:
```shell
npx nx init
npx nx@latest init
```
This command will install the correct version of Nx based on your Angular version.

View File

@ -7,7 +7,7 @@ Create-React-App (CRA) is one of the most widely used tool for creating, buildin
The easiest way to setup Nx in your CRA project is to use the automated migration tool.
```shell
npx nx init
npx nx@latest init
```
{% callout type="note" title="Want to migrate to a monorepo instead?" %}
@ -25,7 +25,7 @@ You will notice that the project now uses [Vite](https://vitejs.dev/) and [Vites
test your application. Vite is a next-gen tooling for building frontend applications, and is much faster than Webpack (
which CRA uses).
If you do not want to use Vite, you can run `npx nx init --vite=false` instead.
If you do not want to use Vite, you can run `npx nx@latest init --vite=false` instead.
{% /callout %}
## Try Nx

View File

@ -1,11 +0,0 @@
/* eslint-disable */
export default {
transform: {
'^.+\\.[tj]sx?$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
maxWorkers: 1,
globals: {},
displayName: 'e2e-add-nx-to-monorepo',
preset: '../../jest.preset.js',
};

View File

@ -1,11 +0,0 @@
{
"name": "e2e-add-nx-to-monorepo",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "e2e/add-nx-to-monorepo",
"projectType": "application",
"targets": {
"e2e": {},
"run-e2e-tests": {}
},
"implicitDependencies": ["workspace"]
}

View File

@ -1,79 +0,0 @@
import {
createNonNxProjectDirectory,
runCLI,
runCommand,
updateFile,
getPackageManagerCommand,
getSelectedPackageManager,
getPublishedVersion,
} from '@nrwl/e2e/utils';
describe('add-nx-to-monorepo', () => {
const pmc = getPackageManagerCommand({
packageManager: getSelectedPackageManager(),
});
it('should not throw', () => {
if (pmc.runUninstalledPackage) {
// Arrange
createNonNxProjectDirectory();
runCommand(pmc.install);
updateFile(
'packages/package-a/package.json',
JSON.stringify({
name: 'package-a',
scripts: {
serve: 'some serve',
build: 'some build',
test: 'some test',
},
})
);
updateFile(
'packages/package-b/package.json',
JSON.stringify({
name: 'package-b',
scripts: {
lint: 'some lint',
},
})
);
// Act
const output = runCommand(
`${
pmc.runUninstalledPackage
} add-nx-to-monorepo@${getPublishedVersion()} -y`
);
// Assert
expect(output).toContain('🎉 Done!');
}
});
it('should build', () => {
if (pmc.runUninstalledPackage) {
// Arrange
createNonNxProjectDirectory();
runCommand(pmc.runUninstalledPackage);
updateFile(
'packages/package-a/package.json',
JSON.stringify({
name: 'package-a',
scripts: {
build: 'echo "build successful"',
},
})
);
// Act
runCommand(
`${
pmc.runUninstalledPackage
} add-nx-to-monorepo@${getPublishedVersion()} -y`
);
const output = runCLI('build package-a');
// Assert
expect(output).toContain('build successful');
}
});
});

View File

@ -1,13 +0,0 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"types": ["node", "jest"]
},
"include": [],
"files": [],
"references": [
{
"path": "./tsconfig.spec.json"
}
]
}

View File

@ -1,20 +0,0 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"include": [
"**/*.test.ts",
"**/*.spec.ts",
"**/*.spec.tsx",
"**/*.test.tsx",
"**/*.spec.js",
"**/*.test.js",
"**/*.spec.jsx",
"**/*.test.jsx",
"**/*.d.ts",
"jest.config.ts"
]
}

View File

@ -45,7 +45,6 @@ export function getPackagesSections(items: MenuItem[]): MenuSection[] {
return items
.filter(
(m) =>
m.id !== 'add-nx-to-monorepo' &&
m.id !== 'cra-to-nx' &&
m.id !== 'create-nx-plugin' &&
m.id !== 'create-nx-workspace' &&

View File

@ -28,7 +28,6 @@ export function filterMigrationPackages<ItemType extends { name: string }>(
itemList: ItemType[]
): ItemType[] {
const nxPackageNames = [
'add-nx-to-monorepo',
'create-nx-workspace',
'create-nx-plugin',
'cra-to-nx',

View File

@ -33,7 +33,6 @@ export async function getStaticProps(): Promise<{ props: CommunityProps }> {
const officialPluginList = (nxPackagesApi.getRootPackageIndex() ?? []).filter(
(m) =>
m.name !== 'add-nx-to-monorepo' &&
m.name !== 'cra-to-nx' &&
m.name !== 'create-nx-plugin' &&
m.name !== 'create-nx-workspace' &&

View File

@ -506,6 +506,7 @@ const packagesDocuments = {
'/packages/storybook/documents/migrate-storybook-7':
'/packages/storybook/generators/migrate-7',
'/linter/eslint-plugin-nx': '/packages/linter/documents/eslint-plugin-nx',
'/packages/add-nx-to-monorepo': '/packages/nx/documents/init',
};
/**

View File

@ -118,9 +118,7 @@ export function MonorepoStyles(): JSX.Element {
</span>{' '}
<span>$</span>
</p>
<p className="typing mt-0.5 flex-1 pl-2">
npx add-nx-to-monorepo
</p>
<p className="typing mt-0.5 flex-1 pl-2">npx nx@latest init</p>
</div>
<div className="mt-4 flex">
<p className="typing flex-1 items-center pl-2">
@ -130,14 +128,6 @@ export function MonorepoStyles(): JSX.Element {
🐳 Nx initialization
</p>
</div>
<div className="mt-4 flex">
<p className="typing flex-1 items-center pl-2">
<span className="mr-2 bg-pink-300 px-1 py-0.5 dark:bg-fuchsia-600">
NX
</span>
🧑🔧 Analyzing the source code and creating configuration files
</p>
</div>{' '}
<div className="mt-4 flex">
<p className="typing flex-1 items-center pl-2">
<span className="mr-2 bg-pink-300 px-1 py-0.5 dark:bg-fuchsia-600">

View File

@ -1,5 +0,0 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"rules": {}
}

View File

@ -1,22 +0,0 @@
# `> npx add-nx-to-monorepo`
<p align="center"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600"></p>
<div align="center">
[![License](https://img.shields.io/npm/l/@nrwl/workspace.svg?style=flat-square)]()
[![NPM Version](https://badge.fury.io/js/%40nrwl%2Fworkspace.svg)](https://www.npmjs.com/@nrwl/workspace)
[![Join the chat at https://gitter.im/nrwl-nx/community](https://badges.gitter.im/nrwl-nx/community.svg)](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Join us @nrwl/community on slack](https://img.shields.io/badge/slack-%40nrwl%2Fcommunity-brightgreen)](https://join.slack.com/t/nrwlcommunity/shared_invite/enQtNzU5MTE4OTQwOTk0LTgxY2E0ZWYzMWE0YzA5ZDA2MWM1NDVhNmI2ZWMyYmZhNWJiODk3MjkxZjY3MzU5ZjRmM2NmNWU1OTgyZmE4Mzc)
</div>
An easy way to add Nx computation caching to any monorepo (Yarn Workspaces, PNPM, Lerna, etc).
Simply run: `npx add-nx-to-monorepo` in your monorepo.
## Learn More
- [Guide: Add Nx to Lerna / Yarn / PNPM / NPM Workspaces](/recipes/adopting-nx/adding-to-monorepo#adding-nx-to-lernayarnpnpmnpm-workspace)
- [Video: https://youtu.be/Dq2ftPf3sn4]
- See [https://github.com/nrwl/nx](https://github.com/nrwl/nx) to learn more about Nx.

View File

@ -1,8 +0,0 @@
#!/usr/bin/env node
import { execSync } from 'child_process';
const args = process.argv.slice(2).join(' ');
execSync(`npx --yes nx@latest init ${args}`, {
stdio: [0, 1, 2],
});

View File

@ -1,17 +0,0 @@
/* eslint-disable */
export default {
displayName: 'add-nx-to-monorepo',
globals: {},
transform: {
'^.+\\.[tj]sx?$': [
'ts-jest',
{
tsConfig: '<rootDir>/tsconfig.spec.json',
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/projects/add-nx-to-monorepo',
preset: '../../jest.preset.js',
};

View File

@ -1,33 +0,0 @@
{
"name": "add-nx-to-monorepo",
"version": "0.0.1",
"private": false,
"description": "Make any monorepo faster by adding Nx to it",
"repository": {
"type": "git",
"url": "https://github.com/nrwl/nx.git",
"directory": "packages/add-nx-to-monorepo"
},
"keywords": [
"Monorepo",
"React",
"Web",
"Node",
"Nest",
"Lerna",
"Yarn",
"CLI"
],
"bin": {
"add-nx-to-monorepo": "./index.js"
},
"author": "Victor Savkin",
"license": "MIT",
"bugs": {
"url": "https://github.com/nrwl/nx/issues"
},
"homepage": "https://nx.dev",
"publishConfig": {
"access": "public"
}
}

View File

@ -1,59 +0,0 @@
{
"name": "add-nx-to-monorepo",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/add-nx-to-monorepo",
"projectType": "library",
"targets": {
"lint": {},
"test": {},
"build-base": {
"executor": "@nrwl/js:tsc",
"options": {
"outputPath": "build/packages/add-nx-to-monorepo",
"tsConfig": "packages/add-nx-to-monorepo/tsconfig.lib.json",
"packageJson": "packages/add-nx-to-monorepo/package.json",
"main": "packages/add-nx-to-monorepo/index.ts",
"updateBuildableProjectDepsInPackageJson": false,
"assets": [
"packages/add-nx-to-monorepo/*.md",
{
"input": "",
"glob": "LICENSE",
"output": "/"
}
]
}
},
"build": {
"executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/add-nx-to-monorepo"],
"options": {
"commands": [
{
"command": "node ./scripts/chmod build/packages/add-nx-to-monorepo/index.js"
},
{
"command": "node ./scripts/copy-readme.js add-nx-to-monorepo"
}
],
"parallel": false
}
},
"test-against-repo": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "nx build add-nx-to-monorepo",
"forwardAllArgs": false
},
{
"command": "export JS_SCRIPT=$PWD/dist/packages/add-nx-to-monorepo/index.js && cd {args.repo} && echo $PWD && node $JS_SCRIPT",
"forwardAllArgs": false
}
],
"parallel": false
}
}
}
}

View File

@ -1,13 +0,0 @@
{
"extends": "../../tsconfig.base.json",
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
]
}

View File

@ -1,13 +0,0 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "../../dist/out-tsc",
"declaration": false,
"types": ["node"],
"importHelpers": false,
"sourceMap": false
},
"exclude": ["**/*.spec.ts", "jest.config.ts"],
"include": ["**/*.ts"]
}

View File

@ -1,16 +0,0 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"include": [
"**/*.spec.ts",
"**/*.spec.tsx",
"**/*.spec.js",
"**/*.spec.jsx",
"**/*.d.ts",
"jest.config.ts"
]
}

View File

@ -42,11 +42,8 @@ function main() {
`To create a workspace run:`,
chalk.bold.white(`npx create-nx-workspace@latest <workspace name>`),
'',
`To add Nx to existing workspace run with a workspace-specific nx.json:`,
chalk.bold.white(`npx add-nx-to-monorepo@latest`),
'',
`To add the default nx.json file run:`,
chalk.bold.white(`nx init`),
`To add Nx to an existing workspace with a workspace-specific nx.json, run:`,
chalk.bold.white(`npx nx@latest init`),
],
});

View File

@ -94,7 +94,7 @@ export function createCache(
const newValue: ProjectGraphCache = {
version: projectGraph.version || '5.1',
deps: packageJsonDeps,
// compilerOptions may not exist, especially for repos converted through add-nx-to-monorepo
// compilerOptions may not exist, especially for package-based repos
pathMappings: tsConfig?.compilerOptions?.paths || {},
nxJsonPlugins,
pluginsConfig: nxJson.pluginsConfig,