storybook-addon-sdc 0.6.1 → 0.6.3

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.
Files changed (2) hide show
  1. package/README.md +11 -3
  2. package/package.json +2 -1
package/README.md CHANGED
@@ -116,7 +116,14 @@ While using Drupal to render components offers tighter integration, there are st
116
116
 
117
117
  6. **Add components to the `components` directory** (or copy from this [repository](https://github.com/iberdinsky-skilld/sdc-addon/tree/main/components)).
118
118
 
119
- 7. **Start Storybook**:
119
+ 7. **Set [type: module](https://nodejs.org/api/packages.html#type) in package.json:**
120
+ ```json
121
+ {
122
+ "type": "module"
123
+ }
124
+ ```
125
+
126
+ 8. **Start Storybook**:
120
127
  ```bash
121
128
  npm run storybook
122
129
  ```
@@ -126,7 +133,8 @@ While using Drupal to render components offers tighter integration, there are st
126
133
  To configure the addon, update `.storybook/main.js` as shown below:
127
134
 
128
135
  ```js
129
- import { join } from 'node:path' // 1. Add path dependency.
136
+ import { join } from 'node:path' // 1. Add dependencies.
137
+ import { cwd } from 'node:process'
130
138
 
131
139
  const config = {
132
140
  stories: ['../components/**/*.component.yml'], // 2. Set components glob.
@@ -140,7 +148,7 @@ const config = {
140
148
  vitePluginTwigDrupalOptions: {
141
149
  // vite-plugin-twig-drupal options.
142
150
  namespaces: {
143
- umami: join(__dirname, '../components'), // Your namespace and path to components.
151
+ umami: join(cwd(), './components'), // Your namespace and path to components.
144
152
  },
145
153
  },
146
154
  jsonSchemaFakerOptions: {}, // json-schema-faker options.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storybook-addon-sdc",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "Drupal Single Directory Components as stories",
5
5
  "keywords": [
6
6
  "SDC",
@@ -33,6 +33,7 @@
33
33
  "release": "npm run build && auto shipit",
34
34
  "storybook": "storybook dev -p 6006",
35
35
  "build-storybook": "storybook build",
36
+ "serve": "npx http-server ./storybook-static",
36
37
  "format": "prettier --write ."
37
38
  },
38
39
  "dependencies": {