diff --git a/.gitignore b/.gitignore index 62358cc..b4a4230 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ node_modules .cache coverage dist +storybook-static diff --git a/.storybook/presets.js b/.storybook/presets.js index 84bbbb5..e026d9a 100644 --- a/.storybook/presets.js +++ b/.storybook/presets.js @@ -1 +1,16 @@ -module.exports = ['@storybook/preset-typescript']; +const path = require('path'); + +module.exports = [ + { + name: '@storybook/preset-typescript', + options: { + tsLoaderOptions: { + configFile: path.resolve(__dirname, './tsconfig.json'), + }, + tsDocgenLoaderOptions: { + tsconfigPath: path.resolve(__dirname, './tsconfig.json'), + }, + include: [path.resolve(__dirname, '../src')], + }, + }, +]; diff --git a/.storybook/tsconfig.json b/.storybook/tsconfig.json new file mode 100644 index 0000000..ab338dc --- /dev/null +++ b/.storybook/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "declaration": false, + } +} diff --git a/README.md b/README.md index c310362..b7fa0cf 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ If you manage to find any, please report them [here](https://github.com/South-Pa Pull the repo and then install dependencies with `yarn`. -In the root directory, use `yarn storybook:start` to run Storybook on `localhost:9000` +In the root directory, use `yarn start:storybook` to run Storybook on `localhost:9000` See `the package.json` for other scripts such as `clean`, `test` and `lint`. diff --git a/package.json b/package.json index bcef373..d71f2be 100644 --- a/package.json +++ b/package.json @@ -24,14 +24,14 @@ "url": "https://github.com/South-Paw/spicy-ui.git" }, "scripts": { - "clean": "rimraf dist", + "clean": "rimraf dist storybook-static", "start": "tsdx watch", + "start:storybook": "start-storybook -p 9000", "build": "tsdx build", + "build:storybook": "build-storybook", "lint": "tsdx lint", "test": "tsdx test --passWithNoTests", - "prepare": "tsdx build", - "storybook:start": "start-storybook -p 9000", - "storybook:build": "build-storybook" + "prepare": "tsdx build" }, "dependencies": { "@styled-system/core": "^5.1.2",