@gtkx/codegen 1.0.0-rc.2 → 1.0.0-rc.4

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 (254) hide show
  1. package/README.md +4 -5
  2. package/dist/analysis/descriptor-render.d.ts +2 -2
  3. package/dist/analysis/descriptor-render.d.ts.map +1 -1
  4. package/dist/analysis/descriptor-render.js +30 -32
  5. package/dist/analysis/descriptor-render.js.map +1 -1
  6. package/dist/analysis/descriptor.d.ts +6 -6
  7. package/dist/analysis/descriptor.d.ts.map +1 -1
  8. package/dist/analysis/descriptor.js +7 -7
  9. package/dist/analysis/descriptor.js.map +1 -1
  10. package/dist/analysis/param-structure.d.ts +2 -2
  11. package/dist/analysis/param-structure.d.ts.map +1 -1
  12. package/dist/analysis/param-structure.js +5 -7
  13. package/dist/analysis/param-structure.js.map +1 -1
  14. package/dist/analysis/ts-type.d.ts +1 -1
  15. package/dist/analysis/ts-type.d.ts.map +1 -1
  16. package/dist/analysis/ts-type.js +7 -13
  17. package/dist/analysis/ts-type.js.map +1 -1
  18. package/dist/compile.d.ts.map +1 -1
  19. package/dist/compile.js +2 -1
  20. package/dist/compile.js.map +1 -1
  21. package/dist/docs/api-reference.d.ts +77 -1
  22. package/dist/docs/api-reference.d.ts.map +1 -1
  23. package/dist/docs/api-reference.js +66 -8
  24. package/dist/docs/api-reference.js.map +1 -1
  25. package/dist/docs/element-page.d.ts.map +1 -1
  26. package/dist/docs/element-page.js +5 -4
  27. package/dist/docs/element-page.js.map +1 -1
  28. package/dist/docs/pipeline.d.ts +5 -3
  29. package/dist/docs/pipeline.d.ts.map +1 -1
  30. package/dist/docs/pipeline.js +5 -3
  31. package/dist/docs/pipeline.js.map +1 -1
  32. package/dist/docs/render.js +6 -6
  33. package/dist/docs/render.js.map +1 -1
  34. package/dist/docs/symbol-page.d.ts +5 -0
  35. package/dist/docs/symbol-page.d.ts.map +1 -1
  36. package/dist/docs/symbol-page.js +2 -2
  37. package/dist/docs/symbol-page.js.map +1 -1
  38. package/dist/fingerprint.d.ts +2 -4
  39. package/dist/fingerprint.d.ts.map +1 -1
  40. package/dist/fingerprint.js +7 -6
  41. package/dist/fingerprint.js.map +1 -1
  42. package/dist/gi.d.ts +7 -10
  43. package/dist/gi.d.ts.map +1 -1
  44. package/dist/gi.js +4 -9
  45. package/dist/gi.js.map +1 -1
  46. package/dist/gir/field.d.ts +0 -1
  47. package/dist/gir/field.d.ts.map +1 -1
  48. package/dist/gir/field.js +0 -3
  49. package/dist/gir/field.js.map +1 -1
  50. package/dist/gir/gir-path.d.ts +7 -0
  51. package/dist/gir/gir-path.d.ts.map +1 -1
  52. package/dist/gir/gir-path.js +7 -0
  53. package/dist/gir/gir-path.js.map +1 -1
  54. package/dist/gir/libraries.d.ts +17 -3
  55. package/dist/gir/libraries.d.ts.map +1 -1
  56. package/dist/gir/libraries.js +14 -1
  57. package/dist/gir/libraries.js.map +1 -1
  58. package/dist/gir/parameter.d.ts.map +1 -1
  59. package/dist/gir/parameter.js +0 -4
  60. package/dist/gir/parameter.js.map +1 -1
  61. package/dist/gir/size.d.ts.map +1 -1
  62. package/dist/gir/size.js +0 -3
  63. package/dist/gir/size.js.map +1 -1
  64. package/dist/gir/type-id.d.ts +1 -1
  65. package/dist/gir/type-id.d.ts.map +1 -1
  66. package/dist/gir/type-id.js +1 -3
  67. package/dist/gir/type-id.js.map +1 -1
  68. package/dist/gir/type-ref.js +1 -1
  69. package/dist/gir/type-ref.js.map +1 -1
  70. package/dist/index.d.ts +18 -5
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/index.js +12 -2
  73. package/dist/index.js.map +1 -1
  74. package/dist/internal.d.ts +3 -0
  75. package/dist/internal.d.ts.map +1 -0
  76. package/dist/internal.js +3 -0
  77. package/dist/internal.js.map +1 -0
  78. package/dist/jsx.d.ts +8 -11
  79. package/dist/jsx.d.ts.map +1 -1
  80. package/dist/jsx.js +18 -15
  81. package/dist/jsx.js.map +1 -1
  82. package/dist/khronos/args.d.ts.map +1 -1
  83. package/dist/khronos/args.js +1 -1
  84. package/dist/khronos/args.js.map +1 -1
  85. package/dist/khronos/pipeline.js +1 -1
  86. package/dist/khronos/pipeline.js.map +1 -1
  87. package/dist/khronos/plan.d.ts +2 -2
  88. package/dist/khronos/plan.d.ts.map +1 -1
  89. package/dist/khronos/plan.js +6 -6
  90. package/dist/khronos/plan.js.map +1 -1
  91. package/dist/react/element-config.d.ts +18 -9
  92. package/dist/react/element-config.d.ts.map +1 -1
  93. package/dist/react/element-config.js +23 -13
  94. package/dist/react/element-config.js.map +1 -1
  95. package/dist/runner.d.ts +36 -16
  96. package/dist/runner.d.ts.map +1 -1
  97. package/dist/runner.js +22 -20
  98. package/dist/runner.js.map +1 -1
  99. package/dist/store/compile-store.d.ts +1 -2
  100. package/dist/store/compile-store.d.ts.map +1 -1
  101. package/dist/store/compile-store.js +2 -2
  102. package/dist/store/compile-store.js.map +1 -1
  103. package/dist/store/gi/callables.d.ts.map +1 -1
  104. package/dist/store/gi/callables.js +4 -9
  105. package/dist/store/gi/callables.js.map +1 -1
  106. package/dist/store/gi/constant.d.ts.map +1 -1
  107. package/dist/store/gi/constant.js +0 -2
  108. package/dist/store/gi/constant.js.map +1 -1
  109. package/dist/store/gi/function.d.ts.map +1 -1
  110. package/dist/store/gi/function.js +1 -7
  111. package/dist/store/gi/function.js.map +1 -1
  112. package/dist/store/gi/method.d.ts.map +1 -1
  113. package/dist/store/gi/method.js +26 -23
  114. package/dist/store/gi/method.js.map +1 -1
  115. package/dist/store/gi/property-accessor.d.ts +1 -1
  116. package/dist/store/gi/property-accessor.d.ts.map +1 -1
  117. package/dist/store/gi/property-accessor.js +5 -7
  118. package/dist/store/gi/property-accessor.js.map +1 -1
  119. package/dist/store/gi/record-constructor.d.ts.map +1 -1
  120. package/dist/store/gi/record-constructor.js +5 -4
  121. package/dist/store/gi/record-constructor.js.map +1 -1
  122. package/dist/store/gi/record-field-accessor.d.ts +3 -2
  123. package/dist/store/gi/record-field-accessor.d.ts.map +1 -1
  124. package/dist/store/gi/record-field-accessor.js +21 -11
  125. package/dist/store/gi/record-field-accessor.js.map +1 -1
  126. package/dist/store/gi/record-layout.d.ts.map +1 -1
  127. package/dist/store/gi/record-layout.js +0 -4
  128. package/dist/store/gi/record-layout.js.map +1 -1
  129. package/dist/store/gi/record.d.ts.map +1 -1
  130. package/dist/store/gi/record.js +0 -7
  131. package/dist/store/gi/record.js.map +1 -1
  132. package/dist/store/gi/return-wrap.d.ts +1 -1
  133. package/dist/store/gi/return-wrap.d.ts.map +1 -1
  134. package/dist/store/gi/return-wrap.js +4 -4
  135. package/dist/store/gi/return-wrap.js.map +1 -1
  136. package/dist/store/gi/signal.d.ts.map +1 -1
  137. package/dist/store/gi/signal.js +13 -16
  138. package/dist/store/gi/signal.js.map +1 -1
  139. package/dist/store/gi/value-marshalable.d.ts +7 -0
  140. package/dist/store/gi/value-marshalable.d.ts.map +1 -0
  141. package/dist/store/gi/value-marshalable.js +57 -0
  142. package/dist/store/gi/value-marshalable.js.map +1 -0
  143. package/dist/store/gi-store.d.ts +2 -3
  144. package/dist/store/gi-store.d.ts.map +1 -1
  145. package/dist/store/gi-store.js.map +1 -1
  146. package/dist/store/jsx/element-components.d.ts +0 -2
  147. package/dist/store/jsx/element-components.d.ts.map +1 -1
  148. package/dist/store/jsx/element-components.js +0 -4
  149. package/dist/store/jsx/element-components.js.map +1 -1
  150. package/dist/store/jsx/element-prop-imports.d.ts +2 -3
  151. package/dist/store/jsx/element-prop-imports.d.ts.map +1 -1
  152. package/dist/store/jsx/element-prop-imports.js +0 -2
  153. package/dist/store/jsx/element-prop-imports.js.map +1 -1
  154. package/dist/store/jsx/element-prop-types.d.ts +0 -1
  155. package/dist/store/jsx/element-prop-types.d.ts.map +1 -1
  156. package/dist/store/jsx/element-prop-types.js +0 -1
  157. package/dist/store/jsx/element-prop-types.js.map +1 -1
  158. package/dist/store/jsx/generated-elements.d.ts +29 -0
  159. package/dist/store/jsx/generated-elements.d.ts.map +1 -0
  160. package/dist/store/jsx/generated-elements.js +30 -0
  161. package/dist/store/jsx/generated-elements.js.map +1 -0
  162. package/dist/store/jsx/intrinsic-elements.d.ts +1 -2
  163. package/dist/store/jsx/intrinsic-elements.d.ts.map +1 -1
  164. package/dist/store/jsx/intrinsic-elements.js +1 -2
  165. package/dist/store/jsx/intrinsic-elements.js.map +1 -1
  166. package/dist/store/jsx/jsx.js +6 -6
  167. package/dist/store/jsx/jsx.js.map +1 -1
  168. package/dist/store/jsx/metadata.js +7 -7
  169. package/dist/store/jsx/metadata.js.map +1 -1
  170. package/dist/store/jsx/omitted-props.d.ts +8 -0
  171. package/dist/store/jsx/omitted-props.d.ts.map +1 -0
  172. package/dist/store/jsx/omitted-props.js +20 -0
  173. package/dist/store/jsx/omitted-props.js.map +1 -0
  174. package/dist/store/jsx/pipeline.d.ts +4 -0
  175. package/dist/store/jsx/pipeline.d.ts.map +1 -1
  176. package/dist/store/jsx/pipeline.js +4 -1
  177. package/dist/store/jsx/pipeline.js.map +1 -1
  178. package/dist/store/jsx/props.d.ts +1 -1
  179. package/dist/store/jsx/props.d.ts.map +1 -1
  180. package/dist/store/jsx/props.js +8 -13
  181. package/dist/store/jsx/props.js.map +1 -1
  182. package/dist/store/jsx-store.d.ts +2 -3
  183. package/dist/store/jsx-store.d.ts.map +1 -1
  184. package/dist/store/jsx-store.js +3 -3
  185. package/dist/store/jsx-store.js.map +1 -1
  186. package/dist/store/resolve-store.d.ts +28 -0
  187. package/dist/store/resolve-store.d.ts.map +1 -0
  188. package/dist/store/resolve-store.js +65 -0
  189. package/dist/store/resolve-store.js.map +1 -0
  190. package/dist/store/store-fs.d.ts +5 -1
  191. package/dist/store/store-fs.d.ts.map +1 -1
  192. package/dist/store/store-fs.js +6 -4
  193. package/dist/store/store-fs.js.map +1 -1
  194. package/overrides/gobject/object.ts.ejs +8 -8
  195. package/package.json +6 -11
  196. package/src/analysis/descriptor-render.ts +45 -38
  197. package/src/analysis/descriptor.ts +13 -13
  198. package/src/analysis/param-structure.ts +8 -10
  199. package/src/analysis/ts-type.ts +8 -17
  200. package/src/compile.ts +2 -1
  201. package/src/docs/api-reference.ts +131 -13
  202. package/src/docs/element-page.ts +5 -9
  203. package/src/docs/pipeline.ts +9 -6
  204. package/src/docs/render.ts +7 -7
  205. package/src/docs/symbol-page.ts +7 -2
  206. package/src/fingerprint.ts +21 -12
  207. package/src/gi.ts +13 -11
  208. package/src/gir/field.ts +0 -4
  209. package/src/gir/gir-path.ts +7 -0
  210. package/src/gir/libraries.ts +18 -4
  211. package/src/gir/parameter.ts +0 -4
  212. package/src/gir/size.ts +0 -3
  213. package/src/gir/type-id.ts +2 -4
  214. package/src/gir/type-ref.ts +1 -1
  215. package/src/index.ts +18 -15
  216. package/src/internal.ts +2 -0
  217. package/src/jsx.ts +26 -21
  218. package/src/khronos/args.ts +1 -1
  219. package/src/khronos/pipeline.ts +1 -1
  220. package/src/khronos/plan.ts +8 -8
  221. package/src/react/element-config.ts +25 -16
  222. package/src/runner.ts +62 -37
  223. package/src/store/compile-store.ts +3 -4
  224. package/src/store/gi/callables.ts +5 -11
  225. package/src/store/gi/constant.ts +0 -2
  226. package/src/store/gi/function.ts +1 -7
  227. package/src/store/gi/method.ts +31 -28
  228. package/src/store/gi/property-accessor.ts +6 -8
  229. package/src/store/gi/record-constructor.ts +9 -4
  230. package/src/store/gi/record-field-accessor.ts +41 -12
  231. package/src/store/gi/record-layout.ts +0 -4
  232. package/src/store/gi/record.ts +0 -9
  233. package/src/store/gi/return-wrap.ts +5 -5
  234. package/src/store/gi/signal.ts +17 -17
  235. package/src/store/gi/value-marshalable.ts +87 -0
  236. package/src/store/gi-store.ts +2 -4
  237. package/src/store/jsx/element-components.ts +0 -6
  238. package/src/store/jsx/element-prop-imports.ts +7 -4
  239. package/src/store/jsx/element-prop-types.ts +0 -1
  240. package/src/store/jsx/generated-elements.ts +60 -0
  241. package/src/store/jsx/intrinsic-elements.ts +0 -9
  242. package/src/store/jsx/jsx.ts +7 -7
  243. package/src/store/jsx/metadata.ts +8 -8
  244. package/src/store/jsx/omitted-props.ts +30 -0
  245. package/src/store/jsx/pipeline.ts +6 -1
  246. package/src/store/jsx/props.ts +8 -20
  247. package/src/store/jsx-store.ts +5 -7
  248. package/src/store/resolve-store.ts +100 -0
  249. package/src/store/store-fs.ts +12 -5
  250. package/dist/store/gi/class-struct-record.d.ts +0 -10
  251. package/dist/store/gi/class-struct-record.d.ts.map +0 -1
  252. package/dist/store/gi/class-struct-record.js +0 -52
  253. package/dist/store/gi/class-struct-record.js.map +0 -1
  254. package/src/store/gi/class-struct-record.ts +0 -72
