Skip to content

Commit 12c52a8

Browse files
authored
feat: always unpack native node files (#8392)
1 parent 9dc0b49 commit 12c52a8

3 files changed

Lines changed: 61 additions & 2 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"app-builder-lib": patch
3+
---
4+
5+
Automatically place .node files into app.asar.unpack

packages/app-builder-lib/src/asar/unpackDetector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function addValue(map: Map<string, Array<string>>, key: string, value: string) {
1818
}
1919

2020
export function isLibOrExe(file: string): boolean {
21-
return file.endsWith(".dll") || file.endsWith(".exe") || file.endsWith(".dylib") || file.endsWith(".so")
21+
return file.endsWith(".dll") || file.endsWith(".exe") || file.endsWith(".dylib") || file.endsWith(".so") || file.endsWith(".node")
2222
}
2323

2424
/** @internal */

test/snapshots/BuildTest.js.snap

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,30 +907,36 @@ Object {
907907
"files": Object {
908908
"LICENSE.md": Object {
909909
"size": "<size>",
910+
"unpacked": true,
910911
},
911912
"build": Object {
912913
"files": Object {
913914
"Release": Object {
914915
"files": Object {
915916
"keytar.node": Object {
916-
"executable": true,
917917
"size": "<size>",
918+
"unpacked": true,
918919
},
919920
},
921+
"unpacked": true,
920922
},
921923
},
922924
},
923925
"lib": Object {
924926
"files": Object {
925927
"keytar.js": Object {
926928
"size": "<size>",
929+
"unpacked": true,
927930
},
928931
},
932+
"unpacked": true,
929933
},
930934
"package.json": Object {
931935
"size": "<size>",
936+
"unpacked": true,
932937
},
933938
},
939+
"unpacked": true,
934940
},
935941
"mimic-response": Object {
936942
"files": Object {
@@ -4853,6 +4859,54 @@ Object {
48534859
exports[`posix smart unpack 4`] = `
48544860
Array [
48554861
"app.asar",
4862+
"app.asar.unpacked/node_modules/keytar/LICENSE.md",
4863+
Object {
4864+
"content": "{
4865+
\\"main\\": \\"./lib/keytar.js\\",
4866+
\\"typings\\": \\"keytar.d.ts\\",
4867+
\\"name\\": \\"keytar\\",
4868+
\\"description\\": \\"Bindings to native Mac/Linux/Windows password APIs\\",
4869+
\\"version\\": \\"7.9.0\\",
4870+
\\"license\\": \\"MIT\\",
4871+
\\"repository\\": {
4872+
\\"type\\": \\"git\\",
4873+
\\"url\\": \\"https://github.com/atom/node-keytar.git\\"
4874+
},
4875+
\\"homepage\\": \\"http://atom.github.io/node-keytar\\",
4876+
\\"files\\": [
4877+
\\"lib\\",
4878+
\\"src\\",
4879+
\\"binding.gyp\\",
4880+
\\"keytar.d.ts\\"
4881+
],
4882+
\\"types\\": \\"./keytar.d.ts\\",
4883+
\\"devDependencies\\": {
4884+
\\"babel-core\\": \\"^6.26.3\\",
4885+
\\"babel-plugin-transform-async-to-generator\\": \\"^6.24.1\\",
4886+
\\"chai\\": \\"^4.2.0\\",
4887+
\\"mocha\\": \\"^9.2.0\\",
4888+
\\"node-cpplint\\": \\"~0.4.0\\",
4889+
\\"node-gyp\\": \\"^8.4.1\\",
4890+
\\"prebuild\\": \\"^11.0.2\\"
4891+
},
4892+
\\"dependencies\\": {
4893+
\\"node-addon-api\\": \\"^4.3.0\\",
4894+
\\"prebuild-install\\": \\"^7.0.1\\"
4895+
},
4896+
\\"binary\\": {
4897+
\\"napi_versions\\": [
4898+
3
4899+
]
4900+
},
4901+
\\"config\\": {
4902+
\\"runtime\\": \\"napi\\",
4903+
\\"target\\": 3
4904+
}
4905+
}",
4906+
"name": "app.asar.unpacked/node_modules/keytar/package.json",
4907+
},
4908+
"app.asar.unpacked/node_modules/keytar/lib/keytar.js",
4909+
"app.asar.unpacked/node_modules/keytar/build/Release/keytar.node",
48564910
]
48574911
`;
48584912

0 commit comments

Comments
 (0)