@gtkx/codegen 1.0.0-rc.1 → 1.0.0-rc.2
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.
- package/dist/analysis/descriptor-render.d.ts +18 -11
- package/dist/analysis/descriptor-render.d.ts.map +1 -1
- package/dist/analysis/descriptor-render.js +275 -152
- package/dist/analysis/descriptor-render.js.map +1 -1
- package/dist/analysis/descriptor.d.ts +37 -34
- package/dist/analysis/descriptor.d.ts.map +1 -1
- package/dist/analysis/descriptor.js +34 -30
- package/dist/analysis/descriptor.js.map +1 -1
- package/dist/analysis/inheritance.d.ts +16 -16
- package/dist/analysis/inheritance.d.ts.map +1 -1
- package/dist/analysis/inheritance.js +139 -84
- package/dist/analysis/inheritance.js.map +1 -1
- package/dist/analysis/param-structure.d.ts +14 -13
- package/dist/analysis/param-structure.d.ts.map +1 -1
- package/dist/analysis/param-structure.js +104 -53
- package/dist/analysis/param-structure.js.map +1 -1
- package/dist/analysis/ts-type.d.ts +6 -5
- package/dist/analysis/ts-type.d.ts.map +1 -1
- package/dist/analysis/ts-type.js +69 -23
- package/dist/analysis/ts-type.js.map +1 -1
- package/dist/compile.d.ts +5 -5
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +70 -63
- package/dist/compile.js.map +1 -1
- package/dist/docs/api-reference.d.ts +12 -11
- package/dist/docs/api-reference.d.ts.map +1 -1
- package/dist/docs/api-reference.js +194 -121
- package/dist/docs/api-reference.js.map +1 -1
- package/dist/docs/element-page.d.ts +6 -9
- package/dist/docs/element-page.d.ts.map +1 -1
- package/dist/docs/element-page.js +68 -133
- package/dist/docs/element-page.js.map +1 -1
- package/dist/docs/pipeline.d.ts +8 -7
- package/dist/docs/pipeline.d.ts.map +1 -1
- package/dist/docs/pipeline.js +79 -53
- package/dist/docs/pipeline.js.map +1 -1
- package/dist/docs/render.d.ts +21 -19
- package/dist/docs/render.d.ts.map +1 -1
- package/dist/docs/render.js +80 -71
- package/dist/docs/render.js.map +1 -1
- package/dist/docs/symbol-page.d.ts +6 -6
- package/dist/docs/symbol-page.d.ts.map +1 -1
- package/dist/docs/symbol-page.js +126 -84
- package/dist/docs/symbol-page.js.map +1 -1
- package/dist/fingerprint.d.ts +28 -5
- package/dist/fingerprint.d.ts.map +1 -1
- package/dist/fingerprint.js +66 -13
- package/dist/fingerprint.js.map +1 -1
- package/dist/gi.d.ts +13 -0
- package/dist/gi.d.ts.map +1 -0
- package/dist/gi.js +21 -0
- package/dist/gi.js.map +1 -0
- package/dist/gir/ancestry.d.ts +4 -3
- package/dist/gir/ancestry.d.ts.map +1 -1
- package/dist/gir/ancestry.js +12 -15
- package/dist/gir/ancestry.js.map +1 -1
- package/dist/gir/callback.d.ts +6 -11
- package/dist/gir/callback.d.ts.map +1 -1
- package/dist/gir/callback.js +6 -7
- package/dist/gir/callback.js.map +1 -1
- package/dist/gir/class.d.ts +7 -5
- package/dist/gir/class.d.ts.map +1 -1
- package/dist/gir/class.js +14 -12
- package/dist/gir/class.js.map +1 -1
- package/dist/gir/enum.d.ts +3 -3
- package/dist/gir/enum.d.ts.map +1 -1
- package/dist/gir/enum.js +7 -6
- package/dist/gir/enum.js.map +1 -1
- package/dist/gir/field.d.ts +8 -3
- package/dist/gir/field.d.ts.map +1 -1
- package/dist/gir/field.js +30 -7
- package/dist/gir/field.js.map +1 -1
- package/dist/gir/function.d.ts +6 -3
- package/dist/gir/function.d.ts.map +1 -1
- package/dist/gir/function.js +23 -7
- package/dist/gir/function.js.map +1 -1
- package/dist/gir/gir-path.d.ts +2 -1
- package/dist/gir/gir-path.d.ts.map +1 -1
- package/dist/gir/gir-path.js +26 -10
- package/dist/gir/gir-path.js.map +1 -1
- package/dist/gir/libraries.d.ts +3 -2
- package/dist/gir/libraries.d.ts.map +1 -1
- package/dist/gir/libraries.js +39 -27
- package/dist/gir/libraries.js.map +1 -1
- package/dist/gir/library.d.ts +17 -11
- package/dist/gir/library.d.ts.map +1 -1
- package/dist/gir/library.js +116 -92
- package/dist/gir/library.js.map +1 -1
- package/dist/gir/namespace.d.ts +10 -10
- package/dist/gir/namespace.d.ts.map +1 -1
- package/dist/gir/namespace.js +21 -20
- package/dist/gir/namespace.js.map +1 -1
- package/dist/gir/nullable-overrides.d.ts +3 -0
- package/dist/gir/nullable-overrides.d.ts.map +1 -0
- package/dist/gir/nullable-overrides.js +5 -0
- package/dist/gir/nullable-overrides.js.map +1 -0
- package/dist/gir/parameter.d.ts +14 -12
- package/dist/gir/parameter.d.ts.map +1 -1
- package/dist/gir/parameter.js +27 -18
- package/dist/gir/parameter.js.map +1 -1
- package/dist/gir/parse.d.ts +12 -13
- package/dist/gir/parse.d.ts.map +1 -1
- package/dist/gir/parse.js +50 -40
- package/dist/gir/parse.js.map +1 -1
- package/dist/gir/primitives.d.ts +5 -4
- package/dist/gir/primitives.d.ts.map +1 -1
- package/dist/gir/primitives.js +4 -3
- package/dist/gir/primitives.js.map +1 -1
- package/dist/gir/property.d.ts +5 -4
- package/dist/gir/property.d.ts.map +1 -1
- package/dist/gir/property.js +10 -9
- package/dist/gir/property.js.map +1 -1
- package/dist/gir/record.d.ts +5 -4
- package/dist/gir/record.d.ts.map +1 -1
- package/dist/gir/record.js +13 -12
- package/dist/gir/record.js.map +1 -1
- package/dist/gir/size.d.ts +6 -5
- package/dist/gir/size.d.ts.map +1 -1
- package/dist/gir/size.js +49 -47
- package/dist/gir/size.js.map +1 -1
- package/dist/gir/type-id.d.ts +17 -15
- package/dist/gir/type-id.d.ts.map +1 -1
- package/dist/gir/type-id.js +5 -1
- package/dist/gir/type-id.js.map +1 -1
- package/dist/gir/type-ref.d.ts +3 -2
- package/dist/gir/type-ref.d.ts.map +1 -1
- package/dist/gir/type-ref.js +36 -25
- package/dist/gir/type-ref.js.map +1 -1
- package/dist/gir/type.d.ts +3 -2
- package/dist/gir/type.d.ts.map +1 -1
- package/dist/gir/type.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/jsx.d.ts +26 -0
- package/dist/jsx.d.ts.map +1 -0
- package/dist/jsx.js +40 -0
- package/dist/jsx.js.map +1 -0
- package/dist/khronos/args.d.ts +7 -7
- package/dist/khronos/args.d.ts.map +1 -1
- package/dist/khronos/args.js +88 -67
- package/dist/khronos/args.js.map +1 -1
- package/dist/khronos/jsdoc.d.ts +4 -4
- package/dist/khronos/jsdoc.d.ts.map +1 -1
- package/dist/khronos/jsdoc.js +29 -16
- package/dist/khronos/jsdoc.js.map +1 -1
- package/dist/khronos/model.d.ts +8 -7
- package/dist/khronos/model.d.ts.map +1 -1
- package/dist/khronos/model.js +94 -59
- package/dist/khronos/model.js.map +1 -1
- package/dist/khronos/modules.d.ts +4 -3
- package/dist/khronos/modules.d.ts.map +1 -1
- package/dist/khronos/modules.js +40 -25
- package/dist/khronos/modules.js.map +1 -1
- package/dist/khronos/param-pair.d.ts +11 -0
- package/dist/khronos/param-pair.d.ts.map +1 -0
- package/dist/khronos/param-pair.js +6 -0
- package/dist/khronos/param-pair.js.map +1 -0
- package/dist/khronos/parse.d.ts +7 -8
- package/dist/khronos/parse.d.ts.map +1 -1
- package/dist/khronos/parse.js +17 -16
- package/dist/khronos/parse.js.map +1 -1
- package/dist/khronos/pipeline.d.ts +4 -4
- package/dist/khronos/pipeline.d.ts.map +1 -1
- package/dist/khronos/pipeline.js +97 -56
- package/dist/khronos/pipeline.js.map +1 -1
- package/dist/khronos/plan.d.ts +11 -10
- package/dist/khronos/plan.d.ts.map +1 -1
- package/dist/khronos/plan.js +109 -45
- package/dist/khronos/plan.js.map +1 -1
- package/dist/khronos/render.d.ts +5 -4
- package/dist/khronos/render.d.ts.map +1 -1
- package/dist/khronos/render.js +106 -59
- package/dist/khronos/render.js.map +1 -1
- package/dist/khronos/select.d.ts +4 -4
- package/dist/khronos/select.d.ts.map +1 -1
- package/dist/khronos/select.js +30 -19
- package/dist/khronos/select.js.map +1 -1
- package/dist/react/element-config.d.ts +17 -0
- package/dist/react/element-config.d.ts.map +1 -0
- package/dist/react/element-config.js +61 -0
- package/dist/react/element-config.js.map +1 -0
- package/dist/runner.d.ts +17 -10
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +45 -43
- package/dist/runner.js.map +1 -1
- package/dist/store/compile-store.d.ts +5 -3
- package/dist/store/compile-store.d.ts.map +1 -1
- package/dist/store/compile-store.js +24 -22
- package/dist/store/compile-store.js.map +1 -1
- package/dist/store/gi/async.d.ts +2 -1
- package/dist/store/gi/async.d.ts.map +1 -1
- package/dist/store/gi/async.js +28 -24
- package/dist/store/gi/async.js.map +1 -1
- package/dist/store/gi/callables.d.ts +26 -20
- package/dist/store/gi/callables.d.ts.map +1 -1
- package/dist/store/gi/callables.js +162 -100
- package/dist/store/gi/callables.js.map +1 -1
- package/dist/store/gi/callback.d.ts +3 -2
- package/dist/store/gi/callback.d.ts.map +1 -1
- package/dist/store/gi/callback.js +6 -3
- package/dist/store/gi/callback.js.map +1 -1
- package/dist/store/gi/class-struct-record.d.ts +4 -3
- package/dist/store/gi/class-struct-record.d.ts.map +1 -1
- package/dist/store/gi/class-struct-record.js +33 -15
- package/dist/store/gi/class-struct-record.js.map +1 -1
- package/dist/store/gi/class.d.ts +2 -1
- package/dist/store/gi/class.d.ts.map +1 -1
- package/dist/store/gi/class.js +86 -47
- package/dist/store/gi/class.js.map +1 -1
- package/dist/store/gi/companion.d.ts +2 -1
- package/dist/store/gi/companion.d.ts.map +1 -1
- package/dist/store/gi/companion.js +8 -5
- package/dist/store/gi/companion.js.map +1 -1
- package/dist/store/gi/constant.d.ts +3 -2
- package/dist/store/gi/constant.d.ts.map +1 -1
- package/dist/store/gi/constant.js +25 -8
- package/dist/store/gi/constant.js.map +1 -1
- package/dist/store/gi/constructor-props.d.ts +3 -2
- package/dist/store/gi/constructor-props.d.ts.map +1 -1
- package/dist/store/gi/constructor-props.js +17 -10
- package/dist/store/gi/constructor-props.js.map +1 -1
- package/dist/store/gi/enum.d.ts +3 -2
- package/dist/store/gi/enum.d.ts.map +1 -1
- package/dist/store/gi/enum.js +14 -11
- package/dist/store/gi/enum.js.map +1 -1
- package/dist/store/gi/function.d.ts +5 -4
- package/dist/store/gi/function.d.ts.map +1 -1
- package/dist/store/gi/function.js +50 -23
- package/dist/store/gi/function.js.map +1 -1
- package/dist/store/gi/gtype-binding.d.ts +4 -4
- package/dist/store/gi/gtype-binding.d.ts.map +1 -1
- package/dist/store/gi/gtype-binding.js +15 -11
- package/dist/store/gi/gtype-binding.js.map +1 -1
- package/dist/store/gi/interface.d.ts +2 -1
- package/dist/store/gi/interface.d.ts.map +1 -1
- package/dist/store/gi/interface.js +36 -18
- package/dist/store/gi/interface.js.map +1 -1
- package/dist/store/gi/item-comparators.d.ts +3 -2
- package/dist/store/gi/item-comparators.d.ts.map +1 -1
- package/dist/store/gi/item-comparators.js +33 -21
- package/dist/store/gi/item-comparators.js.map +1 -1
- package/dist/store/gi/method.d.ts +13 -13
- package/dist/store/gi/method.d.ts.map +1 -1
- package/dist/store/gi/method.js +187 -130
- package/dist/store/gi/method.js.map +1 -1
- package/dist/store/gi/param-marshal.d.ts +7 -6
- package/dist/store/gi/param-marshal.d.ts.map +1 -1
- package/dist/store/gi/param-marshal.js +26 -13
- package/dist/store/gi/param-marshal.js.map +1 -1
- package/dist/store/gi/pipeline.d.ts +2 -1
- package/dist/store/gi/pipeline.d.ts.map +1 -1
- package/dist/store/gi/pipeline.js +38 -23
- package/dist/store/gi/pipeline.js.map +1 -1
- package/dist/store/gi/properties.d.ts +2 -1
- package/dist/store/gi/properties.d.ts.map +1 -1
- package/dist/store/gi/properties.js +6 -4
- package/dist/store/gi/properties.js.map +1 -1
- package/dist/store/gi/property-accessor.d.ts +11 -10
- package/dist/store/gi/property-accessor.d.ts.map +1 -1
- package/dist/store/gi/property-accessor.js +86 -60
- package/dist/store/gi/property-accessor.js.map +1 -1
- package/dist/store/gi/record-constructor.d.ts +3 -2
- package/dist/store/gi/record-constructor.d.ts.map +1 -1
- package/dist/store/gi/record-constructor.js +36 -25
- package/dist/store/gi/record-constructor.js.map +1 -1
- package/dist/store/gi/record-field-accessor.d.ts +8 -8
- package/dist/store/gi/record-field-accessor.d.ts.map +1 -1
- package/dist/store/gi/record-field-accessor.js +171 -99
- package/dist/store/gi/record-field-accessor.js.map +1 -1
- package/dist/store/gi/record-layout.d.ts +6 -5
- package/dist/store/gi/record-layout.d.ts.map +1 -1
- package/dist/store/gi/record-layout.js +75 -39
- package/dist/store/gi/record-layout.js.map +1 -1
- package/dist/store/gi/record.d.ts +2 -1
- package/dist/store/gi/record.d.ts.map +1 -1
- package/dist/store/gi/record.js +19 -13
- package/dist/store/gi/record.js.map +1 -1
- package/dist/store/gi/registration.d.ts +3 -3
- package/dist/store/gi/registration.d.ts.map +1 -1
- package/dist/store/gi/registration.js +3 -2
- package/dist/store/gi/registration.js.map +1 -1
- package/dist/store/gi/return-wrap.d.ts +2 -2
- package/dist/store/gi/return-wrap.d.ts.map +1 -1
- package/dist/store/gi/return-wrap.js +43 -22
- package/dist/store/gi/return-wrap.js.map +1 -1
- package/dist/store/gi/runtime-override.d.ts +2 -1
- package/dist/store/gi/runtime-override.d.ts.map +1 -1
- package/dist/store/gi/runtime-override.js +6 -3
- package/dist/store/gi/runtime-override.js.map +1 -1
- package/dist/store/gi/signal.d.ts +3 -2
- package/dist/store/gi/signal.d.ts.map +1 -1
- package/dist/store/gi/signal.js +113 -66
- package/dist/store/gi/signal.js.map +1 -1
- package/dist/store/gi/vtable.d.ts +2 -1
- package/dist/store/gi/vtable.d.ts.map +1 -1
- package/dist/store/gi/vtable.js +60 -30
- package/dist/store/gi/vtable.js.map +1 -1
- package/dist/store/gi-store.d.ts +5 -4
- package/dist/store/gi-store.d.ts.map +1 -1
- package/dist/store/gi-store.js +4 -2
- package/dist/store/gi-store.js.map +1 -1
- package/dist/store/jsx/element-components.d.ts +23 -0
- package/dist/store/jsx/element-components.d.ts.map +1 -0
- package/dist/store/jsx/element-components.js +86 -0
- package/dist/store/jsx/element-components.js.map +1 -0
- package/dist/store/jsx/element-prop-imports.d.ts +17 -0
- package/dist/store/jsx/element-prop-imports.d.ts.map +1 -0
- package/dist/store/jsx/element-prop-imports.js +15 -0
- package/dist/store/jsx/element-prop-imports.js.map +1 -0
- package/dist/store/jsx/element-prop-types.d.ts +10 -0
- package/dist/store/jsx/element-prop-types.d.ts.map +1 -0
- package/dist/store/jsx/element-prop-types.js +41 -0
- package/dist/store/jsx/element-prop-types.js.map +1 -0
- package/dist/store/jsx/gir-index.d.ts +16 -0
- package/dist/store/jsx/gir-index.d.ts.map +1 -0
- package/dist/store/jsx/gir-index.js +33 -0
- package/dist/store/jsx/gir-index.js.map +1 -0
- package/dist/store/jsx/intrinsic-elements.d.ts +27 -0
- package/dist/store/jsx/intrinsic-elements.d.ts.map +1 -0
- package/dist/store/jsx/intrinsic-elements.js +128 -0
- package/dist/store/jsx/intrinsic-elements.js.map +1 -0
- package/dist/store/{react → jsx}/jsx.d.ts +2 -4
- package/dist/store/jsx/jsx.d.ts.map +1 -0
- package/dist/store/{react → jsx}/jsx.js +110 -71
- package/dist/store/jsx/jsx.js.map +1 -0
- package/dist/store/jsx/metadata.d.ts +4 -0
- package/dist/store/jsx/metadata.d.ts.map +1 -0
- package/dist/store/{react → jsx}/metadata.js +148 -69
- package/dist/store/jsx/metadata.js.map +1 -0
- package/dist/store/jsx/pipeline.d.ts +21 -0
- package/dist/store/jsx/pipeline.d.ts.map +1 -0
- package/dist/store/{react → jsx}/pipeline.js +36 -15
- package/dist/store/jsx/pipeline.js.map +1 -0
- package/dist/store/{react → jsx}/props.d.ts +9 -12
- package/dist/store/jsx/props.d.ts.map +1 -0
- package/dist/store/jsx/props.js +158 -0
- package/dist/store/jsx/props.js.map +1 -0
- package/dist/store/jsx-store.d.ts +5 -3
- package/dist/store/jsx-store.d.ts.map +1 -1
- package/dist/store/jsx-store.js +4 -1
- package/dist/store/jsx-store.js.map +1 -1
- package/dist/store/store-fs.d.ts +14 -12
- package/dist/store/store-fs.d.ts.map +1 -1
- package/dist/store/store-fs.js +9 -7
- package/dist/store/store-fs.js.map +1 -1
- package/dist/writer/context.d.ts +2 -1
- package/dist/writer/context.d.ts.map +1 -1
- package/dist/writer/context.js +12 -6
- package/dist/writer/context.js.map +1 -1
- package/dist/writer/doc.d.ts +2 -1
- package/dist/writer/doc.d.ts.map +1 -1
- package/dist/writer/doc.js +13 -7
- package/dist/writer/doc.js.map +1 -1
- package/dist/writer/emit.d.ts +8 -7
- package/dist/writer/emit.d.ts.map +1 -1
- package/dist/writer/emit.js +13 -10
- package/dist/writer/emit.js.map +1 -1
- package/dist/writer/gtk-doc.d.ts +2 -1
- package/dist/writer/gtk-doc.d.ts.map +1 -1
- package/dist/writer/gtk-doc.js +29 -18
- package/dist/writer/gtk-doc.js.map +1 -1
- package/dist/writer/imports.d.ts +4 -2
- package/dist/writer/imports.d.ts.map +1 -1
- package/dist/writer/imports.js +35 -24
- package/dist/writer/imports.js.map +1 -1
- package/dist/writer/module.d.ts +3 -2
- package/dist/writer/module.d.ts.map +1 -1
- package/dist/writer/module.js +16 -9
- package/dist/writer/module.js.map +1 -1
- package/dist/xml.d.ts +4 -0
- package/dist/xml.d.ts.map +1 -0
- package/dist/xml.js +10 -0
- package/dist/xml.js.map +1 -0
- package/overrides/cairo/context.ts.ejs +7 -7
- package/overrides/cairo/matrix.ts.ejs +2 -2
- package/overrides/cairo/recording-surface.ts.ejs +2 -2
- package/overrides/cairo/region.ts.ejs +1 -1
- package/overrides/cairo/scaled-font.ts.ejs +3 -3
- package/package.json +15 -9
- package/src/analysis/descriptor-render.ts +484 -168
- package/src/analysis/descriptor.ts +162 -125
- package/src/analysis/inheritance.ts +286 -98
- package/src/analysis/param-structure.ts +188 -57
- package/src/analysis/ts-type.ts +112 -26
- package/src/compile.ts +103 -76
- package/src/docs/api-reference.ts +340 -144
- package/src/docs/element-page.ts +137 -146
- package/src/docs/pipeline.ts +132 -73
- package/src/docs/render.ts +151 -87
- package/src/docs/symbol-page.ts +268 -123
- package/src/fingerprint.ts +127 -29
- package/src/gi.ts +26 -0
- package/src/gir/ancestry.ts +26 -14
- package/src/gir/callback.ts +10 -15
- package/src/gir/class.ts +20 -16
- package/src/gir/enum.ts +9 -7
- package/src/gir/field.ts +37 -8
- package/src/gir/function.ts +33 -9
- package/src/gir/gir-path.ts +36 -12
- package/src/gir/libraries.ts +56 -31
- package/src/gir/library.ts +200 -97
- package/src/gir/namespace.ts +42 -26
- package/src/gir/nullable-overrides.ts +5 -0
- package/src/gir/parameter.ts +80 -42
- package/src/gir/parse.ts +102 -47
- package/src/gir/primitives.ts +25 -23
- package/src/gir/property.ts +13 -11
- package/src/gir/record.ts +16 -14
- package/src/gir/size.ts +91 -58
- package/src/gir/type-id.ts +33 -18
- package/src/gir/type-ref.ts +62 -26
- package/src/gir/type.ts +10 -8
- package/src/index.ts +7 -0
- package/src/jsx.ts +70 -0
- package/src/khronos/args.ts +158 -89
- package/src/khronos/jsdoc.ts +67 -29
- package/src/khronos/model.ts +154 -53
- package/src/khronos/modules.ts +67 -27
- package/src/khronos/param-pair.ts +14 -0
- package/src/khronos/parse.ts +37 -17
- package/src/khronos/pipeline.ts +193 -90
- package/src/khronos/plan.ts +235 -86
- package/src/khronos/render.ts +208 -71
- package/src/khronos/select.ts +48 -18
- package/src/react/element-config.ts +91 -0
- package/src/runner.ts +93 -57
- package/src/store/compile-store.ts +32 -26
- package/src/store/gi/async.ts +48 -21
- package/src/store/gi/callables.ts +345 -136
- package/src/store/gi/callback.ts +13 -4
- package/src/store/gi/class-struct-record.ts +49 -17
- package/src/store/gi/class.ts +186 -64
- package/src/store/gi/companion.ts +15 -6
- package/src/store/gi/constant.ts +42 -8
- package/src/store/gi/constructor-props.ts +42 -16
- package/src/store/gi/enum.ts +28 -13
- package/src/store/gi/function.ts +90 -24
- package/src/store/gi/gtype-binding.ts +31 -18
- package/src/store/gi/interface.ts +101 -36
- package/src/store/gi/item-comparators.ts +74 -26
- package/src/store/gi/method.ts +376 -159
- package/src/store/gi/param-marshal.ts +38 -15
- package/src/store/gi/pipeline.ts +72 -22
- package/src/store/gi/properties.ts +16 -5
- package/src/store/gi/property-accessor.ts +192 -84
- package/src/store/gi/record-constructor.ts +62 -30
- package/src/store/gi/record-field-accessor.ts +380 -167
- package/src/store/gi/record-layout.ts +130 -43
- package/src/store/gi/record.ts +37 -14
- package/src/store/gi/registration.ts +15 -9
- package/src/store/gi/return-wrap.ts +71 -23
- package/src/store/gi/runtime-override.ts +13 -3
- package/src/store/gi/signal.ts +244 -104
- package/src/store/gi/vtable.ts +117 -41
- package/src/store/gi-store.ts +26 -13
- package/src/store/jsx/element-components.ts +152 -0
- package/src/store/jsx/element-prop-imports.ts +24 -0
- package/src/store/jsx/element-prop-types.ts +59 -0
- package/src/store/jsx/gir-index.ts +62 -0
- package/src/store/jsx/intrinsic-elements.ts +262 -0
- package/src/store/{react → jsx}/jsx.ts +213 -99
- package/src/store/jsx/metadata.ts +385 -0
- package/src/store/jsx/pipeline.ts +145 -0
- package/src/store/jsx/props.ts +274 -0
- package/src/store/jsx-store.ts +15 -3
- package/src/store/store-fs.ts +36 -20
- package/src/writer/context.ts +25 -6
- package/src/writer/doc.ts +19 -5
- package/src/writer/emit.ts +20 -11
- package/src/writer/gtk-doc.ts +48 -21
- package/src/writer/imports.ts +63 -28
- package/src/writer/module.ts +35 -11
- package/src/xml.ts +12 -0
- package/dist/store/react/built-ins.d.ts +0 -9
- package/dist/store/react/built-ins.d.ts.map +0 -1
- package/dist/store/react/built-ins.js +0 -226
- package/dist/store/react/built-ins.js.map +0 -1
- package/dist/store/react/element-components.d.ts +0 -15
- package/dist/store/react/element-components.d.ts.map +0 -1
- package/dist/store/react/element-components.js +0 -92
- package/dist/store/react/element-components.js.map +0 -1
- package/dist/store/react/element-prop-types.d.ts +0 -19
- package/dist/store/react/element-prop-types.d.ts.map +0 -1
- package/dist/store/react/element-prop-types.js +0 -244
- package/dist/store/react/element-prop-types.js.map +0 -1
- package/dist/store/react/element-props.d.ts +0 -4
- package/dist/store/react/element-props.d.ts.map +0 -1
- package/dist/store/react/element-props.js +0 -178
- package/dist/store/react/element-props.js.map +0 -1
- package/dist/store/react/gir-index.d.ts +0 -25
- package/dist/store/react/gir-index.d.ts.map +0 -1
- package/dist/store/react/gir-index.js +0 -55
- package/dist/store/react/gir-index.js.map +0 -1
- package/dist/store/react/intrinsic-elements.d.ts +0 -26
- package/dist/store/react/intrinsic-elements.d.ts.map +0 -1
- package/dist/store/react/intrinsic-elements.js +0 -107
- package/dist/store/react/intrinsic-elements.js.map +0 -1
- package/dist/store/react/jsx.d.ts.map +0 -1
- package/dist/store/react/jsx.js.map +0 -1
- package/dist/store/react/metadata.d.ts +0 -4
- package/dist/store/react/metadata.d.ts.map +0 -1
- package/dist/store/react/metadata.js.map +0 -1
- package/dist/store/react/pipeline.d.ts +0 -14
- package/dist/store/react/pipeline.d.ts.map +0 -1
- package/dist/store/react/pipeline.js.map +0 -1
- package/dist/store/react/props.d.ts.map +0 -1
- package/dist/store/react/props.js +0 -133
- package/dist/store/react/props.js.map +0 -1
- package/overrides/gtk/constants.ts.ejs +0 -3
- package/overrides/gtk/index.ts.ejs +0 -2
- package/src/store/react/built-ins.ts +0 -260
- package/src/store/react/element-components.ts +0 -138
- package/src/store/react/element-prop-types.ts +0 -280
- package/src/store/react/element-props.ts +0 -204
- package/src/store/react/gir-index.ts +0 -85
- package/src/store/react/intrinsic-elements.ts +0 -161
- package/src/store/react/metadata.ts +0 -197
- package/src/store/react/pipeline.ts +0 -90
- package/src/store/react/props.ts +0 -197
package/dist/compile.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { execFileSync } from "node:child_process";
|
|
2
1
|
import { existsSync, mkdirSync, mkdtempSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
2
|
+
import { dirname, isAbsolute, join, relative } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import ts from "typescript";
|
|
6
5
|
const BASE_COMPILER_OPTIONS = {
|
|
7
6
|
module: "esnext",
|
|
8
7
|
moduleResolution: "bundler",
|
|
@@ -22,84 +21,91 @@ const BASE_COMPILER_OPTIONS = {
|
|
|
22
21
|
skipLibCheck: true,
|
|
23
22
|
types: ["node"],
|
|
24
23
|
};
|
|
25
|
-
const
|
|
24
|
+
const CHECK_OPTIONS = {
|
|
25
|
+
declaration: true,
|
|
26
|
+
isolatedDeclarations: true,
|
|
27
|
+
noEmit: true,
|
|
28
|
+
};
|
|
29
|
+
const FORMAT_HOST = {
|
|
30
|
+
getCanonicalFileName: (fileName) => fileName,
|
|
31
|
+
getCurrentDirectory: () => ts.sys.getCurrentDirectory(),
|
|
32
|
+
getNewLine: () => "\n",
|
|
33
|
+
};
|
|
34
|
+
/** `@gtkx/codegen`'s own `node_modules`, which has `@types/node` plus the `@gtkx/*` deps the store typecheck needs. */
|
|
35
|
+
const codegenModules = () => {
|
|
36
|
+
const sourceDir = dirname(fileURLToPath(import.meta.url));
|
|
37
|
+
return join(dirname(sourceDir), "node_modules");
|
|
38
|
+
};
|
|
26
39
|
const linkToolingModules = (projectDir) => {
|
|
27
40
|
const link = join(projectDir, "node_modules");
|
|
28
|
-
if (existsSync(link))
|
|
29
|
-
return () =>
|
|
41
|
+
if (existsSync(link)) {
|
|
42
|
+
return () => undefined;
|
|
43
|
+
}
|
|
30
44
|
symlinkSync(codegenModules(), link, "junction");
|
|
31
|
-
return () =>
|
|
45
|
+
return () => {
|
|
46
|
+
rmSync(link, { force: true });
|
|
47
|
+
};
|
|
32
48
|
};
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
encoding: "utf8",
|
|
39
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
40
|
-
maxBuffer: 64 * 1024 * 1024,
|
|
41
|
-
});
|
|
42
|
-
return { code: 0, output: "" };
|
|
49
|
+
const isProjectFile = (rel) => !rel.startsWith("..") && !isAbsolute(rel) && !rel.split(/[/\\]/).includes("node_modules");
|
|
50
|
+
const projectDiagnosticLine = (diagnostic, projectDir) => {
|
|
51
|
+
const { file, start } = diagnostic;
|
|
52
|
+
if (file === undefined || start === undefined) {
|
|
53
|
+
return undefined;
|
|
43
54
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return
|
|
55
|
+
const filePath = relative(projectDir, file.fileName);
|
|
56
|
+
if (!isProjectFile(filePath)) {
|
|
57
|
+
return undefined;
|
|
47
58
|
}
|
|
59
|
+
const { line, character } = file.getLineAndCharacterOfPosition(start);
|
|
60
|
+
const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
|
|
61
|
+
return `${filePath}:${String(line + 1)}:${String(character + 1)} - ${message} (TS${String(diagnostic.code)})`;
|
|
48
62
|
};
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
const diagnostics
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const [, filePart, line, column, code, message] = match;
|
|
57
|
-
if (filePart === undefined || line === undefined || column === undefined || code === undefined)
|
|
58
|
-
continue;
|
|
59
|
-
const file = resolve(projectDir, filePart);
|
|
60
|
-
const rel = relative(projectDir, file);
|
|
61
|
-
if (rel.startsWith("..") || isAbsolute(rel) || rel.split(/[/\\]/).includes("node_modules"))
|
|
62
|
-
continue;
|
|
63
|
-
diagnostics.push({ file, line, column, code, message: (message ?? "").trim() });
|
|
63
|
+
const projectDiagnosticLines = (diagnostics, projectDir) => {
|
|
64
|
+
const lines = [];
|
|
65
|
+
for (const diagnostic of diagnostics) {
|
|
66
|
+
const line = projectDiagnosticLine(diagnostic, projectDir);
|
|
67
|
+
if (line !== undefined) {
|
|
68
|
+
lines.push(line);
|
|
69
|
+
}
|
|
64
70
|
}
|
|
65
|
-
return
|
|
71
|
+
return lines;
|
|
66
72
|
};
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
|
|
73
|
+
const diagnosticError = (label, projectDir, diagnostics) => {
|
|
74
|
+
const lines = projectDiagnosticLines(diagnostics, projectDir);
|
|
75
|
+
if (lines.length > 0) {
|
|
76
|
+
return new Error(`Type checking ${label} found ${String(lines.length)} error(s):\n${lines.join("\n")}`);
|
|
77
|
+
}
|
|
78
|
+
return new Error(`Type checking ${label} failed:\n${ts.formatDiagnostics(diagnostics, FORMAT_HOST).trim()}`);
|
|
70
79
|
};
|
|
71
|
-
|
|
72
|
-
const
|
|
80
|
+
const runProgram = (params) => {
|
|
81
|
+
const parsed = ts.parseJsonConfigFileContent({
|
|
82
|
+
compilerOptions: { ...BASE_COMPILER_OPTIONS, ...params.compilerOptions },
|
|
83
|
+
files: params.fileNames.map((name) => `./${name}`),
|
|
84
|
+
}, ts.sys, params.projectDir);
|
|
85
|
+
const program = ts.createProgram({
|
|
86
|
+
rootNames: parsed.fileNames,
|
|
87
|
+
options: parsed.options,
|
|
88
|
+
configFileParsingDiagnostics: parsed.errors,
|
|
89
|
+
});
|
|
90
|
+
const diagnostics = ts.getPreEmitDiagnostics(program);
|
|
91
|
+
if (diagnostics.length > 0) {
|
|
92
|
+
return [...diagnostics];
|
|
93
|
+
}
|
|
94
|
+
return [...program.emit().diagnostics];
|
|
95
|
+
};
|
|
96
|
+
const compileProject = (params) => {
|
|
73
97
|
const unlinkToolingModules = linkToolingModules(params.projectDir);
|
|
74
98
|
try {
|
|
75
|
-
|
|
76
|
-
compilerOptions: {
|
|
77
|
-
...BASE_COMPILER_OPTIONS,
|
|
78
|
-
...params.compilerOptions,
|
|
79
|
-
...(params.paths === undefined ? {} : { paths: params.paths }),
|
|
80
|
-
},
|
|
81
|
-
files: params.fileNames.map((name) => `./${name}`),
|
|
82
|
-
}));
|
|
83
|
-
const { code, output } = runTsc(tsconfigPath, params.projectDir);
|
|
84
|
-
const diagnostics = parseDiagnostics(output, params.projectDir);
|
|
99
|
+
const diagnostics = runProgram(params);
|
|
85
100
|
if (diagnostics.length > 0) {
|
|
86
|
-
throw
|
|
87
|
-
}
|
|
88
|
-
if (code !== 0) {
|
|
89
|
-
throw new Error(`Type checking ${params.label} failed:\n${output.trim()}`);
|
|
101
|
+
throw diagnosticError(params.label, params.projectDir, diagnostics);
|
|
90
102
|
}
|
|
91
103
|
}
|
|
92
104
|
finally {
|
|
93
105
|
unlinkToolingModules();
|
|
94
|
-
rmSync(tsconfigPath, { force: true });
|
|
95
106
|
}
|
|
96
107
|
};
|
|
97
|
-
const
|
|
98
|
-
declaration: true,
|
|
99
|
-
isolatedDeclarations: true,
|
|
100
|
-
noEmit: true,
|
|
101
|
-
};
|
|
102
|
-
export const checkModules = (params) => {
|
|
108
|
+
const checkModules = (params) => {
|
|
103
109
|
const checkRoot = join(params.resolveFrom, "node_modules");
|
|
104
110
|
mkdirSync(checkRoot, { recursive: true });
|
|
105
111
|
const projectDir = mkdtempSync(join(checkRoot, ".gtkx-check-"));
|
|
@@ -120,4 +126,5 @@ export const checkModules = (params) => {
|
|
|
120
126
|
rmSync(projectDir, { recursive: true, force: true });
|
|
121
127
|
}
|
|
122
128
|
};
|
|
129
|
+
export { compileProject, checkModules };
|
|
123
130
|
//# sourceMappingURL=compile.js.map
|
package/dist/compile.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../src/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzE,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,IA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AY,GAAG,CAAC,MAAuE,EAAQ,EAAE;IAC1G,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IAC3D,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1C,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAChE,IAAI,CAAC;QACD,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YAClC,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;YACnD,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAClD,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QAC3C,CAAC;QACD,cAAc,CAAC;YACX,UAAU;YACV,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC;YAC1D,eAAe,EAAE,aAAa;YAC9B,KAAK,EAAE,MAAM,CAAC,KAAK;SACtB,CAAC,CAAC;IACP,CAAC;YAAS,CAAC;QACP,MAAM,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACzD,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { execFileSync } from \"node:child_process\";\nimport { existsSync, mkdirSync, mkdtempSync, rmSync, symlinkSync, writeFileSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { dirname, isAbsolute, join, relative, resolve } from \"node:path\";\n\nconst require = createRequire(import.meta.url);\n\nexport type SourceModule = {\n fileName: string;\n source: string;\n};\n\nexport type CompileProjectParams = {\n projectDir: string;\n fileNames: string[];\n compilerOptions: Record<string, unknown>;\n label: string;\n paths?: Record<string, string[]>;\n};\n\nconst BASE_COMPILER_OPTIONS = {\n module: \"esnext\",\n moduleResolution: \"bundler\",\n target: \"esnext\",\n lib: [\"esnext\"],\n jsx: \"react-jsx\",\n jsxImportSource: \"react\",\n customConditions: [\"source\"],\n strict: true,\n exactOptionalPropertyTypes: true,\n noUncheckedIndexedAccess: true,\n noImplicitReturns: true,\n noFallthroughCasesInSwitch: true,\n allowUnreachableCode: false,\n forceConsistentCasingInFileNames: true,\n resolveJsonModule: true,\n skipLibCheck: true,\n types: [\"node\"],\n};\n\nconst codegenModules = (): string => dirname(dirname(dirname(require.resolve(\"@types/node/package.json\"))));\n\nconst linkToolingModules = (projectDir: string): (() => void) => {\n const link = join(projectDir, \"node_modules\");\n if (existsSync(link)) return () => {};\n symlinkSync(codegenModules(), link, \"junction\");\n return () => rmSync(link, { force: true });\n};\n\nconst tscBin = (): string => join(dirname(require.resolve(\"typescript/package.json\")), \"bin\", \"tsc\");\n\nconst runTsc = (tsconfigPath: string, cwd: string): { code: number; output: string } => {\n try {\n execFileSync(process.execPath, [tscBin(), \"--pretty\", \"false\", \"-p\", tsconfigPath], {\n cwd,\n encoding: \"utf8\",\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n maxBuffer: 64 * 1024 * 1024,\n });\n return { code: 0, output: \"\" };\n } catch (error) {\n const {\n status,\n stdout = \"\",\n stderr = \"\",\n } = error as { status?: number | null; stdout?: string; stderr?: string };\n return { code: typeof status === \"number\" ? status : 1, output: `${stdout}\\n${stderr}` };\n }\n};\n\nconst DIAGNOSTIC_LINE = /^(.+?)\\((\\d+),(\\d+)\\): error TS(\\d+): (.*)$/;\n\ntype ProjectDiagnostic = { file: string; line: string; column: string; code: string; message: string };\n\nconst parseDiagnostics = (output: string, projectDir: string): ProjectDiagnostic[] => {\n const diagnostics: ProjectDiagnostic[] = [];\n for (const raw of output.split(/\\r?\\n/)) {\n const match = DIAGNOSTIC_LINE.exec(raw);\n if (match === null) continue;\n const [, filePart, line, column, code, message] = match;\n if (filePart === undefined || line === undefined || column === undefined || code === undefined) continue;\n const file = resolve(projectDir, filePart);\n const rel = relative(projectDir, file);\n if (rel.startsWith(\"..\") || isAbsolute(rel) || rel.split(/[/\\\\]/).includes(\"node_modules\")) continue;\n diagnostics.push({ file, line, column, code, message: (message ?? \"\").trim() });\n }\n return diagnostics;\n};\n\nconst formatDiagnostics = (label: string, projectDir: string, diagnostics: ProjectDiagnostic[]): string => {\n const messages = diagnostics.map(\n (diagnostic) =>\n `${relative(projectDir, diagnostic.file)}:${diagnostic.line}:${diagnostic.column} - ${diagnostic.message} (TS${diagnostic.code})`,\n );\n return `Type checking ${label} found ${diagnostics.length} error(s):\\n${messages.join(\"\\n\")}`;\n};\n\nexport const compileProject = (params: CompileProjectParams): void => {\n const tsconfigPath = join(params.projectDir, \"tsconfig.json\");\n const unlinkToolingModules = linkToolingModules(params.projectDir);\n try {\n writeFileSync(\n tsconfigPath,\n JSON.stringify({\n compilerOptions: {\n ...BASE_COMPILER_OPTIONS,\n ...params.compilerOptions,\n ...(params.paths === undefined ? {} : { paths: params.paths }),\n },\n files: params.fileNames.map((name) => `./${name}`),\n }),\n );\n const { code, output } = runTsc(tsconfigPath, params.projectDir);\n const diagnostics = parseDiagnostics(output, params.projectDir);\n if (diagnostics.length > 0) {\n throw new Error(formatDiagnostics(params.label, params.projectDir, diagnostics));\n }\n if (code !== 0) {\n throw new Error(`Type checking ${params.label} failed:\\n${output.trim()}`);\n }\n } finally {\n unlinkToolingModules();\n rmSync(tsconfigPath, { force: true });\n }\n};\n\nconst CHECK_OPTIONS = {\n declaration: true,\n isolatedDeclarations: true,\n noEmit: true,\n};\n\nexport const checkModules = (params: { modules: SourceModule[]; resolveFrom: string; label: string }): void => {\n const checkRoot = join(params.resolveFrom, \"node_modules\");\n mkdirSync(checkRoot, { recursive: true });\n const projectDir = mkdtempSync(join(checkRoot, \".gtkx-check-\"));\n try {\n for (const module of params.modules) {\n const filePath = join(projectDir, module.fileName);\n mkdirSync(dirname(filePath), { recursive: true });\n writeFileSync(filePath, module.source);\n }\n compileProject({\n projectDir,\n fileNames: params.modules.map((module) => module.fileName),\n compilerOptions: CHECK_OPTIONS,\n label: params.label,\n });\n } finally {\n rmSync(projectDir, { recursive: true, force: true });\n }\n};\n"]}
|
|
1
|
+
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../src/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjG,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,MAAM,YAAY,CAAC;AAc5B,MAAM,qBAAqB,GAAG;IAC1B,MAAM,EAAE,QAAQ;IAChB,gBAAgB,EAAE,SAAS;IAC3B,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,CAAC,QAAQ,CAAC;IACf,GAAG,EAAE,WAAW;IAChB,eAAe,EAAE,OAAO;IACxB,gBAAgB,EAAE,CAAC,QAAQ,CAAC;IAC5B,MAAM,EAAE,IAAI;IACZ,0BAA0B,EAAE,IAAI;IAChC,wBAAwB,EAAE,IAAI;IAC9B,iBAAiB,EAAE,IAAI;IACvB,0BAA0B,EAAE,IAAI;IAChC,oBAAoB,EAAE,KAAK;IAC3B,gCAAgC,EAAE,IAAI;IACtC,iBAAiB,EAAE,IAAI;IACvB,YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,CAAC,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,aAAa,GAAG;IAClB,WAAW,EAAE,IAAI;IACjB,oBAAoB,EAAE,IAAI;IAC1B,MAAM,EAAE,IAAI;CACf,CAAC;AAEF,MAAM,WAAW,GAA6B;IAC1C,oBAAoB,EAAE,CAAC,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O,EAAE,cAAc,EAAE,YAAY,EAAgD,CAAC","sourcesContent":["import { existsSync, mkdirSync, mkdtempSync, rmSync, symlinkSync, writeFileSync } from \"node:fs\";\nimport { dirname, isAbsolute, join, relative } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport ts from \"typescript\";\n\ntype SourceModule = {\n fileName: string;\n source: string;\n};\n\ntype CompileProjectParams = {\n projectDir: string;\n fileNames: string[];\n compilerOptions: Record<string, unknown>;\n label: string;\n};\n\nconst BASE_COMPILER_OPTIONS = {\n module: \"esnext\",\n moduleResolution: \"bundler\",\n target: \"esnext\",\n lib: [\"esnext\"],\n jsx: \"react-jsx\",\n jsxImportSource: \"react\",\n customConditions: [\"source\"],\n strict: true,\n exactOptionalPropertyTypes: true,\n noUncheckedIndexedAccess: true,\n noImplicitReturns: true,\n noFallthroughCasesInSwitch: true,\n allowUnreachableCode: false,\n forceConsistentCasingInFileNames: true,\n resolveJsonModule: true,\n skipLibCheck: true,\n types: [\"node\"],\n};\n\nconst CHECK_OPTIONS = {\n declaration: true,\n isolatedDeclarations: true,\n noEmit: true,\n};\n\nconst FORMAT_HOST: ts.FormatDiagnosticsHost = {\n getCanonicalFileName: (fileName) => fileName,\n getCurrentDirectory: () => ts.sys.getCurrentDirectory(),\n getNewLine: () => \"\\n\",\n};\n\n/** `@gtkx/codegen`'s own `node_modules`, which has `@types/node` plus the `@gtkx/*` deps the store typecheck needs. */\nconst codegenModules = (): string => {\n const sourceDir = dirname(fileURLToPath(import.meta.url));\n\n return join(dirname(sourceDir), \"node_modules\");\n};\n\nconst linkToolingModules = (projectDir: string): (() => void) => {\n const link = join(projectDir, \"node_modules\");\n\n if (existsSync(link)) {\n return (): void => undefined;\n }\n\n symlinkSync(codegenModules(), link, \"junction\");\n\n return () => {\n rmSync(link, { force: true });\n };\n};\n\nconst isProjectFile = (rel: string): boolean =>\n !rel.startsWith(\"..\") && !isAbsolute(rel) && !rel.split(/[/\\\\]/).includes(\"node_modules\");\n\nconst projectDiagnosticLine = (diagnostic: ts.Diagnostic, projectDir: string): string | undefined => {\n const { file, start } = diagnostic;\n\n if (file === undefined || start === undefined) {\n return undefined;\n }\n\n const filePath = relative(projectDir, file.fileName);\n\n if (!isProjectFile(filePath)) {\n return undefined;\n }\n\n const { line, character } = file.getLineAndCharacterOfPosition(start);\n const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, \"\\n\");\n\n return `${filePath}:${String(line + 1)}:${String(character + 1)} - ${message} (TS${String(diagnostic.code)})`;\n};\n\nconst projectDiagnosticLines = (diagnostics: ts.Diagnostic[], projectDir: string): string[] => {\n const lines: string[] = [];\n\n for (const diagnostic of diagnostics) {\n const line = projectDiagnosticLine(diagnostic, projectDir);\n\n if (line !== undefined) {\n lines.push(line);\n }\n }\n\n return lines;\n};\n\nconst diagnosticError = (label: string, projectDir: string, diagnostics: ts.Diagnostic[]): Error => {\n const lines = projectDiagnosticLines(diagnostics, projectDir);\n\n if (lines.length > 0) {\n return new Error(`Type checking ${label} found ${String(lines.length)} error(s):\\n${lines.join(\"\\n\")}`);\n }\n\n return new Error(`Type checking ${label} failed:\\n${ts.formatDiagnostics(diagnostics, FORMAT_HOST).trim()}`);\n};\n\nconst runProgram = (params: CompileProjectParams): ts.Diagnostic[] => {\n const parsed = ts.parseJsonConfigFileContent(\n {\n compilerOptions: { ...BASE_COMPILER_OPTIONS, ...params.compilerOptions },\n files: params.fileNames.map((name) => `./${name}`),\n },\n ts.sys,\n params.projectDir,\n );\n\n const program = ts.createProgram({\n rootNames: parsed.fileNames,\n options: parsed.options,\n configFileParsingDiagnostics: parsed.errors,\n });\n\n const diagnostics = ts.getPreEmitDiagnostics(program);\n\n if (diagnostics.length > 0) {\n return [...diagnostics];\n }\n\n return [...program.emit().diagnostics];\n};\n\nconst compileProject = (params: CompileProjectParams): void => {\n const unlinkToolingModules = linkToolingModules(params.projectDir);\n\n try {\n const diagnostics = runProgram(params);\n\n if (diagnostics.length > 0) {\n throw diagnosticError(params.label, params.projectDir, diagnostics);\n }\n } finally {\n unlinkToolingModules();\n }\n};\n\nconst checkModules = (params: { modules: SourceModule[]; resolveFrom: string; label: string }): void => {\n const checkRoot = join(params.resolveFrom, \"node_modules\");\n mkdirSync(checkRoot, { recursive: true });\n const projectDir = mkdtempSync(join(checkRoot, \".gtkx-check-\"));\n\n try {\n for (const module of params.modules) {\n const filePath = join(projectDir, module.fileName);\n mkdirSync(dirname(filePath), { recursive: true });\n writeFileSync(filePath, module.source);\n }\n\n compileProject({\n projectDir,\n fileNames: params.modules.map((module) => module.fileName),\n compilerOptions: CHECK_OPTIONS,\n label: params.label,\n });\n } finally {\n rmSync(projectDir, { recursive: true, force: true });\n }\n};\n\nexport { compileProject, checkModules, type SourceModule, type CompileProjectParams };\n"]}
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
import type { ElementProp } from "@gtkx/config";
|
|
2
1
|
import { type GiSymbolEntry } from "./symbol-page.js";
|
|
3
|
-
|
|
2
|
+
type ApiReferenceOptions = {
|
|
4
3
|
libraries: string[];
|
|
5
4
|
girPath: string[];
|
|
6
|
-
elementProps?: Record<string, ElementProp[]>;
|
|
7
5
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export type ApiSymbol = {
|
|
6
|
+
type ApiSymbolKind = GiSymbolEntry["kind"] | "element";
|
|
7
|
+
type ApiSymbol = {
|
|
11
8
|
namespace: string;
|
|
12
9
|
name: string;
|
|
13
10
|
kind: ApiSymbolKind;
|
|
14
11
|
summary: string;
|
|
15
12
|
};
|
|
16
|
-
|
|
13
|
+
type ApiNamespaceSummary = {
|
|
17
14
|
name: string;
|
|
18
15
|
importPath: string;
|
|
19
16
|
symbols: number;
|
|
20
17
|
elements: number;
|
|
21
18
|
};
|
|
22
|
-
|
|
19
|
+
type ApiLookupResult = {
|
|
23
20
|
outcome: "page";
|
|
24
21
|
symbol: ApiSymbol;
|
|
25
22
|
markdown: string;
|
|
@@ -29,12 +26,14 @@ export type ApiLookupResult = {
|
|
|
29
26
|
} | {
|
|
30
27
|
outcome: "notFound";
|
|
31
28
|
};
|
|
32
|
-
|
|
29
|
+
type ApiSearchOptions = {
|
|
33
30
|
query: string;
|
|
34
31
|
namespace?: string;
|
|
35
32
|
kinds?: ApiSymbolKind[];
|
|
36
33
|
limit?: number;
|
|
37
34
|
};
|
|
35
|
+
declare const API_SYMBOL_KINDS: ApiSymbolKind[];
|
|
36
|
+
declare const loadApiReference: (options: ApiReferenceOptions) => ApiReference;
|
|
38
37
|
declare class ApiReference {
|
|
39
38
|
private library;
|
|
40
39
|
private libraries;
|
|
@@ -45,7 +44,6 @@ declare class ApiReference {
|
|
|
45
44
|
private byNamespace;
|
|
46
45
|
private elementsByClass;
|
|
47
46
|
constructor(options: ApiReferenceOptions);
|
|
48
|
-
get girFiles(): string[];
|
|
49
47
|
private add;
|
|
50
48
|
private buildIndex;
|
|
51
49
|
private indexNamespace;
|
|
@@ -54,6 +52,9 @@ declare class ApiReference {
|
|
|
54
52
|
private symbolPageOptions;
|
|
55
53
|
private renderPage;
|
|
56
54
|
private findNamespace;
|
|
55
|
+
private lookupCandidates;
|
|
56
|
+
private scoreEntries;
|
|
57
|
+
get girFiles(): string[];
|
|
57
58
|
lookup(query: string, kind?: ApiSymbolKind): ApiLookupResult;
|
|
58
59
|
search(options: ApiSearchOptions): ApiSymbol[];
|
|
59
60
|
namespaces(): ApiNamespaceSummary[];
|
|
@@ -62,5 +63,5 @@ declare class ApiReference {
|
|
|
62
63
|
namespaceOverview(name: string): string | undefined;
|
|
63
64
|
}
|
|
64
65
|
export type { ApiReference };
|
|
65
|
-
export
|
|
66
|
+
export { API_SYMBOL_KINDS, loadApiReference, type ApiReferenceOptions, type ApiSymbolKind, type ApiSymbol, type ApiNamespaceSummary, type ApiLookupResult, type ApiSearchOptions, };
|
|
66
67
|
//# sourceMappingURL=api-reference.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-reference.d.ts","sourceRoot":"","sources":["../../src/docs/api-reference.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api-reference.d.ts","sourceRoot":"","sources":["../../src/docs/api-reference.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,aAAa,EAA4C,MAAM,kBAAkB,CAAC;AAEhG,KAAK,mBAAmB,GAAG;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,KAAK,aAAa,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;AAEvD,KAAK,SAAS,GAAG;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,eAAe,GACd;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC1D;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,UAAU,EAAE,SAAS,EAAE,CAAA;CAAE,GACjD;IAAE,OAAO,EAAE,UAAU,CAAA;CAAE,CAAC;AAE5B,KAAK,gBAAgB,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAaF,QAAA,MAAM,gBAAgB,EAAE,aAAa,EAUpC,CAAC;AAwBF,QAAA,MAAM,gBAAgB,GAAI,SAAS,mBAAmB,KAAG,YAAyC,CAAC;AAoLnG,cAAM,YAAY;IACd,O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