@storybook/sveltekit 8.3.0-alpha.4 → 8.3.0-alpha.6

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/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { BuilderOptions, StorybookConfigVite } from '@storybook/builder-vite';
2
1
  import { StorybookConfig as StorybookConfig$1, CompatibleString } from 'storybook/internal/types';
2
+ import { BuilderOptions, StorybookConfigVite } from '@storybook/builder-vite';
3
3
 
4
4
  declare function enhance(form: HTMLFormElement): {
5
5
  destroy(): void;
package/dist/preset.js CHANGED
@@ -1 +1 @@
1
- "use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__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 __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var preset_exports={};__export(preset_exports,{core:()=>core,previewAnnotations:()=>previewAnnotations,viteFinal:()=>viteFinal});module.exports=__toCommonJS(preset_exports);var import_preset=require("@storybook/svelte-vite/preset"),import_builder_vite=require("@storybook/builder-vite"),import_path=require("path");function configOverrides(){return{name:"storybook:sveltekit-overrides",apply:"build",config:()=>({build:{ssr:!1}})}}var import_node_path=require("path");async function mockSveltekitStores(){return{name:"storybook:sveltekit-mock-stores",config:()=>({resolve:{alias:{"$app/forms":(0,import_node_path.resolve)(__dirname,"../src/mocks/app/forms.ts"),"$app/navigation":(0,import_node_path.resolve)(__dirname,"../src/mocks/app/navigation.ts"),"$app/stores":(0,import_node_path.resolve)(__dirname,"../src/mocks/app/stores.ts")}}})}}var getAbsolutePath=input=>(0,import_path.dirname)(require.resolve((0,import_path.join)(input,"package.json"))),core={builder:getAbsolutePath("@storybook/builder-vite"),renderer:getAbsolutePath("@storybook/svelte")},previewAnnotations=(entry=[])=>[...entry,(0,import_path.join)((0,import_path.dirname)(require.resolve("@storybook/sveltekit/package.json")),"dist/preview.mjs")],viteFinal=async(config,options)=>{let baseConfig=await(0,import_preset.viteFinal)(config,options),{plugins=[]}=baseConfig;return plugins=(await(0,import_builder_vite.withoutVitePlugins)(plugins,["vite-plugin-sveltekit-compile","vite-plugin-sveltekit-guard"])).concat(configOverrides()).concat(await mockSveltekitStores()),{...baseConfig,plugins}};0&&(module.exports={core,previewAnnotations,viteFinal});
1
+ "use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__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 __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var preset_exports={};__export(preset_exports,{core:()=>core,previewAnnotations:()=>previewAnnotations,viteFinal:()=>viteFinal});module.exports=__toCommonJS(preset_exports);var import_node_path2=require("path"),import_builder_vite=require("@storybook/builder-vite"),import_preset=require("@storybook/svelte-vite/preset");function configOverrides(){return{name:"storybook:sveltekit-overrides",apply:"build",config:()=>({build:{ssr:!1}})}}var import_node_path=require("path");async function mockSveltekitStores(){return{name:"storybook:sveltekit-mock-stores",config:()=>({resolve:{alias:{"$app/forms":(0,import_node_path.resolve)(__dirname,"../src/mocks/app/forms.ts"),"$app/navigation":(0,import_node_path.resolve)(__dirname,"../src/mocks/app/navigation.ts"),"$app/stores":(0,import_node_path.resolve)(__dirname,"../src/mocks/app/stores.ts")}}})}}var getAbsolutePath=input=>(0,import_node_path2.dirname)(require.resolve((0,import_node_path2.join)(input,"package.json"))),core={builder:getAbsolutePath("@storybook/builder-vite"),renderer:getAbsolutePath("@storybook/svelte")},previewAnnotations=(entry=[])=>[...entry,(0,import_node_path2.join)((0,import_node_path2.dirname)(require.resolve("@storybook/sveltekit/package.json")),"dist/preview.mjs")],viteFinal=async(config,options)=>{let baseConfig=await(0,import_preset.viteFinal)(config,options),{plugins=[]}=baseConfig;return plugins=(await(0,import_builder_vite.withoutVitePlugins)(plugins,["vite-plugin-sveltekit-compile","vite-plugin-sveltekit-guard"])).concat(configOverrides()).concat(await mockSveltekitStores()),{...baseConfig,plugins}};0&&(module.exports={core,previewAnnotations,viteFinal});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/sveltekit",
3
- "version": "8.3.0-alpha.4",
3
+ "version": "8.3.0-alpha.6",
4
4
  "description": "Storybook for SvelteKit",
5
5
  "keywords": [
6
6
  "storybook",
@@ -49,22 +49,22 @@
49
49
  "src/mocks/**/*"
50
50
  ],
51
51
  "scripts": {
52
- "check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
53
- "prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
52
+ "check": "jiti ../../../scripts/prepare/check.ts",
53
+ "prep": "jiti ../../../scripts/prepare/bundle.ts"
54
54
  },
55
55
  "dependencies": {
56
- "@storybook/addon-actions": "8.3.0-alpha.4",
57
- "@storybook/builder-vite": "8.3.0-alpha.4",
58
- "@storybook/svelte": "8.3.0-alpha.4",
59
- "@storybook/svelte-vite": "8.3.0-alpha.4"
56
+ "@storybook/addon-actions": "8.3.0-alpha.6",
57
+ "@storybook/builder-vite": "8.3.0-alpha.6",
58
+ "@storybook/svelte": "8.3.0-alpha.6",
59
+ "@storybook/svelte-vite": "8.3.0-alpha.6"
60
60
  },
61
61
  "devDependencies": {
62
- "@types/node": "^18.0.0",
62
+ "@types/node": "^22.0.0",
63
63
  "typescript": "^5.3.2",
64
64
  "vite": "^4.0.0"
65
65
  },
66
66
  "peerDependencies": {
67
- "storybook": "^8.3.0-alpha.4",
67
+ "storybook": "^8.3.0-alpha.6",
68
68
  "svelte": "^4.0.0 || ^5.0.0-next.65",
69
69
  "vite": "^4.0.0 || ^5.0.0"
70
70
  },
@@ -1,4 +1,5 @@
1
1
  import { expect, fn, within } from '@storybook/test';
2
+
2
3
  import Forms from './Forms.svelte';
3
4
 
4
5
  export default {
@@ -1,4 +1,5 @@
1
1
  import { expect, fn, within } from '@storybook/test';
2
+
2
3
  import Hrefs from './Hrefs.svelte';
3
4
 
4
5
  export default {
@@ -1,4 +1,5 @@
1
1
  import { expect, fn, within } from '@storybook/test';
2
+
2
3
  import Navigation from './Navigation.svelte';
3
4
 
4
5
  export default {
@@ -1,4 +1,5 @@
1
1
  import { expect, fn, within } from '@storybook/test';
2
+
2
3
  import Environment from './Environment.svelte';
3
4
 
4
5
  export default {
@@ -1,4 +1,5 @@
1
- import { expect, fn, within } from '@storybook/test';
1
+ import { expect, fn, userEvent, within } from '@storybook/test';
2
+
2
3
  import Forms from './Forms.svelte';
3
4
 
4
5
  export default {
@@ -12,8 +13,8 @@ const enhance = fn();
12
13
  export const Enhance = {
13
14
  async play({ canvasElement }) {
14
15
  const canvas = within(canvasElement);
15
- const button = canvas.getByText('enhance');
16
- button.click();
16
+ const button = canvas.getByRole('button');
17
+ await userEvent.click(button);
17
18
  expect(enhance).toHaveBeenCalled();
18
19
  },
19
20
  parameters: {
@@ -1,4 +1,5 @@
1
1
  import { expect, fn, within } from '@storybook/test';
2
+
2
3
  import Hrefs from './Hrefs.svelte';
3
4
 
4
5
  export default {
@@ -1,4 +1,5 @@
1
1
  import { expect, fn, within } from '@storybook/test';
2
+
2
3
  import Navigation from './Navigation.svelte';
3
4
 
4
5
  export default {
@@ -1,4 +1,5 @@
1
1
  import { expect, fn, within } from '@storybook/test';
2
+
2
3
  import Paths from './Paths.svelte';
3
4
 
4
5
  export default {
@@ -1,4 +1,5 @@
1
1
  import { expect, fn, within } from '@storybook/test';
2
+
2
3
  import Environment from './Environment.svelte';
3
4
 
4
5
  export default {
@@ -1,4 +1,5 @@
1
1
  import { expect, fn, within } from '@storybook/test';
2
+
2
3
  import Forms from './Forms.svelte';
3
4
 
4
5
  export default {
@@ -1,4 +1,5 @@
1
1
  import { expect, fn, within } from '@storybook/test';
2
+
2
3
  import Hrefs from './Hrefs.svelte';
3
4
 
4
5
  export default {
@@ -1,4 +1,5 @@
1
1
  import { expect, fn, within } from '@storybook/test';
2
+
2
3
  import Navigation from './Navigation.svelte';
3
4
 
4
5
  export default {
@@ -1,4 +1,5 @@
1
1
  import { expect, fn, within } from '@storybook/test';
2
+
2
3
  import Paths from './Paths.svelte';
3
4
 
4
5
  export default {