storybook-framework-qwik 0.2.2 → 0.2.4

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.
@@ -1,4 +1,4 @@
1
- import type { StrictArgTypes } from "@storybook/types";
1
+ import type { ArgTypesEnhancer, StrictArgTypes } from "@storybook/types";
2
2
  declare function extractComponentDescription(): string;
3
3
  declare function extractArgTypes(): StrictArgTypes;
4
4
  export declare const parameters: {
@@ -10,5 +10,5 @@ export declare const parameters: {
10
10
  extractComponentDescription: typeof extractComponentDescription;
11
11
  };
12
12
  };
13
- export declare const argTypesEnhancers: (<TRenderer extends import("@storybook/types").Renderer>(context: import("@storybook/types").StoryContextForEnhancers<TRenderer, import("@storybook/types").Args>) => StrictArgTypes<import("@storybook/types").Args>)[];
13
+ export declare const argTypesEnhancers: ArgTypesEnhancer[];
14
14
  export {};
@@ -1,6 +1,6 @@
1
1
  import { enhanceArgTypes, convert } from "@storybook/docs-tools";
2
2
  function getComponentId() {
3
- return window.__STORYBOOK_PREVIEW__.currentRender.story?.componentId;
3
+ return window.__STORYBOOK_PREVIEW__?.currentRender?.story?.componentId;
4
4
  }
5
5
  function getComponentDoc() {
6
6
  const componentId = getComponentId();
package/dist/preset.js CHANGED
@@ -20,9 +20,19 @@ export const viteFinal = async (defaultConfig) => {
20
20
  config.plugins.push(qwikDocgen());
21
21
  // Qwik-city plugin may be used in apps, but it has mdx stuff that conflicts with Storybook mdx
22
22
  // we'll try to only remove the transform code (where the mdx stuff is), and keep everything else.
23
- config.plugins = config.plugins.map((plugin) => plugin.name === "vite-plugin-qwik-city"
24
- ? { ...plugin, transform: () => null }
25
- : plugin);
23
+ config.plugins = config.plugins.map((plugin) => {
24
+ // the plugin may be standalone (Qwik <1.2), or in an array (Qwik >=1.2)
25
+ if (Array.isArray(plugin)) {
26
+ return plugin.map((subPlugin) => {
27
+ return subPlugin.name === "vite-plugin-qwik-city"
28
+ ? { ...subPlugin, transform: () => null }
29
+ : subPlugin;
30
+ });
31
+ }
32
+ return plugin.name === "vite-plugin-qwik-city"
33
+ ? { ...plugin, transform: () => null }
34
+ : plugin;
35
+ });
26
36
  return config;
27
37
  };
28
38
  export const previewAnnotations = (entry = []) => [...entry, require.resolve("storybook-framework-qwik/preview.js")];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storybook-framework-qwik",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Storybook for Qwik: View Qwik components in isolation.",
5
5
  "keywords": [
6
6
  "storybook",
@@ -85,7 +85,6 @@
85
85
  "dependencies": {
86
86
  "@storybook/builder-vite": ">=7.0.0",
87
87
  "@storybook/docs-tools": ">=7.0.0",
88
- "@storybook/types": ">=7.0.0",
89
88
  "magic-string": "^0.30.0",
90
89
  "react-docgen-typescript": "^2.2.2"
91
90
  },
@@ -96,11 +95,12 @@
96
95
  "@builder.io/qwik-city": "^1.1.4"
97
96
  },
98
97
  "devDependencies": {
98
+ "@storybook/types": ">=7.0.0",
99
99
  "@suin/semantic-release-yarn": "1.1.0",
100
100
  "@types/node": "^18.16.16",
101
101
  "semantic-release": "^21.0.2",
102
- "typescript": "~5.0.4",
103
- "vite": "^4.3.9"
102
+ "typescript": "~5.2.2",
103
+ "vite": "^4.4.9"
104
104
  },
105
105
  "engines": {
106
106
  "node": "^14.18 || >=16"