Compare commits

...

7 Commits

Author SHA1 Message Date
Jason Jean 0261e1f308 Release 13.9.3 2022-03-18 12:24:18 -04:00
Jason Jean 0e46ee9db2 fix(core): remove @nrwl/cli bin setting (#9394) 2022-03-18 12:18:01 -04:00
Jason Jean eaf868f59a Release 13.9.2 2022-03-16 17:30:44 -04:00
Jason Jean 755917c86f chore(core): fix snapshots 2022-03-16 17:28:41 -04:00
Jason Jean f99e1d33b7 fix(core): undo removal of @nrwl/cli and add warning when it is imported (#9370) 2022-03-16 17:28:41 -04:00
Jason Jean af66f02777 Release 13.9.1 2022-03-16 11:25:15 -04:00
Leosvel Pérez Espinosa 7e7f04ad4c fix(core): fix migrate command to properly handle the packages consolidation (#9352) 2022-03-16 11:22:04 -04:00
10 changed files with 30 additions and 14 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@nrwl/nx-source",
"version": "13.9.0",
"version": "13.9.3",
"description": "Smart, Fast and Extensible Build System",
"homepage": "https://nx.dev",
"private": true,
+7
View File
@@ -1,2 +1,9 @@
#!/usr/bin/env node
import { logger } from 'nx/src/shared/logger';
import { getPackageManagerCommand } from 'nx/src/shared/package-manager';
logger.warn('Please update your global install of Nx');
logger.warn(`- ${getPackageManagerCommand().addGlobal} nx`);
require('nx/bin/nx');
-3
View File
@@ -18,9 +18,6 @@
"Cypress",
"CLI"
],
"bin": {
"nx": "./bin/nx.js"
},
"author": "Victor Savkin",
"license": "MIT",
"bugs": {
+5 -1
View File
@@ -6,7 +6,11 @@ import { output } from '../src/cli/output';
import { detectPackageManager } from '../src/shared/package-manager';
import { Workspace } from '../src/cli/workspace';
if (process.argv[2] === 'new' || process.argv[2] === '_migrate') {
if (
process.argv[2] === 'new' ||
process.argv[2] === '_migrate' ||
process.argv[2] === 'migrate'
) {
require('../src/cli/index');
} else {
const workspace = findWorkspaceRoot(process.cwd());
+1
View File
@@ -51,6 +51,7 @@ export async function invokeCommand(
commandArgs,
isVerbose
);
case 'migrate':
case '_migrate':
return (await import('../commands/migrate')).migrate(
root,
@@ -8,6 +8,7 @@ export interface PackageManagerCommands {
install: string;
add: string;
addDev: string;
addGlobal: string;
rm: string;
exec: string;
list: string;
@@ -44,6 +45,7 @@ export function getPackageManagerCommand(
install: 'yarn',
add: 'yarn add -W',
addDev: 'yarn add -D -W',
addGlobal: 'yarn global add',
rm: 'yarn remove',
exec: 'yarn',
run: (script: string, args: string) => `yarn ${script} ${args}`,
@@ -59,6 +61,7 @@ export function getPackageManagerCommand(
install: 'pnpm install --no-frozen-lockfile', // explicitly disable in case of CI
add: 'pnpm add',
addDev: 'pnpm add -D',
addGlobal: 'pnpm add -g',
rm: 'pnpm rm',
exec: useExec ? 'pnpm exec' : 'pnpx',
run: (script: string, args: string) => `pnpm run ${script} -- ${args}`,
@@ -72,6 +75,7 @@ export function getPackageManagerCommand(
install: 'npm install',
add: 'npm install',
addDev: 'npm install -D',
addGlobal: 'npm install -g',
rm: 'npm rm',
exec: 'npx',
run: (script: string, args: string) => `npm run ${script} -- ${args}`,
+3 -3
View File
@@ -42,11 +42,11 @@
"cli": "nx",
"implementation": "./src/migrations/update-13-9-0/update-decorate-cli"
},
"13-9-0-replace-tao-and-cli-with-nx": {
"13-9-0-replace-tao-with-nx": {
"version": "13.9.0-beta.0",
"description": "Replace @nrwl/tao and @nrwl/cli with nx",
"description": "Replace @nrwl/tao with nx",
"cli": "nx",
"implementation": "./src/migrations/update-13-9-0/replace-tao-and-cli-with-nx"
"implementation": "./src/migrations/update-13-9-0/replace-tao-with-nx"
}
},
"packageJsonUpdates": {
@@ -6,6 +6,7 @@ Object {
"@nrwl/angular": "*",
},
"devDependencies": Object {
"@nrwl/cli": "*",
"@nrwl/workspace": "*",
"@types/node": "16.11.7",
"nx": "*",
@@ -28,6 +29,7 @@ exports[`new --preset empty should generate necessary npm dependencies 1`] = `
Object {
"dependencies": Object {},
"devDependencies": Object {
"@nrwl/cli": "*",
"@nrwl/workspace": "*",
"@types/node": "16.11.7",
"nx": "*",
@@ -50,6 +52,7 @@ exports[`new --preset react should generate necessary npm dependencies 1`] = `
Object {
"dependencies": Object {},
"devDependencies": Object {
"@nrwl/cli": "*",
"@nrwl/react": "*",
"@nrwl/workspace": "*",
"@types/node": "16.11.7",
@@ -10,6 +10,7 @@
"devDependencies": {
<% if(cli === 'angular') { %>"@angular/cli": "<%= angularCliVersion %>",<% } %>
"nx": "<%= nxVersion %>",
"@nrwl/cli": "<%= nxVersion %>",
"@nrwl/workspace": "<%= nxVersion %>",
"@types/node": "16.11.7",
"typescript": "<%= typescriptVersion %>",
@@ -1,22 +1,21 @@
import { Tree, updateJson } from '@nrwl/devkit';
export function replaceTaoAndCLIWithNx(host: Tree) {
export function replaceTaoWithNx(host: Tree) {
updateJson(host, 'package.json', (json: any) => {
if (json.dependencies['@nrwl/workspace']) {
json.dependencies['nx'] = json.dependencies['@nrwl/workspace'];
} else if (json.devDependencies['@nrwl/workspace']) {
json.devDependencies['nx'] = json.devDependencies['@nrwl/workspace'];
}
removeTaoAndCLI(json.dependencies);
removeTaoAndCLI(json.devDependencies);
removeTao(json.dependencies);
removeTao(json.devDependencies);
return json;
});
}
function removeTaoAndCLI(json: any) {
function removeTao(json: any) {
if (!json) return;
json['@nrwl/tao'] = undefined;
json['@nrwl/cli'] = undefined;
}
export default replaceTaoAndCLIWithNx;
export default replaceTaoWithNx;