@gtkx/cli 1.5.0 → 2.0.0-beta.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 (211) hide show
  1. package/README.md +5 -5
  2. package/dist/cli.js +4 -0
  3. package/dist/cli.js.map +1 -1
  4. package/dist/codegen/freshness.d.ts.map +1 -1
  5. package/dist/codegen/freshness.js +45 -15
  6. package/dist/codegen/freshness.js.map +1 -1
  7. package/dist/codegen/reference.d.ts +17 -0
  8. package/dist/codegen/reference.d.ts.map +1 -0
  9. package/dist/codegen/reference.js +31 -0
  10. package/dist/codegen/reference.js.map +1 -0
  11. package/dist/codegen/report.d.ts.map +1 -1
  12. package/dist/codegen/report.js +18 -15
  13. package/dist/codegen/report.js.map +1 -1
  14. package/dist/codegen/run-codegen.d.ts +5 -5
  15. package/dist/codegen/run-codegen.d.ts.map +1 -1
  16. package/dist/codegen/run-codegen.js +24 -59
  17. package/dist/codegen/run-codegen.js.map +1 -1
  18. package/dist/codegen/store-resolver.d.ts +0 -1
  19. package/dist/codegen/store-resolver.d.ts.map +1 -1
  20. package/dist/codegen/store-resolver.js +8 -17
  21. package/dist/codegen/store-resolver.js.map +1 -1
  22. package/dist/commands/docs.d.ts.map +1 -1
  23. package/dist/commands/docs.js +6 -22
  24. package/dist/commands/docs.js.map +1 -1
  25. package/dist/commands/mcp.d.ts +13 -0
  26. package/dist/commands/mcp.d.ts.map +1 -0
  27. package/dist/commands/mcp.js +68 -0
  28. package/dist/commands/mcp.js.map +1 -0
  29. package/dist/deploy/freedesktop/copyright.d.ts.map +1 -1
  30. package/dist/deploy/freedesktop/copyright.js +2 -13
  31. package/dist/deploy/freedesktop/copyright.js.map +1 -1
  32. package/dist/deploy/freedesktop/xml.d.ts.map +1 -1
  33. package/dist/deploy/freedesktop/xml.js +21 -25
  34. package/dist/deploy/freedesktop/xml.js.map +1 -1
  35. package/dist/deploy/node-runtime/license.d.ts.map +1 -1
  36. package/dist/deploy/node-runtime/license.js +2 -9
  37. package/dist/deploy/node-runtime/license.js.map +1 -1
  38. package/dist/deploy/notices/gtkx.js +1 -1
  39. package/dist/deploy/notices/gtkx.js.map +1 -1
  40. package/dist/deploy/notices/libraries.d.ts.map +1 -1
  41. package/dist/deploy/notices/libraries.js +2 -1
  42. package/dist/deploy/notices/libraries.js.map +1 -1
  43. package/dist/deploy/notices/packages.d.ts.map +1 -1
  44. package/dist/deploy/notices/packages.js +3 -10
  45. package/dist/deploy/notices/packages.js.map +1 -1
  46. package/dist/deploy/payload/copy-tree.d.ts.map +1 -1
  47. package/dist/deploy/payload/copy-tree.js +3 -3
  48. package/dist/deploy/payload/copy-tree.js.map +1 -1
  49. package/dist/deploy/payload/stage.d.ts.map +1 -1
  50. package/dist/deploy/payload/stage.js +1 -3
  51. package/dist/deploy/payload/stage.js.map +1 -1
  52. package/dist/deploy/settings/build-manifest.d.ts.map +1 -1
  53. package/dist/deploy/settings/build-manifest.js +4 -15
  54. package/dist/deploy/settings/build-manifest.js.map +1 -1
  55. package/dist/deploy/settings/libraries.d.ts.map +1 -1
  56. package/dist/deploy/settings/libraries.js +2 -21
  57. package/dist/deploy/settings/libraries.js.map +1 -1
  58. package/dist/deploy/settings/paths.d.ts +1 -2
  59. package/dist/deploy/settings/paths.d.ts.map +1 -1
  60. package/dist/deploy/settings/paths.js +5 -15
  61. package/dist/deploy/settings/paths.js.map +1 -1
  62. package/dist/deploy/settings/screenshots.d.ts.map +1 -1
  63. package/dist/deploy/settings/screenshots.js +6 -31
  64. package/dist/deploy/settings/screenshots.js.map +1 -1
  65. package/dist/deploy/targets/flatpak-pnpm.js +4 -4
  66. package/dist/deploy/targets/flatpak-pnpm.js.map +1 -1
  67. package/dist/deploy/targets/flatpak-source.d.ts.map +1 -1
  68. package/dist/deploy/targets/flatpak-source.js +4 -4
  69. package/dist/deploy/targets/flatpak-source.js.map +1 -1
  70. package/dist/deploy/targets/flatpak-sources.js +1 -1
  71. package/dist/deploy/targets/flatpak-sources.js.map +1 -1
  72. package/dist/deploy/tools.d.ts.map +1 -1
  73. package/dist/deploy/tools.js +1 -3
  74. package/dist/deploy/tools.js.map +1 -1
  75. package/dist/dev/runner-main.js +1 -1
  76. package/dist/dev/runner-main.js.map +1 -1
  77. package/dist/dev/schema-dir.d.ts +1 -1
  78. package/dist/dev/schema-dir.d.ts.map +1 -1
  79. package/dist/dev/schema-dir.js +2 -4
  80. package/dist/dev/schema-dir.js.map +1 -1
  81. package/dist/i18n/catalogs.d.ts.map +1 -1
  82. package/dist/i18n/catalogs.js +2 -1
  83. package/dist/i18n/catalogs.js.map +1 -1
  84. package/dist/i18n/metadata-templates.d.ts.map +1 -1
  85. package/dist/i18n/metadata-templates.js +2 -1
  86. package/dist/i18n/metadata-templates.js.map +1 -1
  87. package/dist/i18n/source-messages.d.ts +3 -21
  88. package/dist/i18n/source-messages.d.ts.map +1 -1
  89. package/dist/i18n/source-messages.js +66 -85
  90. package/dist/i18n/source-messages.js.map +1 -1
  91. package/dist/i18n/types.d.ts +6 -7
  92. package/dist/i18n/types.d.ts.map +1 -1
  93. package/dist/i18n/types.js +83 -96
  94. package/dist/i18n/types.js.map +1 -1
  95. package/dist/internal/agent-rules.d.ts +7 -0
  96. package/dist/internal/agent-rules.d.ts.map +1 -0
  97. package/dist/internal/agent-rules.js +106 -0
  98. package/dist/internal/agent-rules.js.map +1 -0
  99. package/dist/internal/docs-elements.d.ts +8 -0
  100. package/dist/internal/docs-elements.d.ts.map +1 -0
  101. package/dist/internal/docs-elements.js +12 -0
  102. package/dist/internal/docs-elements.js.map +1 -0
  103. package/dist/internal/icon-path.d.ts.map +1 -1
  104. package/dist/internal/icon-path.js +5 -16
  105. package/dist/internal/icon-path.js.map +1 -1
  106. package/dist/internal/source-imports.d.ts.map +1 -1
  107. package/dist/internal/source-imports.js +10 -42
  108. package/dist/internal/source-imports.js.map +1 -1
  109. package/dist/mcp/client-config.d.ts +22 -0
  110. package/dist/mcp/client-config.d.ts.map +1 -0
  111. package/dist/mcp/client-config.js +94 -0
  112. package/dist/mcp/client-config.js.map +1 -0
  113. package/dist/settings/render.d.ts +0 -1
  114. package/dist/settings/render.d.ts.map +1 -1
  115. package/dist/settings/render.js +1 -11
  116. package/dist/settings/render.js.map +1 -1
  117. package/dist/settings/schema.d.ts +2 -2
  118. package/dist/settings/schema.d.ts.map +1 -1
  119. package/dist/settings/schema.js +21 -62
  120. package/dist/settings/schema.js.map +1 -1
  121. package/dist/vite-plugins/asset-imports.d.ts +1 -2
  122. package/dist/vite-plugins/asset-imports.d.ts.map +1 -1
  123. package/dist/vite-plugins/asset-imports.js +19 -32
  124. package/dist/vite-plugins/asset-imports.js.map +1 -1
  125. package/dist/vite-plugins/asset-specifier.d.ts +1 -3
  126. package/dist/vite-plugins/asset-specifier.d.ts.map +1 -1
  127. package/dist/vite-plugins/asset-specifier.js +1 -4
  128. package/dist/vite-plugins/asset-specifier.js.map +1 -1
  129. package/dist/vite-plugins/i18n.d.ts.map +1 -1
  130. package/dist/vite-plugins/i18n.js +2 -1
  131. package/dist/vite-plugins/i18n.js.map +1 -1
  132. package/dist/vite-plugins/index.js +2 -2
  133. package/dist/vite-plugins/index.js.map +1 -1
  134. package/dist/vite-plugins/resources.d.ts.map +1 -1
  135. package/dist/vite-plugins/resources.js +31 -96
  136. package/dist/vite-plugins/resources.js.map +1 -1
  137. package/dist/vite-plugins/settings-worker-env.d.ts.map +1 -1
  138. package/dist/vite-plugins/settings-worker-env.js +1 -3
  139. package/dist/vite-plugins/settings-worker-env.js.map +1 -1
  140. package/dist/vite-plugins/settings.d.ts +1 -2
  141. package/dist/vite-plugins/settings.d.ts.map +1 -1
  142. package/dist/vite-plugins/settings.js +8 -13
  143. package/dist/vite-plugins/settings.js.map +1 -1
  144. package/dist/vite-plugins/undeclared-library.d.ts.map +1 -1
  145. package/dist/vite-plugins/undeclared-library.js +10 -13
  146. package/dist/vite-plugins/undeclared-library.js.map +1 -1
  147. package/dist/vite-plugins/worker.d.ts.map +1 -1
  148. package/dist/vite-plugins/worker.js +0 -1
  149. package/dist/vite-plugins/worker.js.map +1 -1
  150. package/package.json +21 -14
  151. package/src/cli.ts +5 -0
  152. package/src/codegen/freshness.ts +66 -16
  153. package/src/codegen/reference.ts +52 -0
  154. package/src/codegen/report.ts +16 -17
  155. package/src/codegen/run-codegen.ts +31 -91
  156. package/src/codegen/store-resolver.ts +8 -24
  157. package/src/commands/docs.ts +6 -36
  158. package/src/commands/mcp.ts +81 -0
  159. package/src/deploy/freedesktop/copyright.ts +2 -14
  160. package/src/deploy/freedesktop/xml.ts +24 -32
  161. package/src/deploy/node-runtime/license.ts +2 -8
  162. package/src/deploy/notices/gtkx.ts +1 -1
  163. package/src/deploy/notices/libraries.ts +2 -1
  164. package/src/deploy/notices/packages.ts +3 -11
  165. package/src/deploy/payload/copy-tree.ts +3 -4
  166. package/src/deploy/payload/stage.ts +2 -6
  167. package/src/deploy/settings/build-manifest.ts +4 -16
  168. package/src/deploy/settings/libraries.ts +1 -25
  169. package/src/deploy/settings/paths.ts +6 -16
  170. package/src/deploy/settings/screenshots.ts +8 -46
  171. package/src/deploy/targets/flatpak-pnpm.ts +4 -4
  172. package/src/deploy/targets/flatpak-source.ts +4 -4
  173. package/src/deploy/targets/flatpak-sources.ts +1 -1
  174. package/src/deploy/tools.ts +1 -3
  175. package/src/dev/runner-main.ts +1 -1
  176. package/src/dev/schema-dir.ts +2 -4
  177. package/src/i18n/catalogs.ts +2 -1
  178. package/src/i18n/metadata-templates.ts +2 -1
  179. package/src/i18n/source-messages.ts +77 -115
  180. package/src/i18n/types.ts +97 -131
  181. package/src/internal/agent-rules.ts +135 -0
  182. package/src/internal/docs-elements.ts +21 -0
  183. package/src/internal/icon-path.ts +6 -19
  184. package/src/internal/source-imports.ts +14 -50
  185. package/src/mcp/client-config.ts +130 -0
  186. package/src/settings/render.ts +1 -13
  187. package/src/settings/schema.ts +19 -81
  188. package/src/vite-plugins/asset-imports.ts +20 -44
  189. package/src/vite-plugins/asset-specifier.ts +0 -5
  190. package/src/vite-plugins/i18n.ts +2 -1
  191. package/src/vite-plugins/index.ts +2 -2
  192. package/src/vite-plugins/resources.ts +36 -139
  193. package/src/vite-plugins/settings-worker-env.ts +1 -3
  194. package/src/vite-plugins/settings.ts +11 -19
  195. package/src/vite-plugins/undeclared-library.ts +14 -20
  196. package/src/vite-plugins/worker.ts +0 -1
  197. package/dist/i18n/binding-extractor.d.ts +0 -30
  198. package/dist/i18n/binding-extractor.d.ts.map +0 -1
  199. package/dist/i18n/binding-extractor.js +0 -1324
  200. package/dist/i18n/binding-extractor.js.map +0 -1
  201. package/dist/i18n/extractor-plugin.d.ts +0 -8
  202. package/dist/i18n/extractor-plugin.d.ts.map +0 -1
  203. package/dist/i18n/extractor-plugin.js +0 -247
  204. package/dist/i18n/extractor-plugin.js.map +0 -1
  205. package/dist/internal/data-dir.d.ts +0 -4
  206. package/dist/internal/data-dir.d.ts.map +0 -1
  207. package/dist/internal/data-dir.js +0 -52
  208. package/dist/internal/data-dir.js.map +0 -1
  209. package/src/i18n/binding-extractor.ts +0 -1969
  210. package/src/i18n/extractor-plugin.ts +0 -413
  211. package/src/internal/data-dir.ts +0 -70
