@pure-ds/core 0.4.31 → 0.4.33
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 +1 -1
- package/packages/pds-cli/bin/pds-build-icons.mjs +1 -1
- package/packages/pds-cli/bin/pds-static.mjs +1 -1
- package/packages/pds-cli/bin/pds.mjs +1 -1
- package/packages/pds-cli/bin/postinstall.mjs +17 -0
- /package/packages/pds-cli/lib/{asset-roots.js → asset-roots.mjs} +0 -0
- /package/packages/pds-cli/lib/{fs-writer.js → fs-writer.mjs} +0 -0
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import { readFile, writeFile, mkdir, access } from 'fs/promises';
|
|
13
13
|
import path from 'path';
|
|
14
14
|
import { fileURLToPath, pathToFileURL } from 'url';
|
|
15
|
-
import { resolvePublicAssetDirectory, ensurePdsPath } from '../lib/asset-roots.
|
|
15
|
+
import { resolvePublicAssetDirectory, ensurePdsPath } from '../lib/asset-roots.mjs';
|
|
16
16
|
|
|
17
17
|
const __filename = fileURLToPath(import.meta.url);
|
|
18
18
|
const __dirname = path.dirname(__filename);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { generateFromFile, generate, watch as watchConfig } from '../../../src/node-api/pds-api.js';
|
|
3
|
-
import { writeFilesAtomic } from '../lib/fs-writer.
|
|
3
|
+
import { writeFilesAtomic } from '../lib/fs-writer.mjs';
|
|
4
4
|
import fs from 'fs';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
|
|
@@ -385,6 +385,23 @@ async function copyPdsAssets() {
|
|
|
385
385
|
const consumerRoot = await findConsumerRoot();
|
|
386
386
|
console.log('🧪 Consumer root:', consumerRoot);
|
|
387
387
|
|
|
388
|
+
// Check if consumer package.json has "type": "module"
|
|
389
|
+
try {
|
|
390
|
+
const consumerPkgPath = path.join(consumerRoot, 'package.json');
|
|
391
|
+
const consumerPkg = JSON.parse(await readFile(consumerPkgPath, 'utf8'));
|
|
392
|
+
|
|
393
|
+
if (consumerPkg.type !== 'module') {
|
|
394
|
+
console.error('\n❌ ERROR: @pure-ds/core requires ES modules.\n');
|
|
395
|
+
console.error('Add this to your package.json:\n');
|
|
396
|
+
console.error(' "type": "module"\n');
|
|
397
|
+
console.error('Then run: npm install @pure-ds/core\n');
|
|
398
|
+
process.exit(1);
|
|
399
|
+
}
|
|
400
|
+
} catch (e) {
|
|
401
|
+
console.error('❌ Could not read consumer package.json:', e.message);
|
|
402
|
+
process.exit(1);
|
|
403
|
+
}
|
|
404
|
+
|
|
388
405
|
// Allow opting out explicitly (useful for local dev / linking)
|
|
389
406
|
if (
|
|
390
407
|
process.env.PDS_SKIP_POSTINSTALL === '1' ||
|
|
File without changes
|
|
File without changes
|