@gtkx/cli 1.0.0 → 1.1.0

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 (449) hide show
  1. package/README.md +1 -1
  2. package/dist/builder.d.ts +1 -1
  3. package/dist/builder.d.ts.map +1 -1
  4. package/dist/builder.js +20 -3
  5. package/dist/builder.js.map +1 -1
  6. package/dist/cli.js +6 -2
  7. package/dist/cli.js.map +1 -1
  8. package/dist/codegen/freshness.js +2 -2
  9. package/dist/codegen/freshness.js.map +1 -1
  10. package/dist/codegen/run-codegen.d.ts +8 -5
  11. package/dist/codegen/run-codegen.d.ts.map +1 -1
  12. package/dist/codegen/run-codegen.js +24 -19
  13. package/dist/codegen/run-codegen.js.map +1 -1
  14. package/dist/codegen/store-resolver.d.ts +1 -1
  15. package/dist/codegen/store-resolver.d.ts.map +1 -1
  16. package/dist/codegen/store-resolver.js.map +1 -1
  17. package/dist/commands/build.d.ts.map +1 -1
  18. package/dist/commands/build.js +5 -6
  19. package/dist/commands/build.js.map +1 -1
  20. package/dist/commands/codegen.d.ts.map +1 -1
  21. package/dist/commands/codegen.js +11 -1
  22. package/dist/commands/codegen.js.map +1 -1
  23. package/dist/commands/deploy.d.ts +22 -0
  24. package/dist/commands/deploy.d.ts.map +1 -0
  25. package/dist/commands/deploy.js +44 -0
  26. package/dist/commands/deploy.js.map +1 -0
  27. package/dist/commands/dev.d.ts.map +1 -1
  28. package/dist/commands/dev.js +4 -4
  29. package/dist/commands/dev.js.map +1 -1
  30. package/dist/commands/docs.d.ts +2 -2
  31. package/dist/commands/docs.d.ts.map +1 -1
  32. package/dist/commands/docs.js +27 -4
  33. package/dist/commands/docs.js.map +1 -1
  34. package/dist/deploy/depends.d.ts +8 -0
  35. package/dist/deploy/depends.d.ts.map +1 -0
  36. package/dist/deploy/depends.js +27 -0
  37. package/dist/deploy/depends.js.map +1 -0
  38. package/dist/deploy/download.d.ts +20 -0
  39. package/dist/deploy/download.d.ts.map +1 -0
  40. package/dist/deploy/download.js +98 -0
  41. package/dist/deploy/download.js.map +1 -0
  42. package/dist/deploy/freedesktop/copyright.d.ts +4 -0
  43. package/dist/deploy/freedesktop/copyright.d.ts.map +1 -0
  44. package/dist/deploy/freedesktop/copyright.js +33 -0
  45. package/dist/deploy/freedesktop/copyright.js.map +1 -0
  46. package/dist/deploy/freedesktop/dbus-service.d.ts +4 -0
  47. package/dist/deploy/freedesktop/dbus-service.d.ts.map +1 -0
  48. package/dist/deploy/freedesktop/dbus-service.js +15 -0
  49. package/dist/deploy/freedesktop/dbus-service.js.map +1 -0
  50. package/dist/deploy/freedesktop/desktop-entry.d.ts +4 -0
  51. package/dist/deploy/freedesktop/desktop-entry.d.ts.map +1 -0
  52. package/dist/deploy/freedesktop/desktop-entry.js +73 -0
  53. package/dist/deploy/freedesktop/desktop-entry.js.map +1 -0
  54. package/dist/deploy/freedesktop/ini.d.ts +7 -0
  55. package/dist/deploy/freedesktop/ini.d.ts.map +1 -0
  56. package/dist/deploy/freedesktop/ini.js +22 -0
  57. package/dist/deploy/freedesktop/ini.js.map +1 -0
  58. package/dist/deploy/freedesktop/metainfo-sections.d.ts +13 -0
  59. package/dist/deploy/freedesktop/metainfo-sections.d.ts.map +1 -0
  60. package/dist/deploy/freedesktop/metainfo-sections.js +73 -0
  61. package/dist/deploy/freedesktop/metainfo-sections.js.map +1 -0
  62. package/dist/deploy/freedesktop/metainfo.d.ts +4 -0
  63. package/dist/deploy/freedesktop/metainfo.d.ts.map +1 -0
  64. package/dist/deploy/freedesktop/metainfo.js +29 -0
  65. package/dist/deploy/freedesktop/metainfo.js.map +1 -0
  66. package/dist/deploy/freedesktop/mime-package.d.ts +4 -0
  67. package/dist/deploy/freedesktop/mime-package.d.ts.map +1 -0
  68. package/dist/deploy/freedesktop/mime-package.js +16 -0
  69. package/dist/deploy/freedesktop/mime-package.js.map +1 -0
  70. package/dist/deploy/freedesktop/validate.d.ts +4 -0
  71. package/dist/deploy/freedesktop/validate.d.ts.map +1 -0
  72. package/dist/deploy/freedesktop/validate.js +81 -0
  73. package/dist/deploy/freedesktop/validate.js.map +1 -0
  74. package/dist/deploy/freedesktop/xml.d.ts +11 -0
  75. package/dist/deploy/freedesktop/xml.d.ts.map +1 -0
  76. package/dist/deploy/freedesktop/xml.js +33 -0
  77. package/dist/deploy/freedesktop/xml.js.map +1 -0
  78. package/dist/deploy/git.d.ts +4 -0
  79. package/dist/deploy/git.d.ts.map +1 -0
  80. package/dist/deploy/git.js +17 -0
  81. package/dist/deploy/git.js.map +1 -0
  82. package/dist/deploy/install-hints.d.ts +5 -0
  83. package/dist/deploy/install-hints.d.ts.map +1 -0
  84. package/dist/deploy/install-hints.js +85 -0
  85. package/dist/deploy/install-hints.js.map +1 -0
  86. package/dist/deploy/nfpm/config.d.ts +8 -0
  87. package/dist/deploy/nfpm/config.d.ts.map +1 -0
  88. package/dist/deploy/nfpm/config.js +119 -0
  89. package/dist/deploy/nfpm/config.js.map +1 -0
  90. package/dist/deploy/nfpm/contents.d.ts +12 -0
  91. package/dist/deploy/nfpm/contents.d.ts.map +1 -0
  92. package/dist/deploy/nfpm/contents.js +48 -0
  93. package/dist/deploy/nfpm/contents.js.map +1 -0
  94. package/dist/deploy/nfpm/description.d.ts +5 -0
  95. package/dist/deploy/nfpm/description.d.ts.map +1 -0
  96. package/dist/deploy/nfpm/description.js +5 -0
  97. package/dist/deploy/nfpm/description.js.map +1 -0
  98. package/dist/deploy/nfpm/optional.d.ts +5 -0
  99. package/dist/deploy/nfpm/optional.d.ts.map +1 -0
  100. package/dist/deploy/nfpm/optional.js +4 -0
  101. package/dist/deploy/nfpm/optional.js.map +1 -0
  102. package/dist/deploy/nfpm/pack.d.ts +5 -0
  103. package/dist/deploy/nfpm/pack.d.ts.map +1 -0
  104. package/dist/deploy/nfpm/pack.js +32 -0
  105. package/dist/deploy/nfpm/pack.js.map +1 -0
  106. package/dist/deploy/node-runtime/download.d.ts +3 -0
  107. package/dist/deploy/node-runtime/download.d.ts.map +1 -0
  108. package/dist/deploy/node-runtime/download.js +39 -0
  109. package/dist/deploy/node-runtime/download.js.map +1 -0
  110. package/dist/deploy/node-runtime/elf.d.ts +7 -0
  111. package/dist/deploy/node-runtime/elf.d.ts.map +1 -0
  112. package/dist/deploy/node-runtime/elf.js +100 -0
  113. package/dist/deploy/node-runtime/elf.js.map +1 -0
  114. package/dist/deploy/node-runtime/guard.d.ts +4 -0
  115. package/dist/deploy/node-runtime/guard.d.ts.map +1 -0
  116. package/dist/deploy/node-runtime/guard.js +22 -0
  117. package/dist/deploy/node-runtime/guard.js.map +1 -0
  118. package/dist/deploy/node-runtime/index.d.ts +4 -0
  119. package/dist/deploy/node-runtime/index.d.ts.map +1 -0
  120. package/dist/deploy/node-runtime/index.js +61 -0
  121. package/dist/deploy/node-runtime/index.js.map +1 -0
  122. package/dist/deploy/payload/copy-tree.d.ts +7 -0
  123. package/dist/deploy/payload/copy-tree.d.ts.map +1 -0
  124. package/dist/deploy/payload/copy-tree.js +36 -0
  125. package/dist/deploy/payload/copy-tree.js.map +1 -0
  126. package/dist/deploy/payload/icons.d.ts +6 -0
  127. package/dist/deploy/payload/icons.d.ts.map +1 -0
  128. package/dist/deploy/payload/icons.js +53 -0
  129. package/dist/deploy/payload/icons.js.map +1 -0
  130. package/dist/deploy/payload/launcher.d.ts +5 -0
  131. package/dist/deploy/payload/launcher.d.ts.map +1 -0
  132. package/dist/deploy/payload/launcher.js +22 -0
  133. package/dist/deploy/payload/launcher.js.map +1 -0
  134. package/dist/deploy/payload/schemas.d.ts +4 -0
  135. package/dist/deploy/payload/schemas.d.ts.map +1 -0
  136. package/dist/deploy/payload/schemas.js +17 -0
  137. package/dist/deploy/payload/schemas.js.map +1 -0
  138. package/dist/deploy/payload/stage.d.ts +15 -0
  139. package/dist/deploy/payload/stage.d.ts.map +1 -0
  140. package/dist/deploy/payload/stage.js +100 -0
  141. package/dist/deploy/payload/stage.js.map +1 -0
  142. package/dist/deploy/registry.d.ts +7 -0
  143. package/dist/deploy/registry.d.ts.map +1 -0
  144. package/dist/deploy/registry.js +30 -0
  145. package/dist/deploy/registry.js.map +1 -0
  146. package/dist/deploy/run-deploy.d.ts +11 -0
  147. package/dist/deploy/run-deploy.d.ts.map +1 -0
  148. package/dist/deploy/run-deploy.js +153 -0
  149. package/dist/deploy/run-deploy.js.map +1 -0
  150. package/dist/deploy/settings/arch.d.ts +4 -0
  151. package/dist/deploy/settings/arch.d.ts.map +1 -0
  152. package/dist/deploy/settings/arch.js +13 -0
  153. package/dist/deploy/settings/arch.js.map +1 -0
  154. package/dist/deploy/settings/categories.d.ts +4 -0
  155. package/dist/deploy/settings/categories.d.ts.map +1 -0
  156. package/dist/deploy/settings/categories.js +29 -0
  157. package/dist/deploy/settings/categories.js.map +1 -0
  158. package/dist/deploy/settings/exec.d.ts +6 -0
  159. package/dist/deploy/settings/exec.d.ts.map +1 -0
  160. package/dist/deploy/settings/exec.js +20 -0
  161. package/dist/deploy/settings/exec.js.map +1 -0
  162. package/dist/deploy/settings/identity.d.ts +18 -0
  163. package/dist/deploy/settings/identity.d.ts.map +1 -0
  164. package/dist/deploy/settings/identity.js +73 -0
  165. package/dist/deploy/settings/identity.js.map +1 -0
  166. package/dist/deploy/settings/index.d.ts +11 -0
  167. package/dist/deploy/settings/index.d.ts.map +1 -0
  168. package/dist/deploy/settings/index.js +103 -0
  169. package/dist/deploy/settings/index.js.map +1 -0
  170. package/dist/deploy/settings/package-manifest.d.ts +15 -0
  171. package/dist/deploy/settings/package-manifest.d.ts.map +1 -0
  172. package/dist/deploy/settings/package-manifest.js +41 -0
  173. package/dist/deploy/settings/package-manifest.js.map +1 -0
  174. package/dist/deploy/settings/paths.d.ts +9 -0
  175. package/dist/deploy/settings/paths.d.ts.map +1 -0
  176. package/dist/deploy/settings/paths.js +82 -0
  177. package/dist/deploy/settings/paths.js.map +1 -0
  178. package/dist/deploy/settings/screenshots.d.ts +8 -0
  179. package/dist/deploy/settings/screenshots.d.ts.map +1 -0
  180. package/dist/deploy/settings/screenshots.js +79 -0
  181. package/dist/deploy/settings/screenshots.js.map +1 -0
  182. package/dist/deploy/settings/starter.d.ts +4 -0
  183. package/dist/deploy/settings/starter.d.ts.map +1 -0
  184. package/dist/deploy/settings/starter.js +28 -0
  185. package/dist/deploy/settings/starter.js.map +1 -0
  186. package/dist/deploy/settings/version.d.ts +9 -0
  187. package/dist/deploy/settings/version.d.ts.map +1 -0
  188. package/dist/deploy/settings/version.js +37 -0
  189. package/dist/deploy/settings/version.js.map +1 -0
  190. package/dist/deploy/targets/appimage.d.ts +4 -0
  191. package/dist/deploy/targets/appimage.d.ts.map +1 -0
  192. package/dist/deploy/targets/appimage.js +105 -0
  193. package/dist/deploy/targets/appimage.js.map +1 -0
  194. package/dist/deploy/targets/deb.d.ts +4 -0
  195. package/dist/deploy/targets/deb.d.ts.map +1 -0
  196. package/dist/deploy/targets/deb.js +4 -0
  197. package/dist/deploy/targets/deb.js.map +1 -0
  198. package/dist/deploy/targets/flatpak-manifest.d.ts +6 -0
  199. package/dist/deploy/targets/flatpak-manifest.d.ts.map +1 -0
  200. package/dist/deploy/targets/flatpak-manifest.js +48 -0
  201. package/dist/deploy/targets/flatpak-manifest.js.map +1 -0
  202. package/dist/deploy/targets/flatpak-prebuilt.d.ts +8 -0
  203. package/dist/deploy/targets/flatpak-prebuilt.d.ts.map +1 -0
  204. package/dist/deploy/targets/flatpak-prebuilt.js +43 -0
  205. package/dist/deploy/targets/flatpak-prebuilt.js.map +1 -0
  206. package/dist/deploy/targets/flatpak-source.d.ts +5 -0
  207. package/dist/deploy/targets/flatpak-source.d.ts.map +1 -0
  208. package/dist/deploy/targets/flatpak-source.js +110 -0
  209. package/dist/deploy/targets/flatpak-source.js.map +1 -0
  210. package/dist/deploy/targets/flatpak-sources.d.ts +17 -0
  211. package/dist/deploy/targets/flatpak-sources.d.ts.map +1 -0
  212. package/dist/deploy/targets/flatpak-sources.js +108 -0
  213. package/dist/deploy/targets/flatpak-sources.js.map +1 -0
  214. package/dist/deploy/targets/flatpak.d.ts +4 -0
  215. package/dist/deploy/targets/flatpak.d.ts.map +1 -0
  216. package/dist/deploy/targets/flatpak.js +112 -0
  217. package/dist/deploy/targets/flatpak.js.map +1 -0
  218. package/dist/deploy/targets/nfpm-target.d.ts +5 -0
  219. package/dist/deploy/targets/nfpm-target.d.ts.map +1 -0
  220. package/dist/deploy/targets/nfpm-target.js +26 -0
  221. package/dist/deploy/targets/nfpm-target.js.map +1 -0
  222. package/dist/deploy/targets/rpm.d.ts +4 -0
  223. package/dist/deploy/targets/rpm.d.ts.map +1 -0
  224. package/dist/deploy/targets/rpm.js +4 -0
  225. package/dist/deploy/targets/rpm.js.map +1 -0
  226. package/dist/deploy/tools.d.ts +18 -0
  227. package/dist/deploy/tools.d.ts.map +1 -0
  228. package/dist/deploy/tools.js +92 -0
  229. package/dist/deploy/tools.js.map +1 -0
  230. package/dist/deploy/types.d.ts +140 -0
  231. package/dist/deploy/types.d.ts.map +1 -0
  232. package/dist/deploy/types.js +2 -0
  233. package/dist/deploy/types.js.map +1 -0
  234. package/dist/deploy/vendored/appimagetool.d.ts +7 -0
  235. package/dist/deploy/vendored/appimagetool.d.ts.map +1 -0
  236. package/dist/deploy/vendored/appimagetool.js +42 -0
  237. package/dist/deploy/vendored/appimagetool.js.map +1 -0
  238. package/dist/deploy/vendored/nfpm.d.ts +3 -0
  239. package/dist/deploy/vendored/nfpm.d.ts.map +1 -0
  240. package/dist/deploy/vendored/nfpm.js +60 -0
  241. package/dist/deploy/vendored/nfpm.js.map +1 -0
  242. package/dist/dev/change-queue.d.ts +11 -0
  243. package/dist/dev/change-queue.d.ts.map +1 -0
  244. package/dist/dev/change-queue.js +34 -0
  245. package/dist/dev/change-queue.js.map +1 -0
  246. package/dist/dev/failure-tracker.d.ts +10 -0
  247. package/dist/dev/failure-tracker.d.ts.map +1 -0
  248. package/dist/dev/failure-tracker.js +61 -0
  249. package/dist/dev/failure-tracker.js.map +1 -0
  250. package/dist/dev/missing-import.d.ts +4 -0
  251. package/dist/dev/missing-import.d.ts.map +1 -0
  252. package/dist/dev/missing-import.js +23 -0
  253. package/dist/dev/missing-import.js.map +1 -0
  254. package/dist/dev/runner-deps.d.ts.map +1 -1
  255. package/dist/dev/runner-deps.js +25 -6
  256. package/dist/dev/runner-deps.js.map +1 -1
  257. package/dist/dev/runner.d.ts +8 -4
  258. package/dist/dev/runner.d.ts.map +1 -1
  259. package/dist/dev/runner.js +334 -66
  260. package/dist/dev/runner.js.map +1 -1
  261. package/dist/dev/supervisor.d.ts +1 -2
  262. package/dist/dev/supervisor.d.ts.map +1 -1
  263. package/dist/dev/supervisor.js +1 -1
  264. package/dist/dev/supervisor.js.map +1 -1
  265. package/dist/dev/vite-dev-server.d.ts +13 -2
  266. package/dist/dev/vite-dev-server.d.ts.map +1 -1
  267. package/dist/dev/vite-dev-server.js +30 -2
  268. package/dist/dev/vite-dev-server.js.map +1 -1
  269. package/dist/internal/entry-arg.d.ts +1 -7
  270. package/dist/internal/entry-arg.d.ts.map +1 -1
  271. package/dist/internal/entry-arg.js +18 -11
  272. package/dist/internal/entry-arg.js.map +1 -1
  273. package/dist/internal/module-loads.d.ts +7 -0
  274. package/dist/internal/module-loads.d.ts.map +1 -0
  275. package/dist/internal/module-loads.js +21 -0
  276. package/dist/internal/module-loads.js.map +1 -0
  277. package/dist/internal/prepare-project.d.ts +16 -0
  278. package/dist/internal/prepare-project.d.ts.map +1 -0
  279. package/dist/internal/prepare-project.js +15 -0
  280. package/dist/internal/prepare-project.js.map +1 -0
  281. package/dist/internal/run-cli-tool.d.ts +2 -1
  282. package/dist/internal/run-cli-tool.d.ts.map +1 -1
  283. package/dist/internal/run-cli-tool.js +15 -6
  284. package/dist/internal/run-cli-tool.js.map +1 -1
  285. package/dist/internal/staging-dir.d.ts +8 -1
  286. package/dist/internal/staging-dir.d.ts.map +1 -1
  287. package/dist/internal/staging-dir.js +38 -2
  288. package/dist/internal/staging-dir.js.map +1 -1
  289. package/dist/mcp/serialize-widget.d.ts +2 -1
  290. package/dist/mcp/serialize-widget.d.ts.map +1 -1
  291. package/dist/mcp/serialize-widget.js +1 -1
  292. package/dist/mcp/serialize-widget.js.map +1 -1
  293. package/dist/mcp/testing-loader.d.ts +5 -2
  294. package/dist/mcp/testing-loader.d.ts.map +1 -1
  295. package/dist/mcp/testing-loader.js +7 -3
  296. package/dist/mcp/testing-loader.js.map +1 -1
  297. package/dist/refresh-runtime.d.ts +2 -1
  298. package/dist/refresh-runtime.d.ts.map +1 -1
  299. package/dist/refresh-runtime.js +32 -2
  300. package/dist/refresh-runtime.js.map +1 -1
  301. package/dist/settings/schema.d.ts +1 -2
  302. package/dist/settings/schema.d.ts.map +1 -1
  303. package/dist/settings/schema.js +1 -1
  304. package/dist/settings/schema.js.map +1 -1
  305. package/dist/vite-plugins/asset-extensions.d.ts +2 -1
  306. package/dist/vite-plugins/asset-extensions.d.ts.map +1 -1
  307. package/dist/vite-plugins/asset-extensions.js +2 -1
  308. package/dist/vite-plugins/asset-extensions.js.map +1 -1
  309. package/dist/vite-plugins/asset-imports.d.ts +4 -0
  310. package/dist/vite-plugins/asset-imports.d.ts.map +1 -0
  311. package/dist/vite-plugins/asset-imports.js +88 -0
  312. package/dist/vite-plugins/asset-imports.js.map +1 -0
  313. package/dist/vite-plugins/asset-specifier.d.ts +5 -0
  314. package/dist/vite-plugins/asset-specifier.d.ts.map +1 -0
  315. package/dist/vite-plugins/asset-specifier.js +7 -0
  316. package/dist/vite-plugins/asset-specifier.js.map +1 -0
  317. package/dist/vite-plugins/esm-extension.d.ts +4 -0
  318. package/dist/vite-plugins/esm-extension.d.ts.map +1 -0
  319. package/dist/vite-plugins/esm-extension.js +4 -0
  320. package/dist/vite-plugins/esm-extension.js.map +1 -0
  321. package/dist/vite-plugins/fast-refresh/swc-refresh.d.ts +1 -3
  322. package/dist/vite-plugins/fast-refresh/swc-refresh.d.ts.map +1 -1
  323. package/dist/vite-plugins/fast-refresh/swc-refresh.js +1 -1
  324. package/dist/vite-plugins/fast-refresh/swc-refresh.js.map +1 -1
  325. package/dist/vite-plugins/index.d.ts.map +1 -1
  326. package/dist/vite-plugins/index.js +4 -0
  327. package/dist/vite-plugins/index.js.map +1 -1
  328. package/dist/vite-plugins/resource-shared.d.ts +2 -1
  329. package/dist/vite-plugins/resource-shared.d.ts.map +1 -1
  330. package/dist/vite-plugins/resource-shared.js +2 -1
  331. package/dist/vite-plugins/resource-shared.js.map +1 -1
  332. package/dist/vite-plugins/resources.d.ts.map +1 -1
  333. package/dist/vite-plugins/resources.js +30 -29
  334. package/dist/vite-plugins/resources.js.map +1 -1
  335. package/dist/vite-plugins/self-contained.d.ts +4 -0
  336. package/dist/vite-plugins/self-contained.d.ts.map +1 -0
  337. package/dist/vite-plugins/self-contained.js +244 -0
  338. package/dist/vite-plugins/self-contained.js.map +1 -0
  339. package/dist/vite-plugins/settings.d.ts.map +1 -1
  340. package/dist/vite-plugins/settings.js +19 -40
  341. package/dist/vite-plugins/settings.js.map +1 -1
  342. package/dist/vite-plugins/store-links.d.ts +4 -0
  343. package/dist/vite-plugins/store-links.d.ts.map +1 -0
  344. package/dist/vite-plugins/store-links.js +19 -0
  345. package/dist/vite-plugins/store-links.js.map +1 -0
  346. package/dist/vite-plugins/undeclared-library.d.ts.map +1 -1
  347. package/dist/vite-plugins/undeclared-library.js +51 -12
  348. package/dist/vite-plugins/undeclared-library.js.map +1 -1
  349. package/dist/vite-plugins/worker.d.ts.map +1 -1
  350. package/dist/vite-plugins/worker.js +3 -1
  351. package/dist/vite-plugins/worker.js.map +1 -1
  352. package/env.d.ts +106 -25
  353. package/package.json +20 -13
  354. package/src/builder.ts +22 -4
  355. package/src/cli.ts +7 -2
  356. package/src/codegen/freshness.ts +2 -2
  357. package/src/codegen/run-codegen.ts +37 -23
  358. package/src/codegen/store-resolver.ts +1 -1
  359. package/src/commands/build.ts +5 -6
  360. package/src/commands/codegen.ts +14 -1
  361. package/src/commands/deploy.ts +47 -0
  362. package/src/commands/dev.ts +4 -4
  363. package/src/commands/docs.ts +39 -4
  364. package/src/deploy/depends.ts +42 -0
  365. package/src/deploy/download.ts +148 -0
  366. package/src/deploy/freedesktop/copyright.ts +41 -0
  367. package/src/deploy/freedesktop/dbus-service.ts +19 -0
  368. package/src/deploy/freedesktop/desktop-entry.ts +102 -0
  369. package/src/deploy/freedesktop/ini.ts +39 -0
  370. package/src/deploy/freedesktop/metainfo-sections.ts +116 -0
  371. package/src/deploy/freedesktop/metainfo.ts +46 -0
  372. package/src/deploy/freedesktop/mime-package.ts +28 -0
  373. package/src/deploy/freedesktop/validate.ts +124 -0
  374. package/src/deploy/freedesktop/xml.ts +53 -0
  375. package/src/deploy/git.ts +20 -0
  376. package/src/deploy/install-hints.ts +108 -0
  377. package/src/deploy/nfpm/config.ts +153 -0
  378. package/src/deploy/nfpm/contents.ts +69 -0
  379. package/src/deploy/nfpm/description.ts +11 -0
  380. package/src/deploy/nfpm/optional.ts +8 -0
  381. package/src/deploy/nfpm/pack.ts +44 -0
  382. package/src/deploy/node-runtime/download.ts +48 -0
  383. package/src/deploy/node-runtime/elf.ts +145 -0
  384. package/src/deploy/node-runtime/guard.ts +29 -0
  385. package/src/deploy/node-runtime/index.ts +80 -0
  386. package/src/deploy/payload/copy-tree.ts +51 -0
  387. package/src/deploy/payload/icons.ts +80 -0
  388. package/src/deploy/payload/launcher.ts +27 -0
  389. package/src/deploy/payload/schemas.ts +27 -0
  390. package/src/deploy/payload/stage.ts +145 -0
  391. package/src/deploy/registry.ts +40 -0
  392. package/src/deploy/run-deploy.ts +235 -0
  393. package/src/deploy/settings/arch.ts +18 -0
  394. package/src/deploy/settings/categories.ts +39 -0
  395. package/src/deploy/settings/exec.ts +29 -0
  396. package/src/deploy/settings/identity.ts +133 -0
  397. package/src/deploy/settings/index.ts +189 -0
  398. package/src/deploy/settings/package-manifest.ts +66 -0
  399. package/src/deploy/settings/paths.ts +115 -0
  400. package/src/deploy/settings/screenshots.ts +125 -0
  401. package/src/deploy/settings/starter.ts +41 -0
  402. package/src/deploy/settings/version.ts +59 -0
  403. package/src/deploy/targets/appimage.ts +140 -0
  404. package/src/deploy/targets/deb.ts +6 -0
  405. package/src/deploy/targets/flatpak-manifest.ts +61 -0
  406. package/src/deploy/targets/flatpak-prebuilt.ts +59 -0
  407. package/src/deploy/targets/flatpak-source.ts +168 -0
  408. package/src/deploy/targets/flatpak-sources.ts +171 -0
  409. package/src/deploy/targets/flatpak.ts +143 -0
  410. package/src/deploy/targets/nfpm-target.ts +33 -0
  411. package/src/deploy/targets/rpm.ts +6 -0
  412. package/src/deploy/tools.ts +135 -0
  413. package/src/deploy/types.ts +174 -0
  414. package/src/deploy/vendored/appimagetool.ts +57 -0
  415. package/src/deploy/vendored/nfpm.ts +79 -0
  416. package/src/dev/change-queue.ts +59 -0
  417. package/src/dev/failure-tracker.ts +92 -0
  418. package/src/dev/missing-import.ts +32 -0
  419. package/src/dev/runner-deps.ts +34 -6
  420. package/src/dev/runner.ts +506 -102
  421. package/src/dev/supervisor.ts +0 -3
  422. package/src/dev/vite-dev-server.ts +54 -3
  423. package/src/internal/entry-arg.ts +25 -11
  424. package/src/internal/module-loads.ts +32 -0
  425. package/src/internal/prepare-project.ts +23 -0
  426. package/src/internal/run-cli-tool.ts +22 -6
  427. package/src/internal/staging-dir.ts +57 -2
  428. package/src/mcp/serialize-widget.ts +3 -2
  429. package/src/mcp/testing-loader.ts +19 -4
  430. package/src/refresh-runtime.ts +48 -2
  431. package/src/settings/schema.ts +0 -1
  432. package/src/vite-plugins/asset-extensions.ts +2 -1
  433. package/src/vite-plugins/asset-imports.ts +134 -0
  434. package/src/vite-plugins/asset-specifier.ts +9 -0
  435. package/src/vite-plugins/esm-extension.ts +4 -0
  436. package/src/vite-plugins/fast-refresh/swc-refresh.ts +1 -1
  437. package/src/vite-plugins/index.ts +4 -0
  438. package/src/vite-plugins/resource-shared.ts +2 -0
  439. package/src/vite-plugins/resources.ts +33 -33
  440. package/src/vite-plugins/self-contained.ts +352 -0
  441. package/src/vite-plugins/settings.ts +21 -48
  442. package/src/vite-plugins/store-links.ts +25 -0
  443. package/src/vite-plugins/undeclared-library.ts +74 -12
  444. package/src/vite-plugins/worker.ts +4 -1
  445. package/dist/internal.d.ts +0 -3
  446. package/dist/internal.d.ts.map +0 -1
  447. package/dist/internal.js +0 -3
  448. package/dist/internal.js.map +0 -1
  449. package/src/internal.ts +0 -2
