app-builder-lib 26.3.6 → 26.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/out/asar/asarUtil.js +105 -73
  2. package/out/asar/asarUtil.js.map +1 -1
  3. package/out/macPackager.js +4 -0
  4. package/out/macPackager.js.map +1 -1
  5. package/out/node-module-collector/bunNodeModulesCollector.d.ts +4 -5
  6. package/out/node-module-collector/bunNodeModulesCollector.js +5 -9
  7. package/out/node-module-collector/bunNodeModulesCollector.js.map +1 -1
  8. package/out/node-module-collector/index.d.ts +5 -4
  9. package/out/node-module-collector/index.js +7 -4
  10. package/out/node-module-collector/index.js.map +1 -1
  11. package/out/node-module-collector/moduleManager.d.ts +52 -0
  12. package/out/node-module-collector/moduleManager.js +227 -0
  13. package/out/node-module-collector/moduleManager.js.map +1 -0
  14. package/out/node-module-collector/nodeModulesCollector.d.ts +11 -25
  15. package/out/node-module-collector/nodeModulesCollector.js +17 -180
  16. package/out/node-module-collector/nodeModulesCollector.js.map +1 -1
  17. package/out/node-module-collector/npmNodeModulesCollector.d.ts +3 -9
  18. package/out/node-module-collector/npmNodeModulesCollector.js +14 -85
  19. package/out/node-module-collector/npmNodeModulesCollector.js.map +1 -1
  20. package/out/node-module-collector/packageManager.d.ts +2 -1
  21. package/out/node-module-collector/packageManager.js +2 -0
  22. package/out/node-module-collector/packageManager.js.map +1 -1
  23. package/out/node-module-collector/pnpmNodeModulesCollector.d.ts +0 -1
  24. package/out/node-module-collector/pnpmNodeModulesCollector.js +21 -54
  25. package/out/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
  26. package/out/node-module-collector/traversalNodeModulesCollector.d.ts +19 -0
  27. package/out/node-module-collector/traversalNodeModulesCollector.js +122 -0
  28. package/out/node-module-collector/traversalNodeModulesCollector.js.map +1 -0
  29. package/out/node-module-collector/types.d.ts +5 -10
  30. package/out/node-module-collector/types.js.map +1 -1
  31. package/out/node-module-collector/yarnBerryNodeModulesCollector.js +3 -3
  32. package/out/node-module-collector/yarnBerryNodeModulesCollector.js.map +1 -1
  33. package/out/node-module-collector/yarnNodeModulesCollector.d.ts +1 -2
  34. package/out/node-module-collector/yarnNodeModulesCollector.js +4 -32
  35. package/out/node-module-collector/yarnNodeModulesCollector.js.map +1 -1
  36. package/out/publish/PublishManager.d.ts +3 -10
  37. package/out/publish/PublishManager.js +8 -6
  38. package/out/publish/PublishManager.js.map +1 -1
  39. package/out/targets/AppImageTarget.js +1 -1
  40. package/out/targets/AppImageTarget.js.map +1 -1
  41. package/out/targets/FpmTarget.js +2 -2
  42. package/out/targets/FpmTarget.js.map +1 -1
  43. package/out/util/appFileCopier.js +17 -13
  44. package/out/util/appFileCopier.js.map +1 -1
  45. package/out/util/normalizePackageData.js +6 -4
  46. package/out/util/normalizePackageData.js.map +1 -1
  47. package/out/util/pathManager.d.ts +1 -0
  48. package/out/util/pathManager.js +10 -0
  49. package/out/util/pathManager.js.map +1 -1
  50. package/out/version.d.ts +1 -1
  51. package/out/version.js +1 -1
  52. package/out/version.js.map +1 -1
  53. package/out/winPackager.d.ts +2 -0
  54. package/out/winPackager.js +7 -1
  55. package/out/winPackager.js.map +1 -1
  56. package/package.json +7 -7
  57. package/out/node-module-collector/moduleCache.d.ts +0 -27
  58. package/out/node-module-collector/moduleCache.js +0 -57
  59. package/out/node-module-collector/moduleCache.js.map +0 -1
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ModuleCache = void 0;
4
- const builder_util_1 = require("builder-util");
5
- const fs = require("fs-extra");
6
- const path_1 = require("path");
7
- class ModuleCache {
8
- constructor() {
9
- this.packageJsonMap = new Map();
10
- this.realPathMap = new Map();
11
- this.existsMap = new Map();
12
- this.lstatMap = new Map();
13
- this.requireResolveMap = new Map();
14
- this.packageJson = this.createAsyncProxy(this.packageJsonMap, (path) => fs.readJson(path));
15
- this.exists = this.createAsyncProxy(this.existsMap, (path) => (0, builder_util_1.exists)(path));
16
- this.lstat = this.createAsyncProxy(this.lstatMap, (path) => fs.lstat(path));
17
- this.requireResolve = this.createAsyncProxy(this.requireResolveMap, (path) => require.resolve(path));
18
- this.realPath = this.createAsyncProxy(this.realPathMap, async (path) => {
19
- const p = (0, path_1.resolve)(path);
20
- try {
21
- const stats = await this.lstat[p];
22
- if (stats.isSymbolicLink()) {
23
- return await fs.realpath(p);
24
- }
25
- return p;
26
- }
27
- catch (error) {
28
- builder_util_1.log.debug({ filePath: p, message: error.message || error.stack }, "error resolving path");
29
- }
30
- return p;
31
- });
32
- }
33
- // this allows dot-notation access while still supporting async retrieval
34
- // e.g., cache.packageJson[somePath] returns Promise<PackageJson>
35
- createAsyncProxy(map, compute) {
36
- return new Proxy({}, {
37
- async get(_, key) {
38
- if (map.has(key)) {
39
- return Promise.resolve(map.get(key));
40
- }
41
- return await Promise.resolve(compute(key)).then(value => {
42
- map.set(key, value);
43
- return value;
44
- });
45
- },
46
- set(_, key, value) {
47
- map.set(key, value);
48
- return true;
49
- },
50
- has(_, key) {
51
- return map.has(key);
52
- },
53
- });
54
- }
55
- }
56
- exports.ModuleCache = ModuleCache;
57
- //# sourceMappingURL=moduleCache.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"moduleCache.js","sourceRoot":"","sources":["../../src/node-module-collector/moduleCache.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAE1C,+BAA8B;AAC9B,+BAA8B;AAS9B,MAAa,WAAW;IAkBtB;QANiB,mBAAc,GAA6B,IAAI,GAAG,EAAE,CAAA;QACpD,gBAAW,GAAwB,IAAI,GAAG,EAAE,CAAA;QAC5C,cAAS,GAAyB,IAAI,GAAG,EAAE,CAAA;QAC3C,aAAQ,GAA0B,IAAI,GAAG,EAAE,CAAA;QAC3C,sBAAiB,GAA+B,IAAI,GAAG,EAAE,CAAA;QAGxE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,cAAc,EAAE,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;IAED,yEAAyE;IACzE,iEAAiE;IACzD,gBAAgB,CAAI,GAAmB,EAAE,OAAwC;QACvF,OAAO,IAAI,KAAK,CAAC,EAAgC,EAAE;YACjD,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,GAAW;gBACtB,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;oBACjB,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC,CAAA;gBACvC,CAAC;gBACD,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;oBACtD,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;oBACnB,OAAO,KAAK,CAAA;gBACd,CAAC,CAAC,CAAA;YACJ,CAAC;YACD,GAAG,CAAC,CAAC,EAAE,GAAW,EAAE,KAAQ;gBAC1B,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;gBACnB,OAAO,IAAI,CAAA;YACb,CAAC;YACD,GAAG,CAAC,CAAC,EAAE,GAAW;gBAChB,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YACrB,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;CACF;AA5DD,kCA4DC","sourcesContent":["import { exists, log } from \"builder-util\"\nimport { PackageJson } from \"./types\"\nimport * as fs from \"fs-extra\"\nimport { resolve } from \"path\"\n\n// Type aliases for clarity\ntype PackageJsonCache = Record<string, Promise<PackageJson>>\ntype RealPathCache = Record<string, Promise<string>>\ntype ExistsCache = Record<string, Promise<boolean>>\ntype LstatCache = Record<string, Promise<fs.Stats>>\ntype RequireResolveCache = Record<string, Promise<string | null>>\n\nexport class ModuleCache {\n /** Cache for package.json contents (readJson/require) */\n readonly packageJson: PackageJsonCache\n /** Cache for resolved real paths (realpath) */\n readonly realPath: RealPathCache\n /** Cache for file/directory existence checks */\n readonly exists: ExistsCache\n /** Cache for lstat results */\n readonly lstat: LstatCache\n /** Cache for require.resolve results (key: \"packageName::fromDir\") */\n readonly requireResolve: RequireResolveCache\n\n private readonly packageJsonMap: Map<string, PackageJson> = new Map()\n private readonly realPathMap: Map<string, string> = new Map()\n private readonly existsMap: Map<string, boolean> = new Map()\n private readonly lstatMap: Map<string, fs.Stats> = new Map()\n private readonly requireResolveMap: Map<string, string | null> = new Map()\n\n constructor() {\n this.packageJson = this.createAsyncProxy(this.packageJsonMap, (path: string) => fs.readJson(path))\n this.exists = this.createAsyncProxy(this.existsMap, (path: string) => exists(path))\n this.lstat = this.createAsyncProxy(this.lstatMap, (path: string) => fs.lstat(path))\n this.requireResolve = this.createAsyncProxy(this.requireResolveMap, (path: string) => require.resolve(path))\n this.realPath = this.createAsyncProxy(this.realPathMap, async (path: string) => {\n const p = resolve(path)\n try {\n const stats = await this.lstat[p]\n if (stats.isSymbolicLink()) {\n return await fs.realpath(p)\n }\n return p\n } catch (error: any) {\n log.debug({ filePath: p, message: error.message || error.stack }, \"error resolving path\")\n }\n return p\n })\n }\n\n // this allows dot-notation access while still supporting async retrieval\n // e.g., cache.packageJson[somePath] returns Promise<PackageJson>\n private createAsyncProxy<T>(map: Map<string, T>, compute: (key: string) => T | Promise<T>): Record<string, Promise<T>> {\n return new Proxy({} as Record<string, Promise<T>>, {\n async get(_, key: string) {\n if (map.has(key)) {\n return Promise.resolve(map.get(key)!)\n }\n return await Promise.resolve(compute(key)).then(value => {\n map.set(key, value)\n return value\n })\n },\n set(_, key: string, value: T) {\n map.set(key, value)\n return true\n },\n has(_, key: string) {\n return map.has(key)\n },\n })\n }\n}\n"]}