@pure-ds/core 0.5.23 โ 0.5.24
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
CHANGED
|
@@ -547,6 +547,10 @@ async function runDevServer() {
|
|
|
547
547
|
async function ensurePdsAssets() {
|
|
548
548
|
const pdsAssetsDir = path.join(projectRoot, 'public', 'assets', 'pds');
|
|
549
549
|
const repoAssetsDir = path.join(projectRoot, 'assets', 'pds');
|
|
550
|
+
const repoAssetsRoot = path.join(projectRoot, 'assets');
|
|
551
|
+
const repoInstallJson = path.join(repoAssetsRoot, '.pds-install.json');
|
|
552
|
+
const publicAssetsRoot = path.join(projectRoot, 'public', 'assets');
|
|
553
|
+
const publicInstallJson = path.join(publicAssetsRoot, '.pds-install.json');
|
|
550
554
|
|
|
551
555
|
const normalizeAssetsLocation = async () => {
|
|
552
556
|
if (!existsSync(repoAssetsDir)) return;
|
|
@@ -563,7 +567,27 @@ async function ensurePdsAssets() {
|
|
|
563
567
|
return false;
|
|
564
568
|
};
|
|
565
569
|
|
|
570
|
+
const moveInstallJson = async () => {
|
|
571
|
+
if (!existsSync(repoInstallJson)) return;
|
|
572
|
+
await ensureDir(publicAssetsRoot);
|
|
573
|
+
await rename(repoInstallJson, publicInstallJson);
|
|
574
|
+
log('โ
Moved assets/.pds-install.json to public/assets/.pds-install.json');
|
|
575
|
+
};
|
|
576
|
+
|
|
577
|
+
const cleanupAssetsRoot = async () => {
|
|
578
|
+
if (!existsSync(repoAssetsRoot)) return;
|
|
579
|
+
const remaining = ['pds', '.pds-install.json']
|
|
580
|
+
.map((name) => path.join(repoAssetsRoot, name))
|
|
581
|
+
.filter((target) => existsSync(target));
|
|
582
|
+
if (remaining.length === 0) {
|
|
583
|
+
await rm(repoAssetsRoot, { recursive: true, force: true });
|
|
584
|
+
log('๐งน Removed root assets folder');
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
|
|
566
588
|
const movedAssets = await normalizeAssetsLocation();
|
|
589
|
+
await moveInstallJson();
|
|
590
|
+
await cleanupAssetsRoot();
|
|
567
591
|
if (movedAssets) {
|
|
568
592
|
return;
|
|
569
593
|
}
|
|
@@ -590,6 +614,8 @@ async function ensurePdsAssets() {
|
|
|
590
614
|
});
|
|
591
615
|
|
|
592
616
|
await normalizeAssetsLocation();
|
|
617
|
+
await moveInstallJson();
|
|
618
|
+
await cleanupAssetsRoot();
|
|
593
619
|
}
|
|
594
620
|
|
|
595
621
|
async function main() {
|