mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-09 13:15:51 +08:00
8d72e4dc29
#### PR Dependency Tree * **PR #15197** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a new import pipeline with “plan then commit” batch handling for Markdown, Notion HTML, Obsidian, and Bear backups. * Enabled native import sessions with progress, cancellation, and batch-by-batch committing (including assets, folders, icons, and tags). * Added web preflight limits for ZIP and multi-file imports. * **Bug Fixes** * Improved import error/warning reporting and continued processing when some items fail. * Strengthened snapshot-based file/directory picking to preserve paths. * **Chores** * Updated project packaging/configuration for the new import workflow. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
73 lines
1.8 KiB
TypeScript
73 lines
1.8 KiB
TypeScript
import type { Configuration as RspackDevServerConfiguration } from '@rspack/dev-server';
|
|
|
|
export const RSPACK_SUPPORTED_PACKAGES = [
|
|
'@affine/admin',
|
|
'@affine/web',
|
|
'@affine/mobile',
|
|
'@affine/ios',
|
|
'@affine/android',
|
|
'@affine/electron-renderer',
|
|
'@affine/server',
|
|
'@affine/reader',
|
|
] as const;
|
|
|
|
const rspackSupportedPackageSet = new Set<string>(RSPACK_SUPPORTED_PACKAGES);
|
|
|
|
export function isRspackSupportedPackageName(name: string) {
|
|
return rspackSupportedPackageSet.has(name);
|
|
}
|
|
|
|
export function assertRspackSupportedPackageName(name: string) {
|
|
if (isRspackSupportedPackageName(name)) {
|
|
return;
|
|
}
|
|
|
|
throw new Error(
|
|
`Rspack bundling currently supports: ${Array.from(RSPACK_SUPPORTED_PACKAGES).join(', ')}. Unsupported package: ${name}.`
|
|
);
|
|
}
|
|
|
|
export const DEFAULT_DEV_SERVER_CONFIG: RspackDevServerConfiguration = {
|
|
host: '0.0.0.0',
|
|
allowedHosts: 'all',
|
|
hot: false,
|
|
liveReload: true,
|
|
compress: !process.env.CI,
|
|
setupExitSignals: true,
|
|
client: {
|
|
overlay: process.env.DISABLE_DEV_OVERLAY === 'true' ? false : undefined,
|
|
logging: process.env.CI ? 'none' : 'error',
|
|
// see: https://webpack.js.org/configuration/dev-server/#websocketurl
|
|
// must be an explicit ws/wss URL because custom protocols (e.g. assets://)
|
|
// cannot be used to construct WebSocket endpoints in Electron
|
|
webSocketURL: 'ws://0.0.0.0:8080/ws',
|
|
},
|
|
historyApiFallback: {
|
|
rewrites: [
|
|
{
|
|
from: /.*/,
|
|
to: () => {
|
|
return process.env.SELF_HOSTED === 'true'
|
|
? '/selfhost.html'
|
|
: '/index.html';
|
|
},
|
|
},
|
|
],
|
|
},
|
|
proxy: [
|
|
{
|
|
context: '/api',
|
|
target: 'http://localhost:3010',
|
|
},
|
|
{
|
|
context: '/socket.io',
|
|
target: 'http://localhost:3010',
|
|
ws: true,
|
|
},
|
|
{
|
|
context: '/graphql',
|
|
target: 'http://localhost:3010',
|
|
},
|
|
],
|
|
};
|