chore: bump electron (#13935)

fix #13647

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Release Notes

* **Chores**
* Updated development tooling and build dependencies to latest stable
versions
  * Increased minimum Node.js requirement to version 22
  * Updated macOS deployment target to version 11.6
  * Enhanced type safety and error handling in build processes
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
DarkSky
2025-11-15 15:52:04 +08:00
committed by GitHub
parent 17ec76540b
commit 46e7d9fab7
11 changed files with 722 additions and 428 deletions
+15 -7
View File
@@ -39,10 +39,12 @@ function getBaseWorkerConfigs(pkg: Package) {
];
}
function getBundleConfigs(pkg: Package) {
function getBundleConfigs(pkg: Package): webpack.MultiConfiguration {
switch (pkg.name) {
case '@affine/admin': {
return [createHTMLTargetConfig(pkg, pkg.srcPath.join('index.tsx').value)];
return [
createHTMLTargetConfig(pkg, pkg.srcPath.join('index.tsx').value),
] as webpack.MultiConfiguration;
}
case '@affine/web':
case '@affine/mobile':
@@ -64,7 +66,7 @@ function getBundleConfigs(pkg: Package) {
workerConfigs.map(config => config.name)
),
...workerConfigs,
];
] as webpack.MultiConfiguration;
}
case '@affine/electron-renderer': {
const workerConfigs = getBaseWorkerConfigs(pkg);
@@ -87,10 +89,12 @@ function getBundleConfigs(pkg: Package) {
workerConfigs.map(config => config.name)
),
...workerConfigs,
];
] as webpack.MultiConfiguration;
}
case '@affine/server': {
return [createNodeTargetConfig(pkg, pkg.srcPath.join('index.ts').value)];
return [
createNodeTargetConfig(pkg, pkg.srcPath.join('index.ts').value),
] as webpack.MultiConfiguration;
}
}
@@ -174,10 +178,12 @@ export class BundleCommand extends PackageCommand {
rmSync(pkg.distPath.value, { recursive: true, force: true });
const config = getBundleConfigs(pkg);
// @ts-expect-error allow
config.parallelism = cpus().length;
const compiler = webpack(config);
if (!compiler) {
throw new Error('Failed to create webpack compiler');
}
compiler.run((error, stats) => {
if (error) {
@@ -201,10 +207,12 @@ export class BundleCommand extends PackageCommand {
logger.info(`Starting dev server for ${pkg.name}...`);
const config = getBundleConfigs(pkg);
// @ts-expect-error allow
config.parallelism = cpus().length;
const compiler = webpack(config);
if (!compiler) {
throw new Error('Failed to create webpack compiler');
}
const devServer = new WebpackDevServer(
merge({}, defaultDevServerConfig, devServerConfig),