Skip to content

Commit

Permalink
Update Babel & Storybook, fix k in knobs
Browse files Browse the repository at this point in the history
  • Loading branch information
azizhk committed Nov 5, 2018
1 parent c22864e commit 80ffc50
Show file tree
Hide file tree
Showing 7 changed files with 458 additions and 897 deletions.
17 changes: 0 additions & 17 deletions .babelrc

This file was deleted.

18 changes: 18 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
presets: [
[
"@babel/preset-env",
{
targets: { node: "8" }
}
],
"@babel/preset-react",
"@babel/preset-typescript"
],
plugins: [["@babel/plugin-proposal-class-properties", { loose: false }]],
env: {
test: {
plugins: ["require-context-hook"]
}
}
};
52 changes: 23 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"build": "rimraf dist && tsc -p tsconfig.base.json && rollup -c && rimraf compiled && yarn build:icons && yarn copy:fonts",
"build:watch": "chokidar 'src/**/*.ts' 'src/**/*.tsx' -c 'yarn build'",
"test:cover": "yarn test && codecov",
"test": "jest",
"test": "tsc && jest",
"prepublishOnly": "yarn test && yarn build",
"test:watch": "npm test -- --watchAll",
"format": "pretty-quick",
Expand Down Expand Up @@ -49,20 +49,25 @@
"utility-types": "^2.1.0"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.1.0",
"@dump247/storybook-state": "^1.5.1",
"@storybook/addon-a11y": "^v4.0.0-alpha.12",
"@storybook/addon-actions": "^v4.0.0-alpha.12",
"@storybook/addon-backgrounds": "^v4.0.0-alpha.12",
"@storybook/addon-centered": "^v4.0.0-alpha.12",
"@storybook/addon-a11y": "^4.0.2",
"@storybook/addon-actions": "^4.0.2",
"@storybook/addon-backgrounds": "^4.0.2",
"@storybook/addon-centered": "^4.0.2",
"@storybook/addon-console": "^1.0.4",
"@storybook/addon-info": "^v4.0.0-alpha.12",
"@storybook/addon-knobs": "^v4.0.0-alpha.12",
"@storybook/addon-links": "^v4.0.0-alpha.12",
"@storybook/addon-options": "^v4.0.0-alpha.12",
"@storybook/addon-storysource": "^v4.0.0-alpha.12",
"@storybook/addon-viewport": "^v4.0.0-alpha.12",
"@storybook/addons": "^v4.0.0-alpha.12",
"@storybook/react": "^v4.0.0-alpha.12",
"@storybook/addon-info": "^4.0.2",
"@storybook/addon-knobs": "^4.0.2",
"@storybook/addon-links": "^4.0.2",
"@storybook/addon-options": "^4.0.2",
"@storybook/addon-storysource": "^4.0.2",
"@storybook/addon-viewport": "^4.0.2",
"@storybook/addons": "^4.0.2",
"@storybook/react": "^4.0.2",
"@types/enzyme": "^3.1.14",
"@types/enzyme-adapter-react-16": "^1.0.3",
"@types/jest": "^23.3.5",
Expand All @@ -77,14 +82,10 @@
"@types/storybook__addon-knobs": "^3.4.1",
"@types/storybook__react": "^3.0.9",
"awesome-typescript-loader": "^5.2.1",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.5",
"babel-plugin-external-helpers": "^6.22.0",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^23.4.2",
"babel-loader": "^8.0.0",
"babel-plugin-require-context-hook": "^1.0.0",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"babel-runtime": "^6.26.0",
"chokidar-cli": "^1.2.1",
"codecov": "^3.1.0",
"colors": "^1.3.2",
Expand Down Expand Up @@ -115,7 +116,7 @@
"rimraf": "^2.6.2",
"rollup": "^0.66.6",
"rollup-plugin-alias": "^1.4.0",
"rollup-plugin-babel": "^3.0.7",
"rollup-plugin-babel": "^4.0.1",
"rollup-plugin-cleanup": "^3.0.0",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-filesize": "^5.0.1",
Expand All @@ -125,17 +126,11 @@
"serve": "^10.0.2",
"sinon": "^7.0.0",
"svgo": "^1.1.1",
"ts-jest": "^23.10.4",
"typescript": "3.1.4",
"webfonts-generator": "^0.4.0",
"webpack": "^4.21.0"
},
"jest": {
"globals": {
"ts-jest": {
"babelConfig": true
}
},
"snapshotSerializers": [
"enzyme-to-json/serializer"
],
Expand All @@ -145,8 +140,7 @@
],
"setupTestFrameworkScriptFile": "<rootDir>/tests/__setup__/setupFramework.ts",
"transform": {
"^.+\\.jsx?$": "<rootDir>/node_modules/babel-jest",
"^.+\\.tsx?$": "ts-jest"
".[jt]sx?$": "<rootDir>/node_modules/babel-jest"
},
"testRegex": "(<rootDir>/(tests|src)/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
"moduleFileExtensions": [
Expand Down
17 changes: 2 additions & 15 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import resolve from "rollup-plugin-node-resolve";
import filesize from "rollup-plugin-filesize";
import sourceMaps from "rollup-plugin-sourcemaps";
import pkg from "./package.json";
import * as babelConfig from "./.babelrc";
import babel from "rollup-plugin-babel";
import commonjs from "rollup-plugin-commonjs";
import cleanup from "rollup-plugin-cleanup";
Expand All @@ -10,21 +11,7 @@ const input = "compiled/index.js";
const external = ["react", "react-calendar/dist/entry.nostyle"];

const plugins = [
babel({
babelrc: false,
presets: [
[
"env",
{
targets: { node: "6" },
modules: false
}
],
"stage-0",
"react"
],
plugins: ["external-helpers"]
}),
babel(babelConfig),
resolve({
extensions: [".js", ".jsx", ".json"]
}),
Expand Down
4 changes: 2 additions & 2 deletions src/components/OptionGroupRadio.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from "react";
import OptionGroup from "./shared/OptionGroup";
import { OptionGroupRadio } from "./typings/OptionGroupRadio";
import { OptionGroupRadio as OptionGroupRadioProps } from "./typings/OptionGroupRadio";

const OptionGroupRadio: React.SFC<OptionGroupRadio> = props => {
const OptionGroupRadio: React.SFC<OptionGroupRadioProps> = props => {
const { selected, onChange, ...rest } = props;
return (
<OptionGroup
Expand Down
7 changes: 6 additions & 1 deletion stories/phonenumberinput.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ storiesOf("PhoneNumberInput", module).add(
countryCode={store.state.countryCode}
phone={store.state.phone}
placeholder="Alternate Phone Number"
onChange={({ countryCode, phone }) => store.set({ countryCode, phone })}
onChange={({ countryCode, phone }) =>
store.set({
countryCode: `${countryCode}`,
phone
})
}
>
{countries.map(country => (
<Option
Expand Down
Loading

1 comment on commit 80ffc50

@vercel
Copy link

@vercel vercel bot commented on 80ffc50 Nov 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now could not deploy this pull request since the "files" configuration in now.json lists these files or directories which do not exist:

  • .babelrc

These paths may be missing from the GitHub repository because of a .gitignore file.
Consider committing them to GitHub or removing them from the "files" list and generating the paths on Now instead using a build script for a Node.js deployment, or within your Dockerfile for a docker deployment.

For more information on the "files" configuration in now.json, visit https://zeit.co/docs/features/configuration#files(array)

Please sign in to comment.