Skip to content

Commit

Permalink
Merge pull request #255 from uswitch/fix-storybook
Browse files Browse the repository at this point in the history
Fix storybook build
  • Loading branch information
callumacrae authored Feb 7, 2020
2 parents 4db044a + 3318a2b commit 527a9ef
Show file tree
Hide file tree
Showing 36 changed files with 44 additions and 7 deletions.
6 changes: 4 additions & 2 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
module.exports = ({ config }) => {
config.module.rules.push({
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
presets: ["@babel/typescript", "@babel/preset-react"]
presets: ['@babel/typescript', '@babel/preset-react']
}
})
config.resolve.extensions.push('.ts', '.tsx')

config.resolve.mainFields = ['ts:main', 'main']

return config
}
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
## Development
All commands can be run from individual packages, but it is not necessary to do so.

Run `npm install` at the project root to install the dev dependencies.
Run `npx lerna exec 'npm install'` to install each package’s dependencies.
Run `npx lerna bootstrap` to install each package’s dependencies.
Run `npx lerna run build` to run each package’s build script.
- Run `npm install` at the project root to install the dev dependencies.
- Run `npx lerna exec 'npm install'` to install each package’s dependencies.
- Run `npx lerna bootstrap` to link package dependencies to each other.

To run storybook locally `npm start`.

To run each package’s build script, run `npx lerna run build`. You don't usually have to do this as you don't need it for local development and the publish script runs it for you on publish.

To add a new element, copy the template to the src/elements directory, update the package.json with the name and add your source code.

## TODO:
Expand Down
1 change: 1 addition & 0 deletions _element-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.0",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
3 changes: 2 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = api => {
}
},
presets: ['@babel/typescript', '@babel/preset-react'],
plugins: ['@babel/plugin-proposal-optional-chaining']
plugins: ['@babel/plugin-proposal-optional-chaining'],
sourceType: 'unambiguous'
}
}
1 change: 1 addition & 0 deletions src/compounds/side-nav/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.2",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/accordion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.8",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/author/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.3",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/breadcrumbs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.8",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/bullet-list-highlight/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.2.48",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"scripts": {
"--------------- BUILDING": "----------------------",
"clean": "rm -rf lib",
Expand Down
1 change: 1 addition & 0 deletions src/elements/bullet-list-timeline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.2.41",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/button-link/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.3.8",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.7.7",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/call-out/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.8",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/category/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.7",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/checkbox-input/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.22",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/cta/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.7",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/drop-down/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.4.55",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/embedded-video/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.3",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/fieldset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.22",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/frozen-input/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.3.48",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/global-styles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.3.7",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/icon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.2.47",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/imgix-image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.24",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/input-alert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.2.41",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/input/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.3.48",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/list/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.2.7",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/loading-spinner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.2.41",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/pagination/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.8",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/progress-bar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.3.15",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/radio-input/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.1.13",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/side-drawer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.2.35",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/elements/tile-input/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.49",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/helpers/date/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.5",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/layout/arrangement/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "2.0.6",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/layout/grid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "2.0.0",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.tsx",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions src/styles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.4.23",
"license": "MIT",
"main": "lib/index.js",
"ts:main": "src/index.ts",
"publishConfig": {
"access": "public"
},
Expand Down

0 comments on commit 527a9ef

Please sign in to comment.