@pylair/cli 0.1.0-rc.3 → 0.1.0-rc.31

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 (112) hide show
  1. package/README.md +3 -2
  2. package/dist/bin.d.ts +3 -0
  3. package/dist/bin.d.ts.map +1 -0
  4. package/dist/bin.js +7 -0
  5. package/dist/bin.js.map +1 -0
  6. package/dist/build/artifacts.d.ts +14 -0
  7. package/dist/build/artifacts.d.ts.map +1 -0
  8. package/dist/build/artifacts.js +61 -0
  9. package/dist/build/artifacts.js.map +1 -0
  10. package/dist/build/bytecode.d.ts +29 -0
  11. package/dist/build/bytecode.d.ts.map +1 -0
  12. package/dist/build/bytecode.js +65 -0
  13. package/dist/build/bytecode.js.map +1 -0
  14. package/dist/build/download.d.ts +53 -0
  15. package/dist/build/download.d.ts.map +1 -0
  16. package/dist/build/download.js +327 -0
  17. package/dist/build/download.js.map +1 -0
  18. package/dist/build/notices.d.ts +10 -0
  19. package/dist/build/notices.d.ts.map +1 -0
  20. package/dist/build/notices.js +109 -0
  21. package/dist/build/notices.js.map +1 -0
  22. package/dist/build/pbs.d.ts +12 -0
  23. package/dist/build/pbs.d.ts.map +1 -0
  24. package/dist/build/pbs.js +36 -0
  25. package/dist/build/pbs.js.map +1 -0
  26. package/dist/build/python.d.ts +24 -0
  27. package/dist/build/python.d.ts.map +1 -0
  28. package/dist/build/python.js +106 -0
  29. package/dist/build/python.js.map +1 -0
  30. package/dist/build/sign.d.ts +18 -0
  31. package/dist/build/sign.d.ts.map +1 -0
  32. package/dist/build/sign.js +182 -0
  33. package/dist/build/sign.js.map +1 -0
  34. package/dist/build/source.d.ts +19 -0
  35. package/dist/build/source.d.ts.map +1 -0
  36. package/dist/build/source.js +91 -0
  37. package/dist/build/source.js.map +1 -0
  38. package/dist/build/util.d.ts +20 -0
  39. package/dist/build/util.d.ts.map +1 -0
  40. package/dist/build/util.js +62 -0
  41. package/dist/build/util.js.map +1 -0
  42. package/dist/build.d.ts +26 -12
  43. package/dist/build.d.ts.map +1 -1
  44. package/dist/build.js +240 -270
  45. package/dist/build.js.map +1 -1
  46. package/dist/capabilities.d.ts +51 -0
  47. package/dist/capabilities.d.ts.map +1 -0
  48. package/dist/capabilities.js +232 -0
  49. package/dist/capabilities.js.map +1 -0
  50. package/dist/cli.d.ts +38 -1
  51. package/dist/cli.d.ts.map +1 -1
  52. package/dist/cli.js +266 -39
  53. package/dist/cli.js.map +1 -1
  54. package/dist/codegen.d.ts.map +1 -1
  55. package/dist/codegen.js +12 -1
  56. package/dist/codegen.js.map +1 -1
  57. package/dist/config.d.ts +25 -1
  58. package/dist/config.d.ts.map +1 -1
  59. package/dist/config.js +31 -12
  60. package/dist/config.js.map +1 -1
  61. package/dist/dev.d.ts +7 -3
  62. package/dist/dev.d.ts.map +1 -1
  63. package/dist/dev.js +120 -16
  64. package/dist/dev.js.map +1 -1
  65. package/dist/doctor.d.ts +34 -1
  66. package/dist/doctor.d.ts.map +1 -1
  67. package/dist/doctor.js +268 -19
  68. package/dist/doctor.js.map +1 -1
  69. package/dist/keys.d.ts +50 -0
  70. package/dist/keys.d.ts.map +1 -0
  71. package/dist/keys.js +192 -0
  72. package/dist/keys.js.map +1 -0
  73. package/dist/prune.d.ts.map +1 -1
  74. package/dist/prune.js +1 -0
  75. package/dist/prune.js.map +1 -1
  76. package/dist/ui/caps.d.ts +45 -0
  77. package/dist/ui/caps.d.ts.map +1 -0
  78. package/dist/ui/caps.js +81 -0
  79. package/dist/ui/caps.js.map +1 -0
  80. package/dist/ui/index.d.ts +106 -0
  81. package/dist/ui/index.d.ts.map +1 -0
  82. package/dist/ui/index.js +264 -0
  83. package/dist/ui/index.js.map +1 -0
  84. package/dist/ui/prompts.d.ts +39 -0
  85. package/dist/ui/prompts.d.ts.map +1 -0
  86. package/dist/ui/prompts.js +209 -0
  87. package/dist/ui/prompts.js.map +1 -0
  88. package/dist/ui/style.d.ts +27 -0
  89. package/dist/ui/style.d.ts.map +1 -0
  90. package/dist/ui/style.js +71 -0
  91. package/dist/ui/style.js.map +1 -0
  92. package/dist/update.d.ts +64 -0
  93. package/dist/update.d.ts.map +1 -0
  94. package/dist/update.js +266 -0
  95. package/dist/update.js.map +1 -0
  96. package/dist/version.d.ts +5 -0
  97. package/dist/version.d.ts.map +1 -0
  98. package/dist/version.js +15 -0
  99. package/dist/version.js.map +1 -0
  100. package/dist/wrap.d.ts +69 -0
  101. package/dist/wrap.d.ts.map +1 -0
  102. package/dist/wrap.js +292 -0
  103. package/dist/wrap.js.map +1 -0
  104. package/dist/wrapbuild.d.ts +33 -0
  105. package/dist/wrapbuild.d.ts.map +1 -0
  106. package/dist/wrapbuild.js +83 -0
  107. package/dist/wrapbuild.js.map +1 -0
  108. package/dist/wrapconfig.d.ts +52 -0
  109. package/dist/wrapconfig.d.ts.map +1 -0
  110. package/dist/wrapconfig.js +117 -0
  111. package/dist/wrapconfig.js.map +1 -0
  112. package/package.json +4 -3
