@storybook/vue-vite 7.0.0-alpha.35
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/README.md +48 -0
- package/dist/chunk-HKSD7XQF.mjs +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/dist/preset.d.ts +9 -0
- package/dist/preset.js +1 -0
- package/dist/preset.mjs +1 -0
- package/package.json +87 -0
- package/preset.js +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Storybook for Vue and Vite
|
|
2
|
+
|
|
3
|
+
Storybook for Vue is a UI development environment for your Vue components.
|
|
4
|
+
With it, you can visualize different states of your UI components and develop them interactively.
|
|
5
|
+
|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
Storybook runs outside of your app.
|
|
9
|
+
So you can develop UI components in isolation without worrying about app specific dependencies and requirements.
|
|
10
|
+
|
|
11
|
+
## Getting Started
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
cd my-vue-app
|
|
15
|
+
npx storybook init
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
For more information visit: [storybook.js.org](https://storybook.js.org)
|
|
19
|
+
|
|
20
|
+
## Starter Storybook-for-Vue Boilerplate project with [Vuetify](https://github.com/vuetifyjs/vuetify) Material Component Framework
|
|
21
|
+
|
|
22
|
+
<https://github.com/white-rabbit-japan/vue-vuetify-storybook>
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
Storybook also comes with a lot of [addons](https://storybook.js.org/addons) and a great API to customize as you wish.
|
|
27
|
+
You can also build a [static version](https://storybook.js.org/docs/vue/sharing/publish-storybook) of your Storybook and deploy it anywhere you want.
|
|
28
|
+
|
|
29
|
+
## Vue Notes
|
|
30
|
+
|
|
31
|
+
- When using global custom components or extensions (e.g., `Vue.use`). You will need to declare those in the `./storybook/preview.js`.
|
|
32
|
+
|
|
33
|
+
## Known Limitations
|
|
34
|
+
|
|
35
|
+
In Storybook story and decorator components, you can not access the Vue instance
|
|
36
|
+
in factory functions for default prop values:
|
|
37
|
+
|
|
38
|
+
```js
|
|
39
|
+
{
|
|
40
|
+
props: {
|
|
41
|
+
foo: {
|
|
42
|
+
default() {
|
|
43
|
+
return this.bar; // does not work!
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var d=(a=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(a,{get:(b,c)=>(typeof require!="undefined"?require:b)[c]}):a)(function(a){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+a+'" is not supported')});export{d as a};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { createChannel as createPostMessageChannel } from '@storybook/channel-postmessage';
|
|
2
|
+
export { createChannel as createWebSocketChannel } from '@storybook/channel-websocket';
|
|
3
|
+
export { addons } from '@storybook/addons';
|
|
4
|
+
export { PreviewWeb, composeConfigs } from '@storybook/preview-web';
|
|
5
|
+
export { ClientApi } from '@storybook/client-api';
|
|
6
|
+
export * from '@storybook/vue';
|
|
7
|
+
export { StorybookConfig } from '@storybook/builder-vite';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var s=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var d=(o,e)=>{for(var a in e)s(o,a,{get:e[a],enumerable:!0})},f=(o,e,a,m)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of b(e))!h.call(o,n)&&n!==a&&s(o,n,{get:()=>e[n],enumerable:!(m=l(e,n))||m.enumerable});return o},t=(o,e,a)=>(f(o,e,"default"),a&&f(a,e,"default"));var g=o=>f(s({},"__esModule",{value:!0}),o);var r={};d(r,{ClientApi:()=>c.ClientApi,PreviewWeb:()=>p.PreviewWeb,addons:()=>C.addons,composeConfigs:()=>p.composeConfigs,createPostMessageChannel:()=>i.createChannel,createWebSocketChannel:()=>x.createChannel});module.exports=g(r);var i=require("@storybook/channel-postmessage"),x=require("@storybook/channel-websocket"),C=require("@storybook/addons"),p=require("@storybook/preview-web"),c=require("@storybook/client-api");t(r,require("@storybook/vue"),module.exports);0&&(module.exports={ClientApi,PreviewWeb,addons,composeConfigs,createPostMessageChannel,createWebSocketChannel});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-HKSD7XQF.mjs";import{createChannel as t}from"@storybook/channel-postmessage";import{createChannel as n}from"@storybook/channel-websocket";import{addons as f}from"@storybook/addons";import{composeConfigs as m,PreviewWeb as i}from"@storybook/preview-web";import{ClientApi as C}from"@storybook/client-api";export*from"@storybook/vue";export{C as ClientApi,i as PreviewWeb,f as addons,m as composeConfigs,t as createPostMessageChannel,n as createWebSocketChannel};
|
package/dist/preset.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PresetProperty } from '@storybook/core-common';
|
|
2
|
+
import { StorybookConfig } from '@storybook/builder-vite';
|
|
3
|
+
|
|
4
|
+
declare const core: PresetProperty<'core', StorybookConfig>;
|
|
5
|
+
declare const addons: StorybookConfig['addons'];
|
|
6
|
+
declare const typescript: PresetProperty<'typescript', StorybookConfig>;
|
|
7
|
+
declare const viteFinal: StorybookConfig['viteFinal'];
|
|
8
|
+
|
|
9
|
+
export { addons, core, typescript, viteFinal };
|
package/dist/preset.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var f=Object.create;var s=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var S=(o,t)=>{for(var e in t)s(o,e,{get:t[e],enumerable:!0})},a=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of b(t))!k.call(o,r)&&r!==e&&s(o,r,{get:()=>t[r],enumerable:!(n=g(t,r))||n.enumerable});return o};var c=(o,t,e)=>(e=o!=null?f(v(o)):{},a(t||!o||!o.__esModule?s(e,"default",{value:o,enumerable:!0}):e,o)),P=o=>a(s({},"__esModule",{value:!0}),o);var h={};S(h,{addons:()=>C,core:()=>x,typescript:()=>_,viteFinal:()=>w});module.exports=P(h);var p=c(require("path"));var u=require("vue-docgen-api"),m=require("vite"),y=c(require("magic-string"));function l(){let t=(0,m.createFilter)(/\.(vue)$/);return{name:"storybook:vue2-docgen-plugin",async transform(e,n){if(!t(n))return;let r=await(0,u.parse)(n),d=JSON.stringify(r),i=new y.default(e);return i.append(`;__component__.exports.__docgenInfo = ${d}`),{code:i.toString(),map:i.generateMap({hires:!0,source:n})}}}}var x=async(o,t)=>{let e=await t.presets.apply("framework");return{...o,builder:{name:p.default.dirname(require.resolve(p.default.join("@storybook/builder-vite","package.json"))),options:typeof e=="string"?{}:(e==null?void 0:e.options.builder)||{}}}},C=["@storybook/vue"],_=async o=>({...o,skipBabel:!0}),w=async(o,{presets:t})=>{var r;let{plugins:e=[]}=o;return e.push(l()),{...o,plugins:e,resolve:{...o.resolve,alias:{...(r=o.resolve)==null?void 0:r.alias,vue:"vue/dist/vue.esm.js"}}}};0&&(module.exports={addons,core,typescript,viteFinal});
|
package/dist/preset.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s}from"./chunk-HKSD7XQF.mjs";import p from"path";import{parse as m}from"vue-docgen-api";import{createFilter as y}from"vite";import l from"magic-string";function i(){let r=y(/\.(vue)$/);return{name:"storybook:vue2-docgen-plugin",async transform(e,t){if(!r(t))return;let a=await m(t),c=JSON.stringify(a),n=new l(e);return n.append(`;__component__.exports.__docgenInfo = ${c}`),{code:n.toString(),map:n.generateMap({hires:!0,source:t})}}}}var S=async(o,r)=>{let e=await r.presets.apply("framework");return{...o,builder:{name:p.dirname(s.resolve(p.join("@storybook/builder-vite","package.json"))),options:typeof e=="string"?{}:e?.options.builder||{}}}},P=["@storybook/vue"],w=async o=>({...o,skipBabel:!0}),x=async(o,{presets:r})=>{let{plugins:e=[]}=o;return e.push(i()),{...o,plugins:e,resolve:{...o.resolve,alias:{...o.resolve?.alias,vue:"vue/dist/vue.esm.js"}}}};export{P as addons,S as core,w as typescript,x as viteFinal};
|
package/package.json
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@storybook/vue-vite",
|
|
3
|
+
"version": "7.0.0-alpha.35",
|
|
4
|
+
"description": "Storybook for Vue2 and Vite: Develop Vue2 Components in isolation with Hot Reloading.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"storybook"
|
|
7
|
+
],
|
|
8
|
+
"homepage": "https://github.com/storybookjs/storybook/tree/main/frameworks/vue-vite",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/storybookjs/storybook/issues"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/storybookjs/storybook.git",
|
|
15
|
+
"directory": "frameworks/vue-vite"
|
|
16
|
+
},
|
|
17
|
+
"funding": {
|
|
18
|
+
"type": "opencollective",
|
|
19
|
+
"url": "https://opencollective.com/storybook"
|
|
20
|
+
},
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"require": "./dist/index.js",
|
|
25
|
+
"import": "./dist/index.mjs",
|
|
26
|
+
"types": "./dist/index.d.ts"
|
|
27
|
+
},
|
|
28
|
+
"./preset": {
|
|
29
|
+
"require": "./dist/preset.js",
|
|
30
|
+
"import": "./dist/preset.mjs",
|
|
31
|
+
"types": "./dist/preset.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./package.json": {
|
|
34
|
+
"require": "./package.json",
|
|
35
|
+
"import": "./package.json",
|
|
36
|
+
"types": "./package.json"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"main": "dist/index.js",
|
|
40
|
+
"module": "dist/index.mjs",
|
|
41
|
+
"types": "dist/index.d.ts",
|
|
42
|
+
"files": [
|
|
43
|
+
"dist/**/*",
|
|
44
|
+
"README.md",
|
|
45
|
+
"*.js",
|
|
46
|
+
"*.d.ts"
|
|
47
|
+
],
|
|
48
|
+
"scripts": {
|
|
49
|
+
"check": "../../../scripts/node_modules/.bin/tsc --noEmit",
|
|
50
|
+
"prep": "../../../scripts/prepare/bundle.ts"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@storybook/addons": "7.0.0-alpha.35",
|
|
54
|
+
"@storybook/builder-vite": "7.0.0-alpha.35",
|
|
55
|
+
"@storybook/channel-postmessage": "7.0.0-alpha.35",
|
|
56
|
+
"@storybook/channel-websocket": "7.0.0-alpha.35",
|
|
57
|
+
"@storybook/client-api": "7.0.0-alpha.35",
|
|
58
|
+
"@storybook/core-common": "7.0.0-alpha.35",
|
|
59
|
+
"@storybook/core-server": "7.0.0-alpha.35",
|
|
60
|
+
"@storybook/preview-web": "7.0.0-alpha.35",
|
|
61
|
+
"@storybook/vue": "7.0.0-alpha.35",
|
|
62
|
+
"magic-string": "^0.26.1",
|
|
63
|
+
"vite": "^3.1.3",
|
|
64
|
+
"vue-docgen-api": "^4.40.0"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"typescript": "~4.6.3",
|
|
68
|
+
"vue": "^2.7.10"
|
|
69
|
+
},
|
|
70
|
+
"peerDependencies": {
|
|
71
|
+
"vue": "^2.7.0"
|
|
72
|
+
},
|
|
73
|
+
"engines": {
|
|
74
|
+
"node": ">=10.13.0"
|
|
75
|
+
},
|
|
76
|
+
"publishConfig": {
|
|
77
|
+
"access": "public"
|
|
78
|
+
},
|
|
79
|
+
"bundler": {
|
|
80
|
+
"entries": [
|
|
81
|
+
"./src/index.ts",
|
|
82
|
+
"./src/preset.ts"
|
|
83
|
+
],
|
|
84
|
+
"platform": "node"
|
|
85
|
+
},
|
|
86
|
+
"gitHead": "d8972df8c6c1c4716131a856751f5914acddaad1"
|
|
87
|
+
}
|
package/preset.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/preset');
|