@gtkx/cli 2.0.0-beta.1 → 2.0.0-beta.10

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 (501) hide show
  1. package/README.md +43 -40
  2. package/bin/gtkx-dev-runner.js +5 -1
  3. package/bin/gtkx.js +5 -1
  4. package/dist/builder.d.ts +1 -0
  5. package/dist/builder.d.ts.map +1 -1
  6. package/dist/builder.js +44 -12
  7. package/dist/builder.js.map +1 -1
  8. package/dist/cli.d.ts +1 -1
  9. package/dist/cli.d.ts.map +1 -1
  10. package/dist/cli.js +14 -2
  11. package/dist/cli.js.map +1 -1
  12. package/dist/codegen/config-dependencies.d.ts +3 -0
  13. package/dist/codegen/config-dependencies.d.ts.map +1 -0
  14. package/dist/codegen/config-dependencies.js +355 -0
  15. package/dist/codegen/config-dependencies.js.map +1 -0
  16. package/dist/codegen/freshness.d.ts.map +1 -1
  17. package/dist/codegen/freshness.js +5 -1
  18. package/dist/codegen/freshness.js.map +1 -1
  19. package/dist/codegen/reference.d.ts.map +1 -1
  20. package/dist/codegen/reference.js +1 -0
  21. package/dist/codegen/reference.js.map +1 -1
  22. package/dist/codegen/run-codegen.d.ts +6 -3
  23. package/dist/codegen/run-codegen.d.ts.map +1 -1
  24. package/dist/codegen/run-codegen.js +42 -18
  25. package/dist/codegen/run-codegen.js.map +1 -1
  26. package/dist/codegen/store-resolver.d.ts +3 -1
  27. package/dist/codegen/store-resolver.d.ts.map +1 -1
  28. package/dist/codegen/store-resolver.js +7 -4
  29. package/dist/codegen/store-resolver.js.map +1 -1
  30. package/dist/commands/build.d.ts +5 -0
  31. package/dist/commands/build.d.ts.map +1 -1
  32. package/dist/commands/build.js +83 -10
  33. package/dist/commands/build.js.map +1 -1
  34. package/dist/commands/cleanup.d.ts +9 -0
  35. package/dist/commands/cleanup.d.ts.map +1 -0
  36. package/dist/commands/cleanup.js +42 -0
  37. package/dist/commands/cleanup.js.map +1 -0
  38. package/dist/commands/codegen.d.ts +1 -0
  39. package/dist/commands/codegen.d.ts.map +1 -1
  40. package/dist/commands/codegen.js +6 -5
  41. package/dist/commands/codegen.js.map +1 -1
  42. package/dist/commands/deploy.d.ts +5 -0
  43. package/dist/commands/deploy.d.ts.map +1 -1
  44. package/dist/commands/deploy.js +10 -2
  45. package/dist/commands/deploy.js.map +1 -1
  46. package/dist/commands/dev.d.ts +9 -0
  47. package/dist/commands/dev.d.ts.map +1 -1
  48. package/dist/commands/dev.js +31 -4
  49. package/dist/commands/dev.js.map +1 -1
  50. package/dist/commands/docs.d.ts.map +1 -1
  51. package/dist/commands/docs.js +1 -0
  52. package/dist/commands/docs.js.map +1 -1
  53. package/dist/deploy/depends.d.ts.map +1 -1
  54. package/dist/deploy/depends.js +24 -2
  55. package/dist/deploy/depends.js.map +1 -1
  56. package/dist/deploy/download.d.ts +7 -3
  57. package/dist/deploy/download.d.ts.map +1 -1
  58. package/dist/deploy/download.js +19 -20
  59. package/dist/deploy/download.js.map +1 -1
  60. package/dist/deploy/freedesktop/metainfo.d.ts.map +1 -1
  61. package/dist/deploy/freedesktop/metainfo.js +41 -2
  62. package/dist/deploy/freedesktop/metainfo.js.map +1 -1
  63. package/dist/deploy/freedesktop/validate.d.ts.map +1 -1
  64. package/dist/deploy/freedesktop/validate.js +58 -14
  65. package/dist/deploy/freedesktop/validate.js.map +1 -1
  66. package/dist/deploy/native-addon.d.ts +5 -0
  67. package/dist/deploy/native-addon.d.ts.map +1 -0
  68. package/dist/deploy/native-addon.js +134 -0
  69. package/dist/deploy/native-addon.js.map +1 -0
  70. package/dist/deploy/nfpm/config.d.ts +3 -2
  71. package/dist/deploy/nfpm/config.d.ts.map +1 -1
  72. package/dist/deploy/nfpm/config.js +7 -4
  73. package/dist/deploy/nfpm/config.js.map +1 -1
  74. package/dist/deploy/nfpm/contents.d.ts.map +1 -1
  75. package/dist/deploy/nfpm/contents.js +8 -0
  76. package/dist/deploy/nfpm/contents.js.map +1 -1
  77. package/dist/deploy/node-runtime/download.js +2 -2
  78. package/dist/deploy/node-runtime/download.js.map +1 -1
  79. package/dist/deploy/node-runtime/elf.d.ts +4 -1
  80. package/dist/deploy/node-runtime/elf.d.ts.map +1 -1
  81. package/dist/deploy/node-runtime/elf.js +34 -5
  82. package/dist/deploy/node-runtime/elf.js.map +1 -1
  83. package/dist/deploy/node-runtime/guard.d.ts.map +1 -1
  84. package/dist/deploy/node-runtime/guard.js +7 -14
  85. package/dist/deploy/node-runtime/guard.js.map +1 -1
  86. package/dist/deploy/node-runtime/index.d.ts +3 -1
  87. package/dist/deploy/node-runtime/index.d.ts.map +1 -1
  88. package/dist/deploy/node-runtime/index.js +103 -10
  89. package/dist/deploy/node-runtime/index.js.map +1 -1
  90. package/dist/deploy/node-runtime/sonames.d.ts +5 -0
  91. package/dist/deploy/node-runtime/sonames.d.ts.map +1 -0
  92. package/dist/deploy/node-runtime/sonames.js +13 -0
  93. package/dist/deploy/node-runtime/sonames.js.map +1 -0
  94. package/dist/deploy/notices/node-runtime.js +2 -2
  95. package/dist/deploy/notices/node-runtime.js.map +1 -1
  96. package/dist/deploy/payload/launcher.d.ts.map +1 -1
  97. package/dist/deploy/payload/launcher.js +14 -1
  98. package/dist/deploy/payload/launcher.js.map +1 -1
  99. package/dist/deploy/payload/stage.d.ts +2 -1
  100. package/dist/deploy/payload/stage.d.ts.map +1 -1
  101. package/dist/deploy/payload/stage.js +46 -5
  102. package/dist/deploy/payload/stage.js.map +1 -1
  103. package/dist/deploy/run-deploy.d.ts +2 -0
  104. package/dist/deploy/run-deploy.d.ts.map +1 -1
  105. package/dist/deploy/run-deploy.js +197 -52
  106. package/dist/deploy/run-deploy.js.map +1 -1
  107. package/dist/deploy/settings/arch.d.ts +9 -3
  108. package/dist/deploy/settings/arch.d.ts.map +1 -1
  109. package/dist/deploy/settings/arch.js +27 -6
  110. package/dist/deploy/settings/arch.js.map +1 -1
  111. package/dist/deploy/settings/build-manifest.d.ts +6 -1
  112. package/dist/deploy/settings/build-manifest.d.ts.map +1 -1
  113. package/dist/deploy/settings/build-manifest.js +15 -4
  114. package/dist/deploy/settings/build-manifest.js.map +1 -1
  115. package/dist/deploy/settings/extra-files.d.ts +1 -1
  116. package/dist/deploy/settings/extra-files.d.ts.map +1 -1
  117. package/dist/deploy/settings/extra-files.js +25 -3
  118. package/dist/deploy/settings/extra-files.js.map +1 -1
  119. package/dist/deploy/settings/index.d.ts +3 -1
  120. package/dist/deploy/settings/index.d.ts.map +1 -1
  121. package/dist/deploy/settings/index.js +4 -2
  122. package/dist/deploy/settings/index.js.map +1 -1
  123. package/dist/deploy/settings/libraries.d.ts.map +1 -1
  124. package/dist/deploy/settings/libraries.js +2 -1
  125. package/dist/deploy/settings/libraries.js.map +1 -1
  126. package/dist/deploy/settings/paths.d.ts +4 -2
  127. package/dist/deploy/settings/paths.d.ts.map +1 -1
  128. package/dist/deploy/settings/paths.js +121 -12
  129. package/dist/deploy/settings/paths.js.map +1 -1
  130. package/dist/deploy/targets/appimage.d.ts.map +1 -1
  131. package/dist/deploy/targets/appimage.js +1 -0
  132. package/dist/deploy/targets/appimage.js.map +1 -1
  133. package/dist/deploy/targets/flatpak-pnpm.js +4 -4
  134. package/dist/deploy/targets/flatpak-pnpm.js.map +1 -1
  135. package/dist/deploy/targets/flatpak-source.d.ts.map +1 -1
  136. package/dist/deploy/targets/flatpak-source.js +13 -2
  137. package/dist/deploy/targets/flatpak-source.js.map +1 -1
  138. package/dist/deploy/targets/flatpak.d.ts.map +1 -1
  139. package/dist/deploy/targets/flatpak.js +1 -0
  140. package/dist/deploy/targets/flatpak.js.map +1 -1
  141. package/dist/deploy/targets/nfpm-target.d.ts.map +1 -1
  142. package/dist/deploy/targets/nfpm-target.js +13 -7
  143. package/dist/deploy/targets/nfpm-target.js.map +1 -1
  144. package/dist/deploy/types.d.ts +5 -2
  145. package/dist/deploy/types.d.ts.map +1 -1
  146. package/dist/deploy/types.js.map +1 -1
  147. package/dist/deploy/vendored/appimagetool.js +2 -2
  148. package/dist/deploy/vendored/appimagetool.js.map +1 -1
  149. package/dist/deploy/vendored/nfpm.js +1 -1
  150. package/dist/deploy/vendored/nfpm.js.map +1 -1
  151. package/dist/dev/catalog-writes.d.ts +8 -0
  152. package/dist/dev/catalog-writes.d.ts.map +1 -0
  153. package/dist/dev/catalog-writes.js +26 -0
  154. package/dist/dev/catalog-writes.js.map +1 -0
  155. package/dist/dev/entry-env.d.ts +2 -1
  156. package/dist/dev/entry-env.d.ts.map +1 -1
  157. package/dist/dev/entry-env.js +2 -1
  158. package/dist/dev/entry-env.js.map +1 -1
  159. package/dist/dev/font-dir.d.ts +3 -0
  160. package/dist/dev/font-dir.d.ts.map +1 -0
  161. package/dist/dev/font-dir.js +9 -0
  162. package/dist/dev/font-dir.js.map +1 -0
  163. package/dist/dev/headless.d.ts +3 -0
  164. package/dist/dev/headless.d.ts.map +1 -0
  165. package/dist/dev/headless.js +35 -0
  166. package/dist/dev/headless.js.map +1 -0
  167. package/dist/dev/runner-deps.d.ts +1 -1
  168. package/dist/dev/runner-deps.d.ts.map +1 -1
  169. package/dist/dev/runner-deps.js +12 -7
  170. package/dist/dev/runner-deps.js.map +1 -1
  171. package/dist/dev/runner-main.d.ts.map +1 -1
  172. package/dist/dev/runner-main.js +10 -3
  173. package/dist/dev/runner-main.js.map +1 -1
  174. package/dist/dev/runner.d.ts +2 -0
  175. package/dist/dev/runner.d.ts.map +1 -1
  176. package/dist/dev/runner.js +26 -7
  177. package/dist/dev/runner.js.map +1 -1
  178. package/dist/dev/supervisor.d.ts +3 -1
  179. package/dist/dev/supervisor.d.ts.map +1 -1
  180. package/dist/dev/supervisor.js +132 -29
  181. package/dist/dev/supervisor.js.map +1 -1
  182. package/dist/dev/vite-dev-server.d.ts +1 -1
  183. package/dist/dev/vite-dev-server.d.ts.map +1 -1
  184. package/dist/dev/vite-dev-server.js +14 -2
  185. package/dist/dev/vite-dev-server.js.map +1 -1
  186. package/dist/dev/watch-ignore.d.ts +3 -0
  187. package/dist/dev/watch-ignore.d.ts.map +1 -0
  188. package/dist/dev/watch-ignore.js +11 -0
  189. package/dist/dev/watch-ignore.js.map +1 -0
  190. package/dist/i18n/catalogs.d.ts +6 -2
  191. package/dist/i18n/catalogs.d.ts.map +1 -1
  192. package/dist/i18n/catalogs.js +10 -7
  193. package/dist/i18n/catalogs.js.map +1 -1
  194. package/dist/i18n/source-messages.d.ts +3 -1
  195. package/dist/i18n/source-messages.d.ts.map +1 -1
  196. package/dist/i18n/source-messages.js +973 -9
  197. package/dist/i18n/source-messages.js.map +1 -1
  198. package/dist/internal/agent-rules.d.ts.map +1 -1
  199. package/dist/internal/agent-rules.js +7 -2
  200. package/dist/internal/agent-rules.js.map +1 -1
  201. package/dist/internal/banner.d.ts +4 -2
  202. package/dist/internal/banner.d.ts.map +1 -1
  203. package/dist/internal/banner.js +19 -5
  204. package/dist/internal/banner.js.map +1 -1
  205. package/dist/internal/build-manifest.d.ts +5 -2
  206. package/dist/internal/build-manifest.d.ts.map +1 -1
  207. package/dist/internal/build-manifest.js +15 -2
  208. package/dist/internal/build-manifest.js.map +1 -1
  209. package/dist/internal/build-output.d.ts +8 -0
  210. package/dist/internal/build-output.d.ts.map +1 -0
  211. package/dist/internal/build-output.js +116 -0
  212. package/dist/internal/build-output.js.map +1 -0
  213. package/dist/internal/cache-root.d.ts +3 -0
  214. package/dist/internal/cache-root.d.ts.map +1 -0
  215. package/dist/internal/cache-root.js +9 -0
  216. package/dist/internal/cache-root.js.map +1 -0
  217. package/dist/internal/compile-cache-store.d.ts +4 -0
  218. package/dist/internal/compile-cache-store.d.ts.map +1 -0
  219. package/dist/internal/compile-cache-store.js +41 -0
  220. package/dist/internal/compile-cache-store.js.map +1 -0
  221. package/dist/internal/compile-cache.d.ts +4 -0
  222. package/dist/internal/compile-cache.d.ts.map +1 -0
  223. package/dist/internal/compile-cache.js +16 -0
  224. package/dist/internal/compile-cache.js.map +1 -0
  225. package/dist/internal/deploy-out-dir.d.ts +4 -0
  226. package/dist/internal/deploy-out-dir.d.ts.map +1 -0
  227. package/dist/internal/deploy-out-dir.js +5 -0
  228. package/dist/internal/deploy-out-dir.js.map +1 -0
  229. package/dist/internal/docs-elements.d.ts +1 -0
  230. package/dist/internal/docs-elements.d.ts.map +1 -1
  231. package/dist/internal/docs-elements.js +5 -4
  232. package/dist/internal/docs-elements.js.map +1 -1
  233. package/dist/internal/entry-arg.d.ts +4 -1
  234. package/dist/internal/entry-arg.d.ts.map +1 -1
  235. package/dist/internal/entry-arg.js +7 -1
  236. package/dist/internal/entry-arg.js.map +1 -1
  237. package/dist/internal/errors.d.ts +2 -1
  238. package/dist/internal/errors.d.ts.map +1 -1
  239. package/dist/internal/errors.js +1 -1
  240. package/dist/internal/errors.js.map +1 -1
  241. package/dist/internal/font-path.d.ts +4 -0
  242. package/dist/internal/font-path.d.ts.map +1 -0
  243. package/dist/internal/font-path.js +12 -0
  244. package/dist/internal/font-path.js.map +1 -0
  245. package/dist/internal/font-staging.d.ts +6 -0
  246. package/dist/internal/font-staging.d.ts.map +1 -0
  247. package/dist/internal/font-staging.js +94 -0
  248. package/dist/internal/font-staging.js.map +1 -0
  249. package/dist/internal/icon-staging.d.ts +3 -0
  250. package/dist/internal/icon-staging.d.ts.map +1 -0
  251. package/dist/internal/icon-staging.js +40 -0
  252. package/dist/internal/icon-staging.js.map +1 -0
  253. package/dist/internal/import-scan.d.ts +4 -0
  254. package/dist/internal/import-scan.d.ts.map +1 -0
  255. package/dist/internal/import-scan.js +138 -0
  256. package/dist/internal/import-scan.js.map +1 -0
  257. package/dist/internal/module-hash.d.ts +3 -0
  258. package/dist/internal/module-hash.d.ts.map +1 -0
  259. package/dist/internal/module-hash.js +19 -0
  260. package/dist/internal/module-hash.js.map +1 -0
  261. package/dist/internal/output-directory.d.ts +15 -0
  262. package/dist/internal/output-directory.d.ts.map +1 -0
  263. package/dist/internal/output-directory.js +490 -0
  264. package/dist/internal/output-directory.js.map +1 -0
  265. package/dist/internal/parent-process.d.ts +12 -0
  266. package/dist/internal/parent-process.d.ts.map +1 -0
  267. package/dist/internal/parent-process.js +74 -0
  268. package/dist/internal/parent-process.js.map +1 -0
  269. package/dist/internal/prepare-project.d.ts +3 -0
  270. package/dist/internal/prepare-project.d.ts.map +1 -1
  271. package/dist/internal/prepare-project.js +9 -3
  272. package/dist/internal/prepare-project.js.map +1 -1
  273. package/dist/internal/react-compiler-cache.d.ts +13 -0
  274. package/dist/internal/react-compiler-cache.d.ts.map +1 -0
  275. package/dist/internal/react-compiler-cache.js +182 -0
  276. package/dist/internal/react-compiler-cache.js.map +1 -0
  277. package/dist/internal/source-imports.d.ts +7 -2
  278. package/dist/internal/source-imports.d.ts.map +1 -1
  279. package/dist/internal/source-imports.js +31 -11
  280. package/dist/internal/source-imports.js.map +1 -1
  281. package/dist/internal/staging-file.d.ts +5 -0
  282. package/dist/internal/staging-file.d.ts.map +1 -0
  283. package/dist/internal/staging-file.js +35 -0
  284. package/dist/internal/staging-file.js.map +1 -0
  285. package/dist/internal/xdg-banner.d.ts +4 -0
  286. package/dist/internal/xdg-banner.d.ts.map +1 -0
  287. package/dist/internal/xdg-banner.js +11 -0
  288. package/dist/internal/xdg-banner.js.map +1 -0
  289. package/dist/internal/xdg-data-dirs.d.ts +2 -1
  290. package/dist/internal/xdg-data-dirs.d.ts.map +1 -1
  291. package/dist/internal/xdg-data-dirs.js +1 -1
  292. package/dist/internal/xdg-data-dirs.js.map +1 -1
  293. package/dist/mcp/client.js +2 -2
  294. package/dist/mcp/client.js.map +1 -1
  295. package/dist/settings/schema.d.ts.map +1 -1
  296. package/dist/settings/schema.js +3 -8
  297. package/dist/settings/schema.js.map +1 -1
  298. package/dist/vite-plugins/asset-extensions.d.ts.map +1 -1
  299. package/dist/vite-plugins/asset-extensions.js +2 -0
  300. package/dist/vite-plugins/asset-extensions.js.map +1 -1
  301. package/dist/vite-plugins/asset-imports.d.ts.map +1 -1
  302. package/dist/vite-plugins/asset-imports.js +20 -6
  303. package/dist/vite-plugins/asset-imports.js.map +1 -1
  304. package/dist/vite-plugins/asset-specifier.d.ts +5 -1
  305. package/dist/vite-plugins/asset-specifier.d.ts.map +1 -1
  306. package/dist/vite-plugins/asset-specifier.js +10 -1
  307. package/dist/vite-plugins/asset-specifier.js.map +1 -1
  308. package/dist/vite-plugins/build-manifest.d.ts +5 -1
  309. package/dist/vite-plugins/build-manifest.d.ts.map +1 -1
  310. package/dist/vite-plugins/build-manifest.js +2 -1
  311. package/dist/vite-plugins/build-manifest.js.map +1 -1
  312. package/dist/vite-plugins/built-url.d.ts.map +1 -1
  313. package/dist/vite-plugins/built-url.js +5 -2
  314. package/dist/vite-plugins/built-url.js.map +1 -1
  315. package/dist/vite-plugins/css.d.ts.map +1 -1
  316. package/dist/vite-plugins/css.js +13 -5
  317. package/dist/vite-plugins/css.js.map +1 -1
  318. package/dist/vite-plugins/ensure-store.d.ts +1 -1
  319. package/dist/vite-plugins/ensure-store.d.ts.map +1 -1
  320. package/dist/vite-plugins/ensure-store.js +2 -2
  321. package/dist/vite-plugins/ensure-store.js.map +1 -1
  322. package/dist/vite-plugins/fast-refresh/refresh-filter.d.ts +6 -1
  323. package/dist/vite-plugins/fast-refresh/refresh-filter.d.ts.map +1 -1
  324. package/dist/vite-plugins/fast-refresh/refresh-filter.js +3 -1
  325. package/dist/vite-plugins/fast-refresh/refresh-filter.js.map +1 -1
  326. package/dist/vite-plugins/fast-refresh/swc-refresh.d.ts.map +1 -1
  327. package/dist/vite-plugins/fast-refresh/swc-refresh.js +23 -14
  328. package/dist/vite-plugins/fast-refresh/swc-refresh.js.map +1 -1
  329. package/dist/vite-plugins/font-name.d.ts +3 -0
  330. package/dist/vite-plugins/font-name.d.ts.map +1 -0
  331. package/dist/vite-plugins/font-name.js +406 -0
  332. package/dist/vite-plugins/font-name.js.map +1 -0
  333. package/dist/vite-plugins/font-worker-env.d.ts +4 -0
  334. package/dist/vite-plugins/font-worker-env.d.ts.map +1 -0
  335. package/dist/vite-plugins/font-worker-env.js +19 -0
  336. package/dist/vite-plugins/font-worker-env.js.map +1 -0
  337. package/dist/vite-plugins/font.d.ts +4 -0
  338. package/dist/vite-plugins/font.d.ts.map +1 -0
  339. package/dist/vite-plugins/font.js +111 -0
  340. package/dist/vite-plugins/font.js.map +1 -0
  341. package/dist/vite-plugins/i18n.d.ts +11 -2
  342. package/dist/vite-plugins/i18n.d.ts.map +1 -1
  343. package/dist/vite-plugins/i18n.js +74 -8
  344. package/dist/vite-plugins/i18n.js.map +1 -1
  345. package/dist/vite-plugins/icon-worker-env.d.ts +4 -0
  346. package/dist/vite-plugins/icon-worker-env.d.ts.map +1 -0
  347. package/dist/vite-plugins/icon-worker-env.js +23 -0
  348. package/dist/vite-plugins/icon-worker-env.js.map +1 -0
  349. package/dist/vite-plugins/icons.d.ts.map +1 -1
  350. package/dist/vite-plugins/icons.js +4 -9
  351. package/dist/vite-plugins/icons.js.map +1 -1
  352. package/dist/vite-plugins/index.d.ts +10 -1
  353. package/dist/vite-plugins/index.d.ts.map +1 -1
  354. package/dist/vite-plugins/index.js +17 -3
  355. package/dist/vite-plugins/index.js.map +1 -1
  356. package/dist/vite-plugins/native.d.ts.map +1 -1
  357. package/dist/vite-plugins/native.js +0 -4
  358. package/dist/vite-plugins/native.js.map +1 -1
  359. package/dist/vite-plugins/react-compiler.d.ts.map +1 -1
  360. package/dist/vite-plugins/react-compiler.js +57 -18
  361. package/dist/vite-plugins/react-compiler.js.map +1 -1
  362. package/dist/vite-plugins/resource-shared.d.ts +3 -1
  363. package/dist/vite-plugins/resource-shared.d.ts.map +1 -1
  364. package/dist/vite-plugins/resource-shared.js +3 -1
  365. package/dist/vite-plugins/resource-shared.js.map +1 -1
  366. package/dist/vite-plugins/resources.d.ts.map +1 -1
  367. package/dist/vite-plugins/resources.js +9 -6
  368. package/dist/vite-plugins/resources.js.map +1 -1
  369. package/dist/vite-plugins/self-contained.d.ts.map +1 -1
  370. package/dist/vite-plugins/self-contained.js +159 -158
  371. package/dist/vite-plugins/self-contained.js.map +1 -1
  372. package/dist/vite-plugins/settings-worker-env.d.ts +1 -1
  373. package/dist/vite-plugins/settings-worker-env.d.ts.map +1 -1
  374. package/dist/vite-plugins/settings-worker-env.js +4 -4
  375. package/dist/vite-plugins/settings-worker-env.js.map +1 -1
  376. package/dist/vite-plugins/settings.d.ts.map +1 -1
  377. package/dist/vite-plugins/settings.js +25 -14
  378. package/dist/vite-plugins/settings.js.map +1 -1
  379. package/dist/vite-plugins/store-links.d.ts.map +1 -1
  380. package/dist/vite-plugins/store-links.js +9 -5
  381. package/dist/vite-plugins/store-links.js.map +1 -1
  382. package/dist/vite-plugins/undeclared-library.d.ts.map +1 -1
  383. package/dist/vite-plugins/undeclared-library.js +18 -15
  384. package/dist/vite-plugins/undeclared-library.js.map +1 -1
  385. package/dist/vite-plugins/worker.d.ts.map +1 -1
  386. package/dist/vite-plugins/worker.js +21 -13
  387. package/dist/vite-plugins/worker.js.map +1 -1
  388. package/dist/vitest-plugin.d.ts +4 -3
  389. package/dist/vitest-plugin.d.ts.map +1 -1
  390. package/dist/vitest-plugin.js +12 -8
  391. package/dist/vitest-plugin.js.map +1 -1
  392. package/env.d.ts +9 -0
  393. package/package.json +18 -13
  394. package/src/builder.ts +45 -12
  395. package/src/cli.ts +15 -2
  396. package/src/codegen/config-dependencies.ts +470 -0
  397. package/src/codegen/freshness.ts +5 -1
  398. package/src/codegen/reference.ts +1 -0
  399. package/src/codegen/run-codegen.ts +51 -21
  400. package/src/codegen/store-resolver.ts +9 -4
  401. package/src/commands/build.ts +13 -2
  402. package/src/commands/cleanup.ts +48 -0
  403. package/src/commands/codegen.ts +6 -5
  404. package/src/commands/deploy.ts +10 -2
  405. package/src/commands/dev.ts +45 -4
  406. package/src/commands/docs.ts +1 -0
  407. package/src/deploy/depends.ts +30 -3
  408. package/src/deploy/download.ts +33 -24
  409. package/src/deploy/freedesktop/metainfo.ts +73 -21
  410. package/src/deploy/freedesktop/validate.ts +80 -15
  411. package/src/deploy/native-addon.ts +183 -0
  412. package/src/deploy/nfpm/config.ts +13 -4
  413. package/src/deploy/nfpm/contents.ts +8 -0
  414. package/src/deploy/node-runtime/download.ts +2 -2
  415. package/src/deploy/node-runtime/elf.ts +46 -5
  416. package/src/deploy/node-runtime/guard.ts +10 -14
  417. package/src/deploy/node-runtime/index.ts +148 -12
  418. package/src/deploy/node-runtime/sonames.ts +17 -0
  419. package/src/deploy/notices/node-runtime.ts +2 -2
  420. package/src/deploy/payload/launcher.ts +20 -1
  421. package/src/deploy/payload/stage.ts +76 -5
  422. package/src/deploy/run-deploy.ts +227 -72
  423. package/src/deploy/settings/arch.ts +40 -8
  424. package/src/deploy/settings/build-manifest.ts +28 -3
  425. package/src/deploy/settings/extra-files.ts +30 -4
  426. package/src/deploy/settings/index.ts +7 -2
  427. package/src/deploy/settings/libraries.ts +2 -1
  428. package/src/deploy/settings/paths.ts +80 -13
  429. package/src/deploy/targets/appimage.ts +1 -0
  430. package/src/deploy/targets/flatpak-pnpm.ts +4 -4
  431. package/src/deploy/targets/flatpak-source.ts +15 -2
  432. package/src/deploy/targets/flatpak.ts +1 -0
  433. package/src/deploy/targets/nfpm-target.ts +14 -6
  434. package/src/deploy/types.ts +5 -1
  435. package/src/deploy/vendored/appimagetool.ts +2 -2
  436. package/src/deploy/vendored/nfpm.ts +1 -1
  437. package/src/dev/catalog-writes.ts +35 -0
  438. package/src/dev/entry-env.ts +2 -1
  439. package/src/dev/font-dir.ts +11 -0
  440. package/src/dev/headless.ts +40 -0
  441. package/src/dev/runner-deps.ts +20 -7
  442. package/src/dev/runner-main.ts +12 -3
  443. package/src/dev/runner.ts +37 -7
  444. package/src/dev/supervisor.ts +183 -32
  445. package/src/dev/vite-dev-server.ts +20 -2
  446. package/src/dev/watch-ignore.ts +16 -0
  447. package/src/i18n/catalogs.ts +21 -8
  448. package/src/i18n/source-messages.ts +1446 -29
  449. package/src/internal/agent-rules.ts +7 -2
  450. package/src/internal/banner.ts +27 -6
  451. package/src/internal/build-manifest.ts +25 -1
  452. package/src/internal/build-output.ts +171 -0
  453. package/src/internal/cache-root.ts +12 -0
  454. package/src/internal/compile-cache-store.ts +50 -0
  455. package/src/internal/compile-cache.ts +20 -0
  456. package/src/internal/deploy-out-dir.ts +8 -0
  457. package/src/internal/docs-elements.ts +10 -4
  458. package/src/internal/entry-arg.ts +8 -1
  459. package/src/internal/errors.ts +1 -1
  460. package/src/internal/font-path.ts +15 -0
  461. package/src/internal/font-staging.ts +131 -0
  462. package/src/internal/icon-staging.ts +58 -0
  463. package/src/internal/import-scan.ts +206 -0
  464. package/src/internal/module-hash.ts +22 -0
  465. package/src/internal/output-directory.ts +699 -0
  466. package/src/internal/parent-process.ts +110 -0
  467. package/src/internal/prepare-project.ts +11 -5
  468. package/src/internal/react-compiler-cache.ts +246 -0
  469. package/src/internal/source-imports.ts +57 -12
  470. package/src/internal/staging-file.ts +42 -0
  471. package/src/internal/xdg-banner.ts +13 -0
  472. package/src/internal/xdg-data-dirs.ts +1 -1
  473. package/src/mcp/client.ts +2 -2
  474. package/src/settings/schema.ts +4 -10
  475. package/src/vite-plugins/asset-extensions.ts +2 -0
  476. package/src/vite-plugins/asset-imports.ts +23 -5
  477. package/src/vite-plugins/asset-specifier.ts +17 -0
  478. package/src/vite-plugins/build-manifest.ts +7 -1
  479. package/src/vite-plugins/built-url.ts +6 -2
  480. package/src/vite-plugins/css.ts +16 -5
  481. package/src/vite-plugins/ensure-store.ts +2 -2
  482. package/src/vite-plugins/fast-refresh/refresh-filter.ts +10 -1
  483. package/src/vite-plugins/fast-refresh/swc-refresh.ts +33 -14
  484. package/src/vite-plugins/font-name.ts +582 -0
  485. package/src/vite-plugins/font-worker-env.ts +25 -0
  486. package/src/vite-plugins/font.ts +180 -0
  487. package/src/vite-plugins/i18n.ts +122 -11
  488. package/src/vite-plugins/icon-worker-env.ts +36 -0
  489. package/src/vite-plugins/icons.ts +4 -10
  490. package/src/vite-plugins/index.ts +34 -9
  491. package/src/vite-plugins/native.ts +0 -5
  492. package/src/vite-plugins/react-compiler.ts +83 -19
  493. package/src/vite-plugins/resource-shared.ts +4 -0
  494. package/src/vite-plugins/resources.ts +11 -5
  495. package/src/vite-plugins/self-contained.ts +184 -185
  496. package/src/vite-plugins/settings-worker-env.ts +4 -4
  497. package/src/vite-plugins/settings.ts +36 -16
  498. package/src/vite-plugins/store-links.ts +10 -5
  499. package/src/vite-plugins/undeclared-library.ts +19 -15
  500. package/src/vite-plugins/worker.ts +31 -15
  501. package/src/vitest-plugin.ts +12 -8
