@pure-ds/storybook 0.5.53 → 0.5.55

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.
@@ -17,6 +17,10 @@ import { toastFormData } from '../stories/utils/toast-utils.js';
17
17
  // Expose toastFormData globally for inline event handlers
18
18
  window.toastFormData = toastFormData;
19
19
 
20
+ console.log('[PDS Storybook] preview.js loaded');
21
+ console.log('[PDS Storybook] PDS import', PDS ? 'OK' : 'MISSING');
22
+ console.log('[PDS Storybook] location', window.location.href);
23
+
20
24
  // Get initial preset from storage or URL or default
21
25
  const getInitialPreset = () => {
22
26
  try {
@@ -61,6 +65,7 @@ const setLiveGenerator = (generator) => {
61
65
  };
62
66
 
63
67
  PDS.addEventListener('pds:ready', (event) => {
68
+ console.log('[PDS Storybook] pds:ready event', event?.detail || event);
64
69
  if (event?.detail?.generator) {
65
70
  setLiveGenerator(event.detail.generator);
66
71
  }
@@ -68,6 +73,7 @@ PDS.addEventListener('pds:ready', (event) => {
68
73
 
69
74
  // Wrap top-level await in IIFE for production build compatibility
70
75
  (async () => {
76
+ console.log('[PDS Storybook] init start');
71
77
  PDS.initializing = true;
72
78
 
73
79
  // NEVER apply global styles on init - only apply in story decorator
@@ -102,7 +108,14 @@ PDS.addEventListener('pds:ready', (event) => {
102
108
  // Always override mode to 'live' regardless of user config to prevent style injection failures
103
109
  pdsOptions.mode = 'live';
104
110
 
105
- const initResult = await PDS.start(pdsOptions);
111
+ let initResult;
112
+ try {
113
+ initResult = await PDS.start(pdsOptions);
114
+ console.log('[PDS Storybook] PDS.start resolved', initResult);
115
+ } catch (error) {
116
+ console.error('[PDS Storybook] PDS.start failed', error);
117
+ throw error;
118
+ }
106
119
  setLiveGenerator(initResult?.generator);
107
120
  PDS.initializing = false;
108
121
 
package/bin/index.js CHANGED
@@ -10,7 +10,21 @@ const __dirname = dirname(__filename);
10
10
  const packageRoot = join(__dirname, '..');
11
11
  const configDir = join(packageRoot, '.storybook');
12
12
 
13
- const args = process.argv.slice(2);
13
+ const rawArgs = process.argv.slice(2);
14
+ // Ensure our packaged Storybook config is used so preview.js runs
15
+ const stripConfigArgs = (argv) => {
16
+ const cleaned = [];
17
+ for (let i = 0; i < argv.length; i += 1) {
18
+ const arg = argv[i];
19
+ if (arg === '-c' || arg === '--config') {
20
+ i += 1; // skip the config path
21
+ continue;
22
+ }
23
+ cleaned.push(arg);
24
+ }
25
+ return cleaned;
26
+ };
27
+ const args = stripConfigArgs(rawArgs);
14
28
  const command = args[0] || 'dev';
15
29
 
16
30
  const storybookArgs = [
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-02-04T10:10:54.750Z",
2
+ "generatedAt": "2026-02-04T10:59:51.884Z",
3
3
  "sources": {
4
4
  "customElements": "custom-elements.json",
5
5
  "ontology": "src\\js\\pds-core\\pds-ontology.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pure-ds/storybook",
3
- "version": "0.5.53",
3
+ "version": "0.5.55",
4
4
  "description": "Storybook showcase for Pure Design System with live configuration",
5
5
  "type": "module",
6
6
  "private": false,
@@ -38,7 +38,7 @@
38
38
  "pds:build-icons": "pds-build-icons"
39
39
  },
40
40
  "peerDependencies": {
41
- "@pure-ds/core": "^0.5.52"
41
+ "@pure-ds/core": "^0.5.55"
42
42
  },
43
43
  "dependencies": {
44
44
  "@custom-elements-manifest/analyzer": "^0.11.0",