package/env.d.ts CHANGED
@@ -1,107 +1,167 @@
1
1
  /// <reference types="vite/client" />
2
2
  /// <reference types="@gtkx/react/env" />
3
3
 
4
- declare module "*.aac" {
4
+ declare module "#data/*.aac" {
5
+ /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
6
+ const resourceUri: string;
5
7
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
6
8
  export const path: string;
9
+ export default resourceUri;
7
10
  }
8
11
 
9
- declare module "*.avif" {
12
+ declare module "#data/*.avif" {
13
+ /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
14
+ const resourceUri: string;
10
15
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
11
16
  export const path: string;
17
+ export default resourceUri;
12
18
  }
13
19
 
14
- declare module "*.eot" {
20
+ declare module "#data/*.data" {
21
+ /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
22
+ const resourceUri: string;
15
23
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
16
24
  export const path: string;
25
+ export default resourceUri;
17
26
  }
18
27
 
19
- declare module "*.flac" {
28
+ declare module "#data/*.eot" {
29
+ /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
30
+ const resourceUri: string;
20
31
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
21
32
  export const path: string;
33
+ export default resourceUri;
22
34
  }
23
35
 
24
- declare module "*.gif" {
36
+ declare module "#data/*.flac" {
37
+ /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
38
+ const resourceUri: string;
25
39
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
26
40
  export const path: string;
41
+ export default resourceUri;
27
42
  }
28
43
 
29
- declare module "*.ico" {
44
+ declare module "#data/*.gif" {
45
+ /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
46
+ const resourceUri: string;
30
47
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
31
48
  export const path: string;
49
+ export default resourceUri;
32
50
  }
33
51
 
34
- declare module "*.jpeg" {
52
+ declare module "#data/*.gpa" {
53
+ /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
54
+ const resourceUri: string;
35
55
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
36
56
  export const path: string;
57
+ export default resourceUri;
37
58
  }
38
59
 
39
- declare module "*.jpg" {
60
+ declare module "#data/*.ico" {
61
+ /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
62
+ const resourceUri: string;
40
63
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
41
64
  export const path: string;
65
+ export default resourceUri;
42
66
  }
43
67
 
44
- declare module "*.mp3" {
68
+ declare module "#data/*.jpeg" {
69
+ /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
70
+ const resourceUri: string;
45
71
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
46
72
  export const path: string;
73
+ export default resourceUri;
47
74
  }
48
75
 
49
- declare module "*.mp4" {
76
+ declare module "#data/*.jpg" {
77
+ /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
78
+ const resourceUri: string;
50
79
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
51
80
  export const path: string;
81
+ export default resourceUri;
52
82
  }
53
83
 
54
- declare module "*.ogg" {
84
+ declare module "#data/*.mp3" {
85
+ /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
86
+ const resourceUri: string;
55
87
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
56
88
  export const path: string;
89
+ export default resourceUri;
57
90
  }
58
91
 
59
- declare module "*.otf" {
92
+ declare module "#data/*.mp4" {
93
+ /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
94
+ const resourceUri: string;
60
95
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
61
96
  export const path: string;
97
+ export default resourceUri;
62
98
  }
63
99
 
64
- declare module "*.png" {
100
+ declare module "#data/*.ogg" {
101
+ /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
102
+ const resourceUri: string;
65
103
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
66
104
  export const path: string;
105
+ export default resourceUri;
67
106
  }
68
107
 
69
- declare module "*.svg" {
108
+ declare module "#data/*.otf" {
109
+ /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
110
+ const resourceUri: string;
70
111
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
71
112
  export const path: string;
113
+ export default resourceUri;
72
114
  }
73
115
 
74
- declare module "*.ttf" {
116
+ declare module "#data/*.png" {
117
+ /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
118
+ const resourceUri: string;
75
119
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
76
120
  export const path: string;
121
+ export default resourceUri;
77
122
  }
78
123
 
79
- declare module "*.wav" {
124
+ declare module "#data/*.svg" {
125
+ /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
126
+ const resourceUri: string;
80
127
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
81
128
  export const path: string;
129
+ export default resourceUri;
82
130
  }
83
131
 
84
- declare module "*.webm" {
132
+ declare module "#data/*.ttf" {
133
+ /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
134
+ const resourceUri: string;
85
135
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
86
136
  export const path: string;
137
+ export default resourceUri;
87
138
  }
88
139
 
89
- declare module "*.webp" {
140
+ declare module "#data/*.wav" {
141
+ /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
142
+ const resourceUri: string;
90
143
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
91
144
  export const path: string;
145
+ export default resourceUri;
92
146
  }
93
147
 
94
- declare module "*.woff" {
148
+ declare module "#data/*.webm" {
149
+ /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
150
+ const resourceUri: string;
95
151
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
96
152
  export const path: string;
153
+ export default resourceUri;
97
154
  }
98
155
 
99
- declare module "*.woff2" {
156
+ declare module "#data/*.webp" {
157
+ /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
158
+ const resourceUri: string;
100
159
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
101
160
  export const path: string;
161
+ export default resourceUri;
102
162
  }
103
163
 
104
- declare module "*.data" {
164
+ declare module "#data/*.woff" {
105
165
  /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
106
166
  const resourceUri: string;
107
167
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
@@ -109,7 +169,7 @@ declare module "*.data" {
109
169
  export default resourceUri;
110
170
  }
111
171
 
112
- declare module "*.gpa" {
172
+ declare module "#data/*.woff2" {
113
173
  /** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
114
174
  const resourceUri: string;
115
175
  /** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
@@ -117,8 +177,29 @@ declare module "*.gpa" {
117
177
  export default resourceUri;
118
178
  }
119
179
 
180
+ declare module "*.data" {
181
+ /**
182
+ * URL of the emitted asset: a dev server URL under `gtkx dev`, an absolute filesystem path once built.
183
+ * Import it under `#data/` instead for a GResource path and a `resource://` URI.
184
+ */
185
+ const assetUrl: string;
186
+ export default assetUrl;
187
+ }
188
+
189
+ declare module "*.gpa" {
190
+ /**
191
+ * URL of the emitted asset: a dev server URL under `gtkx dev`, an absolute filesystem path once built.
192
+ * Import it under `#data/` instead for a GResource path and a `resource://` URI.
193
+ */
194
+ const assetUrl: string;
195
+ export default assetUrl;
196
+ }
197
+
120
198
  declare module "*.css?url" {
121
- /** Filesystem path of the emitted stylesheet, imported without installing it on the default display. */
122
- const path: string;
123
- export default path;
199
+ /**
200
+ * URL of the emitted stylesheet, imported without installing it on the default display: a dev server URL
201
+ * under `gtkx dev`, an absolute filesystem path once built.
202
+ */
203
+ const styleSheetUrl: string;
204
+ export default styleSheetUrl;
124
205
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gtkx/cli",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Command-line tool and Vite plugin stack that scaffolds, develops, builds, and documents GTKX applications",
5
5
  "keywords": [
6
6
  "gtkx",
@@ -30,10 +30,6 @@
30
30
  "type": "module",
31
31
  "exports": {
32
32
  "./env": "./env.d.ts",
33
- "./internal": {
34
- "types": "./dist/internal.d.ts",
35
- "default": "./dist/internal.js"
36
- },
37
33
  "./package.json": "./package.json",
38
34
  "./refresh-runtime": {
39
35
  "types": "./dist/refresh-runtime.d.ts",
@@ -54,6 +50,16 @@
54
50
  "env.d.ts",
55
51
  "src"
56
52
  ],
53
+ "nx": {
54
+ "targets": {
55
+ "lint": {
56
+ "options": {
57
+ "cwd": ".",
58
+ "command": "eslint {projectRoot}"
59
+ }
60
+ }
61
+ }
62
+ },
57
63
  "engines": {
58
64
  "node": ">=24"
59
65
  },
@@ -66,19 +72,20 @@
66
72
  "fast-xml-parser": "^5.10.1",
67
73
  "react-refresh": "^0.18.0",
68
74
  "vite": "^8.2.1",
69
- "@gtkx/config": "1.0.0",
70
- "@gtkx/codegen": "1.0.0",
71
- "@gtkx/mcp": "1.0.0",
72
- "@gtkx/runtime": "1.0.0",
73
- "@gtkx/utils": "1.0.0",
74
- "@gtkx/vitest": "1.0.0",
75
- "create-gtkx": "1.0.0"
75
+ "yaml": "^2.9.0",
76
+ "@gtkx/codegen": "1.1.0",
77
+ "@gtkx/runtime": "1.1.0",
78
+ "@gtkx/mcp": "1.1.0",
79
+ "@gtkx/config": "1.1.0",
80
+ "@gtkx/utils": "1.1.0",
81
+ "create-gtkx": "1.1.0",
82
+ "@gtkx/vitest": "1.1.0"
76
83
  },
77
84
  "devDependencies": {
78
85
  "@types/babel__core": "^7.20.5",
79
86
  "@types/react-refresh": "^0.14.7",
80
87
  "vitest": "^4.1.10",
81
- "@gtkx/testing": "1.0.0"
88
+ "@gtkx/testing": "1.1.0"
82
89
  },
83
90
  "peerDependencies": {
84
91
  "react": "^19"
package/src/builder.ts CHANGED
@@ -1,7 +1,10 @@
1
+ import { join, posix } from "node:path";
1
2
  import { type InlineConfig, mergeConfig, build as viteBuild } from "vite";
2
3
  import { gtkxBuiltUrl } from "./vite-plugins/built-url.js";
4
+ import { BUNDLE_FILENAME, ESM_EXTENSION } from "./vite-plugins/esm-extension.js";
3
5
  import { gtkxVitePlugins } from "./vite-plugins/index.js";
4
6
  import { gtkxNative } from "./vite-plugins/native.js";
7
+ import { gtkxSelfContained } from "./vite-plugins/self-contained.js";
5
8
  import { gtkxWorker } from "./vite-plugins/worker.js";
6
9
 
7
10
  type BuildOptions = {
@@ -11,11 +14,15 @@ type BuildOptions = {
11
14
  };
12
15
 
13
16
  const BUILD_MODE = "production";
17
+ const CHUNK_STEM = "[name]-[hash]";
18
+ const DEFAULT_OUT_DIR = "dist";
19
+ const DEFAULT_ASSETS_DIR = "assets";
20
+ const ENTRY_FILE_NAMES = BUNDLE_FILENAME;
14
21
 
15
22
  const buildDefaults: InlineConfig = {
16
23
  build: {
17
24
  ssrEmitAssets: true,
18
- outDir: "dist",
25
+ outDir: DEFAULT_OUT_DIR,
19
26
  minify: true,
20
27
  cssMinify: false,
21
28
  },
@@ -24,18 +31,27 @@ const buildDefaults: InlineConfig = {
24
31
  },
25
32
  };
26
33
 
27
- const build = async (options: BuildOptions): Promise<void> => {
34
+ const build = async (options: BuildOptions): Promise<string> => {
28
35
  const { entry, assetBase, vite: viteConfig } = options;
29
36
  const root = viteConfig?.root ?? process.cwd();
37
+ const assetsDir = viteConfig?.build?.assetsDir ?? DEFAULT_ASSETS_DIR;
30
38
 
31
39
  const forced: InlineConfig = {
32
- plugins: [...gtkxVitePlugins(BUILD_MODE), gtkxWorker(), gtkxBuiltUrl(assetBase), gtkxNative(root)],
40
+ plugins: [
41
+ ...gtkxVitePlugins(BUILD_MODE),
42
+ gtkxWorker(),
43
+ gtkxBuiltUrl(assetBase),
44
+ gtkxNative(root),
45
+ gtkxSelfContained(),
46
+ ],
33
47
  build: {
34
48
  ssr: entry,
35
49
  assetsInlineLimit: 0,
36
50
  rolldownOptions: {
37
51
  output: {
38
- entryFileNames: "bundle.js",
52
+ entryFileNames: ENTRY_FILE_NAMES,
53
+ chunkFileNames: posix.join(assetsDir, CHUNK_STEM + ESM_EXTENSION),
54
+ keepNames: true,
39
55
  },
40
56
  },
41
57
  },
@@ -43,6 +59,8 @@ const build = async (options: BuildOptions): Promise<void> => {
43
59
 
44
60
  const merged: InlineConfig = mergeConfig(mergeConfig(buildDefaults, viteConfig ?? {}), forced);
45
61
  await viteBuild({ ...merged, ssr: { ...merged.ssr, noExternal: true } });
62
+
63
+ return join(merged.build?.outDir ?? DEFAULT_OUT_DIR, ENTRY_FILE_NAMES);
46
64
  };
47
65
 
48
66
  export { build };
package/src/cli.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { packageVersion } from "@gtkx/utils";
2
1
  import { defineCommand, runMain } from "citty";
2
+ import packageManifest from "../package.json" with { type: "json" };
3
3
  import { splitApplicationArgs } from "./internal/application-args.js";
4
4
  import { withErrorBoundary } from "./internal/errors.js";
5
5
 
6
- const version = packageVersion(import.meta.url, "../package.json");
6
+ const version = packageManifest.version;
7
7
  const { cliArgs } = splitApplicationArgs(process.argv.slice(2));
8
8
 
9
9
  const main = defineCommand({
@@ -23,6 +23,11 @@ const main = defineCommand({
23
23
 
24
24
  return withErrorBoundary(build);
25
25
  },
26
+ deploy: async () => {
27
+ const { deploy } = await import("./commands/deploy.js");
28
+
29
+ return withErrorBoundary(deploy);
30
+ },
26
31
  codegen: async () => {
27
32
  const { codegen } = await import("./commands/codegen.js");
28
33
 
@@ -30,7 +30,7 @@ const namespaceBarrelPath = (giStoreDir: string, library: string): string => {
30
30
  const hasManifest = (storeDir: string): boolean => existsSync(join(storeDir, "package.json"));
31
31
 
32
32
  const isGiStoreStale = (store: CodegenStore, libraries: string[]): boolean => {
33
- if (!existsSync(store.giLinkDir) || !hasManifest(store.giStoreDir)) {
33
+ if (!hasManifest(store.giStoreDir)) {
34
34
  return true;
35
35
  }
36
36
 
@@ -42,7 +42,7 @@ const isReactStoreStale = (store: CodegenStore): boolean => {
42
42
  return false;
43
43
  }
44
44
 
45
- if (!existsSync(store.jsxLinkDir) || !hasManifest(store.jsxStoreDir)) {
45
+ if (!hasManifest(store.jsxStoreDir)) {
46
46
  return true;
47
47
  }
48
48
 
@@ -1,4 +1,5 @@
1
1
  import { runCodegen as runCodegenCore } from "@gtkx/codegen";
2
+ import { getShadowingStorePaths, sweepProjectStaging } from "@gtkx/codegen/internal";
2
3
  import { type Config, loadConfig } from "@gtkx/config";
3
4
  import {
4
5
  resolveElementComponents,
@@ -12,7 +13,7 @@ import { resolve } from "node:path";
12
13
  import { resolveDataDir } from "../internal/data-dir.js";
13
14
  import { emitSchemaEnv } from "../settings/schema.js";
14
15
  import { type CodegenInputs, isCodegenStale, resolveCodegenInputs } from "./freshness.js";
15
- import { type CodegenStore, resolveCodegenContext } from "./store-resolver.js";
16
+ import { type CodegenContext, type CodegenStore, resolveCodegenContext } from "./store-resolver.js";
16
17
 
17
18
  type RunCodegenOptions = {
18
19
  cwd?: string;
@@ -45,6 +46,7 @@ type CodegenOptionsInput = {
45
46
  };
46
47
 
47
48
  type PreparedCodegen = CodegenInputs & { isForced: boolean };
49
+ type EnsureGeneratedOptions = { shouldAnnounce?: boolean; mode?: string };
48
50
 
49
51
  type RunOptionsInput = {
50
52
  root: string;
@@ -58,17 +60,17 @@ const GIR_PATH_MISSING_MESSAGE =
58
60
  "(Linux: `sudo dnf install gobject-introspection-devel` or `sudo apt install libgirepository1.0-dev`), " +
59
61
  "or set `girPath` in gtkx.config.ts.";
60
62
 
61
- const removeSharedStoreShadow = (cwd: string): void => {
62
- for (const path of [
63
- resolve(cwd, "node_modules/.gtkx/gi"),
64
- resolve(cwd, "node_modules/.gtkx/jsx"),
65
- resolve(cwd, "node_modules/@gtkx/gi"),
66
- resolve(cwd, "node_modules/@gtkx/jsx"),
67
- ]) {
63
+ const removeStores = (paths: string[]): void => {
64
+ for (const path of paths) {
68
65
  rmSync(path, { recursive: true, force: true });
69
66
  }
70
67
  };
71
68
 
69
+ const removeShadowingStores = (cwd: string): void => {
70
+ sweepProjectStaging(cwd);
71
+ removeStores(getShadowingStorePaths(cwd));
72
+ };
73
+
72
74
  const codegenOptions = ({ store, libraries, girPath, elements }: CodegenOptionsInput) => ({
73
75
  libraries,
74
76
  girPath,
@@ -102,10 +104,16 @@ const disabledCodegenResult = (configFile: string): RunCodegenResult => ({
102
104
  libraries: [],
103
105
  });
104
106
 
105
- const clearGeneratedStores = (store: CodegenStore): void => {
106
- for (const path of [store.giStoreDir, store.giLinkDir, store.jsxStoreDir, store.jsxLinkDir]) {
107
- rmSync(path, { recursive: true, force: true });
107
+ const regeneratedStorePaths = (store: CodegenStore): string[] => {
108
+ if (store.react === null) {
109
+ return [store.giStoreDir, store.giLinkDir];
108
110
  }
111
+
112
+ return [store.giStoreDir, store.giLinkDir, store.jsxStoreDir, store.jsxLinkDir];
113
+ };
114
+
115
+ const clearGeneratedStores = (store: CodegenStore): void => {
116
+ removeStores(regeneratedStorePaths(store));
109
117
  };
110
118
 
111
119
  const resolveLoadedConfig = async (options: RunCodegenOptions, cwd: string): Promise<LoadedConfig> =>
@@ -128,7 +136,7 @@ const runCodegen = async (options: RunCodegenOptions = {}): Promise<RunCodegenRe
128
136
  const { config, configFile } = await resolveLoadedConfig(options, cwd);
129
137
 
130
138
  if (config.codegen === false) {
131
- removeSharedStoreShadow(cwd);
139
+ removeShadowingStores(cwd);
132
140
 
133
141
  return disabledCodegenResult(configFile);
134
142
  }
@@ -200,20 +208,15 @@ const getRunOptions = ({ root, mode, inputs, resolved }: RunOptionsInput): RunCo
200
208
  return { cwd: root, mode, inputs, resolved };
201
209
  };
202
210
 
203
- /* eslint-disable-next-line unicorn/consistent-boolean-name -- the boolean reports whether codegen ran */
204
- const ensureGenerated = async (
205
- cwd: string,
206
- options: { shouldAnnounce?: boolean; mode?: string } = {},
207
- ): Promise<boolean> => {
208
- if (options.shouldAnnounce && process.env.GTKX_DISABLE_PREFLIGHT === "1") {
209
- return false;
210
- }
211
+ const isPreflightSkipped = (options: EnsureGeneratedOptions): boolean =>
212
+ options.shouldAnnounce === true && process.env.GTKX_DISABLE_PREFLIGHT === "1";
211
213
 
212
- const context = await resolveCodegenContext(cwd, options.mode);
213
- syncSchemaEnv(cwd);
214
+ /* eslint-disable-next-line unicorn/consistent-boolean-name -- the boolean reports whether codegen ran */
215
+ const generate = async (context: CodegenContext, options: EnsureGeneratedOptions): Promise<boolean> => {
216
+ syncSchemaEnv(context.root);
214
217
 
215
218
  if (context.config.codegen === false) {
216
- removeSharedStoreShadow(context.root);
219
+ removeShadowingStores(context.root);
217
220
 
218
221
  return false;
219
222
  }
@@ -226,6 +229,16 @@ const ensureGenerated = async (
226
229
  return result.isRegenerated;
227
230
  };
228
231
 
232
+ /* eslint-disable-next-line unicorn/consistent-boolean-name -- the boolean reports whether codegen ran */
233
+ const ensureGeneratedIn = async (
234
+ context: CodegenContext,
235
+ options: EnsureGeneratedOptions = {},
236
+ ): Promise<boolean> => (isPreflightSkipped(options) ? false : generate(context, options));
237
+
238
+ /* eslint-disable-next-line unicorn/consistent-boolean-name -- the boolean reports whether codegen ran */
239
+ const ensureGenerated = async (cwd: string, options: EnsureGeneratedOptions = {}): Promise<boolean> =>
240
+ isPreflightSkipped(options) ? false : generate(await resolveCodegenContext(cwd, options.mode), options);
241
+
229
242
  const resolveConfigWatch = async (
230
243
  cwd: string,
231
244
  mode?: string,
@@ -245,6 +258,7 @@ export {
245
258
  isCodegenDisabled,
246
259
  syncSchemaEnv,
247
260
  ensureGenerated,
261
+ ensureGeneratedIn,
248
262
  resolveConfigWatch,
249
263
  type RunCodegenResult,
250
264
  };
@@ -83,4 +83,4 @@ const resolveCodegenContext = async (cwd: string, mode?: string): Promise<Codege
83
83
  return { root: cwd, config, configFile };
84
84
  };
85
85
 
86
- export { resolveCodegenStore, resolveCodegenContext, type CodegenStore };
86
+ export { resolveCodegenStore, resolveCodegenContext, type CodegenContext, type CodegenStore };
@@ -1,8 +1,8 @@
1
1
  import { info } from "@gtkx/utils";
2
2
  import { defineCommand } from "citty";
3
3
  import { build as buildApp } from "../builder.js";
4
- import { ensureGenerated } from "../codegen/run-codegen.js";
5
- import { entryArg, resolveEntry } from "../internal/entry-arg.js";
4
+ import { entryArg } from "../internal/entry-arg.js";
5
+ import { prepareProject } from "../internal/prepare-project.js";
6
6
 
7
7
  const BUILD_MODE = "production";
8
8
 
@@ -19,11 +19,10 @@ const build = defineCommand({
19
19
  },
20
20
  },
21
21
  async run({ args }) {
22
- const { cwd, entry } = resolveEntry(args);
22
+ const { cwd, entry } = await prepareProject(args, BUILD_MODE);
23
23
  info(`Building ${entry}`);
24
- await ensureGenerated(cwd, { shouldAnnounce: true, mode: BUILD_MODE });
25
24
 
26
- await buildApp({
25
+ const bundlePath = await buildApp({
27
26
  entry,
28
27
  assetBase: args["asset-base"],
29
28
  vite: {
@@ -31,7 +30,7 @@ const build = defineCommand({
31
30
  },
32
31
  });
33
32
 
34
- info("Build complete: dist/bundle.js");
33
+ info(`Build complete: ${bundlePath}`);
35
34
  },
36
35
  });
37
36
 
@@ -4,6 +4,11 @@ import { formatCodegenResult } from "../codegen/report.js";
4
4
  import { ensureGenerated, isCodegenDisabled, runCodegen, syncSchemaEnv } from "../codegen/run-codegen.js";
5
5
  import { cwdArg, resolveCwd } from "../internal/entry-arg.js";
6
6
 
7
+ const FORCED_WHILE_DISABLED_MESSAGE =
8
+ "codegen is disabled for this project, so --force has no store to regenerate here. " +
9
+ "Remove `codegen: false` from gtkx.config.ts, or run `gtkx codegen --force` where the installed " +
10
+ "binding store is generated.";
11
+
7
12
  const codegen = defineCommand({
8
13
  meta: {
9
14
  name: "codegen",
@@ -19,8 +24,10 @@ const codegen = defineCommand({
19
24
  },
20
25
  async run({ args }) {
21
26
  const cwd = resolveCwd(args);
27
+ const isDisabled = await isCodegenDisabled(cwd);
28
+ checkForce(isDisabled, args.force);
22
29
 
23
- if (await isCodegenDisabled(cwd)) {
30
+ if (isDisabled) {
24
31
  await runCodegen({ cwd });
25
32
  syncSchemaEnv(cwd);
26
33
  info("codegen: disabled for this project; reusing an installed binding store");
@@ -46,4 +53,10 @@ const codegen = defineCommand({
46
53
  },
47
54
  });
48
55
 
56
+ const checkForce = (isDisabled: boolean, isForced: boolean): void => {
57
+ if (isDisabled && isForced) {
58
+ throw new Error(FORCED_WHILE_DISABLED_MESSAGE);
59
+ }
60
+ };
61
+
49
62
  export { codegen };
@@ -0,0 +1,47 @@
1
+ import { defineCommand } from "citty";
2
+ import { KNOWN_NAMES } from "../deploy/registry.js";
3
+ import { runDeploy } from "../deploy/run-deploy.js";
4
+ import { entryArg } from "../internal/entry-arg.js";
5
+ import { resolveProject } from "../internal/prepare-project.js";
6
+
7
+ const DEPLOY_MODE = "production";
8
+
9
+ const deploy = defineCommand({
10
+ meta: {
11
+ name: "deploy",
12
+ description: "Package the application for distribution",
13
+ },
14
+ args: {
15
+ ...entryArg,
16
+ target: {
17
+ type: "string",
18
+ description: `Comma-separated package formats to build (${KNOWN_NAMES})`,
19
+ },
20
+ out: {
21
+ type: "string",
22
+ description: "Output directory relative to the project root (default: build)",
23
+ },
24
+ "print-manifests": {
25
+ type: "boolean",
26
+ description: "Write the generated manifests and metadata, then stop without packaging",
27
+ },
28
+ "skip-build": {
29
+ type: "boolean",
30
+ description: "Package what is already in dist/ instead of rebuilding",
31
+ },
32
+ },
33
+ async run({ args }) {
34
+ const { cwd, entry } = await resolveProject(args, DEPLOY_MODE);
35
+
36
+ await runDeploy({
37
+ entry,
38
+ cwd,
39
+ targets: args.target,
40
+ outDir: args.out,
41
+ shouldPrintManifests: args["print-manifests"] === true,
42
+ shouldSkipBuild: args["skip-build"] === true,
43
+ });
44
+ },
45
+ });
46
+
47
+ export { deploy };