@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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pure-ds/core",
3
3
  "shortname": "pds",
4
- "version": "0.4.31",
4
+ "version": "0.4.33",
5
5
  "description": "Pure Design System - Why develop a Design System when you can generate one?",
6
6
  "repository": {
7
7
  "type": "git",
@@ -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.js';
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);
@@ -31,7 +31,7 @@ import {
31
31
  isUrlLike,
32
32
  getPublicRootCandidate,
33
33
  ensurePdsPath,
34
- } from '../lib/asset-roots.js';
34
+ } from '../lib/asset-roots.mjs';
35
35
 
36
36
  const __filename = fileURLToPath(import.meta.url);
37
37
  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.js';
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' ||