Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies to support svelte@4 #112

Merged
merged 1 commit into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
- name: Prepare repository
run: git fetch --unshallow --tags

- name: Use Node.js 16.x
- name: Use Node.js 20.x
uses: actions/setup-node@v1
with:
node-version: 16.x
node-version: 20.x

- name: Install dependencies
uses: bahmutov/npm-install@v1
Expand Down
46 changes: 11 additions & 35 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,13 @@
const path = require("path");
const path = require("path")

module.exports = {
framework: '@storybook/svelte-webpack5',
stories: [
"../stories/**/*.stories.svelte",
],
addons: [
"../preset.js",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
],
webpackFinal: async (config, { configType }) => {
// `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION'
// You can change the configuration based on that.
// 'PRODUCTION' is used when building the static version of storybook.

config.resolve = {
...config.resolve,
alias: {
svelte: path.resolve("node_modules", "svelte"),
},
};

config.module.rules = [ {
resourceQuery: /raw/,
type: 'asset/source'
}, ...config.module.rules]

config.module.rules
.filter(r => r.test && r.test.toString().includes("svelte"))
.forEach(r => r.resourceQuery = { not: [/raw/] });

// Return the altered config
return config;
},
};
framework: '@storybook/svelte-webpack5',
stories: [
"../stories/**/*.stories.svelte",
],
addons: [
"../preset.js",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
],
}
8 changes: 4 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SvelteComponentTyped, SvelteComponent } from 'svelte';
import type { SvelteComponent } from 'svelte'
import type { Addon_BaseMeta as BaseMeta, Addon_BaseAnnotations as BaseAnnotations, StoryContext, WebRenderer } from '@storybook/types';


Expand Down Expand Up @@ -54,14 +54,14 @@ interface Slots {
/**
* Meta.
*/
export class Meta extends SvelteComponentTyped<BaseMeta<any> & BaseAnnotations<any, DecoratorReturnType>> { }
export class Meta extends SvelteComponent<BaseMeta<any> & BaseAnnotations<any, DecoratorReturnType>> { }
/**
* Story.
*/
export class Story extends SvelteComponentTyped<StoryProps, any, Slots> { }
export class Story extends SvelteComponent<StoryProps, any, Slots> { }
/**
* Template.
*
* Allow to reuse definition between stories.
*/
export class Template extends SvelteComponentTyped<TemplateProps, any, Slots> { }
export class Template extends SvelteComponent<TemplateProps, any, Slots> { }
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"test": "jest",
"lint": "eslint --cache --cache-location=.cache/eslint --ext .js,.jsx,.json,.html,.ts,.tsx,.mjs --report-unused-disable-directives",
"storybook": "sb dev -p 6006",
"start": "concurrently \"yarn storybook -- --no-manager-cache --quiet\" \"yarn build -- --watch\"",
"start": "concurrently \"yarn storybook --quiet\" \"yarn build -- --watch\"",
"build-storybook": "sb build",
"release": "yarn build && auto shipit"
},
Expand All @@ -47,17 +47,17 @@
"@babel/preset-env": "^7.21.4",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.21.4",
"@storybook/addon-essentials": "^7.0.0-beta.0 || ^7.0.0-rc.0 || ^7.0.0",
"@storybook/addon-interactions": "^7.0.0-beta.0 || ^7.0.0-rc.0 || ^7.0.0",
"@storybook/addon-storyshots": "^7.0.0-beta.0 || ^7.0.0-rc.0 || ^7.0.0",
"@storybook/core-client": "^7.0.0-beta.0 || ^7.0.0-rc.0 || ^7.0.0",
"@storybook/core-server": "^7.0.0-beta.0 || ^7.0.0-rc.0 || ^7.0.0",
"@storybook/addon-essentials": "^7.0.27",
"@storybook/addon-interactions": "^7.0.27",
"@storybook/addon-storyshots": "^7.0.27",
"@storybook/core-client": "^7.0.27",
"@storybook/core-server": "^7.0.27",
"@storybook/eslint-config-storybook": "^3.1.2",
"@storybook/jest": "^0.0.10",
"@storybook/svelte": "^7.0.0-beta.0 || ^7.0.0-rc.0 || ^7.0.0",
"@storybook/svelte-webpack5": "^7.0.0-beta.0 || ^7.0.0-rc.0 || ^7.0.0",
"@storybook/svelte": "^7.0.27",
"@storybook/svelte-webpack5": "^7.0.27",
"@storybook/testing-library": "^0.0.13",
"@storybook/types": "^7.0.0-beta.0 || ^7.0.0-rc.0 || ^7.0.0",
"@storybook/types": "^7.0.27",
"auto": "^10.43.0",
"babel-jest": "^29.5.0",
"babel-loader": "^8.1.0",
Expand All @@ -70,18 +70,18 @@
"react": "^17.0.1",
"react-dom": "^17.0.1",
"rimraf": "^3.0.2",
"sb": "^7.0.0-beta.0 || ^7.0.0-rc.0 || ^7.0.0",
"svelte": "^3.58.0",
"sb": "^7.0.27",
"svelte": "^4.0.0",
"svelte-jester": "^2.3.2",
"svelte-loader": "^3.1.7",
"typescript": "^3.9.7",
"typescript": "^5.0.0",
"vite": "^3.1.4"
},
"peerDependencies": {
"@storybook/svelte": "^7.0.0-beta.0 || ^7.0.0-rc.0 || ^7.0.0",
"@storybook/theming": "^7.0.0-beta.0 || ^7.0.0-rc.0 || ^7.0.0",
"@sveltejs/vite-plugin-svelte": "^1.0.0 || ^2.0.0",
"svelte": "^3.50.0",
"svelte": "^3.50.0 || ^4.0.0",
"svelte-loader": "^3.1.2",
"vite": "^3.0.0 || ^4.0.0"
},
Expand Down Expand Up @@ -112,4 +112,4 @@
],
"icon": "https://user-images.githubusercontent.com/321738/63501763-88dbf600-c4cc-11e9-96cd-94adadc2fd72.png"
}
}
}
Loading