@@ -1 +1 @@
1
- {"version":3,"file":"store-fs.d.ts","sourceRoot":"","sources":["../../src/store/store-fs.ts"],"names":[],"mappings":"AAIA,KAAK,YAAY,GAAG;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,KAAK,SAAS,GAAG;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,IAAI,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7C,CAAC;AAEF,KAAK,aAAa,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7C,CAAC;AAEF,KAA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AO,CAAC,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7C,CAAC;AAEF,KAAK,aAAa,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7C,CAAC;AAEF,KAAK,OAAO,GAAG;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzD,KAAK,gBAAgB,GAAG;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAIF,QAAA,MAAM,aAAa,GAAI,MAAM,MAAM,KAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAGpE,CAAC;AAEH,QAAA,MAAM,aAAa,GAAI,OAAO,aAAa,KAAG,QAc7C,CAAC;AAEF,QAAA,MAAM,UAAU,GAAI,QAAQ,gBAAgB,KAAG,IA0B9C,CAAC;AAuCF,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,CAAC"}
@@ -1,6 +1,7 @@
1
- import { existsSync, mkdirSync, mkdtempSync, renameSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
1
+ import { chmodSync, existsSync, mkdirSync, mkdtempSync, renameSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
2
2
  import { dirname, join, relative } from "node:path";
3
3
  import { compileStore } from "./compile-store.js";
4
+ const STORE_DIR_MODE = 0o755;
4
5
  const subpathExport = (stem) => ({
5
6
  types: `./${stem}.d.ts`,
6
7
  default: `./${stem}.js`,
@@ -28,14 +29,13 @@ const writeStore = (params) => {
28
29
  storeDir: tmp,
29
30
  files: params.files,
30
31
  packageName: params.manifest.name,
31
- ...(params.configEnv !== undefined && { configEnv: params.configEnv }),
32
+ ...(params.requiresEnvReference !== undefined && { requiresEnvReference: params.requiresEnvReference }),
32
33
  });
33
34
  writePackageJson(tmp, params.manifest);
34
35
  const rawFiles = params.rawFiles ?? [];
35
36
  for (const raw of rawFiles) {
36
37
  writeFileSync(join(tmp, raw.relativePath), raw.content);
37
38
  }
38
- symlinkRelative(join(tmp, "node_modules", ...params.manifest.name.split("/")), tmp);
39
39
  swapStore(tmp, params.storeDir, params.linkDir);
40
40
  }
41
41
  finally {
@@ -67,7 +67,9 @@ const swapStore = (tmp, storeDir, visibleLink) => {
67
67
  };
68
68
  const createTempStore = (storeDir) => {
69
69
  mkdirSync(dirname(storeDir), { recursive: true });
70
- return mkdtempSync(`${storeDir}.tmp-`);
70
+ const tmp = mkdtempSync(`${storeDir}.tmp-`);
71
+ chmodSync(tmp, STORE_DIR_MODE);
72
+ return tmp;
71
73
  };
72
74
  export { subpathExport, buildManifest, writeStore };
73
75
  //# sourceMappingURL=store-fs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"store-fs.js","sourceRoot":"","sources":["../../src/store/store-fs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7G,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAwClD,MAAM,aAAa,GAAG,CAAC,IAAY,EAAsC,EAAE,CAAC,CAAC;IACzE,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G,CAAC,QAAgB,EAAE,QAAkB,EAAQ,EAAE;IACpE,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AAC5F,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,QAAgB,EAAE,WAAmB,EAAQ,EAAE;IAC3E,MAAM,QAAQ,GAAG,GAAG,QAAQ,MAAM,CAAC;IACnC,MAAM,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAEnD,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvB,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACnC,CAAC;IAED,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC1B,MAAM,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACnD,eAAe,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,QAAgB,EAAU,EAAE;IACjD,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAElD,OAAO,WAAW,CAAC,GAAG,QAAQ,OAAO,CAAC,CAAC;AAC3C,CAAC,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAmC,CAAC","sourcesContent":["import { existsSync, mkdirSync, mkdtempSync, renameSync, rmSync, symlinkSync, writeFileSync } from \"node:fs\";\nimport { dirname, join, relative } from \"node:path\";\nimport { compileStore } from \"./compile-store.js\";\n\ntype StoreOptions = {\n storeDir: string;\n linkDir: string;\n version: string;\n};\n\ntype StoreFile = {\n fileName: string;\n source: string;\n};\n\ntype Manifest = {\n name: string;\n type: \"module\";\n version: string;\n sideEffects: true;\n exports: Record<string, unknown>;\n peerDependencies?: Record<string, string>;\n};\n\ntype ManifestInput = {\n name: string;\n version: string;\n exports: Record<string, unknown>;\n peerDependencies?: Record<string, string>;\n};\n\ntype RawFile = { relativePath: string; content: string };\n\ntype WriteStoreParams = {\n storeDir: string;\n linkDir: string;\n files: StoreFile[];\n manifest: Manifest;\n rawFiles?: RawFile[];\n configEnv?: boolean;\n};\n\nconst subpathExport = (stem: string): { types: string; default: string } => ({\n types: `./${stem}.d.ts`,\n default: `./${stem}.js`,\n});\n\nconst buildManifest = (input: ManifestInput): Manifest => {\n const manifest: Manifest = {\n name: input.name,\n type: \"module\",\n version: input.version,\n sideEffects: true,\n exports: { \"./package.json\": \"./package.json\", ...input.exports },\n };\n\n if (input.peerDependencies) {\n manifest.peerDependencies = input.peerDependencies;\n }\n\n return manifest;\n};\n\nconst writeStore = (params: WriteStoreParams): void => {\n const tmp = createTempStore(params.storeDir);\n\n try {\n for (const file of params.files) {\n writeSourceFile(tmp, file.fileName, file.source);\n }\n\n compileStore({\n storeDir: tmp,\n files: params.files,\n packageName: params.manifest.name,\n ...(params.configEnv !== undefined && { configEnv: params.configEnv }),\n });\n\n writePackageJson(tmp, params.manifest);\n const rawFiles = params.rawFiles ?? [];\n\n for (const raw of rawFiles) {\n writeFileSync(join(tmp, raw.relativePath), raw.content);\n }\n\n symlinkRelative(join(tmp, \"node_modules\", ...params.manifest.name.split(\"/\")), tmp);\n swapStore(tmp, params.storeDir, params.linkDir);\n } finally {\n rmSync(tmp, { recursive: true, force: true });\n }\n};\n\nconst writeSourceFile = (storeDir: string, fileName: string, source: string): void => {\n const filePath = join(storeDir, fileName);\n mkdirSync(dirname(filePath), { recursive: true });\n writeFileSync(filePath, source);\n};\n\nconst symlinkRelative = (linkPath: string, realTarget: string): void => {\n mkdirSync(dirname(linkPath), { recursive: true });\n rmSync(linkPath, { recursive: true, force: true });\n symlinkSync(relative(dirname(linkPath), realTarget), linkPath, \"dir\");\n};\n\nconst writePackageJson = (storeDir: string, manifest: Manifest): void => {\n writeFileSync(join(storeDir, \"package.json\"), `${JSON.stringify(manifest, null, 2)}\\n`);\n};\n\nconst swapStore = (tmp: string, storeDir: string, visibleLink: string): void => {\n const previous = `${storeDir}.old`;\n rmSync(previous, { recursive: true, force: true });\n\n if (existsSync(storeDir)) {\n renameSync(storeDir, previous);\n }\n\n renameSync(tmp, storeDir);\n rmSync(previous, { recursive: true, force: true });\n symlinkRelative(visibleLink, storeDir);\n};\n\nconst createTempStore = (storeDir: string): string => {\n mkdirSync(dirname(storeDir), { recursive: true });\n\n return mkdtempSync(`${storeDir}.tmp-`);\n};\n\nexport { subpathExport, buildManifest, writeStore, type StoreOptions, type RawFile };\n"]}
1
+ {"version":3,"file":"store-fs.js","sourceRoot":"","sources":["../../src/store/store-fs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AA4ClD,MAAM,cAAc,GAAG,KAAK,CAAC;AAE7B,MAAM,aAAa,GAAG,CAAC,IAAY,EAAsC,EAAE,CAAC,CAAC;IACzE,KAAK,EAAE,KAAK,IAAI,OAAO;IACvB,OAAO,EAAE,KAAK,IAAI,KAAK;CAC1B,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,CAAC,KAAoB,EAAY,EAAE;IACrD,MAAM,QAAQ,GAAa;QACvB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,WAAW,EAAE,IAAI;QAC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,CAAC;IAEnD,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvB,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACnC,CAAC;IAED,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC1B,MAAM,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACnD,eAAe,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,QAAgB,EAAU,EAAE;IACjD,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,QAAQ,OAAO,CAAC,CAAC;IAC5C,SAAS,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IAE/B,OAAO,GAAG,CAAC;AACf,CAAC,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAmC,CAAC","sourcesContent":["import { chmodSync, existsSync, mkdirSync, mkdtempSync, renameSync, rmSync, symlinkSync, writeFileSync } from \"node:fs\";\nimport { dirname, join, relative } from \"node:path\";\nimport { compileStore } from \"./compile-store.js\";\n\n/** Where one generated store is written and how it is reached. */\ntype StoreOptions = {\n /** Directory the generated package is written to, replaced atomically on each run. */\n storeDir: string;\n /** Path the store is symlinked at, which is the specifier's resolution target under `node_modules`. */\n linkDir: string;\n /** Version stamped on the store's `package.json`, taken from the dependency the store is generated for. */\n version: string;\n};\n\ntype StoreFile = {\n fileName: string;\n source: string;\n};\n\ntype Manifest = {\n name: string;\n type: \"module\";\n version: string;\n sideEffects: true;\n exports: Record<string, unknown>;\n peerDependencies?: Record<string, string>;\n};\n\ntype ManifestInput = {\n name: string;\n version: string;\n exports: Record<string, unknown>;\n peerDependencies?: Record<string, string>;\n};\n\ntype RawFile = { relativePath: string; content: string };\n\ntype WriteStoreParams = {\n storeDir: string;\n linkDir: string;\n files: StoreFile[];\n manifest: Manifest;\n rawFiles?: RawFile[];\n requiresEnvReference?: boolean;\n};\n\nconst STORE_DIR_MODE = 0o755;\n\nconst subpathExport = (stem: string): { types: string; default: string } => ({\n types: `./${stem}.d.ts`,\n default: `./${stem}.js`,\n});\n\nconst buildManifest = (input: ManifestInput): Manifest => {\n const manifest: Manifest = {\n name: input.name,\n type: \"module\",\n version: input.version,\n sideEffects: true,\n exports: { \"./package.json\": \"./package.json\", ...input.exports },\n };\n\n if (input.peerDependencies) {\n manifest.peerDependencies = input.peerDependencies;\n }\n\n return manifest;\n};\n\nconst writeStore = (params: WriteStoreParams): void => {\n const tmp = createTempStore(params.storeDir);\n\n try {\n for (const file of params.files) {\n writeSourceFile(tmp, file.fileName, file.source);\n }\n\n compileStore({\n storeDir: tmp,\n files: params.files,\n packageName: params.manifest.name,\n ...(params.requiresEnvReference !== undefined && { requiresEnvReference: params.requiresEnvReference }),\n });\n\n writePackageJson(tmp, params.manifest);\n const rawFiles = params.rawFiles ?? [];\n\n for (const raw of rawFiles) {\n writeFileSync(join(tmp, raw.relativePath), raw.content);\n }\n\n swapStore(tmp, params.storeDir, params.linkDir);\n } finally {\n rmSync(tmp, { recursive: true, force: true });\n }\n};\n\nconst writeSourceFile = (storeDir: string, fileName: string, source: string): void => {\n const filePath = join(storeDir, fileName);\n mkdirSync(dirname(filePath), { recursive: true });\n writeFileSync(filePath, source);\n};\n\nconst symlinkRelative = (linkPath: string, realTarget: string): void => {\n mkdirSync(dirname(linkPath), { recursive: true });\n rmSync(linkPath, { recursive: true, force: true });\n symlinkSync(relative(dirname(linkPath), realTarget), linkPath, \"dir\");\n};\n\nconst writePackageJson = (storeDir: string, manifest: Manifest): void => {\n writeFileSync(join(storeDir, \"package.json\"), `${JSON.stringify(manifest, null, 2)}\\n`);\n};\n\nconst swapStore = (tmp: string, storeDir: string, visibleLink: string): void => {\n const previous = `${storeDir}.old`;\n rmSync(previous, { recursive: true, force: true });\n\n if (existsSync(storeDir)) {\n renameSync(storeDir, previous);\n }\n\n renameSync(tmp, storeDir);\n rmSync(previous, { recursive: true, force: true });\n symlinkRelative(visibleLink, storeDir);\n};\n\nconst createTempStore = (storeDir: string): string => {\n mkdirSync(dirname(storeDir), { recursive: true });\n const tmp = mkdtempSync(`${storeDir}.tmp-`);\n chmodSync(tmp, STORE_DIR_MODE);\n\n return tmp;\n};\n\nexport { subpathExport, buildManifest, writeStore, type StoreOptions, type RawFile };\n"]}
@@ -9,34 +9,34 @@ declare module "../gobject.js" {
9
9
 
10
10
  disconnect(handlerId: number): void;
11
11
 
12
- on(sigName: string, callback: (...args: unknown[]) => unknown, after?: boolean): Object;
12
+ on(sigName: string, callback: (...args: unknown[]) => unknown, isAfter?: boolean): Object;
13
13
 
14
- once(sigName: string, callback: (...args: unknown[]) => unknown, after?: boolean): Object;
14
+ once(sigName: string, callback: (...args: unknown[]) => unknown, isAfter?: boolean): Object;
15
15
 
16
16
  off(sigName: string, callback: (...args: unknown[]) => unknown): Object;
17
17
 
18
- addEventListener(sigName: string, callback: (...args: unknown[]) => unknown, after?: boolean): Object;
18
+ addEventListener(sigName: string, callback: (...args: unknown[]) => unknown, isAfter?: boolean): Object;
19
19
 
20
20
  removeEventListener(sigName: string, callback: (...args: unknown[]) => unknown): Object;
21
21
  }
22
22
  }
23
23
 
24
24
  type GObjectWithConnect = GObject & {
25
- connect(sigName: string, callback: Listener, after?: boolean): number;
25
+ connect(sigName: string, callback: Listener, isAfter?: boolean): number;
26
26
  };
27
27
 
28
28
  GObject.prototype.disconnect = function disconnect(handlerId: number): void {
29
29
  signalHandlerDisconnect(this, BigInt(handlerId));
30
30
  };
31
31
 
32
- function onImpl(this: GObjectWithConnect, sigName: string, callback: Listener, after?: boolean): GObject {
33
- onSignal(this, sigName, callback, after);
32
+ function onImpl(this: GObjectWithConnect, sigName: string, callback: Listener, isAfter?: boolean): GObject {
33
+ onSignal(this, sigName, callback, isAfter);
34
34
  return this;
35
35
  }
36
36
  GObject.prototype.on = onImpl;
37
37
 
38
- function onceImpl(this: GObjectWithConnect, sigName: string, callback: Listener, after?: boolean): GObject {
39
- onceSignal(this, sigName, callback, after);
38
+ function onceImpl(this: GObjectWithConnect, sigName: string, callback: Listener, isAfter?: boolean): GObject {
39
+ onceSignal(this, sigName, callback, isAfter);
40
40
  return this;
41
41
  }
42
42
  GObject.prototype.once = onceImpl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gtkx/codegen",
3
- "version": "1.0.0-rc.2",
3
+ "version": "1.0.0-rc.4",
4
4
  "description": "Generates the typed GTKX bindings and API reference from GIR and OpenGL registry data",
5
5
  "keywords": [
6
6
  "gtkx",
@@ -29,13 +29,9 @@
29
29
  "types": "./dist/index.d.ts",
30
30
  "default": "./dist/index.js"
31
31
  },
32
- "./gi": {
33
- "types": "./dist/gi.d.ts",
34
- "default": "./dist/gi.js"
35
- },
36
- "./jsx": {
37
- "types": "./dist/jsx.d.ts",
38
- "default": "./dist/jsx.js"
32
+ "./internal": {
33
+ "types": "./dist/internal.d.ts",
34
+ "default": "./dist/internal.js"
39
35
  }
40
36
  },
41
37
  "sideEffects": false,
@@ -51,9 +47,8 @@
51
47
  "@types/node": "^26.1.2",
52
48
  "fast-xml-parser": "^5.10.1",
53
49
  "typescript": "^6.0.3",
54
- "@gtkx/config": "1.0.0-rc.2",
55
- "@gtkx/react": "1.0.0-rc.2",
56
- "@gtkx/utils": "1.0.0-rc.2"
50
+ "@gtkx/react": "1.0.0-rc.4",
51
+ "@gtkx/utils": "1.0.0-rc.4"
57
52
  },
58
53
  "scripts": {
59
54
  "release": "tsx ../../scripts/release-package.ts"
@@ -21,6 +21,7 @@ import {
21
21
  } from "../gir/type-id.js";
22
22
  import { isRecordInout } from "../store/gi/param-marshal.js";
23
23
  import { computeRecordFieldSlots } from "../store/gi/record-layout.js";
24
+ import { isValueMarshalable } from "../store/gi/value-marshalable.js";
24
25
  import {
25
26
  type ListDescriptorName,
26
27
  type Ownership,
@@ -50,10 +51,10 @@ import {
50
51
 
51
52
  type RenderDescriptorOptions = {
52
53
  argIndexOffset?: number;
53
- /** GIR parameter index to emitted argument index, for callables that drop parameters. */
54
54
  argIndexMap?: Map<number, number> | undefined;
55
- callerAllocated?: boolean;
55
+ isCallerAllocated?: boolean;
56
56
  isInline?: boolean;
57
+ isNewlyCreated?: boolean;
57
58
  };
58
59
 
59
60
  type ArgIndexOptions = {
@@ -73,7 +74,7 @@ type FundamentalDescriptor = {
73
74
  typeName: string | undefined;
74
75
  ownership: Ownership;
75
76
  wrapperClass?: string | undefined;
76
- inline?: boolean | undefined;
77
+ isInline?: boolean | undefined;
77
78
  };
78
79
 
79
80
  type AncestorFundamental = {
@@ -91,7 +92,7 @@ type FundamentalRecordOptions = {
91
92
  unrefFunc: string;
92
93
  ownership: Ownership;
93
94
  wrapperClass: string | undefined;
94
- inline: boolean;
95
+ isInline: boolean;
95
96
  };
96
97
 
97
98
  const LIST_HELPERS: Record<Exclude<ListFlavor, "gbytearray">, ListDescriptorName> = {
@@ -101,9 +102,8 @@ const LIST_HELPERS: Record<Exclude<ListFlavor, "gbytearray">, ListDescriptorName
101
102
  garray: "gArray",
102
103
  };
103
104
 
104
- // A callable that drops parameters (varargs, and the closure/destroy slots folded into a callback)
105
- // shifts every later parameter left, so a GIR length index has to be looked up in the emitted list
106
- // rather than shifted by the instance offset alone.
105
+ const FLOATING_FUNDAMENTALS: Set<string> = new Set(["GParam"]);
106
+
107
107
  const mapArgIndex = (options: ArgIndexOptions, girIndex: number): number =>
108
108
  options.argIndexMap?.get(girIndex) ?? girIndex + options.argIndexOffset;
109
109
 
@@ -164,9 +164,6 @@ const renderDescriptor = (
164
164
  case "varargs": {
165
165
  return tVoid;
166
166
  }
167
- // A callback in a slot no `renderCallbackType` covers (a vtable entry, a signal argument, a
168
- // record field) is still a function pointer occupying a pointer-sized slot. `t.void` would
169
- // hand the implementation `undefined` where the pointer belongs.
170
167
  case "callback": {
171
168
  return tUint64;
172
169
  }
@@ -277,13 +274,10 @@ const renderParamDescriptor = (
277
274
 
278
275
  return renderDescriptor(context, ref, parameter.transferOwnership, {
279
276
  ...argIndex,
280
- callerAllocated: isCallerAllocatedOut(parameter) || isRecordInout(context, parameter),
277
+ isCallerAllocated: isCallerAllocatedOut(parameter) || isRecordInout(context, parameter),
281
278
  });
282
279
  };
283
280
 
284
- // `closure=` on a callback's own parameter states which slot carries the user data, and it is what
285
- // the TypeScript signature already goes by. The name scan stays as a fallback: 88 callbacks across
286
- // the installed GIRs carry no `closure=` at all.
287
281
  const userDataIndexByName = (parameters: GirParameter[]): number | undefined => {
288
282
  let userDataIndex: number | undefined;
289
283
 
@@ -368,26 +362,41 @@ const primitiveExpression = (category: PrimitiveCategory, ownership: Ownership):
368
362
  };
369
363
 
370
364
  const renderFundamental = (descriptor: FundamentalDescriptor): string => {
371
- const { lib, refFunc, unrefFunc, typeName, ownership, wrapperClass, inline } = descriptor;
365
+ const { lib, refFunc, unrefFunc, typeName, ownership, wrapperClass, isInline } = descriptor;
372
366
 
373
367
  return tFundamental(lib, refFunc, unrefFunc, {
374
368
  ownership,
375
369
  typeName,
376
370
  wrapperClass,
377
- inline,
371
+ isInline,
378
372
  });
379
373
  };
380
374
 
381
- // GIR marks only the root of a fundamental hierarchy with `glib:fundamental` and its ref/unref pair,
382
- // so a derived type such as GtkPropertyExpression carries neither and has to inherit both.
375
+ const sunkOwnership = (
376
+ ancestor: AncestorFundamental,
377
+ ownership: Ownership,
378
+ isNewlyCreated: boolean,
379
+ ): Ownership => {
380
+ if (!isNewlyCreated || ownership !== "full" || ancestor.typeName === undefined) {
381
+ return ownership;
382
+ }
383
+
384
+ return FLOATING_FUNDAMENTALS.has(ancestor.typeName) ? "borrowed" : ownership;
385
+ };
386
+
383
387
  const classOrInterfaceExpression = (
384
388
  context: ModuleContext,
385
389
  resolved: Extract<EntityType, { kind: "class" | "interface" }>,
386
390
  ownership: Ownership,
391
+ isNewlyCreated: boolean,
387
392
  ): string => {
388
393
  const ancestor = fundamentalAncestor(context, resolved);
389
394
 
390
- return ancestor === undefined ? tObject(ownership) : renderFundamental({ ...ancestor, ownership });
395
+ if (ancestor === undefined) {
396
+ return tObject(ownership);
397
+ }
398
+
399
+ return renderFundamental({ ...ancestor, ownership: sunkOwnership(ancestor, ownership, isNewlyCreated) });
391
400
  };
392
401
 
393
402
  const isClassOrInterface = (type: GirType | undefined): type is Extract<EntityType, { kind: "class" | "interface" }> =>
@@ -479,9 +488,6 @@ const renderSelfDescriptor = (context: ModuleContext, instance: GirParameter): s
479
488
  return tObject("borrowed");
480
489
  };
481
490
 
482
- // A record expresses its acquire/release pair as `copy-function`/`free-function`: no `<record>` in
483
- // any installed GIR carries `glib:ref-func`, and GVariant's copy function really is
484
- // `g_variant_ref_sink`.
485
491
  const recordRefPair = (record: ResolvedRecord): { refFunc: string | undefined; unrefFunc: string | undefined } => ({
486
492
  refFunc: record.glibRefFunc ?? record.copyFunc,
487
493
  unrefFunc: record.glibUnrefFunc ?? record.freeFunc,
@@ -501,21 +507,22 @@ const structExpression = (
501
507
  context: ModuleContext,
502
508
  resolved: Extract<EntityType, { kind: "record" }>,
503
509
  ownership: Ownership,
504
- options: { callerAllocated: boolean; inline: boolean },
510
+ options: { isCallerAllocated: boolean; isInline: boolean },
505
511
  ): string => {
506
512
  const { size } = computeRecordFieldSlots(context, resolved.value.fields, resolved.value.isUnion);
507
513
  const wrapperClass = context.qualify(resolved.namespace.name, resolved.value.name);
514
+ const isCopyable = isValueMarshalable(context, resolved.namespace.name, resolved.value);
508
515
 
509
516
  return tStruct(ownership, {
510
- size: size > 0 ? size : undefined,
517
+ size: isCopyable && size > 0 ? size : undefined,
511
518
  wrapperClass,
512
- callerAllocated: options.callerAllocated,
513
- inline: options.inline,
519
+ isCallerAllocated: options.isCallerAllocated,
520
+ isInline: options.isInline,
514
521
  });
515
522
  };
516
523
 
517
524
  const fundamentalRecordExpression = (options: FundamentalRecordOptions): string => {
518
- const { resolved, refFunc, unrefFunc, ownership, wrapperClass, inline } = options;
525
+ const { resolved, refFunc, unrefFunc, ownership, wrapperClass, isInline } = options;
519
526
 
520
527
  return renderFundamental({
521
528
  lib: resolved.namespace.sharedLibrary ?? "",
@@ -524,7 +531,7 @@ const fundamentalRecordExpression = (options: FundamentalRecordOptions): string
524
531
  typeName: resolved.value.glibTypeName,
525
532
  ownership,
526
533
  wrapperClass,
527
- inline,
534
+ isInline,
528
535
  });
529
536
  };
530
537
 
@@ -532,11 +539,11 @@ const boxedRecordExpression = (options: {
532
539
  context: ModuleContext;
533
540
  resolved: Extract<EntityType, { kind: "record" }>;
534
541
  ownership: Ownership;
535
- callerAllocated: boolean;
536
- inline: boolean;
542
+ isCallerAllocated: boolean;
543
+ isInline: boolean;
537
544
  typeFnName: string;
538
545
  }): string => {
539
- const { context, resolved, ownership, callerAllocated, inline, typeFnName } = options;
546
+ const { context, resolved, ownership, isCallerAllocated, isInline, typeFnName } = options;
540
547
  const record = resolved.value;
541
548
  const glibName = record.glibTypeName ?? record.cType ?? record.name;
542
549
  const { size } = computeRecordFieldSlots(context, record.fields, record.isUnion);
@@ -545,8 +552,8 @@ const boxedRecordExpression = (options: {
545
552
  ownership,
546
553
  sharedLibrary: resolved.namespace.sharedLibrary,
547
554
  getTypeFnName: typeFnName,
548
- callerAllocated,
549
- inline,
555
+ isCallerAllocated,
556
+ isInline,
550
557
  size: size > 0 ? size : undefined,
551
558
  });
552
559
  };
@@ -560,8 +567,8 @@ const plainRecordExpression = (
560
567
  const record = resolved.value;
561
568
 
562
569
  const layout = {
563
- callerAllocated: placement.isCallerAllocated ?? false,
564
- inline: placement.isInline ?? false,
570
+ isCallerAllocated: placement.isCallerAllocated ?? false,
571
+ isInline: placement.isInline ?? false,
565
572
  };
566
573
 
567
574
  if (record.glibGetType === undefined) {
@@ -591,7 +598,7 @@ const recordExpression = (
591
598
  unrefFunc,
592
599
  ownership,
593
600
  wrapperClass,
594
- inline: placement.isInline ?? false,
601
+ isInline: placement.isInline ?? false,
595
602
  });
596
603
  }
597
604
 
@@ -624,11 +631,11 @@ const expressionForResolved = (
624
631
  switch (resolved.kind) {
625
632
  case "class":
626
633
  case "interface": {
627
- return classOrInterfaceExpression(context, resolved, ownership);
634
+ return classOrInterfaceExpression(context, resolved, ownership, options.isNewlyCreated ?? false);
628
635
  }
629
636
  case "record": {
630
637
  return recordExpression(context, resolved, ownership, {
631
- isCallerAllocated: options.callerAllocated ?? false,
638
+ isCallerAllocated: options.isCallerAllocated ?? false,
632
639
  isInline: options.isInline ?? false,
633
640
  });
634
641
  }
@@ -64,23 +64,23 @@ type BoxedOptions = {
64
64
  ownership: Ownership;
65
65
  sharedLibrary: string | undefined;
66
66
  getTypeFnName: string;
67
- callerAllocated: boolean;
68
- inline?: boolean;
67
+ isCallerAllocated: boolean;
68
+ isInline?: boolean;
69
69
  size: number | undefined;
70
70
  };
71
71
 
72
72
  type StructOptions = {
73
73
  size: number | string | undefined;
74
74
  wrapperClass: string | undefined;
75
- callerAllocated: boolean;
76
- inline?: boolean;
75
+ isCallerAllocated: boolean;
76
+ isInline?: boolean;
77
77
  };
78
78
 
79
79
  type FundamentalOptions = {
80
80
  ownership: Ownership;
81
81
  typeName: string | undefined;
82
82
  wrapperClass: string | undefined;
83
- inline?: boolean | undefined;
83
+ isInline?: boolean | undefined;
84
84
  };
85
85
 
86
86
  type ListDescriptorName = "list" | "slist" | "ptrArray" | "gArray";
@@ -165,8 +165,8 @@ const tBoxed = (glibName: string, options: BoxedOptions): string =>
165
165
  ? undefined
166
166
  : `sharedLibrary: ${sourceStringLiteral(options.sharedLibrary)}`,
167
167
  `getTypeFnName: ${sourceStringLiteral(options.getTypeFnName)}`,
168
- options.callerAllocated ? "callerAllocated: true" : undefined,
169
- options.inline === true ? "inline: true" : undefined,
168
+ options.isCallerAllocated ? "isCallerAllocated: true" : undefined,
169
+ options.isInline === true ? "isInline: true" : undefined,
170
170
  options.size === undefined ? undefined : `size: ${String(options.size)}`,
171
171
  ]),
172
172
  ]);
@@ -177,13 +177,13 @@ const tStruct = (ownership: Ownership, options: StructOptions): string =>
177
177
  optionsObject([
178
178
  options.size === undefined ? undefined : `size: ${String(options.size)}`,
179
179
  options.wrapperClass === undefined ? undefined : `wrapperClass: ${options.wrapperClass}`,
180
- options.callerAllocated ? "callerAllocated: true" : undefined,
181
- options.inline === true ? "inline: true" : undefined,
180
+ options.isCallerAllocated ? "isCallerAllocated: true" : undefined,
181
+ options.isInline === true ? "isInline: true" : undefined,
182
182
  ]),
183
183
  ]);
184
184
 
185
185
  const tInlineStruct = (): string =>
186
- tStruct("borrowed", { size: undefined, wrapperClass: undefined, callerAllocated: false });
186
+ tStruct("borrowed", { size: undefined, wrapperClass: undefined, isCallerAllocated: false });
187
187
 
188
188
  const tFundamental = (lib: string, refFunc: string, unrefFunc: string, options: FundamentalOptions): string =>
189
189
  call("fundamental", [
@@ -194,7 +194,7 @@ const tFundamental = (lib: string, refFunc: string, unrefFunc: string, options:
194
194
  `ownership: ${sourceStringLiteral(options.ownership)}`,
195
195
  options.typeName === undefined ? undefined : `typeName: ${sourceStringLiteral(options.typeName)}`,
196
196
  options.wrapperClass === undefined ? undefined : `wrapperClass: ${options.wrapperClass}`,
197
- options.inline === true ? "inline: true" : undefined,
197
+ options.isInline === true ? "isInline: true" : undefined,
198
198
  ]),
199
199
  ]);
200
200
 
@@ -252,9 +252,9 @@ const tBind = (args: BindArgs): string =>
252
252
  const tFn = (
253
253
  lib: string,
254
254
  cIdentifier: string,
255
- spec: { args: string; returns: string; throws: boolean },
255
+ spec: { args: string; returns: string; canThrow: boolean },
256
256
  ): string => {
257
- const throwsEntry = spec.throws ? ", throws: true" : "";
257
+ const throwsEntry = spec.canThrow ? ", canThrow: true" : "";
258
258
 
259
259
  return call("fn", [
260
260
  sourceStringLiteral(lib),
@@ -14,8 +14,8 @@ type HandlerResultOptions = {
14
14
  library: Library;
15
15
  signal: GirCallable;
16
16
  renderType: (ref: TypeId | undefined, isNullable: boolean) => string;
17
- includeCallerAllocated: boolean;
18
- optOut: boolean;
17
+ shouldIncludeCallerAllocated: boolean;
18
+ isOptOut: boolean;
19
19
  };
20
20
 
21
21
  const isInputParameter = (options: {
@@ -75,8 +75,6 @@ const closureAndDestroyIndices = (fn: GirFunction): Set<number> => {
75
75
  return indices;
76
76
  };
77
77
 
78
- // The emitted argument list is the instance parameter followed by every parameter `planParameter`
79
- // keeps, so a GIR index only lines up with an emitted index when nothing before it was dropped.
80
78
  const emittedArgIndices = (fn: GirFunction, instanceOffset: number): Map<number, number> => {
81
79
  const closureIndices = closureAndDestroyIndices(fn);
82
80
  const map: Map<number, number> = new Map();
@@ -199,9 +197,9 @@ const foldOutParamShape = (primary: string | undefined, outTypes: string[]): str
199
197
  const isHandlerOutParameter = (options: {
200
198
  library: Library;
201
199
  parameter: GirParameter;
202
- includeCallerAllocated: boolean;
200
+ shouldIncludeCallerAllocated: boolean;
203
201
  }): boolean => {
204
- const { library, parameter, includeCallerAllocated } = options;
202
+ const { library, parameter, shouldIncludeCallerAllocated } = options;
205
203
 
206
204
  if (parameter.isVarargs) {
207
205
  return false;
@@ -215,7 +213,7 @@ const isHandlerOutParameter = (options: {
215
213
  return true;
216
214
  }
217
215
 
218
- return includeCallerAllocated && isCallerAllocatedOut(parameter);
216
+ return shouldIncludeCallerAllocated && isCallerAllocatedOut(parameter);
219
217
  };
220
218
 
221
219
  const scalarResultType = (primary: string | undefined, isOptOut: boolean): string => {
@@ -227,18 +225,18 @@ const scalarResultType = (primary: string | undefined, isOptOut: boolean): strin
227
225
  };
228
226
 
229
227
  const renderHandlerResultType = (options: HandlerResultOptions): string => {
230
- const { library, signal, renderType, includeCallerAllocated, optOut } = options;
228
+ const { library, signal, renderType, shouldIncludeCallerAllocated, isOptOut } = options;
231
229
 
232
230
  const primary = shouldOmitPrimaryReturn(library, signal.returnValue)
233
231
  ? undefined
234
232
  : renderType(signal.returnValue.type, signal.returnValue.nullable);
235
233
 
236
234
  const outTypes = signal.parameters
237
- .filter((parameter) => isHandlerOutParameter({ library, parameter, includeCallerAllocated }))
235
+ .filter((parameter) => isHandlerOutParameter({ library, parameter, shouldIncludeCallerAllocated }))
238
236
  .map((parameter) => renderType(parameter.type, parameter.nullable));
239
237
 
240
238
  if (outTypes.length === 0) {
241
- return scalarResultType(primary, optOut);
239
+ return scalarResultType(primary, isOptOut);
242
240
  }
243
241
 
244
242
  return foldOutParamShape(primary, outTypes);
@@ -9,7 +9,6 @@ import {
9
9
  type ListType,
10
10
  type TypeId,
11
11
  } from "../gir/type-id.js";
12
- import { isClassStructRecord } from "../store/gi/class-struct-record.js";
13
12
  import { gtypeTsType } from "../store/gi/gtype-binding.js";
14
13
 
15
14
  type ReferenceName = {
@@ -20,23 +19,18 @@ type ReferenceName = {
20
19
  type TsTypeTarget = {
21
20
  containerStyle: "map" | "record";
22
21
  callbackType: string;
23
- byteArrayAsNumber: boolean;
22
+ shouldRenderByteArrayAsNumber: boolean;
24
23
  renderNamed: (resolved: GirType | undefined, name: ReferenceName) => string;
25
24
  renderGtype: () => string;
26
25
  };
27
26
 
28
- const willEmitEntity = (library: Library, type: EntityType): boolean => {
27
+ const willEmitEntity = (type: EntityType): boolean => {
29
28
  switch (type.kind) {
30
29
  case "callback": {
31
30
  return type.value.introspectable && type.value.name.length > 0;
32
31
  }
33
32
  case "record": {
34
- return (
35
- type.value.introspectable &&
36
- !type.value.isVtable &&
37
- type.value.name.length > 0 &&
38
- !isClassStructRecord(library, type.namespace.name, type.value)
39
- );
33
+ return type.value.introspectable && type.value.name.length > 0;
40
34
  }
41
35
  case "alias":
42
36
  case "class":
@@ -51,11 +45,10 @@ const renderPrimitiveType = (target: TsTypeTarget, type: Extract<GirType, { kind
51
45
  type.category === "gtype" ? target.renderGtype() : PRIMITIVE_TS_TYPE[type.category];
52
46
 
53
47
  const renderEntityType = (
54
- library: Library,
55
48
  target: TsTypeTarget,
56
49
  type: EntityType,
57
50
  name: ReferenceName | undefined,
58
- ): string => renderNamedType(target, type, willEmitEntity(library, type) ? name : undefined);
51
+ ): string => renderNamedType(target, type, willEmitEntity(type) ? name : undefined);
59
52
 
60
53
  const renderBaseType = (library: Library, target: TsTypeTarget, ref: TypeId | undefined): string => {
61
54
  if (ref === undefined) {
@@ -82,7 +75,7 @@ const renderBaseType = (library: Library, target: TsTypeTarget, ref: TypeId | un
82
75
  case "record":
83
76
  case "enum":
84
77
  case "alias": {
85
- return renderEntityType(library, target, type, name);
78
+ return renderEntityType(target, type, name);
86
79
  }
87
80
  case "carray":
88
81
  case "list":
@@ -107,10 +100,8 @@ const renderContainerType = (
107
100
  return renderSequenceType(library, target, type);
108
101
  };
109
102
 
110
- // An array whose length nothing states decodes as the bare pointer it is, so its TypeScript type has
111
- // to say so too rather than promising elements nothing can count.
112
103
  const renderSequenceType = (library: Library, target: TsTypeTarget, type: CArrayType | ListType): string => {
113
- if (type.kind === "list" && type.flavor === "gbytearray" && target.byteArrayAsNumber) {
104
+ if (type.kind === "list" && type.flavor === "gbytearray" && target.shouldRenderByteArrayAsNumber) {
114
105
  return "number[]";
115
106
  }
116
107
 
@@ -136,7 +127,7 @@ const renderNamedType = (
136
127
  const moduleTarget = (context: ModuleContext): TsTypeTarget => ({
137
128
  containerStyle: "map",
138
129
  callbackType: "((...args: any[]) => any)",
139
- byteArrayAsNumber: true,
130
+ shouldRenderByteArrayAsNumber: true,
140
131
  renderNamed: (_resolved, name) => context.qualify(name.namespaceName, name.typeName),
141
132
  renderGtype: () => gtypeTsType(context),
142
133
  });
@@ -155,7 +146,7 @@ const recordTypeTarget = (
155
146
  const target: TsTypeTarget = {
156
147
  containerStyle: "record",
157
148
  callbackType: "((...args: unknown[]) => unknown)",
158
- byteArrayAsNumber: false,
149
+ shouldRenderByteArrayAsNumber: false,
159
150
  renderNamed: (resolved, name) => {
160
151
  if (resolved?.kind === "alias") {
161
152
  return resolved.value.target === undefined
package/src/compile.ts CHANGED
@@ -29,8 +29,10 @@ const BASE_COMPILER_OPTIONS = {
29
29
  noImplicitReturns: true,
30
30
  noFallthroughCasesInSwitch: true,
31
31
  allowUnreachableCode: false,
32
+ allowImportingTsExtensions: true,
32
33
  forceConsistentCasingInFileNames: true,
33
34
  resolveJsonModule: true,
35
+ rewriteRelativeImportExtensions: true,
34
36
  skipLibCheck: true,
35
37
  types: ["node"],
36
38
  };
@@ -47,7 +49,6 @@ const FORMAT_HOST: ts.FormatDiagnosticsHost = {
47
49
  getNewLine: () => "\n",
48
50
  };
49
51
 
50
- /** `@gtkx/codegen`'s own `node_modules`, which has `@types/node` plus the `@gtkx/*` deps the store typecheck needs. */
51
52
  const codegenModules = (): string => {
52
53
  const sourceDir = dirname(fileURLToPath(import.meta.url));
53
54