Skip to content

Commit 6f9bb02

Browse files
committed
Merge branch 'main' into ts-migrate/victory-native
2 parents 86f5c73 + c8c2eb2 commit 6f9bb02

File tree

199 files changed

+7154
-6397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+7154
-6397
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,34 @@
11
---
2+
"victory-area": patch
23
"victory-axis": patch
34
"victory-bar": patch
45
"victory-box-plot": patch
56
"victory-brush-container": patch
67
"victory-brush-line": patch
78
"victory-candlestick": patch
9+
"victory-canvas": patch
810
"victory-chart": patch
911
"victory-core": patch
10-
"victory-create-container": patch
12+
"victory-cursor-container": patch
1113
"victory-errorbar": patch
14+
"victory-group": patch
15+
"victory-histogram": patch
1216
"victory-legend": patch
17+
"victory-line": patch
18+
"victory-native": patch
19+
"victory-pie": patch
1320
"victory-polar-axis": patch
21+
"victory-scatter": patch
1422
"victory-selection-container": patch
1523
"victory-shared-events": patch
1624
"victory-stack": patch
25+
"victory-tooltip": patch
26+
"victory-voronoi": patch
1727
"victory-voronoi-container": patch
28+
"victory": patch
29+
"victory-create-container": patch
30+
"victory-vendor": patch
31+
"victory-zoom-container": patch
1832
---
1933

20-
Refactor param reassignments
34+
Replace instances of lodash.assign with Object.assign

.changeset/eight-bananas-itch.md

-5
This file was deleted.

.changeset/kind-rivers-kick.md

-5
This file was deleted.

.changeset/long-files-itch.md

-5
This file was deleted.

.changeset/olive-bananas-stare.md

-5
This file was deleted.

.changeset/silver-weeks-attend.md

-5
This file was deleted.

.changeset/six-donuts-swim.md

-5
This file was deleted.

.changeset/sour-owls-dream.md

-6
This file was deleted.

.changeset/tender-bees-talk.md

-6
This file was deleted.

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module.exports = {
1717
"plugin:react-hooks/recommended",
1818
"plugin:eslint-comments/recommended",
1919
"prettier",
20+
"plugin:storybook/recommended",
2021
],
2122
rules: {
2223
"eslint-comments/disable-enable-pair": "off",

.github/workflows/chromatic.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
name: Chromatic
22

33
# Runs chromatic on:
4-
# every pull request where there are changes in stories/ or packages/ and the PR is not in draft mode
4+
# - every push to main (to create a chromatic baseline)
5+
# - every pull request where there are changes in stories/ or packages/ and the PR is not in draft mode
56
on:
7+
push:
8+
branches:
9+
- main
610
pull_request:
711
branches:
812
- main
@@ -21,13 +25,12 @@ jobs:
2125
with:
2226
fetch-depth: 0
2327

24-
# requires node16, see https://github.com/FormidableLabs/victory/issues/2668
2528
- uses: ./.github/actions/setup
2629
with:
27-
node-version: 16.x
30+
node-version: 18.x
2831

29-
- name: Build Storybook
30-
run: pnpm run storybook:build
32+
- name: Build Victory
33+
run: pnpm run build:lib:esm
3134

3235
- name: Publish to Chromatic
3336
uses: chromaui/action@v1

.storybook/main.js

-37
This file was deleted.

.storybook/main.ts

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import type { StorybookConfig } from "@storybook/react-webpack5";
2+
3+
/* globals __dirname:false */
4+
const path = require("path");
5+
const glob = require("glob");
6+
const ROOT = path.resolve(__dirname, "..");
7+
const PKGS = path.resolve(ROOT, "packages");
8+
const STORIES = path.resolve(ROOT, "stories");
9+
10+
const wrapForPnp = (packageName) =>
11+
path.dirname(require.resolve(path.join(packageName, "package.json")));
12+
13+
const config: StorybookConfig = {
14+
webpackFinal: async (config) => {
15+
// Read all the victory packages and alias.
16+
glob.sync(path.join(PKGS, "victory*/package.json")).forEach((pkgPath) => {
17+
const key = path.dirname(path.relative(PKGS, pkgPath));
18+
if (config?.resolve?.alias) {
19+
config.resolve.alias[key] = path.resolve(path.dirname(pkgPath));
20+
}
21+
});
22+
23+
return config;
24+
},
25+
26+
addons: [
27+
"@storybook/addon-essentials",
28+
{
29+
name: "@storybook/addon-storysource",
30+
options: {
31+
rule: {
32+
test: [/\.stories\.(jsx?|tsx?)$/],
33+
include: [STORIES],
34+
},
35+
loaderOptions: {
36+
prettierConfig: { printWidth: 80, singleQuote: false },
37+
},
38+
},
39+
},
40+
],
41+
42+
// Use glob to locate the stories, because it ignores our circular dependencies.
43+
stories: glob.sync("../**/*.stories.@(js|jsx|ts|tsx)", {
44+
cwd: __dirname,
45+
}),
46+
47+
framework: {
48+
name: wrapForPnp("@storybook/react-webpack5"),
49+
options: {
50+
builder: {
51+
useSWC: true,
52+
},
53+
},
54+
},
55+
56+
typescript: {
57+
// typescript compilation check is disabled until we upgrade the babel version
58+
// which is required for the latest version of storybook to do typechecking
59+
// https://github.com/FormidableLabs/victory/issues/2746
60+
check: false,
61+
checkOptions: {
62+
typescript: {
63+
configFile: path.join(__dirname, "../tsconfig.base.json"),
64+
},
65+
},
66+
},
67+
};
68+
69+
export default config;

demo/js/components/events-demo.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { VictoryArea } from "victory-area";
66
import { VictoryBar } from "victory-bar";
77
import { VictoryLine } from "victory-line";
88
import { VictoryTheme, VictoryLabel } from "victory-core";
9-
import { merge } from "lodash";
109

1110
class App extends React.Component {
1211
render() {
@@ -104,7 +103,7 @@ class App extends React.Component {
104103
target: "data",
105104
mutation: (props) => {
106105
return {
107-
style: merge({}, props.style, { stroke: "lime" }),
106+
style: Object.assign({}, props.style, { stroke: "lime" }),
108107
};
109108
},
110109
},
@@ -113,7 +112,7 @@ class App extends React.Component {
113112
target: "labels",
114113
mutation: (props) => {
115114
return {
116-
style: merge({}, props.style, { fill: "green" }),
115+
style: Object.assign({}, props.style, { fill: "green" }),
117116
text: "waddup",
118117
};
119118
},

demo/js/components/external-events-demo.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { VictoryBar } from "victory-bar";
88
import { VictoryLine } from "victory-line";
99
import { VictoryZoomContainer } from "victory-zoom-container";
1010
import { VictoryVoronoiContainer } from "victory-voronoi-container";
11-
import { range, assign } from "lodash";
11+
import { range } from "lodash";
1212

1313
class App extends React.Component {
1414
constructor() {
@@ -52,8 +52,8 @@ class App extends React.Component {
5252
mutation: (props) => {
5353
const fill = props.style && props.style.fill;
5454
return fill === "blue"
55-
? { style: assign({}, props.style, { fill: "red" }) }
56-
: { style: assign({}, props.style, { fill: "blue" }) };
55+
? { style: Object.assign({}, props.style, { fill: "red" }) }
56+
: { style: Object.assign({}, props.style, { fill: "blue" }) };
5757
},
5858
callback,
5959
},

0 commit comments

Comments
 (0)