Skip to content

Commit

Permalink
feat(sveltekit): upgraded sveltekit support to svelltekit v1.0.0 (fix #…
Browse files Browse the repository at this point in the history
…392, #397) (#402)

Co-authored-by: Guillaume Chau <guillaume.b.chau@gmail.com>
  • Loading branch information
bhvngt and Akryum committed Dec 19, 2022
1 parent 5008ecb commit e7e5993
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 42 deletions.
44 changes: 22 additions & 22 deletions examples/sveltekit/package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
File renamed without changes.
5 changes: 0 additions & 5 deletions examples/sveltekit/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ const config = {

kit: {
adapter: adapter(),

// Override http methods in the Todo forms
methodOverride: {
allowed: ['PATCH', 'DELETE']
}
}
};

Expand Down
2 changes: 1 addition & 1 deletion packages/histoire-plugin-svelte/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function HstSvelte (): Plugin {
},
},
viteIgnorePlugins: [
'vite-plugin-svelte-kit',
'vite-plugin-sveltekit-compile',
],
}
},
Expand Down
7 changes: 4 additions & 3 deletions packages/histoire/src/node/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
22 changes: 11 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e7e5993

Please sign in to comment.