@pure-ds/core 0.5.7 → 0.5.9
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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { readFile, writeFile, mkdir, access } from 'fs/promises';
|
|
4
|
+
import { existsSync } from 'fs';
|
|
4
5
|
import path from 'path';
|
|
5
6
|
import { spawn } from 'child_process';
|
|
6
7
|
|
|
@@ -260,6 +261,30 @@ async function runDevServer() {
|
|
|
260
261
|
});
|
|
261
262
|
}
|
|
262
263
|
|
|
264
|
+
async function ensurePdsAssets() {
|
|
265
|
+
const pdsAssetsDir = path.join(projectRoot, 'public', 'assets', 'pds');
|
|
266
|
+
if (existsSync(pdsAssetsDir)) {
|
|
267
|
+
log('↪️ PDS assets already present');
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const npmCmd = getNpmCommand();
|
|
272
|
+
log('🎨 Building PDS static assets (pds:build)...');
|
|
273
|
+
|
|
274
|
+
await new Promise((resolve, reject) => {
|
|
275
|
+
const child = spawn(npmCmd, ['run', 'pds:build'], {
|
|
276
|
+
cwd: projectRoot,
|
|
277
|
+
stdio: 'inherit',
|
|
278
|
+
shell: true
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
child.on('exit', (code) => {
|
|
282
|
+
if (code === 0) resolve();
|
|
283
|
+
else reject(new Error(`npm run pds:build exited with code ${code}`));
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
|
|
263
288
|
async function main() {
|
|
264
289
|
log('\n⚡ PDS Bootstrap\n');
|
|
265
290
|
|
|
@@ -281,6 +306,8 @@ async function main() {
|
|
|
281
306
|
const esbuildDevContent = isModule ? buildEsbuildDevEsm() : buildEsbuildDevCjs();
|
|
282
307
|
await writeFileIfMissing(esbuildDevPath, esbuildDevContent);
|
|
283
308
|
|
|
309
|
+
await ensurePdsAssets();
|
|
310
|
+
|
|
284
311
|
log('\n✅ Bootstrap files ready.\n');
|
|
285
312
|
await runDevServer();
|
|
286
313
|
}
|