@nrwl/nx-cloud
Advanced tools
Comparing version 9.2.0 to 9.2.1-beta.1
@@ -6,2 +6,3 @@ "use strict"; | ||
const child_process_1 = require("child_process"); | ||
const output_1 = require("@nrwl/workspace/src/utils/output"); | ||
function updateNxJson(ops) { | ||
@@ -37,5 +38,8 @@ return workspace_1.updateJsonInTree('nx.json', json => { | ||
function updateWorkspacePackage() { | ||
console.log(`Updating @nrwl/workspace ot 8.12.10 to make the workspace compatible with Nx Cloud.`); | ||
const title = `Updating @nrwl/workspace ot 8.12.10 to make the workspace compatible with Nx Cloud.`; | ||
if (isYarn()) { | ||
console.log(`yarn add --dev @nrwl/workspace@8.12.10`); | ||
output_1.output.note({ | ||
title, | ||
bodyLines: [`yarn add --dev @nrwl/workspace@8.12.10`] | ||
}); | ||
child_process_1.execSync(`yarn add --dev @nrwl/workspace@8.12.10`, { | ||
@@ -46,3 +50,6 @@ stdio: ['inherit', 'inherit', 'inherit'] | ||
else { | ||
console.log(`npm i --save-dev @nrwl/workspace@8.12.10`); | ||
output_1.output.note({ | ||
title, | ||
bodyLines: [`npm i --save-dev @nrwl/workspace@8.12.10`] | ||
}); | ||
child_process_1.execSync(`npm i --save-dev @nrwl/workspace@8.12.10`, { | ||
@@ -53,2 +60,18 @@ stdio: ['inherit', 'inherit', 'inherit'] | ||
} | ||
function printUseNxInsteadOfNgMessage() { | ||
output_1.output.note({ | ||
title: `Take advantage Nx Cloud when building and testing individual projects.`, | ||
bodyLines: [ | ||
`The nx run-many and nx affected:* commands will automatically take advantage of the Nx Cloud caching.`, | ||
`You can also use the Nx CLI to build, test, and lint individual projects:`, | ||
`- use nx build ... instead of ng build ...`, | ||
`- use nx test ... instead of ng test ...`, | ||
`- use nx lint ... instead of ng lint ...`, | ||
`The Nx CLI delegates to the Angular CLI, so everything will work exactly the same except with the caching on.`, | ||
``, | ||
`You can also update your NPM scripts to say: "ng": "nx"`, | ||
`and add the following to the postinstall NPM script: ln -sf ./nx ./node_modules/.bin/ng` | ||
] | ||
}); | ||
} | ||
function isYarn() { | ||
@@ -62,2 +85,10 @@ try { | ||
} | ||
function isAngularCLI() { | ||
try { | ||
return fs_1.statSync('angular.json').isFile(); | ||
} | ||
catch (err) { | ||
return false; | ||
} | ||
} | ||
function init(ops) { | ||
@@ -67,2 +98,5 @@ if (!isCompatibleVersion()) { | ||
} | ||
if (isAngularCLI()) { | ||
printUseNxInsteadOfNgMessage(); | ||
} | ||
return updateNxJson(ops); | ||
@@ -69,0 +103,0 @@ } |
{ | ||
"name": "@nrwl/nx-cloud", | ||
"version": "9.2.0", | ||
"version": "9.2.1-beta.1", | ||
"description": "Nx Cloud plugin for Nx", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36879
557
1