@unisphere/nx 4.5.1 → 4.5.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"change-application-scope.d.ts","sourceRoot":"","sources":["../../../src/generators/change-application-scope/change-application-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAKL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,qCAAqC,EAAE,MAAM,UAAU,CAAC;AAqRjE,wBAAsB,+BAA+B,CACnD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,qCAAqC,iBA6E/C;AAED,eAAe,+BAA+B,CAAC"}
1
+ {"version":3,"file":"change-application-scope.d.ts","sourceRoot":"","sources":["../../../src/generators/change-application-scope/change-application-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAKL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,qCAAqC,EAAE,MAAM,UAAU,CAAC;AAqRjE,wBAAsB,+BAA+B,CACnD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,qCAAqC,iBA6E/C;AAED,eAAe,+BAA+B,CAAC"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.changeApplicationScopeGenerator = changeApplicationScopeGenerator;
4
4
  const devkit_1 = require("@nx/devkit");
5
+ require('chalk').__esModule = true;
5
6
  const generators_1 = require("@nx/workspace/generators");
6
7
  const utils_1 = require("../utils");
7
8
  function validateOptions(options) {
@@ -1 +1 @@
1
- {"version":3,"file":"change-package-scope.d.ts","sourceRoot":"","sources":["../../../src/generators/change-package-scope/change-package-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EACL,IAAI,EAIL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAwY7D,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,iCAAiC,iBAuI3C;AAED,eAAe,2BAA2B,CAAC"}
1
+ {"version":3,"file":"change-package-scope.d.ts","sourceRoot":"","sources":["../../../src/generators/change-package-scope/change-package-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EACL,IAAI,EAIL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAwY7D,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,iCAAiC,iBAuI3C;AAED,eAAe,2BAA2B,CAAC"}
@@ -20,6 +20,7 @@
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.changePackageScopeGenerator = changePackageScopeGenerator;
22
22
  const devkit_1 = require("@nx/devkit");
23
+ require('chalk').__esModule = true;
23
24
  const generators_1 = require("@nx/workspace/generators");
24
25
  const utils_1 = require("../utils");
25
26
  const utils_2 = require("./utils");
@@ -1 +1 @@
1
- {"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../src/generators/remove/remove.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,IAAI,EAKL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AA6RjD,wBAAsB,eAAe,CACnC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,qBAAqB,iBAwF/B;AAED,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../src/generators/remove/remove.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,IAAI,EAKL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AA6RjD,wBAAsB,eAAe,CACnC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,qBAAqB,iBAwF/B;AAED,eAAe,eAAe,CAAC"}
@@ -16,6 +16,7 @@
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.removeGenerator = removeGenerator;
18
18
  const devkit_1 = require("@nx/devkit");
19
+ require('chalk').__esModule = true;
19
20
  const generators_1 = require("@nx/workspace/generators");
20
21
  const utils_1 = require("../utils");
21
22
  const remove_utils_1 = require("./remove-utils");
@@ -1 +1 @@
1
- {"version":3,"file":"rename-application.d.ts","sourceRoot":"","sources":["../../../src/generators/rename-application/rename-application.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAKL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AAuW5D,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gCAAgC,iBA+E1C;AAED,eAAe,0BAA0B,CAAC"}
1
+ {"version":3,"file":"rename-application.d.ts","sourceRoot":"","sources":["../../../src/generators/rename-application/rename-application.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAKL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AAyX5D,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gCAAgC,iBA+E1C;AAED,eAAe,0BAA0B,CAAC"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.renameApplicationGenerator = renameApplicationGenerator;
4
4
  const devkit_1 = require("@nx/devkit");
5
+ require('chalk').__esModule = true;
5
6
  const generators_1 = require("@nx/workspace/generators");
6
7
  const utils_1 = require("../utils");
7
8
  function validateOptions(options) {
@@ -171,19 +172,37 @@ function updateProjectJson(tree, newPath, oldPath, oldNxProjectName, newNxProjec
171
172
  return;
172
173
  }
173
174
  let updated = false;
174
- if (content.includes(oldPath)) {
175
- content = content.replace(new RegExp(escapeRegExp(oldPath), 'g'), newPath);
176
- updated = true;
175
+ if (content.includes(oldPath) && oldPath !== newPath) {
176
+ const result = safeReplace(content, oldPath, newPath);
177
+ if (result !== content) {
178
+ content = result;
179
+ updated = true;
180
+ }
177
181
  }
178
- if (content.includes(oldNxProjectName)) {
179
- content = content.replace(new RegExp(escapeRegExp(oldNxProjectName), 'g'), newNxProjectName);
180
- updated = true;
182
+ if (content.includes(oldNxProjectName) && oldNxProjectName !== newNxProjectName) {
183
+ const result = safeReplace(content, oldNxProjectName, newNxProjectName);
184
+ if (result !== content) {
185
+ content = result;
186
+ updated = true;
187
+ }
181
188
  }
182
189
  if (updated) {
183
190
  tree.write(projectJsonPath, content);
184
191
  devkit_1.logger.info(`✅ Updated project.json paths and comments`);
185
192
  }
186
193
  }
194
+ function safeReplace(text, oldVal, newVal) {
195
+ if (oldVal === newVal)
196
+ return text;
197
+ if (!newVal.includes(oldVal)) {
198
+ return text.replace(new RegExp(escapeRegExp(oldVal), 'g'), newVal);
199
+ }
200
+ const placeholder = `\x00__SAFE_REPLACE_${Date.now()}__\x00`;
201
+ let result = text.replace(new RegExp(escapeRegExp(newVal), 'g'), placeholder);
202
+ result = result.replace(new RegExp(escapeRegExp(oldVal), 'g'), newVal);
203
+ result = result.replace(new RegExp(escapeRegExp(placeholder), 'g'), newVal);
204
+ return result;
205
+ }
187
206
  function updateReadme(tree, newPath, oldNormalizedName, newNormalizedName) {
188
207
  const readmePath = `${newPath}/README.md`;
189
208
  if (!tree.exists(readmePath)) {
@@ -1 +1 @@
1
- {"version":3,"file":"rename-package.d.ts","sourceRoot":"","sources":["../../../src/generators/rename-package/rename-package.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,IAAI,EAKL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAmexD,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,4BAA4B,iBA8GtC;AAED,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"rename-package.d.ts","sourceRoot":"","sources":["../../../src/generators/rename-package/rename-package.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,IAAI,EAKL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAmexD,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,4BAA4B,iBA8GtC;AAED,eAAe,sBAAsB,CAAC"}
@@ -18,6 +18,7 @@
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.renamePackageGenerator = renamePackageGenerator;
20
20
  const devkit_1 = require("@nx/devkit");
21
+ require('chalk').__esModule = true;
21
22
  const generators_1 = require("@nx/workspace/generators");
22
23
  const utils_1 = require("../utils");
23
24
  function validateOptions(options) {
@@ -1 +1 @@
1
- {"version":3,"file":"reorganize-packages-by-distribution-channel.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-0-0/reorganize-packages-by-distribution-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,IAAI,EAML,MAAM,YAAY,CAAC;AAguBpB;;GAEG;AACH,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAyH9D"}
1
+ {"version":3,"file":"reorganize-packages-by-distribution-channel.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-0-0/reorganize-packages-by-distribution-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,IAAI,EAML,MAAM,YAAY,CAAC;AAkuBpB;;GAEG;AACH,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAyH9D"}
@@ -19,6 +19,8 @@
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
20
  exports.default = update;
21
21
  const devkit_1 = require("@nx/devkit");
22
+ // Workaround: chalk + tslib >=2.8 incompatibility causes @nx/workspace barrel to crash
23
+ require('chalk').__esModule = true;
22
24
  const generators_1 = require("@nx/workspace/generators");
23
25
  const fs_1 = require("fs");
24
26
  const path_1 = require("path");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unisphere/nx",
3
- "version": "4.5.1",
3
+ "version": "4.5.3",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",