@@ -1,19 +1,12 @@
1
- import { readFileSync } from "node:fs";
2
1
  import { dirname, join } from "node:path";
2
+ import { readLicenseText } from "../notices/text.js";
3
3
  const LICENSE_FILENAME = "LICENSE";
4
4
  const NODE_MARKER = "Node.js";
5
5
  const licenseCandidates = (binary) => {
6
6
  const dir = dirname(binary);
7
7
  return [join(dir, LICENSE_FILENAME), join(dir, "..", LICENSE_FILENAME)];
8
8
  };
9
- const isNodeLicense = (path) => {
10
- try {
11
- return readFileSync(path, "utf8").includes(NODE_MARKER);
12
- }
13
- catch {
14
- return false;
15
- }
16
- };
9
+ const isNodeLicense = (path) => readLicenseText(path)?.includes(NODE_MARKER) === true;
17
10
  const licenseBesideNode = (binary) => licenseCandidates(binary).find((candidate) => isNodeLicense(candidate)) ?? null;
18
11
  export { LICENSE_FILENAME, licenseBesideNode };
19
12
  //# sourceMappingURL=license.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"license.js","sourceRoot":"","sources":["../../../src/deploy/node-runtime/license.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,gBAAgB,GAAG,SAAS,CAAC;AACnC,MAAM,WAAW,GAAG,SAAS,CAAC;AAE9B,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAY,EAAE;IACnD,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE5B,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,gBAAgB,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAC5E,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,IAAY,EAAW,EAAE;IAC5C,IAAI,CAAC;QACD,OAAO,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC5D,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,KAAK,CAAC;IACjB,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAiB,EAAE,CACxD,iBAAiB,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC;AAEpF,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAC","sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\n\nconst LICENSE_FILENAME = \"LICENSE\";\nconst NODE_MARKER = \"Node.js\";\n\nconst licenseCandidates = (binary: string): string[] => {\n const dir = dirname(binary);\n\n return [join(dir, LICENSE_FILENAME), join(dir, \"..\", LICENSE_FILENAME)];\n};\n\nconst isNodeLicense = (path: string): boolean => {\n try {\n return readFileSync(path, \"utf8\").includes(NODE_MARKER);\n } catch {\n return false;\n }\n};\n\nconst licenseBesideNode = (binary: string): string | null =>\n licenseCandidates(binary).find((candidate) => isNodeLicense(candidate)) ?? null;\n\nexport { LICENSE_FILENAME, licenseBesideNode };\n"]}