@@ -1,9 +1,11 @@
1
1
  import type { Config } from "@gtkx/config";
2
2
  import { isPathInside } from "@gtkx/utils";
3
- import { statSync } from "node:fs";
4
- import { join, resolve } from "node:path";
5
- import type { DeployConfig, DeployPaths } from "../types.js";
3
+ import { lstatSync, readdirSync, statSync, writeFileSync } from "node:fs";
4
+ import { join, relative, resolve, sep } from "node:path";
5
+ import type { DeployArchName, DeployConfig, DeployPaths } from "../types.js";
6
+ import { DEFAULT_DEPLOY_OUT_DIR } from "../../internal/deploy-out-dir.js";
6
7
  import { resolveApplicationIcon } from "../../internal/icon-path.js";
8
+ import { prepareOutputDirectory, readRegularFile } from "../../internal/output-directory.js";
7
9
 
8
10
  type PathsRequest = {
9
11
  root: string;
@@ -11,23 +13,87 @@ type PathsRequest = {
11
13
  applicationIcon: Config["applicationIcon"];
12
14
  applicationId: Config["applicationId"];
13
15
  outDirOverride: string | undefined;
16
+ arch: DeployArchName;
14
17
  };
15
18
 
16
- const DEFAULT_OUT_DIR = "build";
17
19
  const DIST_DIR = "dist";
20
+ const DEPLOY_MARKER_FILENAME = ".gtkx-deploy.json";
21
+ const DEPLOY_MARKER = `${JSON.stringify({ generator: "gtkx-deploy", formatVersion: 1 })}\n`;
18
22
  const LICENSE_CANDIDATES = ["LICENSE", "LICENSE.md", "LICENSE.txt", "COPYING", "COPYING.md"];
19
23
 
24
+ const hasSymlinkComponent = (root: string, target: string): boolean => {
25
+ let current = root;
26
+
27
+ for (const segment of relative(root, target).split(sep)) {
28
+ current = join(current, segment);
29
+
30
+ if (lstatSync(current, { throwIfNoEntry: false })?.isSymbolicLink() === true) {
31
+ return true;
32
+ }
33
+ }
34
+
35
+ return false;
36
+ };
37
+
38
+ const isDeployMarker = (path: string): boolean => {
39
+ return readRegularFile(path) === DEPLOY_MARKER;
40
+ };
41
+
42
+ const isReusableDeployDirectory = (path: string): boolean => {
43
+ const entry = lstatSync(path, { throwIfNoEntry: false });
44
+
45
+ if (entry === undefined) {
46
+ return true;
47
+ }
48
+
49
+ return entry.isDirectory() &&
50
+ (readdirSync(path).length === 0 || isDeployMarker(join(path, DEPLOY_MARKER_FILENAME)));
51
+ };
52
+
53
+ const deployOutputError = (root: string, configured: string): Error =>
54
+ new Error(
55
+ `Cannot use "${configured}" as the deploy output directory: choose an empty directory or an ` +
56
+ `earlier GTKX deploy directory below ${root}`,
57
+ );
58
+
59
+ const assertSafeDeployOutDir = (root: string, outDir: string, configured: string): void => {
60
+ const dist = join(root, DIST_DIR);
61
+
62
+ if (
63
+ outDir === dist ||
64
+ !isPathInside(root, outDir) ||
65
+ isPathInside(dist, outDir) ||
66
+ hasSymlinkComponent(root, outDir)
67
+ ) {
68
+ throw deployOutputError(root, configured);
69
+ }
70
+ };
71
+
20
72
  const resolveOutDir = ({ root, deploy, outDirOverride }: PathsRequest): string => {
21
- const configured = outDirOverride ?? deploy.outDir ?? DEFAULT_OUT_DIR;
73
+ const configured = outDirOverride ?? deploy.outDir ?? DEFAULT_DEPLOY_OUT_DIR;
22
74
  const outDir = resolve(root, configured);
75
+ assertSafeDeployOutDir(root, outDir, configured);
23
76
 
24
- if (!isPathInside(root, outDir)) {
25
- throw new Error(`Cannot use "${configured}" as the deploy output directory: it is outside ${root}`);
77
+ if (!isReusableDeployDirectory(outDir)) {
78
+ throw deployOutputError(root, configured);
26
79
  }
27
80
 
28
81
  return outDir;
29
82
  };
30
83
 
84
+ const prepareDeployOutDir = (root: string, outDir: string): void => {
85
+ assertSafeDeployOutDir(root, outDir, outDir);
86
+ const prepared = prepareOutputDirectory(root, outDir, isReusableDeployDirectory);
87
+
88
+ if (prepared.status === "unsafe") {
89
+ throw deployOutputError(root, outDir);
90
+ }
91
+
92
+ using transaction = prepared.transaction;
93
+ transaction.commit();
94
+ writeFileSync(join(outDir, DEPLOY_MARKER_FILENAME), DEPLOY_MARKER, { flag: "wx" });
95
+ };
96
+
31
97
  const existingFile = (path: string): string | null =>
32
98
  statSync(path, { throwIfNoEntry: false })?.isFile() === true ? path : null;
33
99
 
@@ -48,16 +114,17 @@ const resolveLicenseFile = (root: string, configured: string | undefined): strin
48
114
  const resolvePaths = (request: PathsRequest): DeployPaths => {
49
115
  const { root, deploy } = request;
50
116
  const outDir = resolveOutDir(request);
117
+ const archDir = join(outDir, request.arch);
51
118
 
52
119
  return {
53
120
  root,
54
121
  dist: join(root, DIST_DIR),
55
122
  outDir,
56
- metadata: join(outDir, "metadata"),
57
- runtime: join(outDir, "runtime"),
58
- stage: join(outDir, "stage"),
59
- overlay: join(outDir, "overlay"),
60
- targets: join(outDir, "targets"),
123
+ metadata: join(archDir, "metadata"),
124
+ runtime: join(archDir, "runtime"),
125
+ stage: join(archDir, "stage"),
126
+ overlay: join(archDir, "overlay"),
127
+ targets: join(archDir, "targets"),
61
128
  output: join(outDir, "out"),
62
129
  applicationIcon: resolveApplicationIcon(root, request.applicationId, request.applicationIcon),
63
130
  licenseFile: resolveLicenseFile(root, deploy.licenseFile),
@@ -65,4 +132,4 @@ const resolvePaths = (request: PathsRequest): DeployPaths => {
65
132
  };
66
133
  };
67
134
 
68
- export { resolvePaths };
135
+ export { prepareDeployOutDir, resolvePaths };
@@ -29,6 +29,7 @@ const EXTRACT_AND_RUN = "APPIMAGE_EXTRACT_AND_RUN";
29
29
  const appimageTarget: DeployTarget = {
30
30
  name: "appimage",
31
31
  prefix: PREFIX,
32
+ isHostOnly: true,
32
33
  tools: [FILE_TOOL],
33
34
  render: (payload) => renderManifests(payload),
34
35
  pack: (payload) => packAppImage(payload),
@@ -9,12 +9,12 @@ type PnpmPin = {
9
9
  sha512: string;
10
10
  };
11
11
 
12
- const PNPM_VERSION = "11.25.0";
12
+ const PNPM_VERSION = "11.26.0";
13
13
  const PNPM_MAJOR = 11;
14
- const PNPM_MINOR = 25;
14
+ const PNPM_MINOR = 26;
15
15
 
16
- const PNPM_SHA512 = "5cde925b4f075f725eb71fbae18a42ffe784524789f19b61c731cb8721ec28aaee160e01a" +
17
- "8d5af4fedb2a42cdbf300efe23db356b0d4a17b4d63e11f8ab7c956";
16
+ const PNPM_SHA512 = "fc0e2bf890b9f983611f1ab68c0637bce914390653699f83c1a78b005ed25f2c81e77920c8" +
17
+ "fd8eee2ecf0b58b28cdcb00a84d97f69bcf7c56b2f344710238664";
18
18
 
19
19
  const PNPM_DIR = "flatpak-pnpm";
20
20
  const PNPM_COMMAND = "pnpm";
@@ -3,6 +3,7 @@ import { existsSync, readFileSync, realpathSync } from "node:fs";
3
3
  import { posix, relative, resolve } from "node:path";
4
4
  import type { DeployPayload, DeploySettings } from "../types.js";
5
5
  import { LOCALE_DIRNAME } from "../../i18n/catalogs.js";
6
+ import { FONTS_DIR } from "../../internal/font-path.js";
6
7
  import { listFilesRecursive } from "../../internal/list-files.js";
7
8
  import { BUNDLE_FILENAME } from "../../vite-plugins/esm-extension.js";
8
9
  import { renderDbusService } from "../freedesktop/dbus-service.js";
@@ -68,6 +69,7 @@ const runtimeInstallCommands = (settings: DeploySettings, nodeExtensionPath: str
68
69
  "test ! -f dist/gschemas.compiled || " +
69
70
  installCommand("dist/gschemas.compiled", `${lib}/gschemas.compiled`, "m644"),
70
71
  `test ! -d dist/assets || cp -a dist/assets ${lib}/assets`,
72
+ `test ! -d dist/${FONTS_DIR} || cp -a dist/${FONTS_DIR} ${lib}/${FONTS_DIR}`,
71
73
  `test ! -d dist/${LOCALE_DIRNAME} || { mkdir -p ${locale} && cp -a dist/${LOCALE_DIRNAME}/. ${locale}/; }`,
72
74
  installCommand(LAUNCHER_FILENAME, `${DESTINATION}/bin/${settings.binaryName}`, "m755"),
73
75
  ];
@@ -244,6 +246,17 @@ const appendPathFor = (settings: DeploySettings, pin: PnpmPin | null, nodeExtens
244
246
  ? `${nodeExtensionPath}/bin`
245
247
  : `${pnpmPathFor(moduleDirFor(settings))}:${nodeExtensionPath}/bin`;
246
248
 
249
+ const sourceBuildCommand = (settings: DeploySettings): string => {
250
+ const configFile = projectRelative(settings, settings.configFile);
251
+ assertInsideProject(settings, {
252
+ destination: "the Flatpak build configuration",
253
+ source: configFile,
254
+ resolved: settings.configFile,
255
+ });
256
+
257
+ return `npx gtkx build --config ${pathArgument(configFile)}`;
258
+ };
259
+
247
260
  const flatpakSourceModule = (payload: DeployPayload): FlatpakModule => {
248
261
  const settings = payload.settings;
249
262
  const manager = detectPackageManager(settings);
@@ -271,14 +284,14 @@ const flatpakSourceModule = (payload: DeployPayload): FlatpakModule => {
271
284
  ],
272
285
  "build-commands": [
273
286
  installCommandFor(settings, manager),
274
- "npx gtkx build",
287
+ sourceBuildCommand(settings),
275
288
  ...runtimeInstallCommands(settings, nodeExtensionPath),
289
+ ...extraFileInstallCommands(settings),
276
290
  ...metadataInstallCommands(settings),
277
291
  ...schemaInstallCommands(settings),
278
292
  ...iconInstallCommands(settings),
279
293
  ...licenseInstallCommands(settings),
280
294
  ...noticesInstallCommands(settings),
281
- ...extraFileInstallCommands(settings),
282
295
  ...(settings.deploy.flatpak?.buildCommands ?? []),
283
296
  ...validationCommands(settings),
284
297
  ],
@@ -21,6 +21,7 @@ const BUILDER_REF = "org.flatpak.Builder";
21
21
  const flatpakTarget: DeployTarget = {
22
22
  name: "flatpak",
23
23
  prefix: PREFIX,
24
+ isHostOnly: true,
24
25
  tools: [FLATPAK, FLATPAK_BUILDER, DESKTOP_FILE_VALIDATE, APPSTREAMCLI],
25
26
  render: (payload) => renderManifests(payload),
26
27
  pack: (payload) => Promise.try(() => packFlatpak(payload)),
@@ -1,7 +1,8 @@
1
+ import { info } from "@gtkx/utils";
1
2
  import { join } from "node:path";
2
3
  import { stringify } from "yaml";
3
4
  import type { DeployArtifact, DeployManifest, DeployPayload, DeployTarget } from "../types.js";
4
- import { type NfpmPackager, renderNfpmConfig } from "../nfpm/config.js";
5
+ import { glibcMinimumForPackage, type NfpmPackager, renderNfpmConfig } from "../nfpm/config.js";
5
6
  import { packWithNfpm } from "../nfpm/pack.js";
6
7
  import { TAR } from "../tools.js";
7
8
 
@@ -11,12 +12,18 @@ const PREFIX = "/usr";
11
12
  const manifestPathFor = (payload: DeployPayload, packager: NfpmPackager): string =>
12
13
  join(payload.settings.paths.targets, packager, MANIFEST_FILENAME);
13
14
 
14
- const renderManifests = (payload: DeployPayload, packager: NfpmPackager): DeployManifest[] => [
15
- {
15
+ const renderManifests = (payload: DeployPayload, packager: NfpmPackager): DeployManifest[] => {
16
+ const glibcMinimum = glibcMinimumForPackage(payload, packager);
17
+
18
+ if (glibcMinimum !== null) {
19
+ info(`${packager} package requires glibc >= ${glibcMinimum}`);
20
+ }
21
+
22
+ return [{
16
23
  path: manifestPathFor(payload, packager),
17
- contents: stringify(renderNfpmConfig(payload, packager), { lineWidth: 0 }),
18
- },
19
- ];
24
+ contents: stringify(renderNfpmConfig(payload, packager, glibcMinimum), { lineWidth: 0 }),
25
+ }];
26
+ };
20
27
 
21
28
  const packPackage = async (payload: DeployPayload, packager: NfpmPackager): Promise<DeployArtifact[]> => [
22
29
  await packWithNfpm(payload, packager, manifestPathFor(payload, packager)),
@@ -25,6 +32,7 @@ const packPackage = async (payload: DeployPayload, packager: NfpmPackager): Prom
25
32
  const nfpmTarget = (packager: NfpmPackager): DeployTarget => ({
26
33
  name: packager,
27
34
  prefix: PREFIX,
35
+ isHostOnly: false,
28
36
  tools: [TAR],
29
37
  render: (payload) => renderManifests(payload, packager),
30
38
  pack: (payload) => packPackage(payload, packager),
@@ -2,6 +2,7 @@ import type { Config } from "@gtkx/config";
2
2
  import type { ResolvedApplicationIcon } from "../internal/icon-path.js";
3
3
 
4
4
  type DeployConfig = NonNullable<Config["deploy"]>;
5
+ type DeployArchName = NonNullable<DeployConfig["architectures"]>[number];
5
6
  type DeployTargetName = NonNullable<DeployConfig["targets"]>[number];
6
7
  type PackageFamily = "arch" | "debian" | "fedora" | "suse" | "unknown";
7
8
 
@@ -94,7 +95,7 @@ type DeployArch = {
94
95
  rpm: string;
95
96
  flatpak: string;
96
97
  appimage: string;
97
- node: string;
98
+ node: DeployArchName;
98
99
  };
99
100
 
100
101
  type DeployPaths = {
@@ -114,6 +115,7 @@ type DeployPaths = {
114
115
 
115
116
  type DeploySettings = {
116
117
  applicationId: string;
118
+ configFile: string;
117
119
  binaryName: string;
118
120
  name: string;
119
121
  genericName: string | null;
@@ -169,6 +171,7 @@ type DeployArtifact = {
169
171
  type DeployTarget = {
170
172
  name: DeployTargetName;
171
173
  prefix: string;
174
+ isHostOnly: boolean;
172
175
  tools: DeployTool[];
173
176
  render: (payload: DeployPayload) => DeployManifest[];
174
177
  pack: (payload: DeployPayload, manifests: DeployManifest[]) => Promise<DeployArtifact[]>;
@@ -176,6 +179,7 @@ type DeployTarget = {
176
179
 
177
180
  export type {
178
181
  DeployArch,
182
+ DeployArchName,
179
183
  DeployArtifact,
180
184
  DeployConfig,
181
185
  DeployDesktopAction,
@@ -39,7 +39,7 @@ const resolveAppimageTooling = async (arch: string): Promise<AppimageTooling> =>
39
39
  url: `${APPIMAGETOOL_URL}/appimagetool-${arch}.AppImage`,
40
40
  dest: join(dir, `appimagetool-${arch}`),
41
41
  label: `appimagetool ${APPIMAGETOOL_VERSION}`,
42
- sha256: digestFor(APPIMAGETOOL_DIGESTS, arch, "appimagetool"),
42
+ digest: digestFor(APPIMAGETOOL_DIGESTS, arch, "appimagetool"),
43
43
  mode: EXECUTABLE_MODE,
44
44
  });
45
45
 
@@ -47,7 +47,7 @@ const resolveAppimageTooling = async (arch: string): Promise<AppimageTooling> =>
47
47
  url: `${RUNTIME_URL}/runtime-${arch}`,
48
48
  dest: join(dir, `runtime-${arch}`),
49
49
  label: `the AppImage runtime ${RUNTIME_VERSION}`,
50
- sha256: digestFor(RUNTIME_DIGESTS, arch, "the AppImage runtime"),
50
+ digest: digestFor(RUNTIME_DIGESTS, arch, "the AppImage runtime"),
51
51
  mode: EXECUTABLE_MODE,
52
52
  });
53
53
 
@@ -56,7 +56,7 @@ const downloadNfpm = async (dir: string, binary: string): Promise<string> => {
56
56
  url: `${NFPM_BASE_URL}/${assetName}`,
57
57
  dest: join(dir, assetName),
58
58
  label: `nfpm ${NFPM_VERSION}`,
59
- sha256: digestFor(process.arch),
59
+ digest: digestFor(process.arch),
60
60
  });
61
61
 
62
62
  extractNfpm(archive, binary);
@@ -0,0 +1,35 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { resolve } from "node:path";
3
+ import type { WrittenCatalog } from "../i18n/catalogs.js";
4
+
5
+ type CatalogWrites = {
6
+ record: (catalogs: WrittenCatalog[]) => void;
7
+ hasWritten: (path: string) => boolean;
8
+ };
9
+
10
+ const hasContent = (path: string, content: Buffer): boolean => {
11
+ try {
12
+ return readFileSync(path).equals(content);
13
+ } catch {
14
+ return false;
15
+ }
16
+ };
17
+
18
+ const createCatalogWrites = (): CatalogWrites => {
19
+ const contents: Map<string, Buffer> = new Map();
20
+
21
+ return {
22
+ record: (catalogs) => {
23
+ for (const catalog of catalogs) {
24
+ contents.set(resolve(catalog.path), catalog.content);
25
+ }
26
+ },
27
+ hasWritten: (path) => {
28
+ const content = contents.get(resolve(path));
29
+
30
+ return content !== undefined && hasContent(path, content);
31
+ },
32
+ };
33
+ };
34
+
35
+ export { type CatalogWrites, createCatalogWrites };
@@ -1,3 +1,4 @@
1
1
  const DEV_ENTRY_ENV = "GTKX_DEV_ENTRY";
2
+ const DEV_CONFIG_ENV = "GTKX_DEV_CONFIG";
2
3
 
3
- export { DEV_ENTRY_ENV };
4
+ export { DEV_CONFIG_ENV, DEV_ENTRY_ENV };
@@ -0,0 +1,11 @@
1
+ import { stageProjectFonts } from "../internal/font-staging.js";
2
+ import { prependXdgDataDir } from "../internal/xdg-data-dirs.js";
3
+
4
+ const prepareDevFontDir = (root: string): string => {
5
+ const shareDir = stageProjectFonts(root);
6
+ process.env.XDG_DATA_DIRS = prependXdgDataDir(shareDir, process.env.XDG_DATA_DIRS);
7
+
8
+ return shareDir;
9
+ };
10
+
11
+ export { prepareDevFontDir };
@@ -0,0 +1,40 @@
1
+ import { MCP_SOCKET_PATH_ENV, resolveMcpSocketPath } from "@gtkx/mcp/internal";
2
+ import { resolveHeadlessOptions, startHeadlessDisplay } from "@gtkx/vitest/headless";
3
+
4
+ const restoreEnvironment = (name: string, value: string | undefined): void => {
5
+ if (value === undefined) {
6
+ Reflect.deleteProperty(process.env, name);
7
+ } else {
8
+ process.env[name] = value;
9
+ }
10
+ };
11
+
12
+ const startHeadlessDevDisplay = async (size?: string): Promise<() => void> => {
13
+ const previousSocketPath = process.env[MCP_SOCKET_PATH_ENV];
14
+ process.env[MCP_SOCKET_PATH_ENV] = resolveMcpSocketPath();
15
+
16
+ try {
17
+ const stopDisplay = await startHeadlessDisplay(resolveHeadlessOptions({ ...(size !== undefined && { size }) }));
18
+ let isStopped = false;
19
+
20
+ const stop = (): void => {
21
+ if (isStopped) {
22
+ return;
23
+ }
24
+
25
+ isStopped = true;
26
+ process.removeListener("exit", stop);
27
+ stopDisplay();
28
+ restoreEnvironment(MCP_SOCKET_PATH_ENV, previousSocketPath);
29
+ };
30
+
31
+ process.once("exit", stop);
32
+
33
+ return stop;
34
+ } catch (error) {
35
+ restoreEnvironment(MCP_SOCKET_PATH_ENV, previousSocketPath);
36
+ throw error;
37
+ }
38
+ };
39
+
40
+ export { startHeadlessDevDisplay };
@@ -17,6 +17,7 @@ import { isRefreshBoundary, performRefresh, staleExportName } from "../refresh-r
17
17
  import { gtkxFastRefresh } from "../vite-plugins/fast-refresh/swc-refresh.js";
18
18
  import { gtkxVitePlugins } from "../vite-plugins/index.js";
19
19
  import { gtkxReactDomPrebundle } from "../vite-plugins/react-dom-prebundle.js";
20
+ import { type CatalogWrites, createCatalogWrites } from "./catalog-writes.js";
20
21
 
21
22
  const DEV_MODE = "development";
22
23
  const APPLICATION_POLL_INTERVAL_MS = 50;
@@ -43,11 +44,22 @@ const waitForApplicationId = async (timeoutMs: number, shouldKeepWaiting: () =>
43
44
 
44
45
  const readFileRevision = (path: string): Promise<string> => readFile(path, "utf8");
45
46
 
46
- const defaultDevRunnerDeps = (): DevRunnerDeps => ({
47
+ const devPlugins = (configFile: string, catalogWrites: CatalogWrites): DevRunnerDeps["plugins"] =>
48
+ (entryPath) => [
49
+ ...gtkxVitePlugins({ mode: DEV_MODE, entryPath, configFile, onCatalogsWritten: catalogWrites.record }),
50
+ ...gtkxFastRefresh(),
51
+ gtkxReactDomPrebundle(),
52
+ ];
53
+
54
+ const createDevRunnerDeps = (
55
+ configFile: string,
56
+ deployOutDir: string | undefined,
57
+ catalogWrites: CatalogWrites,
58
+ ): DevRunnerDeps => ({
47
59
  createServer,
48
60
  waitForApplicationId,
49
61
  getConfiguredApplicationId: async (root: string) => {
50
- const loaded = await loadConfig(root, { mode: DEV_MODE });
62
+ const loaded = await loadConfig(root, { mode: DEV_MODE, configFile });
51
63
 
52
64
  return loaded.config.applicationId;
53
65
  },
@@ -86,13 +98,14 @@ const defaultDevRunnerDeps = (): DevRunnerDeps => ({
86
98
  isRefreshBoundary,
87
99
  staleExportName,
88
100
  readFileRevision,
89
- plugins: (entryPath) => [
90
- ...gtkxVitePlugins(DEV_MODE, entryPath),
91
- ...gtkxFastRefresh(),
92
- gtkxReactDomPrebundle(),
93
- ],
101
+ hasWrittenCatalog: catalogWrites.hasWritten,
102
+ deployOutDir,
103
+ plugins: devPlugins(configFile, catalogWrites),
94
104
  log: info,
95
105
  exit: (code: number): never => process.exit(code),
96
106
  });
97
107
 
108
+ const defaultDevRunnerDeps = (configFile: string, deployOutDir: string | undefined): DevRunnerDeps =>
109
+ createDevRunnerDeps(configFile, deployOutDir, createCatalogWrites());
110
+
98
111
  export { defaultDevRunnerDeps };
@@ -1,7 +1,8 @@
1
1
  import { loadConfig } from "@gtkx/config";
2
2
  import { error } from "@gtkx/utils";
3
3
  import { resolve } from "node:path";
4
- import { DEV_ENTRY_ENV } from "./entry-env.js";
4
+ import { DEV_CONFIG_ENV, DEV_ENTRY_ENV } from "./entry-env.js";
5
+ import { prepareDevFontDir } from "./font-dir.js";
5
6
  import { prepareDevIconDir } from "./icon-dir.js";
6
7
  import { prepareDevLocaleDir } from "./locale-dir.js";
7
8
  import { createDevRunner } from "./runner.js";
@@ -22,13 +23,21 @@ const main = async (): Promise<void> => {
22
23
  process.exit(1);
23
24
  }
24
25
 
25
- const { config, root } = await loadConfig(cwd, { mode: "development" });
26
+ const configFile = process.env[DEV_CONFIG_ENV];
27
+
28
+ if (!configFile) {
29
+ error(`Missing ${DEV_CONFIG_ENV}`);
30
+ process.exit(1);
31
+ }
32
+
33
+ const { config, root } = await loadConfig(cwd, { mode: "development", configFile });
26
34
  prepareDevLocaleDir(root, config.applicationId);
27
35
  prepareDevSchemaDir(root);
28
36
  prepareDevIconDir(root, config.applicationId, config.applicationIcon);
37
+ prepareDevFontDir(root);
29
38
  const entryPath = resolve(cwd, entryArg);
30
39
  const { defaultDevRunnerDeps } = await import("./runner-deps.js");
31
- const runner = createDevRunner(defaultDevRunnerDeps());
40
+ const runner = createDevRunner(defaultDevRunnerDeps(configFile, config.deploy?.outDir));
32
41
  await runner.run(entryPath);
33
42
  };
34
43
 
package/src/dev/runner.ts CHANGED
@@ -2,6 +2,7 @@ import type { ApplicationInstance } from "@gtkx/runtime/internal";
2
2
  import type { InlineConfig, Plugin } from "vite";
3
3
  import { error, warn } from "@gtkx/utils";
4
4
  import { isCatalogSource } from "../i18n/catalogs.js";
5
+ import { hasUnstagedFontImport } from "../internal/font-staging.js";
5
6
  import { loadModuleExclusively, withExclusiveLoad } from "../internal/module-loads.js";
6
7
  import { createChangeQueue, type WatchedChange } from "./change-queue.js";
7
8
  import { createFailureTracker, type FailureTracker } from "./failure-tracker.js";
@@ -33,6 +34,8 @@ type DevRunnerDeps = {
33
34
  isRefreshBoundary(module: Record<string, unknown>): boolean;
34
35
  staleExportName(previous: Record<string, unknown>, current: Record<string, unknown>): string | null;
35
36
  readFileRevision(path: string): Promise<string>;
37
+ hasWrittenCatalog(path: string): boolean;
38
+ deployOutDir: string | undefined;
36
39
  plugins(entryPath: string): Plugin[];
37
40
  log(message: string): void;
38
41
  exit(code: number): never;
@@ -370,21 +373,46 @@ const restartForServerConfig = async (session: DevSession, changedPath: string):
370
373
  await requestRestart(session);
371
374
  };
372
375
 
373
- const applyChange = async (session: DevSession, change: WatchedChange): Promise<void> => {
374
- if (session.controller.isShuttingDown()) {
376
+ const restartForFont = async (session: DevSession, changedPath: string): Promise<void> => {
377
+ session.deps.log(`Font import added: ${changedPath}`);
378
+ await requestRestart(session);
379
+ };
380
+
381
+ const restartForCatalog = async (session: DevSession, changedPath: string): Promise<void> => {
382
+ if (session.deps.hasWrittenCatalog(changedPath)) {
375
383
  return;
376
384
  }
377
385
 
378
- if (isCatalogSource(session.server.config.root, change.path)) {
379
- session.deps.log(`Translation catalog changed: ${change.path}`);
380
- await requestRestart(session);
386
+ session.deps.log(`Translation catalog changed: ${changedPath}`);
387
+ await requestRestart(session);
388
+ };
381
389
 
382
- return;
390
+ const didRestartForChange = async (session: DevSession, change: WatchedChange): Promise<boolean> => {
391
+ const { root } = session.server.config;
392
+
393
+ if (isCatalogSource(root, change.path)) {
394
+ await restartForCatalog(session, change.path);
395
+
396
+ return true;
383
397
  }
384
398
 
385
399
  if (isServerConfigFile(session.server.config, change.path)) {
386
400
  await restartForServerConfig(session, change.path);
387
401
 
402
+ return true;
403
+ }
404
+
405
+ if (change.event !== "unlink" && hasUnstagedFontImport(root, change.path)) {
406
+ await restartForFont(session, change.path);
407
+
408
+ return true;
409
+ }
410
+
411
+ return false;
412
+ };
413
+
414
+ const applyChange = async (session: DevSession, change: WatchedChange): Promise<void> => {
415
+ if (session.controller.isShuttingDown() || await didRestartForChange(session, change)) {
388
416
  return;
389
417
  }
390
418
 
@@ -610,7 +638,9 @@ const createSession = (server: DevServer, deps: DevRunnerDeps): DevSession => {
610
638
 
611
639
  const createDevRunner = (deps: DevRunnerDeps): DevRunner => ({
612
640
  async run(entryPath: string): Promise<void> {
613
- const server = await deps.createServer(createDevServerConfig(process.cwd(), deps.plugins(entryPath)));
641
+ const server = await deps.createServer(
642
+ createDevServerConfig(process.cwd(), deps.deployOutDir, deps.plugins(entryPath)),
643
+ );
614
644
  const session = createSession(server, deps);
615
645
  deps.installShutdownHandlers(onShutdownSignal(session));
616
646