@unisphere/nx 4.5.3 â 4.5.5
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/dist/migrations/1-22-7/update-git-ignore.d.ts.map +1 -1
- package/dist/migrations/1-22-7/update-git-ignore.js +0 -14
- package/dist/migrations/3-0-0/add-env-to-application-gitignore.d.ts.map +1 -1
- package/dist/migrations/3-0-0/add-env-to-application-gitignore.js +2 -3
- package/dist/migrations/3-0-0/pre-cleanup-empty-directories.d.ts +4 -3
- package/dist/migrations/3-0-0/pre-cleanup-empty-directories.d.ts.map +1 -1
- package/dist/migrations/3-0-0/pre-cleanup-empty-directories.js +8 -3
- package/dist/migrations/3-0-0/reorganize-applications-by-distribution-channel.d.ts.map +1 -1
- package/dist/migrations/3-0-0/reorganize-applications-by-distribution-channel.js +10 -1
- package/dist/migrations/3-15-0/add-experience-documentation.d.ts.map +1 -1
- package/dist/migrations/3-15-0/add-experience-documentation.js +8 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-git-ignore.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-7/update-git-ignore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAE1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"update-git-ignore.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-7/update-git-ignore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAE1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAwC9D"}
|
|
@@ -13,23 +13,9 @@ async function update(tree) {
|
|
|
13
13
|
const currentContent = tree.read(gitignorePath, 'utf-8') || '';
|
|
14
14
|
let updatedContent = currentContent;
|
|
15
15
|
let addedItems = 0;
|
|
16
|
-
// Check if migrations.json is already in .gitignore
|
|
17
|
-
const migrationsJsonRegex = /^migrations\.json\s*$/gm;
|
|
18
|
-
if (!migrationsJsonRegex.test(updatedContent)) {
|
|
19
|
-
// Add migrations.json entry
|
|
20
|
-
if (!updatedContent.includes('# Migration files')) {
|
|
21
|
-
updatedContent = updatedContent.trim() + '\n\n# Migration files\n';
|
|
22
|
-
}
|
|
23
|
-
if (!updatedContent.includes('migrations.json')) {
|
|
24
|
-
updatedContent += 'migrations.json\n';
|
|
25
|
-
addedItems++;
|
|
26
|
-
devkit_1.logger.info('đ Added migrations.json to .gitignore');
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
16
|
// Check if ai-migrations is already in .gitignore
|
|
30
17
|
const aiMigrationsRegex = /^ai-migrations\s*$/gm;
|
|
31
18
|
if (!aiMigrationsRegex.test(updatedContent)) {
|
|
32
|
-
// Add ai-migrations entry
|
|
33
19
|
if (!updatedContent.includes('# Migration files')) {
|
|
34
20
|
updatedContent = updatedContent.trim() + '\n\n# Migration files\n';
|
|
35
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-env-to-application-gitignore.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-0-0/add-env-to-application-gitignore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAE1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"add-env-to-application-gitignore.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-0-0/add-env-to-application-gitignore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAE1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CA4B9D"}
|
|
@@ -12,9 +12,8 @@ async function update(tree) {
|
|
|
12
12
|
try {
|
|
13
13
|
const currentContent = tree.read(gitignorePath, 'utf-8') || '';
|
|
14
14
|
let updatedContent = currentContent;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (!migrationsJsonRegex.test(updatedContent)) {
|
|
15
|
+
const envRegex = /^\.env$/gm;
|
|
16
|
+
if (!envRegex.test(updatedContent)) {
|
|
18
17
|
updatedContent += '.env\n';
|
|
19
18
|
tree.write(gitignorePath, updatedContent);
|
|
20
19
|
devkit_1.logger.info(`â
Successfully updated .gitignore (added .env entry)`);
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* Migration: Pre-cleanup Empty Directories
|
|
3
3
|
*
|
|
4
4
|
* This migration runs before the reorganize migrations to:
|
|
5
|
-
* 1.
|
|
6
|
-
* 2.
|
|
7
|
-
* 3.
|
|
5
|
+
* 1. Patch chalk for tslib >=2.8 compatibility (global, covers all subsequent migrations)
|
|
6
|
+
* 2. Check Nx version is 22 or higher
|
|
7
|
+
* 3. Reset Nx cache to ensure fresh project graph
|
|
8
|
+
* 4. Clean up any existing empty directories that might block the migration flow
|
|
8
9
|
*/
|
|
9
10
|
import { Tree } from '@nx/devkit';
|
|
10
11
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pre-cleanup-empty-directories.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-0-0/pre-cleanup-empty-directories.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pre-cleanup-empty-directories.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-0-0/pre-cleanup-empty-directories.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,EAAE,IAAI,EAAoB,MAAM,YAAY,CAAC;AAqFpD;;GAEG;AACH,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAqB9D"}
|
|
@@ -3,12 +3,17 @@
|
|
|
3
3
|
* Migration: Pre-cleanup Empty Directories
|
|
4
4
|
*
|
|
5
5
|
* This migration runs before the reorganize migrations to:
|
|
6
|
-
* 1.
|
|
7
|
-
* 2.
|
|
8
|
-
* 3.
|
|
6
|
+
* 1. Patch chalk for tslib >=2.8 compatibility (global, covers all subsequent migrations)
|
|
7
|
+
* 2. Check Nx version is 22 or higher
|
|
8
|
+
* 3. Reset Nx cache to ensure fresh project graph
|
|
9
|
+
* 4. Clean up any existing empty directories that might block the migration flow
|
|
9
10
|
*/
|
|
10
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
12
|
exports.default = update;
|
|
13
|
+
// Global workaround: tslib >=2.8 __importStar no longer sets __esModule on CJS modules,
|
|
14
|
+
// causing chalk (used by @nx/workspace, @nx/jest, etc.) to crash with "Cannot read
|
|
15
|
+
// properties of undefined". Patching here covers all migrations that run after this one.
|
|
16
|
+
require('chalk').__esModule = true;
|
|
12
17
|
const devkit_1 = require("@nx/devkit");
|
|
13
18
|
const child_process_1 = require("child_process");
|
|
14
19
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reorganize-applications-by-distribution-channel.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-0-0/reorganize-applications-by-distribution-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;EAQE;AAEF,OAAO,EACL,IAAI,EAQL,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"reorganize-applications-by-distribution-channel.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-0-0/reorganize-applications-by-distribution-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;EAQE;AAEF,OAAO,EACL,IAAI,EAQL,MAAM,YAAY,CAAC;AAkvBpB;;GAEG;AACH,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAqE9D"}
|
|
@@ -65,10 +65,19 @@ function discoverApplications(tree) {
|
|
|
65
65
|
const applicationsConfig = unisphereConfig.elements?.applications || {};
|
|
66
66
|
for (const [name, config] of Object.entries(applicationsConfig)) {
|
|
67
67
|
const normalizedName = (0, devkit_1.names)(name).fileName;
|
|
68
|
-
const distributionChannel = config.distributionChannel || 'none';
|
|
69
68
|
// Get sourceRoot from .unisphere config, or fall back to default path
|
|
70
69
|
const sourceRoot = config.sourceRoot;
|
|
71
70
|
const currentPath = sourceRoot || `unisphere/applications/${normalizedName}`;
|
|
71
|
+
// Infer distributionChannel: use explicit property if present, otherwise
|
|
72
|
+
// infer from current path (handles re-runs after upgrade-schema-to-2-0-0
|
|
73
|
+
// has already removed distributionChannel).
|
|
74
|
+
let distributionChannel = config.distributionChannel || 'none';
|
|
75
|
+
if (!config.distributionChannel && currentPath.includes('/applications/server/')) {
|
|
76
|
+
distributionChannel = 'unisphere';
|
|
77
|
+
}
|
|
78
|
+
else if (!config.distributionChannel && currentPath.includes('/applications/local/')) {
|
|
79
|
+
distributionChannel = 'none';
|
|
80
|
+
}
|
|
72
81
|
// Calculate target path
|
|
73
82
|
const subdirectory = getSubdirectory(distributionChannel);
|
|
74
83
|
const targetPath = `unisphere/applications/${subdirectory}/${normalizedName}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-experience-documentation.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-15-0/add-experience-documentation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"add-experience-documentation.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-15-0/add-experience-documentation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAoB,MAAM,YAAY,CAAC;AAGpD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAiB9D"}
|
|
@@ -12,6 +12,14 @@ const devkit_1 = require("@nx/devkit");
|
|
|
12
12
|
const add_documentation_1 = require("../../generators/add-documentation/add-documentation");
|
|
13
13
|
async function update(tree) {
|
|
14
14
|
devkit_1.logger.info('đ Creating experience-level documentation site...');
|
|
15
|
+
if (tree.exists('.unisphere')) {
|
|
16
|
+
const config = (0, devkit_1.readJson)(tree, '.unisphere');
|
|
17
|
+
const existingSites = config.elements?.documentation;
|
|
18
|
+
if (existingSites && Object.keys(existingSites).length > 0) {
|
|
19
|
+
devkit_1.logger.info('âšī¸ Documentation site already exists, skipping.');
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
15
23
|
await (0, add_documentation_1.addDocumentationGenerator)(tree, {
|
|
16
24
|
skipInstall: true,
|
|
17
25
|
});
|