@nx/devkit 20.4.0-canary.20250111-bbbfd9f → 20.4.0-canary.20250115-0ae8665
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 +1 -1
- package/src/utils/add-plugin.js +3 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/devkit",
|
3
|
-
"version": "20.4.0-canary.
|
3
|
+
"version": "20.4.0-canary.20250115-0ae8665",
|
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": {
|
package/src/utils/add-plugin.js
CHANGED
@@ -138,6 +138,7 @@ function processProject(tree, projectRoot, projectConfiguration) {
|
|
138
138
|
return;
|
139
139
|
}
|
140
140
|
let hasChanges = false;
|
141
|
+
targetCommands.sort((a, b) => b.command.split(/\s/).length - a.command.split(/\s/).length);
|
141
142
|
for (const targetCommand of targetCommands) {
|
142
143
|
const { command, target, configuration } = targetCommand;
|
143
144
|
const targetCommandRegex = new RegExp(`(?<=^|&)((?: )*(?:[^&\\r\\n\\s]+ )*)(${command})((?: [^&\\r\\n\\s]+)*(?: )*)(?=$|&)`, 'g');
|
@@ -204,7 +205,8 @@ function processProject(tree, projectRoot, projectConfiguration) {
|
|
204
205
|
}
|
205
206
|
if (!hasArgsWithDifferentValues && !scriptHasExtraArgs) {
|
206
207
|
// they are the same, replace with the command removing the args
|
207
|
-
|
208
|
+
const script = packageJson.scripts[scriptName];
|
209
|
+
packageJson.scripts[scriptName] = script.replace(match, match.replace(commandRegex, configuration
|
208
210
|
? `$1nx ${target} --configuration=${configuration}$4`
|
209
211
|
: `$1nx ${target}$4`));
|
210
212
|
hasChanges = true;
|