@storybook/vue3
Advanced tools
Comparing version 7.0.26 to 7.6.3
@@ -5,6 +5,6 @@ import * as _storybook_types from '@storybook/types'; | ||
import { App, FunctionalComponent, VNodeChild } from 'vue'; | ||
import { V as VueRenderer } from './render-c842c5d5.js'; | ||
export { s as setup } from './render-c842c5d5.js'; | ||
import { V as VueRenderer } from './types-ad933ac1.js'; | ||
import { Simplify, SetOptional, Constructor, RemoveIndexSignature } from 'type-fest'; | ||
import { ComponentProps, ComponentSlots } from 'vue-component-type-helpers'; | ||
export { s as setup } from './render-18d12fa7.js'; | ||
@@ -11,0 +11,0 @@ interface ClientApi extends Addon_ClientStoryApi<VueRenderer['storyResult']> { |
@@ -1,1 +0,1 @@ | ||
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};__export(src_exports,{configure:()=>configure,forceReRender:()=>forceReRender,raw:()=>raw,setup:()=>setup,storiesOf:()=>storiesOf});module.exports=__toCommonJS(src_exports);var import_global=require("@storybook/global"),{window:globalWindow}=import_global.global;globalWindow.STORYBOOK_ENV="vue3";var import_preview_api2=require("@storybook/preview-api");var import_vue=require("vue"),import_preview_api=require("@storybook/preview-api");function normalizeFunctionalComponent(options){return typeof options=="function"?{render:options,name:options.name}:options}function prepare(rawStory,innerStory){let story=rawStory;return story==null?null:innerStory?{...normalizeFunctionalComponent(story),components:{...story.components||{},story:innerStory}}:{render(){return(0,import_vue.h)(story)}}}function decorateStory(storyFn,decorators){return decorators.reduce((decorated,decorator)=>context=>{let story,decoratedStory=decorator(update=>{let sanitizedUpdate=(0,import_preview_api.sanitizeStoryContextUpdate)(update);return update&&(sanitizedUpdate.args=Object.assign(context.args,sanitizedUpdate.args)),story=decorated({...context,...sanitizedUpdate}),story},context);return story||(story=decorated(context)),decoratedStory===story?story:prepare(decoratedStory,(0,import_vue.h)(story))},context=>prepare(storyFn(context)))}var import_vue2=require("vue"),render=(props,context)=>{let{id,component:Component}=context;if(!Component)throw new Error(`Unable to render story ${id} as the component annotation is missing from the default export`);return()=>(0,import_vue2.h)(Component,props,getSlots(props,context))},setupFunction=_app=>{},setup=fn=>{setupFunction=fn},map=new Map,elementMap=new Map;function renderToCanvas({storyFn,forceRemount,showMain,showException,storyContext},canvasElement){var _a2;storyContext.args=(0,import_vue2.reactive)(storyContext.args);let element=storyFn();elementMap.set(canvasElement,element);let props=(_a2=element.render)==null?void 0:_a2.call(element).props,reactiveArgs=props?(0,import_vue2.reactive)(props):storyContext.args,existingApp=map.get(canvasElement);if(existingApp&&!forceRemount)return updateArgs(existingApp.reactiveArgs,reactiveArgs),()=>{teardown(existingApp.vueApp,canvasElement)};existingApp&&forceRemount&&teardown(existingApp.vueApp,canvasElement);let storybookApp=(0,import_vue2.createApp)({render(){let renderedElement=elementMap.get(canvasElement),current=renderedElement&&renderedElement.template?renderedElement:element;return map.set(canvasElement,{vueApp:storybookApp,reactiveArgs}),(0,import_vue2.h)(current)}});return storybookApp.config.errorHandler=e=>showException(e),setupFunction(storybookApp),storybookApp.mount(canvasElement),showMain(),()=>{teardown(storybookApp,canvasElement)}}function getSlots(props,context){let{argTypes}=context,slots=Object.entries(props).filter(([key,value])=>{var _a2,_b;return((_b=(_a2=argTypes[key])==null?void 0:_a2.table)==null?void 0:_b.category)==="slots"}).map(([key,value])=>[key,typeof value=="function"?value:()=>value]);return Object.fromEntries(slots)}function updateArgs(reactiveArgs,nextArgs){nextArgs&&(Object.keys(reactiveArgs).forEach(key=>{delete reactiveArgs[key]}),Object.assign(reactiveArgs,nextArgs))}function teardown(storybookApp,canvasElement){storybookApp==null||storybookApp.unmount(),map.has(canvasElement)&&map.delete(canvasElement)}var RENDERER="vue3",api=(0,import_preview_api2.start)(renderToCanvas,{decorateStory,render}),storiesOf=(kind,m)=>api.clientApi.storiesOf(kind,m).addParameters({renderer:RENDERER}),configure=(...args)=>api.configure(RENDERER,...args),{forceReRender}=api,{raw}=api.clientApi;var _a;typeof module<"u"&&((_a=module==null?void 0:module.hot)==null||_a.decline());0&&(module.exports={configure,forceReRender,raw,setup,storiesOf}); | ||
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};__export(src_exports,{configure:()=>configure,forceReRender:()=>forceReRender,raw:()=>raw,setup:()=>setup,storiesOf:()=>storiesOf});module.exports=__toCommonJS(src_exports);var import_global=require("@storybook/global"),{window:globalWindow}=import_global.global;globalWindow.STORYBOOK_ENV="vue3";globalWindow.PLUGINS_SETUP_FUNCTIONS||=new Set;var import_preview_api2=require("@storybook/preview-api");var import_vue=require("vue"),import_preview_api=require("@storybook/preview-api");function normalizeFunctionalComponent(options){return typeof options=="function"?{render:options,name:options.name}:options}function prepare(rawStory,innerStory){let story=rawStory;return story===null?null:typeof story=="function"?story:innerStory?{...normalizeFunctionalComponent(story),components:{...story.components||{},story:innerStory}}:{render(){return(0,import_vue.h)(story)}}}function decorateStory(storyFn,decorators){return decorators.reduce((decorated,decorator)=>context=>{let story,decoratedStory=decorator(update=>{let sanitizedUpdate=(0,import_preview_api.sanitizeStoryContextUpdate)(update);return update&&(sanitizedUpdate.args=Object.assign(context.args,sanitizedUpdate.args)),story=decorated({...context,...sanitizedUpdate}),story},context);return story||(story=decorated(context)),decoratedStory===story?story:prepare(decoratedStory,()=>(0,import_vue.h)(story))},context=>prepare(storyFn(context)))}var import_vue2=require("vue"),render=(props,context)=>{let{id,component:Component}=context;if(!Component)throw new Error(`Unable to render story ${id} as the component annotation is missing from the default export`);return()=>(0,import_vue2.h)(Component,props,getSlots(props,context))},setup=fn=>{globalThis.PLUGINS_SETUP_FUNCTIONS??=new Set,globalThis.PLUGINS_SETUP_FUNCTIONS.add(fn)},runSetupFunctions=async(app,storyContext)=>{globalThis&&globalThis.PLUGINS_SETUP_FUNCTIONS&&await Promise.all([...globalThis.PLUGINS_SETUP_FUNCTIONS].map(fn=>fn(app,storyContext)))},map=new Map;async function renderToCanvas({storyFn,forceRemount,showMain,showException,storyContext,id},canvasElement){let existingApp=map.get(canvasElement);if(existingApp&&!forceRemount){let element=storyFn(),args=getArgs(element,storyContext);return updateArgs(existingApp.reactiveArgs,args),()=>{teardown(existingApp.vueApp,canvasElement)}}existingApp&&forceRemount&&teardown(existingApp.vueApp,canvasElement);let vueApp=(0,import_vue2.createApp)({setup(){storyContext.args=(0,import_vue2.reactive)(storyContext.args);let rootElement=storyFn(),args=getArgs(rootElement,storyContext),appState={vueApp,reactiveArgs:(0,import_vue2.reactive)(args)};return map.set(canvasElement,appState),()=>(0,import_vue2.h)(rootElement)}});return vueApp.config.errorHandler=e=>showException(e),await runSetupFunctions(vueApp,storyContext),vueApp.mount(canvasElement),showMain(),()=>{teardown(vueApp,canvasElement)}}function getSlots(props,context){let{argTypes}=context,slots=Object.entries(props).filter(([key])=>{var _a2,_b;return((_b=(_a2=argTypes[key])==null?void 0:_a2.table)==null?void 0:_b.category)==="slots"}).map(([key,value])=>[key,typeof value=="function"?value:()=>value]);return Object.fromEntries(slots)}function getArgs(element,storyContext){return element.props&&(0,import_vue2.isVNode)(element)?element.props:storyContext.args}function updateArgs(reactiveArgs,nextArgs){if(Object.keys(nextArgs).length===0)return;let currentArgs=(0,import_vue2.isReactive)(reactiveArgs)?reactiveArgs:(0,import_vue2.reactive)(reactiveArgs);Object.keys(currentArgs).forEach(key=>{key in nextArgs||delete currentArgs[key]}),Object.assign(currentArgs,nextArgs)}function teardown(storybookApp,canvasElement){storybookApp==null||storybookApp.unmount(),map.has(canvasElement)&&map.delete(canvasElement)}var RENDERER="vue3",api=(0,import_preview_api2.start)(renderToCanvas,{decorateStory,render}),storiesOf=(kind,m)=>api.clientApi.storiesOf(kind,m).addParameters({renderer:RENDERER}),configure=(...args)=>api.configure(RENDERER,...args),{forceReRender}=api,{raw}=api.clientApi;var _a;try{(_a=module==null?void 0:module.hot)!=null&&_a.decline&&module.hot.decline()}catch{}0&&(module.exports={configure,forceReRender,raw,setup,storiesOf}); |
{ | ||
"name": "@storybook/vue3", | ||
"version": "7.0.26", | ||
"version": "7.6.3", | ||
"description": "Storybook Vue 3 renderer", | ||
@@ -29,7 +29,5 @@ "keywords": [ | ||
}, | ||
"./preview": { | ||
"types": "./dist/config.d.ts", | ||
"require": "./dist/config.js", | ||
"import": "./dist/config.mjs" | ||
}, | ||
"./preset": "./preset.js", | ||
"./dist/entry-preview.mjs": "./dist/entry-preview.mjs", | ||
"./dist/entry-preview-docs.mjs": "./dist/entry-preview-docs.mjs", | ||
"./package.json": "./package.json" | ||
@@ -42,19 +40,21 @@ }, | ||
"dist/**/*", | ||
"template/**/*", | ||
"template/cli/**/*", | ||
"README.md", | ||
"*.js", | ||
"*.d.ts" | ||
"*.d.ts", | ||
"!src/**/*" | ||
], | ||
"scripts": { | ||
"check": "vue-tsc --noEmit", | ||
"prep": "../../../scripts/prepare/bundle.ts" | ||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts" | ||
}, | ||
"dependencies": { | ||
"@storybook/core-client": "7.0.26", | ||
"@storybook/docs-tools": "7.0.26", | ||
"@storybook/core-client": "7.6.3", | ||
"@storybook/docs-tools": "7.6.3", | ||
"@storybook/global": "^5.0.0", | ||
"@storybook/preview-api": "7.0.26", | ||
"@storybook/types": "7.0.26", | ||
"@storybook/preview-api": "7.6.3", | ||
"@storybook/types": "7.6.3", | ||
"lodash": "^4.17.21", | ||
"ts-dedent": "^2.0.0", | ||
"type-fest": "2.19.0", | ||
"type-fest": "~2.19", | ||
"vue-component-type-helpers": "latest" | ||
@@ -65,8 +65,11 @@ }, | ||
"@types/prettier": "2.7.2", | ||
"@vue/compiler-core": "^3.3.4", | ||
"@vue/vue3-jest": "29", | ||
"babel-jest": "^29.7.0", | ||
"typescript": "~4.9.3", | ||
"vue": "^3.2.47", | ||
"vue-tsc": "^1.2.0" | ||
"vue-tsc": "latest" | ||
}, | ||
"peerDependencies": { | ||
"@vue/compiler-core": "^3.0.0", | ||
"vue": "^3.0.0" | ||
@@ -83,7 +86,9 @@ }, | ||
"./src/index.ts", | ||
"./src/config.ts" | ||
"./src/preset.ts", | ||
"./src/entry-preview.ts", | ||
"./src/entry-preview-docs.ts" | ||
], | ||
"platform": "browser" | ||
}, | ||
"gitHead": "9fb2573aa274f3f69d3358050e8df9c903e8245f" | ||
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" | ||
} |
import MyButton from './Button.vue'; | ||
// More on how to set up stories at: https://storybook.js.org/docs/vue/writing-stories/introduction | ||
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories | ||
export default { | ||
@@ -22,3 +22,3 @@ title: 'Example/Button', | ||
// More on writing stories with args: https://storybook.js.org/docs/vue/writing-stories/args | ||
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args | ||
export const Primary = { | ||
@@ -25,0 +25,0 @@ args: { |
@@ -6,3 +6,3 @@ import MyHeader from './Header.vue'; | ||
component: MyHeader, | ||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/vue/writing-docs/autodocs | ||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs | ||
tags: ['autodocs'], | ||
@@ -25,3 +25,3 @@ render: (args) => ({ | ||
parameters: { | ||
// More on how to position stories at: https://storybook.js.org/docs/vue/configure/story-layout | ||
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout | ||
layout: 'fullscreen', | ||
@@ -28,0 +28,0 @@ }, |
@@ -1,2 +0,2 @@ | ||
import { within, userEvent } from '@storybook/testing-library'; | ||
import { within, userEvent, expect } from '@storybook/test'; | ||
import MyPage from './Page.vue'; | ||
@@ -8,3 +8,3 @@ | ||
parameters: { | ||
// More on how to position stories at: https://storybook.js.org/docs/vue/configure/story-layout | ||
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout | ||
layout: 'fullscreen', | ||
@@ -16,3 +16,3 @@ }, | ||
// More on interaction testing: https://storybook.js.org/docs/vue/writing-tests/interaction-testing | ||
// More on interaction testing: https://storybook.js.org/docs/writing-tests/interaction-testing | ||
export const LoggedIn = { | ||
@@ -27,7 +27,10 @@ render: () => ({ | ||
const canvas = within(canvasElement); | ||
const loginButton = await canvas.getByRole('button', { | ||
name: /Log in/i, | ||
}); | ||
const loginButton = canvas.getByRole('button', { name: /Log in/i }); | ||
await expect(loginButton).toBeInTheDocument(); | ||
await userEvent.click(loginButton); | ||
await expect(loginButton).not.toBeInTheDocument(); | ||
const logoutButton = canvas.getByRole('button', { name: /Log out/i }); | ||
await expect(logoutButton).toBeInTheDocument(); | ||
}, | ||
}; |
@@ -5,7 +5,7 @@ import type { Meta, StoryObj } from '@storybook/vue3'; | ||
// More on how to set up stories at: https://storybook.js.org/docs/vue/writing-stories/introduction | ||
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories | ||
const meta: Meta<typeof Button> = { | ||
title: 'Example/Button', | ||
component: Button, | ||
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/vue/writing-docs/autodocs | ||
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/writing-docs/autodocs | ||
tags: ['autodocs'], | ||
@@ -24,3 +24,3 @@ argTypes: { | ||
*👇 Render functions are a framework specific feature to allow you control on how the component renders. | ||
* See https://storybook.js.org/docs/vue/api/csf | ||
* See https://storybook.js.org/docs/api/csf | ||
* to learn how to use render functions. | ||
@@ -27,0 +27,0 @@ */ |
@@ -7,3 +7,3 @@ import type { Meta, StoryObj } from '@storybook/vue3'; | ||
/* 👇 The title prop is optional. | ||
* See https://storybook.js.org/docs/vue/configure/overview#configure-story-loading | ||
* See https://storybook.js.org/docs/configure/#configure-story-loading | ||
* to learn how to generate automatic titles | ||
@@ -21,6 +21,6 @@ */ | ||
parameters: { | ||
// More on how to position stories at: https://storybook.js.org/docs/react/configure/story-layout | ||
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout | ||
layout: 'fullscreen', | ||
}, | ||
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/vue/writing-docs/autodocs | ||
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/writing-docs/autodocs | ||
tags: ['autodocs'], | ||
@@ -27,0 +27,0 @@ }; |
import type { Meta, StoryObj } from '@storybook/vue3'; | ||
import { within, userEvent } from '@storybook/testing-library'; | ||
import { within, userEvent, expect } from '@storybook/test'; | ||
import MyPage from './Page.vue'; | ||
@@ -13,6 +13,6 @@ | ||
parameters: { | ||
// More on how to position stories at: https://storybook.js.org/docs/vue/configure/story-layout | ||
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout | ||
layout: 'fullscreen', | ||
}, | ||
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/vue/writing-docs/autodocs | ||
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/writing-docs/autodocs | ||
tags: ['autodocs'], | ||
@@ -24,10 +24,13 @@ }; | ||
// More on interaction testing: https://storybook.js.org/docs/vue/writing-tests/interaction-testing | ||
// More on interaction testing: https://storybook.js.org/docs/writing-tests/interaction-testing | ||
export const LoggedIn: Story = { | ||
play: async ({ canvasElement }: any) => { | ||
const canvas = within(canvasElement); | ||
const loginButton = await canvas.getByRole('button', { | ||
name: /Log in/i, | ||
}); | ||
const loginButton = canvas.getByRole('button', { name: /Log in/i }); | ||
await expect(loginButton).toBeInTheDocument(); | ||
await userEvent.click(loginButton); | ||
await expect(loginButton).not.toBeInTheDocument(); | ||
const logoutButton = canvas.getByRole('button', { name: /Log out/i }); | ||
await expect(logoutButton).toBeInTheDocument(); | ||
}, | ||
@@ -34,0 +37,0 @@ }; |
@@ -5,7 +5,7 @@ import type { Meta, StoryObj } from '@storybook/vue3'; | ||
// More on how to set up stories at: https://storybook.js.org/docs/vue/writing-stories/introduction | ||
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories | ||
const meta = { | ||
title: 'Example/Button', | ||
component: Button, | ||
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/vue/writing-docs/autodocs | ||
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/writing-docs/autodocs | ||
tags: ['autodocs'], | ||
@@ -24,3 +24,3 @@ argTypes: { | ||
*👇 Render functions are a framework specific feature to allow you control on how the component renders. | ||
* See https://storybook.js.org/docs/vue/api/csf | ||
* See https://storybook.js.org/docs/api/csf | ||
* to learn how to use render functions. | ||
@@ -27,0 +27,0 @@ */ |
@@ -7,3 +7,3 @@ import type { Meta, StoryObj } from '@storybook/vue3'; | ||
/* 👇 The title prop is optional. | ||
* See https://storybook.js.org/docs/vue/configure/overview#configure-story-loading | ||
* See https://storybook.js.org/docs/configure/#configure-story-loading | ||
* to learn how to generate automatic titles | ||
@@ -21,6 +21,6 @@ */ | ||
parameters: { | ||
// More on how to position stories at: https://storybook.js.org/docs/react/configure/story-layout | ||
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout | ||
layout: 'fullscreen', | ||
}, | ||
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/vue/writing-docs/autodocs | ||
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/writing-docs/autodocs | ||
tags: ['autodocs'], | ||
@@ -27,0 +27,0 @@ } satisfies Meta<typeof MyHeader>; |
import type { Meta, StoryObj } from '@storybook/vue3'; | ||
import { within, userEvent } from '@storybook/testing-library'; | ||
import { within, userEvent, expect } from '@storybook/test'; | ||
import MyPage from './Page.vue'; | ||
@@ -13,6 +13,6 @@ | ||
parameters: { | ||
// More on how to position stories at: https://storybook.js.org/docs/vue/configure/story-layout | ||
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout | ||
layout: 'fullscreen', | ||
}, | ||
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/vue/writing-docs/autodocs | ||
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/writing-docs/autodocs | ||
tags: ['autodocs'], | ||
@@ -24,10 +24,13 @@ } satisfies Meta<typeof MyPage>; | ||
// More on interaction testing: https://storybook.js.org/docs/vue/writing-tests/interaction-testing | ||
// More on interaction testing: https://storybook.js.org/docs/writing-tests/interaction-testing | ||
export const LoggedIn: Story = { | ||
play: async ({ canvasElement }: any) => { | ||
const canvas = within(canvasElement); | ||
const loginButton = await canvas.getByRole('button', { | ||
name: /Log in/i, | ||
}); | ||
const loginButton = canvas.getByRole('button', { name: /Log in/i }); | ||
await expect(loginButton).toBeInTheDocument(); | ||
await userEvent.click(loginButton); | ||
await expect(loginButton).not.toBeInTheDocument(); | ||
const logoutButton = canvas.getByRole('button', { name: /Log out/i }); | ||
await expect(logoutButton).toBeInTheDocument(); | ||
}, | ||
@@ -34,0 +37,0 @@ }; |
@@ -5,7 +5,16 @@ import { global as globalThis } from '@storybook/global'; | ||
// TODO: I'd like to be able to export rather than imperatively calling an imported function | ||
// export const setup = (app) => { | ||
// app.component('GlobalButton', Button); | ||
// }; | ||
const somePlugin = { | ||
install: (app, options) => { | ||
// inject a globally available $greetingText() method | ||
// eslint-disable-next-line no-param-reassign | ||
app.config.globalProperties.$greetingMessage = (key) => { | ||
// retrieve a nested property in `options` | ||
// using `key` | ||
return options.greetings[key]; | ||
}; | ||
}, | ||
}; | ||
const someColor = 'someColor'; | ||
// add components to global scope | ||
setup((app) => { | ||
@@ -15,1 +24,17 @@ // This adds a component that can be used globally in stories | ||
}); | ||
// this adds a plugin to vue app that can be used globally in stories | ||
setup((app, context) => { | ||
app.use(somePlugin, { | ||
greetings: { | ||
hello: `Hello Story! from some plugin your name is ${context?.name}!`, | ||
welcome: `Welcome Story! from some plugin your name is ${context?.name}!`, | ||
hi: `Hi Story! from some plugin your name is ${context?.name}!`, | ||
}, | ||
}); | ||
}); | ||
// additonal setup to provide some propriety to the app | ||
setup((app, context) => { | ||
app.provide(someColor, 'green'); | ||
}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
0
71735
11
8
39
812
4
+ Addedlodash@^4.17.21
+ Added@esbuild/android-arm@0.18.20(transitive)
+ Added@esbuild/android-arm64@0.18.20(transitive)
+ Added@esbuild/android-x64@0.18.20(transitive)
+ Added@esbuild/darwin-arm64@0.18.20(transitive)
+ Added@esbuild/darwin-x64@0.18.20(transitive)
+ Added@esbuild/freebsd-arm64@0.18.20(transitive)
+ Added@esbuild/freebsd-x64@0.18.20(transitive)
+ Added@esbuild/linux-arm@0.18.20(transitive)
+ Added@esbuild/linux-arm64@0.18.20(transitive)
+ Added@esbuild/linux-ia32@0.18.20(transitive)
+ Added@esbuild/linux-loong64@0.18.20(transitive)
+ Added@esbuild/linux-mips64el@0.18.20(transitive)
+ Added@esbuild/linux-ppc64@0.18.20(transitive)
+ Added@esbuild/linux-riscv64@0.18.20(transitive)
+ Added@esbuild/linux-s390x@0.18.20(transitive)
+ Added@esbuild/linux-x64@0.18.20(transitive)
+ Added@esbuild/netbsd-x64@0.18.20(transitive)
+ Added@esbuild/openbsd-x64@0.18.20(transitive)
+ Added@esbuild/sunos-x64@0.18.20(transitive)
+ Added@esbuild/win32-arm64@0.18.20(transitive)
+ Added@esbuild/win32-ia32@0.18.20(transitive)
+ Added@esbuild/win32-x64@0.18.20(transitive)
+ Added@isaacs/cliui@8.0.2(transitive)
+ Added@pkgjs/parseargs@0.11.0(transitive)
+ Added@storybook/channels@7.6.3(transitive)
+ Added@storybook/client-logger@7.6.3(transitive)
+ Added@storybook/core-client@7.6.3(transitive)
+ Added@storybook/core-common@7.6.3(transitive)
+ Added@storybook/core-events@7.6.3(transitive)
+ Added@storybook/docs-tools@7.6.3(transitive)
+ Added@storybook/node-logger@7.6.3(transitive)
+ Added@storybook/preview-api@7.6.3(transitive)
+ Added@storybook/types@7.6.3(transitive)
+ Added@types/find-cache-dir@3.2.1(transitive)
+ Added@types/node@18.19.55(transitive)
+ Addedansi-regex@6.1.0(transitive)
+ Addedansi-styles@6.2.1(transitive)
+ Addedassert@2.1.0(transitive)
+ Addedavailable-typed-arrays@1.0.7(transitive)
+ Addedcommondir@1.0.1(transitive)
+ Addedcross-spawn@7.0.3(transitive)
+ Addeddefine-properties@1.2.1(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addedemoji-regex@9.2.2(transitive)
+ Addedesbuild@0.18.20(transitive)
+ Addedfind-cache-dir@3.3.2(transitive)
+ Addedfind-up@4.1.0(transitive)
+ Addedfor-each@0.3.3(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedglob@10.4.5(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedis-arguments@1.1.1(transitive)
+ Addedis-callable@1.2.7(transitive)
+ Addedis-generator-function@1.0.10(transitive)
+ Addedis-nan@1.3.2(transitive)
+ Addedis-typed-array@1.1.13(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjackspeak@3.4.3(transitive)
+ Addedlocate-path@5.0.0(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addedmake-dir@3.1.0(transitive)
+ Addedminimatch@9.0.5(transitive)
+ Addedminipass@7.1.2(transitive)
+ Addedobject-is@1.1.6(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedobject.assign@4.1.5(transitive)
+ Addedp-limit@2.3.0(transitive)
+ Addedp-locate@4.1.0(transitive)
+ Addedp-try@2.2.0(transitive)
+ Addedpackage-json-from-dist@1.0.1(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpath-scurry@1.11.1(transitive)
+ Addedpkg-dir@4.2.0(transitive)
+ Addedpossible-typed-array-names@1.0.0(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@4.1.0(transitive)
+ Addedstring-width@5.1.2(transitive)
+ Addedstrip-ansi@7.1.0(transitive)
+ Addedtiny-invariant@1.3.3(transitive)
+ Addedundici-types@5.26.5(transitive)
+ Addedutil@0.12.5(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwhich-typed-array@1.1.15(transitive)
+ Addedwrap-ansi@7.0.08.1.0(transitive)
- Removed@ampproject/remapping@2.3.0(transitive)
- Removed@babel/code-frame@7.25.7(transitive)
- Removed@babel/compat-data@7.25.8(transitive)
- Removed@babel/core@7.25.8(transitive)
- Removed@babel/generator@7.25.7(transitive)
- Removed@babel/helper-compilation-targets@7.25.7(transitive)
- Removed@babel/helper-module-imports@7.25.7(transitive)
- Removed@babel/helper-module-transforms@7.25.7(transitive)
- Removed@babel/helper-simple-access@7.25.7(transitive)
- Removed@babel/helper-validator-option@7.25.7(transitive)
- Removed@babel/helpers@7.25.7(transitive)
- Removed@babel/highlight@7.25.7(transitive)
- Removed@babel/template@7.25.7(transitive)
- Removed@babel/traverse@7.25.7(transitive)
- Removed@esbuild/android-arm@0.17.19(transitive)
- Removed@esbuild/android-arm64@0.17.19(transitive)
- Removed@esbuild/android-x64@0.17.19(transitive)
- Removed@esbuild/darwin-arm64@0.17.19(transitive)
- Removed@esbuild/darwin-x64@0.17.19(transitive)
- Removed@esbuild/freebsd-arm64@0.17.19(transitive)
- Removed@esbuild/freebsd-x64@0.17.19(transitive)
- Removed@esbuild/linux-arm@0.17.19(transitive)
- Removed@esbuild/linux-arm64@0.17.19(transitive)
- Removed@esbuild/linux-ia32@0.17.19(transitive)
- Removed@esbuild/linux-loong64@0.17.19(transitive)
- Removed@esbuild/linux-mips64el@0.17.19(transitive)
- Removed@esbuild/linux-ppc64@0.17.19(transitive)
- Removed@esbuild/linux-riscv64@0.17.19(transitive)
- Removed@esbuild/linux-s390x@0.17.19(transitive)
- Removed@esbuild/linux-x64@0.17.19(transitive)
- Removed@esbuild/netbsd-x64@0.17.19(transitive)
- Removed@esbuild/openbsd-x64@0.17.19(transitive)
- Removed@esbuild/sunos-x64@0.17.19(transitive)
- Removed@esbuild/win32-arm64@0.17.19(transitive)
- Removed@esbuild/win32-ia32@0.17.19(transitive)
- Removed@esbuild/win32-x64@0.17.19(transitive)
- Removed@jridgewell/gen-mapping@0.3.5(transitive)
- Removed@jridgewell/resolve-uri@3.1.2(transitive)
- Removed@jridgewell/set-array@1.2.1(transitive)
- Removed@jridgewell/trace-mapping@0.3.25(transitive)
- Removed@storybook/channel-postmessage@7.0.26(transitive)
- Removed@storybook/channels@7.0.26(transitive)
- Removed@storybook/client-logger@7.0.26(transitive)
- Removed@storybook/core-client@7.0.26(transitive)
- Removed@storybook/core-common@7.0.26(transitive)
- Removed@storybook/core-events@7.0.26(transitive)
- Removed@storybook/docs-tools@7.0.26(transitive)
- Removed@storybook/node-logger@7.0.26(transitive)
- Removed@storybook/preview-api@7.0.26(transitive)
- Removed@storybook/types@7.0.26(transitive)
- Removed@types/node@16.18.113(transitive)
- Removed@types/npmlog@4.1.6(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedaproba@2.0.0(transitive)
- Removedare-we-there-yet@2.0.0(transitive)
- Removedbrowserslist@4.24.0(transitive)
- Removedcaniuse-lite@1.0.30001668(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedcolor-support@1.1.3(transitive)
- Removedconsole-control-strings@1.1.0(transitive)
- Removedconvert-source-map@2.0.0(transitive)
- Removeddelegates@1.0.0(transitive)
- Removedelectron-to-chromium@1.5.38(transitive)
- Removedesbuild@0.17.19(transitive)
- Removedescalade@3.2.0(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedgauge@3.0.2(transitive)
- Removedgensync@1.0.0-beta.2(transitive)
- Removedglob@8.1.0(transitive)
- Removedglob-promise@6.0.7(transitive)
- Removedglobals@11.12.0(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedhas-unicode@2.0.1(transitive)
- Removedinflight@1.0.6(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedjsesc@3.0.2(transitive)
- Removedjson5@2.2.3(transitive)
- Removedlru-cache@5.1.1(transitive)
- Removedminimatch@5.1.6(transitive)
- Removednode-releases@2.0.18(transitive)
- Removednpmlog@5.0.1(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedonce@1.4.0(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedset-blocking@2.0.0(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedsupports-color@5.5.0(transitive)
- Removedupdate-browserslist-db@1.1.1(transitive)
- Removedwide-align@1.1.5(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedyallist@3.1.1(transitive)
Updated@storybook/core-client@7.6.3
Updated@storybook/docs-tools@7.6.3
Updated@storybook/preview-api@7.6.3
Updated@storybook/types@7.6.3
Updatedtype-fest@~2.19