Compare commits

...
6 changed files with 101 additions and 10 deletions

No files matched your search

+45 -2
View File
@@ -69,8 +69,19 @@ module.exports = {
'dist/**/*',
'electron/**/*',
// The Windows Hello helper is shipped once through win.extraResources.
// Exclude local per-arch build output from app.asar on every platform.
// Exclude both its C++ source and local per-arch build output from app.asar.
'!electron/bridges/windowsHelloHelper/build/**/*',
'!electron/bridges/windowsHelloHelper/NetcattyWindowsHello.cpp',
// Packaged builds always run `prebuild` -> `build:preload`, producing
// `electron/preload.bundle.cjs` (preferred by preloadPath.cjs). Keep
// the unbundled preload sources out of app.asar.
'!electron/preload.cjs',
'!electron/preload/**/*',
// Build-time macOS entitlements plist, dev launcher, and internal docs
// are not runtime app files.
'!electron/entitlements.mac.plist',
'!electron/launch.cjs',
'!electron/plugins/distribution/README.md',
// Test fixtures, test-only helpers, and dev/CI schema snapshots are not
// runtime resources. Keep them out of production ASARs (including plugin
// smoke fixtures so no example plugin can be mistaken for an installed package).
@@ -178,6 +189,15 @@ module.exports = {
// web-streams-polyfill is only a Node < 16.5 fallback inside fetch-blob;
// Netcatty requires Node >= 22 / Electron 42 with native Web Streams.
'!node_modules/web-streams-polyfill/**/*',
// tar-stream and events-universal declare bare-* packages only for the
// Holepunch/Bare runtime ("bare" import/export condition). Node/Electron
// always resolves default Node.js built-ins and never loads bare-* or
// their cross-platform iOS/Android/desktop .bare prebuilds.
'!node_modules/bare-fs/**/*',
'!node_modules/bare-url/**/*',
'!node_modules/bare-path/**/*',
'!node_modules/bare-events/**/*',
'!node_modules/bare-stream/**/*',
// Main process only CJS-requires css-tree (cjs/index.cjs) and mdn-data's
// css/{at-rules,properties,syntaxes}.json; skip browser/ESM/l10n/schema copies.
'!node_modules/css-tree/dist/**/*',
@@ -229,6 +249,15 @@ module.exports = {
// per-platform prebuilds); netcatty uses the user's copilot via cliPath,
// so it is excluded entirely.
'!**/@anthropic-ai/claude-agent-sdk-*/**/*',
// claudeDriver.cjs only imports the default "@anthropic-ai/claude-agent-sdk"
// entrypoint (sdk.mjs). Exclude unused sibling entrypoints and manifests
// while keeping sdk.mjs, LICENSE.md, and README.md.
'!node_modules/@anthropic-ai/claude-agent-sdk/assistant.mjs',
'!node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs',
'!node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js',
'!node_modules/@anthropic-ai/claude-agent-sdk/extractFromBunfs.js',
'!node_modules/@anthropic-ai/claude-agent-sdk/manifest.json',
'!node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json',
'!node_modules/@anthropic-ai/claude-code-*/**/*',
'!node_modules/@openai/codex-{darwin,linux,linuxmusl,win32}-*/**/*',
'!node_modules/@github/copilot-{darwin,linux,linuxmusl,win32}-*/**/*',
@@ -246,8 +275,22 @@ module.exports = {
'!node_modules/@cursor/sdk/dist/**/*.d.ts',
'!node_modules/@cursor/sdk/dist/**/*.d.ts.map',
// sqlite3 rebuilds a native module for Electron; its upstream source
// tarball is build-time payload only.
// tarball, C++ sources, and install-only prebuild-install/tar helpers
// are not needed at runtime (sqlite3-binding.js only requires bindings).
'!node_modules/sqlite3/deps/**/*',
'!node_modules/sqlite3/src/**/*',
'!node_modules/prebuild-install/**/*',
'!node_modules/tar/**/*',
// Native module C/C++ sources, build scripts, and node-pty's third_party
// ConPTY staging copies are build-time only; runtime loads compiled
// binaries from build/Release or prebuilds.
'!node_modules/node-pty/third_party/**/*',
'!node_modules/node-pty/deps/**/*',
'!node_modules/node-pty/src/**/*',
'!node_modules/node-pty/scripts/**/*',
'!node_modules/node-pty/node-addon-api/**/*',
'!node_modules/node-pty/typings/**/*',
'!node_modules/@serialport/bindings-cpp/src/**/*',
// Native compilation helpers are needed during install/rebuild only.
// Match nested copies too; keep the actual native loaders and binaries.
'!node_modules/**/node-gyp/**/*',
+4
View File
@@ -10,6 +10,10 @@ export default [
files: ["examples/plugins/starter-netcatty/panel.js"],
languageOptions: { globals: globals.browser },
},
{
files: ["plugins/*/scripts/**/*.{js,mjs,cjs}"],
languageOptions: { globals: globals.node },
},
// The recommended preset has no file scope of its own, so scope it off all of
// electron/ — that main-process tree is historically unlinted. The bridges
// get a focused rule set in the dedicated block at the end of this config;
@@ -336,6 +336,8 @@ void electron.app
console.error("MONITOR_ELECTRON_SMOKE_FAILED:", error);
try {
fs.rmSync(userData, { recursive: true, force: true });
} catch {}
} catch {
// Best-effort temp dir cleanup on failure.
}
electron.app.exit(1);
});
@@ -318,6 +318,7 @@ export function computeAlertBadge(
const count = Math.min(999, active.length);
const criticalCount = active.filter((a) => a.severity === 'critical').length;
const tone: 'warning' | 'danger' = criticalCount > 0 ? 'danger' : 'warning';
// eslint-disable-next-line no-control-regex
const topMsg = (active[0]?.message ?? '').replace(/[\r\n\t\x00-\x1f\x7f]/g, ' ').trim();
const summary =
@@ -72,6 +72,11 @@ export function OverviewTab({
return { min, avg, max };
}, [points]);
const diskLayout = useMemo(
() => buildMonitorDiskListLayout(stats, showSystemDisks, thresholds.diskWarning),
[stats, showSystemDisks, thresholds.diskWarning],
);
if (isProbe) {
const probe = state?.probe;
return (
@@ -176,11 +181,6 @@ export function OverviewTab({
? Math.min(100, (stats.fdUsed / stats.fdMax) * 100)
: null;
const diskLayout = useMemo(
() => buildMonitorDiskListLayout(stats, showSystemDisks, thresholds.diskWarning),
[stats, showSystemDisks, thresholds.diskWarning],
);
const hasCpuBreakdown = points.some((p) => p.cpuUser != null || p.cpuSystem != null);
return (
+43 -2
View File
@@ -529,8 +529,31 @@ test("node_modules packaging exclusions prune unused payloads while preserving l
"node_modules/foo/CHANGELOG.md",
"node_modules/foo/HISTORY.md",
"node_modules/@anthropic-ai/sdk/README.md",
"node_modules/bare-url/prebuilds/ios-arm64/bare-url.bare",
"node_modules/bare-fs/index.js",
"node_modules/bare-path/index.js",
"node_modules/bare-events/index.js",
"node_modules/bare-stream/index.js",
"node_modules/@anthropic-ai/claude-agent-sdk/assistant.mjs",
"node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs",
"node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js",
"node_modules/@anthropic-ai/claude-agent-sdk/extractFromBunfs.js",
"node_modules/@anthropic-ai/claude-agent-sdk/manifest.json",
"node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json",
"node_modules/node-pty/third_party/conpty/1.23.251008001/win10-x64/OpenConsole.exe",
"node_modules/node-pty/deps/winpty/src/include/winpty.h",
"node_modules/node-pty/src/unix/pty.cc",
"node_modules/node-pty/scripts/post-install.js",
"node_modules/node-pty/node-addon-api/napi.h",
"node_modules/node-pty/typings/node-pty.d.ts",
"node_modules/@serialport/bindings-cpp/src/serialport.cpp",
"node_modules/sqlite3/src/database.cc",
"node_modules/prebuild-install/index.js",
"node_modules/tar/index.js",
]) {
assert.equal(nmMac(path.join(root, dropped), stat), false, `expected excluded: ${dropped}`);
for (const [label, filter] of [["mac", nmMac], ["win", nmWin], ["linux", nmLinux]]) {
assert.equal(filter(path.join(root, dropped), stat), false, `expected excluded (${label}): ${dropped}`);
}
}
for (const kept of [
@@ -548,9 +571,20 @@ test("node_modules packaging exclusions prune unused payloads while preserving l
"node_modules/foo/NOTICE.md",
// @anthropic-ai/claude-agent-sdk declares "license": "SEE LICENSE IN README.md"
"node_modules/@anthropic-ai/claude-agent-sdk/README.md",
"node_modules/@anthropic-ai/claude-agent-sdk/LICENSE.md",
"node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs",
"node_modules/tar-stream/index.js",
"node_modules/node-pty/lib/index.js",
"node_modules/node-pty/build/Release/pty.node",
"node_modules/node-pty/prebuilds/win32-x64/conpty/OpenConsole.exe",
"node_modules/@serialport/bindings-cpp/dist/index.js",
"node_modules/@serialport/bindings-cpp/build/Release/bindings.node",
"node_modules/sqlite3/lib/sqlite3.js",
"node_modules/sqlite3/build/Release/node_sqlite3.node",
]) {
assert.equal(nmMac(path.join(root, kept), stat), true, `expected preserved: ${kept}`);
for (const [label, filter] of [["mac", nmMac], ["win", nmWin], ["linux", nmLinux]]) {
assert.equal(filter(path.join(root, kept), stat), true, `expected preserved (${label}): ${kept}`);
}
}
// Platform-scoped @vscode/windows-process-tree exclusion
@@ -591,6 +625,12 @@ test("app file exclusions prune dev schemas, test helpers/fixtures, svg sources,
"electron/bridges/cliDiscoveryTestIsolation.cjs",
"electron/bridges/sshBridge/serverStatsTestHelpers.cjs",
"electron/bridges/terminalBridge.moshConpty.integration.cjs",
"electron/bridges/windowsHelloHelper/NetcattyWindowsHello.cpp",
"electron/preload.cjs",
"electron/preload/api.cjs",
"electron/entitlements.mac.plist",
"electron/launch.cjs",
"electron/plugins/distribution/README.md",
"dist/icon.svg",
"dist/tray-iconTemplate.svg",
]) {
@@ -599,6 +639,7 @@ test("app file exclusions prune dev schemas, test helpers/fixtures, svg sources,
assert.equal(macFilter(path.join(root, "dist/index.html"), stat), true);
assert.equal(macFilter(path.join(root, "electron/main.cjs"), stat), true);
assert.equal(macFilter(path.join(root, "electron/preload.bundle.cjs"), stat), true);
const macosVariantIcon = path.join(root, "dist/icons/variants/macos/icon.png");
assert.equal(macFilter(macosVariantIcon, stat), true);