@nx/devkit 20.4.0-canary.20250114-6181592 → 20.4.0-canary.20250115-0ae8665
Sign up to get free protection for your applications and to get access to all the features.
- 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;
|