diff --git a/App/frontend/desktop/src/pages/tests/app-frame.test.tsx b/App/frontend/desktop/src/pages/tests/app-frame.test.tsx index 3b15c7c3..a3a48785 100644 --- a/App/frontend/desktop/src/pages/tests/app-frame.test.tsx +++ b/App/frontend/desktop/src/pages/tests/app-frame.test.tsx @@ -237,7 +237,7 @@ describe("AppFrame", () => { it("positions the task action menu as a top-level viewport overlay", () => { const overlayStyle = resolveSidebarMenuOverlayStyle( - { right: 188, bottom: 424 }, + { left: 196, right: 188, bottom: 424 }, { width: 512, height: 768 }, { width: 128, height: 128, margin: 8, gap: 4 } ); @@ -720,6 +720,7 @@ describe("AppFrame", () => { onPin={() => undefined} onRequestArchive={() => undefined} onConfirmArchive={() => undefined} + onCancelArchive={() => undefined} /> ); @@ -731,6 +732,7 @@ describe("AppFrame", () => { onPin={() => undefined} onRequestArchive={() => undefined} onConfirmArchive={() => undefined} + onCancelArchive={() => undefined} /> ); @@ -742,6 +744,7 @@ describe("AppFrame", () => { onPin={() => undefined} onRequestArchive={() => undefined} onConfirmArchive={() => undefined} + onCancelArchive={() => undefined} /> ); diff --git a/App/frontend/desktop/src/pages/tests/project-target-picker.interaction.test.tsx b/App/frontend/desktop/src/pages/tests/project-target-picker.interaction.test.tsx index 5e19f91b..0ed11569 100644 --- a/App/frontend/desktop/src/pages/tests/project-target-picker.interaction.test.tsx +++ b/App/frontend/desktop/src/pages/tests/project-target-picker.interaction.test.tsx @@ -242,7 +242,6 @@ function PickerHarness(props: { projects={projects} registryState={props.registryState ?? "ready"} disabled={false} - canChooseOtherFolder onToggle={() => setOpen((current) => !current)} onClose={() => setOpen(false)} onSelect={(nextTarget) => { diff --git a/App/shell/desktop/electron-builder.unsigned.yml b/App/shell/desktop/electron-builder.unsigned.yml index b3548319..5c26ab43 100644 --- a/App/shell/desktop/electron-builder.unsigned.yml +++ b/App/shell/desktop/electron-builder.unsigned.yml @@ -9,6 +9,10 @@ directories: files: - dist/**/* - package.json + - "!**/node_modules/**/{test,tests,__tests__,doc,docs,example,examples,coverage,.github}" + - "!**/node_modules/**/{test,tests,__tests__,doc,docs,example,examples,coverage,.github}/**/*" + - "!**/node_modules/**/*.{test,spec}.*" + - "!**/node_modules/**/{README,README*.md,README*.mdown,README*.markdown,README*.rst,README*.txt,CHANGELOG,CHANGELOG*.md,CHANGELOG*.mdown,CHANGELOG*.markdown,CHANGELOG*.rst,CHANGELOG*.txt,CONTRIBUTING,CONTRIBUTING*.md,CONTRIBUTING*.mdown,CONTRIBUTING*.markdown,CONTRIBUTING*.rst,CONTRIBUTING*.txt,CODE_OF_CONDUCT,CODE_OF_CONDUCT*.md,CODE_OF_CONDUCT*.mdown,CODE_OF_CONDUCT*.markdown,CODE_OF_CONDUCT*.rst,CODE_OF_CONDUCT*.txt,SECURITY,SECURITY*.md,SECURITY*.mdown,SECURITY*.markdown,SECURITY*.rst,SECURITY*.txt}" asar: true asarUnpack: diff --git a/App/shell/desktop/electron-builder.win.unsigned.yml b/App/shell/desktop/electron-builder.win.unsigned.yml index 7068fa33..3b57c929 100644 --- a/App/shell/desktop/electron-builder.win.unsigned.yml +++ b/App/shell/desktop/electron-builder.win.unsigned.yml @@ -9,6 +9,10 @@ directories: files: - dist/**/* - package.json + - "!**/node_modules/**/{test,tests,__tests__,doc,docs,example,examples,coverage,.github}" + - "!**/node_modules/**/{test,tests,__tests__,doc,docs,example,examples,coverage,.github}/**/*" + - "!**/node_modules/**/*.{test,spec}.*" + - "!**/node_modules/**/{README,README*.md,README*.mdown,README*.markdown,README*.rst,README*.txt,CHANGELOG,CHANGELOG*.md,CHANGELOG*.mdown,CHANGELOG*.markdown,CHANGELOG*.rst,CHANGELOG*.txt,CONTRIBUTING,CONTRIBUTING*.md,CONTRIBUTING*.mdown,CONTRIBUTING*.markdown,CONTRIBUTING*.rst,CONTRIBUTING*.txt,CODE_OF_CONDUCT,CODE_OF_CONDUCT*.md,CODE_OF_CONDUCT*.mdown,CODE_OF_CONDUCT*.markdown,CODE_OF_CONDUCT*.rst,CODE_OF_CONDUCT*.txt,SECURITY,SECURITY*.md,SECURITY*.mdown,SECURITY*.markdown,SECURITY*.rst,SECURITY*.txt}" asar: true asarUnpack: diff --git a/App/shell/desktop/electron-builder.win.yml b/App/shell/desktop/electron-builder.win.yml index 751a617c..453e1d5e 100644 --- a/App/shell/desktop/electron-builder.win.yml +++ b/App/shell/desktop/electron-builder.win.yml @@ -9,6 +9,10 @@ directories: files: - dist/**/* - package.json + - "!**/node_modules/**/{test,tests,__tests__,doc,docs,example,examples,coverage,.github}" + - "!**/node_modules/**/{test,tests,__tests__,doc,docs,example,examples,coverage,.github}/**/*" + - "!**/node_modules/**/*.{test,spec}.*" + - "!**/node_modules/**/{README,README*.md,README*.mdown,README*.markdown,README*.rst,README*.txt,CHANGELOG,CHANGELOG*.md,CHANGELOG*.mdown,CHANGELOG*.markdown,CHANGELOG*.rst,CHANGELOG*.txt,CONTRIBUTING,CONTRIBUTING*.md,CONTRIBUTING*.mdown,CONTRIBUTING*.markdown,CONTRIBUTING*.rst,CONTRIBUTING*.txt,CODE_OF_CONDUCT,CODE_OF_CONDUCT*.md,CODE_OF_CONDUCT*.mdown,CODE_OF_CONDUCT*.markdown,CODE_OF_CONDUCT*.rst,CODE_OF_CONDUCT*.txt,SECURITY,SECURITY*.md,SECURITY*.mdown,SECURITY*.markdown,SECURITY*.rst,SECURITY*.txt}" asar: true asarUnpack: diff --git a/App/shell/desktop/electron-builder.yml b/App/shell/desktop/electron-builder.yml index 983d4eed..ca761e1f 100644 --- a/App/shell/desktop/electron-builder.yml +++ b/App/shell/desktop/electron-builder.yml @@ -9,6 +9,10 @@ directories: files: - dist/**/* - package.json + - "!**/node_modules/**/{test,tests,__tests__,doc,docs,example,examples,coverage,.github}" + - "!**/node_modules/**/{test,tests,__tests__,doc,docs,example,examples,coverage,.github}/**/*" + - "!**/node_modules/**/*.{test,spec}.*" + - "!**/node_modules/**/{README,README*.md,README*.mdown,README*.markdown,README*.rst,README*.txt,CHANGELOG,CHANGELOG*.md,CHANGELOG*.mdown,CHANGELOG*.markdown,CHANGELOG*.rst,CHANGELOG*.txt,CONTRIBUTING,CONTRIBUTING*.md,CONTRIBUTING*.mdown,CONTRIBUTING*.markdown,CONTRIBUTING*.rst,CONTRIBUTING*.txt,CODE_OF_CONDUCT,CODE_OF_CONDUCT*.md,CODE_OF_CONDUCT*.mdown,CODE_OF_CONDUCT*.markdown,CODE_OF_CONDUCT*.rst,CODE_OF_CONDUCT*.txt,SECURITY,SECURITY*.md,SECURITY*.mdown,SECURITY*.markdown,SECURITY*.rst,SECURITY*.txt}" asar: true asarUnpack: diff --git a/App/shell/desktop/tests/packaged-runtime-boundary.test.ts b/App/shell/desktop/tests/packaged-runtime-boundary.test.ts index 255d54b5..d5bc8e9b 100644 --- a/App/shell/desktop/tests/packaged-runtime-boundary.test.ts +++ b/App/shell/desktop/tests/packaged-runtime-boundary.test.ts @@ -234,6 +234,29 @@ describe("desktop packaged runtime boundaries", () => { } }); + it("excludes dependency tests and docs from every desktop app archive", () => { + for (const configPath of [ + electronBuilderPath, + unsignedElectronBuilderPath, + winElectronBuilderPath, + winUnsignedBuilderPath + ]) { + const config = parseYaml(readFileSync(configPath, "utf8")) as { + files?: string[]; + }; + const files = config.files ?? []; + + expect(files).toContain("dist/**/*"); + expect(files).toContain("!**/node_modules/**/{test,tests,__tests__,doc,docs,example,examples,coverage,.github}"); + expect(files).toContain("!**/node_modules/**/{test,tests,__tests__,doc,docs,example,examples,coverage,.github}/**/*"); + expect(files).toContain("!**/node_modules/**/*.{test,spec}.*"); + expect(files).toContain( + "!**/node_modules/**/{README,README*.md,README*.mdown,README*.markdown,README*.rst,README*.txt,CHANGELOG,CHANGELOG*.md,CHANGELOG*.mdown,CHANGELOG*.markdown,CHANGELOG*.rst,CHANGELOG*.txt,CONTRIBUTING,CONTRIBUTING*.md,CONTRIBUTING*.mdown,CONTRIBUTING*.markdown,CONTRIBUTING*.rst,CONTRIBUTING*.txt,CODE_OF_CONDUCT,CODE_OF_CONDUCT*.md,CODE_OF_CONDUCT*.mdown,CODE_OF_CONDUCT*.markdown,CODE_OF_CONDUCT*.rst,CODE_OF_CONDUCT*.txt,SECURITY,SECURITY*.md,SECURITY*.mdown,SECURITY*.markdown,SECURITY*.rst,SECURITY*.txt}" + ); + expect(files).not.toContain("!**/node_modules/**/*.md"); + } + }); + it("unpacks the sqlite-vec native extension in every desktop package variant", () => { for (const configPath of [ electronBuilderPath, @@ -1019,6 +1042,29 @@ describe("desktop packaged runtime boundaries", () => { expect(winSource).toContain("sqlite-vec-windows-x64/vec0.*"); }); + it("prunes third-party package docs and tests from macOS runtime before packaging", () => { + const source = readFileSync(packageMacDmgPath, "utf8"); + + expect(source).toContain("prune_node_modules_non_runtime_files"); + expect(source).toContain('prune_node_modules_non_runtime_files "$RUNTIME_DIR"'); + expect(source).toContain("-name tests"); + expect(source).toContain("-name docs"); + expect(source).toContain('-iname "README*.md"'); + expect(source).toContain('-iname "README*.mdown"'); + expect(source).toContain('-iname "CHANGELOG*.md"'); + expect(source).toContain('-iname "SECURITY*.md"'); + expect(source).toContain('-iname "*.test.js"'); + expect(source).toContain('-iname "*.test.ts"'); + expect(source).toContain('! \\( \\'); + expect(source).toContain('-iname "LICENSE*"'); + expect(source).toContain('-iname "NOTICE*"'); + expect(source).toContain('rm -f "$RUNTIME_DIR/memmy-agent/dist/skills/README.md"'); + + expect(source.indexOf('prune_node_modules_non_runtime_files "$RUNTIME_DIR"')).toBeLessThan( + source.indexOf("npx electron-builder"), + ); + }); + it("sets an explicit edition in macOS package wrappers", () => { for (const [name, accountChannel, edition] of [ ["cn-unsigned", "phone", "cn"], diff --git a/scripts/internal/package-mac-dmg.sh b/scripts/internal/package-mac-dmg.sh index d595e49b..82dbc546 100755 --- a/scripts/internal/package-mac-dmg.sh +++ b/scripts/internal/package-mac-dmg.sh @@ -431,6 +431,97 @@ prune_onnxruntime_native_artifacts() { esac } +prune_node_modules_non_runtime_files() { + local runtime_root="$1" + + if [ ! -d "$runtime_root" ]; then + return + fi + + local modules_dir + while IFS= read -r modules_dir; do + if [ ! -d "$modules_dir" ]; then + continue + fi + + local disposable_list + disposable_list="$(mktemp)" + find "$modules_dir" -depth -type d \( \ + -name test -o \ + -name tests -o \ + -name __tests__ -o \ + -name doc -o \ + -name docs -o \ + -name example -o \ + -name examples -o \ + -name coverage -o \ + -name .github \ + \) > "$disposable_list" + + local disposable_dir + while IFS= read -r disposable_dir; do + rm -rf "$disposable_dir" + done < "$disposable_list" + rm -f "$disposable_list" + + if [ ! -d "$modules_dir" ]; then + continue + fi + + find "$modules_dir" -type f \( \ + -iname "README" -o \ + -iname "README*.md" -o \ + -iname "README*.mdown" -o \ + -iname "README*.markdown" -o \ + -iname "README*.rst" -o \ + -iname "README*.txt" -o \ + -iname "CHANGELOG" -o \ + -iname "CHANGELOG*.md" -o \ + -iname "CHANGELOG*.mdown" -o \ + -iname "CHANGELOG*.markdown" -o \ + -iname "CHANGELOG*.rst" -o \ + -iname "CHANGELOG*.txt" -o \ + -iname "CONTRIBUTING" -o \ + -iname "CONTRIBUTING*.md" -o \ + -iname "CONTRIBUTING*.mdown" -o \ + -iname "CONTRIBUTING*.markdown" -o \ + -iname "CONTRIBUTING*.rst" -o \ + -iname "CONTRIBUTING*.txt" -o \ + -iname "CODE_OF_CONDUCT" -o \ + -iname "CODE_OF_CONDUCT*.md" -o \ + -iname "CODE_OF_CONDUCT*.mdown" -o \ + -iname "CODE_OF_CONDUCT*.markdown" -o \ + -iname "CODE_OF_CONDUCT*.rst" -o \ + -iname "CODE_OF_CONDUCT*.txt" -o \ + -iname "SECURITY" -o \ + -iname "SECURITY*.md" -o \ + -iname "SECURITY*.mdown" -o \ + -iname "SECURITY*.markdown" -o \ + -iname "SECURITY*.rst" -o \ + -iname "SECURITY*.txt" \ + \) ! \( \ + -iname "LICENSE*" -o \ + -iname "NOTICE*" -o \ + -iname "COPYING*" \ + \) -delete + + find "$modules_dir" -type f \( \ + -iname "*.test.js" -o \ + -iname "*.test.cjs" -o \ + -iname "*.test.mjs" -o \ + -iname "*.test.ts" -o \ + -iname "*.test.tsx" -o \ + -iname "*.spec.js" -o \ + -iname "*.spec.cjs" -o \ + -iname "*.spec.mjs" -o \ + -iname "*.spec.ts" -o \ + -iname "*.spec.tsx" -o \ + -iname "test.js" -o \ + -iname "tests.json" \ + \) -delete + done < <(find "$runtime_root" -type d -name node_modules) +} + require_packaged_runtime_file() { local required_file="$1" @@ -502,6 +593,8 @@ prune_mac_runtime_artifacts() { echo "Pruning macOS runtime artifacts for darwin-$target_cpu." find "$RUNTIME_DIR" -type f -name "*.map" -delete + prune_node_modules_non_runtime_files "$RUNTIME_DIR" + rm -f "$RUNTIME_DIR/memmy-agent/dist/skills/README.md" while IFS= read -r module_dir; do prune_better_sqlite3_build_artifacts "$module_dir"