@gtkx/cli 1.6.0 → 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 (578) hide show
  1. package/README.md +47 -44
  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 +49 -16
  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 +2 -7
  21. package/dist/codegen/reference.js.map +1 -1
  22. package/dist/codegen/report.d.ts.map +1 -1
  23. package/dist/codegen/report.js +5 -16
  24. package/dist/codegen/report.js.map +1 -1
  25. package/dist/codegen/run-codegen.d.ts +9 -8
  26. package/dist/codegen/run-codegen.d.ts.map +1 -1
  27. package/dist/codegen/run-codegen.js +60 -113
  28. package/dist/codegen/run-codegen.js.map +1 -1
  29. package/dist/codegen/store-resolver.d.ts +3 -2
  30. package/dist/codegen/store-resolver.d.ts.map +1 -1
  31. package/dist/codegen/store-resolver.js +14 -20
  32. package/dist/codegen/store-resolver.js.map +1 -1
  33. package/dist/commands/build.d.ts +5 -0
  34. package/dist/commands/build.d.ts.map +1 -1
  35. package/dist/commands/build.js +83 -10
  36. package/dist/commands/build.js.map +1 -1
  37. package/dist/commands/cleanup.d.ts +9 -0
  38. package/dist/commands/cleanup.d.ts.map +1 -0
  39. package/dist/commands/cleanup.js +42 -0
  40. package/dist/commands/cleanup.js.map +1 -0
  41. package/dist/commands/codegen.d.ts +1 -0
  42. package/dist/commands/codegen.d.ts.map +1 -1
  43. package/dist/commands/codegen.js +6 -5
  44. package/dist/commands/codegen.js.map +1 -1
  45. package/dist/commands/deploy.d.ts +5 -0
  46. package/dist/commands/deploy.d.ts.map +1 -1
  47. package/dist/commands/deploy.js +10 -2
  48. package/dist/commands/deploy.js.map +1 -1
  49. package/dist/commands/dev.d.ts +9 -0
  50. package/dist/commands/dev.d.ts.map +1 -1
  51. package/dist/commands/dev.js +31 -4
  52. package/dist/commands/dev.js.map +1 -1
  53. package/dist/commands/docs.d.ts.map +1 -1
  54. package/dist/commands/docs.js +6 -15
  55. package/dist/commands/docs.js.map +1 -1
  56. package/dist/deploy/depends.d.ts.map +1 -1
  57. package/dist/deploy/depends.js +24 -2
  58. package/dist/deploy/depends.js.map +1 -1
  59. package/dist/deploy/download.d.ts +7 -3
  60. package/dist/deploy/download.d.ts.map +1 -1
  61. package/dist/deploy/download.js +19 -20
  62. package/dist/deploy/download.js.map +1 -1
  63. package/dist/deploy/freedesktop/copyright.d.ts.map +1 -1
  64. package/dist/deploy/freedesktop/copyright.js +2 -13
  65. package/dist/deploy/freedesktop/copyright.js.map +1 -1
  66. package/dist/deploy/freedesktop/metainfo.d.ts.map +1 -1
  67. package/dist/deploy/freedesktop/metainfo.js +41 -2
  68. package/dist/deploy/freedesktop/metainfo.js.map +1 -1
  69. package/dist/deploy/freedesktop/validate.d.ts.map +1 -1
  70. package/dist/deploy/freedesktop/validate.js +58 -14
  71. package/dist/deploy/freedesktop/validate.js.map +1 -1
  72. package/dist/deploy/freedesktop/xml.d.ts.map +1 -1
  73. package/dist/deploy/freedesktop/xml.js +21 -25
  74. package/dist/deploy/freedesktop/xml.js.map +1 -1
  75. package/dist/deploy/native-addon.d.ts +5 -0
  76. package/dist/deploy/native-addon.d.ts.map +1 -0
  77. package/dist/deploy/native-addon.js +134 -0
  78. package/dist/deploy/native-addon.js.map +1 -0
  79. package/dist/deploy/nfpm/config.d.ts +3 -2
  80. package/dist/deploy/nfpm/config.d.ts.map +1 -1
  81. package/dist/deploy/nfpm/config.js +7 -4
  82. package/dist/deploy/nfpm/config.js.map +1 -1
  83. package/dist/deploy/nfpm/contents.d.ts.map +1 -1
  84. package/dist/deploy/nfpm/contents.js +8 -0
  85. package/dist/deploy/nfpm/contents.js.map +1 -1
  86. package/dist/deploy/node-runtime/download.js +2 -2
  87. package/dist/deploy/node-runtime/download.js.map +1 -1
  88. package/dist/deploy/node-runtime/elf.d.ts +4 -1
  89. package/dist/deploy/node-runtime/elf.d.ts.map +1 -1
  90. package/dist/deploy/node-runtime/elf.js +34 -5
  91. package/dist/deploy/node-runtime/elf.js.map +1 -1
  92. package/dist/deploy/node-runtime/guard.d.ts.map +1 -1
  93. package/dist/deploy/node-runtime/guard.js +7 -14
  94. package/dist/deploy/node-runtime/guard.js.map +1 -1
  95. package/dist/deploy/node-runtime/index.d.ts +3 -1
  96. package/dist/deploy/node-runtime/index.d.ts.map +1 -1
  97. package/dist/deploy/node-runtime/index.js +103 -10
  98. package/dist/deploy/node-runtime/index.js.map +1 -1
  99. package/dist/deploy/node-runtime/license.d.ts.map +1 -1
  100. package/dist/deploy/node-runtime/license.js +2 -9
  101. package/dist/deploy/node-runtime/license.js.map +1 -1
  102. package/dist/deploy/node-runtime/sonames.d.ts +5 -0
  103. package/dist/deploy/node-runtime/sonames.d.ts.map +1 -0
  104. package/dist/deploy/node-runtime/sonames.js +13 -0
  105. package/dist/deploy/node-runtime/sonames.js.map +1 -0
  106. package/dist/deploy/notices/node-runtime.js +2 -2
  107. package/dist/deploy/notices/node-runtime.js.map +1 -1
  108. package/dist/deploy/notices/packages.d.ts.map +1 -1
  109. package/dist/deploy/notices/packages.js +3 -10
  110. package/dist/deploy/notices/packages.js.map +1 -1
  111. package/dist/deploy/payload/copy-tree.d.ts.map +1 -1
  112. package/dist/deploy/payload/copy-tree.js +3 -3
  113. package/dist/deploy/payload/copy-tree.js.map +1 -1
  114. package/dist/deploy/payload/launcher.d.ts.map +1 -1
  115. package/dist/deploy/payload/launcher.js +14 -1
  116. package/dist/deploy/payload/launcher.js.map +1 -1
  117. package/dist/deploy/payload/stage.d.ts +2 -1
  118. package/dist/deploy/payload/stage.d.ts.map +1 -1
  119. package/dist/deploy/payload/stage.js +47 -8
  120. package/dist/deploy/payload/stage.js.map +1 -1
  121. package/dist/deploy/run-deploy.d.ts +2 -0
  122. package/dist/deploy/run-deploy.d.ts.map +1 -1
  123. package/dist/deploy/run-deploy.js +197 -52
  124. package/dist/deploy/run-deploy.js.map +1 -1
  125. package/dist/deploy/settings/arch.d.ts +9 -3
  126. package/dist/deploy/settings/arch.d.ts.map +1 -1
  127. package/dist/deploy/settings/arch.js +27 -6
  128. package/dist/deploy/settings/arch.js.map +1 -1
  129. package/dist/deploy/settings/build-manifest.d.ts +6 -1
  130. package/dist/deploy/settings/build-manifest.d.ts.map +1 -1
  131. package/dist/deploy/settings/build-manifest.js +17 -17
  132. package/dist/deploy/settings/build-manifest.js.map +1 -1
  133. package/dist/deploy/settings/extra-files.d.ts +1 -1
  134. package/dist/deploy/settings/extra-files.d.ts.map +1 -1
  135. package/dist/deploy/settings/extra-files.js +25 -3
  136. package/dist/deploy/settings/extra-files.js.map +1 -1
  137. package/dist/deploy/settings/index.d.ts +3 -1
  138. package/dist/deploy/settings/index.d.ts.map +1 -1
  139. package/dist/deploy/settings/index.js +4 -2
  140. package/dist/deploy/settings/index.js.map +1 -1
  141. package/dist/deploy/settings/libraries.d.ts.map +1 -1
  142. package/dist/deploy/settings/libraries.js +3 -19
  143. package/dist/deploy/settings/libraries.js.map +1 -1
  144. package/dist/deploy/settings/paths.d.ts +4 -3
  145. package/dist/deploy/settings/paths.d.ts.map +1 -1
  146. package/dist/deploy/settings/paths.js +118 -19
  147. package/dist/deploy/settings/paths.js.map +1 -1
  148. package/dist/deploy/settings/screenshots.d.ts.map +1 -1
  149. package/dist/deploy/settings/screenshots.js +6 -31
  150. package/dist/deploy/settings/screenshots.js.map +1 -1
  151. package/dist/deploy/targets/appimage.d.ts.map +1 -1
  152. package/dist/deploy/targets/appimage.js +1 -0
  153. package/dist/deploy/targets/appimage.js.map +1 -1
  154. package/dist/deploy/targets/flatpak-pnpm.js +4 -4
  155. package/dist/deploy/targets/flatpak-pnpm.js.map +1 -1
  156. package/dist/deploy/targets/flatpak-source.d.ts.map +1 -1
  157. package/dist/deploy/targets/flatpak-source.js +17 -6
  158. package/dist/deploy/targets/flatpak-source.js.map +1 -1
  159. package/dist/deploy/targets/flatpak-sources.js +1 -1
  160. package/dist/deploy/targets/flatpak-sources.js.map +1 -1
  161. package/dist/deploy/targets/flatpak.d.ts.map +1 -1
  162. package/dist/deploy/targets/flatpak.js +1 -0
  163. package/dist/deploy/targets/flatpak.js.map +1 -1
  164. package/dist/deploy/targets/nfpm-target.d.ts.map +1 -1
  165. package/dist/deploy/targets/nfpm-target.js +13 -7
  166. package/dist/deploy/targets/nfpm-target.js.map +1 -1
  167. package/dist/deploy/types.d.ts +5 -2
  168. package/dist/deploy/types.d.ts.map +1 -1
  169. package/dist/deploy/types.js.map +1 -1
  170. package/dist/deploy/vendored/appimagetool.js +2 -2
  171. package/dist/deploy/vendored/appimagetool.js.map +1 -1
  172. package/dist/deploy/vendored/nfpm.js +1 -1
  173. package/dist/deploy/vendored/nfpm.js.map +1 -1
  174. package/dist/dev/catalog-writes.d.ts +8 -0
  175. package/dist/dev/catalog-writes.d.ts.map +1 -0
  176. package/dist/dev/catalog-writes.js +26 -0
  177. package/dist/dev/catalog-writes.js.map +1 -0
  178. package/dist/dev/entry-env.d.ts +2 -1
  179. package/dist/dev/entry-env.d.ts.map +1 -1
  180. package/dist/dev/entry-env.js +2 -1
  181. package/dist/dev/entry-env.js.map +1 -1
  182. package/dist/dev/font-dir.d.ts +3 -0
  183. package/dist/dev/font-dir.d.ts.map +1 -0
  184. package/dist/dev/font-dir.js +9 -0
  185. package/dist/dev/font-dir.js.map +1 -0
  186. package/dist/dev/headless.d.ts +3 -0
  187. package/dist/dev/headless.d.ts.map +1 -0
  188. package/dist/dev/headless.js +35 -0
  189. package/dist/dev/headless.js.map +1 -0
  190. package/dist/dev/runner-deps.d.ts +1 -1
  191. package/dist/dev/runner-deps.d.ts.map +1 -1
  192. package/dist/dev/runner-deps.js +12 -7
  193. package/dist/dev/runner-deps.js.map +1 -1
  194. package/dist/dev/runner-main.d.ts.map +1 -1
  195. package/dist/dev/runner-main.js +11 -5
  196. package/dist/dev/runner-main.js.map +1 -1
  197. package/dist/dev/runner.d.ts +2 -0
  198. package/dist/dev/runner.d.ts.map +1 -1
  199. package/dist/dev/runner.js +26 -7
  200. package/dist/dev/runner.js.map +1 -1
  201. package/dist/dev/schema-dir.d.ts +1 -1
  202. package/dist/dev/schema-dir.d.ts.map +1 -1
  203. package/dist/dev/schema-dir.js +2 -4
  204. package/dist/dev/schema-dir.js.map +1 -1
  205. package/dist/dev/supervisor.d.ts +3 -1
  206. package/dist/dev/supervisor.d.ts.map +1 -1
  207. package/dist/dev/supervisor.js +132 -29
  208. package/dist/dev/supervisor.js.map +1 -1
  209. package/dist/dev/vite-dev-server.d.ts +1 -1
  210. package/dist/dev/vite-dev-server.d.ts.map +1 -1
  211. package/dist/dev/vite-dev-server.js +14 -2
  212. package/dist/dev/vite-dev-server.js.map +1 -1
  213. package/dist/dev/watch-ignore.d.ts +3 -0
  214. package/dist/dev/watch-ignore.d.ts.map +1 -0
  215. package/dist/dev/watch-ignore.js +11 -0
  216. package/dist/dev/watch-ignore.js.map +1 -0
  217. package/dist/i18n/catalogs.d.ts +6 -2
  218. package/dist/i18n/catalogs.d.ts.map +1 -1
  219. package/dist/i18n/catalogs.js +12 -8
  220. package/dist/i18n/catalogs.js.map +1 -1
  221. package/dist/i18n/metadata-templates.d.ts.map +1 -1
  222. package/dist/i18n/metadata-templates.js +2 -1
  223. package/dist/i18n/metadata-templates.js.map +1 -1
  224. package/dist/i18n/source-messages.d.ts +5 -21
  225. package/dist/i18n/source-messages.d.ts.map +1 -1
  226. package/dist/i18n/source-messages.js +1037 -92
  227. package/dist/i18n/source-messages.js.map +1 -1
  228. package/dist/i18n/types.d.ts +6 -7
  229. package/dist/i18n/types.d.ts.map +1 -1
  230. package/dist/i18n/types.js +83 -96
  231. package/dist/i18n/types.js.map +1 -1
  232. package/dist/internal/agent-rules.d.ts.map +1 -1
  233. package/dist/internal/agent-rules.js +7 -2
  234. package/dist/internal/agent-rules.js.map +1 -1
  235. package/dist/internal/banner.d.ts +4 -2
  236. package/dist/internal/banner.d.ts.map +1 -1
  237. package/dist/internal/banner.js +19 -5
  238. package/dist/internal/banner.js.map +1 -1
  239. package/dist/internal/build-manifest.d.ts +5 -2
  240. package/dist/internal/build-manifest.d.ts.map +1 -1
  241. package/dist/internal/build-manifest.js +15 -2
  242. package/dist/internal/build-manifest.js.map +1 -1
  243. package/dist/internal/build-output.d.ts +8 -0
  244. package/dist/internal/build-output.d.ts.map +1 -0
  245. package/dist/internal/build-output.js +116 -0
  246. package/dist/internal/build-output.js.map +1 -0
  247. package/dist/internal/cache-root.d.ts +3 -0
  248. package/dist/internal/cache-root.d.ts.map +1 -0
  249. package/dist/internal/cache-root.js +9 -0
  250. package/dist/internal/cache-root.js.map +1 -0
  251. package/dist/internal/compile-cache-store.d.ts +4 -0
  252. package/dist/internal/compile-cache-store.d.ts.map +1 -0
  253. package/dist/internal/compile-cache-store.js +41 -0
  254. package/dist/internal/compile-cache-store.js.map +1 -0
  255. package/dist/internal/compile-cache.d.ts +4 -0
  256. package/dist/internal/compile-cache.d.ts.map +1 -0
  257. package/dist/internal/compile-cache.js +16 -0
  258. package/dist/internal/compile-cache.js.map +1 -0
  259. package/dist/internal/deploy-out-dir.d.ts +4 -0
  260. package/dist/internal/deploy-out-dir.d.ts.map +1 -0
  261. package/dist/internal/deploy-out-dir.js +5 -0
  262. package/dist/internal/deploy-out-dir.js.map +1 -0
  263. package/dist/internal/docs-elements.d.ts +1 -0
  264. package/dist/internal/docs-elements.d.ts.map +1 -1
  265. package/dist/internal/docs-elements.js +6 -5
  266. package/dist/internal/docs-elements.js.map +1 -1
  267. package/dist/internal/entry-arg.d.ts +4 -1
  268. package/dist/internal/entry-arg.d.ts.map +1 -1
  269. package/dist/internal/entry-arg.js +7 -1
  270. package/dist/internal/entry-arg.js.map +1 -1
  271. package/dist/internal/errors.d.ts +2 -1
  272. package/dist/internal/errors.d.ts.map +1 -1
  273. package/dist/internal/errors.js +1 -1
  274. package/dist/internal/errors.js.map +1 -1
  275. package/dist/internal/font-path.d.ts +4 -0
  276. package/dist/internal/font-path.d.ts.map +1 -0
  277. package/dist/internal/font-path.js +12 -0
  278. package/dist/internal/font-path.js.map +1 -0
  279. package/dist/internal/font-staging.d.ts +6 -0
  280. package/dist/internal/font-staging.d.ts.map +1 -0
  281. package/dist/internal/font-staging.js +94 -0
  282. package/dist/internal/font-staging.js.map +1 -0
  283. package/dist/internal/icon-path.d.ts.map +1 -1
  284. package/dist/internal/icon-path.js +5 -16
  285. package/dist/internal/icon-path.js.map +1 -1
  286. package/dist/internal/icon-staging.d.ts +3 -0
  287. package/dist/internal/icon-staging.d.ts.map +1 -0
  288. package/dist/internal/icon-staging.js +40 -0
  289. package/dist/internal/icon-staging.js.map +1 -0
  290. package/dist/internal/import-scan.d.ts +4 -0
  291. package/dist/internal/import-scan.d.ts.map +1 -0
  292. package/dist/internal/import-scan.js +138 -0
  293. package/dist/internal/import-scan.js.map +1 -0
  294. package/dist/internal/module-hash.d.ts +3 -0
  295. package/dist/internal/module-hash.d.ts.map +1 -0
  296. package/dist/internal/module-hash.js +19 -0
  297. package/dist/internal/module-hash.js.map +1 -0
  298. package/dist/internal/output-directory.d.ts +15 -0
  299. package/dist/internal/output-directory.d.ts.map +1 -0
  300. package/dist/internal/output-directory.js +490 -0
  301. package/dist/internal/output-directory.js.map +1 -0
  302. package/dist/internal/parent-process.d.ts +12 -0
  303. package/dist/internal/parent-process.d.ts.map +1 -0
  304. package/dist/internal/parent-process.js +74 -0
  305. package/dist/internal/parent-process.js.map +1 -0
  306. package/dist/internal/prepare-project.d.ts +3 -0
  307. package/dist/internal/prepare-project.d.ts.map +1 -1
  308. package/dist/internal/prepare-project.js +9 -3
  309. package/dist/internal/prepare-project.js.map +1 -1
  310. package/dist/internal/react-compiler-cache.d.ts +13 -0
  311. package/dist/internal/react-compiler-cache.d.ts.map +1 -0
  312. package/dist/internal/react-compiler-cache.js +182 -0
  313. package/dist/internal/react-compiler-cache.js.map +1 -0
  314. package/dist/internal/source-imports.d.ts +7 -2
  315. package/dist/internal/source-imports.d.ts.map +1 -1
  316. package/dist/internal/source-imports.js +38 -49
  317. package/dist/internal/source-imports.js.map +1 -1
  318. package/dist/internal/staging-file.d.ts +5 -0
  319. package/dist/internal/staging-file.d.ts.map +1 -0
  320. package/dist/internal/staging-file.js +35 -0
  321. package/dist/internal/staging-file.js.map +1 -0
  322. package/dist/internal/xdg-banner.d.ts +4 -0
  323. package/dist/internal/xdg-banner.d.ts.map +1 -0
  324. package/dist/internal/xdg-banner.js +11 -0
  325. package/dist/internal/xdg-banner.js.map +1 -0
  326. package/dist/internal/xdg-data-dirs.d.ts +2 -1
  327. package/dist/internal/xdg-data-dirs.d.ts.map +1 -1
  328. package/dist/internal/xdg-data-dirs.js +1 -1
  329. package/dist/internal/xdg-data-dirs.js.map +1 -1
  330. package/dist/mcp/client.js +2 -2
  331. package/dist/mcp/client.js.map +1 -1
  332. package/dist/settings/render.d.ts +0 -1
  333. package/dist/settings/render.d.ts.map +1 -1
  334. package/dist/settings/render.js +1 -11
  335. package/dist/settings/render.js.map +1 -1
  336. package/dist/settings/schema.d.ts +2 -2
  337. package/dist/settings/schema.d.ts.map +1 -1
  338. package/dist/settings/schema.js +24 -70
  339. package/dist/settings/schema.js.map +1 -1
  340. package/dist/vite-plugins/asset-extensions.d.ts.map +1 -1
  341. package/dist/vite-plugins/asset-extensions.js +2 -0
  342. package/dist/vite-plugins/asset-extensions.js.map +1 -1
  343. package/dist/vite-plugins/asset-imports.d.ts +1 -2
  344. package/dist/vite-plugins/asset-imports.d.ts.map +1 -1
  345. package/dist/vite-plugins/asset-imports.js +36 -35
  346. package/dist/vite-plugins/asset-imports.js.map +1 -1
  347. package/dist/vite-plugins/asset-specifier.d.ts +5 -3
  348. package/dist/vite-plugins/asset-specifier.d.ts.map +1 -1
  349. package/dist/vite-plugins/asset-specifier.js +10 -4
  350. package/dist/vite-plugins/asset-specifier.js.map +1 -1
  351. package/dist/vite-plugins/build-manifest.d.ts +5 -1
  352. package/dist/vite-plugins/build-manifest.d.ts.map +1 -1
  353. package/dist/vite-plugins/build-manifest.js +2 -1
  354. package/dist/vite-plugins/build-manifest.js.map +1 -1
  355. package/dist/vite-plugins/built-url.d.ts.map +1 -1
  356. package/dist/vite-plugins/built-url.js +5 -2
  357. package/dist/vite-plugins/built-url.js.map +1 -1
  358. package/dist/vite-plugins/css.d.ts.map +1 -1
  359. package/dist/vite-plugins/css.js +13 -5
  360. package/dist/vite-plugins/css.js.map +1 -1
  361. package/dist/vite-plugins/ensure-store.d.ts +1 -1
  362. package/dist/vite-plugins/ensure-store.d.ts.map +1 -1
  363. package/dist/vite-plugins/ensure-store.js +2 -2
  364. package/dist/vite-plugins/ensure-store.js.map +1 -1
  365. package/dist/vite-plugins/fast-refresh/refresh-filter.d.ts +6 -1
  366. package/dist/vite-plugins/fast-refresh/refresh-filter.d.ts.map +1 -1
  367. package/dist/vite-plugins/fast-refresh/refresh-filter.js +3 -1
  368. package/dist/vite-plugins/fast-refresh/refresh-filter.js.map +1 -1
  369. package/dist/vite-plugins/fast-refresh/swc-refresh.d.ts.map +1 -1
  370. package/dist/vite-plugins/fast-refresh/swc-refresh.js +23 -14
  371. package/dist/vite-plugins/fast-refresh/swc-refresh.js.map +1 -1
  372. package/dist/vite-plugins/font-name.d.ts +3 -0
  373. package/dist/vite-plugins/font-name.d.ts.map +1 -0
  374. package/dist/vite-plugins/font-name.js +406 -0
  375. package/dist/vite-plugins/font-name.js.map +1 -0
  376. package/dist/vite-plugins/font-worker-env.d.ts +4 -0
  377. package/dist/vite-plugins/font-worker-env.d.ts.map +1 -0
  378. package/dist/vite-plugins/font-worker-env.js +19 -0
  379. package/dist/vite-plugins/font-worker-env.js.map +1 -0
  380. package/dist/vite-plugins/font.d.ts +4 -0
  381. package/dist/vite-plugins/font.d.ts.map +1 -0
  382. package/dist/vite-plugins/font.js +111 -0
  383. package/dist/vite-plugins/font.js.map +1 -0
  384. package/dist/vite-plugins/i18n.d.ts +11 -2
  385. package/dist/vite-plugins/i18n.d.ts.map +1 -1
  386. package/dist/vite-plugins/i18n.js +75 -8
  387. package/dist/vite-plugins/i18n.js.map +1 -1
  388. package/dist/vite-plugins/icon-worker-env.d.ts +4 -0
  389. package/dist/vite-plugins/icon-worker-env.d.ts.map +1 -0
  390. package/dist/vite-plugins/icon-worker-env.js +23 -0
  391. package/dist/vite-plugins/icon-worker-env.js.map +1 -0
  392. package/dist/vite-plugins/icons.d.ts.map +1 -1
  393. package/dist/vite-plugins/icons.js +4 -9
  394. package/dist/vite-plugins/icons.js.map +1 -1
  395. package/dist/vite-plugins/index.d.ts +10 -1
  396. package/dist/vite-plugins/index.d.ts.map +1 -1
  397. package/dist/vite-plugins/index.js +19 -7
  398. package/dist/vite-plugins/index.js.map +1 -1
  399. package/dist/vite-plugins/native.d.ts.map +1 -1
  400. package/dist/vite-plugins/native.js +0 -4
  401. package/dist/vite-plugins/native.js.map +1 -1
  402. package/dist/vite-plugins/react-compiler.d.ts.map +1 -1
  403. package/dist/vite-plugins/react-compiler.js +57 -18
  404. package/dist/vite-plugins/react-compiler.js.map +1 -1
  405. package/dist/vite-plugins/resource-shared.d.ts +3 -1
  406. package/dist/vite-plugins/resource-shared.d.ts.map +1 -1
  407. package/dist/vite-plugins/resource-shared.js +3 -1
  408. package/dist/vite-plugins/resource-shared.js.map +1 -1
  409. package/dist/vite-plugins/resources.d.ts.map +1 -1
  410. package/dist/vite-plugins/resources.js +40 -102
  411. package/dist/vite-plugins/resources.js.map +1 -1
  412. package/dist/vite-plugins/self-contained.d.ts.map +1 -1
  413. package/dist/vite-plugins/self-contained.js +159 -158
  414. package/dist/vite-plugins/self-contained.js.map +1 -1
  415. package/dist/vite-plugins/settings-worker-env.d.ts +1 -1
  416. package/dist/vite-plugins/settings-worker-env.d.ts.map +1 -1
  417. package/dist/vite-plugins/settings-worker-env.js +5 -7
  418. package/dist/vite-plugins/settings-worker-env.js.map +1 -1
  419. package/dist/vite-plugins/settings.d.ts +1 -2
  420. package/dist/vite-plugins/settings.d.ts.map +1 -1
  421. package/dist/vite-plugins/settings.js +32 -27
  422. package/dist/vite-plugins/settings.js.map +1 -1
  423. package/dist/vite-plugins/store-links.d.ts.map +1 -1
  424. package/dist/vite-plugins/store-links.js +9 -5
  425. package/dist/vite-plugins/store-links.js.map +1 -1
  426. package/dist/vite-plugins/undeclared-library.d.ts.map +1 -1
  427. package/dist/vite-plugins/undeclared-library.js +25 -25
  428. package/dist/vite-plugins/undeclared-library.js.map +1 -1
  429. package/dist/vite-plugins/worker.d.ts.map +1 -1
  430. package/dist/vite-plugins/worker.js +21 -14
  431. package/dist/vite-plugins/worker.js.map +1 -1
  432. package/dist/vitest-plugin.d.ts +4 -3
  433. package/dist/vitest-plugin.d.ts.map +1 -1
  434. package/dist/vitest-plugin.js +12 -8
  435. package/dist/vitest-plugin.js.map +1 -1
  436. package/env.d.ts +9 -0
  437. package/package.json +28 -17
  438. package/src/builder.ts +45 -12
  439. package/src/cli.ts +15 -2
  440. package/src/codegen/config-dependencies.ts +470 -0
  441. package/src/codegen/freshness.ts +70 -17
  442. package/src/codegen/reference.ts +2 -8
  443. package/src/codegen/report.ts +5 -21
  444. package/src/codegen/run-codegen.ts +73 -160
  445. package/src/codegen/store-resolver.ts +16 -27
  446. package/src/commands/build.ts +13 -2
  447. package/src/commands/cleanup.ts +48 -0
  448. package/src/commands/codegen.ts +6 -5
  449. package/src/commands/deploy.ts +10 -2
  450. package/src/commands/dev.ts +45 -4
  451. package/src/commands/docs.ts +6 -17
  452. package/src/deploy/depends.ts +30 -3
  453. package/src/deploy/download.ts +33 -24
  454. package/src/deploy/freedesktop/copyright.ts +2 -14
  455. package/src/deploy/freedesktop/metainfo.ts +73 -21
  456. package/src/deploy/freedesktop/validate.ts +80 -15
  457. package/src/deploy/freedesktop/xml.ts +24 -32
  458. package/src/deploy/native-addon.ts +183 -0
  459. package/src/deploy/nfpm/config.ts +13 -4
  460. package/src/deploy/nfpm/contents.ts +8 -0
  461. package/src/deploy/node-runtime/download.ts +2 -2
  462. package/src/deploy/node-runtime/elf.ts +46 -5
  463. package/src/deploy/node-runtime/guard.ts +10 -14
  464. package/src/deploy/node-runtime/index.ts +148 -12
  465. package/src/deploy/node-runtime/license.ts +2 -8
  466. package/src/deploy/node-runtime/sonames.ts +17 -0
  467. package/src/deploy/notices/node-runtime.ts +2 -2
  468. package/src/deploy/notices/packages.ts +3 -11
  469. package/src/deploy/payload/copy-tree.ts +3 -4
  470. package/src/deploy/payload/launcher.ts +20 -1
  471. package/src/deploy/payload/stage.ts +78 -11
  472. package/src/deploy/run-deploy.ts +227 -72
  473. package/src/deploy/settings/arch.ts +40 -8
  474. package/src/deploy/settings/build-manifest.ts +30 -17
  475. package/src/deploy/settings/extra-files.ts +30 -4
  476. package/src/deploy/settings/index.ts +7 -2
  477. package/src/deploy/settings/libraries.ts +2 -22
  478. package/src/deploy/settings/paths.ts +78 -21
  479. package/src/deploy/settings/screenshots.ts +8 -46
  480. package/src/deploy/targets/appimage.ts +1 -0
  481. package/src/deploy/targets/flatpak-pnpm.ts +4 -4
  482. package/src/deploy/targets/flatpak-source.ts +19 -6
  483. package/src/deploy/targets/flatpak-sources.ts +1 -1
  484. package/src/deploy/targets/flatpak.ts +1 -0
  485. package/src/deploy/targets/nfpm-target.ts +14 -6
  486. package/src/deploy/types.ts +5 -1
  487. package/src/deploy/vendored/appimagetool.ts +2 -2
  488. package/src/deploy/vendored/nfpm.ts +1 -1
  489. package/src/dev/catalog-writes.ts +35 -0
  490. package/src/dev/entry-env.ts +2 -1
  491. package/src/dev/font-dir.ts +11 -0
  492. package/src/dev/headless.ts +40 -0
  493. package/src/dev/runner-deps.ts +20 -7
  494. package/src/dev/runner-main.ts +13 -5
  495. package/src/dev/runner.ts +37 -7
  496. package/src/dev/schema-dir.ts +2 -4
  497. package/src/dev/supervisor.ts +183 -32
  498. package/src/dev/vite-dev-server.ts +20 -2
  499. package/src/dev/watch-ignore.ts +16 -0
  500. package/src/i18n/catalogs.ts +23 -9
  501. package/src/i18n/metadata-templates.ts +2 -1
  502. package/src/i18n/source-messages.ts +1641 -262
  503. package/src/i18n/types.ts +97 -131
  504. package/src/internal/agent-rules.ts +7 -2
  505. package/src/internal/banner.ts +27 -6
  506. package/src/internal/build-manifest.ts +25 -1
  507. package/src/internal/build-output.ts +171 -0
  508. package/src/internal/cache-root.ts +12 -0
  509. package/src/internal/compile-cache-store.ts +50 -0
  510. package/src/internal/compile-cache.ts +20 -0
  511. package/src/internal/deploy-out-dir.ts +8 -0
  512. package/src/internal/docs-elements.ts +11 -5
  513. package/src/internal/entry-arg.ts +8 -1
  514. package/src/internal/errors.ts +1 -1
  515. package/src/internal/font-path.ts +15 -0
  516. package/src/internal/font-staging.ts +131 -0
  517. package/src/internal/icon-path.ts +6 -19
  518. package/src/internal/icon-staging.ts +58 -0
  519. package/src/internal/import-scan.ts +206 -0
  520. package/src/internal/module-hash.ts +22 -0
  521. package/src/internal/output-directory.ts +699 -0
  522. package/src/internal/parent-process.ts +110 -0
  523. package/src/internal/prepare-project.ts +11 -5
  524. package/src/internal/react-compiler-cache.ts +246 -0
  525. package/src/internal/source-imports.ts +64 -55
  526. package/src/internal/staging-file.ts +42 -0
  527. package/src/internal/xdg-banner.ts +13 -0
  528. package/src/internal/xdg-data-dirs.ts +1 -1
  529. package/src/mcp/client.ts +2 -2
  530. package/src/settings/render.ts +1 -13
  531. package/src/settings/schema.ts +23 -91
  532. package/src/vite-plugins/asset-extensions.ts +2 -0
  533. package/src/vite-plugins/asset-imports.ts +39 -45
  534. package/src/vite-plugins/asset-specifier.ts +17 -5
  535. package/src/vite-plugins/build-manifest.ts +7 -1
  536. package/src/vite-plugins/built-url.ts +6 -2
  537. package/src/vite-plugins/css.ts +16 -5
  538. package/src/vite-plugins/ensure-store.ts +2 -2
  539. package/src/vite-plugins/fast-refresh/refresh-filter.ts +10 -1
  540. package/src/vite-plugins/fast-refresh/swc-refresh.ts +33 -14
  541. package/src/vite-plugins/font-name.ts +582 -0
  542. package/src/vite-plugins/font-worker-env.ts +25 -0
  543. package/src/vite-plugins/font.ts +180 -0
  544. package/src/vite-plugins/i18n.ts +123 -11
  545. package/src/vite-plugins/icon-worker-env.ts +36 -0
  546. package/src/vite-plugins/icons.ts +4 -10
  547. package/src/vite-plugins/index.ts +36 -13
  548. package/src/vite-plugins/native.ts +0 -5
  549. package/src/vite-plugins/react-compiler.ts +83 -19
  550. package/src/vite-plugins/resource-shared.ts +4 -0
  551. package/src/vite-plugins/resources.ts +47 -144
  552. package/src/vite-plugins/self-contained.ts +184 -185
  553. package/src/vite-plugins/settings-worker-env.ts +5 -7
  554. package/src/vite-plugins/settings.ts +44 -33
  555. package/src/vite-plugins/store-links.ts +10 -5
  556. package/src/vite-plugins/undeclared-library.ts +30 -32
  557. package/src/vite-plugins/worker.ts +31 -16
  558. package/src/vitest-plugin.ts +12 -8
  559. package/dist/i18n/binding-extractor.d.ts +0 -30
  560. package/dist/i18n/binding-extractor.d.ts.map +0 -1
  561. package/dist/i18n/binding-extractor.js +0 -1324
  562. package/dist/i18n/binding-extractor.js.map +0 -1
  563. package/dist/i18n/extractor-plugin.d.ts +0 -8
  564. package/dist/i18n/extractor-plugin.d.ts.map +0 -1
  565. package/dist/i18n/extractor-plugin.js +0 -247
  566. package/dist/i18n/extractor-plugin.js.map +0 -1
  567. package/dist/internal/data-dir.d.ts +0 -4
  568. package/dist/internal/data-dir.d.ts.map +0 -1
  569. package/dist/internal/data-dir.js +0 -52
  570. package/dist/internal/data-dir.js.map +0 -1
  571. package/dist/vite-plugins/animated.d.ts +0 -5
  572. package/dist/vite-plugins/animated.d.ts.map +0 -1
  573. package/dist/vite-plugins/animated.js +0 -325
  574. package/dist/vite-plugins/animated.js.map +0 -1
  575. package/src/i18n/binding-extractor.ts +0 -1969
  576. package/src/i18n/extractor-plugin.ts +0 -413
  577. package/src/internal/data-dir.ts +0 -70
  578. package/src/vite-plugins/animated.ts +0 -486
