Skip to content

Commit 6f038e7

Browse files
committed
feat(core): reorganize packges to consolidate all cli-related code in nx
1 parent 5c0da2f commit 6f038e7

239 files changed

Lines changed: 1435 additions & 5009 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/shared/migration/adding-to-monorepo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Nx + Lerna:
148148
"devDependencies": {
149149
"lerna": "*",
150150
"@nrwl/workspace": "*",
151-
"@nrwl/tao": "*"
151+
"nx": "*"
152152
}
153153
}
154154
```

docs/shared/migration/migration-angularjs.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ Your `package.json` should now look like this:
107107
"@nrwl/cli": "13.4.6",
108108
"@nrwl/eslint-plugin-nx": "13.4.6",
109109
"@nrwl/linter": "13.4.6",
110-
"@nrwl/tao": "13.4.6",
111110
"@nrwl/workspace": "13.4.6",
112111
"@types/jasmine": "~3.5.0",
113112
"@types/jasminewd2": "~2.0.3",

docs/shared/nx-core.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ package.json
3232
"scripts": {},
3333
"private": true,
3434
"devDependencies": {
35-
"@nrwl/cli": "12.8.0",
36-
"@nrwl/tao": "12.8.0",
35+
"nx": "12.8.0",
3736
"@nrwl/workspace": "12.8.0",
3837
"@types/node": "14.14.33",
3938
"typescript": "~4.3.5"

e2e/add-nx-to-monorepo/src/add-nx-to-monorepo.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import {
22
createNonNxProjectDirectory,
3-
readProjectConfig,
43
runCommand,
54
tmpProjPath,
65
updateFile,
76
} from '@nrwl/e2e/utils';
8-
import { Workspaces } from '@nrwl/tao/src/shared/workspace';
7+
import { Workspaces } from 'nx/src/shared/workspace';
98

109
describe('add-nx-to-monorepo', () => {
1110
it('should not throw', () => {

e2e/angular-core/src/ng-add.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { PackageManager } from 'nx/src/shared/package-manager';
2+
13
process.env.SELECTED_CLI = 'angular';
24

35
import {
@@ -13,7 +15,6 @@ import {
1315
uniq,
1416
updateFile,
1517
} from '@nrwl/e2e/utils';
16-
import { PackageManager } from '@nrwl/tao/src/shared/package-manager';
1718

1819
describe('convert Angular CLI workspace to an Nx workspace', () => {
1920
let project: string;

e2e/cli/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@
3030
"outputs": ["coverage/e2e/cli"]
3131
}
3232
},
33-
"implicitDependencies": ["cli", "js"]
33+
"implicitDependencies": ["js"]
3434
}

e2e/cli/src/cli.test.ts

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
describe('Cli', () => {
1616
beforeEach(() => newProject());
1717

18-
it('vvvshould execute long running tasks', () => {
18+
it('vvvshould execute long running tasks', async () => {
1919
const myapp = uniq('myapp');
2020
runCLI(`generate @nrwl/web:app ${myapp}`);
2121
updateProjectConfig(myapp, (c) => {
@@ -210,15 +210,13 @@ describe('migrate', () => {
210210
})
211211
);
212212

213-
updateFile(
214-
'./node_modules/@nrwl/tao/src/commands/migrate.js',
215-
(content) => {
216-
const start = content.indexOf('// testing-fetch-start');
217-
const end = content.indexOf('// testing-fetch-end');
218-
219-
const before = content.substring(0, start);
220-
const after = content.substring(end);
221-
const newFetch = `
213+
updateFile('./node_modules/nx/src/commands/migrate.js', (content) => {
214+
const start = content.indexOf('// testing-fetch-start');
215+
const end = content.indexOf('// testing-fetch-end');
216+
217+
const before = content.substring(0, start);
218+
const after = content.substring(end);
219+
const newFetch = `
222220
function createFetcher(logger) {
223221
return function fetch(packageName) {
224222
if (packageName === 'migrate-parent-package') {
@@ -250,9 +248,8 @@ describe('migrate', () => {
250248
}
251249
`;
252250

253-
return `${before}${newFetch}${after}`;
254-
}
255-
);
251+
return `${before}${newFetch}${after}`;
252+
});
256253

257254
runCLI(
258255

e2e/utils/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import {
44
ProjectConfiguration,
55
WorkspaceJsonConfiguration,
66
} from '@nrwl/devkit';
7-
import { detectPackageManager } from '@nrwl/tao/src/shared/package-manager';
8-
import { Workspaces } from '@nrwl/tao/src/shared/workspace';
97
import { angularCliVersion } from '@nrwl/workspace/src/utils/versions';
108
import { ChildProcess, exec, execSync } from 'child_process';
119
import {
@@ -29,6 +27,8 @@ import { promisify } from 'util';
2927
import chalk = require('chalk');
3028
import isCI = require('is-ci');
3129
import treeKill = require('tree-kill');
30+
import { Workspaces } from '../../packages/nx/src/shared/workspace';
31+
import { detectPackageManager } from '../../packages/create-nx-workspace/bin/package-manager';
3232

3333
const kill = require('kill-port');
3434
export const isWindows = require('is-windows');

packages/angular/src/builders/webpack-server/webpack-server.impl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
} from '@angular-devkit/build-angular/src/builders/dev-server';
66
import { JsonObject } from '@angular-devkit/core';
77
import { joinPathFragments, parseTargetString } from '@nrwl/devkit';
8-
import { Workspaces } from '@nrwl/tao/src/shared/workspace';
8+
import { Workspaces } from 'nx/src/shared/workspace';
99
import { existsSync } from 'fs';
1010
import { merge } from 'webpack-merge';
1111
import { resolveCustomWebpackConfig } from '../utilities/webpack';

packages/angular/src/executors/utilities/tailwindcss.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { logger } from '@nrwl/devkit';
2-
import { appRootPath } from '@nrwl/tao/src/utils/app-root';
2+
import { appRootPath } from 'nx/src/utils/app-root';
33
import { existsSync } from 'fs';
44
import { join, relative } from 'path';
55
import * as postcssImport from 'postcss-import';

0 commit comments

Comments
 (0)