@@ -0,0 +1,10 @@
1
+ /** THIRD-PARTY-NOTICES for the bundle: the licenses of everything it
2
+ * embeds (pylair, the interpreter, every installed wheel). */
3
+ /** Shipped bundles must carry the licenses of what they embed. Collects:
4
+ * pylair's own dual license, the interpreter's license tree (PSF license
5
+ * requires LICENSE text with redistributed CPython), and each wheel's
6
+ * dist-info license files. Runs before prune so nothing collected is
7
+ * deleted afterwards. Returns the notice dir.
8
+ */
9
+ export declare function stageNotices(resources: string, pylairDir: string): string;
10
+ //# sourceMappingURL=notices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notices.d.ts","sourceRoot":"","sources":["../../src/build/notices.ts"],"names":[],"mappings":"AAAA;8DAC8D;AAc9D;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CA8FzE"}
@@ -0,0 +1,109 @@
1
+ /** THIRD-PARTY-NOTICES for the bundle: the licenses of everything it
2
+ * embeds (pylair, the interpreter, every installed wheel). */
3
+ import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync, } from "node:fs";
4
+ import { join } from "node:path";
5
+ import { ui } from "../ui/index.js";
6
+ /** Shipped bundles must carry the licenses of what they embed. Collects:
7
+ * pylair's own dual license, the interpreter's license tree (PSF license
8
+ * requires LICENSE text with redistributed CPython), and each wheel's
9
+ * dist-info license files. Runs before prune so nothing collected is
10
+ * deleted afterwards. Returns the notice dir.
11
+ */
12
+ export function stageNotices(resources, pylairDir) {
13
+ const out = join(resources, "THIRD-PARTY-NOTICES");
14
+ rmSync(out, { recursive: true, force: true });
15
+ mkdirSync(out, { recursive: true });
16
+ const index = [];
17
+ const copyInto = (subdir, src, dest) => {
18
+ mkdirSync(join(out, subdir), { recursive: true });
19
+ cpSync(src, join(out, subdir, dest));
20
+ };
21
+ const LICENSEISH = /^(licen[cs]e|copying|notice|authors|copyright)/i;
22
+ for (const f of ["LICENSE-MIT", "LICENSE-APACHE"]) {
23
+ const src = join(pylairDir, f);
24
+ if (existsSync(src))
25
+ copyInto("pylair", src, f);
26
+ }
27
+ index.push("pylair/ — pylair itself (MIT OR Apache-2.0)");
28
+ // The interpreter: python-build-standalone ships a licenses/ dir holding
29
+ // CPython's license plus every statically-linked dep (OpenSSL, libffi…).
30
+ const pyRoot = join(resources, "python");
31
+ let found = 0;
32
+ const walkPy = (dir) => {
33
+ for (const e of readdirSync(dir, { withFileTypes: true })) {
34
+ const p = join(dir, e.name);
35
+ if (e.isDirectory()) {
36
+ if (e.name.toLowerCase() === "licenses") {
37
+ cpSync(p, join(out, "python", "licenses"), { recursive: true });
38
+ found++;
39
+ }
40
+ else
41
+ walkPy(p);
42
+ }
43
+ else if (LICENSEISH.test(e.name)) {
44
+ copyInto("python", p, e.name);
45
+ found++;
46
+ }
47
+ }
48
+ };
49
+ if (existsSync(pyRoot))
50
+ walkPy(pyRoot);
51
+ if (!found) {
52
+ mkdirSync(join(out, "python"), { recursive: true });
53
+ writeFileSync(join(out, "python", "NOTICE.txt"), "This app bundles CPython (PSF-2.0 license) via python-build-standalone.\n" +
54
+ "License texts were not located in the interpreter tree at build time;\n" +
55
+ "they ship upstream in the python/licenses directory of each\n" +
56
+ "python-build-standalone release.\n");
57
+ ui.warn("warning: no license files found under resources/python; wrote a placeholder NOTICE");
58
+ }
59
+ index.push("python/ — bundled CPython interpreter (PSF-2.0) and its vendored deps");
60
+ // Wheels: every installed dist-info/egg-info carries license files or
61
+ // license metadata. Copy whichever exists.
62
+ const sp = join(resources, "site-packages");
63
+ let wheels = 0;
64
+ if (existsSync(sp)) {
65
+ for (const e of readdirSync(sp, { withFileTypes: true })) {
66
+ if (!e.isDirectory())
67
+ continue;
68
+ const m = /^(.*?)-[\d.]+.*\.(dist-info|egg-info)$/.exec(e.name);
69
+ if (!m)
70
+ continue;
71
+ const pkg = m[1].replace(/[^\w.-]/g, "_");
72
+ const d = join(sp, e.name);
73
+ let kept = false;
74
+ for (const f of readdirSync(d, { withFileTypes: true })) {
75
+ if (f.isDirectory() && f.name.toLowerCase() === "licenses") {
76
+ cpSync(join(d, f.name), join(out, pkg, "licenses"), { recursive: true });
77
+ kept = true;
78
+ }
79
+ else if (f.isFile() && LICENSEISH.test(f.name)) {
80
+ copyInto(pkg, join(d, f.name), f.name);
81
+ kept = true;
82
+ }
83
+ }
84
+ const meta = join(d, "METADATA");
85
+ if (existsSync(meta)) {
86
+ const lines = readFileSync(meta, "utf-8")
87
+ .split("\n")
88
+ .filter((l) => /^(License|Classifier: License)/i.test(l));
89
+ // Copyleft is legal to ship but app authors deserve to know they
90
+ // bundled it — warn, never block.
91
+ if (/\b(a?lgpl|gpl)[ -]?v?\d/i.test(lines.join(" ")))
92
+ ui.warn(`warning: bundled wheel ${e.name} declares a copyleft license`);
93
+ if (lines.length) {
94
+ mkdirSync(join(out, pkg), { recursive: true });
95
+ writeFileSync(join(out, pkg, "METADATA-LICENSE.txt"), lines.join("\n") + "\n");
96
+ kept = true;
97
+ }
98
+ }
99
+ if (kept) {
100
+ wheels++;
101
+ index.push(`${pkg}/ — from ${e.name}`);
102
+ }
103
+ }
104
+ }
105
+ writeFileSync(join(out, "INDEX.txt"), index.join("\n") + "\n");
106
+ ui.status(`third-party notices: pylair, python interpreter, ${wheels} wheel(s)`);
107
+ return out;
108
+ }
109
+ //# sourceMappingURL=notices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notices.js","sourceRoot":"","sources":["../../src/build/notices.ts"],"names":[],"mappings":"AAAA;8DAC8D;AAE9D,OAAO,EACL,MAAM,EACN,UAAU,EACV,SAAS,EACT,WAAW,EACX,YAAY,EACZ,MAAM,EACN,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,SAAiB,EAAE,SAAiB;IAC/D,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,EAAE,qBAAqB,CAAC,CAAC;IACnD,MAAM,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9C,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACpC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAE,GAAW,EAAE,IAAY,EAAE,EAAE;QAC7D,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAClD,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;IACvC,CAAC,CAAC;IACF,MAAM,UAAU,GAAG,iDAAiD,CAAC;IAErE,KAAK,MAAM,CAAC,IAAI,CAAC,a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AG,EAAE,sBAAsB,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;oBAC/E,IAAI,GAAG,IAAI,CAAC;gBACd,CAAC;YACH,CAAC;YACD,IAAI,IAAI,EAAE,CAAC;gBACT,MAAM,EAAE,CAAC;gBACT,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,YAAY,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;YACzC,CAAC;QACH,CAAC;IACH,CAAC;IACD,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IAC/D,EAAE,CAAC,MAAM,CAAC,oDAAoD,MAAM,WAAW,CAAC,CAAC;IACjF,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,12 @@
1
+ /** python-build-standalone: the pinned release, the supported versions and
2
+ * host triples, and the SHA-256 of every asset committed in-repo. */
3
+ export declare const PBS_TAG = "20261110";
4
+ export declare const PBS_VERSIONS: Record<string, string>;
5
+ /** Expected SHA256 per asset, committed in-repo — a hash fetched from the
6
+ * same release as the tarball catches corruption but not a tampered
7
+ * release. Bump together with PBS_TAG/PBS_VERSIONS; verify each value
8
+ * against upstream SHA256SUMS before committing.
9
+ */
10
+ export declare const PBS_SHA256: Record<string, string>;
11
+ export declare function hostTriple(): string;
12
+ //# sourceMappingURL=pbs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pbs.d.ts","sourceRoot":"","sources":["../../src/build/pbs.ts"],"names":[],"mappings":"AAAA;qEACqE;AAIrE,eAAO,MAAM,OAAO,aAAa,CAAC;AAClC,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAA4C,CAAC;AAS7F;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAW7C,CAAC;AAEF,wBAAgB,UAAU,IAAI,MAAM,CAInC"}
@@ -0,0 +1,36 @@
1
+ /** python-build-standalone: the pinned release, the supported versions and
2
+ * host triples, and the SHA-256 of every asset committed in-repo. */
3
+ import { arch, platform } from "node:os";
4
+ export const PBS_TAG = "20261110";
5
+ export const PBS_VERSIONS = { "3.12": "3.12.16", "3.13": "3.13.18" };
6
+ const HOST_TRIPLES = {
7
+ "darwin:arm64": "aarch64-apple-darwin",
8
+ "darwin:x64": "x86_64-apple-darwin",
9
+ "win32:x64": "x86_64-pc-windows-msvc",
10
+ "linux:x64": "x86_64-unknown-linux-gnu",
11
+ "linux:arm64": "aarch64-unknown-linux-gnu",
12
+ };
13
+ /** Expected SHA256 per asset, committed in-repo — a hash fetched from the
14
+ * same release as the tarball catches corruption but not a tampered
15
+ * release. Bump together with PBS_TAG/PBS_VERSIONS; verify each value
16
+ * against upstream SHA256SUMS before committing.
17
+ */
18
+ export const PBS_SHA256 = {
19
+ "3.12.16-aarch64-apple-darwin": "2f11b8aa3726bdbd87dd9eb76568412faddf4f47e26913fa45d6a2e424972acd",
20
+ "3.12.16-aarch64-unknown-linux-gnu": "b6a41defec4975d94b4ff1950236e7383e5c02ba40ea48c9ec33c66087a35aab",
21
+ "3.12.16-x86_64-apple-darwin": "b78a4c479f1964ec484880bee567568266f68da102269fb93a05fe8716b45f91",
22
+ "3.12.16-x86_64-pc-windows-msvc": "355ee61b8207b91574491b1c6dc9b0ebb4408fc56bfafe498f3ef439314b52dc",
23
+ "3.12.16-x86_64-unknown-linux-gnu": "6a9e62dad033790aef722dbd370e0ce76ce17b73627ba3ae679f537049350b39",
24
+ "3.13.18-aarch64-apple-darwin": "7a2384641584ab9984221fcb0fc9265df465922af71be71410529e2a9c3f0540",
25
+ "3.13.18-aarch64-unknown-linux-gnu": "55c00325f7c1fddf325dfc621aabdfbbac4dc54adda224af88ec411dc12db239",
26
+ "3.13.18-x86_64-apple-darwin": "d27d59a722db9f69926eb6d9564071247221f45a04da920ea7f3001c97e32f9b",
27
+ "3.13.18-x86_64-pc-windows-msvc": "2e0fed09d48989f64c9305da9ff2d37a41c0d13ab2aa6283405b2b620dfbf805",
28
+ "3.13.18-x86_64-unknown-linux-gnu": "f2d2199eb25880e07863b391cf7124e7ffa1338b0d65600dfcec117c4223a7fb",
29
+ };
30
+ export function hostTriple() {
31
+ const t = HOST_TRIPLES[`${platform()}:${arch()}`];
32
+ if (!t)
33
+ throw new Error(`no standalone CPython build for ${platform()}/${arch()}`);
34
+ return t;
35
+ }
36
+ //# sourceMappingURL=pbs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pbs.js","sourceRoot":"","sources":["../../src/build/pbs.ts"],"names":[],"mappings":"AAAA;qEACqE;AAErE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC;AAClC,MAAM,CAAC,MAAM,YAAY,GAA2B,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AAC7F,MAAM,YAAY,GAA2B;IAC3C,cAAc,EAAE,sBAAsB;IACtC,YAAY,EAAE,qBAAqB;IACnC,WAAW,EAAE,wBAAwB;IACrC,WAAW,EAAE,0BAA0B;IACvC,aAAa,EAAE,2BAA2B;CAC3C,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAA2B;IAChD,8BAA8B,EAAE,kEAAkE;IAClG,mCAAmC,EAAE,kEAAkE;IACvG,6BAA6B,EAAE,kEAAkE;IACjG,gCAAgC,EAAE,kEAAkE;IACpG,kCAAkC,EAAE,kEAAkE;IACtG,8BAA8B,EAAE,kEAAkE;IAClG,mCAAmC,EAAE,kEAAkE;IACvG,6BAA6B,EAAE,kEAAkE;IACjG,gCAAgC,EAAE,kEAAkE;IACpG,kCAAkC,EAAE,kEAAkE;CACvG,CAAC;AAEF,MAAM,UAAU,UAAU;IACxB,MAAM,CAAC,GAAG,YAAY,CAAC,GAAG,QAAQ,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;IAClD,IAAI,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,QAAQ,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;IACnF,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,24 @@
1
+ /** The bundled interpreter and its packages: fetch and unpack CPython,
2
+ * export the lock with uv, and install site-packages through the bundled
3
+ * interpreter (native wheels only). */
4
+ import { type StepHandle } from "../ui/index.js";
5
+ export declare function fetchPython(resources: string, cacheDir: string, versionClass: string): Promise<string>;
6
+ /** uv export args: the lock's production set only. --no-emit-project
7
+ * drops the scaffold's own project entry — its source is staged by
8
+ * stageSource(), not installed as a package. */
9
+ export declare function uvExportArgs(exported: string): string[];
10
+ /** True when a requirements file carries any `--hash` entries.
11
+ * `\s` before `--hash` excludes a trailing comment mention. */
12
+ export declare function requirementsHaveHashes(reqsText: string): boolean;
13
+ /** `uv pip install` args. `--require-hashes` is passed ONLY for the
14
+ * requirements.txt fallback: an exported lock legitimately mixes hashed
15
+ * registry deps with hash-less `file://` path deps, which the flag
16
+ * would reject — and individual `--hash` entries are verified without
17
+ * it anyway. */
18
+ export declare function uvPipInstallArgs(python: string, target: string, reqsFile: string, requireHashes: boolean): string[];
19
+ export interface StageEnvOptions {
20
+ step?: StepHandle;
21
+ verbose?: boolean;
22
+ }
23
+ export declare function stageEnv(resources: string, python: string, appDir: string, reqs: string, cacheDir: string, o?: StageEnvOptions): Promise<void>;
24
+ //# sourceMappingURL=python.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"python.d.ts","sourceRoot":"","sources":["../../src/build/python.ts"],"names":[],"mappings":"AAAA;;uCAEuC;AAOvC,OAAO,EAAM,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGrD,wBAAsB,WAAW,CAC/B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,CAAC,CA+BjB;AAED;;gDAEgD;AAChD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAWvD;AAED;+DAC+D;AAC/D,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED;;;;gBAIgB;AAChB,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,OAAO,GACrB,MAAM,EAAE,CAaV;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAsB,QAAQ,CAC5B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,CAAC,GAAE,eAAoB,GACtB,OAAO,CAAC,IAAI,CAAC,CAwBf"}
@@ -0,0 +1,106 @@
1
+ /** The bundled interpreter and its packages: fetch and unpack CPython,
2
+ * export the lock with uv, and install site-packages through the bundled
3
+ * interpreter (native wheels only). */
4
+ import { existsSync, mkdirSync, readFileSync, rmSync } from "node:fs";
5
+ import { join } from "node:path";
6
+ import { x as untar } from "tar";
7
+ import { ensureTarball } from "./download.js";
8
+ import { PBS_SHA256, PBS_TAG, PBS_VERSIONS, hostTriple } from "./pbs.js";
9
+ import { ui } from "../ui/index.js";
10
+ import { isWin, runTool } from "./util.js";
11
+ export async function fetchPython(resources, cacheDir, versionClass) {
12
+ const ver = PBS_VERSIONS[versionClass];
13
+ if (!ver)
14
+ throw new Error(`python-version "${versionClass}" not available (supported: ${Object.keys(PBS_VERSIONS).join(", ")})`);
15
+ const triple = hostTriple();
16
+ const asset = `cpython-${ver}+${PBS_TAG}-${triple}-install_only_stripped.tar.gz`;
17
+ const base = `https://github.com/astral-sh/python-build-standalone/releases/download/${PBS_TAG}`;
18
+ mkdirSync(resources, { recursive: true });
19
+ mkdirSync(cacheDir, { recursive: true });
20
+ const tarball = join(cacheDir, asset);
21
+ // The interpreter ships to end users — verify against hashes committed
22
+ // in-repo (see PBS_SHA256), not a checksum file from the same release.
23
+ const want = PBS_SHA256[`${ver}-${triple}`];
24
+ if (!want)
25
+ throw new Error(`no committed SHA256 for ${ver}/${triple}`);
26
+ await ensureTarball(`${base}/${asset}`, tarball, want);
27
+ const dest = join(resources, "python");
28
+ rmSync(dest, { recursive: true, force: true });
29
+ mkdirSync(dest, { recursive: true });
30
+ // Extract in-process — same lesson as the tomllib probe: whichever
31
+ // `tar` PATH resolves to can differ (System32 bsdtar vs Git Bash GNU
32
+ // tar, which dies on drive-letter paths). The `tar` package handles
33
+ // pax long names (>100 chars) and the bin/python3 -> python3.12
34
+ // symlinks the POSIX builds carry.
35
+ await untar({ file: tarball, cwd: dest, strip: 1 });
36
+ const py = join(dest, isWin ? "python.exe" : "bin/python3");
37
+ if (!existsSync(py))
38
+ throw new Error(`expected interpreter at ${py}`);
39
+ return py;
40
+ }
41
+ /** uv export args: the lock's production set only. --no-emit-project
42
+ * drops the scaffold's own project entry — its source is staged by
43
+ * stageSource(), not installed as a package. */
44
+ export function uvExportArgs(exported) {
45
+ return [
46
+ "export",
47
+ "--frozen",
48
+ "--format",
49
+ "requirements-txt",
50
+ "--no-dev",
51
+ "--no-emit-project",
52
+ "-o",
53
+ exported,
54
+ ];
55
+ }
56
+ /** True when a requirements file carries any `--hash` entries.
57
+ * `\s` before `--hash` excludes a trailing comment mention. */
58
+ export function requirementsHaveHashes(reqsText) {
59
+ return /\s--hash=/.test(reqsText);
60
+ }
61
+ /** `uv pip install` args. `--require-hashes` is passed ONLY for the
62
+ * requirements.txt fallback: an exported lock legitimately mixes hashed
63
+ * registry deps with hash-less `file://` path deps, which the flag
64
+ * would reject — and individual `--hash` entries are verified without
65
+ * it anyway. */
66
+ export function uvPipInstallArgs(python, target, reqsFile, requireHashes) {
67
+ const args = [
68
+ "pip",
69
+ "install",
70
+ "--python",
71
+ python,
72
+ "--target",
73
+ target,
74
+ "-r",
75
+ reqsFile,
76
+ ];
77
+ if (requireHashes)
78
+ args.push("--require-hashes");
79
+ return args;
80
+ }
81
+ export async function stageEnv(resources, python, appDir, reqs, cacheDir, o = {}) {
82
+ const target = join(resources, "site-packages");
83
+ rmSync(target, { recursive: true, force: true });
84
+ // dev uses `uv sync` (uv.lock) — build must install the SAME locked set,
85
+ // hashed, or dev/prod parity is a fiction. requirements.txt is the
86
+ // fallback for projects that don't lock.
87
+ const lock = join(appDir, "uv.lock");
88
+ let reqsFile = reqs;
89
+ let requireHashes = false;
90
+ if (existsSync(lock)) {
91
+ const exported = join(cacheDir, "requirements.exported.txt");
92
+ await runTool(ui, "uv", uvExportArgs(exported), appDir, o);
93
+ reqsFile = exported;
94
+ }
95
+ else if (!existsSync(reqs)) {
96
+ ui.line(`no uv.lock and no ${reqs}: bundling stdlib only`);
97
+ return;
98
+ }
99
+ else {
100
+ ui.warn("warning: no uv.lock, building from requirements.txt; " +
101
+ "the bundled env may drift from `pylair dev`'s env");
102
+ requireHashes = requirementsHaveHashes(readFileSync(reqs, "utf-8"));
103
+ }
104
+ await runTool(ui, "uv", uvPipInstallArgs(python, target, reqsFile, requireHashes), appDir, o);
105
+ }
106
+ //# sourceMappingURL=python.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"python.js","sourceRoot":"","sources":["../../src/build/python.ts"],"names":[],"mappings":"AAAA;;uCAEuC;AAEvC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,CAAC,IAAI,KAAK,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;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0,0 +1,18 @@
1
+ /** macOS ad-hoc signing of the built .app, verified with codesign. Runs
2
+ * only on macOS hosts; see build() for when it is used. */
3
+ /** The pieces of `runHdiutil` a test stubs. */
4
+ export interface HdiutilOps {
5
+ /** The command's exit code and combined output. */
6
+ run: (args: string[]) => {
7
+ code: number | null;
8
+ out: string;
9
+ };
10
+ warn: (msg: string) => void;
11
+ sleep: (ms: number) => void;
12
+ }
13
+ /** Run hdiutil, retrying only the transient lock messages: 5 attempts,
14
+ * waits of 1, 2, 4, 8 s between them, one warning line per retry. For
15
+ * attach, stale mounts of the image are detached before each retry. */
16
+ export declare function runHdiutil(o: HdiutilOps, args: string[]): void;
17
+ export declare function adHocSign(tauriDir: string, productName: string): void;
18
+ //# sourceMappingURL=sign.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign.d.ts","sourceRoot":"","sources":["../../src/build/sign.ts"],"names":[],"mappings":"AAAA;2DAC2D;AAyB3D,+CAA+C;AAC/C,MAAM,WAAW,UAAU;IACzB,mDAAmD;IACnD,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK;QAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9D,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7B;AAmCD;;uEAEuE;AACvE,wBAAgB,UAAU,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAe9D;AAoCD,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAuErE"}
@@ -0,0 +1,182 @@
1
+ /** macOS ad-hoc signing of the built .app, verified with codesign. Runs
2
+ * only on macOS hosts; see build() for when it is used. */
3
+ import { spawnSync } from "node:child_process";
4
+ import { closeSync, existsSync, mkdtempSync, openSync, readdirSync, readSync, rmSync, } from "node:fs";
5
+ import { tmpdir } from "node:os";
6
+ import { join } from "node:path";
7
+ import { ui } from "../ui/index.js";
8
+ import { run } from "./util.js";
9
+ // ── hdiutil with retries ──────────────────────────────────────────────
10
+ // hdiutil intermittently fails when a system process holds the image
11
+ // (Spotlight, XProtect, a leftover mount): "Resource busy" on create,
12
+ // "Resource temporarily unavailable" on attach. Those messages retry;
13
+ // anything else fails at once, as run() did.
14
+ const HDIUTIL_TRANSIENT = /resource busy|resource temporarily unavailable/i;
15
+ const HDIUTIL_ATTEMPTS = 5;
16
+ const hdiutilReal = {
17
+ run: (args) => {
18
+ const r = spawnSync("hdiutil", args, { encoding: "utf-8" });
19
+ return { code: r.status, out: `${r.stdout ?? ""}${r.stderr ?? ""}` };
20
+ },
21
+ warn: (s) => ui.warn(s),
22
+ sleep: (ms) => Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, ms),
23
+ };
24
+ /** Where `image` is mounted right now, per `hdiutil info`. */
25
+ function mountsOfImage(infoOut, image) {
26
+ const mounts = [];
27
+ let forImage = false;
28
+ for (const line of infoOut.split(/\r?\n/)) {
29
+ if (/^(image-path|image-alias)\s*:/.test(line)) {
30
+ forImage = line.slice(line.indexOf(":") + 1).trim() === image;
31
+ }
32
+ else if (forImage && /^mount-point\s*:/.test(line)) {
33
+ const m = line.slice(line.indexOf(":") + 1).trim();
34
+ if (m)
35
+ mounts.push(m);
36
+ }
37
+ }
38
+ return mounts;
39
+ }
40
+ /** Before an attach retry: drop mounts of the same image that a failed
41
+ * attach left behind, plus anything at our mountpoint. Best-effort. */
42
+ function detachStaleMounts(o, image, mountpoint) {
43
+ const stale = new Set([mountpoint]);
44
+ const info = o.run(["info"]);
45
+ if (info.code === 0)
46
+ for (const m of mountsOfImage(info.out, image))
47
+ stale.add(m);
48
+ for (const m of stale)
49
+ o.run(["detach", m, "-force", "-quiet"]);
50
+ }
51
+ /** Run hdiutil, retrying only the transient lock messages: 5 attempts,
52
+ * waits of 1, 2, 4, 8 s between them, one warning line per retry. For
53
+ * attach, stale mounts of the image are detached before each retry. */
54
+ export function runHdiutil(o, args) {
55
+ const isAttach = args[0] === "attach";
56
+ const image = isAttach ? args[args.length - 1] : "";
57
+ const mount = isAttach ? args[args.indexOf("-mountpoint") + 1] : "";
58
+ for (let attempt = 1; attempt <= HDIUTIL_ATTEMPTS; attempt++) {
59
+ const r = o.run(args);
60
+ if (r.code === 0)
61
+ return;
62
+ const out = r.out.trim();
63
+ if (!HDIUTIL_TRANSIENT.test(out) || attempt === HDIUTIL_ATTEMPTS)
64
+ throw new Error(`hdiutil ${args[0]} exited ${r.code}${out ? `:\n${out}` : ""}`);
65
+ if (isAttach)
66
+ detachStaleMounts(o, image, mount);
67
+ const wait = 2 ** (attempt - 1); // 1, 2, 4, 8 s
68
+ o.warn(`hdiutil ${args[0]} failed transiently; retrying in ${wait}s (attempt ${attempt + 1}/${HDIUTIL_ATTEMPTS})`);
69
+ o.sleep(wait * 1000);
70
+ }
71
+ }
72
+ // ── macOS ad-hoc signing ──────────────────────────────────────────────
73
+ // Mach-O magic numbers, read as the first BE u32 — includes the
74
+ // byte-swapped forms and both fat headers.
75
+ const MACHO_MAGIC = new Set([
76
+ 0xfeedface, 0xfeedfacf, 0xcefaedfe, 0xcffaedfe,
77
+ 0xcafebabe, 0xbebafeca, 0xcafebabf, 0xbfbafeca,
78
+ ]);
79
+ function isMachO(p) {
80
+ const fd = openSync(p, "r");
81
+ try {
82
+ const b = Buffer.alloc(4);
83
+ return readSync(fd, b, 0, 4, 0) === 4 && MACHO_MAGIC.has(b.readUInt32BE(0));
84
+ }
85
+ finally {
86
+ closeSync(fd);
87
+ }
88
+ }
89
+ /** Re-sign a built .app ad-hoc and REQUIRE it to verify. With no signing
90
+ * identity Tauri ships only the linker's ad-hoc stub on the main binary —
91
+ * a signature that doesn't cover the bundle is the worst state for
92
+ * Gatekeeper ("is damaged"), worse than none at all. Signs every Mach-O
93
+ * nested-first rather than `codesign --deep`, which is documented to miss
94
+ * binaries in layouts it doesn't model — a vendored CPython tree is
95
+ * exactly that. Verify with --deep --strict; if it fails, the build
96
+ * fails — a broken signature must not ship silently.
97
+ */
98
+ function codesignVerify(path) {
99
+ const v = spawnSync("codesign", ["--verify", "--deep", "--strict", path], {
100
+ encoding: "utf-8",
101
+ });
102
+ return v.status === 0 ? null : (v.stderr ?? "").trim();
103
+ }
104
+ export function adHocSign(tauriDir, productName) {
105
+ const bundleDir = join(tauriDir, "target", "release", "bundle", "macos");
106
+ if (!existsSync(bundleDir))
107
+ return; // --bundles skipped app — nothing to sign
108
+ const app = readdirSync(bundleDir).find((n) => n.endsWith(".app"));
109
+ if (!app)
110
+ return;
111
+ const appPath = join(bundleDir, app);
112
+ const machos = [];
113
+ const walk = (dir) => {
114
+ for (const e of readdirSync(dir, { withFileTypes: true })) {
115
+ const p = join(dir, e.name);
116
+ // Dirent types describe the link, not the target — symlinked files
117
+ // and dirs are skipped; the real binary is signed in place.
118
+ if (e.isDirectory())
119
+ walk(p);
120
+ else if (e.isFile() && isMachO(p))
121
+ machos.push(p);
122
+ }
123
+ };
124
+ walk(appPath);
125
+ // Deepest first — a parent's signature seals its children, so children
126
+ // must be final when the parent is written.
127
+ machos.sort((a, b) => b.split("/").length - a.split("/").length);
128
+ for (const p of machos)
129
+ run("codesign", ["--force", "--sign", "-", p], appPath);
130
+ run("codesign", ["--force", "--sign", "-", appPath], bundleDir);
131
+ const err = codesignVerify(appPath);
132
+ if (err)
133
+ throw new Error(`ad-hoc signing produced an invalid bundle:\n${err}`);
134
+ ui.status(`ad-hoc signed ${app}: ${machos.length} nested binaries, codesign --verify clean`);
135
+ // A dmg built in the same `tauri build` already captured the
136
+ // PRE-signing .app — signing after bundling can't reach inside a
137
+ // compressed image. Repackage each dmg from the signed app and verify
138
+ // the shipped artifact itself, not just the staged copy. The rebuilt
139
+ // image is plain (app + /Applications link) — Tauri's cosmetic layout
140
+ // returns once real signing is configured and repackaging stops.
141
+ const dmgDir = join(tauriDir, "target", "release", "bundle", "dmg");
142
+ if (!existsSync(dmgDir))
143
+ return;
144
+ for (const dmg of readdirSync(dmgDir).filter((n) => n.endsWith(".dmg"))) {
145
+ const dmgPath = join(dmgDir, dmg);
146
+ const staging = mkdtempSync(join(tmpdir(), "pylair-dmg-"));
147
+ try {
148
+ run("ditto", [appPath, join(staging, app)], tauriDir);
149
+ run("ln", ["-s", "/Applications", join(staging, "Applications")], tauriDir);
150
+ runHdiutil(hdiutilReal, [
151
+ "create",
152
+ "-volname",
153
+ productName,
154
+ "-srcfolder",
155
+ staging,
156
+ "-ov",
157
+ "-format",
158
+ "UDZO",
159
+ dmgPath,
160
+ ]);
161
+ }
162
+ finally {
163
+ rmSync(staging, { recursive: true, force: true });
164
+ }
165
+ // Verify the app INSIDE the shipped dmg — mount read-only at a fixed
166
+ // point, verify, always detach, then judge.
167
+ const mount = mkdtempSync(join(tmpdir(), "pylair-mnt-"));
168
+ runHdiutil(hdiutilReal, ["attach", "-nobrowse", "-readonly", "-mountpoint", mount, dmgPath]);
169
+ let inDmg = null;
170
+ try {
171
+ inDmg = codesignVerify(join(mount, app));
172
+ }
173
+ finally {
174
+ spawnSync("hdiutil", ["detach", mount, "-quiet"], { stdio: "inherit" });
175
+ rmSync(mount, { recursive: true, force: true });
176
+ }
177
+ if (inDmg)
178
+ throw new Error(`${dmg} contains an invalidly-signed app:\n${inDmg}`);
179
+ ui.status(`repackaged ${dmg} with the signed app, verified inside the image`);
180
+ }
181
+ }
182
+ //# sourceMappingURL=sign.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign.js","sourceRoot":"","sources":["../../src/build/sign.ts"],"names":[],"mappings":"AAAA;2DAC2D;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EACL,SAAS,EACT,UAAU,EACV,WAAW,EACX,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,MAAM,GACP,MAAM,S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AAC,CAAC;QACpD,CAAC;QAED,qEAAqE;QACrE,4CAA4C;QAC5C,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,aAAa,CAAC,CAAC,CAAC;QACzD,UAAU,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;QAC7F,IAAI,KAAK,GAAkB,IAAI,CAAC;QAChC,IAAI,CAAC;YACH,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;QAC3C,CAAC;gBAAS,CAAC;YACT,SAAS,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;YACxE,MAAM,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,GAAG,GAAG,uCAAuC,KAAK,EAAE,CAAC,CAAC;QACjF,EAAE,CAAC,MAAM,CAAC,cAAc,GAAG,iDAAiD,CAAC,CAAC;IAChF,CAAC;AACH,CAAC"}
@@ -0,0 +1,19 @@
1
+ /** Staging the app source into the bundle, minus anything that looks
2
+ * like a secret unless `[tool.pylair] include` names it. */
3
+ /**
4
+ * Copy the app source tree into the bundle, minus anything that looks
5
+ * like a secret. A path is skipped when any segment starts with "." or
6
+ * its basename matches SECRET_PATTERNS, UNLESS an `include` glob
7
+ * (relative to srcDir, same shape as `prune` entries) names it — an
8
+ * include wins even inside a denied directory, which stays walkable so
9
+ * the descent can reach it. Skips are reported, not fatal: `warn` gets
10
+ * the count, the first 10 names, and how to opt a path back in; nothing
11
+ * is printed when nothing was skipped.
12
+ *
13
+ * Returns the `/`-separated relative paths that were refused.
14
+ */
15
+ export declare function stageSource(srcDir: string, dest: string, include?: string[], warn?: (msg: string) => void,
16
+ /** Top-level names to leave out entirely (a root source dir holding the
17
+ * project's own `src-tauri`, `node_modules`...). Not reported as skipped. */
18
+ exclude?: string[]): string[];
19
+ //# sourceMappingURL=source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/build/source.ts"],"names":[],"mappings":"AAAA;4DAC4D;AA4C5D;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,MAAM,EAAO,EACtB,IAAI,GAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAC8D;AACrF;6EAC6E;AAC7E,OAAO,GAAE,MAAM,EAAO,GACrB,MAAM,EAAE,CAyBV"}