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
+2 -2
View File
@@ -19,7 +19,7 @@
"@aws-sdk/client-s3": "^3.709.0",
"@clack/core": "^0.4.0",
"@clack/prompts": "^0.10.0",
"@napi-rs/simple-git": "^0.1.19",
"@napi-rs/simple-git": "^0.1.22",
"@perfsee/webpack": "^1.13.0",
"@sentry/webpack-plugin": "^3.0.0",
"@swc/core": "^1.10.1",
@@ -49,7 +49,7 @@
"ts-node": "^10.9.2",
"typanion": "^3.14.0",
"typescript": "^5.5.4",
"webpack": "^5.97.1",
"webpack": "^5.102.1",
"webpack-dev-server": "^5.2.0",
"webpack-merge": "^6.0.1"
},
+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),