Skip to content

Commit 38573f6

Browse files
Revert "chore(web): update storybooks dependencies (#139)"
This reverts commit 916dcad.
1 parent 916dcad commit 38573f6

258 files changed

Lines changed: 11766 additions & 9792 deletions

File tree

Some content is hidden

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

web/.storybook/main.ts

Lines changed: 6 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,19 @@
1-
// This file has been automatically migrated to valid ESM format by Storybook.
2-
import { fileURLToPath } from "node:url";
3-
import { resolve, dirname } from "path";
1+
import { resolve } from "path";
42

53
import type { StorybookConfig } from "@storybook/react-vite";
64
import { mergeConfig } from "vite";
75

8-
const __filename = fileURLToPath(import.meta.url);
9-
const __dirname = dirname(__filename);
10-
116
const config: StorybookConfig = {
127
stories: ["../src/**/*.stories.@(js|ts|tsx|mdx)"],
13-
addons: [
14-
"@storybook/addon-onboarding",
15-
"@storybook/addon-a11y",
16-
"@storybook/addon-themes",
17-
"@chromatic-com/storybook",
18-
"@storybook/addon-docs",
19-
],
20-
8+
addons: ["@storybook/addon-essentials", "@storybook/addon-styling"],
219
framework: {
2210
name: "@storybook/react-vite",
2311
options: {},
2412
},
25-
2613
core: {
2714
disableTelemetry: true,
2815
},
29-
3016
staticDirs: ["./public"],
31-
3217
viteFinal(config, { configType }) {
3318
return mergeConfig(config, {
3419
define: {
@@ -61,29 +46,7 @@ const config: StorybookConfig = {
6146
find: "@reearth/core",
6247
replacement: resolve(__dirname, "..", "node_modules/@reearth/core"),
6348
},
64-
// cesium-mvt-imagery-provider: force resolution to the JS bundle, not the .d.ts types file
65-
{
66-
find: "cesium-mvt-imagery-provider",
67-
replacement: resolve(
68-
__dirname,
69-
"..",
70-
"node_modules/cesium-mvt-imagery-provider/dist/cesium-mvt-imagery-provider.mjs",
71-
),
72-
},
73-
// quickjs-emscripten: force resolution to the JS bundle, not the .d.ts types file
74-
{
75-
find: "quickjs-emscripten-sync",
76-
replacement: resolve(
77-
__dirname,
78-
"..",
79-
"node_modules/quickjs-emscripten-sync/dist/quickjs-emscripten-sync.mjs",
80-
),
81-
},
82-
// react-align: force resolution to the JS bundle, not the .d.ts types file
83-
{
84-
find: "react-align",
85-
replacement: resolve(__dirname, "..", "node_modules/react-align/dist/react-align.mjs"),
86-
},
49+
// quickjs-emscripten
8750
{
8851
find: "@reearth",
8952
replacement: resolve(__dirname, "..", "src"),
@@ -94,10 +57,6 @@ const config: StorybookConfig = {
9457
},
9558
],
9659
},
97-
optimizeDeps: {
98-
include: ["quickjs-emscripten-sync", "prop-types", "hoist-non-react-statics", "react-is"],
99-
exclude: ["react-align"],
100-
},
10160
server: {
10261
watch: {
10362
// https://github.com/storybookjs/storybook/issues/22253#issuecomment-1673229400
@@ -106,11 +65,8 @@ const config: StorybookConfig = {
10665
},
10766
});
10867
},
109-
110-
docs: {},
111-
112-
typescript: {
113-
reactDocgen: "react-docgen-typescript",
68+
docs: {
69+
autodocs: true,
11470
},
11571
};
116-
export default config;
72+
module.exports = config;

web/.storybook/manager.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { addons } from "@storybook/manager-api";
2+
3+
import theme from "./theme";
4+
5+
addons.setConfig({
6+
theme,
7+
});

web/.storybook/preview.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {
77
Observable,
88
} from "@apollo/client";
99
import { ThemeProvider } from "@emotion/react";
10-
import { withThemeFromJSXProvider } from "@storybook/addon-themes";
11-
import type { Preview, ReactRenderer } from "@storybook/react-vite";
10+
import { withThemeFromJSXProvider } from "@storybook/addon-styling";
11+
import type { Preview, ReactRenderer } from "@storybook/react";
1212
import React from "react";
1313

1414
import classicDarkTheme from "../src/classic/theme/reearthTheme/darkTheme"; // temp classic imports
@@ -33,18 +33,18 @@ const mockClient = new ApolloClient({
3333
const preview: Preview = {
3434
parameters: {
3535
backgrounds: {
36-
options: {
37-
light: { name: "Light", value: "lightGrey" },
38-
dark: { name: "Dark", value: "ash" },
39-
},
36+
values: [
37+
{ name: "Light", value: "lightGrey" },
38+
{ name: "Dark", value: "ash" },
39+
],
4040
},
4141
layout: "fullscreen",
4242
controls: { expanded: true },
43+
actions: { argTypesRegex: "^on.*" },
4344
docs: {
4445
theme,
4546
},
4647
},
47-
4848
decorators: [
4949
withThemeFromJSXProvider<ReactRenderer>({
5050
themes: {
@@ -73,8 +73,6 @@ const preview: Preview = {
7373
);
7474
},
7575
],
76-
77-
tags: ["autodocs"],
7876
};
7977

8078
export default preview;

web/.storybook/theme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { create } from "storybook/theming";
1+
import { create } from "@storybook/theming";
22

33
export default create({
44
base: "dark",

web/.yarn/install-state.gz

372 KB
Binary file not shown.

0 commit comments

Comments
 (0)