mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-23 21:06:22 +08:00
fix(core): storybook build issue (#6274)
1. es2022 is required and should be set separately in storybook. 2. @blocksuite/icons versions are not consistent across packages.
This commit is contained in:
@@ -25,6 +25,9 @@ export default {
|
|||||||
async viteFinal(config, _options) {
|
async viteFinal(config, _options) {
|
||||||
return mergeConfig(config, {
|
return mergeConfig(config, {
|
||||||
plugins: [vanillaExtractPlugin()],
|
plugins: [vanillaExtractPlugin()],
|
||||||
|
esbuild: {
|
||||||
|
target: 'ES2022',
|
||||||
|
},
|
||||||
define: {
|
define: {
|
||||||
'process.env': {},
|
'process.env': {},
|
||||||
'process.env.COVERAGE': JSON.stringify(!!process.env.COVERAGE),
|
'process.env.COVERAGE': JSON.stringify(!!process.env.COVERAGE),
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
import 'core-js/modules/esnext.symbol.async-dispose';
|
||||||
|
import 'core-js/modules/esnext.symbol.dispose';
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import './polyfill';
|
||||||
import '../src/theme/global.css';
|
import '../src/theme/global.css';
|
||||||
import './preview.css';
|
import './preview.css';
|
||||||
import { ThemeProvider, useTheme } from 'next-themes';
|
import { ThemeProvider, useTheme } from 'next-themes';
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@blocksuite/blocks": "0.13.0-canary-202403140735-2367cd5",
|
"@blocksuite/blocks": "0.13.0-canary-202403140735-2367cd5",
|
||||||
"@blocksuite/global": "0.13.0-canary-202403140735-2367cd5",
|
"@blocksuite/global": "0.13.0-canary-202403140735-2367cd5",
|
||||||
"@blocksuite/icons": "2.1.45",
|
"@blocksuite/icons": "2.1.46",
|
||||||
"@blocksuite/lit": "0.13.0-canary-202403140735-2367cd5",
|
"@blocksuite/lit": "0.13.0-canary-202403140735-2367cd5",
|
||||||
"@blocksuite/presets": "0.13.0-canary-202403140735-2367cd5",
|
"@blocksuite/presets": "0.13.0-canary-202403140735-2367cd5",
|
||||||
"@blocksuite/store": "0.13.0-canary-202403140735-2367cd5",
|
"@blocksuite/store": "0.13.0-canary-202403140735-2367cd5",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { runCli } from '@magic-works/i18n-codegen';
|
import { runCli } from '@magic-works/i18n-codegen';
|
||||||
import type { StorybookConfig } from '@storybook/react-vite';
|
import type { StorybookConfig } from '@storybook/react-vite';
|
||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
import { mergeConfig } from 'vite';
|
import { mergeConfig, type InlineConfig } from 'vite';
|
||||||
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
|
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
|
||||||
import { getRuntimeConfig } from '@affine/cli/src/webpack/runtime-config';
|
import { getRuntimeConfig } from '@affine/cli/src/webpack/runtime-config';
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ export default {
|
|||||||
});
|
});
|
||||||
// disable for storybook build
|
// disable for storybook build
|
||||||
runtimeConfig.enableCloud = false;
|
runtimeConfig.enableCloud = false;
|
||||||
return mergeConfig(config, {
|
return mergeConfig<InlineConfig, InlineConfig>(config, {
|
||||||
assetsInclude: ['**/*.md'],
|
assetsInclude: ['**/*.md'],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
@@ -51,6 +51,9 @@ export default {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
esbuild: {
|
||||||
|
target: 'ES2022',
|
||||||
|
},
|
||||||
plugins: [vanillaExtractPlugin()],
|
plugins: [vanillaExtractPlugin()],
|
||||||
define: {
|
define: {
|
||||||
'process.on': 'undefined',
|
'process.on': 'undefined',
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
import 'core-js/modules/esnext.symbol.async-dispose';
|
||||||
|
import 'core-js/modules/esnext.symbol.dispose';
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import './polyfill';
|
||||||
import '@affine/component/theme/global.css';
|
import '@affine/component/theme/global.css';
|
||||||
import '@affine/component/theme/theme.css';
|
import '@affine/component/theme/theme.css';
|
||||||
import { createI18n } from '@affine/i18n';
|
import { createI18n } from '@affine/i18n';
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
"@blocksuite/block-std": "0.13.0-canary-202403140735-2367cd5",
|
"@blocksuite/block-std": "0.13.0-canary-202403140735-2367cd5",
|
||||||
"@blocksuite/blocks": "0.13.0-canary-202403140735-2367cd5",
|
"@blocksuite/blocks": "0.13.0-canary-202403140735-2367cd5",
|
||||||
"@blocksuite/global": "0.13.0-canary-202403140735-2367cd5",
|
"@blocksuite/global": "0.13.0-canary-202403140735-2367cd5",
|
||||||
"@blocksuite/icons": "2.1.45",
|
"@blocksuite/icons": "2.1.46",
|
||||||
"@blocksuite/inline": "0.13.0-canary-202403140735-2367cd5",
|
"@blocksuite/inline": "0.13.0-canary-202403140735-2367cd5",
|
||||||
"@blocksuite/lit": "0.13.0-canary-202403140735-2367cd5",
|
"@blocksuite/lit": "0.13.0-canary-202403140735-2367cd5",
|
||||||
"@blocksuite/presets": "0.13.0-canary-202403140735-2367cd5",
|
"@blocksuite/presets": "0.13.0-canary-202403140735-2367cd5",
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ __metadata:
|
|||||||
"@affine/i18n": "workspace:*"
|
"@affine/i18n": "workspace:*"
|
||||||
"@blocksuite/blocks": "npm:0.13.0-canary-202403140735-2367cd5"
|
"@blocksuite/blocks": "npm:0.13.0-canary-202403140735-2367cd5"
|
||||||
"@blocksuite/global": "npm:0.13.0-canary-202403140735-2367cd5"
|
"@blocksuite/global": "npm:0.13.0-canary-202403140735-2367cd5"
|
||||||
"@blocksuite/icons": "npm:2.1.45"
|
"@blocksuite/icons": "npm:2.1.46"
|
||||||
"@blocksuite/lit": "npm:0.13.0-canary-202403140735-2367cd5"
|
"@blocksuite/lit": "npm:0.13.0-canary-202403140735-2367cd5"
|
||||||
"@blocksuite/presets": "npm:0.13.0-canary-202403140735-2367cd5"
|
"@blocksuite/presets": "npm:0.13.0-canary-202403140735-2367cd5"
|
||||||
"@blocksuite/store": "npm:0.13.0-canary-202403140735-2367cd5"
|
"@blocksuite/store": "npm:0.13.0-canary-202403140735-2367cd5"
|
||||||
@@ -762,7 +762,7 @@ __metadata:
|
|||||||
"@blocksuite/block-std": "npm:0.13.0-canary-202403140735-2367cd5"
|
"@blocksuite/block-std": "npm:0.13.0-canary-202403140735-2367cd5"
|
||||||
"@blocksuite/blocks": "npm:0.13.0-canary-202403140735-2367cd5"
|
"@blocksuite/blocks": "npm:0.13.0-canary-202403140735-2367cd5"
|
||||||
"@blocksuite/global": "npm:0.13.0-canary-202403140735-2367cd5"
|
"@blocksuite/global": "npm:0.13.0-canary-202403140735-2367cd5"
|
||||||
"@blocksuite/icons": "npm:2.1.45"
|
"@blocksuite/icons": "npm:2.1.46"
|
||||||
"@blocksuite/inline": "npm:0.13.0-canary-202403140735-2367cd5"
|
"@blocksuite/inline": "npm:0.13.0-canary-202403140735-2367cd5"
|
||||||
"@blocksuite/lit": "npm:0.13.0-canary-202403140735-2367cd5"
|
"@blocksuite/lit": "npm:0.13.0-canary-202403140735-2367cd5"
|
||||||
"@blocksuite/presets": "npm:0.13.0-canary-202403140735-2367cd5"
|
"@blocksuite/presets": "npm:0.13.0-canary-202403140735-2367cd5"
|
||||||
@@ -3530,16 +3530,6 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@blocksuite/icons@npm:2.1.45":
|
|
||||||
version: 2.1.45
|
|
||||||
resolution: "@blocksuite/icons@npm:2.1.45"
|
|
||||||
peerDependencies:
|
|
||||||
"@types/react": ^18.0.25
|
|
||||||
react: ^18.2.0
|
|
||||||
checksum: 10/a77b46ab6f2325005fb873f5d1e5982bcf01588fa1c03cebaf6f4c4a1cb380dfc39c60334ceb4a7fca9486cb9e4911c15f79e54da45ed87bcea6425b00cb20e5
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"@blocksuite/icons@npm:2.1.46":
|
"@blocksuite/icons@npm:2.1.46":
|
||||||
version: 2.1.46
|
version: 2.1.46
|
||||||
resolution: "@blocksuite/icons@npm:2.1.46"
|
resolution: "@blocksuite/icons@npm:2.1.46"
|
||||||
|
|||||||
Reference in New Issue
Block a user