Skip to content

Commit

Permalink
update storybook to v7
Browse files Browse the repository at this point in the history
  • Loading branch information
Cesar Perez authored and carbonrobot committed Jan 10, 2024
1 parent 8dae5bb commit 4f2a1f8
Show file tree
Hide file tree
Showing 49 changed files with 6,427 additions and 7,991 deletions.
2 changes: 1 addition & 1 deletion .babelrc.build.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
extends: "./.babelrc.js",
extends: "./babel.config.js",
ignore: [/^.*(.test.)[j|t]sx?$/],
};
33 changes: 0 additions & 33 deletions .babelrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .babelrc.native.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
presets: ["module:metro-react-native-babel-preset"],
plugins: [
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-transform-export-namespace-from",
"@babel/plugin-transform-flow-strip-types",
],
};
34 changes: 34 additions & 0 deletions .changeset/clever-kings-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
"victory": minor
"victory-area": minor
"victory-axis": minor
"victory-bar": minor
"victory-box-plot": minor
"victory-brush-container": minor
"victory-brush-line": minor
"victory-candlestick": minor
"victory-canvas": minor
"victory-chart": minor
"victory-core": minor
"victory-create-container": minor
"victory-cursor-container": minor
"victory-errorbar": minor
"victory-group": minor
"victory-histogram": minor
"victory-legend": minor
"victory-line": minor
"victory-pie": minor
"victory-polar-axis": minor
"victory-scatter": minor
"victory-selection-container": minor
"victory-shared-events": minor
"victory-stack": minor
"victory-tooltip": minor
"victory-voronoi": minor
"victory-voronoi-container": minor
"victory-zoom-container": minor
"victory-native": minor
"victory-vendor": minor
---

Update build tools to latest versions
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const path = require("path");
const BABEL_PATH = path.resolve(__dirname, ".babelrc.js"); // eslint-disable-line no-undef
const BABEL_PATH = path.resolve(__dirname, "babel.config.js"); // eslint-disable-line no-undef

module.exports = {
settings: {
Expand All @@ -17,6 +17,7 @@ module.exports = {
"plugin:react-hooks/recommended",
"plugin:eslint-comments/recommended",
"prettier",
"plugin:storybook/recommended",
],
rules: {
"eslint-comments/disable-enable-pair": "off",
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ runs:
cache: 'pnpm'

# Wireit cache
- uses: google/wireit@setup-github-actions-caching/v1
# - uses: google/wireit@setup-github-actions-caching/v1

- name: Install dependencies
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
Expand Down
23 changes: 19 additions & 4 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@ const ROOT = path.resolve(__dirname, "..");
const PKGS = path.resolve(ROOT, "packages");
const STORIES = path.resolve(ROOT, "stories");

const wrapForPnp = (packageName) => path.dirname(require.resolve(path.join(packageName, 'package.json')));

module.exports = {
webpackFinal: async (config) => {
// Read all the victory packages and alias.
glob.sync(path.join(PKGS, "victory*/package.json").replace(/\\/g, "/")).forEach((pkgPath) => {
const key = path.dirname(path.relative(PKGS, pkgPath));
config.resolve.alias[key] = path.resolve(path.dirname(pkgPath));
});
glob
.sync(path.join(PKGS, "victory*/package.json"))
.forEach((pkgPath) => {
const key = path.dirname(path.relative(PKGS, pkgPath));
config.resolve.alias[key] = path.resolve(path.dirname(pkgPath));
});

return config;
},

addons: [
"@storybook/addon-options/register",
{
Expand All @@ -30,8 +35,18 @@ module.exports = {
},
},
],

// Use glob to locate the stories, because it ignores our circular dependencies.
stories: glob.sync("../**/*.stories.@(js|jsx|ts|tsx)", {
cwd: __dirname,
}),

framework: {
name: wrapForPnp("@storybook/react-webpack5"),
options: {
builder: {
useSWC: true,
},
},
},
};
9 changes: 9 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
presets: [
"@babel/preset-env",
"@babel/preset-react",
"@babel/preset-typescript",
],
plugins: ["lodash"],
ignore: ["**/*.d.ts"],
};
2 changes: 1 addition & 1 deletion config/webpack/demo/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports = {
use: {
loader: "babel-loader",
// eslint-disable-next-line global-require
options: require("../../../.babelrc.js"),
options: require("../../../babel.config.js"),
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion config/webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module.exports = {
use: {
loader: "babel-loader",
// eslint-disable-next-line global-require
options: require("../../.babelrc.js"),
options: require("../../babel.config.js"),
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"styled-components": "^5.1.0",
"styled-normalize": "^8.0.6",
"unist-util-visit": "^1.4.0",
"victory": "^36.4.0"
"victory": "^36.8.1"
},
"devDependencies": {
"babel-cli": "^6.26.0",
Expand Down
Loading

0 comments on commit 4f2a1f8

Please sign in to comment.