1
+ {"version":3,"file":"license.js","sourceRoot":"","sources":["../../../src/deploy/node-runtime/license.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,gBAAgB,GAAG,SAAS,CAAC;AACnC,MAAM,WAAW,GAAG,SAAS,CAAC;AAE9B,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAY,EAAE;IACnD,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE5B,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,gBAAgB,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAC5E,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;AAEvG,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAiB,EAAE,CACxD,iBAAiB,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC;AAEpF,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAC","sourcesContent":["import { dirname, join } from \"node:path\";\nimport { readLicenseText } from \"../notices/text.js\";\n\nconst LICENSE_FILENAME = \"LICENSE\";\nconst NODE_MARKER = \"Node.js\";\n\nconst licenseCandidates = (binary: string): string[] => {\n const dir = dirname(binary);\n\n return [join(dir, LICENSE_FILENAME), join(dir, \"..\", LICENSE_FILENAME)];\n};\n\nconst isNodeLicense = (path: string): boolean => readLicenseText(path)?.includes(NODE_MARKER) === true;\n\nconst licenseBesideNode = (binary: string): string | null =>\n licenseCandidates(binary).find((candidate) => isNodeLicense(candidate)) ?? null;\n\nexport { LICENSE_FILENAME, licenseBesideNode };\n"]}
@@ -29,7 +29,7 @@ const summaryFor = (settings, packages) => {
29
29
  "Section 3.2(a) asks that whoever receives an executable form be told how to obtain the source code,",
30
30
  "which is what the source pointer below is for: it leads to the release these files were built from.",
31
31
  `The addon also statically links Rust crates GTKX did not write, so ${lib}/${NATIVE_FILENAME} is not`,
32
- `${LICENSE_NAME} alone. The second notice below names the licenses those crates carry; it does not`,
32
+ `${LICENSE_NAME} alone. The crates notice below names the licenses those crates carry; it does not`,
33
33
  `reproduce their texts, and ${CRATES_MANIFEST} in the source pointed at records which crates went in`,
34
34
  "and at which versions.",
35
35
  ...modulesLine(packages),
@@ -1 +1 @@
1
- {"version":3,"file":"gtkx.js","sourceRoot":"","sources":["../../../src/deploy/notices/gtkx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,MAAM,KAAK,GAAG,MAAM,CAAC;AACrB,MAAM,KAAK,GAAG,QAAQ,CAAC;AACvB,MAAM,YAAY,GAAG,SAAS,CAAC;AAC/B,MAAM,WAAW,GAAG,kCAAkC,CAAC;AACvD,MAAM,cAAc,GAAG,kCAAkC,CAAC;AAC1D,MAAM,eAAe,GAAG,WAAW,CAAC;AACpC,MAAM,cAAc,GAAG,+CAA+C,CAAC;AACvE,MAAM,cAAc,GAAG,4CAA4C,CAAC;AACpE,MAAM,eAAe,GAAG,4BAA4B,CAAC;AAErD,MAAM,aAAa,GAAG,CAAC,KAAqB,EAAW,EAAE,CAA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Q,CAAC;IACjC,SAAS,EAAE,EAAE;IACb,IAAI,EAAE,IAAI;CACb,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,CAAC,QAAwB,EAAE,QAA0B,EAAiB,EAAE;IACxF,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7D,MAAM,GAAG,GAAG,OAAO,QAAQ,CAAC,UAAU,EAAE,CAAC;IAEzC,OAAO;QACH,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,CAAC,GAAG,GAAG,IAAI,eAAe,EAAE,EAAE,GAAG,GAAG,IAAI,eAAe,EAAE,CAAC;QACjE,OAAO,EAAE,UAAU,CAAC,QAAQ,EAAE,GAAG,CAAC;QAClC,OAAO,EAAE,CAAC;gBACN,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC;gBACxB,OAAO,EAAE,YAAY;gBACrB,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC;gBACtB,SAAS,EAAE,YAAY,CAAC,GAAG,CAAC;gBAC5B,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC;aACrB,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;KACxB,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import { sortStrings } from \"@gtkx/utils\";\nimport type { DeploySettings, Notice, NoticeSection } from \"../types.js\";\nimport type { BundledPackage } from \"./packages.js\";\nimport { BUNDLE_FILENAME } from \"../../vite-plugins/esm-extension.js\";\n\nconst TITLE = \"GTKX\";\nconst SCOPE = \"@gtkx/\";\nconst LICENSE_NAME = \"MPL-2.0\";\nconst LICENSE_URL = \"https://www.mozilla.org/MPL/2.0/\";\nconst REPOSITORY_URL = \"https://github.com/gtkx-org/gtkx\";\nconst NATIVE_FILENAME = \"gtkx.node\";\nconst CRATES_SUBJECT = \"Rust crates linked into the GTKX native addon\";\nconst CRATES_LICENSE = \"MIT and Apache-2.0 and ISC and Unicode-3.0\";\nconst CRATES_MANIFEST = \"packages/native/Cargo.toml\";\n\nconst isGtkxPackage = (entry: BundledPackage): boolean => entry.name.startsWith(SCOPE);\n\nconst getVersion = (packages: BundledPackage[]): string | null =>\n packages.map((entry) => entry.version).find((version) => version !== null) ?? null;\n\nconst getRepository = (packages: BundledPackage[]): string =>\n packages.map((entry) => entry.source).find((source) => source !== null) ?? REPOSITORY_URL;\n\nconst sourceFor = (packages: BundledPackage[]): string => {\n const repository = getRepository(packages);\n const version = getVersion(packages);\n\n return version === null ? repository : `${repository}/tree/v${version}`;\n};\n\nconst cratesSourceFor = (packages: BundledPackage[]): string => `${sourceFor(packages)}/${CRATES_MANIFEST}`;\n\nconst modulesLine = (packages: BundledPackage[]): string[] =>\n packages.length === 0 ? [] : [`Modules: ${sortStrings(packages.map((entry) => entry.name)).join(\", \")}.`];\n\nconst summaryFor = (settings: DeploySettings, packages: BundledPackage[]): string[] => {\n const lib = `lib/${settings.binaryName}`;\n\n return [\n \"GTKX is the framework this application is built on. Its JavaScript is compiled into\",\n `${lib}/${BUNDLE_FILENAME}, and its native addon is ${lib}/${NATIVE_FILENAME}.`,\n `The ${LICENSE_NAME} notice below covers the code GTKX wrote, all of which is in both files, and the`,\n `Mozilla Public License 2.0 is published at ${LICENSE_URL}.`,\n \"Section 3.2(a) asks that whoever receives an executable form be told how to obtain the source code,\",\n \"which is what the source pointer below is for: it leads to the release these files were built from.\",\n `The addon also statically links Rust crates GTKX did not write, so ${lib}/${NATIVE_FILENAME} is not`,\n `${LICENSE_NAME} alone. The second notice below names the licenses those crates carry; it does not`,\n `reproduce their texts, and ${CRATES_MANIFEST} in the source pointed at records which crates went in`,\n \"and at which versions.\",\n ...modulesLine(packages),\n ];\n};\n\nconst getText = (packages: BundledPackage[]): string | null =>\n packages.map((entry) => entry.text).find((text) => text !== null) ?? null;\n\nconst getCopyright = (packages: BundledPackage[]): string[] =>\n sortStrings(new Set(packages.flatMap((entry) => entry.copyright)));\n\nconst subjectFor = (packages: BundledPackage[]): string => {\n const version = getVersion(packages);\n\n return version === null ? TITLE : `${TITLE} ${version}`;\n};\n\nconst cratesNotice = (packages: BundledPackage[]): Notice => ({\n subject: CRATES_SUBJECT,\n license: CRATES_LICENSE,\n source: cratesSourceFor(packages),\n copyright: [],\n text: null,\n});\n\nconst gtkxNotices = (settings: DeploySettings, packages: BundledPackage[]): NoticeSection => {\n const own = packages.filter((entry) => isGtkxPackage(entry));\n const lib = `lib/${settings.binaryName}`;\n\n return {\n title: TITLE,\n files: [`${lib}/${NATIVE_FILENAME}`, `${lib}/${BUNDLE_FILENAME}`],\n summary: summaryFor(settings, own),\n notices: [{\n subject: subjectFor(own),\n license: LICENSE_NAME,\n source: sourceFor(own),\n copyright: getCopyright(own),\n text: getText(own),\n }, cratesNotice(own)],\n };\n};\n\nexport { gtkxNotices, isGtkxPackage };\n"]}
1
+ {"version":3,"file":"gtkx.js","sourceRoot":"","sources":["../../../src/deploy/notices/gtkx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,MAAM,KAAK,GAAG,MAAM,CAAC;AACrB,MAAM,KAAK,GAAG,QAAQ,CAAC;AACvB,MAAM,YAAY,GAAG,SAAS,CAAC;AAC/B,MAAM,WAAW,GAAG,kCAAkC,CAAC;AACvD,MAAM,cAAc,GAAG,kCAAkC,CAAC;AAC1D,MAAM,eAAe,GAAG,WAAW,CAAC;AACpC,MAAM,cAAc,GAAG,+CAA+C,CAAC;AACvE,MAAM,cAAc,GAAG,4CAA4C,CAAC;AACpE,MAAM,eAAe,GAAG,4BAA4B,CAAC;AAErD,MAAM,aAAa,GAAG,CAAC,KAAqB,EAAW,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;AAEvF,MAAM,UAAU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AEH,MAAM,WAAW,GAAG,CAAC,QAAwB,EAAE,QAA0B,EAAiB,EAAE;IACxF,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7D,MAAM,GAAG,GAAG,OAAO,QAAQ,CAAC,UAAU,EAAE,CAAC;IAEzC,OAAO;QACH,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,CAAC,GAAG,GAAG,IAAI,eAAe,EAAE,EAAE,GAAG,GAAG,IAAI,eAAe,EAAE,CAAC;QACjE,OAAO,EAAE,UAAU,CAAC,QAAQ,EAAE,GAAG,CAAC;QAClC,OAAO,EAAE,CAAC;gBACN,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC;gBACxB,OAAO,EAAE,YAAY;gBACrB,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC;gBACtB,SAAS,EAAE,YAAY,CAAC,GAAG,CAAC;gBAC5B,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC;aACrB,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;KACxB,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import { sortStrings } from \"@gtkx/utils\";\nimport type { DeploySettings, Notice, NoticeSection } from \"../types.js\";\nimport type { BundledPackage } from \"./packages.js\";\nimport { BUNDLE_FILENAME } from \"../../vite-plugins/esm-extension.js\";\n\nconst TITLE = \"GTKX\";\nconst SCOPE = \"@gtkx/\";\nconst LICENSE_NAME = \"MPL-2.0\";\nconst LICENSE_URL = \"https://www.mozilla.org/MPL/2.0/\";\nconst REPOSITORY_URL = \"https://github.com/gtkx-org/gtkx\";\nconst NATIVE_FILENAME = \"gtkx.node\";\nconst CRATES_SUBJECT = \"Rust crates linked into the GTKX native addon\";\nconst CRATES_LICENSE = \"MIT and Apache-2.0 and ISC and Unicode-3.0\";\nconst CRATES_MANIFEST = \"packages/native/Cargo.toml\";\n\nconst isGtkxPackage = (entry: BundledPackage): boolean => entry.name.startsWith(SCOPE);\n\nconst getVersion = (packages: BundledPackage[]): string | null =>\n packages.map((entry) => entry.version).find((version) => version !== null) ?? null;\n\nconst getRepository = (packages: BundledPackage[]): string =>\n packages.map((entry) => entry.source).find((source) => source !== null) ?? REPOSITORY_URL;\n\nconst sourceFor = (packages: BundledPackage[]): string => {\n const repository = getRepository(packages);\n const version = getVersion(packages);\n\n return version === null ? repository : `${repository}/tree/v${version}`;\n};\n\nconst cratesSourceFor = (packages: BundledPackage[]): string => `${sourceFor(packages)}/${CRATES_MANIFEST}`;\n\nconst modulesLine = (packages: BundledPackage[]): string[] =>\n packages.length === 0 ? [] : [`Modules: ${sortStrings(packages.map((entry) => entry.name)).join(\", \")}.`];\n\nconst summaryFor = (settings: DeploySettings, packages: BundledPackage[]): string[] => {\n const lib = `lib/${settings.binaryName}`;\n\n return [\n \"GTKX is the framework this application is built on. Its JavaScript is compiled into\",\n `${lib}/${BUNDLE_FILENAME}, and its native addon is ${lib}/${NATIVE_FILENAME}.`,\n `The ${LICENSE_NAME} notice below covers the code GTKX wrote, all of which is in both files, and the`,\n `Mozilla Public License 2.0 is published at ${LICENSE_URL}.`,\n \"Section 3.2(a) asks that whoever receives an executable form be told how to obtain the source code,\",\n \"which is what the source pointer below is for: it leads to the release these files were built from.\",\n `The addon also statically links Rust crates GTKX did not write, so ${lib}/${NATIVE_FILENAME} is not`,\n `${LICENSE_NAME} alone. The crates notice below names the licenses those crates carry; it does not`,\n `reproduce their texts, and ${CRATES_MANIFEST} in the source pointed at records which crates went in`,\n \"and at which versions.\",\n ...modulesLine(packages),\n ];\n};\n\nconst getText = (packages: BundledPackage[]): string | null =>\n packages.map((entry) => entry.text).find((text) => text !== null) ?? null;\n\nconst getCopyright = (packages: BundledPackage[]): string[] =>\n sortStrings(new Set(packages.flatMap((entry) => entry.copyright)));\n\nconst subjectFor = (packages: BundledPackage[]): string => {\n const version = getVersion(packages);\n\n return version === null ? TITLE : `${TITLE} ${version}`;\n};\n\nconst cratesNotice = (packages: BundledPackage[]): Notice => ({\n subject: CRATES_SUBJECT,\n license: CRATES_LICENSE,\n source: cratesSourceFor(packages),\n copyright: [],\n text: null,\n});\n\nconst gtkxNotices = (settings: DeploySettings, packages: BundledPackage[]): NoticeSection => {\n const own = packages.filter((entry) => isGtkxPackage(entry));\n const lib = `lib/${settings.binaryName}`;\n\n return {\n title: TITLE,\n files: [`${lib}/${NATIVE_FILENAME}`, `${lib}/${BUNDLE_FILENAME}`],\n summary: summaryFor(settings, own),\n notices: [{\n subject: subjectFor(own),\n license: LICENSE_NAME,\n source: sourceFor(own),\n copyright: getCopyright(own),\n text: getText(own),\n }, cratesNotice(own)],\n };\n};\n\nexport { gtkxNotices, isGtkxPackage };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"libraries.d.ts","sourceRoot":"","sources":["../../../src/deploy/notices/libraries.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAU,aAAa,EAAE,MAAM,aAAa,CAAC;AAoEzE,QAAA,MAAM,cAAc,GAAI,UAAU,cAAc,KAAG,aASlD,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"libraries.d.ts","sourceRoot":"","sources":["../../../src/deploy/notices/libraries.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAU,aAAa,EAAE,MAAM,aAAa,CAAC;AAqEzE,QAAA,MAAM,cAAc,GAAI,UAAU,cAAc,KAAG,aASlD,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -25,7 +25,8 @@ const SUMMARY = [
25
25
  "their own terms; this package does not distribute them at all.",
26
26
  "The GTKX native addon does link GLib, GObject and GIO dynamically against the copies already installed",
27
27
  "on the system, which makes the addon a work that uses those libraries, and section 6 of the LGPL asks",
28
- "such a work to carry three things. This is the notice it asks for. The license itself is published at",
28
+ "such a work to carry a notice, the license, and the copyright notices. This is the notice it asks for,",
29
+ "and the license itself is published at",
29
30
  `${LGPL_URL},`,
30
31
  "and the copyright notice of each library is published with its sources, at the address listed beside",
31
32
  "it below. Linking against an installed shared library is the mechanism section 6(b) allows, so the",
@@ -1 +1 @@
1
- {"version":3,"file":"libraries.js","sourceRoot":"","sources":["../../../src/deploy/notices/libraries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAS5C,MAAM,KAAK,GAAG,oBAAoB,CAAC;AACnC,MAAM,SAAS,GAAG,gCAAgC,CAAC;AACnD,MAAM,IAAI,GAAG,mBAAmB,CAAC;AACjC,MAAM,QAAQ,GAAG,yDAAyD,CAAC;AAE3E,MAAM,IAAI,GAAoB;IAC1B,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,GAAG,SAAS,OAAO;CAC9B,CAAC;AAEF,MAAM,eAAe,GAAoC;IACrD,OAAO,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,aAAa,EAAE;IACpF,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE;IACxE,aAAa,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,gBAAgB,EAAE;IAChG,YAAY,EAAE;QACV,OAAO,EAAE,WAAW;QACpB,OAAO,EAAE,oCAAoC;QAC7C,MAAM,EAAE,kCAAkC;KAC7C;CACJ,CAAC;AAEF,MAAM,OAAO,GAAG;IACZ,+FAA+F;IAC/F,uGAAuG;IACvG,uGAAuG;IACvG,gEAAgE;IAChE,wGAAwG;IACxG,uGAAuG;IACvG,uGAAuG;IACvG,GAAG,QAAQ,GAAG;IACd,sGAAsG;IACtG,oGAAoG;IACpG,oEAAoE;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YAAY,CAAC,QAAQ,CAAC,CAAC;QAChD,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;KACrE,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { sortStringsBy } from \"@gtkx/utils\";\nimport type { DeploySettings, Notice, NoticeSection } from \"../types.js\";\n\ntype PlatformLibrary = {\n subject: string;\n license: string;\n source: string;\n};\n\nconst TITLE = \"Platform libraries\";\nconst GNOME_URL = \"https://gitlab.gnome.org/GNOME\";\nconst LGPL = \"LGPL-2.1-or-later\";\nconst LGPL_URL = \"https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html\";\n\nconst GLIB: PlatformLibrary = {\n subject: \"GLib, GObject and GIO\",\n license: LGPL,\n source: `${GNOME_URL}/glib`,\n};\n\nconst KNOWN_LIBRARIES: Record<string, PlatformLibrary> = {\n \"Adw-1\": { subject: \"libadwaita\", license: LGPL, source: `${GNOME_URL}/libadwaita` },\n \"Gtk-4.0\": { subject: \"GTK\", license: LGPL, source: `${GNOME_URL}/gtk` },\n \"GtkSource-5\": { subject: \"GtkSourceView\", license: LGPL, source: `${GNOME_URL}/gtksourceview` },\n \"WebKit-6.0\": {\n subject: \"WebKitGTK\",\n license: \"LGPL-2.1-or-later and BSD-2-Clause\",\n source: \"https://github.com/WebKit/WebKit\",\n },\n};\n\nconst SUMMARY = [\n \"Not one of the libraries below is included in this package. GTKX reaches them through GObject\",\n \"introspection, so they are resolved when the application runs: from the host system for a deb, an rpm\",\n \"or an AppImage, and from the GNOME runtime for a flatpak. Your platform distributes them to you under\",\n \"their own terms; this package does not distribute them at all.\",\n \"The GTKX native addon does link GLib, GObject and GIO dynamically against the copies already installed\",\n \"on the system, which makes the addon a work that uses those libraries, and section 6 of the LGPL asks\",\n \"such a work to carry three things. This is the notice it asks for. The license itself is published at\",\n `${LGPL_URL},`,\n \"and the copyright notice of each library is published with its sources, at the address listed beside\",\n \"it below. Linking against an installed shared library is the mechanism section 6(b) allows, so the\",\n \"source of the libraries does not have to travel with this package.\",\n];\n\nconst noticeFor = (library: PlatformLibrary): Notice => ({\n subject: library.subject,\n license: library.license,\n source: library.source,\n copyright: [],\n text: null,\n});\n\nconst knownLibraries = (settings: DeploySettings): PlatformLibrary[] =>\n settings.libraries.map((library) => KNOWN_LIBRARIES[library]).filter((library) => library !== undefined);\n\nconst otherLibraries = (settings: DeploySettings): string[] =>\n settings.libraries.filter((library) => KNOWN_LIBRARIES[library] === undefined);\n\nconst otherSummary = (settings: DeploySettings): string[] => {\n const others = otherLibraries(settings);\n\n if (others.length === 0) {\n return [];\n }\n\n return [`This application also declares ${others.join(\", \")}, resolved from the platform the same way.`];\n};\n\nconst libraryNotices = (settings: DeploySettings): NoticeSection => {\n const libraries = sortStringsBy(knownLibraries(settings), (library) => library.subject);\n\n return {\n title: TITLE,\n files: [],\n summary: [...SUMMARY, ...otherSummary(settings)],\n notices: [GLIB, ...libraries].map((library) => noticeFor(library)),\n };\n};\n\nexport { libraryNotices };\n"]}
1
+ {"version":3,"file":"libraries.js","sourceRoot":"","sources":["../../../src/deploy/notices/libraries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAS5C,MAAM,KAAK,GAAG,oBAAoB,CAAC;AACnC,MAAM,SAAS,GAAG,gCAAgC,CAAC;AACnD,MAAM,IAAI,GAAG,mBAAmB,CAAC;AACjC,MAAM,QAAQ,GAAG,yDAAyD,CAAC;AAE3E,MAAM,IAAI,GAAoB;IAC1B,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,GAAG,SAAS,OAAO;CAC9B,CAAC;AAEF,MAAM,eAAe,GAAoC;IACrD,OAAO,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM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AAM,YAAY,GAAG,CAAC,QAAwB,EAAY,EAAE;IACxD,MAAM,MAAM,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;IAExC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,EAAE,CAAC;IACd,CAAC;IAED,OAAO,CAAC,kCAAkC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;AAC7G,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,QAAwB,EAAiB,EAAE;IAC/D,MAAM,SAAS,GAAG,aAAa,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAExF,OAAO;QACH,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;QAChD,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;KACrE,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { sortStringsBy } from \"@gtkx/utils\";\nimport type { DeploySettings, Notice, NoticeSection } from \"../types.js\";\n\ntype PlatformLibrary = {\n subject: string;\n license: string;\n source: string;\n};\n\nconst TITLE = \"Platform libraries\";\nconst GNOME_URL = \"https://gitlab.gnome.org/GNOME\";\nconst LGPL = \"LGPL-2.1-or-later\";\nconst LGPL_URL = \"https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html\";\n\nconst GLIB: PlatformLibrary = {\n subject: \"GLib, GObject and GIO\",\n license: LGPL,\n source: `${GNOME_URL}/glib`,\n};\n\nconst KNOWN_LIBRARIES: Record<string, PlatformLibrary> = {\n \"Adw-1\": { subject: \"libadwaita\", license: LGPL, source: `${GNOME_URL}/libadwaita` },\n \"Gtk-4.0\": { subject: \"GTK\", license: LGPL, source: `${GNOME_URL}/gtk` },\n \"GtkSource-5\": { subject: \"GtkSourceView\", license: LGPL, source: `${GNOME_URL}/gtksourceview` },\n \"WebKit-6.0\": {\n subject: \"WebKitGTK\",\n license: \"LGPL-2.1-or-later and BSD-2-Clause\",\n source: \"https://github.com/WebKit/WebKit\",\n },\n};\n\nconst SUMMARY = [\n \"Not one of the libraries below is included in this package. GTKX reaches them through GObject\",\n \"introspection, so they are resolved when the application runs: from the host system for a deb, an rpm\",\n \"or an AppImage, and from the GNOME runtime for a flatpak. Your platform distributes them to you under\",\n \"their own terms; this package does not distribute them at all.\",\n \"The GTKX native addon does link GLib, GObject and GIO dynamically against the copies already installed\",\n \"on the system, which makes the addon a work that uses those libraries, and section 6 of the LGPL asks\",\n \"such a work to carry a notice, the license, and the copyright notices. This is the notice it asks for,\",\n \"and the license itself is published at\",\n `${LGPL_URL},`,\n \"and the copyright notice of each library is published with its sources, at the address listed beside\",\n \"it below. Linking against an installed shared library is the mechanism section 6(b) allows, so the\",\n \"source of the libraries does not have to travel with this package.\",\n];\n\nconst noticeFor = (library: PlatformLibrary): Notice => ({\n subject: library.subject,\n license: library.license,\n source: library.source,\n copyright: [],\n text: null,\n});\n\nconst knownLibraries = (settings: DeploySettings): PlatformLibrary[] =>\n settings.libraries.map((library) => KNOWN_LIBRARIES[library]).filter((library) => library !== undefined);\n\nconst otherLibraries = (settings: DeploySettings): string[] =>\n settings.libraries.filter((library) => KNOWN_LIBRARIES[library] === undefined);\n\nconst otherSummary = (settings: DeploySettings): string[] => {\n const others = otherLibraries(settings);\n\n if (others.length === 0) {\n return [];\n }\n\n return [`This application also declares ${others.join(\", \")}, resolved from the platform the same way.`];\n};\n\nconst libraryNotices = (settings: DeploySettings): NoticeSection => {\n const libraries = sortStringsBy(knownLibraries(settings), (library) => library.subject);\n\n return {\n title: TITLE,\n files: [],\n summary: [...SUMMARY, ...otherSummary(settings)],\n notices: [GLIB, ...libraries].map((library) => noticeFor(library)),\n };\n};\n\nexport { libraryNotices };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"packages.d.ts","sourceRoot":"","sources":["../../../src/deploy/notices/packages.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD,KAAK,cAAc,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACtB,CAAC;AAmGF,QAAA,MAAM,eAAe,GAAI,UAAU,cAAc,EAAE,UAAU,eAAe,EAAE,KAAG,cAAc,EAY9F,CAAC;AAEF,OAAO,EAAE,KAAK,cAAc,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"packages.d.ts","sourceRoot":"","sources":["../../../src/deploy/notices/packages.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD,KAAK,cAAc,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACtB,CAAC;AA0FF,QAAA,MAAM,eAAe,GAAI,UAAU,cAAc,EAAE,UAAU,eAAe,EAAE,KAAG,cAAc,EAY9F,CAAC;AAEF,OAAO,EAAE,KAAK,cAAc,EAAE,eAAe,EAAE,CAAC"}
@@ -1,13 +1,10 @@
1
1
  import { sortStringsBy, warn } from "@gtkx/utils";
2
+ import hostedGitInfo from "hosted-git-info";
2
3
  import { existsSync, realpathSync } from "node:fs";
3
4
  import { join, resolve } from "node:path";
4
5
  import { readPackageManifest } from "../settings/package-manifest.js";
5
6
  import { copyrightLines, licenseTextIn } from "./text.js";
6
7
  const MANIFEST_FILENAME = "package.json";
7
- const GIT_PREFIX = /^git\+/;
8
- const GIT_SUFFIX = /\.git$/;
9
- const GIT_SCHEME = /^git:\/\//;
10
- const GITHUB_SLUG = /^(?:github:)?(?<slug>[\w.-]+\/[\w.-]+)$/;
11
8
  const realPath = (path) => {
12
9
  try {
13
10
  return realpathSync(path);
@@ -28,12 +25,8 @@ const sourceUrl = (manifest) => {
28
25
  if (configured === null) {
29
26
  return null;
30
27
  }
31
- const url = configured.replace(GIT_PREFIX, "").replace(GIT_SUFFIX, "").replace(GIT_SCHEME, "https://");
32
- const slug = GITHUB_SLUG.exec(url)?.groups?.slug;
33
- if (slug !== undefined) {
34
- return `https://github.com/${slug}`;
35
- }
36
- return url.startsWith("http") ? url : null;
28
+ const url = configured.replace(/^git\+/, "").replace(/\.git$/, "").replace(/^git:\/\//, "https://");
29
+ return hostedGitInfo.fromUrl(url)?.browse() ?? (url.startsWith("http") ? url : null);
37
30
  };
38
31
  const missingPackage = (entry) => ({
39
32
  name: entry.name,
@@ -1 +1 @@
1
- {"version":3,"file":"packages.js","sourceRoot":"","sources":["../../../src/deploy/notices/packages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EA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AK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;SACzE,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;SAC3C,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;IAEpD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAChC,WAAW,CAAC,OAAO,CAAC,CAAC;IAErB,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AAEF,OAAO,EAAuB,eAAe,EAAE,CAAC","sourcesContent":["import { sortStringsBy, warn } from \"@gtkx/utils\";\nimport { existsSync, realpathSync } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\nimport type { RecordedPackage } from \"../../internal/build-manifest.js\";\nimport type { DeploySettings } from \"../types.js\";\nimport { type PackageManifest, readPackageManifest } from \"../settings/package-manifest.js\";\nimport { copyrightLines, licenseTextIn } from \"./text.js\";\n\ntype BundledPackage = {\n name: string;\n version: string | null;\n license: string | null;\n source: string | null;\n copyright: string[];\n text: string | null;\n isPresent: boolean;\n};\n\nconst MANIFEST_FILENAME = \"package.json\";\nconst GIT_PREFIX = /^git\\+/;\nconst GIT_SUFFIX = /\\.git$/;\nconst GIT_SCHEME = /^git:\\/\\//;\nconst GITHUB_SLUG = /^(?:github:)?(?<slug>[\\w.-]+\\/[\\w.-]+)$/;\n\nconst realPath = (path: string): string => {\n try {\n return realpathSync(path);\n } catch {\n return path;\n }\n};\n\nconst authorLine = (manifest: PackageManifest): string[] => {\n const { name, email } = manifest.author;\n\n if (name === null) {\n return [];\n }\n\n return [email === null ? name : `${name} <${email}>`];\n};\n\nconst sourceUrl = (manifest: PackageManifest): string | null => {\n const configured = manifest.repository ?? manifest.homepage;\n\n if (configured === null) {\n return null;\n }\n\n const url = configured.replace(GIT_PREFIX, \"\").replace(GIT_SUFFIX, \"\").replace(GIT_SCHEME, \"https://\");\n const slug = GITHUB_SLUG.exec(url)?.groups?.slug;\n\n if (slug !== undefined) {\n return `https://github.com/${slug}`;\n }\n\n return url.startsWith(\"http\") ? url : null;\n};\n\nconst missingPackage = (entry: RecordedPackage): BundledPackage => ({\n name: entry.name,\n version: entry.version,\n license: null,\n source: null,\n copyright: [],\n text: null,\n isPresent: false,\n});\n\nconst packageIn = (entry: RecordedPackage, dir: string): BundledPackage => {\n if (!existsSync(join(dir, MANIFEST_FILENAME))) {\n return missingPackage(entry);\n }\n\n const manifest = readPackageManifest(dir);\n const text = licenseTextIn(dir);\n const copyright = copyrightLines(text);\n\n return {\n name: manifest.name ?? entry.name,\n version: manifest.version ?? entry.version,\n license: manifest.license,\n source: sourceUrl(manifest),\n copyright: copyright.length === 0 ? authorLine(manifest) : copyright,\n text,\n isPresent: true,\n };\n};\n\nconst keyFor = (entry: BundledPackage): string => `${entry.name}@${entry.version ?? \"\"}`;\n\nconst dedupe = (entries: BundledPackage[]): BundledPackage[] => {\n const unique: Map<string, BundledPackage> = new Map();\n\n for (const entry of entries) {\n unique.set(keyFor(entry), entry);\n }\n\n return sortStringsBy(unique.values(), keyFor);\n};\n\nconst warnMissing = (entries: BundledPackage[]): void => {\n const missing = entries.filter((entry) => !entry.isPresent);\n\n if (missing.length === 0) {\n return;\n }\n\n warn(\n `The third-party notices name ${missing.map((entry) => keyFor(entry)).join(\", \")} without any license: ` +\n \"`gtkx build` recorded where each package was installed and those directories are no longer there. \" +\n \"Deploy from the tree the build ran in, or build again, so the notices carry their terms.\",\n );\n};\n\nconst bundledPackages = (settings: DeploySettings, recorded: RecordedPackage[]): BundledPackage[] => {\n const root = realPath(settings.paths.root);\n\n const entries = recorded\n .map((entry) => ({ entry, dir: resolve(settings.paths.dist, entry.dir) }))\n .filter(({ dir }) => realPath(dir) !== root)\n .map(({ entry, dir }) => packageIn(entry, dir));\n\n const bundled = dedupe(entries);\n warnMissing(bundled);\n\n return bundled;\n};\n\nexport { type BundledPackage, bundledPackages };\n"]}
1
+ {"version":3,"file":"packages.js","sourceRoot":"","sources":["../../../src/deploy/notices/packages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG1C,OAAO,EAAwB,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAY1D,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAEzC,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAU,EAAE;IACtC,IAAI,CAAC;QACD,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,IAAI,CAAC;IAChB,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,QAAyB,EAAY,EAAE;IACvD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC;IAExC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAChB,OAAO,EAAE,CAAC;IACd,CAAC;IAED,OAAO,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,KAAK,GAAG,CAAC,CAAC;AAC1D,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,QAAyB,EAAiB,EAAE;IAC3D,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAU,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B,EAAoB,EAAE;IAChG,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAE3C,MAAM,OAAO,GAAG,QAAQ;SACnB,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;SACzE,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;SAC3C,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;IAEpD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAChC,WAAW,CAAC,OAAO,CAAC,CAAC;IAErB,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AAEF,OAAO,EAAuB,eAAe,EAAE,CAAC","sourcesContent":["import { sortStringsBy, warn } from \"@gtkx/utils\";\nimport hostedGitInfo from \"hosted-git-info\";\nimport { existsSync, realpathSync } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\nimport type { RecordedPackage } from \"../../internal/build-manifest.js\";\nimport type { DeploySettings } from \"../types.js\";\nimport { type PackageManifest, readPackageManifest } from \"../settings/package-manifest.js\";\nimport { copyrightLines, licenseTextIn } from \"./text.js\";\n\ntype BundledPackage = {\n name: string;\n version: string | null;\n license: string | null;\n source: string | null;\n copyright: string[];\n text: string | null;\n isPresent: boolean;\n};\n\nconst MANIFEST_FILENAME = \"package.json\";\n\nconst realPath = (path: string): string => {\n try {\n return realpathSync(path);\n } catch {\n return path;\n }\n};\n\nconst authorLine = (manifest: PackageManifest): string[] => {\n const { name, email } = manifest.author;\n\n if (name === null) {\n return [];\n }\n\n return [email === null ? name : `${name} <${email}>`];\n};\n\nconst sourceUrl = (manifest: PackageManifest): string | null => {\n const configured = manifest.repository ?? manifest.homepage;\n\n if (configured === null) {\n return null;\n }\n\n const url = configured.replace(/^git\\+/, \"\").replace(/\\.git$/, \"\").replace(/^git:\\/\\//, \"https://\");\n\n return hostedGitInfo.fromUrl(url)?.browse() ?? (url.startsWith(\"http\") ? url : null);\n};\n\nconst missingPackage = (entry: RecordedPackage): BundledPackage => ({\n name: entry.name,\n version: entry.version,\n license: null,\n source: null,\n copyright: [],\n text: null,\n isPresent: false,\n});\n\nconst packageIn = (entry: RecordedPackage, dir: string): BundledPackage => {\n if (!existsSync(join(dir, MANIFEST_FILENAME))) {\n return missingPackage(entry);\n }\n\n const manifest = readPackageManifest(dir);\n const text = licenseTextIn(dir);\n const copyright = copyrightLines(text);\n\n return {\n name: manifest.name ?? entry.name,\n version: manifest.version ?? entry.version,\n license: manifest.license,\n source: sourceUrl(manifest),\n copyright: copyright.length === 0 ? authorLine(manifest) : copyright,\n text,\n isPresent: true,\n };\n};\n\nconst keyFor = (entry: BundledPackage): string => `${entry.name}@${entry.version ?? \"\"}`;\n\nconst dedupe = (entries: BundledPackage[]): BundledPackage[] => {\n const unique: Map<string, BundledPackage> = new Map();\n\n for (const entry of entries) {\n unique.set(keyFor(entry), entry);\n }\n\n return sortStringsBy(unique.values(), keyFor);\n};\n\nconst warnMissing = (entries: BundledPackage[]): void => {\n const missing = entries.filter((entry) => !entry.isPresent);\n\n if (missing.length === 0) {\n return;\n }\n\n warn(\n `The third-party notices name ${missing.map((entry) => keyFor(entry)).join(\", \")} without any license: ` +\n \"`gtkx build` recorded where each package was installed and those directories are no longer there. \" +\n \"Deploy from the tree the build ran in, or build again, so the notices carry their terms.\",\n );\n};\n\nconst bundledPackages = (settings: DeploySettings, recorded: RecordedPackage[]): BundledPackage[] => {\n const root = realPath(settings.paths.root);\n\n const entries = recorded\n .map((entry) => ({ entry, dir: resolve(settings.paths.dist, entry.dir) }))\n .filter(({ dir }) => realPath(dir) !== root)\n .map(({ entry, dir }) => packageIn(entry, dir));\n\n const bundled = dedupe(entries);\n warnMissing(bundled);\n\n return bundled;\n};\n\nexport { type BundledPackage, bundledPackages };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"copy-tree.d.ts","sourceRoot":"","sources":["../../../src/deploy/payload/copy-tree.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9C,QAAA,MAAM,eAAe,MAAQ,CAAC;AA8B9B,QAAA,MAAM,QAAQ,GAAI,MAAM,MAAM,EAAE,KAAK,MAAM,EAAE,QAAQ,MAAM,EAAE,aAAmB,KAAG,UAG7E,CAAC;AAEP,QAAA,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,KAAK,MAAM,EAAE,UAAU,MAAM,EAAE,aAAoB,KAAG,UAGjF,CAAC;AAIP,QAAA,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,MACmC,CAAC;AAE9E,QAAA,MAAM,QAAQ,GAAI,MAAM,MAAM,EAAE,SAAS,MAAM,EAAE,WAAW,MAAM,KAAG,UAAU,EAEwB,CAAC;AAExG,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,iBAAiB,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"copy-tree.d.ts","sourceRoot":"","sources":["../../../src/deploy/payload/copy-tree.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9C,QAAA,MAAM,eAAe,MAAQ,CAAC;AA4B9B,QAAA,MAAM,QAAQ,GAAI,MAAM,MAAM,EAAE,KAAK,MAAM,EAAE,QAAQ,MAAM,EAAE,aAAmB,KAAG,UAG7E,CAAC;AAEP,QAAA,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,KAAK,MAAM,EAAE,UAAU,MAAM,EAAE,aAAoB,KAAG,UAGjF,CAAC;AAIP,QAAA,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,MACmC,CAAC;AAE9E,QAAA,MAAM,QAAQ,GAAI,MAAM,MAAM,EAAE,SAAS,MAAM,EAAE,WAAW,MAAM,KAAG,UAAU,EAEwB,CAAC;AAExG,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,iBAAiB,EAAE,SAAS,EAAE,CAAC"}
@@ -1,5 +1,6 @@
1
+ import { isPathInside } from "@gtkx/utils";
1
2
  import { chmodSync, copyFileSync, mkdirSync, statSync, writeFileSync } from "node:fs";
2
- import { dirname, isAbsolute, join, relative } from "node:path";
3
+ import { dirname, join } from "node:path";
3
4
  import { listFilesRecursive } from "../../internal/list-files.js";
4
5
  const EXECUTABLE_MODE = 0o755;
5
6
  const READABLE_MODE = 0o644;
@@ -11,8 +12,7 @@ const modeFor = (rel) => {
11
12
  return EXECUTABLE_SUFFIXES.some((suffix) => name.endsWith(suffix)) ? EXECUTABLE_MODE : READABLE_MODE;
12
13
  };
13
14
  const assertInsideRoot = (root, rel, abs) => {
14
- const escape = relative(root, abs);
15
- if (escape.length === 0 || escape.startsWith("..") || isAbsolute(escape)) {
15
+ if (!isPathInside(root, abs)) {
16
16
  throw new Error(`Cannot stage "${rel}": it resolves outside the staging directory`);
17
17
  }
18
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"copy-tree.js","sourceRoot":"","sources":["../../../src/deploy/payload/copy-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtF,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEhE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,eAAe,GAAG,KAAK,CAAC;AAC9B,MAAM,aAAa,GAAG,KAAK,CAAC;AAC5B,MAAM,mBA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Ae,EAAE,iBAAiB,EAAE,SAAS,EAAE,CAAC","sourcesContent":["import { chmodSync, copyFileSync, mkdirSync, statSync, writeFileSync } from \"node:fs\";\nimport { dirname, isAbsolute, join, relative } from \"node:path\";\nimport type { StagedFile } from \"../types.js\";\nimport { listFilesRecursive } from \"../../internal/list-files.js\";\n\nconst EXECUTABLE_MODE = 0o755;\nconst READABLE_MODE = 0o644;\nconst EXECUTABLE_SUFFIXES = [\".node\", \".so\"];\nconst MODE_MASK = 0o7777;\nconst EXECUTE_MASK = 0o111;\n\nconst modeFor = (rel: string): number => {\n const name = rel.split(\"/\").at(-1) ?? rel;\n\n return EXECUTABLE_SUFFIXES.some((suffix) => name.endsWith(suffix)) ? EXECUTABLE_MODE : READABLE_MODE;\n};\n\nconst assertInsideRoot = (root: string, rel: string, abs: string): void => {\n const escape = relative(root, abs);\n\n if (escape.length === 0 || escape.startsWith(\"..\") || isAbsolute(escape)) {\n throw new Error(`Cannot stage \"${rel}\": it resolves outside the staging directory`);\n }\n};\n\nconst placeFile = (root: string, rel: string, mode: number, write: (target: string) => void): StagedFile => {\n const abs = join(root, rel);\n assertInsideRoot(root, rel, abs);\n mkdirSync(dirname(abs), { recursive: true });\n write(abs);\n chmodSync(abs, mode);\n\n return { rel, abs, mode };\n};\n\nconst copyInto = (root: string, rel: string, source: string, mode = modeFor(rel)): StagedFile =>\n placeFile(root, rel, mode, (target) => {\n copyFileSync(source, target);\n });\n\nconst writeInto = (root: string, rel: string, contents: string, mode = READABLE_MODE): StagedFile =>\n placeFile(root, rel, mode, (target) => {\n writeFileSync(target, contents);\n });\n\nconst sourceMode = (path: string): number => statSync(path).mode & MODE_MASK;\n\nconst executableModeFor = (path: string): number =>\n (sourceMode(path) & EXECUTE_MASK) === 0 ? READABLE_MODE : EXECUTABLE_MODE;\n\nconst copyTree = (root: string, relBase: string, sourceDir: string): StagedFile[] =>\n listFilesRecursive(sourceDir)\n .map((file) => copyInto(root, join(relBase, file.rel), file.absPath, sourceMode(file.absPath)));\n\nexport { copyInto, copyTree, EXECUTABLE_MODE, executableModeFor, writeInto };\n"]}
1
+ {"version":3,"file":"copy-tree.js","sourceRoot":"","sources":["../../../src/deploy/payload/copy-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,eAAe,GAAG,KAAK,CAAC;AAC9B,MAAM,aAAa,GAAG,KAAK,CAAC;AAC5B,MAAM,mBAAmB,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC7C,MAAM,SAAS,GAAG,MAAM,CAAC;AACzB,MAAM,YAAY,GAAG,KAAK,CAAC;AAE3B,MAAM,OAAO,GAAG,CAAC,GAAW,EAAU,EAAE;IACpC,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;IAE1C,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,aAAa,CAAC;AACzG,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAE,GAAW,EAAE,GAAW,EAAQ,EAAE;IACtE,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,iBAAiB,GAAG,8CAA8C,CAAC,CAAC;IACxF,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC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,CAAC;AAE9E,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,OAAe,EAAE,SAAiB,EAAgB,EAAE,CAChF,kBAAkB,CAAC,SAAS,CAAC;KACxB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAExG,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,iBAAiB,EAAE,SAAS,EAAE,CAAC","sourcesContent":["import { isPathInside } from \"@gtkx/utils\";\nimport { chmodSync, copyFileSync, mkdirSync, statSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport type { StagedFile } from \"../types.js\";\nimport { listFilesRecursive } from \"../../internal/list-files.js\";\n\nconst EXECUTABLE_MODE = 0o755;\nconst READABLE_MODE = 0o644;\nconst EXECUTABLE_SUFFIXES = [\".node\", \".so\"];\nconst MODE_MASK = 0o7777;\nconst EXECUTE_MASK = 0o111;\n\nconst modeFor = (rel: string): number => {\n const name = rel.split(\"/\").at(-1) ?? rel;\n\n return EXECUTABLE_SUFFIXES.some((suffix) => name.endsWith(suffix)) ? EXECUTABLE_MODE : READABLE_MODE;\n};\n\nconst assertInsideRoot = (root: string, rel: string, abs: string): void => {\n if (!isPathInside(root, abs)) {\n throw new Error(`Cannot stage \"${rel}\": it resolves outside the staging directory`);\n }\n};\n\nconst placeFile = (root: string, rel: string, mode: number, write: (target: string) => void): StagedFile => {\n const abs = join(root, rel);\n assertInsideRoot(root, rel, abs);\n mkdirSync(dirname(abs), { recursive: true });\n write(abs);\n chmodSync(abs, mode);\n\n return { rel, abs, mode };\n};\n\nconst copyInto = (root: string, rel: string, source: string, mode = modeFor(rel)): StagedFile =>\n placeFile(root, rel, mode, (target) => {\n copyFileSync(source, target);\n });\n\nconst writeInto = (root: string, rel: string, contents: string, mode = READABLE_MODE): StagedFile =>\n placeFile(root, rel, mode, (target) => {\n writeFileSync(target, contents);\n });\n\nconst sourceMode = (path: string): number => statSync(path).mode & MODE_MASK;\n\nconst executableModeFor = (path: string): number =>\n (sourceMode(path) & EXECUTE_MASK) === 0 ? READABLE_MODE : EXECUTABLE_MODE;\n\nconst copyTree = (root: string, relBase: string, sourceDir: string): StagedFile[] =>\n listFilesRecursive(sourceDir)\n .map((file) => copyInto(root, join(relBase, file.rel), file.absPath, sourceMode(file.absPath)));\n\nexport { copyInto, copyTree, EXECUTABLE_MODE, executableModeFor, writeInto };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../../src/deploy/payload/stage.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAa5G,KAAK,YAAY,GAAG;IAChB,QAAQ,EAAE,cAAc,CAAC;IACzB,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,cAAc,CAAC;CAC5B,CAAC;AAEF,KAAK,cAAc,GAAG;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAAC;AAIF,QAAA,MAAM,gBAAgB,wBAAwB,CAAC;AAmB/C,QAAA,MAAM,kBAAkB,GAAI,UAAU,cAAc,KAAG,MAA8C,CAAC;AACtG,QAAA,MAAM,kBAAkB,GAAI,UAAU,cAAc,KAAG,MAA0D,CAAC;AAQlH,QAAA,MAAM,sBAAsB,GAAI,UAAU,cAAc,KAAG,MACe,CAAC;AA8C3E,QAAA,MAAM,YAAY,GAAI,8BAA8B,YAAY,KAAG,UAAU,EAc5E,CAAC;AA0DF,QAAA,MAAM,aAAa,GACf,UAAU,cAAc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AAa,EACb,YAAY,GACf,CAAC"}
@@ -13,7 +13,6 @@ import { stageIcons } from "./icons.js";
13
13
  import { NODE_FILENAME, renderLauncher } from "./launcher.js";
14
14
  import { stageSchemas } from "./schemas.js";
15
15
  const DIST_ICONS_DIR = "icons";
16
- const LEGACY_PACKAGES_MANIFEST_FILENAME = "gtkx-packages.json";
17
16
  const NOTICES_FILENAME = "THIRD-PARTY-NOTICES";
18
17
  const NODE_LICENSE_FILENAME = "LICENSE";
19
18
  const SHARE_APPLICATIONS = "share/applications";
@@ -34,7 +33,6 @@ const licenseDirFor = (settings) => `${SHARE_LICENSES}/${settings.binaryName}`;
34
33
  const licenseDestination = (settings) => `${licenseDirFor(settings)}/LICENSE`;
35
34
  const noticesDestination = (settings) => `${licenseDirFor(settings)}/${NOTICES_FILENAME}`;
36
35
  const isIconAsset = (rel) => rel === DIST_ICONS_DIR || rel.startsWith(`${DIST_ICONS_DIR}/`);
37
- const isBuildMetadata = (rel) => rel === BUILD_MANIFEST_FILENAME || rel === LEGACY_PACKAGES_MANIFEST_FILENAME;
38
36
  const isLocaleAsset = (rel) => rel === LOCALE_DIRNAME || rel.startsWith(`${LOCALE_DIRNAME}/`);
39
37
  const nodeLicenseDestination = (settings) => `${licenseDirFor(settings)}/${NODE_FILENAME}/${NODE_LICENSE_FILENAME}`;
40
38
  const stageRuntimeFiles = (settings, root) => {
@@ -43,7 +41,7 @@ const stageRuntimeFiles = (settings, root) => {
43
41
  throw new Error(`Cannot deploy: ${join(dist, BUNDLE_FILENAME)} is missing. Run \`gtkx build\` first.`);
44
42
  }
45
43
  return listFilesRecursive(dist)
46
- .filter((file) => !isIconAsset(file.rel) && !isBuildMetadata(file.rel) && !isLocaleAsset(file.rel))
44
+ .filter((file) => !isIconAsset(file.rel) && file.rel !== BUILD_MANIFEST_FILENAME && !isLocaleAsset(file.rel))
47
45
  .map((file) => copyInto(root, join(libDirFor(settings), file.rel), file.absPath));
48
46
  };
49
47
  const stageCatalogs = (settings, root) => listF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,OAAO,CAAC,CAAC;SACzG,CAAC;IACN,CAAC;IAED,OAAO;QACH,GAAG,UAAU;QACb,GAAG,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;QAC5F,SAAS,CAAC,IAAI,EAAE,kBAAkB,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;KAClF,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAClB,QAAwB,EACxB,OAAwB,EACxB,QAAwB,EACc,EAAE,CAAC,CAAC;IAC1C,QAAQ,EAAE,YAAY,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC;IAC/D,GAAG,EAAE,YAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;IACrD,OAAO,EAAE,YAAY,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC;IAC7D,GAAG,EAAE,YAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;CACxD,CAAC,CAAC;AAEH,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAElB,aAAa,EACb,YAAY,GACf,CAAC","sourcesContent":["import { sortStringsBy } from \"@gtkx/utils\";\nimport { existsSync, rmSync } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\nimport type { DeploySettings, DeployTargetName, NodeRuntime, NoticeSection, StagedFile } from \"../types.js\";\nimport { LOCALE_DIRNAME } from \"../../i18n/catalogs.js\";\nimport { BUILD_MANIFEST_FILENAME } from \"../../internal/build-manifest.js\";\nimport { listFilesRecursive } from \"../../internal/list-files.js\";\nimport { BUNDLE_FILENAME } from \"../../vite-plugins/esm-extension.js\";\nimport { renderCopyright } from \"../freedesktop/copyright.js\";\nimport { renderDbusService } from \"../freedesktop/dbus-service.js\";\nimport { renderNotices } from \"../notices/render.js\";\nimport { copyInto, EXECUTABLE_MODE, executableModeFor, writeInto } from \"./copy-tree.js\";\nimport { stageIcons } from \"./icons.js\";\nimport { NODE_FILENAME, renderLauncher } from \"./launcher.js\";\nimport { stageSchemas } from \"./schemas.js\";\n\ntype StageRequest = {\n settings: DeploySettings;\n node: NodeRuntime | null;\n metadata: StagedMetadata;\n};\n\ntype StagedMetadata = {\n desktopEntry: string;\n metainfo: string;\n mimePackage: string | null;\n};\n\nconst DIST_ICONS_DIR = \"icons\";\nconst LEGACY_PACKAGES_MANIFEST_FILENAME = \"gtkx-packages.json\";\nconst NOTICES_FILENAME = \"THIRD-PARTY-NOTICES\";\nconst NODE_LICENSE_FILENAME = \"LICENSE\";\nconst SHARE_APPLICATIONS = \"share/applications\";\nconst SHARE_METAINFO = \"share/metainfo\";\nconst SHARE_MIME_PACKAGES = \"share/mime/packages\";\nconst SHARE_DOC = \"share/doc\";\nconst SHARE_LICENSES = \"share/licenses\";\nconst SHARE_DBUS_SERVICES = \"share/dbus-1/services\";\nconst SHARE_LOCALE = `share/${LOCALE_DIRNAME}`;\n\nconst PREFIX_FOR: Record<DeployTargetName, string> = {\n appimage: \"/usr\",\n deb: \"/usr\",\n flatpak: \"/app\",\n rpm: \"/usr\",\n};\n\nconst libDirFor = (settings: DeploySettings): string => `lib/${settings.binaryName}`;\nconst licenseDirFor = (settings: DeploySettings): string => `${SHARE_LICENSES}/${settings.binaryName}`;\nconst licenseDestination = (settings: DeploySettings): string => `${licenseDirFor(settings)}/LICENSE`;\nconst noticesDestination = (settings: DeploySettings): string => `${licenseDirFor(settings)}/${NOTICES_FILENAME}`;\nconst isIconAsset = (rel: string): boolean => rel === DIST_ICONS_DIR || rel.startsWith(`${DIST_ICONS_DIR}/`);\n\nconst isBuildMetadata = (rel: string): boolean =>\n rel === BUILD_MANIFEST_FILENAME || rel === LEGACY_PACKAGES_MANIFEST_FILENAME;\n\nconst isLocaleAsset = (rel: string): boolean => rel === LOCALE_DIRNAME || rel.startsWith(`${LOCALE_DIRNAME}/`);\n\nconst nodeLicenseDestination = (settings: DeploySettings): string =>\n `${licenseDirFor(settings)}/${NODE_FILENAME}/${NODE_LICENSE_FILENAME}`;\n\nconst stageRuntimeFiles = (settings: DeploySettings, root: string): StagedFile[] => {\n const dist = settings.paths.dist;\n\n if (!existsSync(join(dist, BUNDLE_FILENAME))) {\n throw new Error(`Cannot deploy: ${join(dist, BUNDLE_FILENAME)} is missing. Run \\`gtkx build\\` first.`);\n }\n\n return listFilesRecursive(dist)\n .filter((file) => !isIconAsset(file.rel) && !isBuildMetadata(file.rel) && !isLocaleAsset(file.rel))\n .map((file) => copyInto(root, join(libDirFor(settings), file.rel), file.absPath));\n};\n\nconst stageCatalogs = (settings: DeploySettings, root: string): StagedFile[] =>\n listFilesRecursive(join(settings.paths.dist, LOCALE_DIRNAME))\n .map((file) => copyInto(root, join(SHARE_LOCALE, file.rel), file.absPath));\n\nconst stageNodeBinary = (settings: DeploySettings, root: string, node: NodeRuntime | null): StagedFile[] =>\n node === null ? [] : [copyInto(root, join(libDirFor(settings), NODE_FILENAME), node.path, EXECUTABLE_MODE)];\n\nconst stageMetadata = (settings: DeploySettings, root: string, metadata: StagedMetadata): StagedFile[] => [\n writeInto(root, join(SHARE_APPLICATIONS, `${settings.applicationId}.desktop`), metadata.desktopEntry),\n writeInto(root, join(SHARE_METAINFO, `${settings.applicationId}.metainfo.xml`), metadata.metainfo),\n ...(metadata.mimePackage === null\n ? []\n : [writeInto(root, join(SHARE_MIME_PACKAGES, `${settings.applicationId}.xml`), metadata.mimePackage)]),\n];\n\nconst stageExtraFiles = (settings: DeploySettings, root: string): StagedFile[] =>\n settings.extraFiles.map((file) => {\n const source = resolve(settings.paths.root, file.source);\n\n return copyInto(root, file.destination, source, file.mode ?? executableModeFor(source));\n });\n\nconst byRelativePath = (files: StagedFile[]): StagedFile[] => {\n const latest: Map<string, StagedFile> = new Map();\n\n for (const file of files) {\n latest.set(file.rel, file);\n }\n\n return sortStringsBy(latest.values(), (file) => file.rel);\n};\n\nconst stagePayload = ({ settings, node, metadata }: StageRequest): StagedFile[] => {\n const root = settings.paths.stage;\n rmSync(root, { recursive: true, force: true, maxRetries: 5 });\n\n return byRelativePath([\n writeInto(root, join(\"bin\", settings.binaryName), renderLauncher(settings), EXECUTABLE_MODE),\n ...stageNodeBinary(settings, root, node),\n ...stageRuntimeFiles(settings, root),\n ...stageCatalogs(settings, root),\n ...stageMetadata(settings, root, metadata),\n ...stageIcons(settings, root),\n ...stageSchemas(settings, root),\n ...stageExtraFiles(settings, root),\n ]);\n};\n\nconst withoutDbusActivation = (desktopEntry: string): string =>\n desktopEntry\n .split(\"\\n\")\n .filter((line) => line !== \"DBusActivatable=true\")\n .join(\"\\n\");\n\nconst stageActivation = (\n settings: DeploySettings,\n root: string,\n target: DeployTargetName,\n metadata: StagedMetadata,\n): StagedFile[] => {\n if (!settings.isDbusActivatable) {\n return [];\n }\n\n if (target === \"appimage\") {\n return [writeInto(\n root,\n join(SHARE_APPLICATIONS, `${settings.applicationId}.desktop`),\n withoutDbusActivation(metadata.desktopEntry),\n )];\n }\n\n return [writeInto(\n root,\n join(SHARE_DBUS_SERVICES, `${settings.applicationId}.service`),\n renderDbusService(settings, PREFIX_FOR[target]),\n )];\n};\n\nconst stageOverlay = (\n settings: DeploySettings,\n target: DeployTargetName,\n notices: NoticeSection[],\n metadata: StagedMetadata,\n): StagedFile[] => {\n const root = join(settings.paths.overlay, target);\n rmSync(root, { recursive: true, force: true, maxRetries: 5 });\n const licenseFile = settings.paths.licenseFile;\n const activation = stageActivation(settings, root, target, metadata);\n\n if (target === \"deb\") {\n return [\n ...activation,\n writeInto(root, join(SHARE_DOC, settings.binaryName, \"copyright\"), renderCopyright(settings, notices)),\n ];\n }\n\n return [\n ...activation,\n ...(licenseFile === null ? [] : [copyInto(root, licenseDestination(settings), licenseFile)]),\n writeInto(root, noticesDestination(settings), renderNotices(settings, notices)),\n ];\n};\n\nconst stageOverlays = (\n settings: DeploySettings,\n notices: NoticeSection[],\n metadata: StagedMetadata,\n): Record<DeployTargetName, StagedFile[]> => ({\n appimage: stageOverlay(settings, \"appimage\", notices, metadata),\n deb: stageOverlay(settings, \"deb\", notices, metadata),\n flatpak: stageOverlay(settings, \"flatpak\", notices, metadata),\n rpm: stageOverlay(settings, \"rpm\", notices, metadata),\n});\n\nexport {\n licenseDestination,\n nodeLicenseDestination,\n NOTICES_FILENAME,\n noticesDestination,\n type StagedMetadata,\n stageOverlays,\n stagePayload,\n};\n"]}
1
+ {"version":3,"file":"stage.js","sourceRoot":"","sources":["../../../src/deploy/payload/stage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO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,CAAC;IAErE,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;QACnB,OAAO;YACH,GAAG,UAAU;YACb,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;SACzG,CAAC;IACN,CAAC;IAED,OAAO;QACH,GAAG,UAAU;QACb,GAAG,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;QAC5F,SAAS,CAAC,IAAI,EAAE,kBAAkB,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;KAClF,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAClB,QAAwB,EACxB,OAAwB,EACxB,QAAwB,EACc,EAAE,CAAC,CAAC;IAC1C,QAAQ,EAAE,YAAY,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC;IAC/D,GAAG,EAAE,YAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;IACrD,OAAO,EAAE,YAAY,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC;IAC7D,GAAG,EAAE,YAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;CACxD,CAAC,CAAC;AAEH,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAElB,aAAa,EACb,YAAY,GACf,CAAC","sourcesContent":["import { sortStringsBy } from \"@gtkx/utils\";\nimport { existsSync, rmSync } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\nimport type { DeploySettings, DeployTargetName, NodeRuntime, NoticeSection, StagedFile } from \"../types.js\";\nimport { LOCALE_DIRNAME } from \"../../i18n/catalogs.js\";\nimport { BUILD_MANIFEST_FILENAME } from \"../../internal/build-manifest.js\";\nimport { listFilesRecursive } from \"../../internal/list-files.js\";\nimport { BUNDLE_FILENAME } from \"../../vite-plugins/esm-extension.js\";\nimport { renderCopyright } from \"../freedesktop/copyright.js\";\nimport { renderDbusService } from \"../freedesktop/dbus-service.js\";\nimport { renderNotices } from \"../notices/render.js\";\nimport { copyInto, EXECUTABLE_MODE, executableModeFor, writeInto } from \"./copy-tree.js\";\nimport { stageIcons } from \"./icons.js\";\nimport { NODE_FILENAME, renderLauncher } from \"./launcher.js\";\nimport { stageSchemas } from \"./schemas.js\";\n\ntype StageRequest = {\n settings: DeploySettings;\n node: NodeRuntime | null;\n metadata: StagedMetadata;\n};\n\ntype StagedMetadata = {\n desktopEntry: string;\n metainfo: string;\n mimePackage: string | null;\n};\n\nconst DIST_ICONS_DIR = \"icons\";\nconst NOTICES_FILENAME = \"THIRD-PARTY-NOTICES\";\nconst NODE_LICENSE_FILENAME = \"LICENSE\";\nconst SHARE_APPLICATIONS = \"share/applications\";\nconst SHARE_METAINFO = \"share/metainfo\";\nconst SHARE_MIME_PACKAGES = \"share/mime/packages\";\nconst SHARE_DOC = \"share/doc\";\nconst SHARE_LICENSES = \"share/licenses\";\nconst SHARE_DBUS_SERVICES = \"share/dbus-1/services\";\nconst SHARE_LOCALE = `share/${LOCALE_DIRNAME}`;\n\nconst PREFIX_FOR: Record<DeployTargetName, string> = {\n appimage: \"/usr\",\n deb: \"/usr\",\n flatpak: \"/app\",\n rpm: \"/usr\",\n};\n\nconst libDirFor = (settings: DeploySettings): string => `lib/${settings.binaryName}`;\nconst licenseDirFor = (settings: DeploySettings): string => `${SHARE_LICENSES}/${settings.binaryName}`;\nconst licenseDestination = (settings: DeploySettings): string => `${licenseDirFor(settings)}/LICENSE`;\nconst noticesDestination = (settings: DeploySettings): string => `${licenseDirFor(settings)}/${NOTICES_FILENAME}`;\nconst isIconAsset = (rel: string): boolean => rel === DIST_ICONS_DIR || rel.startsWith(`${DIST_ICONS_DIR}/`);\nconst isLocaleAsset = (rel: string): boolean => rel === LOCALE_DIRNAME || rel.startsWith(`${LOCALE_DIRNAME}/`);\n\nconst nodeLicenseDestination = (settings: DeploySettings): string =>\n `${licenseDirFor(settings)}/${NODE_FILENAME}/${NODE_LICENSE_FILENAME}`;\n\nconst stageRuntimeFiles = (settings: DeploySettings, root: string): StagedFile[] => {\n const dist = settings.paths.dist;\n\n if (!existsSync(join(dist, BUNDLE_FILENAME))) {\n throw new Error(`Cannot deploy: ${join(dist, BUNDLE_FILENAME)} is missing. Run \\`gtkx build\\` first.`);\n }\n\n return listFilesRecursive(dist)\n .filter((file) =>\n !isIconAsset(file.rel) && file.rel !== BUILD_MANIFEST_FILENAME && !isLocaleAsset(file.rel))\n .map((file) => copyInto(root, join(libDirFor(settings), file.rel), file.absPath));\n};\n\nconst stageCatalogs = (settings: DeploySettings, root: string): StagedFile[] =>\n listFilesRecursive(join(settings.paths.dist, LOCALE_DIRNAME))\n .map((file) => copyInto(root, join(SHARE_LOCALE, file.rel), file.absPath));\n\nconst stageNodeBinary = (settings: DeploySettings, root: string, node: NodeRuntime | null): StagedFile[] =>\n node === null ? [] : [copyInto(root, join(libDirFor(settings), NODE_FILENAME), node.path, EXECUTABLE_MODE)];\n\nconst stageMetadata = (settings: DeploySettings, root: string, metadata: StagedMetadata): StagedFile[] => [\n writeInto(root, join(SHARE_APPLICATIONS, `${settings.applicationId}.desktop`), metadata.desktopEntry),\n writeInto(root, join(SHARE_METAINFO, `${settings.applicationId}.metainfo.xml`), metadata.metainfo),\n ...(metadata.mimePackage === null\n ? []\n : [writeInto(root, join(SHARE_MIME_PACKAGES, `${settings.applicationId}.xml`), metadata.mimePackage)]),\n];\n\nconst stageExtraFiles = (settings: DeploySettings, root: string): StagedFile[] =>\n settings.extraFiles.map((file) => {\n const source = resolve(settings.paths.root, file.source);\n\n return copyInto(root, file.destination, source, file.mode ?? executableModeFor(source));\n });\n\nconst byRelativePath = (files: StagedFile[]): StagedFile[] => {\n const latest: Map<string, StagedFile> = new Map();\n\n for (const file of files) {\n latest.set(file.rel, file);\n }\n\n return sortStringsBy(latest.values(), (file) => file.rel);\n};\n\nconst stagePayload = ({ settings, node, metadata }: StageRequest): StagedFile[] => {\n const root = settings.paths.stage;\n rmSync(root, { recursive: true, force: true, maxRetries: 5 });\n\n return byRelativePath([\n writeInto(root, join(\"bin\", settings.binaryName), renderLauncher(settings), EXECUTABLE_MODE),\n ...stageNodeBinary(settings, root, node),\n ...stageRuntimeFiles(settings, root),\n ...stageCatalogs(settings, root),\n ...stageMetadata(settings, root, metadata),\n ...stageIcons(settings, root),\n ...stageSchemas(settings, root),\n ...stageExtraFiles(settings, root),\n ]);\n};\n\nconst withoutDbusActivation = (desktopEntry: string): string =>\n desktopEntry\n .split(\"\\n\")\n .filter((line) => line !== \"DBusActivatable=true\")\n .join(\"\\n\");\n\nconst stageActivation = (\n settings: DeploySettings,\n root: string,\n target: DeployTargetName,\n metadata: StagedMetadata,\n): StagedFile[] => {\n if (!settings.isDbusActivatable) {\n return [];\n }\n\n if (target === \"appimage\") {\n return [writeInto(\n root,\n join(SHARE_APPLICATIONS, `${settings.applicationId}.desktop`),\n withoutDbusActivation(metadata.desktopEntry),\n )];\n }\n\n return [writeInto(\n root,\n join(SHARE_DBUS_SERVICES, `${settings.applicationId}.service`),\n renderDbusService(settings, PREFIX_FOR[target]),\n )];\n};\n\nconst stageOverlay = (\n settings: DeploySettings,\n target: DeployTargetName,\n notices: NoticeSection[],\n metadata: StagedMetadata,\n): StagedFile[] => {\n const root = join(settings.paths.overlay, target);\n rmSync(root, { recursive: true, force: true, maxRetries: 5 });\n const licenseFile = settings.paths.licenseFile;\n const activation = stageActivation(settings, root, target, metadata);\n\n if (target === \"deb\") {\n return [\n ...activation,\n writeInto(root, join(SHARE_DOC, settings.binaryName, \"copyright\"), renderCopyright(settings, notices)),\n ];\n }\n\n return [\n ...activation,\n ...(licenseFile === null ? [] : [copyInto(root, licenseDestination(settings), licenseFile)]),\n writeInto(root, noticesDestination(settings), renderNotices(settings, notices)),\n ];\n};\n\nconst stageOverlays = (\n settings: DeploySettings,\n notices: NoticeSection[],\n metadata: StagedMetadata,\n): Record<DeployTargetName, StagedFile[]> => ({\n appimage: stageOverlay(settings, \"appimage\", notices, metadata),\n deb: stageOverlay(settings, \"deb\", notices, metadata),\n flatpak: stageOverlay(settings, \"flatpak\", notices, metadata),\n rpm: stageOverlay(settings, \"rpm\", notices, metadata),\n});\n\nexport {\n licenseDestination,\n nodeLicenseDestination,\n NOTICES_FILENAME,\n noticesDestination,\n type StagedMetadata,\n stageOverlays,\n stagePayload,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"build-manifest.d.ts","sourceRoot":"","sources":["../../../src/deploy/settings/build-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAKH,KAAK,eAAe,EACvB,MAAM,kCAAkC,CAAC;AAO1C,KAAK,qBAAqB,GAAG;IACzB,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,WAAW,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAqFF,QAAA,MAAM,iBAAiB,GAAI,UAAU,cAAc,KAAG,qBAcrD,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"build-manifest.d.ts","sourceRoot":"","sources":["../../../src/deploy/settings/build-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAKH,KAAK,eAAe,EACvB,MAAM,kCAAkC,CAAC;AAO1C,KAAK,qBAAqB,GAAG;IACzB,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,WAAW,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAyEF,QAAA,MAAM,iBAAiB,GAAI,UAAU,cAAc,KAAG,qBAcrD,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
- import { isRecord, sortStrings } from "@gtkx/utils";
1
+ import { isPathInside, isRecord, sortStrings } from "@gtkx/utils";
2
2
  import { existsSync, readFileSync, statSync } from "node:fs";
3
- import { isAbsolute, join, relative, resolve, sep } from "node:path";
3
+ import { isAbsolute, join, resolve } from "node:path";
4
4
  import { BUILD_MANIFEST_FILENAME, BUILD_MANIFEST_FORMAT_VERSION, BUILD_MANIFEST_GENERATOR, } from "../../internal/build-manifest.js";
5
5
  import { assertUniqueSchemaBasenames, projectRelativeSchemaPath, SCHEMA_SUFFIX, } from "../../settings/schema.js";
6
6
  const invalidManifest = (path) => new Error(`Cannot deploy: ${path} is not a valid GTKX build manifest. Run \`gtkx build\` again.`);
@@ -36,24 +36,13 @@ const parseBuildManifest = (value, path) => {
36
36
  packages: packages.map((entry) => recordedPackage(entry, path)),
37
37
  };
38
38
  };
39
- const isFile = (path) => {
40
- try {
41
- return statSync(path, { throwIfNoEntry: false })?.isFile() === true;
42
- }
43
- catch {
44
- return false;
45
- }
46
- };
47
- const isInsideProject = (root, filePath) => {
48
- const rel = relative(root, filePath);
49
- return rel.length > 0 && rel !== ".." && !rel.startsWith(`..${sep}`) && !isAbsolute(rel);
50
- };
39
+ const isFile = (path) => statSync(path, { throwIfNoEntry: false })?.isFile() === true;
51
40
  const resolveRecordedSchema = (root, manifestPath, entry) => {
52
41
  if (isAbsolute(entry) || !entry.endsWith(SCHEMA_SUFFIX)) {
53
42
  throw new Error(`Cannot deploy: ${manifestPath} records an invalid GSettings schema path.`);
54
43
  }
55
44
  const filePath = resolve(root, entry);
56
- if (!isInsideProject(root, filePath)) {
45
+ if (!isPathInside(root, filePath)) {
57
46
  throw new Error(`Cannot deploy: ${manifestPath} records a GSettings schema outside the project.`);
58
47
  }
59
48
  if (!isFile(filePath)) {
@@ -1 +1 @@
1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B,YAAY,wCAAwC,CAAC,CAAC;IAC5F,CAAC;IAED,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;IACvE,MAAM,QAAQ,GAAG,kBAAkB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC1D,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,qBAAqB,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC;IAC/G,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3C,2BAA2B,CAAC,MAAM,CAAC,CAAC;IAEpC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;AAChE,CAAC,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC","sourcesContent":["import { isRecord, sortStrings } from \"@gtkx/utils\";\nimport { existsSync, readFileSync, statSync } from \"node:fs\";\nimport { isAbsolute, join, relative, resolve, sep } from \"node:path\";\nimport type { DeploySettings } from \"../types.js\";\nimport {\n BUILD_MANIFEST_FILENAME,\n BUILD_MANIFEST_FORMAT_VERSION,\n BUILD_MANIFEST_GENERATOR,\n type BuildManifest,\n type RecordedPackage,\n} from \"../../internal/build-manifest.js\";\nimport {\n assertUniqueSchemaBasenames,\n projectRelativeSchemaPath,\n SCHEMA_SUFFIX,\n} from \"../../settings/schema.js\";\n\ntype ResolvedBuildManifest = {\n packages: RecordedPackage[];\n schemaFiles: string[];\n};\n\nconst invalidManifest = (path: string): Error =>\n new Error(`Cannot deploy: ${path} is not a valid GTKX build manifest. Run \\`gtkx build\\` again.`);\n\nconst recordedSchemas = (value: unknown[], path: string): string[] =>\n value.map((entry) => {\n if (typeof entry !== \"string\") {\n throw invalidManifest(path);\n }\n\n return entry;\n });\n\nconst recordedPackage = (value: unknown, path: string): RecordedPackage => {\n if (\n !isRecord(value) ||\n typeof value.name !== \"string\" ||\n typeof value.dir !== \"string\" ||\n isAbsolute(value.dir) ||\n (value.version !== null && typeof value.version !== \"string\")\n ) {\n throw invalidManifest(path);\n }\n\n return { name: value.name, version: value.version, dir: value.dir };\n};\n\nconst parseBuildManifest = (value: unknown, path: string): BuildManifest => {\n if (\n !isRecord(value) ||\n value.generator !== BUILD_MANIFEST_GENERATOR ||\n value.formatVersion !== BUILD_MANIFEST_FORMAT_VERSION ||\n !Array.isArray(value.schemas) ||\n !Array.isArray(value.packages)\n ) {\n throw invalidManifest(path);\n }\n\n const packages: unknown[] = value.packages;\n\n return {\n generator: BUILD_MANIFEST_GENERATOR,\n formatVersion: BUILD_MANIFEST_FORMAT_VERSION,\n schemas: recordedSchemas(value.schemas, path),\n packages: packages.map((entry) => recordedPackage(entry, path)),\n };\n};\n\nconst isFile = (path: string): boolean => {\n try {\n return statSync(path, { throwIfNoEntry: false })?.isFile() === true;\n } catch {\n return false;\n }\n};\n\nconst isInsideProject = (root: string, filePath: string): boolean => {\n const rel = relative(root, filePath);\n\n return rel.length > 0 && rel !== \"..\" && !rel.startsWith(`..${sep}`) && !isAbsolute(rel);\n};\n\nconst resolveRecordedSchema = (root: string, manifestPath: string, entry: string): string => {\n if (isAbsolute(entry) || !entry.endsWith(SCHEMA_SUFFIX)) {\n throw new Error(`Cannot deploy: ${manifestPath} records an invalid GSettings schema path.`);\n }\n\n const filePath = resolve(root, entry);\n\n if (!isInsideProject(root, filePath)) {\n throw new Error(`Cannot deploy: ${manifestPath} records a GSettings schema outside the project.`);\n }\n\n if (!isFile(filePath)) {\n throw new Error(`Cannot deploy: the recorded GSettings schema ${filePath} is missing.`);\n }\n\n if (projectRelativeSchemaPath(root, filePath) === null) {\n throw new Error(`Cannot deploy: ${manifestPath} records a GSettings schema outside the project.`);\n }\n\n return filePath;\n};\n\nconst readBuildManifest = (settings: DeploySettings): ResolvedBuildManifest => {\n const manifestPath = join(settings.paths.dist, BUILD_MANIFEST_FILENAME);\n\n if (!existsSync(manifestPath)) {\n throw new Error(`Cannot deploy: ${manifestPath} is missing. Run \\`gtkx build\\` first.`);\n }\n\n const parsed: unknown = JSON.parse(readFileSync(manifestPath, \"utf8\"));\n const manifest = parseBuildManifest(parsed, manifestPath);\n const files = manifest.schemas.map((entry) => resolveRecordedSchema(settings.paths.root, manifestPath, entry));\n const unique = sortStrings(new Set(files));\n assertUniqueSchemaBasenames(unique);\n\n return { packages: manifest.packages, schemaFiles: unique };\n};\n\nexport { readBuildManifest };\n"]}
1
+ {"version":3,"file":"build-manifest.js","sourceRoot":"","sources":["../../../src/deploy/settings/build-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEtD,OAAO,EACH,uBAAuB,EACvB,6BAA6B,EAC7B,wBAAwB,GAG3B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACH,2BAA2B,EAC3B,yBAAyB,EACzB,aAAa,GAChB,MAAM,0BAA0B,CAAC;AAOlC,MAAM,eAAe,GAAG,CAAC,IAAY,EAAS,EAAE,CAC5C,IAAI,KAAK,CAAC,kBAAkB,IAAI,gEAAgE,CAAC,CAAC;AAEtG,MAAM,eAAe,GAAG,CAAC,KAAgB,EAAE,IAAY,EAAY,EAAE,CACjE,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;IAChB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,MAAM,eAAe,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,KAAK,CAAC;AACj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CAAC;IAC5F,CAAC;IAED,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;IACvE,MAAM,QAAQ,GAAG,kBAAkB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC1D,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,qBAAqB,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC;IAC/G,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3C,2BAA2B,CAAC,MAAM,CAAC,CAAC;IAEpC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;AAChE,CAAC,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC","sourcesContent":["import { isPathInside, isRecord, sortStrings } from \"@gtkx/utils\";\nimport { existsSync, readFileSync, statSync } from \"node:fs\";\nimport { isAbsolute, join, resolve } from \"node:path\";\nimport type { DeploySettings } from \"../types.js\";\nimport {\n BUILD_MANIFEST_FILENAME,\n BUILD_MANIFEST_FORMAT_VERSION,\n BUILD_MANIFEST_GENERATOR,\n type BuildManifest,\n type RecordedPackage,\n} from \"../../internal/build-manifest.js\";\nimport {\n assertUniqueSchemaBasenames,\n projectRelativeSchemaPath,\n SCHEMA_SUFFIX,\n} from \"../../settings/schema.js\";\n\ntype ResolvedBuildManifest = {\n packages: RecordedPackage[];\n schemaFiles: string[];\n};\n\nconst invalidManifest = (path: string): Error =>\n new Error(`Cannot deploy: ${path} is not a valid GTKX build manifest. Run \\`gtkx build\\` again.`);\n\nconst recordedSchemas = (value: unknown[], path: string): string[] =>\n value.map((entry) => {\n if (typeof entry !== \"string\") {\n throw invalidManifest(path);\n }\n\n return entry;\n });\n\nconst recordedPackage = (value: unknown, path: string): RecordedPackage => {\n if (\n !isRecord(value) ||\n typeof value.name !== \"string\" ||\n typeof value.dir !== \"string\" ||\n isAbsolute(value.dir) ||\n (value.version !== null && typeof value.version !== \"string\")\n ) {\n throw invalidManifest(path);\n }\n\n return { name: value.name, version: value.version, dir: value.dir };\n};\n\nconst parseBuildManifest = (value: unknown, path: string): BuildManifest => {\n if (\n !isRecord(value) ||\n value.generator !== BUILD_MANIFEST_GENERATOR ||\n value.formatVersion !== BUILD_MANIFEST_FORMAT_VERSION ||\n !Array.isArray(value.schemas) ||\n !Array.isArray(value.packages)\n ) {\n throw invalidManifest(path);\n }\n\n const packages: unknown[] = value.packages;\n\n return {\n generator: BUILD_MANIFEST_GENERATOR,\n formatVersion: BUILD_MANIFEST_FORMAT_VERSION,\n schemas: recordedSchemas(value.schemas, path),\n packages: packages.map((entry) => recordedPackage(entry, path)),\n };\n};\n\nconst isFile = (path: string): boolean => statSync(path, { throwIfNoEntry: false })?.isFile() === true;\n\nconst resolveRecordedSchema = (root: string, manifestPath: string, entry: string): string => {\n if (isAbsolute(entry) || !entry.endsWith(SCHEMA_SUFFIX)) {\n throw new Error(`Cannot deploy: ${manifestPath} records an invalid GSettings schema path.`);\n }\n\n const filePath = resolve(root, entry);\n\n if (!isPathInside(root, filePath)) {\n throw new Error(`Cannot deploy: ${manifestPath} records a GSettings schema outside the project.`);\n }\n\n if (!isFile(filePath)) {\n throw new Error(`Cannot deploy: the recorded GSettings schema ${filePath} is missing.`);\n }\n\n if (projectRelativeSchemaPath(root, filePath) === null) {\n throw new Error(`Cannot deploy: ${manifestPath} records a GSettings schema outside the project.`);\n }\n\n return filePath;\n};\n\nconst readBuildManifest = (settings: DeploySettings): ResolvedBuildManifest => {\n const manifestPath = join(settings.paths.dist, BUILD_MANIFEST_FILENAME);\n\n if (!existsSync(manifestPath)) {\n throw new Error(`Cannot deploy: ${manifestPath} is missing. Run \\`gtkx build\\` first.`);\n }\n\n const parsed: unknown = JSON.parse(readFileSync(manifestPath, \"utf8\"));\n const manifest = parseBuildManifest(parsed, manifestPath);\n const files = manifest.schemas.map((entry) => resolveRecordedSchema(settings.paths.root, manifestPath, entry));\n const unique = sortStrings(new Set(files));\n assertUniqueSchemaBasenames(unique);\n\n return { packages: manifest.packages, schemaFiles: unique };\n};\n\nexport { readBuildManifest };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"libraries.d.ts","sourceRoot":"","sources":["../../../src/deploy/settings/libraries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAS3C,KAAK,iBAAiB,GAAG;IACrB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClD,CAAC;AAiCF,QAAA,MAAM,gBAAgB,GAAI,MAAM,MAAM,EAAE,QAAQ,MAAM,KAAG,iBASxD,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"libraries.d.ts","sourceRoot":"","sources":["../../../src/deploy/settings/libraries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAQ3C,KAAK,iBAAiB,GAAG;IACrB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClD,CAAC;AAUF,QAAA,MAAM,gBAAgB,GAAI,MAAM,MAAM,EAAE,QAAQ,MAAM,KAAG,iBASxD,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,6 +1,4 @@
1
- import { resolveLibraries as expandLibraries, readGeneratedLibraries, resolveGirPath, resolveStore, } from "@gtkx/codegen";
2
- const DEFAULT_LIBRARY = "Gtk-4.0";
3
- const DEFAULT_LIBRARY_PREFIX = "Gtk-";
1
+ import { resolveLibraries as expandLibraries, readGeneratedLibraries, resolveStore, } from "@gtkx/codegen";
4
2
  const generatedLibraries = (root) => {
5
3
  try {
6
4
  return readGeneratedLibraries(resolveStore(root).gi.storeDir);
@@ -9,26 +7,9 @@ const generatedLibraries = (root) => {
9
7
  return null;
10
8
  }
11
9
  };
12
- const discoveredLibraries = (config) => {
13
- try {
14
- return expandLibraries(config.libraries, resolveGirPath(config.girPath));
15
- }
16
- catch {
17
- return null;
18
- }
19
- };
20
- const configLibraries = (config) => {
21
- const libraries = config.libraries;
22
- if (!Array.isArray(libraries)) {
23
- return discoveredLibraries(config) ?? [DEFAULT_LIBRARY];
24
- }
25
- return libraries.some((library) => library.startsWith(DEFAULT_LIBRARY_PREFIX))
26
- ? [...libraries]
27
- : [DEFAULT_LIBRARY, ...libraries];
28
- };
29
10
  const resolveLibraries = (root, config) => {
30
11
  const generated = generatedLibraries(root);
31
- const libraries = generated?.libraries ?? configLibraries(config);
12
+ const libraries = generated?.libraries ?? expandLibraries(config.libraries);
32
13
  const deploy = config.deploy ?? {};
33
14
  return {
34
15
  libraries,
@@ -1 +1 @@
1
- {"version":3,"file":"libraries.js","sourceRoot":"","sources":["../../../src/deploy/settings/libraries.ts"],"names":[],"mappings":"AACA,OAAO,EACH,gBAAgB,IAAI,eAAe,EAEnC,sBAAsB,EACtB,cAAc,EACd,YAAY,GACf,MAAM,eAAe,CAAC;AAOvB,MAAM,eAAe,GAAG,SAAS,CAAC;AAClC,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAEtC,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAA6B,EAAE;IACnE,IAAI,CAAC;QACD,OAAO,sBAAsB,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IAClE,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,IAAI,CAAC;IAChB,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,CAAC,MAAc,EAAmB,EAAE;IAC5D,IAAI,CAAC;QACD,OAAO,eAAe,CAAC,MAAM,CAAC,SAAS,EAAE,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAC7E,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,IAAI,CAAC;IAChB,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,MAAc,EAAY,EAAE;IACjD,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;IAEnC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QAC5B,OAAO,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC;QAC1E,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;QAChB,CAAC,CAAC,CAAC,eAAe,EAAE,GAAG,SAAS,CAAC,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAE,MAAc,EAAqB,EAAE;IACzE,MAAM,SAAS,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,SAAS,GAAG,SAAS,EAAE,SAAS,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;IAClE,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC;IAEnC,OAAO;QACH,SAAS;QACT,sBAAsB,EAAE,MAAM,CAAC,sBAAsB,IAAI,EAAE;KAC9D,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC","sourcesContent":["import type { Config } from \"@gtkx/config\";\nimport {\n resolveLibraries as expandLibraries,\n type GeneratedLibraries,\n readGeneratedLibraries,\n resolveGirPath,\n resolveStore,\n} from \"@gtkx/codegen\";\n\ntype ResolvedLibraries = {\n libraries: string[];\n minimumLibraryVersions: Record<string, string>;\n};\n\nconst DEFAULT_LIBRARY = \"Gtk-4.0\";\nconst DEFAULT_LIBRARY_PREFIX = \"Gtk-\";\n\nconst generatedLibraries = (root: string): GeneratedLibraries | null => {\n try {\n return readGeneratedLibraries(resolveStore(root).gi.storeDir);\n } catch {\n return null;\n }\n};\n\nconst discoveredLibraries = (config: Config): string[] | null => {\n try {\n return expandLibraries(config.libraries, resolveGirPath(config.girPath));\n } catch {\n return null;\n }\n};\n\nconst configLibraries = (config: Config): string[] => {\n const libraries = config.libraries;\n\n if (!Array.isArray(libraries)) {\n return discoveredLibraries(config) ?? [DEFAULT_LIBRARY];\n }\n\n return libraries.some((library) => library.startsWith(DEFAULT_LIBRARY_PREFIX))\n ? [...libraries]\n : [DEFAULT_LIBRARY, ...libraries];\n};\n\nconst resolveLibraries = (root: string, config: Config): ResolvedLibraries => {\n const generated = generatedLibraries(root);\n const libraries = generated?.libraries ?? configLibraries(config);\n const deploy = config.deploy ?? {};\n\n return {\n libraries,\n minimumLibraryVersions: deploy.minimumLibraryVersions ?? {},\n };\n};\n\nexport { resolveLibraries };\n"]}
1
+ {"version":3,"file":"libraries.js","sourceRoot":"","sources":["../../../src/deploy/settings/libraries.ts"],"names":[],"mappings":"AACA,OAAO,EACH,gBAAgB,IAAI,eAAe,EAEnC,sBAAsB,EACtB,YAAY,GACf,MAAM,eAAe,CAAC;AAOvB,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAA6B,EAAE;IACnE,IAAI,CAAC;QACD,OAAO,sBAAsB,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IAClE,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,IAAI,CAAC;IAChB,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAE,MAAc,EAAqB,EAAE;IACzE,MAAM,SAAS,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,SAAS,GAAG,SAAS,EAAE,SAAS,IAAI,eAAe,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC5E,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC;IAEnC,OAAO;QACH,SAAS;QACT,sBAAsB,EAAE,MAAM,CAAC,sBAAsB,IAAI,EAAE;KAC9D,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC","sourcesContent":["import type { Config } from \"@gtkx/config\";\nimport {\n resolveLibraries as expandLibraries,\n type GeneratedLibraries,\n readGeneratedLibraries,\n resolveStore,\n} from \"@gtkx/codegen\";\n\ntype ResolvedLibraries = {\n libraries: string[];\n minimumLibraryVersions: Record<string, string>;\n};\n\nconst generatedLibraries = (root: string): GeneratedLibraries | null => {\n try {\n return readGeneratedLibraries(resolveStore(root).gi.storeDir);\n } catch {\n return null;\n }\n};\n\nconst resolveLibraries = (root: string, config: Config): ResolvedLibraries => {\n const generated = generatedLibraries(root);\n const libraries = generated?.libraries ?? expandLibraries(config.libraries);\n const deploy = config.deploy ?? {};\n\n return {\n libraries,\n minimumLibraryVersions: deploy.minimumLibraryVersions ?? {},\n };\n};\n\nexport { resolveLibraries };\n"]}
@@ -7,7 +7,6 @@ type PathsRequest = {
7
7
  applicationId: Config["applicationId"];
8
8
  outDirOverride: string | undefined;
9
9
  };
10
- declare const isInside: (parent: string, candidate: string) => boolean;
11
10
  declare const resolvePaths: (request: PathsRequest) => DeployPaths;
12
- export { isInside, resolvePaths };
11
+ export { resolvePaths };
13
12
  //# sourceMappingURL=paths.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/deploy/settings/paths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG7D,KAAK,YAAY,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,YAAY,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAC3C,aAAa,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC;IACvC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,CAAC;AAMF,QAAA,MAAM,QAAQ,GAAI,QAAQ,MAAM,EAAE,WAAW,MAAM,KAAG,OAIrD,CAAC;AAmCF,QAAA,MAAM,YAAY,GAAI,SAAS,YAAY,KAAG,WAkB7C,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/deploy/settings/paths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG7D,KAAK,YAAY,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,YAAY,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAC3C,aAAa,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC;IACvC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,CAAC;AAkCF,QAAA,MAAM,YAAY,GAAI,SAAS,YAAY,KAAG,WAkB7C,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,29 +1,19 @@
1
+ import { isPathInside } from "@gtkx/utils";
1
2
  import { statSync } from "node:fs";
2
- import { isAbsolute, join, relative, resolve } from "node:path";
3
+ import { join, resolve } from "node:path";
3
4
  import { resolveApplicationIcon } from "../../internal/icon-path.js";
4
5
  const DEFAULT_OUT_DIR = "build";
5
6
  const DIST_DIR = "dist";
6
7
  const LICENSE_CANDIDATES = ["LICENSE", "LICENSE.md", "LICENSE.txt", "COPYING", "COPYING.md"];
7
- const isInside = (parent, candidate) => {
8
- const rel = relative(parent, candidate);
9
- return rel.length > 0 && !rel.startsWith("..") && !isAbsolute(rel);
10
- };
11
8
  const resolveOutDir = ({ root, deploy, outDirOverride }) => {
12
9
  const configured = outDirOverride ?? deploy.outDir ?? DEFAULT_OUT_DIR;
13
10
  const outDir = resolve(root, configured);
14
- if (!isInside(root, outDir)) {
11
+ if (!isPathInside(root, outDir)) {
15
12
  throw new Error(`Cannot use "${configured}" as the deploy output directory: it is outside ${root}`);
16
13
  }
17
14
  return outDir;
18
15
  };
19
- const existingFile = (path) => {
20
- try {
21
- return statSync(path, { throwIfNoEntry: false })?.isFile() === true ? path : null;
22
- }
23
- catch {
24
- return null;
25
- }
26
- };
16
+ const existingFile = (path) => statSync(path, { throwIfNoEntry: false })?.isFile() === true ? path : null;
27
17
  const resolveLicenseFile = (root, configured) => {
28
18
  if (configured !== undefined) {
29
19
  const path = resolve(root, configured);
@@ -52,5 +42,5 @@ const resolvePaths = (request) => {
52
42
  schemaFiles: [],
53
43
  };
54
44
  };
55
- export { isInside, resolvePaths };
45
+ export { resolvePaths };
56
46
  //# sourceMappingURL=paths.js.map