@@ -1,53 +1,106 @@
1
1
  import type { Config } from "@gtkx/config";
2
2
  import { resolveGirPath, resolveLibraries } from "@gtkx/codegen";
3
- import { resolveFuture } from "@gtkx/config/internal";
4
- import { existsSync } from "node:fs";
5
- import { join } from "node:path";
3
+ import { resolveBoundLibraries } from "@gtkx/codegen/internal";
4
+ import { existsSync, readFileSync } from "node:fs";
5
+ import { basename, dirname, join } from "node:path";
6
6
  import { type CodegenStore, resolveCodegenStore } from "./store-resolver.js";
7
7
 
8
+ type ExportTarget = string | { [condition: string]: ExportTarget };
9
+ type StoreExports = Record<string, ExportTarget>;
10
+
8
11
  type CodegenInputs = {
9
12
  girPath: string[];
10
13
  libraries: string[];
11
14
  store: CodegenStore;
12
15
  };
13
16
 
14
- const REACT_GENERATED_MODULES: string[] = ["index.js", "metadata.js", join("gtk", "gtk.js")];
17
+ const PACKAGE_EXPORT = "./package.json";
18
+ const JSX_REQUIRED_EXPORTS = [PACKAGE_EXPORT, "./metadata", "./gtk", "./adw"];
15
19
 
