@nx/devkit 18.1.0-canary.20240315-3b8cbae → 18.1.1
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": "18.1.
|
|
3
|
+
"version": "18.1.1",
|
|
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": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"tslib": "^2.3.0",
|
|
36
36
|
"semver": "^7.5.3",
|
|
37
37
|
"yargs-parser": "21.1.1",
|
|
38
|
-
"@nrwl/devkit": "18.1.
|
|
38
|
+
"@nrwl/devkit": "18.1.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"nx": ">= 16 <= 18"
|
|
@@ -24,6 +24,7 @@ async function replaceProjectConfigurationsWithPlugin(tree, rootMappings, plugin
|
|
|
24
24
|
const nodes = await createNodesFunction(configFile, pluginOptions, {
|
|
25
25
|
workspaceRoot: tree.root,
|
|
26
26
|
nxJsonConfiguration: readNxJson(tree),
|
|
27
|
+
configFiles,
|
|
27
28
|
});
|
|
28
29
|
const node = nodes.projects[Object.keys(nodes.projects)[0]];
|
|
29
30
|
for (const [targetName, targetConfig] of Object.entries(node.targets)) {
|
|
@@ -8,14 +8,14 @@ const { glob, readJson, readNxJson, workspaceRoot, writeJson } = (0, nx_1.requir
|
|
|
8
8
|
async function updatePackageScripts(tree, createNodesTuple) {
|
|
9
9
|
const nxJson = readNxJson(tree);
|
|
10
10
|
const [pattern, createNodes] = createNodesTuple;
|
|
11
|
-
const
|
|
12
|
-
for (const file of
|
|
11
|
+
const matchingFiles = glob(tree, [pattern]);
|
|
12
|
+
for (const file of matchingFiles) {
|
|
13
13
|
const projectRoot = getProjectRootFromConfigFile(file);
|
|
14
|
-
await processProject(tree, projectRoot, file, createNodes, nxJson);
|
|
14
|
+
await processProject(tree, projectRoot, file, createNodes, nxJson, matchingFiles);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
exports.updatePackageScripts = updatePackageScripts;
|
|
18
|
-
async function processProject(tree, projectRoot, projectConfigurationFile, createNodesFunction, nxJsonConfiguration) {
|
|
18
|
+
async function processProject(tree, projectRoot, projectConfigurationFile, createNodesFunction, nxJsonConfiguration, configFiles) {
|
|
19
19
|
const packageJsonPath = `${projectRoot}/package.json`;
|
|
20
20
|
if (!tree.exists(packageJsonPath)) {
|
|
21
21
|
return;
|
|
@@ -24,7 +24,11 @@ async function processProject(tree, projectRoot, projectConfigurationFile, creat
|
|
|
24
24
|
if (!packageJson.scripts || !Object.keys(packageJson.scripts).length) {
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
const result = await createNodesFunction(projectConfigurationFile, {}, {
|
|
27
|
+
const result = await createNodesFunction(projectConfigurationFile, {}, {
|
|
28
|
+
nxJsonConfiguration,
|
|
29
|
+
workspaceRoot,
|
|
30
|
+
configFiles,
|
|
31
|
+
});
|
|
28
32
|
const targetCommands = getInferredTargetCommands(result);
|
|
29
33
|
if (!targetCommands.length) {
|
|
30
34
|
return;
|