From adbb269dc1d98b1ed2e56edda2b4a1b784e70a41 Mon Sep 17 00:00:00 2001 From: Merge Sim Date: Sun, 6 Sep 2026 00:56:27 -0700 Subject: [PATCH] test(packaging): cover spaced runtime imports --- config/packaged-runtime-node-modules.cjs | 2 +- config/scripts/electron-builder-runtime-resources.test.mjs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/packaged-runtime-node-modules.cjs b/config/packaged-runtime-node-modules.cjs index e42357f69d1..9b4a84df54c 100644 --- a/config/packaged-runtime-node-modules.cjs +++ b/config/packaged-runtime-node-modules.cjs @@ -238,7 +238,7 @@ function verifyPackagedMainRuntimeDeps(resourcesDir, asar = require('@electron/a // backslashes, and extractFile expects that same host-style path. const internalPath = entry.replace(/^[\\/]+/, '') const source = asar.extractFile(asarPath, internalPath).toString('utf8') - for (const match of source.matchAll(/\b(?:require|import)\(\s*(["'`])([^"'`$]+)\1\s*\)/g)) { + for (const match of source.matchAll(/\b(?:require|import)\s*\(\s*(["'`])([^"'`$]+)\1\s*\)/g)) { const specifier = match[2] if (!isPackagedExternalSpecifier(specifier)) { continue diff --git a/config/scripts/electron-builder-runtime-resources.test.mjs b/config/scripts/electron-builder-runtime-resources.test.mjs index 4204e49804f..f60feb22fed 100644 --- a/config/scripts/electron-builder-runtime-resources.test.mjs +++ b/config/scripts/electron-builder-runtime-resources.test.mjs @@ -50,7 +50,7 @@ describe('packaged runtime resources', () => { await writeFile(join(resourcesDir, 'app.asar'), '', 'utf8') const sources = new Map([ - ['out/main/index.js', 'import(`@anthropic-ai/claude-agent-sdk`)'], + ['out/main/index.js', 'import (`@anthropic-ai/claude-agent-sdk`)'], ['out/main/agent-hooks/managed-agent-hook-controls.js', ''] ]) const asar = {