@unisphere/nx 2.2.2 → 3.2.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.
- package/dist/generators/add-application/add-application.d.ts.map +1 -1
- package/dist/generators/add-application/add-application.js +76 -59
- package/dist/generators/add-application/schema.d.ts +3 -1
- package/dist/generators/add-application/schema.json +4 -8
- package/dist/generators/add-application/templates/default/.env-template +6 -0
- package/dist/generators/add-application/templates/default/.eslintrc.json +1 -1
- package/dist/generators/add-application/templates/default/jest.config.ts +3 -3
- package/dist/generators/add-application/templates/default/project.json.template +2 -2
- package/dist/generators/add-application/templates/default/readme.md.template +11 -0
- package/dist/generators/add-application/templates/default/src/app/app.tsx.template +77 -77
- package/dist/generators/add-application/templates/default/tsconfig.json +1 -1
- package/dist/generators/add-application/templates/default/webpack.config.js.template +6 -1
- package/dist/generators/add-package/README.md +2 -2
- package/dist/generators/add-package/add-package.d.ts.map +1 -1
- package/dist/generators/add-package/add-package.js +11 -23
- package/dist/generators/add-package/schema.d.ts +1 -1
- package/dist/generators/add-package/schema.json +27 -19
- package/dist/generators/add-package/templates/new-package/.eslintrc.json +1 -1
- package/dist/generators/add-package/templates/new-package/package.json.template +0 -1
- package/dist/generators/add-package/templates/new-package/project.json.template +4 -4
- package/dist/generators/add-package/templates/new-package/rollup.config.js +1 -1
- package/dist/generators/add-package/templates/new-package/tsconfig.json +1 -1
- package/dist/generators/add-package/templates/new-package/tsconfig.lib.json.template +1 -1
- package/dist/generators/add-package/templates/new-package/tsconfig.spec.json +1 -1
- package/dist/generators/add-runtime/add-runtime.d.ts.map +1 -1
- package/dist/generators/add-runtime/add-runtime.js +62 -9
- package/dist/generators/add-runtime/schema.d.ts +1 -0
- package/dist/generators/add-runtime/schema.json +1 -9
- package/dist/generators/add-runtime/templates/new-runtime/src/lib/create-factory.tsx.template +4 -4
- package/dist/generators/add-runtime/templates/new-runtime/src/lib/runtime.tsx.template +26 -2
- package/dist/generators/add-visual/add-visual.d.ts +1 -1
- package/dist/generators/add-visual/add-visual.d.ts.map +1 -1
- package/dist/generators/add-visual/add-visual.js +108 -15
- package/dist/generators/add-visual/schema.d.ts +3 -3
- package/dist/generators/add-visual/schema.json +2 -24
- package/dist/generators/dependency-config.d.ts.map +1 -1
- package/dist/generators/dependency-config.js +1 -0
- package/dist/generators/internal-dev-runner/generator.d.ts +3 -0
- package/dist/generators/internal-dev-runner/generator.d.ts.map +1 -0
- package/dist/generators/internal-dev-runner/generator.js +45 -0
- package/dist/generators/internal-dev-runner/schema.json +9 -0
- package/dist/generators/remove/remove.d.ts +19 -0
- package/dist/generators/remove/remove.d.ts.map +1 -0
- package/dist/generators/remove/remove.js +270 -0
- package/dist/generators/remove/schema.d.ts +4 -0
- package/dist/generators/remove/schema.json +38 -0
- package/dist/generators/rename-package/rename-package.d.ts +3 -0
- package/dist/generators/rename-package/rename-package.d.ts.map +1 -1
- package/dist/generators/rename-package/rename-package.js +139 -20
- package/dist/generators/utils.d.ts +30 -1
- package/dist/generators/utils.d.ts.map +1 -1
- package/dist/generators/utils.js +258 -7
- package/dist/migrations/1-22-0/patches/@changesets+cli+2.29.7.patch +36 -4
- package/dist/migrations/3-0-0/add-define-plugin-to-webpack.d.ts +3 -0
- package/dist/migrations/3-0-0/add-define-plugin-to-webpack.d.ts.map +1 -0
- package/dist/migrations/3-0-0/add-define-plugin-to-webpack.js +233 -0
- package/dist/migrations/3-0-0/add-env-to-application-gitignore.d.ts +3 -0
- package/dist/migrations/3-0-0/add-env-to-application-gitignore.d.ts.map +1 -0
- package/dist/migrations/3-0-0/add-env-to-application-gitignore.js +117 -0
- package/dist/migrations/3-0-0/fix-vite-config-cache-paths.d.ts +10 -0
- package/dist/migrations/3-0-0/fix-vite-config-cache-paths.d.ts.map +1 -0
- package/dist/migrations/3-0-0/fix-vite-config-cache-paths.js +66 -0
- package/dist/migrations/3-0-0/patches/@changesets+cli+2.29.7.patch +88 -0
- package/dist/migrations/3-0-0/post-cleanup-empty-directories.d.ts +12 -0
- package/dist/migrations/3-0-0/post-cleanup-empty-directories.d.ts.map +1 -0
- package/dist/migrations/3-0-0/post-cleanup-empty-directories.js +62 -0
- package/dist/migrations/3-0-0/pre-cleanup-empty-directories.d.ts +14 -0
- package/dist/migrations/3-0-0/pre-cleanup-empty-directories.d.ts.map +1 -0
- package/dist/migrations/3-0-0/pre-cleanup-empty-directories.js +105 -0
- package/dist/migrations/3-0-0/remove-kaltura-tools-to-pre-install.d.ts +3 -0
- package/dist/migrations/3-0-0/remove-kaltura-tools-to-pre-install.d.ts.map +1 -0
- package/dist/migrations/3-0-0/remove-kaltura-tools-to-pre-install.js +21 -0
- package/dist/migrations/3-0-0/remove-private-from-applications-and-runtimes.d.ts +9 -0
- package/dist/migrations/3-0-0/remove-private-from-applications-and-runtimes.d.ts.map +1 -0
- package/dist/migrations/3-0-0/remove-private-from-applications-and-runtimes.js +88 -0
- package/dist/migrations/3-0-0/remove-publish-config-from-packages.d.ts +9 -0
- package/dist/migrations/3-0-0/remove-publish-config-from-packages.d.ts.map +1 -0
- package/dist/migrations/3-0-0/remove-publish-config-from-packages.js +45 -0
- package/dist/migrations/3-0-0/reorganize-applications-by-distribution-channel.d.ts +15 -0
- package/dist/migrations/3-0-0/reorganize-applications-by-distribution-channel.d.ts.map +1 -0
- package/dist/migrations/3-0-0/reorganize-applications-by-distribution-channel.js +563 -0
- package/dist/migrations/3-0-0/reorganize-packages-by-distribution-channel.d.ts +23 -0
- package/dist/migrations/3-0-0/reorganize-packages-by-distribution-channel.d.ts.map +1 -0
- package/dist/migrations/3-0-0/reorganize-packages-by-distribution-channel.js +645 -0
- package/dist/migrations/3-0-0/replace-github-workflow.d.ts +3 -0
- package/dist/migrations/3-0-0/replace-github-workflow.d.ts.map +1 -0
- package/dist/migrations/3-0-0/replace-github-workflow.js +48 -0
- package/dist/migrations/3-0-0/sync-package-lock.d.ts +10 -0
- package/dist/migrations/3-0-0/sync-package-lock.d.ts.map +1 -0
- package/dist/migrations/3-0-0/sync-package-lock.js +26 -0
- package/dist/migrations/3-0-0/templates/_publish-artifacts.template +363 -0
- package/dist/migrations/3-0-0/templates/cicd.template +89 -0
- package/dist/migrations/3-0-0/update-changeset-patch.d.ts +3 -0
- package/dist/migrations/3-0-0/update-changeset-patch.d.ts.map +1 -0
- package/dist/migrations/3-0-0/update-changeset-patch.js +31 -0
- package/dist/migrations/3-0-0/upgrade-schema-to-2-0-0.d.ts +21 -0
- package/dist/migrations/3-0-0/upgrade-schema-to-2-0-0.d.ts.map +1 -0
- package/dist/migrations/3-0-0/upgrade-schema-to-2-0-0.js +105 -0
- package/dist/migrations/utils/has-react-dependency.d.ts +14 -0
- package/dist/migrations/utils/has-react-dependency.d.ts.map +1 -0
- package/dist/migrations/utils/has-react-dependency.js +72 -0
- package/dist/shared.d.ts +6 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +9 -0
- package/generators.json +12 -1
- package/migrations.json +117 -0
- package/package.json +3 -2
- package/dist/generators/add-application/templates/local-dev-playground/.babelrc +0 -11
- package/dist/generators/add-application/templates/local-dev-playground/.eslintrc.json +0 -22
- package/dist/generators/add-application/templates/local-dev-playground/jest.config.ts +0 -11
- package/dist/generators/add-application/templates/local-dev-playground/package.json +0 -6
- package/dist/generators/add-application/templates/local-dev-playground/project.json +0 -9
- package/dist/generators/add-application/templates/local-dev-playground/src/app/app.tsx.template +0 -212
- package/dist/generators/add-application/templates/local-dev-playground/src/app/components/header.tsx.template +0 -123
- package/dist/generators/add-application/templates/local-dev-playground/src/app/components/settings-buttons.tsx +0 -57
- package/dist/generators/add-application/templates/local-dev-playground/src/app/components/settings-form.tsx +0 -108
- package/dist/generators/add-application/templates/local-dev-playground/src/app/components/settings.tsx +0 -74
- package/dist/generators/add-application/templates/local-dev-playground/src/app/configuration-provider.tsx +0 -163
- package/dist/generators/add-application/templates/local-dev-playground/src/app/definitions.ts +0 -25
- package/dist/generators/add-application/templates/local-dev-playground/src/app/utils/merge-deep.ts +0 -31
- package/dist/generators/add-application/templates/local-dev-playground/src/favicon.ico +0 -0
- package/dist/generators/add-application/templates/local-dev-playground/src/index.html +0 -17
- package/dist/generators/add-application/templates/local-dev-playground/src/main.tsx +0 -13
- package/dist/generators/add-application/templates/local-dev-playground/src/styles.css +0 -0
- package/dist/generators/add-application/templates/local-dev-playground/tsconfig.app.json +0 -24
- package/dist/generators/add-application/templates/local-dev-playground/tsconfig.json +0 -20
- package/dist/generators/add-application/templates/local-dev-playground/tsconfig.spec.json +0 -25
- package/dist/generators/add-application/templates/local-dev-playground/webpack.config.js +0 -33
- /package/dist/generators/add-runtime/templates/{core-templates → types-templates}/__runtimeName__-runtime/index.ts.template +0 -0
- /package/dist/generators/add-runtime/templates/{core-templates → types-templates}/__runtimeName__-runtime/runtime-types.ts.template +0 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = update;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const dotenv_1 = require("dotenv");
|
|
7
|
+
const DEFINE_PLUGIN_IMPORT = "const { DefinePlugin } = require('webpack');";
|
|
8
|
+
/**
|
|
9
|
+
* Detect the type of an env value
|
|
10
|
+
*/
|
|
11
|
+
function detectType(value) {
|
|
12
|
+
if (value === 'true' || value === 'false') {
|
|
13
|
+
return 'boolean';
|
|
14
|
+
}
|
|
15
|
+
if (!isNaN(Number(value)) && value !== '') {
|
|
16
|
+
return 'number';
|
|
17
|
+
}
|
|
18
|
+
return 'string';
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Parse .env file content using dotenv and add type detection
|
|
22
|
+
*/
|
|
23
|
+
function parseEnvFile(content) {
|
|
24
|
+
const parsed = (0, dotenv_1.parse)(Buffer.from(content));
|
|
25
|
+
return Object.entries(parsed).map(([key, value]) => ({
|
|
26
|
+
key,
|
|
27
|
+
value: value || '',
|
|
28
|
+
type: detectType(value || ''),
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Generate DefinePlugin block with env variables
|
|
33
|
+
*/
|
|
34
|
+
function generateDefinePluginBlock(envVars) {
|
|
35
|
+
if (envVars.length === 0) {
|
|
36
|
+
return `new DefinePlugin({
|
|
37
|
+
// Add your environment variables here
|
|
38
|
+
// Example: 'process.env.API_URL': JSON.stringify(process.env.API_URL),
|
|
39
|
+
}),`;
|
|
40
|
+
}
|
|
41
|
+
const entries = envVars.map(({ key, type }) => {
|
|
42
|
+
if (type === 'boolean') {
|
|
43
|
+
return ` 'process.env.${key}': process.env.${key} === 'true',`;
|
|
44
|
+
}
|
|
45
|
+
else if (type === 'number') {
|
|
46
|
+
return ` 'process.env.${key}': Number(process.env.${key}),`;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
return ` 'process.env.${key}': JSON.stringify(process.env.${key}),`;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
return `new DefinePlugin({
|
|
53
|
+
${entries.join('\n')}
|
|
54
|
+
}),`;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Generate .env-template content from parsed env variables
|
|
58
|
+
*/
|
|
59
|
+
function generateEnvTemplate(envVars) {
|
|
60
|
+
const header = `# Environment variables template
|
|
61
|
+
# Copy this file to .env and fill in the values
|
|
62
|
+
# Do not commit .env to version control
|
|
63
|
+
|
|
64
|
+
`;
|
|
65
|
+
if (envVars.length === 0) {
|
|
66
|
+
return header + `# Example:
|
|
67
|
+
# API_URL=https://api.example.com
|
|
68
|
+
`;
|
|
69
|
+
}
|
|
70
|
+
const entries = envVars.map(({ key, value, type }) => {
|
|
71
|
+
const typeComment = type !== 'string' ? ` # ${type}` : '';
|
|
72
|
+
return `${key}=${value}${typeComment}`;
|
|
73
|
+
});
|
|
74
|
+
return header + entries.join('\n') + '\n';
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Merge env variables from two sources, preferring values from the first source
|
|
78
|
+
*/
|
|
79
|
+
function mergeEnvVars(primary, secondary) {
|
|
80
|
+
const merged = new Map();
|
|
81
|
+
// Add secondary first (will be overwritten by primary)
|
|
82
|
+
for (const envVar of secondary) {
|
|
83
|
+
merged.set(envVar.key, envVar);
|
|
84
|
+
}
|
|
85
|
+
// Add primary (overwrites secondary)
|
|
86
|
+
for (const envVar of primary) {
|
|
87
|
+
merged.set(envVar.key, envVar);
|
|
88
|
+
}
|
|
89
|
+
return Array.from(merged.values());
|
|
90
|
+
}
|
|
91
|
+
async function update(tree) {
|
|
92
|
+
devkit_1.logger.info('🔄 Adding DefinePlugin to application webpack configs');
|
|
93
|
+
try {
|
|
94
|
+
// Read .unisphere config
|
|
95
|
+
if (!tree.exists('.unisphere')) {
|
|
96
|
+
devkit_1.logger.warn('⚠️ No .unisphere file found, skipping');
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const unisphereConfig = (0, devkit_1.readJson)(tree, '.unisphere');
|
|
100
|
+
const applications = unisphereConfig.elements?.applications;
|
|
101
|
+
if (!applications || Object.keys(applications).length === 0) {
|
|
102
|
+
devkit_1.logger.info('ℹ️ No applications found, skipping');
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
let webpackUpdatedCount = 0;
|
|
106
|
+
let envTemplateCreatedCount = 0;
|
|
107
|
+
for (const [appName, appConfig] of Object.entries(applications)) {
|
|
108
|
+
const appPath = appConfig.sourceRoot;
|
|
109
|
+
const webpackPath = (0, path_1.join)(appPath, 'webpack.config.js');
|
|
110
|
+
const envPath = (0, path_1.join)(appPath, '.env');
|
|
111
|
+
const envTemplatePath = (0, path_1.join)(appPath, '.env-template');
|
|
112
|
+
// Skip if neither .env nor .env-template exists - don't touch anything
|
|
113
|
+
const hasEnv = tree.exists(envPath);
|
|
114
|
+
const hasEnvTemplate = tree.exists(envTemplatePath);
|
|
115
|
+
if (!hasEnv && !hasEnvTemplate) {
|
|
116
|
+
devkit_1.logger.info(`ℹ️ ${appName}: No .env or .env-template found, skipping`);
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
// Parse env files and merge (template values take priority)
|
|
120
|
+
let envVars = [];
|
|
121
|
+
let envVarsFromEnv = [];
|
|
122
|
+
let envVarsFromTemplate = [];
|
|
123
|
+
if (hasEnv) {
|
|
124
|
+
const envContent = tree.read(envPath, 'utf-8') || '';
|
|
125
|
+
envVarsFromEnv = parseEnvFile(envContent);
|
|
126
|
+
devkit_1.logger.info(`ℹ️ ${appName}: Found ${envVarsFromEnv.length} env variable(s) in .env`);
|
|
127
|
+
}
|
|
128
|
+
if (hasEnvTemplate) {
|
|
129
|
+
const templateContent = tree.read(envTemplatePath, 'utf-8') || '';
|
|
130
|
+
envVarsFromTemplate = parseEnvFile(templateContent);
|
|
131
|
+
devkit_1.logger.info(`ℹ️ ${appName}: Found ${envVarsFromTemplate.length} env variable(s) in .env-template`);
|
|
132
|
+
}
|
|
133
|
+
// Merge: .env-template values take priority over .env values
|
|
134
|
+
envVars = mergeEnvVars(envVarsFromTemplate, envVarsFromEnv);
|
|
135
|
+
devkit_1.logger.info(`ℹ️ ${appName}: Using ${envVars.length} merged env variable(s)`);
|
|
136
|
+
// Handle webpack.config.js
|
|
137
|
+
if (tree.exists(webpackPath)) {
|
|
138
|
+
let webpackContent = tree.read(webpackPath, 'utf-8') || '';
|
|
139
|
+
let updated = false;
|
|
140
|
+
// Check if DefinePlugin is already imported
|
|
141
|
+
if (!webpackContent.includes('DefinePlugin')) {
|
|
142
|
+
// Add DefinePlugin import after NxReactWebpackPlugin import
|
|
143
|
+
if (webpackContent.includes("require('@nx/react/webpack-plugin')")) {
|
|
144
|
+
webpackContent = webpackContent.replace("require('@nx/react/webpack-plugin');", `require('@nx/react/webpack-plugin');\n${DEFINE_PLUGIN_IMPORT}`);
|
|
145
|
+
}
|
|
146
|
+
else if (webpackContent.includes("require('@nx/webpack/app-plugin')")) {
|
|
147
|
+
// Fallback: add after NxAppWebpackPlugin import
|
|
148
|
+
webpackContent = webpackContent.replace("require('@nx/webpack/app-plugin');", `require('@nx/webpack/app-plugin');\n${DEFINE_PLUGIN_IMPORT}`);
|
|
149
|
+
}
|
|
150
|
+
// Add DefinePlugin to plugins array with env variables
|
|
151
|
+
const definePluginBlock = generateDefinePluginBlock(envVars);
|
|
152
|
+
if (webpackContent.includes('plugins: [')) {
|
|
153
|
+
webpackContent = webpackContent.replace('plugins: [', `plugins: [\n ${definePluginBlock}`);
|
|
154
|
+
}
|
|
155
|
+
updated = true;
|
|
156
|
+
devkit_1.logger.info(`✅ ${appName}: Added DefinePlugin to webpack.config.js with ${envVars.length} variable(s)`);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
// DefinePlugin exists - replace it entirely with variables from .env
|
|
160
|
+
// Find the DefinePlugin block - match opening and find balanced closing
|
|
161
|
+
const defineStartMatch = webpackContent.match(/new DefinePlugin\(\{/);
|
|
162
|
+
if (defineStartMatch && defineStartMatch.index !== undefined) {
|
|
163
|
+
const startIndex = defineStartMatch.index;
|
|
164
|
+
let braceCount = 0;
|
|
165
|
+
let endIndex = startIndex;
|
|
166
|
+
let foundStart = false;
|
|
167
|
+
// Find the balanced closing })
|
|
168
|
+
for (let i = startIndex; i < webpackContent.length; i++) {
|
|
169
|
+
const char = webpackContent[i];
|
|
170
|
+
if (char === '{') {
|
|
171
|
+
braceCount++;
|
|
172
|
+
foundStart = true;
|
|
173
|
+
}
|
|
174
|
+
else if (char === '}') {
|
|
175
|
+
braceCount--;
|
|
176
|
+
if (foundStart && braceCount === 0) {
|
|
177
|
+
// Found the closing }, now check for )
|
|
178
|
+
if (webpackContent[i + 1] === ')') {
|
|
179
|
+
endIndex = i + 2; // Include the )
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
const existingBlock = webpackContent.substring(startIndex, endIndex);
|
|
186
|
+
// Generate new DefinePlugin block from env vars
|
|
187
|
+
const newBlock = generateDefinePluginBlock(envVars);
|
|
188
|
+
// Remove trailing comma from generateDefinePluginBlock output
|
|
189
|
+
const newBlockWithoutComma = newBlock.replace(/,\s*$/, '');
|
|
190
|
+
webpackContent = webpackContent.replace(existingBlock, newBlockWithoutComma);
|
|
191
|
+
updated = true;
|
|
192
|
+
devkit_1.logger.info(`✅ ${appName}: Replaced DefinePlugin with ${envVars.length} variable(s) from .env`);
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
devkit_1.logger.warn(`⚠️ ${appName}: Could not find DefinePlugin block to update`);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
if (updated) {
|
|
199
|
+
tree.write(webpackPath, webpackContent);
|
|
200
|
+
webpackUpdatedCount++;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
devkit_1.logger.info(`ℹ️ ${appName}: No webpack.config.js found, skipping`);
|
|
205
|
+
}
|
|
206
|
+
// Create or update .env-template with merged variables
|
|
207
|
+
const templateKeys = new Set(envVarsFromTemplate.map((v) => v.key));
|
|
208
|
+
const hasNewVarsFromEnv = envVarsFromEnv.some((v) => !templateKeys.has(v.key));
|
|
209
|
+
if (!hasEnvTemplate) {
|
|
210
|
+
// Create new .env-template from .env variables
|
|
211
|
+
const envTemplateContent = generateEnvTemplate(envVars);
|
|
212
|
+
tree.write(envTemplatePath, envTemplateContent);
|
|
213
|
+
devkit_1.logger.info(`✅ ${appName}: Created .env-template`);
|
|
214
|
+
envTemplateCreatedCount++;
|
|
215
|
+
}
|
|
216
|
+
else if (hasEnv && hasNewVarsFromEnv) {
|
|
217
|
+
// Update .env-template with merged variables (new vars from .env)
|
|
218
|
+
const envTemplateContent = generateEnvTemplate(envVars);
|
|
219
|
+
tree.write(envTemplatePath, envTemplateContent);
|
|
220
|
+
devkit_1.logger.info(`✅ ${appName}: Updated .env-template with new variables from .env`);
|
|
221
|
+
envTemplateCreatedCount++;
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
devkit_1.logger.info(`✅ ${appName}: .env-template already up to date`);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
devkit_1.logger.info(`\n✅ Done: ${webpackUpdatedCount} webpack configs updated, ${envTemplateCreatedCount} .env-template files created`);
|
|
228
|
+
}
|
|
229
|
+
catch (error) {
|
|
230
|
+
devkit_1.logger.error(`❌ Failed to update webpack configs: ${error?.message || 'Unknown error'}`);
|
|
231
|
+
throw error;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
@@ -0,0 +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,EAAoB,MAAM,YAAY,CAAC;AAsDpD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAkF9D"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = update;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const ENV_GITIGNORE_ENTRIES = `.env`;
|
|
7
|
+
/**
|
|
8
|
+
* Add .env entries to .gitignore for a given element
|
|
9
|
+
* Returns: 'updated' | 'created' | 'skipped'
|
|
10
|
+
*/
|
|
11
|
+
function addEnvToGitignore(tree, elementName, elementPath) {
|
|
12
|
+
const gitignorePath = (0, path_1.join)(elementPath, '.gitignore');
|
|
13
|
+
if (tree.exists(gitignorePath)) {
|
|
14
|
+
// Read existing .gitignore
|
|
15
|
+
const existingContent = tree.read(gitignorePath, 'utf-8') || '';
|
|
16
|
+
// Check if .env is already in gitignore
|
|
17
|
+
if (existingContent.includes('.env')) {
|
|
18
|
+
devkit_1.logger.info(` ✅ ${elementName}: .gitignore already contains .env`);
|
|
19
|
+
return 'skipped';
|
|
20
|
+
}
|
|
21
|
+
// Append .env entries to existing .gitignore
|
|
22
|
+
const newContent = existingContent.trimEnd() + '\n\n# Environment files\n' + ENV_GITIGNORE_ENTRIES + '\n';
|
|
23
|
+
tree.write(gitignorePath, newContent);
|
|
24
|
+
devkit_1.logger.info(` ✅ ${elementName}: Added .env to existing .gitignore`);
|
|
25
|
+
return 'updated';
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
// Create new .gitignore with .env entries
|
|
29
|
+
const newContent = '# Environment files\n' + ENV_GITIGNORE_ENTRIES + '\n';
|
|
30
|
+
tree.write(gitignorePath, newContent);
|
|
31
|
+
devkit_1.logger.info(` ✅ ${elementName}: Created .gitignore with .env`);
|
|
32
|
+
return 'created';
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async function update(tree) {
|
|
36
|
+
devkit_1.logger.info('🔄 Adding .env to .gitignore files for all elements');
|
|
37
|
+
try {
|
|
38
|
+
// Read .unisphere config
|
|
39
|
+
if (!tree.exists('.unisphere')) {
|
|
40
|
+
devkit_1.logger.warn('⚠️ No .unisphere file found, skipping');
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const unisphereConfig = (0, devkit_1.readJson)(tree, '.unisphere');
|
|
44
|
+
const elements = unisphereConfig.elements;
|
|
45
|
+
if (!elements) {
|
|
46
|
+
devkit_1.logger.info('ℹ️ No elements found, skipping');
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
let totalUpdated = 0;
|
|
50
|
+
let totalCreated = 0;
|
|
51
|
+
// Process applications
|
|
52
|
+
const applications = elements.applications || {};
|
|
53
|
+
if (Object.keys(applications).length > 0) {
|
|
54
|
+
devkit_1.logger.info('\n📦 Processing applications...');
|
|
55
|
+
for (const [name, config] of Object.entries(applications)) {
|
|
56
|
+
const result = addEnvToGitignore(tree, name, config.sourceRoot);
|
|
57
|
+
if (result === 'updated')
|
|
58
|
+
totalUpdated++;
|
|
59
|
+
if (result === 'created')
|
|
60
|
+
totalCreated++;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// Process packages
|
|
64
|
+
const packages = elements.packages || {};
|
|
65
|
+
if (Object.keys(packages).length > 0) {
|
|
66
|
+
devkit_1.logger.info('\n📦 Processing packages...');
|
|
67
|
+
for (const [name, config] of Object.entries(packages)) {
|
|
68
|
+
const result = addEnvToGitignore(tree, name, config.sourceRoot);
|
|
69
|
+
if (result === 'updated')
|
|
70
|
+
totalUpdated++;
|
|
71
|
+
if (result === 'created')
|
|
72
|
+
totalCreated++;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// Process runtimes
|
|
76
|
+
const runtimes = elements.runtimes || {};
|
|
77
|
+
if (Object.keys(runtimes).length > 0) {
|
|
78
|
+
devkit_1.logger.info('\n📦 Processing runtimes...');
|
|
79
|
+
for (const [name, config] of Object.entries(runtimes)) {
|
|
80
|
+
const result = addEnvToGitignore(tree, name, config.sourceRoot);
|
|
81
|
+
if (result === 'updated')
|
|
82
|
+
totalUpdated++;
|
|
83
|
+
if (result === 'created')
|
|
84
|
+
totalCreated++;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
// Process workspace elements
|
|
88
|
+
const workspace = elements.workspace || {};
|
|
89
|
+
if (Object.keys(workspace).length > 0) {
|
|
90
|
+
devkit_1.logger.info('\n📦 Processing workspace elements...');
|
|
91
|
+
for (const [name, config] of Object.entries(workspace)) {
|
|
92
|
+
const result = addEnvToGitignore(tree, name, config.sourceRoot);
|
|
93
|
+
if (result === 'updated')
|
|
94
|
+
totalUpdated++;
|
|
95
|
+
if (result === 'created')
|
|
96
|
+
totalCreated++;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// Process loader elements
|
|
100
|
+
const loader = elements.loader || {};
|
|
101
|
+
if (Object.keys(loader).length > 0) {
|
|
102
|
+
devkit_1.logger.info('\n📦 Processing loader elements...');
|
|
103
|
+
for (const [name, config] of Object.entries(loader)) {
|
|
104
|
+
const result = addEnvToGitignore(tree, name, config.sourceRoot);
|
|
105
|
+
if (result === 'updated')
|
|
106
|
+
totalUpdated++;
|
|
107
|
+
if (result === 'created')
|
|
108
|
+
totalCreated++;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
devkit_1.logger.info(`\n✅ Done: ${totalUpdated} updated, ${totalCreated} created`);
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
devkit_1.logger.error(`❌ Failed to update .gitignore files: ${error?.message || 'Unknown error'}`);
|
|
115
|
+
throw error;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration: Fix vite.config.ts cache directory paths
|
|
3
|
+
*
|
|
4
|
+
* This migration ensures that vite.config.ts cache directory paths
|
|
5
|
+
* match the package name. This fixes any packages that were renamed
|
|
6
|
+
* before the rename-package generator was updated to handle vite configs.
|
|
7
|
+
*/
|
|
8
|
+
import { Tree } from '@nx/devkit';
|
|
9
|
+
export default function update(tree: Tree): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=fix-vite-config-cache-paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fix-vite-config-cache-paths.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-0-0/fix-vite-config-cache-paths.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAoB,MAAM,YAAY,CAAC;AAYpD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAgE9D"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Migration: Fix vite.config.ts cache directory paths
|
|
4
|
+
*
|
|
5
|
+
* This migration ensures that vite.config.ts cache directory paths
|
|
6
|
+
* match the package name. This fixes any packages that were renamed
|
|
7
|
+
* before the rename-package generator was updated to handle vite configs.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.default = update;
|
|
11
|
+
const devkit_1 = require("@nx/devkit");
|
|
12
|
+
async function update(tree) {
|
|
13
|
+
devkit_1.logger.info('');
|
|
14
|
+
devkit_1.logger.info('🔄 Fixing vite.config.ts cache directory paths...');
|
|
15
|
+
devkit_1.logger.info('');
|
|
16
|
+
if (!tree.exists('.unisphere')) {
|
|
17
|
+
devkit_1.logger.info('No .unisphere file found, skipping migration');
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const unisphereConfig = (0, devkit_1.readJson)(tree, '.unisphere');
|
|
21
|
+
const packagesConfig = unisphereConfig.elements?.packages || {};
|
|
22
|
+
let updatedCount = 0;
|
|
23
|
+
for (const [packageName, config] of Object.entries(packagesConfig)) {
|
|
24
|
+
const sourceRoot = config.sourceRoot;
|
|
25
|
+
if (!sourceRoot) {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
const viteConfigPath = `${sourceRoot}/vite.config.ts`;
|
|
29
|
+
if (!tree.exists(viteConfigPath)) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
let content = tree.read(viteConfigPath, 'utf-8');
|
|
33
|
+
if (!content) {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
// Check if vite config has cache paths that don't match the package name
|
|
37
|
+
const expectedPattern = `package-${packageName}`;
|
|
38
|
+
// Match any package-{name} pattern in cache paths
|
|
39
|
+
const cachePathRegex = /package-([a-z0-9-]+)/g;
|
|
40
|
+
const matches = content.match(cachePathRegex);
|
|
41
|
+
if (matches) {
|
|
42
|
+
let needsUpdate = false;
|
|
43
|
+
for (const match of matches) {
|
|
44
|
+
if (match !== expectedPattern) {
|
|
45
|
+
needsUpdate = true;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (needsUpdate) {
|
|
50
|
+
// Replace all package-{oldName} with package-{packageName}
|
|
51
|
+
content = content.replace(cachePathRegex, expectedPattern);
|
|
52
|
+
tree.write(viteConfigPath, content);
|
|
53
|
+
devkit_1.logger.info(`✅ Fixed vite.config.ts for package "${packageName}"`);
|
|
54
|
+
updatedCount++;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (updatedCount === 0) {
|
|
59
|
+
devkit_1.logger.info('All vite.config.ts files have correct cache paths');
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
devkit_1.logger.info('');
|
|
63
|
+
devkit_1.logger.info(`✅ Fixed ${updatedCount} vite.config.ts file(s)`);
|
|
64
|
+
}
|
|
65
|
+
devkit_1.logger.info('');
|
|
66
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
diff --git a/node_modules/@changesets/cli/dist/changesets-cli.cjs.js b/node_modules/@changesets/cli/dist/changesets-cli.cjs.js
|
|
2
|
+
index 53fc925..8ee486e 100644
|
|
3
|
+
--- a/node_modules/@changesets/cli/dist/changesets-cli.cjs.js
|
|
4
|
+
+++ b/node_modules/@changesets/cli/dist/changesets-cli.cjs.js
|
|
5
|
+
@@ -310,22 +310,23 @@ async function createChangeset(changedPackages, allPackages) {
|
|
6
|
+
const packagesToRelease = await getPackagesToRelease(changedPackages, allPackages);
|
|
7
|
+
let pkgJsonsByName = getPkgJsonsByName(allPackages);
|
|
8
|
+
let pkgsLeftToGetBumpTypeFor = new Set(packagesToRelease);
|
|
9
|
+
- let pkgsThatShouldBeMajorBumped = (await askCheckboxPlus(bold(`Which packages should have a ${red("major")} bump?`), [{
|
|
10
|
+
- name: "all packages",
|
|
11
|
+
- choices: packagesToRelease.map(pkgName => {
|
|
12
|
+
- return {
|
|
13
|
+
- name: pkgName,
|
|
14
|
+
- message: formatPkgNameAndVersion(pkgName, pkgJsonsByName.get(pkgName).version)
|
|
15
|
+
- };
|
|
16
|
+
- })
|
|
17
|
+
- }], x => {
|
|
18
|
+
- // this removes changed packages and unchanged packages from the list
|
|
19
|
+
- // of packages shown after selection
|
|
20
|
+
- if (Array.isArray(x)) {
|
|
21
|
+
- return x.filter(x => x !== "all packages").map(x => cyan(x)).join(", ");
|
|
22
|
+
- }
|
|
23
|
+
- return x;
|
|
24
|
+
- })).filter(x => x !== "all packages");
|
|
25
|
+
+ let nonRuntimePackages = packagesToRelease.filter(pkgName => !pkgName.includes('unisphere-runtime-'));
|
|
26
|
+
+ let pkgsThatShouldBeMajorBumped = nonRuntimePackages.length > 0 ? (await askCheckboxPlus(bold(`Which packages should have a ${red("major")} bump?`), [{
|
|
27
|
+
+ name: "all packages",
|
|
28
|
+
+ choices: nonRuntimePackages.map(pkgName => {
|
|
29
|
+
+ return {
|
|
30
|
+
+ name: pkgName,
|
|
31
|
+
+ message: formatPkgNameAndVersion(pkgName, pkgJsonsByName.get(pkgName).version)
|
|
32
|
+
+ };
|
|
33
|
+
+ })
|
|
34
|
+
+ }], x => {
|
|
35
|
+
+ // this removes changed packages and unchanged packages from the list
|
|
36
|
+
+ // of packages shown after selection
|
|
37
|
+
+ if (Array.isArray(x)) {
|
|
38
|
+
+ return x.filter(x => x !== "all packages").map(x => cyan(x)).join(", ");
|
|
39
|
+
+ }
|
|
40
|
+
+ return x;
|
|
41
|
+
+ })).filter(x => x !== "all packages") : [];
|
|
42
|
+
for (const pkgName of pkgsThatShouldBeMajorBumped) {
|
|
43
|
+
// for packages that are under v1, we want to make sure major releases are intended,
|
|
44
|
+
// as some repo-wide sweeping changes have mistakenly release first majors
|
|
45
|
+
diff --git a/node_modules/@changesets/cli/dist/changesets-cli.esm.js b/node_modules/@changesets/cli/dist/changesets-cli.esm.js
|
|
46
|
+
index 6c363c0..40aad33 100644
|
|
47
|
+
--- a/node_modules/@changesets/cli/dist/changesets-cli.esm.js
|
|
48
|
+
+++ b/node_modules/@changesets/cli/dist/changesets-cli.esm.js
|
|
49
|
+
@@ -272,22 +272,23 @@ async function createChangeset(changedPackages, allPackages) {
|
|
50
|
+
const packagesToRelease = await getPackagesToRelease(changedPackages, allPackages);
|
|
51
|
+
let pkgJsonsByName = getPkgJsonsByName(allPackages);
|
|
52
|
+
let pkgsLeftToGetBumpTypeFor = new Set(packagesToRelease);
|
|
53
|
+
- let pkgsThatShouldBeMajorBumped = (await askCheckboxPlus(bold(`Which packages should have a ${red("major")} bump?`), [{
|
|
54
|
+
- name: "all packages",
|
|
55
|
+
- choices: packagesToRelease.map(pkgName => {
|
|
56
|
+
- return {
|
|
57
|
+
- name: pkgName,
|
|
58
|
+
- message: formatPkgNameAndVersion(pkgName, pkgJsonsByName.get(pkgName).version)
|
|
59
|
+
- };
|
|
60
|
+
- })
|
|
61
|
+
- }], x => {
|
|
62
|
+
- // this removes changed packages and unchanged packages from the list
|
|
63
|
+
- // of packages shown after selection
|
|
64
|
+
- if (Array.isArray(x)) {
|
|
65
|
+
- return x.filter(x => x !== "all packages").map(x => cyan(x)).join(", ");
|
|
66
|
+
- }
|
|
67
|
+
- return x;
|
|
68
|
+
- })).filter(x => x !== "all packages");
|
|
69
|
+
+ let nonRuntimePackages = packagesToRelease.filter(pkgName => !pkgName.includes('unisphere-runtime-'));
|
|
70
|
+
+ let pkgsThatShouldBeMajorBumped = nonRuntimePackages.length > 0 ? (await askCheckboxPlus(bold(`Which packages should have a ${red("major")} bump?`), [{
|
|
71
|
+
+ name: "all packages",
|
|
72
|
+
+ choices: nonRuntimePackages.map(pkgName => {
|
|
73
|
+
+ return {
|
|
74
|
+
+ name: pkgName,
|
|
75
|
+
+ message: formatPkgNameAndVersion(pkgName, pkgJsonsByName.get(pkgName).version)
|
|
76
|
+
+ };
|
|
77
|
+
+ })
|
|
78
|
+
+ }], x => {
|
|
79
|
+
+ // this removes changed packages and unchanged packages from the list
|
|
80
|
+
+ // of packages shown after selection
|
|
81
|
+
+ if (Array.isArray(x)) {
|
|
82
|
+
+ return x.filter(x => x !== "all packages").map(x => cyan(x)).join(", ");
|
|
83
|
+
+ }
|
|
84
|
+
+ return x;
|
|
85
|
+
+ })).filter(x => x !== "all packages") : [];
|
|
86
|
+
for (const pkgName of pkgsThatShouldBeMajorBumped) {
|
|
87
|
+
// for packages that are under v1, we want to make sure major releases are intended,
|
|
88
|
+
// as some repo-wide sweeping changes have mistakenly release first majors
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration: Post-cleanup Empty Directories
|
|
3
|
+
*
|
|
4
|
+
* This migration runs after all reorganize migrations to clean up any
|
|
5
|
+
* empty directories left behind after moving packages/applications.
|
|
6
|
+
*/
|
|
7
|
+
import { Tree } from '@nx/devkit';
|
|
8
|
+
/**
|
|
9
|
+
* Main migration function
|
|
10
|
+
*/
|
|
11
|
+
export default function update(tree: Tree): Promise<() => void>;
|
|
12
|
+
//# sourceMappingURL=post-cleanup-empty-directories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-cleanup-empty-directories.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-0-0/post-cleanup-empty-directories.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AA8C1C;;GAEG;AACH,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,CAYpE"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Migration: Post-cleanup Empty Directories
|
|
4
|
+
*
|
|
5
|
+
* This migration runs after all reorganize migrations to clean up any
|
|
6
|
+
* empty directories left behind after moving packages/applications.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.default = update;
|
|
10
|
+
const devkit_1 = require("@nx/devkit");
|
|
11
|
+
const child_process_1 = require("child_process");
|
|
12
|
+
/**
|
|
13
|
+
* Clean up empty directories in unisphere folder
|
|
14
|
+
*/
|
|
15
|
+
function cleanupEmptyDirectories() {
|
|
16
|
+
const foldersToClean = [
|
|
17
|
+
'unisphere/packages',
|
|
18
|
+
'unisphere/applications',
|
|
19
|
+
'unisphere/runtimes',
|
|
20
|
+
];
|
|
21
|
+
let cleaned = false;
|
|
22
|
+
for (const folder of foldersToClean) {
|
|
23
|
+
try {
|
|
24
|
+
const result = (0, child_process_1.execSync)(`find ${folder} -type d -empty 2>/dev/null | head -20 || true`, { stdio: 'pipe', encoding: 'utf-8' });
|
|
25
|
+
if (result.trim()) {
|
|
26
|
+
devkit_1.logger.info(` Found empty directories in ${folder}:`);
|
|
27
|
+
result
|
|
28
|
+
.trim()
|
|
29
|
+
.split('\n')
|
|
30
|
+
.forEach((dir) => {
|
|
31
|
+
if (dir)
|
|
32
|
+
devkit_1.logger.info(` - ${dir}`);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
(0, child_process_1.execSync)(`find ${folder} -type d -empty -delete 2>/dev/null || true`, {
|
|
36
|
+
stdio: 'pipe',
|
|
37
|
+
});
|
|
38
|
+
cleaned = true;
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
// Ignore errors - folder might not exist
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (cleaned) {
|
|
45
|
+
devkit_1.logger.info(' Empty directories removed');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Main migration function
|
|
50
|
+
*/
|
|
51
|
+
async function update(tree) {
|
|
52
|
+
devkit_1.logger.info('');
|
|
53
|
+
devkit_1.logger.info('Post-cleanup: Removing empty directories after reorganization...');
|
|
54
|
+
devkit_1.logger.info('');
|
|
55
|
+
// Return callback to run after Tree changes are written
|
|
56
|
+
return () => {
|
|
57
|
+
cleanupEmptyDirectories();
|
|
58
|
+
devkit_1.logger.info('');
|
|
59
|
+
devkit_1.logger.info('Post-cleanup completed');
|
|
60
|
+
devkit_1.logger.info('');
|
|
61
|
+
};
|
|
62
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration: Pre-cleanup Empty Directories
|
|
3
|
+
*
|
|
4
|
+
* This migration runs before the reorganize migrations to:
|
|
5
|
+
* 1. Check Nx version is 22 or higher
|
|
6
|
+
* 2. Reset Nx cache to ensure fresh project graph
|
|
7
|
+
* 3. Clean up any existing empty directories that might block the migration flow
|
|
8
|
+
*/
|
|
9
|
+
import { Tree } from '@nx/devkit';
|
|
10
|
+
/**
|
|
11
|
+
* Main migration function
|
|
12
|
+
*/
|
|
13
|
+
export default function update(tree: Tree): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=pre-cleanup-empty-directories.d.ts.map
|
|
@@ -0,0 +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;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAoB,MAAM,YAAY,CAAC;AAqFpD;;GAEG;AACH,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAqB9D"}
|