enablement-build-manifest 1.7.0 → 1.8.0
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/package.json +2 -2
- package/src/manifest.mjs +2 -2
- package/tests/manifest.test.mjs +30 -0
package/package.json
CHANGED
package/src/manifest.mjs
CHANGED
|
@@ -78,7 +78,7 @@ export const generateManifest = async (options) => {
|
|
|
78
78
|
versions[pkgJson.name] = pkgJson.version;
|
|
79
79
|
dependents[pkgJson.name] = []; // Initialize reverse dependency map
|
|
80
80
|
const folderName = path.basename(path.dirname(pkgPath));
|
|
81
|
-
const packageFolder = path.
|
|
81
|
+
const packageFolder = path.relative(process.cwd(), path.dirname(path.dirname(pkgPath)));
|
|
82
82
|
if (pkgJson['.cicd']) {
|
|
83
83
|
const cicdEntry = { ...pkgJson['.cicd'] };
|
|
84
84
|
delete cicdEntry.templates;
|
|
@@ -132,7 +132,7 @@ export const generateManifest = async (options) => {
|
|
|
132
132
|
if (!cicd[pkgName].folderName)
|
|
133
133
|
cicd[pkgName].folderName = path.basename(path.dirname(pkgPath));
|
|
134
134
|
if (!cicd[pkgName].packageFolder)
|
|
135
|
-
cicd[pkgName].packageFolder = path.
|
|
135
|
+
cicd[pkgName].packageFolder = path.relative(process.cwd(), path.dirname(path.dirname(pkgPath)));
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
138
|
|
package/tests/manifest.test.mjs
CHANGED
|
@@ -360,3 +360,33 @@ describe('generateManifest schema version and migration', () => {
|
|
|
360
360
|
}
|
|
361
361
|
});
|
|
362
362
|
});
|
|
363
|
+
|
|
364
|
+
describe('nested workspace package folders', () => {
|
|
365
|
+
it('preserves nested workspace segments in cicd packageFolder metadata', async () => {
|
|
366
|
+
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'manifest-tests-'));
|
|
367
|
+
const oldCwd = process.cwd();
|
|
368
|
+
|
|
369
|
+
try {
|
|
370
|
+
writeJson(path.join(tmpRoot, 'ux/packages/profile/package.json'), {
|
|
371
|
+
name: 'profile',
|
|
372
|
+
version: '1.0.0',
|
|
373
|
+
main: 'index.js',
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
fs.mkdirSync(path.join(tmpRoot, '.cicd/templates'), { recursive: true });
|
|
377
|
+
fs.writeFileSync(path.join(tmpRoot, '.cicd/templates/build.yml'), 'stages: []\n', 'utf-8');
|
|
378
|
+
fs.writeFileSync(path.join(tmpRoot, '.cicd/templates/_build_node_package.yml'), '# node build template\n', 'utf-8');
|
|
379
|
+
|
|
380
|
+
process.chdir(tmpRoot);
|
|
381
|
+
await generateManifest({ platform: 'ado', save: true });
|
|
382
|
+
|
|
383
|
+
const templatedJson = JSON.parse(
|
|
384
|
+
fs.readFileSync(path.join(tmpRoot, '.cicd/templates/templated.json'), 'utf-8'),
|
|
385
|
+
);
|
|
386
|
+
expect(templatedJson.cicd.profile.packageFolder).toBe('ux/packages');
|
|
387
|
+
} finally {
|
|
388
|
+
process.chdir(oldCwd);
|
|
389
|
+
fs.rmSync(tmpRoot, { recursive: true, force: true });
|
|
390
|
+
}
|
|
391
|
+
});
|
|
392
|
+
});
|