diff --git a/examples/sveltekit/package.json b/examples/sveltekit/package.json index d75d59a2..9b6edb98 100644 --- a/examples/sveltekit/package.json +++ b/examples/sveltekit/package.json @@ -1,34 +1,34 @@ { - "name": "sveltekit", - "version": "0.0.1", + "name": "sveltekit", + "version": "0.0.1", "private": true, - "scripts": { - "sk:dev": "vite dev", - "sk:build": "vite build", - "sk:package": "svelte-kit package", - "sk:preview": "vite preview", - "sk:check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", - "sk:check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", + "scripts": { + "sk:dev": "vite dev", + "sk:build": "vite build", + "sk:package": "svelte-kit package", + "sk:preview": "vite preview", + "sk:check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "sk:check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "story:dev": "histoire dev", "story:build": "histoire build", "story:preview": "histoire preview --port 4567" - }, - "type": "module", - "dependencies": { - "@fontsource/fira-mono": "^4.5.0", - "cookie": "^0.4.1" - }, - "devDependencies": { + }, + "type": "module", + "dependencies": { + "@fontsource/fira-mono": "^4.5.0", + "cookie": "^0.4.1" + }, + "devDependencies": { "@histoire/plugin-svelte": "workspace:*", - "@sveltejs/adapter-auto": "next", - "@sveltejs/kit": "next", - "@types/cookie": "^0.5.1", + "@sveltejs/adapter-auto": "^1.0.0", + "@sveltejs/kit": "^1.0.0", + "@types/cookie": "^0.5.1", "histoire": "workspace:*", "svelte": "^3.54.0", - "svelte-check": "^2.7.1", + "svelte-check": "^2.7.1", "svelte-preprocess": "^4.10.7", - "tslib": "^2.3.1", + "tslib": "^2.3.1", "typescript": "^4.7.4", "vite": "^4.0.0" - } + } } diff --git a/examples/sveltekit/src/hooks.ts b/examples/sveltekit/src/hooks.server.ts similarity index 100% rename from examples/sveltekit/src/hooks.ts rename to examples/sveltekit/src/hooks.server.ts diff --git a/examples/sveltekit/svelte.config.js b/examples/sveltekit/svelte.config.js index 1fa366b0..80034679 100644 --- a/examples/sveltekit/svelte.config.js +++ b/examples/sveltekit/svelte.config.js @@ -9,11 +9,6 @@ const config = { kit: { adapter: adapter(), - - // Override http methods in the Todo forms - methodOverride: { - allowed: ['PATCH', 'DELETE'] - } } }; diff --git a/packages/histoire-plugin-svelte/src/index.ts b/packages/histoire-plugin-svelte/src/index.ts index 2783a6c4..4ff121ee 100644 --- a/packages/histoire-plugin-svelte/src/index.ts +++ b/packages/histoire-plugin-svelte/src/index.ts @@ -28,7 +28,7 @@ export function HstSvelte (): Plugin { }, }, viteIgnorePlugins: [ - 'vite-plugin-svelte-kit', + 'vite-plugin-sveltekit-compile', ], } }, diff --git a/packages/histoire/src/node/vite.ts b/packages/histoire/src/node/vite.ts index 66c8aa37..0b83b68c 100644 --- a/packages/histoire/src/node/vite.ts +++ b/packages/histoire/src/node/vite.ts @@ -78,10 +78,11 @@ export async function mergeHistoireViteConfig (viteConfig: InlineConfig, ctx: Co let flatPlugins = [] if (viteConfig.plugins) { for (const pluginOption of viteConfig.plugins) { - if (Array.isArray(pluginOption)) { - flatPlugins.push(...await Promise.all(pluginOption)) + const resolvedPluginOption = await pluginOption + if (Array.isArray(resolvedPluginOption)) { + flatPlugins.push(...await Promise.all(resolvedPluginOption)) } else { - flatPlugins.push(await pluginOption) + flatPlugins.push(resolvedPluginOption) } } flatPlugins = flatPlugins.filter(Boolean) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 53889af1..9c4764b8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -103,8 +103,8 @@ importers: specifiers: '@fontsource/fira-mono': ^4.5.0 '@histoire/plugin-svelte': workspace:* - '@sveltejs/adapter-auto': next - '@sveltejs/kit': next + '@sveltejs/adapter-auto': ^1.0.0 + '@sveltejs/kit': ^1.0.0 '@types/cookie': ^0.5.1 cookie: ^0.4.1 histoire: workspace:* @@ -119,8 +119,8 @@ importers: cookie: 0.4.2 devDependencies: '@histoire/plugin-svelte': link:../../packages/histoire-plugin-svelte - '@sveltejs/adapter-auto': 1.0.0-next.91_l5ueyfihz3gpzzvvyo2ean5u3e - '@sveltejs/kit': 1.0.0-next.589_svelte@3.55.0+vite@4.0.2 + '@sveltejs/adapter-auto': 1.0.0_@sveltejs+kit@1.0.1 + '@sveltejs/kit': 1.0.1_svelte@3.55.0+vite@4.0.2 '@types/cookie': 0.5.1 histoire: link:../../packages/histoire svelte: 3.55.0 @@ -2630,18 +2630,18 @@ packages: resolution: {integrity: sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ==} dev: true - /@sveltejs/adapter-auto/1.0.0-next.91_l5ueyfihz3gpzzvvyo2ean5u3e: - resolution: {integrity: sha512-U57tQdzTfFINim8tzZSARC9ztWPzwOoHwNOpGdb2o6XrD0mEQwU9DsII7dBblvzg+xCnmd0pw7PDtXz5c5t96w==} + /@sveltejs/adapter-auto/1.0.0_@sveltejs+kit@1.0.1: + resolution: {integrity: sha512-yKyPvlLVua1bJ/42FrR3X041mFGdB4GzTZOAEoHUcNBRE5Mhx94+eqHpC3hNvAOiLEDcKfVO0ObyKSu7qldU+w==} peerDependencies: - '@sveltejs/kit': ^1.0.0-next.587 + '@sveltejs/kit': ^1.0.0 dependencies: - '@sveltejs/kit': 1.0.0-next.589_svelte@3.55.0+vite@4.0.2 + '@sveltejs/kit': 1.0.1_svelte@3.55.0+vite@4.0.2 import-meta-resolve: 2.2.0 dev: true - /@sveltejs/kit/1.0.0-next.589_svelte@3.55.0+vite@4.0.2: - resolution: {integrity: sha512-5ABRw46z9B+cCe/YWhcx+I/azNZg1NCDEkVJifZn8ToFoJ3a1eP0OexNIrvMEWpllMbNMPcJm2TC9tnz9oPfWQ==} - engines: {node: '>=16.14'} + /@sveltejs/kit/1.0.1_svelte@3.55.0+vite@4.0.2: + resolution: {integrity: sha512-C41aCaDjA7xoUdsrc/lSdU1059UdLPIRE1vEIRRynzpMujNgp82bTMHkDosb6vykH6LrLf3tT2w2/5NYQhKYGQ==} + engines: {node: ^16.14 || >=18} hasBin: true requiresBuild: true peerDependencies: