mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-12 15:46:29 +08:00
feat(core): import progress & perf (#15197)
#### 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 -->
This commit is contained in:
@@ -9,7 +9,6 @@ export const RSPACK_SUPPORTED_PACKAGES = [
|
||||
'@affine/electron-renderer',
|
||||
'@affine/server',
|
||||
'@affine/reader',
|
||||
'@affine/media-capture-playground',
|
||||
] as const;
|
||||
|
||||
const rspackSupportedPackageSet = new Set<string>(RSPACK_SUPPORTED_PACKAGES);
|
||||
|
||||
+1
-31
@@ -194,41 +194,11 @@ function getRspackBundleConfigs(pkg: Package): MultiRspackOptions {
|
||||
}),
|
||||
] as MultiRspackOptions;
|
||||
}
|
||||
case '@affine/media-capture-playground': {
|
||||
return [
|
||||
createRspackHTMLTargetConfig(pkg, pkg.join('web/main.tsx').value, {
|
||||
template: pkg.join('web/index.html').value,
|
||||
additionalEntryForSelfhost: false,
|
||||
copySharedPublicAssets: false,
|
||||
injectGlobalErrorHandler: false,
|
||||
emitAssetsManifest: false,
|
||||
}),
|
||||
] as MultiRspackOptions;
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error(`Unsupported package: ${pkg.name}`);
|
||||
}
|
||||
|
||||
function getRspackDevServerConfig(
|
||||
pkg: Package
|
||||
): RspackDevServerConfiguration | undefined {
|
||||
if (pkg.name !== '@affine/media-capture-playground') {
|
||||
return;
|
||||
}
|
||||
|
||||
return {
|
||||
proxy: [
|
||||
{
|
||||
context: '/api',
|
||||
target: 'http://localhost:6544',
|
||||
changeOrigin: true,
|
||||
pathRewrite: { '^/api': '' },
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
export class BundleCommand extends PackageCommand {
|
||||
static override paths = [['bundle'], ['pack'], ['bun']];
|
||||
|
||||
@@ -244,7 +214,7 @@ export class BundleCommand extends PackageCommand {
|
||||
const pkg = this.workspace.getPackage(this.package);
|
||||
|
||||
if (this.dev) {
|
||||
await BundleCommand.dev(pkg, getRspackDevServerConfig(pkg));
|
||||
await BundleCommand.dev(pkg);
|
||||
} else {
|
||||
await BundleCommand.build(pkg);
|
||||
}
|
||||
|
||||
@@ -78,9 +78,7 @@ export function createHTMLTargetConfig(
|
||||
): RspackConfiguration {
|
||||
entry = typeof entry === 'string' ? { index: entry } : entry;
|
||||
const tailwindConfigPath = pkg.join('tailwind.config.js');
|
||||
const hasTailwind =
|
||||
tailwindConfigPath.exists() ||
|
||||
pkg.name === '@affine/media-capture-playground';
|
||||
const hasTailwind = tailwindConfigPath.exists();
|
||||
const tailwindPlugin = tailwindConfigPath.exists()
|
||||
? ['@tailwindcss/postcss', require(tailwindConfigPath.value)]
|
||||
: ['@tailwindcss/postcss'];
|
||||
|
||||
Reference in New Issue
Block a user