Skip to content

Commit 527a9ef

Browse files
authored
Merge pull request #255 from uswitch/fix-storybook
Fix storybook build
2 parents 4db044a + 3318a2b commit 527a9ef

File tree

36 files changed

+44
-7
lines changed

36 files changed

+44
-7
lines changed

Diff for: .storybook/webpack.config.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
module.exports = ({ config }) => {
22
config.module.rules.push({
33
test: /\.tsx?$/,
4-
exclude: /node_modules/,
54
loader: 'babel-loader',
65
options: {
7-
presets: ["@babel/typescript", "@babel/preset-react"]
6+
presets: ['@babel/typescript', '@babel/preset-react']
87
}
98
})
109
config.resolve.extensions.push('.ts', '.tsx')
10+
11+
config.resolve.mainFields = ['ts:main', 'main']
12+
1113
return config
1214
}

Diff for: README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
## Development
22
All commands can be run from individual packages, but it is not necessary to do so.
33

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

98
To run storybook locally `npm start`.
109

10+
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.
11+
1112
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.
1213

1314
## TODO:

Diff for: _element-template/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.0.0",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: babel.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module.exports = api => {
1414
}
1515
},
1616
presets: ['@babel/typescript', '@babel/preset-react'],
17-
plugins: ['@babel/plugin-proposal-optional-chaining']
17+
plugins: ['@babel/plugin-proposal-optional-chaining'],
18+
sourceType: 'unambiguous'
1819
}
1920
}

Diff for: src/compounds/side-nav/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.1.2",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/accordion/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.1.8",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/author/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.1.3",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/breadcrumbs/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.0.8",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/bullet-list-highlight/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.2.48",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"scripts": {
78
"--------------- BUILDING": "----------------------",
89
"clean": "rm -rf lib",

Diff for: src/elements/bullet-list-timeline/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.2.41",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/button-link/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.3.8",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/button/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.7.7",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/call-out/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.1.8",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/category/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.1.7",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/checkbox-input/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.0.22",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/cta/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.1.7",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/drop-down/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.4.55",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/embedded-video/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.1.3",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/fieldset/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.0.22",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/frozen-input/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.3.48",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/global-styles/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.3.7",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/icon/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.2.47",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/imgix-image/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.1.24",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/input-alert/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.2.41",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/input/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.3.48",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/list/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.2.7",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/loading-spinner/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.2.41",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/pagination/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.1.8",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/progress-bar/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.3.15",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/radio-input/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.1.13",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/side-drawer/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.2.35",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/elements/tile-input/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.0.49",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/helpers/date/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.0.5",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/layout/arrangement/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "2.0.6",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/layout/grid/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "2.0.0",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.tsx",
67
"publishConfig": {
78
"access": "public"
89
},

Diff for: src/styles/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.4.23",
44
"license": "MIT",
55
"main": "lib/index.js",
6+
"ts:main": "src/index.ts",
67
"publishConfig": {
78
"access": "public"
89
},

0 commit comments

Comments
 (0)