16
20
  const resolveCodegenInputs = (cwd: string, config: Config): CodegenInputs => {
17
21
  const girPath = resolveGirPath(config.girPath);
18
- const libraries = resolveLibraries(config.libraries, girPath, resolveFuture(config.future).isAdwaitaDefault);
22
+ const libraries = resolveLibraries(config.libraries);
19
23
  const store = resolveCodegenStore(cwd);
20
24
 
21
25
  return { girPath, libraries, store };
22
26
  };
23
27
 
24
- const namespaceBarrelPath = (giStoreDir: string, library: string): string => {
28
+ const namespaceExport = (library: string): string => {
25
29
  const separator = library.indexOf("-");
26
30
  const namespace = (separator === -1 ? library : library.slice(0, separator)).toLowerCase();
27
31
 
28
- return join(giStoreDir, namespace, "index.js");
32
+ return `./${namespace}`;
29
33
  };
30
34
 
31
- const hasManifest = (storeDir: string): boolean => existsSync(join(storeDir, "package.json"));
35
+ const targetFiles = (target: ExportTarget): string[] =>
36
+ typeof target === "string" ? [target] : Object.values(target).flatMap((nested) => targetFiles(nested));
32
37
 
33
- const isGiStoreStale = (store: CodegenStore, libraries: string[]): boolean => {
34
- if (!hasManifest(store.giStoreDir)) {
35
- return true;
38
+ const indexExtension = (target: string): string | undefined => {
39
+ if (target.endsWith("/index.d.ts")) {
40
+ return ".d.ts";
36
41
  }
37
42
 
38
- return libraries.some((library) => !existsSync(namespaceBarrelPath(store.giStoreDir, library)));
43
+ return target.endsWith("/index.js") ? ".js" : undefined;
39
44
  };
40
45
 
41
- const isReactStoreStale = (store: CodegenStore): boolean => {
42
- if (store.react === null) {
46
+ const implementationFile = (target: string): string | undefined => {
47
+ const extension = indexExtension(target);
48
+
49
+ if (extension === undefined) {
50
+ return undefined;
51
+ }
52
+
53
+ const directory = dirname(target);
54
+
55
+ return join(directory, `${basename(directory)}${extension}`);
56
+ };
57
+
58
+ const generatedFiles = (exports: StoreExports): string[] =>
59
+ Object.values(exports)
60
+ .flatMap((target) => targetFiles(target))
61
+ .flatMap((target) => {
62
+ const implementation = implementationFile(target);
63
+
64
+ return implementation === undefined ? [target] : [target, implementation];
65
+ });
66
+
67
+ const hasStoreExports = (storeDir: string, required: string[], forbidden: string[] = []): boolean => {
68
+ const manifestPath = join(storeDir, "package.json");
69
+
70
+ if (!existsSync(manifestPath)) {
43
71
  return false;
44
72
  }
45
73
 
46
- if (!hasManifest(store.jsxStoreDir)) {
47
- return true;
74
+ const manifest = JSON.parse(readFileSync(manifestPath, "utf8")) as {
75
+ exports?: StoreExports;
76
+ };
77
+ const exports = manifest.exports;
78
+
79
+ if (exports === undefined || required.some((key) => !Object.hasOwn(exports, key)) ||
80
+ forbidden.some((key) => Object.hasOwn(exports, key))) {
81
+ return false;
82
+ }
83
+
84
+ const files = generatedFiles(exports);
85
+
86
+ return files.length > 0 && files.every((file) => existsSync(join(storeDir, file)));
87
+ };
88
+
89
+ const isGiStoreStale = (store: CodegenStore, libraries: string[]): boolean => {
90
+ const required = [
91
+ PACKAGE_EXPORT,
92
+ ...resolveBoundLibraries(libraries).map((library) => namespaceExport(library)),
93
+ ];
94
+
95
+ return !hasStoreExports(store.giStoreDir, required);
96
+ };
97
+
98
+ const isReactStoreStale = (store: CodegenStore): boolean => {
99
+ if (store.react === null) {
100
+ return false;
48
101
  }
49
102
 
50
- return REACT_GENERATED_MODULES.some((module) => !existsSync(join(store.jsxStoreDir, module)));
103
+ return !hasStoreExports(store.jsxStoreDir, JSX_REQUIRED_EXPORTS, ["."]);
51
104
  };
52
105
 
53
106
  const isCodegenStale = (inputs: CodegenInputs): boolean => {
@@ -22,8 +22,6 @@ type ReferenceResult = {
22
22
  const REFERENCE_PATH = ".gtkx/reference";
23
23
  const SKIPPED: ReferenceResult = { isRegenerated: false, elements: 0, namespaces: 0 };
24
24
 
25
- const resolveReferenceDir = (root: string): string => join(root, ".gtkx", "reference");
26
-
27
25
  const writeReference = async (options: WriteReferenceOptions): Promise<ReferenceResult> => {
28
26
  const { root, config, girPath, libraries } = options;
29
27
 
@@ -36,17 +34,13 @@ const writeReference = async (options: WriteReferenceOptions): Promise<Reference
36
34
  const { isRegenerated, namespaces } = writeDocs({
37
35
  libraries,
38
36
  girPath,
39
- outDir: resolveReferenceDir(root),
37
+ outDir: join(root, REFERENCE_PATH),
40
38
  basePath: REFERENCE_PATH,
41
39
  linkStyle: "file",
42
40
  props: builtin.props,
41
+ acceptedChildTypes: builtin.acceptedChildTypes,
43
42
  omittedProps: mergeOmittedProps(builtin.omittedProps, resolveOmittedProps(config.elements)),
44
43
  isForced: options.isForced === true,
45
- isByteArrayTyped: config.future?.v2ByteArrays === true,
46
- isValueUnwrapped: config.future?.v2ValueReturns === true,
47
- isFinishTrimmed: config.future?.v2FinishResults === true,
48
- isInoutInPlace: config.future?.v2InoutReturns === true,
49
- isTreeShaken: config.future?.v2TreeShaking === true,
50
44
  });
51
45
 
52
46
  return {
@@ -3,27 +3,11 @@ import { REFERENCE_PATH } from "./reference.js";
3
3
 
4
4
  const PREFIX = "codegen: ";
5
5
 
6
- const contextDetails = (result: RunCodegenResult): string[] => {
7
- const details: string[] = [];
8
-
9
- if (result.configFile) {
10
- details.push(`config=${result.configFile}`);
11
- }
12
-
13
- if (result.libraries) {
14
- details.push(`libraries=${result.libraries.join(", ")}`);
15
- }
16
-
17
- if (result.girPath) {
18
- details.push(`girPath=${result.girPath.join(":")}`);
19
- }
20
-
21
- if (result.future && result.future.length > 0) {
22
- details.push(`future=${result.future.join(", ")}`);
23
- }
24
-
25
- return details;
26
- };
6
+ const contextDetails = (result: RunCodegenResult): string[] => [
7
+ `config=${result.configFile}`,
8
+ `libraries=${result.libraries.join(", ")}`,
9
+ `girPath=${result.girPath.join(":")}`,
10
+ ];
27
11
 
28
12
  const referenceDetails = (result: RunCodegenResult): string[] => {
29
13
  if (result.reference?.isRegenerated !== true) {
@@ -1,31 +1,24 @@
1
1
  import { runCodegen as runCodegenCore } from "@gtkx/codegen";
2
- import {
3
- getShadowingStorePaths,
4
- LIBRARIES_WILDCARD,
5
- redundantLibraries,
6
- sweepProjectStaging,
7
- } from "@gtkx/codegen/internal";
2
+ import { getShadowingStorePaths, sweepProjectStaging } from "@gtkx/codegen/internal";
8
3
  import { type Config, loadConfig } from "@gtkx/config";
9
4
  import {
5
+ configDependenciesFor,
10
6
  isAgentRulesEnabled,
11
- type ResolvedFuture,
12
7
  resolveElementComponents,
13
8
  resolveElementProps,
14
- resolveFuture,
15
9
  resolveLazyElements,
16
10
  resolveOmittedProps,
17
- unknownFutureKeys,
18
11
  } from "@gtkx/config/internal";
19
- import { info, warn } from "@gtkx/utils";
12
+ import { info } from "@gtkx/utils";
20
13
  import { existsSync, rmSync } from "node:fs";
21
- import { join, resolve } from "node:path";
14
+ import { join, relative, resolve } from "node:path";
22
15
  import { resolveCatalogProject, synchronizeCatalogs } from "../i18n/catalogs.js";
23
16
  import { extractSourceCatalog } from "../i18n/source-messages.js";
24
- import { emitI18nTypes } from "../i18n/types.js";
17
+ import { clearI18nTypes, emitI18nTypes } from "../i18n/types.js";
25
18
  import { upsertAgentRules } from "../internal/agent-rules.js";
26
- import { resolveDataDir } from "../internal/data-dir.js";
27
19
  import { discoverSourceFiles } from "../internal/source-imports.js";
28
20
  import { emitSchemaEnv } from "../settings/schema.js";
21
+ import { resolveConfigDependencies } from "./config-dependencies.js";
29
22
  import { type CodegenInputs, isCodegenStale, resolveCodegenInputs } from "./freshness.js";
30
23
  import { type ReferenceResult, writeReference } from "./reference.js";
31
24
  import { type CodegenContext, type CodegenStore, resolveCodegenContext } from "./store-resolver.js";
@@ -33,6 +26,7 @@ import { type CodegenContext, type CodegenStore, resolveCodegenContext } from ".
33
26
  type RunCodegenOptions = {
34
27
  cwd?: string;
35
28
  mode?: string | undefined;
29
+ configFile?: string | undefined;
36
30
  isForced?: boolean;
37
31
  inputs?: CodegenInputs;
38
32
  resolved?: LoadedConfig;
@@ -48,12 +42,10 @@ type RunCodegenResult = {
48
42
  isRegenerated: boolean;
49
43
  namespaces: number;
50
44
  intrinsicElements: number;
51
- notices: string[];
52
45
  duration: number;
53
- girPath?: string[] | undefined;
54
- configFile?: string | undefined;
55
- libraries?: string[] | undefined;
56
- future?: string[] | undefined;
46
+ girPath: string[];
47
+ configFile: string;
48
+ libraries: string[];
57
49
  reference?: ReferenceResult | undefined;
58
50
  };
59
51
 
@@ -62,7 +54,6 @@ type CodegenOptionsInput = {
62
54
  libraries: string[];
63
55
  girPath: string[];
64
56
  elements: Config["elements"];
65
- future: ResolvedFuture;
66
57
  };
67
58
 
68
59
  type PreparedCodegen = CodegenInputs & { isForced: boolean };
@@ -70,17 +61,10 @@ type PreparedCodegen = CodegenInputs & { isForced: boolean };
70
61
  type EnsureGeneratedOptions = {
71
62
  shouldAnnounce?: boolean;
72
63
  mode?: string;
64
+ configFile?: string | undefined;
73
65
  shouldPreserveI18nMetadata?: boolean | undefined;
74
66
  };
75
67
 
76
- type RunOptionsInput = {
77
- root: string;
78
- mode: string | undefined;
79
- inputs: CodegenInputs | null;
80
- resolved: LoadedConfig;
81
- shouldPreserveI18nMetadata: boolean | undefined;
82
- };
83
-
84
68
  const GIR_PATH_MISSING_MESSAGE =
85
69
  "No GIR search paths available. Install gobject-introspection " +
86
70
  "(Linux: `sudo dnf install gobject-introspection-devel` or `sudo apt install libgirepository1.0-dev`), " +
@@ -97,18 +81,14 @@ const removeShadowingStores = (cwd: string): void => {
97
81
  removeStores(getShadowingStorePaths(cwd));
98
82
  };
99
83
 
100
- const codegenOptions = ({ store, libraries, girPath, elements, future }: CodegenOptionsInput) => ({
84
+ const codegenOptions = ({ store, libraries, girPath, elements }: CodegenOptionsInput) => ({
101
85
  libraries,
102
86
  girPath,
103
- isByteArrayTyped: future.isByteArrayTyped,
104
- isValueUnwrapped: future.isValueUnwrapped,
105
- isFinishTrimmed: future.isFinishTrimmed,
106
- isInoutInPlace: future.isInoutInPlace,
107
- isTreeShaken: future.isTreeShaken,
108
87
  gi: {
109
88
  storeDir: store.giStoreDir,
110
89
  linkDir: store.giLinkDir,
111
90
  version: store.runtimeVersion,
91
+ owner: store.owner,
112
92
  },
113
93
  jsx:
114
94
  store.react === null
@@ -117,94 +97,24 @@ const codegenOptions = ({ store, libraries, girPath, elements, future }: Codegen
117
97
  storeDir: store.jsxStoreDir,
118
98
  linkDir: store.jsxLinkDir,
119
99
  version: store.react.version,
100
+ owner: store.owner,
120
101
  },
121
- reactSubexports: store.react?.subexports ?? [],
122
102
  userComponents: resolveElementComponents(elements),
123
103
  userProps: resolveElementProps(elements),
124
104
  userLazyElements: resolveLazyElements(elements),
125
105
  userOmittedProps: resolveOmittedProps(elements),
126
106
  });
127
107
 
128
- const enabledFutureFlags = (config: Config): string[] => {
129
- const unknown: Set<string> = new Set(unknownFutureKeys(config.future));
130
-
131
- return Object.entries(config.future ?? {})
132
- .filter(([name, value]) => value === true && !unknown.has(name))
133
- .map(([name]) => name);
134
- };
135
-
136
- const disabledCodegenResult = (configFile: string, notices: string[]): RunCodegenResult => ({
108
+ const disabledCodegenResult = (configFile: string): RunCodegenResult => ({
137
109
  isRegenerated: false,
138
110
  namespaces: 0,
139
111
  intrinsicElements: 0,
140
- notices,
141
112
  duration: 0,
142
113
  girPath: [],
143
114
  configFile,
144
115
  libraries: [],
145
116
  });
146
117
 
147
- const warnNotices = (notices: string[]): void => {
148
- for (const notice of notices) {
149
- warn(notice);
150
- }
151
- };
152
-
153
- const unknownFutureNotice = (keys: string[]): string[] => {
154
- if (keys.length === 0) {
155
- return [];
156
- }
157
-
158
- return [
159
- `gtkx.config.ts: \`future\` has no ${keys.join(", ")} flag, so the key is ignored. Check it against ` +
160
- "the flags the configuration guide lists.",
161
- ];
162
- };
163
-
164
- const redundantLibraryNotice = (entries: string[]): string[] => {
165
- if (entries.length === 0) {
166
- return [];
167
- }
168
-
169
- return [
170
- `gtkx.config.ts: \`future.v2DefaultLibraries\` binds ${entries.join(", ")} on its own, so naming them ` +
171
- "in `libraries` changes nothing. Drop them; naming them becomes a configuration error in GTKX 2.0.",
172
- ];
173
- };
174
-
175
- const wildcardLibrariesNotice = (libraries: Config["libraries"]): string[] => {
176
- if (libraries !== LIBRARIES_WILDCARD) {
177
- return [];
178
- }
179
-
180
- return [
181
- 'gtkx.config.ts: `libraries: "*"` binds whatever the build host happens to have installed, so the ' +
182
- "store changes with the machine. Instead, list the libraries the project needs; the wildcard is " +
183
- "removed in GTKX 2.0.",
184
- ];
185
- };
186
-
187
- const configNotices = (config: Config, future: ResolvedFuture): string[] => [
188
- ...unknownFutureNotice(unknownFutureKeys(config.future)),
189
- ...wildcardLibrariesNotice(config.libraries),
190
- ...redundantLibraryNotice(redundantLibraries(config.libraries, future.isAdwaitaDefault)),
191
- ];
192
-
193
- const regeneratedStorePaths = (store: CodegenStore): string[] => {
194
- if (store.react === null) {
195
- return [store.giStoreDir, store.giLinkDir];
196
- }
197
-
198
- return [store.giStoreDir, store.giLinkDir, store.jsxStoreDir, store.jsxLinkDir];
199
- };
200
-
201
- const clearGeneratedStores = (store: CodegenStore): void => {
202
- removeStores(regeneratedStorePaths(store));
203
- };
204
-
205
- const resolveLoadedConfig = async (options: RunCodegenOptions, cwd: string): Promise<LoadedConfig> =>
206
- options.resolved ?? (await loadConfig(cwd, { mode: options.mode }));
207
-
208
118
  const prepareCodegen = (options: RunCodegenOptions, cwd: string, config: Config): PreparedCodegen => {
209
119
  const { girPath, libraries, store } = options.inputs ?? resolveCodegenInputs(cwd, config);
210
120
 
@@ -219,55 +129,44 @@ const prepareCodegen = (options: RunCodegenOptions, cwd: string, config: Config)
219
129
 
220
130
  const runCodegen = async (options: RunCodegenOptions = {}): Promise<RunCodegenResult> => {
221
131
  const cwd = options.cwd ?? process.cwd();
222
- const { config, configFile } = await resolveLoadedConfig(options, cwd);
223
- const future = resolveFuture(config.future);
224
- const configured = configNotices(config, future);
225
- warnNotices(configured);
132
+ const { config, configFile } = options.resolved ?? (await loadConfig(cwd, {
133
+ mode: options.mode,
134
+ configFile: options.configFile,
135
+ }));
226
136
  await syncI18n(cwd, config.applicationId, options.shouldPreserveI18nMetadata);
227
- syncSchemaEnv(cwd, future.isResourceImported);
137
+ emitSchemaEnv(cwd);
228
138
 
229
139
  if (config.codegen === false) {
230
140
  removeShadowingStores(cwd);
231
141
 
232
- return disabledCodegenResult(configFile, configured);
142
+ return disabledCodegenResult(configFile);
233
143
  }
234
144
 
235
145
  const { girPath, libraries, store, isForced } = prepareCodegen(options, cwd, config);
236
146
 
237
- if (options.isForced) {
238
- clearGeneratedStores(store);
239
- }
240
-
241
147
  const result = await runCodegenCore({
242
- ...codegenOptions({ store, libraries, girPath, elements: config.elements, future }),
148
+ ...codegenOptions({ store, libraries, girPath, elements: config.elements }),
243
149
  isForced,
244
150
  });
245
151
 
246
- warnNotices(result.notices);
247
- const notices = [...configured, ...result.notices];
248
152
  const reference = await writeReference({ root: cwd, config, girPath, libraries, isForced });
249
- syncAgentRules(cwd, config);
153
+
154
+ if (isAgentRulesEnabled(config)) {
155
+ upsertAgentRules(cwd);
156
+ }
250
157
 
251
158
  return {
252
159
  isRegenerated: result.isRegenerated,
253
160
  namespaces: result.namespaces,
254
161
  intrinsicElements: result.intrinsicElements,
255
- notices,
256
162
  duration: result.duration,
257
163
  girPath,
258
164
  configFile,
259
165
  libraries,
260
- future: enabledFutureFlags(config),
261
166
  reference,
262
167
  };
263
168
  };
264
169
 
265
- const syncAgentRules = (root: string, config: Config): void => {
266
- if (isAgentRulesEnabled(config)) {
267
- upsertAgentRules(root);
268
- }
269
- };
270
-
271
170
  const syncI18n = async (
272
171
  root: string,
273
172
  applicationId: string,
@@ -276,21 +175,21 @@ const syncI18n = async (
276
175
  const project = resolveCatalogProject(root, applicationId);
277
176
 
278
177
  if (project === null) {
279
- emitI18nTypes(root, [], false);
178
+ clearI18nTypes(root);
280
179
 
281
180
  return;
282
181
  }
283
182
 
284
183
  const srcDir = join(root, "src");
285
184
  const sourceFiles = discoverSourceFiles(existsSync(srcDir) ? srcDir : root);
286
- const catalog = await extractSourceCatalog(project, sourceFiles, shouldPreserveMetadataMessages);
185
+ await extractSourceCatalog(project, sourceFiles, shouldPreserveMetadataMessages);
287
186
  synchronizeCatalogs(project);
288
- emitI18nTypes(root, catalog.messages);
187
+ await emitI18nTypes(root);
289
188
  };
290
189
 
291
- const isCodegenDisabled = async (cwd: string, mode?: string): Promise<boolean> => {
190
+ const isCodegenDisabled = async (cwd: string, mode?: string, configFile?: string): Promise<boolean> => {
292
191
  try {
293
- const { config } = await loadConfig(cwd, { mode });
192
+ const { config } = await loadConfig(cwd, { mode, configFile });
294
193
 
295
194
  return config.codegen === false;
296
195
  } catch {
@@ -298,11 +197,6 @@ const isCodegenDisabled = async (cwd: string, mode?: string): Promise<boolean> =
298
197
  }
299
198
  };
300
199
 
301
- const syncSchemaEnv = (cwd: string, isV2ResourceImports = false): void => {
302
- const dataDir = isV2ResourceImports ? null : resolveDataDir(cwd);
303
- emitSchemaEnv(cwd, dataDir, isV2ResourceImports);
304
- };
305
-
306
200
  const resolveInputsOrNull = (cwd: string, config: Config): CodegenInputs | null => {
307
201
  try {
308
202
  return resolveCodegenInputs(cwd, config);
@@ -321,20 +215,6 @@ const maybeAnnounceStale = (shouldAnnounce: boolean | undefined, inputs: Codegen
321
215
  }
322
216
  };
323
217
 
324
- const getRunOptions = ({
325
- root,
326
- mode,
327
- inputs,
328
- resolved,
329
- shouldPreserveI18nMetadata,
330
- }: RunOptionsInput): RunCodegenOptions => {
331
- if (inputs === null) {
332
- return { cwd: root, mode, resolved, shouldPreserveI18nMetadata };
333
- }
334
-
335
- return { cwd: root, mode, inputs, resolved, shouldPreserveI18nMetadata };
336
- };
337
-
338
218
  const isPreflightSkipped = (options: EnsureGeneratedOptions): boolean =>
339
219
  options.shouldAnnounce === true && process.env.GTKX_DISABLE_PREFLIGHT === "1";
340
220
 
@@ -355,13 +235,13 @@ const generate = async (context: CodegenContext, options: EnsureGeneratedOptions
355
235
  maybeAnnounceStale(options.shouldAnnounce, inputs);
356
236
  const resolved = { config: context.config, configFile: context.configFile };
357
237
 
358
- const result = await runCodegen(getRunOptions({
359
- root: context.root,
238
+ const result = await runCodegen({
239
+ cwd: context.root,
360
240
  mode: options.mode,
361
- inputs,
362
241
  resolved,
363
242
  shouldPreserveI18nMetadata: options.shouldPreserveI18nMetadata,
364
- }));
243
+ ...(inputs !== null && { inputs }),
244
+ });
365
245
 
366
246
  return result.isRegenerated;
367
247
  };
@@ -374,18 +254,51 @@ const ensureGeneratedIn = async (
374
254
 
375
255
  /* eslint-disable-next-line unicorn/consistent-boolean-name -- the boolean reports whether codegen ran */
376
256
  const ensureGenerated = async (cwd: string, options: EnsureGeneratedOptions = {}): Promise<boolean> =>
377
- isPreflightSkipped(options) ? false : generate(await resolveCodegenContext(cwd, options.mode), options);
257
+ isPreflightSkipped(options)
258
+ ? false
259
+ : generate(await resolveCodegenContext(cwd, options.mode, options.configFile), options);
378
260
 
379
261
  const resolveConfigWatch = async (
380
262
  cwd: string,
381
263
  mode?: string,
382
- ): Promise<{ paths: string[]; regenerate: () => Promise<void> }> => {
383
- const { configFile, root } = await loadConfig(cwd, { mode });
264
+ configFile?: string,
265
+ initialDependencies: string[] = [],
266
+ ): Promise<{ paths: string[]; resolvePaths: () => string[]; regenerate: () => Promise<string[]> }> => {
267
+ let selectedConfigFile: string;
268
+
269
+ if (configFile === undefined) {
270
+ const loaded = await loadConfig(cwd, { mode });
271
+ selectedConfigFile = loaded.configFile;
272
+ } else {
273
+ selectedConfigFile = resolve(cwd, configFile);
274
+ }
275
+
276
+ let knownDependencies = initialDependencies;
277
+ const selectedConfigName = relative(cwd, selectedConfigFile);
278
+ const resolvePaths = (): string[] => [
279
+ ...new Set(
280
+ [selectedConfigFile, ...knownDependencies]
281
+ .flatMap((path) => resolveConfigDependencies(path, selectedConfigName, cwd)),
282
+ ),
283
+ ];
384
284
 
385
285
  return {
386
- paths: [resolve(root, configFile)],
286
+ paths: resolvePaths(),
287
+ resolvePaths,
387
288
  regenerate: async () => {
388
- await runCodegen({ cwd: root, mode });
289
+ let loaded: Awaited<ReturnType<typeof loadConfig>>;
290
+
291
+ try {
292
+ loaded = await loadConfig(cwd, { mode, configFile: selectedConfigFile });
293
+ } catch (error) {
294
+ knownDependencies = [...new Set([...knownDependencies, ...configDependenciesFor(error)])];
295
+ throw error;
296
+ }
297
+
298
+ knownDependencies = configDependenciesFor(loaded);
299
+ await runCodegen({ cwd, mode, resolved: loaded });
300
+
301
+ return resolvePaths();
389
302
  },
390
303
  };
391
304
  };