@nx/devkit 22.7.0-beta.0 → 22.7.0-canary.20260320-2c4fb2a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/devkit",
|
|
3
|
-
"version": "22.7.0-
|
|
3
|
+
"version": "22.7.0-canary.20260320-2c4fb2a",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Devkit is used to customize Nx for different technologies and use cases. It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more. Learn more about [extending Nx by leveraging the Nx Devkit](https://nx.dev/extending-nx/intro/getting-started) on our docs.",
|
|
6
6
|
"repository": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"jest": "^30.0.2",
|
|
41
|
-
"nx": "22.7.0-
|
|
41
|
+
"nx": "22.7.0-canary.20260320-2c4fb2a"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"nx": ">= 21 <= 23 || ^22.0.0-0"
|
|
@@ -4,7 +4,8 @@ import { PackageManager, Tree } from 'nx/src/devkit-exports';
|
|
|
4
4
|
* `package.json` hasn't changed at all or it hasn't changed since the last invocation.
|
|
5
5
|
*
|
|
6
6
|
* @param tree - the file system tree
|
|
7
|
-
* @param
|
|
7
|
+
* @param ensureInstall - ensure install runs even if `package.json` hasn't changed,
|
|
8
|
+
* unless install already ran this generator cycle.
|
|
8
9
|
*/
|
|
9
|
-
export declare function installPackagesTask(tree: Tree,
|
|
10
|
+
export declare function installPackagesTask(tree: Tree, ensureInstall?: boolean, cwd?: string, packageManager?: PackageManager): void;
|
|
10
11
|
//# sourceMappingURL=install-packages-task.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-packages-task.d.ts","sourceRoot":"","sources":["../../../../../packages/devkit/src/tasks/install-packages-task.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,cAAc,EACd,IAAI,EACL,MAAM,uBAAuB,CAAC;AAE/B
|
|
1
|
+
{"version":3,"file":"install-packages-task.d.ts","sourceRoot":"","sources":["../../../../../packages/devkit/src/tasks/install-packages-task.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,cAAc,EACd,IAAI,EACL,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,EACV,aAAa,GAAE,OAAe,EAC9B,GAAG,GAAE,MAAW,EAChB,cAAc,GAAE,cAA2D,GAC1E,IAAI,CAmCN"}
|
|
@@ -9,25 +9,28 @@ const devkit_exports_1 = require("nx/src/devkit-exports");
|
|
|
9
9
|
* `package.json` hasn't changed at all or it hasn't changed since the last invocation.
|
|
10
10
|
*
|
|
11
11
|
* @param tree - the file system tree
|
|
12
|
-
* @param
|
|
12
|
+
* @param ensureInstall - ensure install runs even if `package.json` hasn't changed,
|
|
13
|
+
* unless install already ran this generator cycle.
|
|
13
14
|
*/
|
|
14
|
-
function installPackagesTask(tree,
|
|
15
|
-
|
|
15
|
+
function installPackagesTask(tree, ensureInstall = false, cwd = '', packageManager = (0, devkit_exports_1.detectPackageManager)((0, path_1.join)(tree.root, cwd))) {
|
|
16
|
+
const packageJsonPath = (0, devkit_exports_1.joinPathFragments)(cwd, 'package.json');
|
|
17
|
+
const packageJsonChanged = tree
|
|
16
18
|
.listChanges()
|
|
17
|
-
.
|
|
18
|
-
|
|
19
|
+
.some((f) => f.path === packageJsonPath);
|
|
20
|
+
if (!packageJsonChanged && !ensureInstall) {
|
|
19
21
|
return;
|
|
20
22
|
}
|
|
21
|
-
const packageJsonValue = tree.read(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const packageJsonValue = tree.read(packageJsonPath, 'utf-8');
|
|
24
|
+
const storedPackageJsonValue = global['__packageJsonInstallCache__'];
|
|
25
|
+
const installAlreadyRan = storedPackageJsonValue != null;
|
|
26
|
+
const packageJsonDiffers = storedPackageJsonValue != packageJsonValue;
|
|
27
|
+
if (packageJsonDiffers || (ensureInstall && !installAlreadyRan)) {
|
|
25
28
|
global['__packageJsonInstallCache__'] = packageJsonValue;
|
|
26
29
|
const pmc = (0, devkit_exports_1.getPackageManagerCommand)(packageManager);
|
|
27
30
|
const execSyncOptions = {
|
|
28
31
|
cwd: (0, path_1.join)(tree.root, cwd),
|
|
29
32
|
stdio: process.env.NX_GENERATE_QUIET === 'true' ? 'ignore' : 'inherit',
|
|
30
|
-
windowsHide:
|
|
33
|
+
windowsHide: true,
|
|
31
34
|
};
|
|
32
35
|
// ensure local registry from process is not interfering with the install
|
|
33
36
|
// when we start the process from temp folder the local registry would override the custom registry
|