@unisphere/cli 3.0.0 → 3.0.1
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/bundler/package/rollup.js +24 -3
- package/package.json +1 -1
|
@@ -135,9 +135,30 @@ module.exports = (unisphereConfig) => {
|
|
|
135
135
|
const projectJsonPath = path.join(unisphereConfig.cwd, 'project.json');
|
|
136
136
|
const projectJson = JSON.parse(fs.readFileSync(projectJsonPath, 'utf8'));
|
|
137
137
|
const sourcePath = projectJson.sourceRoot.replace(/\/src$/, '').split('/');
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
|
|
139
|
+
// Expected: unisphere/packages/<subdirectory>/<package-name>
|
|
140
|
+
// Subdirectories: local, kaltura-corp, unisphere, kaltura-ai
|
|
141
|
+
const validSubdirectories = ['local', 'kaltura-corp', 'unisphere', 'kaltura-ai'];
|
|
142
|
+
const isValidPath =
|
|
143
|
+
sourcePath[0] === 'unisphere' &&
|
|
144
|
+
sourcePath[1] === 'packages' &&
|
|
145
|
+
sourcePath.length === 4 &&
|
|
146
|
+
validSubdirectories.includes(sourcePath[2]);
|
|
147
|
+
|
|
148
|
+
if (!isValidPath) {
|
|
149
|
+
const isOldPattern = sourcePath[0] === 'unisphere' && sourcePath[1] === 'packages' && sourcePath.length === 3;
|
|
150
|
+
|
|
151
|
+
if (!isOldPattern) {
|
|
152
|
+
throw new Error('sourcePath must follow pattern unisphere/packages/<subdirectory>/<package-name> (subdirectory: local, kaltura-corp, unisphere, kaltura-ai)');
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Old pattern: allow during project graph creation (migrations), error during actual builds
|
|
156
|
+
const isGraphCreation = global.NX_GRAPH_CREATION === true;
|
|
157
|
+
if (isGraphCreation) {
|
|
158
|
+
console.warn(`[unisphere] WARNING: Package "${sourcePath[2]}" uses deprecated path. Will fail during builds.`);
|
|
159
|
+
} else {
|
|
160
|
+
throw new Error(`Package "${sourcePath[2]}" must be moved to a subdirectory. Run: npx nx migrate @unisphere/nx@latest --run-migrations`);
|
|
161
|
+
}
|
|
141
162
|
}
|
|
142
163
|
|
|
143
164
|
return getWithNx({
|