@powerlines/plugin-alloy 0.26.179 → 0.26.181
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/_virtual/_rolldown/runtime.cjs +14 -0
- package/dist/_virtual/_rolldown/runtime.mjs +18 -0
- package/dist/core/components/infrastructure-file.cjs +8 -1
- package/dist/core/components/infrastructure-file.mjs +3 -1
- package/dist/core/components/infrastructure-file.mjs.map +1 -1
- package/dist/core/components/infrastructure-file.test.cjs +16 -0
- package/dist/core/components/infrastructure-file.test.d.cts +1 -0
- package/dist/core/components/infrastructure-file.test.d.mts +1 -0
- package/dist/core/components/infrastructure-file.test.mjs +18 -0
- package/dist/core/components/infrastructure-file.test.mjs.map +1 -0
- package/dist/core/components/output.cjs +9 -1
- package/dist/core/components/output.d.cts.map +1 -1
- package/dist/core/components/output.d.mts.map +1 -1
- package/dist/core/components/output.mjs +3 -1
- package/dist/core/components/output.mjs.map +1 -1
- package/dist/core/components/output.test.cjs +16 -0
- package/dist/core/components/output.test.d.cts +1 -0
- package/dist/core/components/output.test.d.mts +1 -0
- package/dist/core/components/output.test.mjs +18 -0
- package/dist/core/components/output.test.mjs.map +1 -0
- package/dist/core/components/single-line-comment.cjs +9 -1
- package/dist/core/components/single-line-comment.mjs +3 -1
- package/dist/core/components/single-line-comment.mjs.map +1 -1
- package/dist/core/components/single-line-comment.test.cjs +16 -0
- package/dist/core/components/single-line-comment.test.d.cts +1 -0
- package/dist/core/components/single-line-comment.test.d.mts +1 -0
- package/dist/core/components/single-line-comment.test.mjs +18 -0
- package/dist/core/components/single-line-comment.test.mjs.map +1 -0
- package/dist/core/components/source-file.cjs +8 -1
- package/dist/core/components/source-file.mjs +3 -1
- package/dist/core/components/source-file.mjs.map +1 -1
- package/dist/core/components/source-file.test.cjs +16 -0
- package/dist/core/components/source-file.test.d.cts +1 -0
- package/dist/core/components/source-file.test.d.mts +1 -0
- package/dist/core/components/source-file.test.mjs +18 -0
- package/dist/core/components/source-file.test.mjs.map +1 -0
- package/dist/core/components/spacing.cjs +9 -1
- package/dist/core/components/spacing.d.cts.map +1 -1
- package/dist/core/components/spacing.d.mts.map +1 -1
- package/dist/core/components/spacing.mjs +3 -1
- package/dist/core/components/spacing.mjs.map +1 -1
- package/dist/core/components/spacing.test.cjs +16 -0
- package/dist/core/components/spacing.test.d.cts +1 -0
- package/dist/core/components/spacing.test.d.mts +1 -0
- package/dist/core/components/spacing.test.mjs +18 -0
- package/dist/core/components/spacing.test.mjs.map +1 -0
- package/dist/core/contexts/context.cjs +13 -0
- package/dist/core/contexts/context.d.cts.map +1 -1
- package/dist/core/contexts/context.d.mts.map +1 -1
- package/dist/core/contexts/context.mjs +8 -1
- package/dist/core/contexts/context.mjs.map +1 -1
- package/dist/core/contexts/context.test.cjs +16 -0
- package/dist/core/contexts/context.test.d.cts +1 -0
- package/dist/core/contexts/context.test.d.mts +1 -0
- package/dist/core/contexts/context.test.mjs +18 -0
- package/dist/core/contexts/context.test.mjs.map +1 -0
- package/dist/core/contexts/meta.cjs +13 -0
- package/dist/core/contexts/meta.d.cts.map +1 -1
- package/dist/core/contexts/meta.d.mts.map +1 -1
- package/dist/core/contexts/meta.mjs +8 -1
- package/dist/core/contexts/meta.mjs.map +1 -1
- package/dist/core/contexts/meta.test.cjs +16 -0
- package/dist/core/contexts/meta.test.d.cts +1 -0
- package/dist/core/contexts/meta.test.d.mts +1 -0
- package/dist/core/contexts/meta.test.mjs +18 -0
- package/dist/core/contexts/meta.test.mjs.map +1 -0
- package/dist/core/contexts/schema.cjs +13 -0
- package/dist/core/contexts/schema.d.cts.map +1 -1
- package/dist/core/contexts/schema.d.mts.map +1 -1
- package/dist/core/contexts/schema.mjs +8 -1
- package/dist/core/contexts/schema.mjs.map +1 -1
- package/dist/core/contexts/schema.test.cjs +16 -0
- package/dist/core/contexts/schema.test.d.cts +1 -0
- package/dist/core/contexts/schema.test.d.mts +1 -0
- package/dist/core/contexts/schema.test.mjs +18 -0
- package/dist/core/contexts/schema.test.mjs.map +1 -0
- package/dist/core/helpers/code.cjs +9 -1
- package/dist/core/helpers/code.mjs +3 -1
- package/dist/core/helpers/code.mjs.map +1 -1
- package/dist/core/helpers/code.test.cjs +16 -0
- package/dist/core/helpers/code.test.d.cts +1 -0
- package/dist/core/helpers/code.test.d.mts +1 -0
- package/dist/core/helpers/code.test.mjs +18 -0
- package/dist/core/helpers/code.test.mjs.map +1 -0
- package/dist/hcl/components/block-declaration.cjs +9 -1
- package/dist/hcl/components/block-declaration.mjs +3 -1
- package/dist/hcl/components/block-declaration.mjs.map +1 -1
- package/dist/hcl/components/block-declaration.test.cjs +16 -0
- package/dist/hcl/components/block-declaration.test.d.cts +1 -0
- package/dist/hcl/components/block-declaration.test.d.mts +1 -0
- package/dist/hcl/components/block-declaration.test.mjs +18 -0
- package/dist/hcl/components/block-declaration.test.mjs.map +1 -0
- package/dist/hcl/components/hcl-file.cjs +12 -1
- package/dist/hcl/components/hcl-file.mjs +6 -1
- package/dist/hcl/components/hcl-file.mjs.map +1 -1
- package/dist/hcl/components/hcl-file.test.cjs +16 -0
- package/dist/hcl/components/hcl-file.test.d.cts +1 -0
- package/dist/hcl/components/hcl-file.test.d.mts +1 -0
- package/dist/hcl/components/hcl-file.test.mjs +18 -0
- package/dist/hcl/components/hcl-file.test.mjs.map +1 -0
- package/dist/hcl/components/packer-file.cjs +9 -1
- package/dist/hcl/components/packer-file.mjs +3 -1
- package/dist/hcl/components/packer-file.mjs.map +1 -1
- package/dist/hcl/components/packer-file.test.cjs +16 -0
- package/dist/hcl/components/packer-file.test.d.cts +1 -0
- package/dist/hcl/components/packer-file.test.d.mts +1 -0
- package/dist/hcl/components/packer-file.test.mjs +18 -0
- package/dist/hcl/components/packer-file.test.mjs.map +1 -0
- package/dist/hcl/components/terraform-file.cjs +9 -1
- package/dist/hcl/components/terraform-file.mjs +3 -1
- package/dist/hcl/components/terraform-file.mjs.map +1 -1
- package/dist/hcl/components/terraform-file.test.cjs +16 -0
- package/dist/hcl/components/terraform-file.test.d.cts +1 -0
- package/dist/hcl/components/terraform-file.test.d.mts +1 -0
- package/dist/hcl/components/terraform-file.test.mjs +18 -0
- package/dist/hcl/components/terraform-file.test.mjs.map +1 -0
- package/dist/helpers/capnp.cjs +24 -0
- package/dist/helpers/capnp.d.cts.map +1 -1
- package/dist/helpers/capnp.d.mts.map +1 -1
- package/dist/helpers/capnp.mjs +20 -1
- package/dist/helpers/capnp.mjs.map +1 -1
- package/dist/helpers/capnp.test.cjs +16 -0
- package/dist/helpers/capnp.test.d.cts +1 -0
- package/dist/helpers/capnp.test.d.mts +1 -0
- package/dist/helpers/capnp.test.mjs +18 -0
- package/dist/helpers/capnp.test.mjs.map +1 -0
- package/dist/helpers/create-builtin.cjs +9 -1
- package/dist/helpers/create-builtin.d.cts.map +1 -1
- package/dist/helpers/create-builtin.d.mts.map +1 -1
- package/dist/helpers/create-builtin.mjs +3 -1
- package/dist/helpers/create-builtin.mjs.map +1 -1
- package/dist/helpers/create-builtin.test.cjs +16 -0
- package/dist/helpers/create-builtin.test.d.cts +1 -0
- package/dist/helpers/create-builtin.test.d.mts +1 -0
- package/dist/helpers/create-builtin.test.mjs +18 -0
- package/dist/helpers/create-builtin.test.mjs.map +1 -0
- package/dist/helpers/refkey.cjs +1 -0
- package/dist/helpers/refkey.d.cts.map +1 -1
- package/dist/helpers/refkey.d.mts.map +1 -1
- package/dist/helpers/refkey.mjs +1 -0
- package/dist/helpers/refkey.mjs.map +1 -1
- package/dist/helpers/refkey.test.cjs +30 -0
- package/dist/helpers/refkey.test.d.cts +1 -0
- package/dist/helpers/refkey.test.d.mts +1 -0
- package/dist/helpers/refkey.test.mjs +32 -0
- package/dist/helpers/refkey.test.mjs.map +1 -0
- package/dist/helpers/typescript.cjs +9 -1
- package/dist/helpers/typescript.d.cts.map +1 -1
- package/dist/helpers/typescript.d.mts.map +1 -1
- package/dist/helpers/typescript.mjs +3 -1
- package/dist/helpers/typescript.mjs.map +1 -1
- package/dist/helpers/typescript.test.cjs +16 -0
- package/dist/helpers/typescript.test.d.cts +1 -0
- package/dist/helpers/typescript.test.d.mts +1 -0
- package/dist/helpers/typescript.test.mjs +18 -0
- package/dist/helpers/typescript.test.mjs.map +1 -0
- package/dist/markdown/components/front-matter.cjs +9 -1
- package/dist/markdown/components/front-matter.mjs +3 -1
- package/dist/markdown/components/front-matter.mjs.map +1 -1
- package/dist/markdown/components/front-matter.test.cjs +16 -0
- package/dist/markdown/components/front-matter.test.d.cts +1 -0
- package/dist/markdown/components/front-matter.test.d.mts +1 -0
- package/dist/markdown/components/front-matter.test.mjs +18 -0
- package/dist/markdown/components/front-matter.test.mjs.map +1 -0
- package/dist/markdown/components/heading.cjs +9 -1
- package/dist/markdown/components/heading.mjs +3 -1
- package/dist/markdown/components/heading.mjs.map +1 -1
- package/dist/markdown/components/heading.test.cjs +16 -0
- package/dist/markdown/components/heading.test.d.cts +1 -0
- package/dist/markdown/components/heading.test.d.mts +1 -0
- package/dist/markdown/components/heading.test.mjs +18 -0
- package/dist/markdown/components/heading.test.mjs.map +1 -0
- package/dist/markdown/components/markdown-file.cjs +12 -1
- package/dist/markdown/components/markdown-file.mjs +6 -1
- package/dist/markdown/components/markdown-file.mjs.map +1 -1
- package/dist/markdown/components/markdown-file.test.cjs +16 -0
- package/dist/markdown/components/markdown-file.test.d.cts +1 -0
- package/dist/markdown/components/markdown-file.test.d.mts +1 -0
- package/dist/markdown/components/markdown-file.test.mjs +18 -0
- package/dist/markdown/components/markdown-file.test.mjs.map +1 -0
- package/dist/markdown/components/markdown-table.cjs +13 -1
- package/dist/markdown/components/markdown-table.d.cts.map +1 -1
- package/dist/markdown/components/markdown-table.d.mts.map +1 -1
- package/dist/markdown/components/markdown-table.mjs +7 -1
- package/dist/markdown/components/markdown-table.mjs.map +1 -1
- package/dist/markdown/components/markdown-table.test.cjs +16 -0
- package/dist/markdown/components/markdown-table.test.d.cts +1 -0
- package/dist/markdown/components/markdown-table.test.d.mts +1 -0
- package/dist/markdown/components/markdown-table.test.mjs +18 -0
- package/dist/markdown/components/markdown-table.test.mjs.map +1 -0
- package/dist/markdown/contexts/markdown-table.cjs +13 -0
- package/dist/markdown/contexts/markdown-table.d.cts.map +1 -1
- package/dist/markdown/contexts/markdown-table.d.mts.map +1 -1
- package/dist/markdown/contexts/markdown-table.mjs +8 -1
- package/dist/markdown/contexts/markdown-table.mjs.map +1 -1
- package/dist/markdown/contexts/markdown-table.test.cjs +16 -0
- package/dist/markdown/contexts/markdown-table.test.d.cts +1 -0
- package/dist/markdown/contexts/markdown-table.test.d.mts +1 -0
- package/dist/markdown/contexts/markdown-table.test.mjs +18 -0
- package/dist/markdown/contexts/markdown-table.test.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.cjs +78 -0
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +78 -0
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_expect@4.1.7/node_modules/@vitest/expect/dist/index.cjs +1487 -0
- package/dist/node_modules/.pnpm/@vitest_expect@4.1.7/node_modules/@vitest/expect/dist/index.mjs +1473 -0
- package/dist/node_modules/.pnpm/@vitest_expect@4.1.7/node_modules/@vitest/expect/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_pretty-format@4.1.7/node_modules/@vitest/pretty-format/dist/index.cjs +889 -0
- package/dist/node_modules/.pnpm/@vitest_pretty-format@4.1.7/node_modules/@vitest/pretty-format/dist/index.mjs +888 -0
- package/dist/node_modules/.pnpm/@vitest_pretty-format@4.1.7/node_modules/@vitest/pretty-format/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.cjs +1614 -0
- package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.mjs +1594 -0
- package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/index.cjs +1 -0
- package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/index.mjs +3 -0
- package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/utils.cjs +1 -0
- package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/utils.mjs +3 -0
- package/dist/node_modules/.pnpm/@vitest_snapshot@4.1.7/node_modules/@vitest/snapshot/dist/index.cjs +923 -0
- package/dist/node_modules/.pnpm/@vitest_snapshot@4.1.7/node_modules/@vitest/snapshot/dist/index.mjs +922 -0
- package/dist/node_modules/.pnpm/@vitest_snapshot@4.1.7/node_modules/@vitest/snapshot/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_spy@4.1.7/node_modules/@vitest/spy/dist/index.cjs +391 -0
- package/dist/node_modules/.pnpm/@vitest_spy@4.1.7/node_modules/@vitest/spy/dist/index.mjs +386 -0
- package/dist/node_modules/.pnpm/@vitest_spy@4.1.7/node_modules/@vitest/spy/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.cjs +82 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.mjs +82 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/diff.cjs +1358 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/diff.mjs +1357 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/diff.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/display.cjs +561 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/display.mjs +559 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/display.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/error.cjs +37 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/error.mjs +38 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/error.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/helpers.cjs +197 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/helpers.mjs +181 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/helpers.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/offset.cjs +29 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/offset.mjs +27 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/offset.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/serialize.cjs +77 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/serialize.mjs +77 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/serialize.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/source-map.cjs +374 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/source-map.mjs +374 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/source-map.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/timers.cjs +38 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/timers.mjs +37 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/timers.mjs.map +1 -0
- package/dist/node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.cjs +2978 -0
- package/dist/node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.mjs +2973 -0
- package/dist/node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.cjs +939 -0
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs +940 -0
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs.map +1 -0
- package/dist/node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.cjs +87 -0
- package/dist/node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.mjs +87 -0
- package/dist/node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.cjs +6 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.mjs +6 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.mjs.map +1 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/rpc.MzXet3jl.cjs +54 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/rpc.MzXet3jl.mjs +52 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/rpc.MzXet3jl.mjs.map +1 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.cjs +2696 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs +2697 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs.map +1 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.cjs +47 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.mjs +45 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.mjs.map +1 -0
- package/dist/render.d.cts.map +1 -1
- package/dist/render.d.mts.map +1 -1
- package/dist/render.mjs.map +1 -1
- package/dist/typescript/components/builtin-file.cjs +9 -1
- package/dist/typescript/components/builtin-file.mjs +3 -1
- package/dist/typescript/components/builtin-file.mjs.map +1 -1
- package/dist/typescript/components/builtin-file.test.cjs +16 -0
- package/dist/typescript/components/builtin-file.test.d.cts +1 -0
- package/dist/typescript/components/builtin-file.test.d.mts +1 -0
- package/dist/typescript/components/builtin-file.test.mjs +18 -0
- package/dist/typescript/components/builtin-file.test.mjs.map +1 -0
- package/dist/typescript/components/class-declaration.cjs +16 -1
- package/dist/typescript/components/class-declaration.mjs +10 -1
- package/dist/typescript/components/class-declaration.mjs.map +1 -1
- package/dist/typescript/components/class-declaration.test.cjs +16 -0
- package/dist/typescript/components/class-declaration.test.d.cts +1 -0
- package/dist/typescript/components/class-declaration.test.d.mts +1 -0
- package/dist/typescript/components/class-declaration.test.mjs +18 -0
- package/dist/typescript/components/class-declaration.test.mjs.map +1 -0
- package/dist/typescript/components/dynamic-import-statement.cjs +9 -1
- package/dist/typescript/components/dynamic-import-statement.mjs +3 -1
- package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
- package/dist/typescript/components/dynamic-import-statement.test.cjs +16 -0
- package/dist/typescript/components/dynamic-import-statement.test.d.cts +1 -0
- package/dist/typescript/components/dynamic-import-statement.test.d.mts +1 -0
- package/dist/typescript/components/dynamic-import-statement.test.mjs +18 -0
- package/dist/typescript/components/dynamic-import-statement.test.mjs.map +1 -0
- package/dist/typescript/components/entry-file.cjs +8 -1
- package/dist/typescript/components/entry-file.mjs +3 -1
- package/dist/typescript/components/entry-file.mjs.map +1 -1
- package/dist/typescript/components/entry-file.test.cjs +16 -0
- package/dist/typescript/components/entry-file.test.d.cts +1 -0
- package/dist/typescript/components/entry-file.test.d.mts +1 -0
- package/dist/typescript/components/entry-file.test.mjs +18 -0
- package/dist/typescript/components/entry-file.test.mjs.map +1 -0
- package/dist/typescript/components/interface-declaration.cjs +14 -1
- package/dist/typescript/components/interface-declaration.mjs +8 -1
- package/dist/typescript/components/interface-declaration.mjs.map +1 -1
- package/dist/typescript/components/interface-declaration.test.cjs +16 -0
- package/dist/typescript/components/interface-declaration.test.d.cts +1 -0
- package/dist/typescript/components/interface-declaration.test.d.mts +1 -0
- package/dist/typescript/components/interface-declaration.test.mjs +18 -0
- package/dist/typescript/components/interface-declaration.test.mjs.map +1 -0
- package/dist/typescript/components/object-declaration.cjs +12 -1
- package/dist/typescript/components/object-declaration.mjs +6 -1
- package/dist/typescript/components/object-declaration.mjs.map +1 -1
- package/dist/typescript/components/object-declaration.test.cjs +16 -0
- package/dist/typescript/components/object-declaration.test.d.cts +1 -0
- package/dist/typescript/components/object-declaration.test.d.mts +1 -0
- package/dist/typescript/components/object-declaration.test.mjs +18 -0
- package/dist/typescript/components/object-declaration.test.mjs.map +1 -0
- package/dist/typescript/components/property-name.cjs +9 -1
- package/dist/typescript/components/property-name.mjs +3 -1
- package/dist/typescript/components/property-name.mjs.map +1 -1
- package/dist/typescript/components/property-name.test.cjs +16 -0
- package/dist/typescript/components/property-name.test.d.cts +1 -0
- package/dist/typescript/components/property-name.test.d.mts +1 -0
- package/dist/typescript/components/property-name.test.mjs +18 -0
- package/dist/typescript/components/property-name.test.mjs.map +1 -0
- package/dist/typescript/components/record-expression.cjs +9 -1
- package/dist/typescript/components/record-expression.d.cts.map +1 -1
- package/dist/typescript/components/record-expression.d.mts.map +1 -1
- package/dist/typescript/components/record-expression.mjs +3 -1
- package/dist/typescript/components/record-expression.mjs.map +1 -1
- package/dist/typescript/components/record-expression.test.cjs +16 -0
- package/dist/typescript/components/record-expression.test.d.cts +1 -0
- package/dist/typescript/components/record-expression.test.d.mts +1 -0
- package/dist/typescript/components/record-expression.test.mjs +18 -0
- package/dist/typescript/components/record-expression.test.mjs.map +1 -0
- package/dist/typescript/components/tsdoc-schema.cjs +12 -1
- package/dist/typescript/components/tsdoc-schema.mjs +6 -1
- package/dist/typescript/components/tsdoc-schema.mjs.map +1 -1
- package/dist/typescript/components/tsdoc-schema.test.cjs +16 -0
- package/dist/typescript/components/tsdoc-schema.test.d.cts +1 -0
- package/dist/typescript/components/tsdoc-schema.test.d.mts +1 -0
- package/dist/typescript/components/tsdoc-schema.test.mjs +18 -0
- package/dist/typescript/components/tsdoc-schema.test.mjs.map +1 -0
- package/dist/typescript/components/tsdoc.cjs +32 -1
- package/dist/typescript/components/tsdoc.d.cts.map +1 -1
- package/dist/typescript/components/tsdoc.d.mts.map +1 -1
- package/dist/typescript/components/tsdoc.mjs +26 -1
- package/dist/typescript/components/tsdoc.mjs.map +1 -1
- package/dist/typescript/components/tsdoc.test.cjs +16 -0
- package/dist/typescript/components/tsdoc.test.d.cts +1 -0
- package/dist/typescript/components/tsdoc.test.d.mts +1 -0
- package/dist/typescript/components/tsdoc.test.mjs +18 -0
- package/dist/typescript/components/tsdoc.test.mjs.map +1 -0
- package/dist/typescript/components/type-declaration.cjs +9 -1
- package/dist/typescript/components/type-declaration.mjs +3 -1
- package/dist/typescript/components/type-declaration.mjs.map +1 -1
- package/dist/typescript/components/type-declaration.test.cjs +16 -0
- package/dist/typescript/components/type-declaration.test.d.cts +1 -0
- package/dist/typescript/components/type-declaration.test.d.mts +1 -0
- package/dist/typescript/components/type-declaration.test.mjs +18 -0
- package/dist/typescript/components/type-declaration.test.mjs.map +1 -0
- package/dist/typescript/components/type-parameters.cjs +9 -1
- package/dist/typescript/components/type-parameters.mjs +3 -1
- package/dist/typescript/components/type-parameters.mjs.map +1 -1
- package/dist/typescript/components/type-parameters.test.cjs +16 -0
- package/dist/typescript/components/type-parameters.test.d.cts +1 -0
- package/dist/typescript/components/type-parameters.test.d.mts +1 -0
- package/dist/typescript/components/type-parameters.test.mjs +18 -0
- package/dist/typescript/components/type-parameters.test.mjs.map +1 -0
- package/dist/typescript/components/typescript-file.cjs +13 -1
- package/dist/typescript/components/typescript-file.mjs +7 -1
- package/dist/typescript/components/typescript-file.mjs.map +1 -1
- package/dist/typescript/components/typescript-file.test.cjs +16 -0
- package/dist/typescript/components/typescript-file.test.d.cts +1 -0
- package/dist/typescript/components/typescript-file.test.d.mts +1 -0
- package/dist/typescript/components/typescript-file.test.mjs +18 -0
- package/dist/typescript/components/typescript-file.test.mjs.map +1 -0
- package/dist/typescript/contexts/lexical-scope.cjs +9 -1
- package/dist/typescript/contexts/lexical-scope.mjs +3 -1
- package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
- package/dist/typescript/contexts/lexical-scope.test.cjs +16 -0
- package/dist/typescript/contexts/lexical-scope.test.d.cts +1 -0
- package/dist/typescript/contexts/lexical-scope.test.d.mts +1 -0
- package/dist/typescript/contexts/lexical-scope.test.mjs +18 -0
- package/dist/typescript/contexts/lexical-scope.test.mjs.map +1 -0
- package/dist/typescript/contexts/member-scope.cjs +9 -1
- package/dist/typescript/contexts/member-scope.mjs +3 -1
- package/dist/typescript/contexts/member-scope.mjs.map +1 -1
- package/dist/typescript/contexts/member-scope.test.cjs +16 -0
- package/dist/typescript/contexts/member-scope.test.d.cts +1 -0
- package/dist/typescript/contexts/member-scope.test.d.mts +1 -0
- package/dist/typescript/contexts/member-scope.test.mjs +18 -0
- package/dist/typescript/contexts/member-scope.test.mjs.map +1 -0
- package/dist/typescript/helpers/get-call-signature-props.cjs +9 -1
- package/dist/typescript/helpers/get-call-signature-props.mjs +3 -1
- package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -1
- package/dist/typescript/helpers/get-call-signature-props.test.cjs +16 -0
- package/dist/typescript/helpers/get-call-signature-props.test.d.cts +1 -0
- package/dist/typescript/helpers/get-call-signature-props.test.d.mts +1 -0
- package/dist/typescript/helpers/get-call-signature-props.test.mjs +18 -0
- package/dist/typescript/helpers/get-call-signature-props.test.mjs.map +1 -0
- package/dist/typescript/helpers/utilities.cjs +9 -1
- package/dist/typescript/helpers/utilities.mjs +4 -1
- package/dist/typescript/helpers/utilities.mjs.map +1 -1
- package/dist/typescript/helpers/utilities.test.cjs +16 -0
- package/dist/typescript/helpers/utilities.test.d.cts +1 -0
- package/dist/typescript/helpers/utilities.test.d.mts +1 -0
- package/dist/typescript/helpers/utilities.test.mjs +18 -0
- package/dist/typescript/helpers/utilities.test.mjs.map +1 -0
- package/dist/yaml/components/yaml-file.cjs +12 -1
- package/dist/yaml/components/yaml-file.mjs +6 -1
- package/dist/yaml/components/yaml-file.mjs.map +1 -1
- package/dist/yaml/components/yaml-file.test.cjs +16 -0
- package/dist/yaml/components/yaml-file.test.d.cts +1 -0
- package/dist/yaml/components/yaml-file.test.d.mts +1 -0
- package/dist/yaml/components/yaml-file.test.mjs +18 -0
- package/dist/yaml/components/yaml-file.test.mjs.map +1 -0
- package/package.json +590 -17
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
2
3
|
const require_core_contexts_schema = require('../../core/contexts/schema.cjs');
|
|
3
4
|
const require_typescript_components_tsdoc = require('./tsdoc.cjs');
|
|
4
5
|
const require_typescript_contexts_member_scope = require('../contexts/member-scope.cjs');
|
|
@@ -14,6 +15,12 @@ let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-stri
|
|
|
14
15
|
let _stryke_unique_id_uuid = require("@stryke/unique-id/uuid");
|
|
15
16
|
|
|
16
17
|
//#region src/typescript/components/interface-declaration.tsx
|
|
18
|
+
var interface_declaration_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
19
|
+
InterfaceDeclaration: () => InterfaceDeclaration,
|
|
20
|
+
InterfaceDeclarationProperty: () => InterfaceDeclarationProperty,
|
|
21
|
+
InterfaceExpression: () => InterfaceExpression,
|
|
22
|
+
InterfaceMember: () => InterfaceMember
|
|
23
|
+
});
|
|
17
24
|
const InterfaceExpression = (0, _alloy_js_typescript.ensureTypeRefContext)(function InterfaceExpression(props) {
|
|
18
25
|
const symbol = (0, _alloy_js_core.createSymbol)(_alloy_js_typescript.TSOutputSymbol, "", void 0, {
|
|
19
26
|
transient: true,
|
|
@@ -254,4 +261,10 @@ function InterfaceDeclarationProperty(props) {
|
|
|
254
261
|
exports.InterfaceDeclaration = InterfaceDeclaration;
|
|
255
262
|
exports.InterfaceDeclarationProperty = InterfaceDeclarationProperty;
|
|
256
263
|
exports.InterfaceExpression = InterfaceExpression;
|
|
257
|
-
exports.InterfaceMember = InterfaceMember;
|
|
264
|
+
exports.InterfaceMember = InterfaceMember;
|
|
265
|
+
Object.defineProperty(exports, 'interface_declaration_exports', {
|
|
266
|
+
enumerable: true,
|
|
267
|
+
get: function () {
|
|
268
|
+
return interface_declaration_exports;
|
|
269
|
+
}
|
|
270
|
+
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __exportAll } from "../../_virtual/_rolldown/runtime.mjs";
|
|
1
2
|
import { SchemaContext, SchemaPropertyContext } from "../../core/contexts/schema.mjs";
|
|
2
3
|
import { TSDoc } from "./tsdoc.mjs";
|
|
3
4
|
import { MemberScope as MemberScope$1 } from "../contexts/member-scope.mjs";
|
|
@@ -13,6 +14,12 @@ import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
|
13
14
|
import { uuid } from "@stryke/unique-id/uuid";
|
|
14
15
|
|
|
15
16
|
//#region src/typescript/components/interface-declaration.tsx
|
|
17
|
+
var interface_declaration_exports = /* @__PURE__ */ __exportAll({
|
|
18
|
+
InterfaceDeclaration: () => InterfaceDeclaration,
|
|
19
|
+
InterfaceDeclarationProperty: () => InterfaceDeclarationProperty,
|
|
20
|
+
InterfaceExpression: () => InterfaceExpression,
|
|
21
|
+
InterfaceMember: () => InterfaceMember
|
|
22
|
+
});
|
|
16
23
|
const InterfaceExpression = ensureTypeRefContext(function InterfaceExpression(props) {
|
|
17
24
|
const symbol = createSymbol(TSOutputSymbol, "", void 0, {
|
|
18
25
|
transient: true,
|
|
@@ -250,5 +257,5 @@ function InterfaceDeclarationProperty(props) {
|
|
|
250
257
|
}
|
|
251
258
|
|
|
252
259
|
//#endregion
|
|
253
|
-
export { InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceExpression, InterfaceMember };
|
|
260
|
+
export { InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceExpression, InterfaceMember, interface_declaration_exports };
|
|
254
261
|
//# sourceMappingURL=interface-declaration.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface-declaration.mjs","names":[],"sources":["../../../src/typescript/components/interface-declaration.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n Block,\n Children,\n childrenArray,\n computed,\n createSymbol,\n createSymbolSlot,\n effect,\n emitSymbol,\n findUnkeyedChildren,\n For,\n MemberDeclaration,\n Name,\n Namekey,\n Refkey,\n Show,\n splitProps,\n takeSymbols\n} from \"@alloy-js/core\";\nimport {\n CommonDeclarationProps,\n Declaration,\n ensureTypeRefContext,\n TSOutputSymbol,\n TSSymbolFlags,\n TypeParameterDescriptor,\n useTSLexicalScope,\n useTSMemberScope,\n useTSNamePolicy\n} from \"@alloy-js/typescript\";\nimport {\n getPrimarySchemaType,\n getPropertiesList,\n isSchemaNullable,\n JsonSchema,\n JsonSchemaPrimitiveType,\n stringifyType\n} from \"@powerlines/schema\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { PartialKeys } from \"@stryke/types/base\";\nimport { uuid } from \"@stryke/unique-id/uuid\";\nimport {\n SchemaContext,\n SchemaPropertyContext\n} from \"../../core/contexts/schema\";\nimport { ComponentProps } from \"../../types/components\";\nimport { MemberScope } from \"../contexts/member-scope\";\nimport { PropertyName } from \"./property-name\";\nimport { TSDoc } from \"./tsdoc\";\nimport { TSDocObjectSchema, TSDocSchemaProperty } from \"./tsdoc-schema\";\nimport { TypeParameters } from \"./type-parameters\";\n\nexport interface InterfaceDeclarationProps\n extends PartialKeys<CommonDeclarationProps, \"name\">, ComponentProps {\n /**\n * A base type that this interface extends. This can be used to represent inheritance\n */\n extends?: Children;\n\n /**\n * The generic type parameters of the interface.\n */\n typeParameters?: TypeParameterDescriptor[] | string[];\n\n /**\n * The JSON Schema that describes the properties of this interface.\n *\n * @remarks\n * This is used to generate the members of the interface based on the properties of the schema.\n */\n schema?: JsonSchema;\n\n /**\n * Documentation for the interface. This can be a string or any Alloy component that renders documentation content (such as `TSDoc`).\n */\n doc?: Children;\n}\n\nexport type InterfaceDeclarationPropertyProps = InterfaceMemberProps &\n ComponentProps & {\n schema: JsonSchema;\n name: string;\n required: boolean;\n defaultValue?: unknown;\n };\n\nexport interface InterfaceExpressionProps {\n children?: Children;\n}\n\nexport const InterfaceExpression = ensureTypeRefContext(\n function InterfaceExpression(props: InterfaceExpressionProps) {\n const scope = useTSLexicalScope();\n const symbol = createSymbol(TSOutputSymbol, \"\", undefined, {\n transient: true,\n binder: scope?.binder\n });\n\n emitSymbol(symbol);\n\n return (\n <group>\n <MemberScope ownerSymbol={symbol}>\n <Block>{props.children}</Block>\n </MemberScope>\n </group>\n );\n }\n);\n\nexport interface InterfaceMemberPropsBase {\n children?: Children;\n name: string | Namekey;\n doc?: Children;\n refkey?: Refkey | Refkey[];\n readOnly?: boolean;\n type?: Children | JsonSchemaPrimitiveType | string;\n nullish?: boolean;\n required?: boolean;\n}\n\nexport interface InterfaceIndexerMemberProps extends InterfaceMemberPropsBase {\n indexer: Children;\n}\n\nexport interface InterfaceTypeMemberProps extends InterfaceMemberPropsBase {\n type: string;\n}\n\nexport interface InterfaceSchemaMemberProps extends InterfaceMemberPropsBase {\n schema: JsonSchema;\n}\n\nexport type InterfaceMemberProps =\n | InterfaceIndexerMemberProps\n | InterfaceTypeMemberProps\n | InterfaceSchemaMemberProps;\n\n/**\n * Create a TypeScript interface member.\n *\n * An interface member can either provide a `name` prop to create a named\n * property, or an `indexer` prop to define an indexer for the interface.\n *\n * The type of the member can be provided either as the `type` prop or as the\n * children of the component.\n */\nexport function InterfaceMember(props: InterfaceMemberProps) {\n const type = (props as InterfaceSchemaMemberProps).schema\n ? stringifyType((props as InterfaceSchemaMemberProps).schema)\n : (props.type ?? props.children);\n\n const readonly =\n ((props as InterfaceSchemaMemberProps).schema &&\n (props as InterfaceSchemaMemberProps).schema?.readOnly) ||\n (!(props as InterfaceSchemaMemberProps).schema && props.readOnly)\n ? \"readonly \"\n : \"\";\n\n if (\"indexer\" in props) {\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n {readonly}[{props.indexer}]: {type}\n </>\n );\n }\n\n const scope = useTSMemberScope();\n const sym = createSymbol(\n TSOutputSymbol,\n (((props as InterfaceSchemaMemberProps).schema\n ? (props as InterfaceSchemaMemberProps).schema?.name\n : undefined) || isSetString(props.name)\n ? props.name\n : props.name.toString()) || uuid().replace(/-/g, \"\"),\n scope.ownerSymbol.staticMembers,\n {\n refkeys: props.refkey,\n tsFlags:\n TSSymbolFlags.TypeSymbol |\n (!!(\n (props as InterfaceSchemaMemberProps).schema &&\n isSchemaNullable((props as InterfaceSchemaMemberProps).schema)\n ) || !!props.nullish\n ? TSSymbolFlags.Nullish\n : TSSymbolFlags.None),\n namePolicy: useTSNamePolicy().for(\"interface-member\"),\n binder: scope.binder\n }\n );\n\n const taken = takeSymbols();\n effect(() => {\n if (taken.size > 1) return;\n const symbol = Array.from(taken)[0];\n if (symbol?.isTransient) {\n symbol.moveMembersTo(sym);\n }\n });\n\n return (\n <MemberDeclaration symbol={sym}>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n {readonly}\n <PropertyName />\n {!props.required ? \"?\" : \"\"}: {type}\n </MemberDeclaration>\n );\n}\n\nconst BaseInterfaceDeclaration = ensureTypeRefContext(\n function InterfaceDeclaration(props: InterfaceDeclarationProps) {\n const ExprSlot = createSymbolSlot();\n\n const children = childrenArray(() => props.children);\n\n const extendsPart = props.extends ? <> extends {props.extends}</> : \"\";\n const filteredChildren = findUnkeyedChildren(children);\n const currentScope = useTSLexicalScope();\n\n const binder = currentScope?.binder;\n const sym = createSymbol(\n TSOutputSymbol,\n (isSetString(props.name) ? props.name : props.name?.toString()) ||\n uuid().replace(/-/g, \"\"),\n currentScope.types,\n {\n refkeys: props.refkey,\n default: props.default,\n export: props.export,\n metadata: props.metadata,\n tsFlags: TSSymbolFlags.TypeSymbol,\n namePolicy: useTSNamePolicy().for(\"interface\"),\n binder\n }\n );\n\n effect(() => {\n if (ExprSlot.ref.value) {\n const takenSymbols = ExprSlot.ref.value;\n for (const symbol of takenSymbols) {\n // ignore non-transient symbols (likely not the result of an expression).\n if (symbol.isTransient) {\n symbol.moveMembersTo(sym);\n }\n }\n }\n });\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n <Declaration {...props} nameKind=\"interface\" kind=\"type\" symbol={sym}>\n interface <Name />\n {props.typeParameters && (\n <TypeParameters parameters={props.typeParameters} />\n )}\n {extendsPart}{\" \"}\n <ExprSlot>\n <InterfaceExpression>{filteredChildren}</InterfaceExpression>\n </ExprSlot>\n </Declaration>\n </>\n );\n }\n);\n\n/**\n * Generates a TypeScript interface for the given schema.\n */\nexport function InterfaceDeclaration(props: InterfaceDeclarationProps) {\n const [{ name, schema, doc }, rest] = splitProps(props, [\n \"name\",\n \"schema\",\n \"doc\"\n ]);\n\n const interfaceName = computed(() =>\n pascalCase(isSetString(name) ? name : schema?.name || schema?.title || \"\")\n );\n const properties = computed(() =>\n schema\n ? getPropertiesList(schema as Parameters<typeof getPropertiesList>[0])\n .filter(property => !property?.ignore)\n .sort((a, b) =>\n (a?.readOnly && b?.readOnly) || (!a?.readOnly && !b?.readOnly)\n ? !a.name && !b.name\n ? 0\n : !a.name\n ? -1\n : !b.name\n ? 1\n : a.name.localeCompare(b.name)\n : a?.readOnly\n ? 1\n : -1\n )\n : []\n );\n\n return (\n <Show\n when={schema && properties.value.length > 0}\n fallback={\n <BaseInterfaceDeclaration\n {...props}\n schema={{\n type: \"object\",\n name: interfaceName.value,\n properties: {}\n }}\n name={interfaceName.value}\n />\n }>\n <SchemaContext.Provider value={schema}>\n <TSDocObjectSchema heading={doc} schema={schema!} />\n <BaseInterfaceDeclaration\n export={true}\n name={interfaceName.value}\n {...rest}>\n <For each={properties} doubleHardline={true} semicolon={true}>\n {property => (\n <InterfaceDeclarationProperty\n name={property.name}\n schema={property}\n required={!!property?.required}\n />\n )}\n </For>\n </BaseInterfaceDeclaration>\n </SchemaContext.Provider>\n </Show>\n );\n}\n\n/**\n * Generates a TypeScript interface property for the given reflection class.\n */\nexport function InterfaceDeclarationProperty(\n props: InterfaceDeclarationPropertyProps\n) {\n const [{ schema, name, required, defaultValue }, rest] = splitProps(props, [\n \"schema\",\n \"name\",\n \"required\",\n \"defaultValue\"\n ]);\n\n return (\n <Show when={isSetString(name)}>\n <SchemaPropertyContext.Provider value={schema}>\n <TSDocSchemaProperty schema={schema} defaultValue={defaultValue} />\n <InterfaceMember\n name={name}\n schema={schema}\n required={required}\n readOnly={schema?.readOnly}\n nullish={isSchemaNullable(schema)}\n type={getPrimarySchemaType(schema)}\n {...rest}\n />\n </SchemaPropertyContext.Provider>\n </Show>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAiCA,MAAM,sBAAA,qBAAA,SAAA,oBAAA,OAAA;CAEJ,MAAA,SAAA,aAAA,gBAAA,IAAA,QAAA;EACA,WAAa;EACf,QAHY,kBAGL,GAAA;CACL,CAAA;CACA,WAAW,MAAA;CACX,OAAA,gBAAoB,SAAA,EACpB,IAAA,WAAc;EACd,OAAA,gBAAa,eAAA;GACb,aAAA;GACA,IAAA,WAAiB;IACjB,OAAA,gBAAgB,OAAA,EAChB,IAAA,WAAA;KACY,OAAI,MAAA;IACX,EACL,CAAA;GACA;EACA,CAAA;CACA,EACA,CAAA;AACF,CAAC;;;;;;;;;;AAUD,SAAS,gBAAuB,OAAM;CACtC,MAAQ,OAAC,MAAY,SAAS,cAAW,MAAO,MAAM,IAAA,MAAA,QAAA,MAAA;CACtD,MAAQ,WAAC,MAAe,UAAQ,MAAS,QAAK,YAAA,CAAA,MAAA,UAAA,MAAA,WAAA,cAAA;CAC9C,IAAM,aAAW,OACjB,OAAS;EAAA,gBAAmB,MAAA;GACtB,IAAG,OAAA;;GAEH;GACJ,IAAQ,WAAW;IACjB,OAAA,gBAAA,OAAA,EACG,IAAK,UAAU;KAClB,OAAA,MAAA;IACM;GAEN;EACA,CAAC;EAAG;EAAS;EAAK,WAAc,MAAI,OAAS;EAAA;EAAA;CAAA;CAE/C,MAAA,QAAc,i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":3,"file":"interface-declaration.mjs","names":[],"sources":["../../../src/typescript/components/interface-declaration.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n Block,\n Children,\n childrenArray,\n computed,\n createSymbol,\n createSymbolSlot,\n effect,\n emitSymbol,\n findUnkeyedChildren,\n For,\n MemberDeclaration,\n Name,\n Namekey,\n Refkey,\n Show,\n splitProps,\n takeSymbols\n} from \"@alloy-js/core\";\nimport {\n CommonDeclarationProps,\n Declaration,\n ensureTypeRefContext,\n TSOutputSymbol,\n TSSymbolFlags,\n TypeParameterDescriptor,\n useTSLexicalScope,\n useTSMemberScope,\n useTSNamePolicy\n} from \"@alloy-js/typescript\";\nimport {\n getPrimarySchemaType,\n getPropertiesList,\n isSchemaNullable,\n JsonSchema,\n JsonSchemaPrimitiveType,\n stringifyType\n} from \"@powerlines/schema\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { PartialKeys } from \"@stryke/types/base\";\nimport { uuid } from \"@stryke/unique-id/uuid\";\nimport {\n SchemaContext,\n SchemaPropertyContext\n} from \"../../core/contexts/schema\";\nimport { ComponentProps } from \"../../types/components\";\nimport { MemberScope } from \"../contexts/member-scope\";\nimport { PropertyName } from \"./property-name\";\nimport { TSDoc } from \"./tsdoc\";\nimport { TSDocObjectSchema, TSDocSchemaProperty } from \"./tsdoc-schema\";\nimport { TypeParameters } from \"./type-parameters\";\n\nexport interface InterfaceDeclarationProps\n extends PartialKeys<CommonDeclarationProps, \"name\">, ComponentProps {\n /**\n * A base type that this interface extends. This can be used to represent inheritance\n */\n extends?: Children;\n\n /**\n * The generic type parameters of the interface.\n */\n typeParameters?: TypeParameterDescriptor[] | string[];\n\n /**\n * The JSON Schema that describes the properties of this interface.\n *\n * @remarks\n * This is used to generate the members of the interface based on the properties of the schema.\n */\n schema?: JsonSchema;\n\n /**\n * Documentation for the interface. This can be a string or any Alloy component that renders documentation content (such as `TSDoc`).\n */\n doc?: Children;\n}\n\nexport type InterfaceDeclarationPropertyProps = InterfaceMemberProps &\n ComponentProps & {\n schema: JsonSchema;\n name: string;\n required: boolean;\n defaultValue?: unknown;\n };\n\nexport interface InterfaceExpressionProps {\n children?: Children;\n}\n\nexport const InterfaceExpression = ensureTypeRefContext(\n function InterfaceExpression(props: InterfaceExpressionProps) {\n const scope = useTSLexicalScope();\n const symbol = createSymbol(TSOutputSymbol, \"\", undefined, {\n transient: true,\n binder: scope?.binder\n });\n\n emitSymbol(symbol);\n\n return (\n <group>\n <MemberScope ownerSymbol={symbol}>\n <Block>{props.children}</Block>\n </MemberScope>\n </group>\n );\n }\n);\n\nexport interface InterfaceMemberPropsBase {\n children?: Children;\n name: string | Namekey;\n doc?: Children;\n refkey?: Refkey | Refkey[];\n readOnly?: boolean;\n type?: Children | JsonSchemaPrimitiveType | string;\n nullish?: boolean;\n required?: boolean;\n}\n\nexport interface InterfaceIndexerMemberProps extends InterfaceMemberPropsBase {\n indexer: Children;\n}\n\nexport interface InterfaceTypeMemberProps extends InterfaceMemberPropsBase {\n type: string;\n}\n\nexport interface InterfaceSchemaMemberProps extends InterfaceMemberPropsBase {\n schema: JsonSchema;\n}\n\nexport type InterfaceMemberProps =\n | InterfaceIndexerMemberProps\n | InterfaceTypeMemberProps\n | InterfaceSchemaMemberProps;\n\n/**\n * Create a TypeScript interface member.\n *\n * An interface member can either provide a `name` prop to create a named\n * property, or an `indexer` prop to define an indexer for the interface.\n *\n * The type of the member can be provided either as the `type` prop or as the\n * children of the component.\n */\nexport function InterfaceMember(props: InterfaceMemberProps) {\n const type = (props as InterfaceSchemaMemberProps).schema\n ? stringifyType((props as InterfaceSchemaMemberProps).schema)\n : (props.type ?? props.children);\n\n const readonly =\n ((props as InterfaceSchemaMemberProps).schema &&\n (props as InterfaceSchemaMemberProps).schema?.readOnly) ||\n (!(props as InterfaceSchemaMemberProps).schema && props.readOnly)\n ? \"readonly \"\n : \"\";\n\n if (\"indexer\" in props) {\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n {readonly}[{props.indexer}]: {type}\n </>\n );\n }\n\n const scope = useTSMemberScope();\n const sym = createSymbol(\n TSOutputSymbol,\n (((props as InterfaceSchemaMemberProps).schema\n ? (props as InterfaceSchemaMemberProps).schema?.name\n : undefined) || isSetString(props.name)\n ? props.name\n : props.name.toString()) || uuid().replace(/-/g, \"\"),\n scope.ownerSymbol.staticMembers,\n {\n refkeys: props.refkey,\n tsFlags:\n TSSymbolFlags.TypeSymbol |\n (!!(\n (props as InterfaceSchemaMemberProps).schema &&\n isSchemaNullable((props as InterfaceSchemaMemberProps).schema)\n ) || !!props.nullish\n ? TSSymbolFlags.Nullish\n : TSSymbolFlags.None),\n namePolicy: useTSNamePolicy().for(\"interface-member\"),\n binder: scope.binder\n }\n );\n\n const taken = takeSymbols();\n effect(() => {\n if (taken.size > 1) return;\n const symbol = Array.from(taken)[0];\n if (symbol?.isTransient) {\n symbol.moveMembersTo(sym);\n }\n });\n\n return (\n <MemberDeclaration symbol={sym}>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n {readonly}\n <PropertyName />\n {!props.required ? \"?\" : \"\"}: {type}\n </MemberDeclaration>\n );\n}\n\nconst BaseInterfaceDeclaration = ensureTypeRefContext(\n function InterfaceDeclaration(props: InterfaceDeclarationProps) {\n const ExprSlot = createSymbolSlot();\n\n const children = childrenArray(() => props.children);\n\n const extendsPart = props.extends ? <> extends {props.extends}</> : \"\";\n const filteredChildren = findUnkeyedChildren(children);\n const currentScope = useTSLexicalScope();\n\n const binder = currentScope?.binder;\n const sym = createSymbol(\n TSOutputSymbol,\n (isSetString(props.name) ? props.name : props.name?.toString()) ||\n uuid().replace(/-/g, \"\"),\n currentScope.types,\n {\n refkeys: props.refkey,\n default: props.default,\n export: props.export,\n metadata: props.metadata,\n tsFlags: TSSymbolFlags.TypeSymbol,\n namePolicy: useTSNamePolicy().for(\"interface\"),\n binder\n }\n );\n\n effect(() => {\n if (ExprSlot.ref.value) {\n const takenSymbols = ExprSlot.ref.value;\n for (const symbol of takenSymbols) {\n // ignore non-transient symbols (likely not the result of an expression).\n if (symbol.isTransient) {\n symbol.moveMembersTo(sym);\n }\n }\n }\n });\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n <Declaration {...props} nameKind=\"interface\" kind=\"type\" symbol={sym}>\n interface <Name />\n {props.typeParameters && (\n <TypeParameters parameters={props.typeParameters} />\n )}\n {extendsPart}{\" \"}\n <ExprSlot>\n <InterfaceExpression>{filteredChildren}</InterfaceExpression>\n </ExprSlot>\n </Declaration>\n </>\n );\n }\n);\n\n/**\n * Generates a TypeScript interface for the given schema.\n */\nexport function InterfaceDeclaration(props: InterfaceDeclarationProps) {\n const [{ name, schema, doc }, rest] = splitProps(props, [\n \"name\",\n \"schema\",\n \"doc\"\n ]);\n\n const interfaceName = computed(() =>\n pascalCase(isSetString(name) ? name : schema?.name || schema?.title || \"\")\n );\n const properties = computed(() =>\n schema\n ? getPropertiesList(schema as Parameters<typeof getPropertiesList>[0])\n .filter(property => !property?.ignore)\n .sort((a, b) =>\n (a?.readOnly && b?.readOnly) || (!a?.readOnly && !b?.readOnly)\n ? !a.name && !b.name\n ? 0\n : !a.name\n ? -1\n : !b.name\n ? 1\n : a.name.localeCompare(b.name)\n : a?.readOnly\n ? 1\n : -1\n )\n : []\n );\n\n return (\n <Show\n when={schema && properties.value.length > 0}\n fallback={\n <BaseInterfaceDeclaration\n {...props}\n schema={{\n type: \"object\",\n name: interfaceName.value,\n properties: {}\n }}\n name={interfaceName.value}\n />\n }>\n <SchemaContext.Provider value={schema}>\n <TSDocObjectSchema heading={doc} schema={schema!} />\n <BaseInterfaceDeclaration\n export={true}\n name={interfaceName.value}\n {...rest}>\n <For each={properties} doubleHardline={true} semicolon={true}>\n {property => (\n <InterfaceDeclarationProperty\n name={property.name}\n schema={property}\n required={!!property?.required}\n />\n )}\n </For>\n </BaseInterfaceDeclaration>\n </SchemaContext.Provider>\n </Show>\n );\n}\n\n/**\n * Generates a TypeScript interface property for the given reflection class.\n */\nexport function InterfaceDeclarationProperty(\n props: InterfaceDeclarationPropertyProps\n) {\n const [{ schema, name, required, defaultValue }, rest] = splitProps(props, [\n \"schema\",\n \"name\",\n \"required\",\n \"defaultValue\"\n ]);\n\n return (\n <Show when={isSetString(name)}>\n <SchemaPropertyContext.Provider value={schema}>\n <TSDocSchemaProperty schema={schema} defaultValue={defaultValue} />\n <InterfaceMember\n name={name}\n schema={schema}\n required={required}\n readOnly={schema?.readOnly}\n nullish={isSchemaNullable(schema)}\n type={getPrimarySchemaType(schema)}\n {...rest}\n />\n </SchemaPropertyContext.Provider>\n </Show>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAM,sBAAA,qBAAA,SAAA,oBAAA,OAAA;CAEJ,MAAA,SAAA,aAAA,gBAAA,IAAA,QAAA;EACA,WAAa;EACf,QAHY,kBAGL,GAAA;CACL,CAAA;CACA,WAAW,MAAA;CACX,OAAA,gBAAoB,SAAA,EACpB,IAAA,WAAc;EACd,OAAA,gBAAa,eAAA;GACb,aAAA;GACA,IAAA,WAAiB;IACjB,OAAA,gBAAgB,OAAA,EAChB,IAAA,WAAA;KACY,OAAI,MAAA;IACX,EACL,CAAA;GACA;EACA,CAAA;CACA,EACA,CAAA;AACF,CAAC;;;;;;;;;;AAUD,SAAS,gBAAuB,OAAM;CACtC,MAAQ,OAAC,MAAY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ACpB;EACA,IAAI,WAAS;GACX,OAAE,gBAAsB,sBAAA,UAAA;IACtB,OAAO;IACP,IAAA,WAAe;KACf,OAAS,CAAA,gBAAc,qBAAU;MACrB;MACZ;KACF,CAAA,GAAA,gBAAA,iBAAA,WAAA;MACD;;MAEY;MACP,IAAA,WAAa;OACT,OAAA,QAAe;MACjB;MACA,IAAC,UAAW;OACV,OAAO,iBAAa,MAAA;MACtB;MACF,IAAA,OAAA;OACF,OAAA,qBAAA,MAAA;MACF;KACA,GAAA,IAAA,CAAA,CAAA;;GAEF,CAAA;EACA;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const require_chunk_artifact = require('../../node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.cjs');
|
|
2
|
+
const require_test_DNmyFkvJ = require('../../node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.cjs');
|
|
3
|
+
const require_typescript_components_interface_declaration = require('./interface-declaration.cjs');
|
|
4
|
+
|
|
5
|
+
//#region src/typescript/components/interface-declaration.test.ts
|
|
6
|
+
require_chunk_artifact.describe("plugins/plugin-alloy/src/typescript/components/interface-declaration.tsx", () => {
|
|
7
|
+
require_chunk_artifact.it("loads module exports", () => {
|
|
8
|
+
require_test_DNmyFkvJ.globalExpect(require_typescript_components_interface_declaration.interface_declaration_exports).toBeDefined();
|
|
9
|
+
require_test_DNmyFkvJ.globalExpect(typeof require_typescript_components_interface_declaration.interface_declaration_exports).toBe("object");
|
|
10
|
+
});
|
|
11
|
+
require_chunk_artifact.it("has at least one runtime export", () => {
|
|
12
|
+
require_test_DNmyFkvJ.globalExpect(Object.keys(require_typescript_components_interface_declaration.interface_declaration_exports).length).toBeGreaterThan(0);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { describe, it } from "../../node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.mjs";
|
|
2
|
+
import { globalExpect } from "../../node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs";
|
|
3
|
+
import { interface_declaration_exports } from "./interface-declaration.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/typescript/components/interface-declaration.test.ts
|
|
6
|
+
describe("plugins/plugin-alloy/src/typescript/components/interface-declaration.tsx", () => {
|
|
7
|
+
it("loads module exports", () => {
|
|
8
|
+
globalExpect(interface_declaration_exports).toBeDefined();
|
|
9
|
+
globalExpect(typeof interface_declaration_exports).toBe("object");
|
|
10
|
+
});
|
|
11
|
+
it("has at least one runtime export", () => {
|
|
12
|
+
globalExpect(Object.keys(interface_declaration_exports).length).toBeGreaterThan(0);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { };
|
|
18
|
+
//# sourceMappingURL=interface-declaration.test.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface-declaration.test.mjs","names":[],"sources":["../../../src/typescript/components/interface-declaration.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./interface-declaration\";\n\ndescribe(\"plugins/plugin-alloy/src/typescript/components/interface-declaration.tsx\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n\n it(\"has at least one runtime export\", () => {\n expect(Object.keys(moduleExports).length).toBeGreaterThan(0);\n });\n});\n"],"mappings":";;;;;;CAGA,GAAA,8BAAmC;EAC/B,aAAO,6BAAQ,EAAO,YAAS;EAC/B,aAAO,OAAA,6BAAe,EAAA,KAAY,QAAC;CACrC,CAAC;CACD,GAAE,yCAAA;;CAEF,CAAA;AACF,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
2
3
|
const require_core_contexts_schema = require('../../core/contexts/schema.cjs');
|
|
3
4
|
const require_typescript_components_tsdoc_schema = require('./tsdoc-schema.cjs');
|
|
4
5
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
@@ -10,6 +11,10 @@ let _powerlines_schema = require("@powerlines/schema");
|
|
|
10
11
|
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
11
12
|
|
|
12
13
|
//#region src/typescript/components/object-declaration.tsx
|
|
14
|
+
var object_declaration_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
15
|
+
ObjectDeclaration: () => ObjectDeclaration,
|
|
16
|
+
ObjectDeclarationProperty: () => ObjectDeclarationProperty
|
|
17
|
+
});
|
|
13
18
|
/**
|
|
14
19
|
* Generates a TypeScript object for the given reflection class.
|
|
15
20
|
*/
|
|
@@ -128,4 +133,10 @@ function ObjectDeclarationProperty(props) {
|
|
|
128
133
|
|
|
129
134
|
//#endregion
|
|
130
135
|
exports.ObjectDeclaration = ObjectDeclaration;
|
|
131
|
-
exports.ObjectDeclarationProperty = ObjectDeclarationProperty;
|
|
136
|
+
exports.ObjectDeclarationProperty = ObjectDeclarationProperty;
|
|
137
|
+
Object.defineProperty(exports, 'object_declaration_exports', {
|
|
138
|
+
enumerable: true,
|
|
139
|
+
get: function () {
|
|
140
|
+
return object_declaration_exports;
|
|
141
|
+
}
|
|
142
|
+
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __exportAll } from "../../_virtual/_rolldown/runtime.mjs";
|
|
1
2
|
import { SchemaContext, SchemaPropertyContext } from "../../core/contexts/schema.mjs";
|
|
2
3
|
import { TSDocObjectSchema, TSDocSchemaProperty } from "./tsdoc-schema.mjs";
|
|
3
4
|
import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
@@ -9,6 +10,10 @@ import { getPropertiesList, stringifyValue } from "@powerlines/schema";
|
|
|
9
10
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
10
11
|
|
|
11
12
|
//#region src/typescript/components/object-declaration.tsx
|
|
13
|
+
var object_declaration_exports = /* @__PURE__ */ __exportAll({
|
|
14
|
+
ObjectDeclaration: () => ObjectDeclaration,
|
|
15
|
+
ObjectDeclarationProperty: () => ObjectDeclarationProperty
|
|
16
|
+
});
|
|
12
17
|
/**
|
|
13
18
|
* Generates a TypeScript object for the given reflection class.
|
|
14
19
|
*/
|
|
@@ -126,5 +131,5 @@ function ObjectDeclarationProperty(props) {
|
|
|
126
131
|
}
|
|
127
132
|
|
|
128
133
|
//#endregion
|
|
129
|
-
export { ObjectDeclaration, ObjectDeclarationProperty };
|
|
134
|
+
export { ObjectDeclaration, ObjectDeclarationProperty, object_declaration_exports };
|
|
130
135
|
//# sourceMappingURL=object-declaration.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object-declaration.mjs","names":[],"sources":["../../../src/typescript/components/object-declaration.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n computed,\n Declaration as CoreDeclaration,\n createSymbolSlot,\n For,\n Name,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n createValueSymbol,\n ObjectExpression,\n ObjectProperty,\n TSSymbolFlags,\n TypeRefContext,\n useTSNamePolicy,\n VarDeclarationProps\n} from \"@alloy-js/typescript\";\nimport {\n getPropertiesList,\n JsonSchema,\n JsonSchemaObject,\n JsonSchemaType,\n stringifyValue\n} from \"@powerlines/schema\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport {\n SchemaContext,\n SchemaPropertyContext\n} from \"../../core/contexts/schema\";\nimport { ComponentProps } from \"../../types/components\";\nimport { TSDocObjectSchema, TSDocSchemaProperty } from \"./tsdoc-schema\";\n\nexport interface ObjectDeclarationProps extends VarDeclarationProps {\n schema?: JsonSchemaObject;\n}\n\n/**\n * Generates a TypeScript object for the given reflection class.\n */\nexport function ObjectDeclaration(props: ObjectDeclarationProps) {\n const { schema } = props;\n if (!schema) {\n return null;\n }\n\n const name = computed(() =>\n camelCase(isSetString(props.name) ? props.name : schema?.name)\n );\n\n const defaultValues = computed(() =>\n Object.fromEntries(\n getPropertiesList(schema).map(property => [\n property.name,\n property.default\n ]) || {}\n )\n );\n const properties = computed(() =>\n getPropertiesList(schema)\n .filter(\n property =>\n !property?.ignore &&\n !property?.runtime &&\n !isUndefined(\n defaultValues.value[property.name] ??\n property?.alias?.reduce((ret, alias) => {\n if (\n isUndefined(ret) &&\n !isUndefined(defaultValues.value[alias])\n ) {\n return defaultValues.value[alias];\n }\n\n return ret;\n }, undefined as any) ??\n property?.default\n )\n )\n .sort((a, b) =>\n (a?.readOnly && b?.readOnly) || (!a?.readOnly && !b?.readOnly)\n ? a.name.localeCompare(b.name)\n : a?.readOnly\n ? 1\n : -1\n )\n );\n\n const TypeSymbolSlot = createSymbolSlot();\n const ValueTypeSymbolSlot = createSymbolSlot();\n const sym = createValueSymbol(name.value || \"schema\", {\n refkeys: props.refkey,\n default: props.default,\n export: props.export,\n metadata: props.metadata,\n tsFlags: props.nullish ? TSSymbolFlags.Nullish : TSSymbolFlags.None,\n type: props.type ? TypeSymbolSlot.firstSymbol : undefined,\n namePolicy: useTSNamePolicy().for(\"variable\")\n });\n\n if (!props.type) {\n ValueTypeSymbolSlot.moveMembersTo(sym);\n }\n\n const keyword = props.var ? \"var\" : props.let ? \"let\" : \"const\";\n const type = props.type ? (\n <TypeRefContext>\n : <TypeSymbolSlot>{props.type}</TypeSymbolSlot>\n </TypeRefContext>\n ) : undefined;\n\n return (\n <Show when={!!schema}>\n <SchemaContext.Provider value={schema}>\n <Show when={!!name.value && !!type}>\n <TSDocObjectSchema schema={schema} />\n <CoreDeclaration symbol={sym}>\n {props.export ? \"export \" : \"\"}\n {props.default ? \"default \" : \"\"}\n {keyword} <Name />\n {type} ={\" \"}\n <ValueTypeSymbolSlot>\n {props.initializer ?? props.children ?? (\n <ObjectExpression>\n <For\n each={properties.value ?? []}\n comma={true}\n doubleHardline={true}>\n {property => (\n <ObjectDeclarationProperty\n name={property.name}\n schema={property}\n />\n )}\n </For>\n </ObjectExpression>\n )}\n </ValueTypeSymbolSlot>\n </CoreDeclaration>\n </Show>\n <hbr />\n </SchemaContext.Provider>\n </Show>\n );\n}\n\nexport interface ObjectDeclarationPropertyProps extends ComponentProps {\n name: string;\n required?: boolean;\n value?: unknown;\n schema: JsonSchema;\n}\n\n/**\n * Generates a TypeScript object property for the given reflection class.\n */\nexport function ObjectDeclarationProperty(\n props: ObjectDeclarationPropertyProps\n) {\n const [{ schema, name, value }, rest] = splitProps(props, [\n \"schema\",\n \"name\",\n \"value\"\n ]);\n\n return (\n <Show when={isSetString(name)}>\n <SchemaPropertyContext.Provider value={schema}>\n <TSDocSchemaProperty schema={schema} defaultValue={value} />\n <ObjectProperty\n name={name}\n value={stringifyValue(\n value,\n (schema as { type?: JsonSchemaType }).type\n )}\n {...rest}\n />\n <hbr />\n </SchemaPropertyContext.Provider>\n </Show>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"object-declaration.mjs","names":[],"sources":["../../../src/typescript/components/object-declaration.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n computed,\n Declaration as CoreDeclaration,\n createSymbolSlot,\n For,\n Name,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n createValueSymbol,\n ObjectExpression,\n ObjectProperty,\n TSSymbolFlags,\n TypeRefContext,\n useTSNamePolicy,\n VarDeclarationProps\n} from \"@alloy-js/typescript\";\nimport {\n getPropertiesList,\n JsonSchema,\n JsonSchemaObject,\n JsonSchemaType,\n stringifyValue\n} from \"@powerlines/schema\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport {\n SchemaContext,\n SchemaPropertyContext\n} from \"../../core/contexts/schema\";\nimport { ComponentProps } from \"../../types/components\";\nimport { TSDocObjectSchema, TSDocSchemaProperty } from \"./tsdoc-schema\";\n\nexport interface ObjectDeclarationProps extends VarDeclarationProps {\n schema?: JsonSchemaObject;\n}\n\n/**\n * Generates a TypeScript object for the given reflection class.\n */\nexport function ObjectDeclaration(props: ObjectDeclarationProps) {\n const { schema } = props;\n if (!schema) {\n return null;\n }\n\n const name = computed(() =>\n camelCase(isSetString(props.name) ? props.name : schema?.name)\n );\n\n const defaultValues = computed(() =>\n Object.fromEntries(\n getPropertiesList(schema).map(property => [\n property.name,\n property.default\n ]) || {}\n )\n );\n const properties = computed(() =>\n getPropertiesList(schema)\n .filter(\n property =>\n !property?.ignore &&\n !property?.runtime &&\n !isUndefined(\n defaultValues.value[property.name] ??\n property?.alias?.reduce((ret, alias) => {\n if (\n isUndefined(ret) &&\n !isUndefined(defaultValues.value[alias])\n ) {\n return defaultValues.value[alias];\n }\n\n return ret;\n }, undefined as any) ??\n property?.default\n )\n )\n .sort((a, b) =>\n (a?.readOnly && b?.readOnly) || (!a?.readOnly && !b?.readOnly)\n ? a.name.localeCompare(b.name)\n : a?.readOnly\n ? 1\n : -1\n )\n );\n\n const TypeSymbolSlot = createSymbolSlot();\n const ValueTypeSymbolSlot = createSymbolSlot();\n const sym = createValueSymbol(name.value || \"schema\", {\n refkeys: props.refkey,\n default: props.default,\n export: props.export,\n metadata: props.metadata,\n tsFlags: props.nullish ? TSSymbolFlags.Nullish : TSSymbolFlags.None,\n type: props.type ? TypeSymbolSlot.firstSymbol : undefined,\n namePolicy: useTSNamePolicy().for(\"variable\")\n });\n\n if (!props.type) {\n ValueTypeSymbolSlot.moveMembersTo(sym);\n }\n\n const keyword = props.var ? \"var\" : props.let ? \"let\" : \"const\";\n const type = props.type ? (\n <TypeRefContext>\n : <TypeSymbolSlot>{props.type}</TypeSymbolSlot>\n </TypeRefContext>\n ) : undefined;\n\n return (\n <Show when={!!schema}>\n <SchemaContext.Provider value={schema}>\n <Show when={!!name.value && !!type}>\n <TSDocObjectSchema schema={schema} />\n <CoreDeclaration symbol={sym}>\n {props.export ? \"export \" : \"\"}\n {props.default ? \"default \" : \"\"}\n {keyword} <Name />\n {type} ={\" \"}\n <ValueTypeSymbolSlot>\n {props.initializer ?? props.children ?? (\n <ObjectExpression>\n <For\n each={properties.value ?? []}\n comma={true}\n doubleHardline={true}>\n {property => (\n <ObjectDeclarationProperty\n name={property.name}\n schema={property}\n />\n )}\n </For>\n </ObjectExpression>\n )}\n </ValueTypeSymbolSlot>\n </CoreDeclaration>\n </Show>\n <hbr />\n </SchemaContext.Provider>\n </Show>\n );\n}\n\nexport interface ObjectDeclarationPropertyProps extends ComponentProps {\n name: string;\n required?: boolean;\n value?: unknown;\n schema: JsonSchema;\n}\n\n/**\n * Generates a TypeScript object property for the given reflection class.\n */\nexport function ObjectDeclarationProperty(\n props: ObjectDeclarationPropertyProps\n) {\n const [{ schema, name, value }, rest] = splitProps(props, [\n \"schema\",\n \"name\",\n \"value\"\n ]);\n\n return (\n <Show when={isSetString(name)}>\n <SchemaPropertyContext.Provider value={schema}>\n <TSDocSchemaProperty schema={schema} defaultValue={value} />\n <ObjectProperty\n name={name}\n value={stringifyValue(\n value,\n (schema as { type?: JsonSchemaType }).type\n )}\n {...rest}\n />\n <hbr />\n </SchemaPropertyContext.Provider>\n </Show>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA+BA,SAAe,kBAAA,OAAA;CACb,MAAA,EACA,WACA;CACA,IAAI,CAAC,QACP,OAAO;CAEL,MAAA,OAAU,eAAA,UAAA,YAAA,MAAA,IAAA,IAAA,MAAA,OAAA,QAAA,IAAA,CAAA;CACV,MAAA,gBAAgB,eAAA,OAAA,YAAA,kBAAA,MAAA,EAAA,KAAA,aAAA,CAAA,SAAA,MAAA,SAAA,OAAA,CAAA,KAAA,CAAA,CAAA,CAAA;CAChB,MAAA,aAAc,eAAA,kBAAA,MAAA,EAAA,QAAA,aAAA,CAAA,UAAA,UAAA,CAAA,UAAA,WAAA,CAAA,YAAA,cAAA,MAAA,SAAA,SAAA,UAAA,OAAA,QAAA,KAAA,UAAA;EACd,IAAA,YAAA,GAAA,KAAA,CAAA,YAAA,cAAA,MAAA,MAAA,GACI,OAAG,cAAkB,MAAA;EAE3B,OAAS;CACT,GAAA,MAAS,KAAA,UAAoB,OAAO,CAAC,EAAA,MAAK,GAAM,MAAI,GAAA,YAAU,GAAA,YAAA,CAAA,GAAA,YAAA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AAA,OAAc;cACvB,OAAA,WAAA,SAAA,CAAA;;aAEU,OAAA;aACC,gBAAS;aACZ,WAAA,aAAA,gBAAA,2BAAA;cACd,IAAA,OAAA;eACJ,OAAA,SAAA;cACc;cACO,QAAW;aACnB,CAAA;YACJ,CAAA;WACD,EACC,CAAA;UACT,EACH,CAAA;SAAA;;OAEK,CAAA,CAAA;MACA;KACA,CAAG,GAAG,gBAAkB,OAAK,CAAA,CAAA,CAAK;IACtC;GACA,CAAA;EACA;CACF,CAAC;AACH;;;;;CAKE,MAAK,CAAA,EACH,QACF,eAEA,QAAM,WAAgB,OAAO;EAAA;EAAO;EAAY;CAAO,CAAC;CACxD,OAAM,gBAAmB,MAAC;EACxB,IAAC,OAAA;GACC,OAAG,YAAgB,IAAA;EACrB;EACA,IAAE,WAAS;;IAEP,OAAC;IACJ,IAAK,WAAQ;KACX,OAAA;MAAA,gBAA6B,qBAAQ;OACxB;OACT,cAAA;MACD,CAAC;MAAA,gBAAgB,gBAAY,WAAA;OACrB;OACN,IAAC,QAAM;QACN,OAAQ,eAAQ,OAAA,OAAA,IAAA;OACjB;MACF,GAAG,IAAA,CAAA;MAAA,gBAAmB,OAAA,CAAA,CAAA;KAAA;IACxB;GACF,CAAC;EACH;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const require_chunk_artifact = require('../../node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.cjs');
|
|
2
|
+
const require_test_DNmyFkvJ = require('../../node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.cjs');
|
|
3
|
+
const require_typescript_components_object_declaration = require('./object-declaration.cjs');
|
|
4
|
+
|
|
5
|
+
//#region src/typescript/components/object-declaration.test.ts
|
|
6
|
+
require_chunk_artifact.describe("plugins/plugin-alloy/src/typescript/components/object-declaration.tsx", () => {
|
|
7
|
+
require_chunk_artifact.it("loads module exports", () => {
|
|
8
|
+
require_test_DNmyFkvJ.globalExpect(require_typescript_components_object_declaration.object_declaration_exports).toBeDefined();
|
|
9
|
+
require_test_DNmyFkvJ.globalExpect(typeof require_typescript_components_object_declaration.object_declaration_exports).toBe("object");
|
|
10
|
+
});
|
|
11
|
+
require_chunk_artifact.it("has at least one runtime export", () => {
|
|
12
|
+
require_test_DNmyFkvJ.globalExpect(Object.keys(require_typescript_components_object_declaration.object_declaration_exports).length).toBeGreaterThan(0);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { describe, it } from "../../node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.mjs";
|
|
2
|
+
import { globalExpect } from "../../node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs";
|
|
3
|
+
import { object_declaration_exports } from "./object-declaration.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/typescript/components/object-declaration.test.ts
|
|
6
|
+
describe("plugins/plugin-alloy/src/typescript/components/object-declaration.tsx", () => {
|
|
7
|
+
it("loads module exports", () => {
|
|
8
|
+
globalExpect(object_declaration_exports).toBeDefined();
|
|
9
|
+
globalExpect(typeof object_declaration_exports).toBe("object");
|
|
10
|
+
});
|
|
11
|
+
it("has at least one runtime export", () => {
|
|
12
|
+
globalExpect(Object.keys(object_declaration_exports).length).toBeGreaterThan(0);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { };
|
|
18
|
+
//# sourceMappingURL=object-declaration.test.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object-declaration.test.mjs","names":[],"sources":["../../../src/typescript/components/object-declaration.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./object-declaration\";\n\ndescribe(\"plugins/plugin-alloy/src/typescript/components/object-declaration.tsx\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n\n it(\"has at least one runtime export\", () => {\n expect(Object.keys(moduleExports).length).toBeGreaterThan(0);\n });\n});\n"],"mappings":";;;;;;CAGA,GAAA,8BAAmC;EAC/B,aAAO,0BAAQ,EAAO,YAAS;EAC/B,aAAO,OAAA,0BAAe,EAAA,KAAY,QAAC;CACrC,CAAC;CACD,GAAE,yCAAA;;CAEF,CAAA;AACF,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
2
3
|
const require_typescript_helpers_utilities = require('../helpers/utilities.cjs');
|
|
3
4
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
4
5
|
let _alloy_js_core = require("@alloy-js/core");
|
|
5
6
|
|
|
6
7
|
//#region src/typescript/components/property-name.tsx
|
|
8
|
+
var property_name_exports = /* @__PURE__ */ require_runtime.__exportAll({ PropertyName: () => PropertyName });
|
|
7
9
|
/**
|
|
8
10
|
* A TypeScript property name for an interface, class, or object member.
|
|
9
11
|
*
|
|
@@ -28,4 +30,10 @@ function quoteIfNeeded(name) {
|
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
//#endregion
|
|
31
|
-
exports.PropertyName = PropertyName;
|
|
33
|
+
exports.PropertyName = PropertyName;
|
|
34
|
+
Object.defineProperty(exports, 'property_name_exports', {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () {
|
|
37
|
+
return property_name_exports;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { __exportAll } from "../../_virtual/_rolldown/runtime.mjs";
|
|
1
2
|
import { isValidJSIdentifier } from "../helpers/utilities.mjs";
|
|
2
3
|
import { memo } from "@alloy-js/core/jsx-runtime";
|
|
3
4
|
import { MemberDeclarationContext, memo as memo$1, useContext } from "@alloy-js/core";
|
|
4
5
|
|
|
5
6
|
//#region src/typescript/components/property-name.tsx
|
|
7
|
+
var property_name_exports = /* @__PURE__ */ __exportAll({ PropertyName: () => PropertyName });
|
|
6
8
|
/**
|
|
7
9
|
* A TypeScript property name for an interface, class, or object member.
|
|
8
10
|
*
|
|
@@ -27,5 +29,5 @@ function quoteIfNeeded(name) {
|
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
//#endregion
|
|
30
|
-
export { PropertyName };
|
|
32
|
+
export { PropertyName, property_name_exports };
|
|
31
33
|
//# sourceMappingURL=property-name.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-name.mjs","names":[],"sources":["../../../src/typescript/components/property-name.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { MemberDeclarationContext, memo, useContext } from \"@alloy-js/core\";\nimport { TSOutputSymbol } from \"@alloy-js/typescript\";\nimport { isValidJSIdentifier } from \"../helpers/utilities\";\n\nexport interface PropertyNameProps {\n /**\n * The name of the property.\n */\n name?: string;\n\n /**\n * Whether the property is a private property. If `true`, the property will be prefixed with `#`.\n */\n private?: boolean;\n}\n\n/**\n * A TypeScript property name for an interface, class, or object member.\n *\n * @remarks\n * If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.\n */\nexport function PropertyName(props: PropertyNameProps) {\n if (props.name) {\n return memo(() => {\n if (props.private) {\n return `#${props.name}`;\n }\n return quoteIfNeeded(props.name!);\n });\n } else {\n const declSymbol = useContext(MemberDeclarationContext) as TSOutputSymbol;\n if (!declSymbol) {\n return \"(no member declaration context)\";\n }\n\n if (declSymbol.isPrivateMemberSymbol) {\n return <>#{declSymbol.name}</>;\n } else {\n return <>{quoteIfNeeded(declSymbol.name)}</>;\n }\n }\n}\n\nfunction quoteIfNeeded(name: string) {\n if (isValidJSIdentifier(name)) {\n return name;\n } else {\n return `\"${name.replace(/\"/g, '\\\\\"')}\"`;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"property-name.mjs","names":[],"sources":["../../../src/typescript/components/property-name.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { MemberDeclarationContext, memo, useContext } from \"@alloy-js/core\";\nimport { TSOutputSymbol } from \"@alloy-js/typescript\";\nimport { isValidJSIdentifier } from \"../helpers/utilities\";\n\nexport interface PropertyNameProps {\n /**\n * The name of the property.\n */\n name?: string;\n\n /**\n * Whether the property is a private property. If `true`, the property will be prefixed with `#`.\n */\n private?: boolean;\n}\n\n/**\n * A TypeScript property name for an interface, class, or object member.\n *\n * @remarks\n * If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.\n */\nexport function PropertyName(props: PropertyNameProps) {\n if (props.name) {\n return memo(() => {\n if (props.private) {\n return `#${props.name}`;\n }\n return quoteIfNeeded(props.name!);\n });\n } else {\n const declSymbol = useContext(MemberDeclarationContext) as TSOutputSymbol;\n if (!declSymbol) {\n return \"(no member declaration context)\";\n }\n\n if (declSymbol.isPrivateMemberSymbol) {\n return <>#{declSymbol.name}</>;\n } else {\n return <>{quoteIfNeeded(declSymbol.name)}</>;\n }\n }\n}\n\nfunction quoteIfNeeded(name: string) {\n if (isValidJSIdentifier(name)) {\n return name;\n } else {\n return `\"${name.replace(/\"/g, '\\\\\"')}\"`;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AA4BA,SAAI,aAAA,OAAA;CACF,IAAG,MAAO,MACR,OAAA,aAAA;EACF,IAAQ,MAAE,SACZ,OAAA,IAAA,MAAA;EAEE,OAAA,cAAA,MAAA,IAAA;CACE,CAAC;MACJ;EACG,MAAA,aAAA,WAAA,wBAAA;EACD,IAAG,CAAG,YACP,OAAA;EAEE,IAAE,WAAY,uBACd,OAAO,CAAA,KAAQ,WAAG,WAAA,IAAA,CAAA;OAEhB,OAAE,CAAM,WAAW,cAAM,WAAA,IAAA,CAAA,CAAA;CAE7B;AACF;AACA,SAAS,cAAA,MAAA;CACP,IAAE,oBAAmB,IAAA,GACnB,OAAK;MAEL,OAAA,IAAA,KAAA,QAAA,MAAA,MAAA,EAAA;AAEJ"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const require_chunk_artifact = require('../../node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.cjs');
|
|
2
|
+
const require_test_DNmyFkvJ = require('../../node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.cjs');
|
|
3
|
+
const require_typescript_components_property_name = require('./property-name.cjs');
|
|
4
|
+
|
|
5
|
+
//#region src/typescript/components/property-name.test.ts
|
|
6
|
+
require_chunk_artifact.describe("plugins/plugin-alloy/src/typescript/components/property-name.tsx", () => {
|
|
7
|
+
require_chunk_artifact.it("loads module exports", () => {
|
|
8
|
+
require_test_DNmyFkvJ.globalExpect(require_typescript_components_property_name.property_name_exports).toBeDefined();
|
|
9
|
+
require_test_DNmyFkvJ.globalExpect(typeof require_typescript_components_property_name.property_name_exports).toBe("object");
|
|
10
|
+
});
|
|
11
|
+
require_chunk_artifact.it("has at least one runtime export", () => {
|
|
12
|
+
require_test_DNmyFkvJ.globalExpect(Object.keys(require_typescript_components_property_name.property_name_exports).length).toBeGreaterThan(0);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { describe, it } from "../../node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.mjs";
|
|
2
|
+
import { globalExpect } from "../../node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs";
|
|
3
|
+
import { property_name_exports } from "./property-name.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/typescript/components/property-name.test.ts
|
|
6
|
+
describe("plugins/plugin-alloy/src/typescript/components/property-name.tsx", () => {
|
|
7
|
+
it("loads module exports", () => {
|
|
8
|
+
globalExpect(property_name_exports).toBeDefined();
|
|
9
|
+
globalExpect(typeof property_name_exports).toBe("object");
|
|
10
|
+
});
|
|
11
|
+
it("has at least one runtime export", () => {
|
|
12
|
+
globalExpect(Object.keys(property_name_exports).length).toBeGreaterThan(0);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { };
|
|
18
|
+
//# sourceMappingURL=property-name.test.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-name.test.mjs","names":[],"sources":["../../../src/typescript/components/property-name.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./property-name\";\n\ndescribe(\"plugins/plugin-alloy/src/typescript/components/property-name.tsx\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n\n it(\"has at least one runtime export\", () => {\n expect(Object.keys(moduleExports).length).toBeGreaterThan(0);\n });\n});\n"],"mappings":";;;;;;CAGA,GAAA,8BAAmC;EAC/B,aAAO,qBAAQ,EAAO,YAAS;EAC/B,aAAO,OAAA,qBAAe,EAAA,KAAY,QAAC;CACrC,CAAC;CACD,GAAE,yCAAA;;CAEF,CAAA;AACF,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
2
3
|
let _alloy_js_core = require("@alloy-js/core");
|
|
3
4
|
|
|
4
5
|
//#region src/typescript/components/record-expression.tsx
|
|
6
|
+
var record_expression_exports = /* @__PURE__ */ require_runtime.__exportAll({ RecordExpression: () => RecordExpression });
|
|
5
7
|
function RecordExpression({ elementType }) {
|
|
6
8
|
return _alloy_js_core.code`
|
|
7
9
|
Record<string, ${elementType}>
|
|
@@ -9,4 +11,10 @@ function RecordExpression({ elementType }) {
|
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
//#endregion
|
|
12
|
-
exports.RecordExpression = RecordExpression;
|
|
14
|
+
exports.RecordExpression = RecordExpression;
|
|
15
|
+
Object.defineProperty(exports, 'record_expression_exports', {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () {
|
|
18
|
+
return record_expression_exports;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-expression.d.cts","names":[],"sources":["../../../src/typescript/components/record-expression.tsx"],"mappings":";;;UAoBiB,qBAAA;EACf,WAAA,EAAa,QAAQ;AAAA;AAAA,iBAGP,gBAAA
|
|
1
|
+
{"version":3,"file":"record-expression.d.cts","names":[],"sources":["../../../src/typescript/components/record-expression.tsx"],"mappings":";;;UAoBiB,qBAAA;EACf,WAAA,EAAa,QAAQ;AAAA;AAAA,iBAGP,gBAAA;EAAmB;AAAA,GAAe,qBAAA,GAAqB,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-expression.d.mts","names":[],"sources":["../../../src/typescript/components/record-expression.tsx"],"mappings":";;;UAoBiB,qBAAA;EACf,WAAA,EAAa,QAAQ;AAAA;AAAA,iBAGP,gBAAA
|
|
1
|
+
{"version":3,"file":"record-expression.d.mts","names":[],"sources":["../../../src/typescript/components/record-expression.tsx"],"mappings":";;;UAoBiB,qBAAA;EACf,WAAA,EAAa,QAAQ;AAAA;AAAA,iBAGP,gBAAA;EAAmB;AAAA,GAAe,qBAAA,GAAqB,QAAA"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { __exportAll } from "../../_virtual/_rolldown/runtime.mjs";
|
|
1
2
|
import { code } from "@alloy-js/core";
|
|
2
3
|
|
|
3
4
|
//#region src/typescript/components/record-expression.tsx
|
|
5
|
+
var record_expression_exports = /* @__PURE__ */ __exportAll({ RecordExpression: () => RecordExpression });
|
|
4
6
|
function RecordExpression({ elementType }) {
|
|
5
7
|
return code`
|
|
6
8
|
Record<string, ${elementType}>
|
|
@@ -8,5 +10,5 @@ function RecordExpression({ elementType }) {
|
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
//#endregion
|
|
11
|
-
export { RecordExpression };
|
|
13
|
+
export { RecordExpression, record_expression_exports };
|
|
12
14
|
//# sourceMappingURL=record-expression.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-expression.mjs","names":[],"sources":["../../../src/typescript/components/record-expression.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Children, code } from \"@alloy-js/core\";\n\nexport interface RecordExpressionProps {\n elementType: Children;\n}\n\nexport function RecordExpression({ elementType }: RecordExpressionProps) {\n return code`\n Record<string, ${elementType}>\n `;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"record-expression.mjs","names":[],"sources":["../../../src/typescript/components/record-expression.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Children, code } from \"@alloy-js/core\";\n\nexport interface RecordExpressionProps {\n elementType: Children;\n}\n\nexport function RecordExpression({ elementType }: RecordExpressionProps) {\n return code`\n Record<string, ${elementType}>\n `;\n}\n"],"mappings":";;;;;4BAoBA,eACE;CACF,OAAA,IAAA;;;AAGA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const require_chunk_artifact = require('../../node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.cjs');
|
|
2
|
+
const require_test_DNmyFkvJ = require('../../node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.cjs');
|
|
3
|
+
const require_typescript_components_record_expression = require('./record-expression.cjs');
|
|
4
|
+
|
|
5
|
+
//#region src/typescript/components/record-expression.test.ts
|
|
6
|
+
require_chunk_artifact.describe("plugins/plugin-alloy/src/typescript/components/record-expression.tsx", () => {
|
|
7
|
+
require_chunk_artifact.it("loads module exports", () => {
|
|
8
|
+
require_test_DNmyFkvJ.globalExpect(require_typescript_components_record_expression.record_expression_exports).toBeDefined();
|
|
9
|
+
require_test_DNmyFkvJ.globalExpect(typeof require_typescript_components_record_expression.record_expression_exports).toBe("object");
|
|
10
|
+
});
|
|
11
|
+
require_chunk_artifact.it("has at least one runtime export", () => {
|
|
12
|
+
require_test_DNmyFkvJ.globalExpect(Object.keys(require_typescript_components_record_expression.record_expression_exports).length).toBeGreaterThan(0);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { describe, it } from "../../node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.mjs";
|
|
2
|
+
import { globalExpect } from "../../node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs";
|
|
3
|
+
import { record_expression_exports } from "./record-expression.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/typescript/components/record-expression.test.ts
|
|
6
|
+
describe("plugins/plugin-alloy/src/typescript/components/record-expression.tsx", () => {
|
|
7
|
+
it("loads module exports", () => {
|
|
8
|
+
globalExpect(record_expression_exports).toBeDefined();
|
|
9
|
+
globalExpect(typeof record_expression_exports).toBe("object");
|
|
10
|
+
});
|
|
11
|
+
it("has at least one runtime export", () => {
|
|
12
|
+
globalExpect(Object.keys(record_expression_exports).length).toBeGreaterThan(0);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { };
|
|
18
|
+
//# sourceMappingURL=record-expression.test.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-expression.test.mjs","names":[],"sources":["../../../src/typescript/components/record-expression.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./record-expression\";\n\ndescribe(\"plugins/plugin-alloy/src/typescript/components/record-expression.tsx\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n\n it(\"has at least one runtime export\", () => {\n expect(Object.keys(moduleExports).length).toBeGreaterThan(0);\n });\n});\n"],"mappings":";;;;;;CAGA,GAAA,8BAAmC;EAC/B,aAAO,yBAAQ,EAAO,YAAS;EAC/B,aAAO,OAAA,yBAAe,EAAA,KAAY,QAAC;CACrC,CAAC;CACD,GAAE,yCAAA;;CAEF,CAAA;AACF,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
2
3
|
const require_core_components_spacing = require('../../core/components/spacing.cjs');
|
|
3
4
|
const require_typescript_components_tsdoc = require('./tsdoc.cjs');
|
|
4
5
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
@@ -10,6 +11,10 @@ let _powerlines_schema = require("@powerlines/schema");
|
|
|
10
11
|
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
11
12
|
|
|
12
13
|
//#region src/typescript/components/tsdoc-schema.tsx
|
|
14
|
+
var tsdoc_schema_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
15
|
+
TSDocObjectSchema: () => TSDocObjectSchema,
|
|
16
|
+
TSDocSchemaProperty: () => TSDocSchemaProperty
|
|
17
|
+
});
|
|
13
18
|
/**
|
|
14
19
|
* Generates a TSDoc documentation block for the given reflection class. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about properties or methods of a class.
|
|
15
20
|
*/
|
|
@@ -163,4 +168,10 @@ function TSDocSchemaProperty(props) {
|
|
|
163
168
|
|
|
164
169
|
//#endregion
|
|
165
170
|
exports.TSDocObjectSchema = TSDocObjectSchema;
|
|
166
|
-
exports.TSDocSchemaProperty = TSDocSchemaProperty;
|
|
171
|
+
exports.TSDocSchemaProperty = TSDocSchemaProperty;
|
|
172
|
+
Object.defineProperty(exports, 'tsdoc_schema_exports', {
|
|
173
|
+
enumerable: true,
|
|
174
|
+
get: function () {
|
|
175
|
+
return tsdoc_schema_exports;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __exportAll } from "../../_virtual/_rolldown/runtime.mjs";
|
|
1
2
|
import { Spacing } from "../../core/components/spacing.mjs";
|
|
2
3
|
import { TSDoc, TSDocAttributesTags } from "./tsdoc.mjs";
|
|
3
4
|
import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
@@ -9,6 +10,10 @@ import { getPrimarySchemaType } from "@powerlines/schema";
|
|
|
9
10
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
10
11
|
|
|
11
12
|
//#region src/typescript/components/tsdoc-schema.tsx
|
|
13
|
+
var tsdoc_schema_exports = /* @__PURE__ */ __exportAll({
|
|
14
|
+
TSDocObjectSchema: () => TSDocObjectSchema,
|
|
15
|
+
TSDocSchemaProperty: () => TSDocSchemaProperty
|
|
16
|
+
});
|
|
12
17
|
/**
|
|
13
18
|
* Generates a TSDoc documentation block for the given reflection class. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about properties or methods of a class.
|
|
14
19
|
*/
|
|
@@ -161,5 +166,5 @@ function TSDocSchemaProperty(props) {
|
|
|
161
166
|
}
|
|
162
167
|
|
|
163
168
|
//#endregion
|
|
164
|
-
export { TSDocObjectSchema, TSDocSchemaProperty };
|
|
169
|
+
export { TSDocObjectSchema, TSDocSchemaProperty, tsdoc_schema_exports };
|
|
165
170
|
//# sourceMappingURL=tsdoc-schema.mjs.map
|