mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-11 07:06:28 +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) {
|
||||
return mergeConfig(config, {
|
||||
plugins: [vanillaExtractPlugin()],
|
||||
esbuild: {
|
||||
target: 'ES2022',
|
||||
},
|
||||
define: {
|
||||
'process.env': {},
|
||||
'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 './preview.css';
|
||||
import { ThemeProvider, useTheme } from 'next-themes';
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
"devDependencies": {
|
||||
"@blocksuite/blocks": "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/presets": "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 type { StorybookConfig } from '@storybook/react-vite';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { mergeConfig } from 'vite';
|
||||
import { mergeConfig, type InlineConfig } from 'vite';
|
||||
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
|
||||
import { getRuntimeConfig } from '@affine/cli/src/webpack/runtime-config';
|
||||
|
||||
@@ -40,7 +40,7 @@ export default {
|
||||
});
|
||||
// disable for storybook build
|
||||
runtimeConfig.enableCloud = false;
|
||||
return mergeConfig(config, {
|
||||
return mergeConfig<InlineConfig, InlineConfig>(config, {
|
||||
assetsInclude: ['**/*.md'],
|
||||
resolve: {
|
||||
alias: {
|
||||
@@ -51,6 +51,9 @@ export default {
|
||||
),
|
||||
},
|
||||
},
|
||||
esbuild: {
|
||||
target: 'ES2022',
|
||||
},
|
||||
plugins: [vanillaExtractPlugin()],
|
||||
define: {
|
||||
'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/theme.css';
|
||||
import { createI18n } from '@affine/i18n';
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
"@blocksuite/block-std": "0.13.0-canary-202403140735-2367cd5",
|
||||
"@blocksuite/blocks": "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/lit": "0.13.0-canary-202403140735-2367cd5",
|
||||
"@blocksuite/presets": "0.13.0-canary-202403140735-2367cd5",
|
||||
|
||||
@@ -228,7 +228,7 @@ __metadata:
|
||||
"@affine/i18n": "workspace:*"
|
||||
"@blocksuite/blocks": "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/presets": "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/blocks": "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/lit": "npm:0.13.0-canary-202403140735-2367cd5"
|
||||
"@blocksuite/presets": "npm:0.13.0-canary-202403140735-2367cd5"
|
||||
@@ -3530,16 +3530,6 @@ __metadata:
|
||||
languageName: node
|
||||
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":
|
||||
version: 2.1.46
|
||||
resolution: "@blocksuite/icons@npm:2.1.46"
|
||||
|
||||
Reference in New Issue
Block a user