@powerlines/plugin-alloy 0.26.215 → 0.26.217
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/core/components/infrastructure-file.d.mts.map +1 -1
- package/dist/core/components/infrastructure-file.mjs.map +1 -1
- package/dist/core/components/output.d.mts.map +1 -1
- package/dist/core/components/output.mjs.map +1 -1
- package/dist/core/components/single-line-comment.d.mts.map +1 -1
- package/dist/core/components/single-line-comment.mjs.map +1 -1
- package/dist/core/components/source-file.d.mts.map +1 -1
- package/dist/core/components/source-file.mjs.map +1 -1
- package/dist/core/components/spacing.d.mts.map +1 -1
- package/dist/core/components/spacing.mjs.map +1 -1
- package/dist/core/contexts/context.d.mts.map +1 -1
- package/dist/core/contexts/context.mjs.map +1 -1
- package/dist/core/contexts/meta.d.mts.map +1 -1
- package/dist/core/contexts/meta.mjs.map +1 -1
- package/dist/core/contexts/schema.d.mts.map +1 -1
- package/dist/core/contexts/schema.mjs.map +1 -1
- package/dist/core/helpers/code.d.mts.map +1 -1
- package/dist/core/helpers/code.mjs.map +1 -1
- package/dist/hcl/components/block-declaration.d.mts.map +1 -1
- package/dist/hcl/components/block-declaration.mjs.map +1 -1
- package/dist/hcl/components/hcl-file.d.mts.map +1 -1
- package/dist/hcl/components/hcl-file.mjs.map +1 -1
- package/dist/hcl/components/packer-file.d.mts.map +1 -1
- package/dist/hcl/components/packer-file.mjs.map +1 -1
- package/dist/hcl/components/terraform-file.d.mts.map +1 -1
- package/dist/hcl/components/terraform-file.mjs.map +1 -1
- package/dist/helpers/capnp.d.mts.map +1 -1
- package/dist/helpers/capnp.mjs.map +1 -1
- package/dist/helpers/create-builtin.d.mts.map +1 -1
- package/dist/helpers/create-builtin.mjs.map +1 -1
- package/dist/helpers/refkey.d.mts.map +1 -1
- package/dist/helpers/refkey.mjs.map +1 -1
- package/dist/helpers/typescript.d.mts.map +1 -1
- package/dist/helpers/typescript.mjs.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/markdown/components/front-matter.d.mts.map +1 -1
- package/dist/markdown/components/front-matter.mjs.map +1 -1
- package/dist/markdown/components/heading.d.mts.map +1 -1
- package/dist/markdown/components/heading.mjs.map +1 -1
- package/dist/markdown/components/markdown-file.d.mts.map +1 -1
- package/dist/markdown/components/markdown-file.mjs.map +1 -1
- package/dist/markdown/components/markdown-table.d.mts.map +1 -1
- package/dist/markdown/components/markdown-table.mjs.map +1 -1
- package/dist/markdown/contexts/markdown-table.d.mts.map +1 -1
- package/dist/markdown/contexts/markdown-table.mjs.map +1 -1
- package/dist/render.d.mts.map +1 -1
- package/dist/render.mjs.map +1 -1
- package/dist/types/components.d.mts.map +1 -1
- package/dist/types/components.mjs.map +1 -1
- package/dist/types/plugin.d.mts.map +1 -1
- package/dist/typescript/components/builtin-file.d.mts.map +1 -1
- package/dist/typescript/components/builtin-file.mjs.map +1 -1
- package/dist/typescript/components/class-declaration.d.mts.map +1 -1
- package/dist/typescript/components/class-declaration.mjs.map +1 -1
- package/dist/typescript/components/dynamic-import-statement.d.mts.map +1 -1
- package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
- package/dist/typescript/components/entry-file.d.mts.map +1 -1
- package/dist/typescript/components/entry-file.mjs.map +1 -1
- package/dist/typescript/components/interface-declaration.d.mts.map +1 -1
- package/dist/typescript/components/interface-declaration.mjs.map +1 -1
- package/dist/typescript/components/object-declaration.d.mts.map +1 -1
- package/dist/typescript/components/object-declaration.mjs.map +1 -1
- package/dist/typescript/components/property-name.d.mts.map +1 -1
- package/dist/typescript/components/property-name.mjs.map +1 -1
- package/dist/typescript/components/record-expression.d.mts.map +1 -1
- package/dist/typescript/components/record-expression.mjs.map +1 -1
- package/dist/typescript/components/tsdoc-schema.d.mts.map +1 -1
- package/dist/typescript/components/tsdoc-schema.mjs.map +1 -1
- package/dist/typescript/components/tsdoc.d.mts.map +1 -1
- package/dist/typescript/components/tsdoc.mjs.map +1 -1
- package/dist/typescript/components/type-declaration.d.mts.map +1 -1
- package/dist/typescript/components/type-declaration.mjs.map +1 -1
- package/dist/typescript/components/type-parameters.d.mts.map +1 -1
- package/dist/typescript/components/type-parameters.mjs.map +1 -1
- package/dist/typescript/components/typescript-file.d.mts.map +1 -1
- package/dist/typescript/components/typescript-file.mjs.map +1 -1
- package/dist/typescript/contexts/lexical-scope.d.mts.map +1 -1
- package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
- package/dist/typescript/contexts/member-scope.d.mts.map +1 -1
- package/dist/typescript/contexts/member-scope.mjs.map +1 -1
- package/dist/typescript/helpers/get-call-signature-props.d.mts.map +1 -1
- package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -1
- package/dist/typescript/helpers/utilities.d.mts.map +1 -1
- package/dist/typescript/helpers/utilities.mjs.map +1 -1
- package/dist/yaml/components/yaml-file.d.mts.map +1 -1
- package/dist/yaml/components/yaml-file.mjs.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-declaration.d.mts","names":[],"sources":["../../../src/typescript/components/class-declaration.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"class-declaration.d.mts","names":[],"sources":["../../../src/typescript/components/class-declaration.tsx"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-declaration.mjs","names":[],"sources":["../../../src/typescript/components/class-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 code,\n For,\n MemberDeclaration,\n Name,\n Namekey,\n Refkey,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n CallSignature,\n CallSignatureProps,\n CommonDeclarationProps,\n createMemberSymbol,\n createTypeAndValueSymbol,\n Declaration,\n TSSymbolFlags,\n TypeParameterDescriptor,\n TypeRefContext,\n useTSNamePolicy\n} from \"@alloy-js/typescript\";\nimport { LexicalScope } from \"../contexts\";\nimport { MemberScope } from \"../contexts/member-scope\";\nimport { getCallSignatureProps } from \"../helpers\";\nimport { PropertyName } from \"./property-name\";\nimport { TSDoc, TSDocParams } from \"./tsdoc\";\nimport { TypeParameters } from \"./type-parameters\";\n\n/**\n * Props for the ClassDeclaration component, which represents a TypeScript class declaration\n */\nexport interface ClassDeclarationProps extends CommonDeclarationProps {\n /**\n * An indication of whether this class is abstract\n */\n abstract?: boolean;\n\n /**\n * An optional class that this class extends. This will be rendered as an `extends` clause in the class declaration\n */\n extends?: Children;\n\n /**\n * Optional interfaces that this class implements. This will be rendered as an `implements` clause in the class declaration\n */\n implements?: Children[];\n\n /**\n * The generic type parameters of the class.\n */\n typeParameters?: TypeParameterDescriptor[] | string[];\n}\n\n/**\n * Create a TypeScript class declaration.\n *\n * @example\n * ```tsx\n * const myPetRefkey = refkey();\n * const Animal = refkey();\n * const staticMember = refkey();\n * const instanceMember = refkey();\n *\n * <ClassDeclaration name=\"Animal\" refkey={Animal}>\n * <ClassMember public static name=\"something\" type=\"string\" refkey={staticMember}>\n * \"hello\"\n * </ClassMember>\n * <ClassMember public name=\"kind\" type=\"string\" />\n * <ClassMember public name=\"name\" type=\"string\" refkey={instanceMember} />\n * <ClassConstructor parameters=\"name: string\">\n * this.name = name;\n * </ClassConstructor>\n * </ClassDeclaration>\n *\n * <VarDeclaration const name=\"myPet\" refkey={myPetRefkey}>\n * new {Animal}();\n * </VarDeclaration>\n *\n * {staticMember}; // Animal.something\n * <MemberReference path={[myPetRefkey, instanceMember]} /> // myPet.name\n * {memberRefkey(myPetRefkey, instanceMember)}\n * ```\n */\nexport function ClassDeclaration(props: ClassDeclarationProps) {\n const extendsPart = props.extends && <> extends {props.extends}</>;\n const implementsPart = props.implements && props.implements.length > 0 && (\n <>\n {\" \"}\n implements{\" \"}\n <For each={props.implements} comma space>\n {implement => implement}\n </For>\n </>\n );\n const sym = createTypeAndValueSymbol(props.name, {\n refkeys: props.refkey,\n export: props.export,\n default: props.default,\n metadata: props.metadata,\n hasInstanceMembers: true,\n namePolicy: useTSNamePolicy().for(\"class\")\n });\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n <Declaration symbol={sym} export={props.export} default={props.default}>\n <MemberScope ownerSymbol={sym}>\n {props.abstract && code`abstract `} class <Name />\n {props.typeParameters && (\n <TypeParameters parameters={props.typeParameters} />\n )}\n {extendsPart}\n {implementsPart} <Block>{props.children}</Block>\n </MemberScope>\n </Declaration>\n </>\n );\n}\n\nClassDeclaration.TypeParameters = TypeParameters;\n\n/**\n * Generates a TypeScript class member declaration for the given reflection class.\n */\nexport interface ClassMemberProps {\n name: string | Namekey;\n refkey?: Refkey;\n public?: boolean;\n private?: boolean;\n protected?: boolean;\n jsPrivate?: boolean;\n static?: boolean;\n abstract?: boolean;\n children?: Children;\n doc?: Children;\n nullish?: boolean;\n override?: boolean;\n}\n\n/**\n * Generates a TypeScript class member declaration for the given reflection class.\n *\n * @param props - The properties of the class member, including its name, visibility, and other modifiers.\n * @returns A JSX element representing the class member declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassMember(props: ClassMemberProps) {\n let tsFlags = TSSymbolFlags.None;\n if (props.nullish) {\n tsFlags |= TSSymbolFlags.Nullish;\n }\n\n const sym = createMemberSymbol(props.name, props, {\n refkeys: props.refkey,\n tsFlags,\n namePolicy: useTSNamePolicy().for(\"class-member-data\")\n });\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n <MemberDeclaration symbol={sym}>\n {props.public && \"public \"}\n {props.private && \"private \"}\n {props.protected && \"protected \"}\n {props.abstract && \"abstract \"}\n {props.override && \"override \"}\n {props.static && \"static \"}\n {props.children}\n </MemberDeclaration>\n </>\n );\n}\n\n/**\n * Props for a class field, which is a specific type of class member that represents a property of the class.\n */\nexport interface ClassFieldProps extends ClassMemberProps {\n name: string;\n type?: Children;\n optional?: boolean;\n children?: Children;\n isPrivateMember?: boolean;\n}\n\n/**\n * Generates a TypeScript class field declaration for the given reflection class.\n *\n * @param props - The properties of the class field, including its name, type, optionality, and other modifiers.\n * @returns A JSX element representing the class field declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassField(props: ClassFieldProps) {\n const optionality = props.optional ? \"?\" : \"\";\n const typeSection = props.type && (\n <>\n {optionality}: <TypeRefContext>{props.type}</TypeRefContext>\n </>\n );\n const initializerSection = props.children && <> = {props.children}</>;\n const nullish = props.nullish ?? props.optional;\n\n return (\n <ClassMember {...props} nullish={nullish}>\n <PropertyName\n private={props.isPrivateMember}\n name={props.isPrivateMember ? props.name : undefined}\n />\n {typeSection}\n {initializerSection}\n </ClassMember>\n );\n}\n\n/**\n * Props for a class field, which is a specific type of class member that represents a property of the class.\n */\nexport interface ClassPropertyProps extends ClassMemberProps {\n name: string;\n type?: Children;\n children?: Children;\n}\n\n/**\n * Generates a TypeScript class property setter declaration for the given reflection class.\n *\n * @param props - The properties of the class property, including its name, type, and other modifiers.\n * @returns A JSX element representing the class property setter declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassPropertySet(props: ClassPropertyProps) {\n return (\n <>\n <ClassMember {...props}>\n {\"set \"}\n <PropertyName name={props.name} />\n <LexicalScope>\n <CallSignature\n parameters={[\n {\n name: \"value\",\n type: <TypeRefContext>{props.type}</TypeRefContext>\n }\n ]}\n />{\" \"}\n <Block>{props.children}</Block>\n </LexicalScope>\n </ClassMember>\n </>\n );\n}\n\n/**\n * Generates a TypeScript class property getter declaration for the given reflection class.\n *\n * @param props - The properties of the class property, including its name, type, and other modifiers.\n * @returns A JSX element representing the class property getter declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassPropertyGet(props: ClassPropertyProps) {\n return (\n <ClassMember {...props}>\n {\"get \"}\n <PropertyName name={props.name} />\n <LexicalScope>\n <CallSignature\n returnType={<TypeRefContext>{props.type}</TypeRefContext>}\n />{\" \"}\n <Block>{props.children}</Block>\n </LexicalScope>\n </ClassMember>\n );\n}\n\n/**\n * Props for a class method, which is a specific type of class member that represents a function defined within the class.\n */\nexport interface ClassMethodProps extends ClassMemberProps, CallSignatureProps {\n async?: boolean;\n children?: Children;\n}\n\n/**\n * Generates a TypeScript class method declaration for the given reflection class.\n *\n * @param props - The properties of the class method, including its name, visibility, and other modifiers.\n * @returns A JSX element representing the class method declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassMethod(props: ClassMethodProps) {\n const callProps = getCallSignatureProps(props);\n const [_, rest] = splitProps(props, [\"doc\"]);\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc}>\n {Array.isArray(rest.parameters) && (\n <TSDocParams parameters={rest.parameters} />\n )}\n </TSDoc>\n </Show>\n <ClassMember {...rest}>\n {props.async && \"async \"}\n <PropertyName />\n <LexicalScope>\n <CallSignature {...callProps} /> <Block>{props.children}</Block>\n </LexicalScope>\n </ClassMember>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+DE,MAAE,cAAA,MAAA,WAAA,CAAA,aAAA,WAAA,MAAA,OAAA,CAAA;CACF,MAAG,iBAAoB,MAAK,cAAW,MAAU,WAAW,SAAI,KAAS;EAAE;EAAK;EAAY;EAAO,gBAAa,KAAA;GAC9G,IAAA,OAAA;IACF,OAAW,MAAE;;GAEX,OAAA;GACA,OAAK;GACL,WAAA,cAAA;EACF,CAAA;CAAA;CACF,MAAA,MAAA,yBAAA,MAAA,MAAA;;EAEE,QAAA,MAAA;EACC,SAAS,MAAA;EACX,UAAA,MAAA;EACG,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CAAA;EAAA;CACF,EACF,CAAA,CAAA,CAAA;AACA"}
|
|
1
|
+
{"version":3,"file":"class-declaration.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-import-statement.d.mts","names":[],"sources":["../../../src/typescript/components/dynamic-import-statement.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dynamic-import-statement.d.mts","names":[],"sources":["../../../src/typescript/components/dynamic-import-statement.tsx"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-import-statement.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"dynamic-import-statement.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-file.d.mts","names":[],"sources":["../../../src/typescript/components/entry-file.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"entry-file.d.mts","names":[],"sources":["../../../src/typescript/components/entry-file.tsx"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-file.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"entry-file.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface-declaration.d.mts","names":[],"sources":["../../../src/typescript/components/interface-declaration.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"interface-declaration.d.mts","names":[],"sources":["../../../src/typescript/components/interface-declaration.tsx"],"mappings":""}
|
|
@@ -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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MAAA;MACtB;MACF,IAAA,OAAA;OACF,OAAA,qBAAA,MAAA;MACF;KACA,GAAA,IAAA,CAAA,CAAA;;GAEF,CAAA;EACA;CACF,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"interface-declaration.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object-declaration.d.mts","names":[],"sources":["../../../src/typescript/components/object-declaration.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"object-declaration.d.mts","names":[],"sources":["../../../src/typescript/components/object-declaration.tsx"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object-declaration.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"object-declaration.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-name.d.mts","names":[],"sources":["../../../src/typescript/components/property-name.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"property-name.d.mts","names":[],"sources":["../../../src/typescript/components/property-name.tsx"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-name.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"property-name.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-expression.d.mts","names":[],"sources":["../../../src/typescript/components/record-expression.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"record-expression.d.mts","names":[],"sources":["../../../src/typescript/components/record-expression.tsx"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-expression.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"record-expression.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdoc-schema.d.mts","names":[],"sources":["../../../src/typescript/components/tsdoc-schema.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tsdoc-schema.d.mts","names":[],"sources":["../../../src/typescript/components/tsdoc-schema.tsx"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdoc-schema.mjs","names":[],"sources":["../../../src/typescript/components/tsdoc-schema.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 childrenArray,\n computed,\n List,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport { getPrimarySchemaType, JsonSchema } from \"@powerlines/schema\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { Spacing } from \"../../core/components/spacing\";\nimport { TSDoc, TSDocAttributesTags, TSDocProps } from \"./tsdoc\";\n\nexport interface TSDocObjectSchemaProps extends TSDocProps {\n schema: JsonSchema;\n}\n\n/**\n * 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.\n */\nexport function TSDocObjectSchema(props: TSDocObjectSchemaProps) {\n const [{ children, heading, schema }, rest] = splitProps(props, [\n \"heading\",\n \"children\",\n \"schema\"\n ]);\n\n if (!isSetObject(schema)) {\n return null;\n }\n\n const title = computed(() => schema?.title || titleCase(schema?.name));\n const computedHeading = computed(\n () => heading || schema?.description || title.value\n );\n\n const alias = computed(() => schema?.alias);\n const tags = computed(() => schema?.tags);\n const readOnly = computed(() => schema?.readOnly);\n const internal = computed(() => schema?.internal);\n const runtime = computed(() => schema?.runtime);\n const ignore = computed(() => schema?.ignore);\n const hidden = computed(() => schema?.hidden);\n\n if (\n !computedHeading.value ||\n (isSetString(computedHeading.value) && computedHeading.value.trim() === \"\")\n ) {\n return null;\n }\n\n const hasAttributes = computed(\n () =>\n isSetString(title.value) ||\n (!isUndefined(alias.value) && alias.value.length > 0) ||\n (!isUndefined(tags.value) && tags.value.length > 0) ||\n !isUndefined(readOnly.value) ||\n !isUndefined(internal.value) ||\n !isUndefined(runtime.value) ||\n !isUndefined(ignore.value) ||\n !isUndefined(hidden.value)\n );\n\n return (\n <TSDoc\n {...rest}\n heading={\n isSetString(computedHeading.value)\n ? computedHeading.value.trim()\n : computedHeading.value\n }>\n <Show when={hasAttributes.value}>\n <TSDocAttributesTags\n type={getPrimarySchemaType(schema)}\n title={title.value}\n alias={alias.value}\n tags={tags.value}\n readOnly={Boolean(readOnly.value)}\n internal={Boolean(internal.value)}\n runtime={Boolean(runtime.value)}\n ignore={Boolean(ignore.value)}\n hidden={Boolean(hidden.value)}\n />\n </Show>\n <Show\n when={\n !isUndefined(children) &&\n childrenArray(() => children).filter(Boolean).length > 0\n }>\n <Show when={hasAttributes.value}>\n <Spacing />\n </Show>\n <List>{childrenArray(() => children)}</List>\n </Show>\n </TSDoc>\n );\n}\n\nexport interface TSDocSchemaPropertyProps extends TSDocProps {\n schema: JsonSchema;\n defaultValue?: unknown;\n}\n\n/**\n * Generates a TSDoc documentation block for the given reflection property. 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 parameters of a method or properties of a class.\n */\nexport function TSDocSchemaProperty(props: TSDocSchemaPropertyProps) {\n const [{ children, schema, defaultValue }, rest] = splitProps(props, [\n \"children\",\n \"schema\",\n \"defaultValue\"\n ]);\n\n if (!isSetObject(schema)) {\n return null;\n }\n\n const hasAttributes = computed(\n () =>\n isSetString(schema?.title) ||\n (!isUndefined(schema?.alias) && schema?.alias.length > 0) ||\n (!isUndefined(schema?.tags) && schema?.tags.length > 0) ||\n !isUndefined(schema?.readOnly) ||\n !isUndefined(schema?.internal) ||\n !isUndefined(schema?.runtime) ||\n !isUndefined(schema?.ignore) ||\n !isUndefined(schema?.hidden) ||\n !isUndefined(defaultValue)\n );\n\n return (\n <TSDoc heading={schema?.description} {...rest}>\n <Show when={hasAttributes.value}>\n <TSDocAttributesTags\n type={getPrimarySchemaType(schema)}\n title={schema?.title}\n alias={schema?.alias}\n tags={schema?.tags}\n readOnly={schema?.readOnly}\n internal={schema?.internal}\n runtime={schema?.runtime}\n ignore={schema?.ignore}\n hidden={schema?.hidden}\n default={defaultValue}\n />\n </Show>\n <Show\n when={\n !isUndefined(children) &&\n childrenArray(() => children).filter(Boolean).length > 0\n }>\n <Show when={hasAttributes.value}>\n <Spacing />\n </Show>\n <List>{childrenArray(() => children)}</List>\n </Show>\n </TSDoc>\n );\n}\n\n// export interface TSDocReflectionMethodProps extends TSDocProps {\n// reflection: ReflectionMethod;\n// }\n\n// /**\n// * Generates a TSDoc documentation block for the given reflection method. 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. Additionally, this component will render information about the parameters and return type of the method, if available.\n// */\n// export function TSDocReflectionMethod(props: TSDocReflectionMethodProps) {\n// const [{ children, reflection }, rest] = splitProps(props, [\n// \"children\",\n// \"reflection\"\n// ]);\n\n// if (!isSetObject(reflection)) {\n// return null;\n// }\n\n// const heading = computed(\n// () =>\n// reflection.getDescription() ||\n// (isString(reflection.getName())\n// ? code`${String(reflection.getName())} method definition`\n// : undefined)\n// );\n\n// return (\n// <TSDoc heading={heading.value} {...rest}>\n// <TSDocAttributesTags\n// title={reflection.getTitle()}\n// alias={reflection.getAlias()}\n// resourceId={reflection.getDomain()}\n// permission={reflection.getPermission()}\n// isReadonly={reflection.isReadonly()}\n// isInternal={reflection.isInternal()}\n// isRuntime={reflection.isRuntime()}\n// isIgnored={reflection.isIgnored()}\n// isHidden={reflection.isHidden()}\n// />\n// <Show\n// when={Boolean(children) && childrenArray(() => children).length > 0}>\n// <List>{childrenArray(() => children)}</List>\n// </Show>\n// <Show when={reflection.getParameters().length > 0}>\n// <Spacing />\n// <For each={reflection.getParameters()} hardline ender={<hbr />}>\n// {param => (\n// <TSDocParam\n// name={param.getName()}\n// optional={param.isOptional()}\n// defaultValue={\n// param.hasDefault() ? param.getDefaultValue() : undefined\n// }>\n// <Show\n// when={Boolean(param.parameter.description)}\n// fallback={code`A parameter to provide a ${param.getName()} value to the function.`}>\n// {param.parameter.description}\n// </Show>\n// </TSDocParam>\n// )}\n// </For>\n// </Show>\n// <Show when={reflection.getReturnType().kind !== ReflectionKind.void}>\n// <Spacing />\n// <TSDocReturns>\n// {code`The return value of the function, which is of type ${stringifyType(\n// reflection.getReturnType()\n// )}.`}\n// </TSDocReturns>\n// </Show>\n// </TSDoc>\n// );\n// }\n\n// /**\n// * Uses the `useReflectionMethod` hook to retrieve the reflection method from the context, and then renders a `TSDocReflectionMethod` component with the retrieved reflection method. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection method without having to manually retrieve the reflection method from the context.\n// */\n// export function TSDocContextMethod(props: TSDocProps) {\n// const reflection = useReflectionMethod();\n\n// return (\n// <Show when={isSetObject(reflection)}>\n// <TSDocReflectionMethod {...props} reflection={reflection} />\n// </Show>\n// );\n// }\n"],"mappings":";;;;;;;;;;;;;;AA8BA,SAAgB,kBAAe,OAAK;CACpC,MAAQ,CAAC,YAET,SACE,UACF,QAAA,WAAA,OAAA;EAAA;EAAA;EAAA;CAAA,CAAA;2BAEE,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AAA;;GAEM,IAAA,WAAe;IACf,OAAA,gBAAA,qBAAA;KACF,IAAA,OAAY;MACV,OAAY,qBAAkB,MAAQ;KACtC;KACD,IAAA,QAAY;MACZ,OAAY,QAAQ;KACpB;KACA,IAAA,QAAY;MACZ,OAAY,QAAQ;KACpB;KACJ,IAAA,OAAA;;KAEM;KACE,IAAA,WAAgB;MACf,OAAM,QAAA;KACT;KACC,IAAM,WAAA;MACN,OAAO,QAAQ;KACf;KACA,IAAM,UAAQ;MACd,OAAU,QAAQ;KAClB;KACA,IAAA,SAAe;MACf,OAAQ,QAAQ;KAChB;KACA,IAAA,SAAS;MACV,OAAA,QAAA;KACG;KACL,WAAA;IACC,CAAA;GACA;EACF,CAAC,GAAG,gBAAkB,MAAE;GACtB,IAAC,OAAA;IACA,OAAK,WAAM,CAAA,CAAA,CAAa,YAAO,QAAA,CAAA,EAAA,KAAA,oBAAA,QAAA,EAAA,OAAA,OAAA,EAAA,SAAA;GAChC;GACA,IAAE,WAAI;IACL,OAAM,CAAA,gBAAoB,MAAA;KACvB,IAAA,OAAA;MACD,OAAA,cAAA;KACR;KACH,IAAA,WAAA;;KAEU;IACL,CAAA,GAAA,gBAAY,MAAgB,EAC9B,IAAA,WAAA;;IAEE,EACC,CAAA,CAAA;GACD;EACF,CAAA,CAAA;CACC,EACF,CAAC,CAAC;AACJ"}
|
|
1
|
+
{"version":3,"file":"tsdoc-schema.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdoc.d.mts","names":[],"sources":["../../../src/typescript/components/tsdoc.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tsdoc.d.mts","names":[],"sources":["../../../src/typescript/components/tsdoc.tsx"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdoc.mjs","names":[],"sources":["../../../src/typescript/components/tsdoc.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 Children,\n childrenArray,\n computed,\n For,\n List,\n Prose,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport { JSDocExampleProps, ParameterDescriptor } from \"@alloy-js/typescript\";\nimport type { JsonSchemaPrimitiveType } from \"@powerlines/schema\";\nimport { stringifyValue } from \"@powerlines/schema\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { Spacing } from \"../../core/components/spacing\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport type { ComponentProps } from \"../../types/components\";\n\nexport interface TSDocProps extends ComponentProps {\n heading?: Children;\n}\n\n/**\n * Generates a TypeScript interface for the given reflection class.\n */\nexport function TSDoc(props: TSDocProps) {\n const [{ children, heading }] = splitProps(props, [\"children\", \"heading\"]);\n\n return (\n <>\n /**\n <align string=\" * \">\n <hbr />\n <Show when={!isUndefined(heading)}>{heading}</Show>\n <Show\n when={\n !isUndefined(children) &&\n childrenArray(() => children).filter(Boolean).length > 0\n }>\n <Show when={!isUndefined(heading)}>\n <Spacing />\n </Show>\n <List hardline={false} softline={true}>\n {childrenArray(() => children)}\n </List>\n </Show>\n </align>\n <hbr />\n {`*/`}\n <hbr />\n </>\n );\n}\n\nexport interface TSDocTagProps extends ComponentProps {\n tag: string;\n}\n\n/**\n * Create a TSDoc `@<props.tag>` tag.\n */\nexport function TSDocTag(props: TSDocTagProps) {\n const [{ children, tag }] = splitProps(props, [\"children\", \"tag\"]);\n\n return (\n <>\n {`@${tag} `}\n <Show when={Boolean(children)}>\n <align width={2}>\n <Prose>{children}</Prose>\n </align>\n </Show>\n <sbr />\n </>\n );\n}\n\nexport interface TSDocParamsProps {\n parameters: ParameterDescriptor[] | string[];\n}\n\n/**\n * A component that creates a TSDoc block with `@param` tags for each parameter.\n */\nexport function TSDocParams(props: TSDocParamsProps) {\n const parameters = normalizeParametersForDoc(props.parameters);\n\n return (\n <For each={parameters}>\n {param => (\n <TSDocParam name={param.name} optional={param.optional}>\n {param.doc}\n </TSDocParam>\n )}\n </For>\n );\n}\n\nfunction normalizeParametersForDoc(\n parameters: ParameterDescriptor[] | string[]\n): ParameterDescriptor[] {\n if (parameters.some(p => typeof p === \"string\")) {\n return [];\n }\n\n return parameters as ParameterDescriptor[];\n}\n\n/**\n * Create a TSDoc `@title` tag.\n */\nexport function TSDocTitle(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"title\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@domain` tag.\n */\nexport function TSDocDomain(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"domain\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@alias` tag.\n */\nexport function TSDocAlias(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"alias\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@permission` tag.\n */\nexport function TSDocPermission(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"permission\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@group` tag.\n */\nexport function TSDocGroup(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"group\">\n {children}\n </TSDocTag>\n );\n}\n\nexport interface TSDocDefaultValueProps extends ComponentProps {\n type?: JsonSchemaPrimitiveType | string;\n defaultValue: any;\n}\n\n/**\n * Create a TSDoc `@defaultValue` tag.\n */\nexport function TSDocDefaultValue(props: TSDocDefaultValueProps) {\n const [{ type, defaultValue }] = splitProps(props, [\"type\", \"defaultValue\"]);\n\n return (\n <>\n {\"@defaultValue \"}\n <Show when={!isUndefined(defaultValue)}>\n <align width={2}>\n <Prose>{stringifyValue(defaultValue, type)}</Prose>\n </align>\n </Show>\n </>\n );\n}\n\n/**\n * Create a TSDoc `@remarks` tag.\n */\nexport function TSDocRemarks(props: ComponentProps) {\n return (\n <>\n {\"@remarks \"}\n <hbr />\n <List hardline={false} softline={true}>\n {childrenArray(() => props.children)}\n </List>\n </>\n );\n}\n\n/**\n * Create a TSDoc `@see` tag.\n */\nexport function TSDocLink(props: ComponentProps) {\n return <TSDocTag {...props} tag=\"see\" />;\n}\n\nexport interface TSDocExampleProps extends JSDocExampleProps {\n /**\n * Whether the file is a TSX file.\n *\n * @defaultValue false\n */\n tsx?: boolean;\n}\n\n/**\n * Create a TSDoc `@example` tag.\n */\nexport function TSDocExample(props: TSDocExampleProps) {\n const [{ tsx, fenced = true, language, children }] = splitProps(props, [\n \"tsx\",\n \"fenced\",\n \"language\",\n \"children\"\n ]);\n\n return (\n <>\n {\"@example \"}\n <hbr />\n <Show when={fenced}>\n ```{language || (tsx ? \"tsx\" : \"ts\")}\n <hbr />\n </Show>\n {children}\n <Show when={fenced}>\n <hbr />\n ```\n </Show>\n </>\n );\n}\n\n/**\n * Create a TSDoc `@readonly` tag.\n */\nexport function TSDocReadonly() {\n return <TSDocTag tag=\"readonly\" />;\n}\n\n/**\n * Create a TSDoc `@internal` tag.\n */\nexport function TSDocInternal() {\n return <TSDocTag tag=\"internal\" />;\n}\n\n/**\n * Create a TSDoc `@ignore` tag.\n */\nexport function TSDocIgnore() {\n return <TSDocTag tag=\"ignore\" />;\n}\n\n/**\n * Create a TSDoc `@hidden` tag.\n */\nexport function TSDocHidden() {\n return <TSDocTag tag=\"hidden\" />;\n}\n\n/**\n * Create a TSDoc `@runtime` tag.\n */\nexport function TSDocRuntime() {\n return <TSDocTag tag=\"runtime\" />;\n}\n\nexport interface TSDocAttributesTagsProps {\n type?: JsonSchemaPrimitiveType | string;\n default?: any;\n title?: string;\n alias?: string[];\n tags?: string[];\n readOnly?: boolean;\n internal?: boolean;\n ignore?: boolean;\n hidden?: boolean;\n runtime?: boolean;\n}\n\n/**\n * Generates a TypeScript interface property for the given reflection class.\n */\nexport function TSDocAttributesTags(props: TSDocAttributesTagsProps) {\n const [\n {\n type,\n alias,\n tags,\n readOnly,\n internal,\n ignore,\n hidden,\n runtime,\n default: defaultValue\n }\n ] = splitProps(props, [\n \"type\",\n \"alias\",\n \"tags\",\n \"readOnly\",\n \"internal\",\n \"ignore\",\n \"hidden\",\n \"runtime\",\n \"default\"\n ]);\n\n const title = computed(() => props.title?.trim() || \"\");\n\n return (\n <>\n <Show when={isSetString(title.value)}>\n <TSDocTitle>{title.value}</TSDocTitle>\n </Show>\n <Show\n when={\n !isUndefined(alias) &&\n alias.length > 0 &&\n alias.some(a => isSetString(a?.trim()))\n }>\n <For each={alias?.filter(a => isSetString(a?.trim())) ?? []}>\n {alias => <TSDocAlias>{alias}</TSDocAlias>}\n </For>\n </Show>\n <Show\n when={\n !isUndefined(tags) &&\n tags.length > 0 &&\n tags.some(g => isSetString(g?.trim()))\n }>\n <For each={tags?.filter(g => isSetString(g?.trim())) ?? []}>\n {tag => <TSDocGroup>{tag}</TSDocGroup>}\n </For>\n </Show>\n <Show when={readOnly === true}>\n <TSDocReadonly />\n </Show>\n <Show when={internal === true}>\n <TSDocInternal />\n </Show>\n <Show when={ignore === true}>\n <TSDocIgnore />\n </Show>\n <Show when={hidden === true}>\n <TSDocHidden />\n </Show>\n <Show when={runtime === true}>\n <TSDocRuntime />\n </Show>\n <Show\n when={\n runtime !== true && !isUndefined(type) && !isUndefined(defaultValue)\n }>\n <TSDocDefaultValue type={type} defaultValue={defaultValue} />\n </Show>\n </>\n );\n}\n\nexport interface TSDocParamProps {\n name: Children;\n children?: Children;\n optional?: boolean;\n default?: Children;\n}\n\n/**\n * Create a TSDoc parameter set off with `@param`.\n */\nexport function TSDocParam(props: TSDocParamProps) {\n return (\n <>\n {\"@param \"}\n <TSDocParamName\n name={props.name}\n optional={props.optional}\n default={props.default}\n />\n <TSDocParamDescription children={props.children} />\n </>\n );\n}\n\ninterface TSDocParamNameProps {\n name: Children;\n optional?: boolean;\n default?: Children;\n}\n\nfunction TSDocParamName(props: TSDocParamNameProps) {\n return (\n <>\n <Show when={props.optional}>{\"[\"}</Show>\n {props.name}\n <Show when={Boolean(props.default)}>={props.default}</Show>\n <Show when={props.optional}>{\"]\"}</Show>\n </>\n );\n}\n\ninterface TSDocParamDescriptionProps {\n children?: Children;\n}\n\nfunction TSDocParamDescription(props: TSDocParamDescriptionProps) {\n return (\n <Show when={Boolean(props.children)}>\n {\" - \"}\n <align width={2}>\n <Prose>{props.children}</Prose>\n </align>\n </Show>\n );\n}\n\n/**\n * Create a TSDoc `@returns` tag.\n */\nexport function TSDocReturns(props: ComponentProps) {\n return <TSDocTag {...props} tag=\"returns\" />;\n}\n\n/**\n * Create a TSDoc `@throws` tag.\n */\nexport function TSDocThrows(props: ComponentProps) {\n return <TSDocTag {...props} tag=\"throws\" />;\n}\n\nexport interface TSDocModuleProps extends ComponentProps {\n /**\n * The prefix for the builtin module name\n *\n * @remarks\n * This value is populated from the Powerlines configuration output builtin prefix by default.\n *\n * @example\n * ```ts\n * /**\n * @module powerlines:my-module\n * \\/\n * ```\n */\n prefix?: string;\n\n /**\n * The name of the module\n *\n * @remarks\n * This will be used in the `@module` tag as well as the import path for the module, e.g. `storm:<name>`.\n *\n * @example\n * ```ts\n * import { MyModule } from \"powerlines:my-module\";\n * ```\n */\n name: Children;\n}\n\n/**\n * Generates a TSDoc `@module` tag for the given module name.\n */\nexport function TSDocModule(props: TSDocModuleProps) {\n const [{ children, name, prefix }] = splitProps(props, [\n \"children\",\n \"name\",\n \"prefix\"\n ]);\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n /**\n <align string=\" * \">\n <hbr />\n <Show when={Boolean(children)}>\n <List hardline={false} softline={true}>\n {childrenArray(() => children)}\n </List>\n <Spacing />\n </Show>\n {\"@module \"}\n {prefix || context?.config?.framework?.name || \"powerlines\"}:{name}\n </align>\n <hbr />\n {` */`}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA6BA,SAAc,MAAA,OAAA;CACd,MAAQ,CAAC,EACT,UACA,aACO,WAAW,OAAO,CAAC,YAAU,SAAW,CAAA;CAC/C,OAAS;EAAA;EAAA,gBAA0B,SAAM;GACzC,QAAY;;IAEN,OAAC;KAAA,gBAAqB,OAAQ,CAAA,CAAA;KAAA,gBAAe,MAAA;MACjD,IAAU,OAAA;OACZ,OAAA,CAAA,YAAA,OAAA;;MAEE,UAAA;KACC,CAAA;KAAA,gBAAuB,MAAA;MACxB,IAAA,OAAA;OACK,OAAS,WAAa,CAAA,CAAA,CAAA,YAAY,QAAA,CAAA,EAAA,KAAA,oBAAA,QAAA,EAAA,OAAA,OAAA,EAAA,SAAA;MACjC;;OAEC,OAAA,CAAA,gBAAA,MAAA;QACJ,IAAA,OAAA;SACG,OAAA,CAAA,YAAA,OAAA;QACI;QACA,IAAE,WAAA;SACA,OAAO,gBAAY,SAAW,CAAA,CAAA;QACnC;OACC,CAAA,GAAI,gBAAC,MAAA;QACH,UAAC;QACD,UAAA;QACD,IAAA,WAAA;SACA,OAAU,oBAAc,QAAS;QAChC;OACF,CAAC,CAAC;MACJ;KACF,CAAC;IAAC;GACJ;EACF,CAAC;EAAG,gBAAQ,OAAA,CAAA,CAAA;EAAA;EAAA,gBAAA,OAAA,CAAA,CAAA;CAAA;AACd;;;;AAIA,SAAM,SAAA,OAAA;CACJ,MAAC,CAAA,EACH,mBAEO,WAAU,OAAA,CAAA,YAAqB,KAAC,CAAA;CACrC,OAAK;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CAAA,CAAA,CAAA;MAClB;KACG,CAAA;KAAA;KAAA,WAAA,UAAA,SAAA,QAAA,WAAA,QAAA,YAAA;KAAA;KAAA;IAAA;GACF;EACF,CAAC;EAAA,gBAAA,OAAA,CAAA,CAAA;EAAA;CAAA;AACH"}
|
|
1
|
+
{"version":3,"file":"tsdoc.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-declaration.d.mts","names":[],"sources":["../../../src/typescript/components/type-declaration.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"type-declaration.d.mts","names":[],"sources":["../../../src/typescript/components/type-declaration.tsx"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-declaration.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"type-declaration.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-parameters.d.mts","names":[],"sources":["../../../src/typescript/components/type-parameters.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"type-parameters.d.mts","names":[],"sources":["../../../src/typescript/components/type-parameters.tsx"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-parameters.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"type-parameters.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-file.d.mts","names":[],"sources":["../../../src/typescript/components/typescript-file.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"typescript-file.d.mts","names":[],"sources":["../../../src/typescript/components/typescript-file.tsx"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-file.mjs","names":[],"sources":["../../../src/typescript/components/typescript-file.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 type { Children } from \"@alloy-js/core\";\nimport {\n computed,\n For,\n Scope,\n Show,\n SourceDirectoryContext,\n splitProps,\n useContext,\n useScope\n} from \"@alloy-js/core\";\nimport {\n getSourceDirectoryData,\n ImportStatements,\n PackageContext,\n SourceFileContext,\n TSModuleScope,\n useSourceFile\n} from \"@alloy-js/typescript\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isBoolean } from \"@stryke/type-checks/is-boolean\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { SourceFile, SourceFileProps } from \"../../core/components/source-file\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { code } from \"../../core/helpers/code\";\nimport {\n ComponentProps,\n SourceFileHeaderProps,\n TypescriptFileImportItem,\n TypescriptFileImports\n} from \"../../types/components\";\n\nexport type TypescriptFileProps = Omit<SourceFileProps, \"filetype\"> &\n ComponentProps & {\n hashbang?: Children | true;\n header?: Children;\n imports?: TypescriptFileImports;\n builtinImports?: TypescriptFileImports;\n export?: boolean | string;\n tsx?: boolean;\n };\n\n/**\n * A base component representing a Powerlines generated Typescript source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function TypescriptFile(props: TypescriptFileProps) {\n const [\n { children, path, imports, builtinImports, tsx, header, hashbang },\n rest\n ] = splitProps(props, [\n \"children\",\n \"path\",\n \"imports\",\n \"builtinImports\",\n \"tsx\",\n \"header\",\n \"hashbang\"\n ]);\n\n const directoryContext = useContext(SourceDirectoryContext)!;\n const sdData = getSourceDirectoryData(directoryContext);\n\n const modulePath = appendPath(path, directoryContext.path);\n const scope = new TSModuleScope(modulePath, useScope());\n sdData.modules.add(scope);\n\n const pkg = useContext(PackageContext);\n if (pkg) {\n pkg.scope.addModule(scope);\n }\n\n if (props.export) {\n if (pkg) {\n if (isBoolean(props.export)) {\n pkg.scope.addExport(modulePath, scope);\n } else {\n pkg.scope.addExport(props.export, scope);\n }\n }\n }\n\n return (\n <SourceFileContext.Provider\n value={{\n scope\n }}>\n <Scope value={scope}>\n <SourceFile\n {...rest}\n path={modulePath}\n header={\n header ?? (\n <TypescriptFileHeader hashbang={hashbang}>\n <TypescriptFileHeaderImports\n imports={imports}\n builtinImports={builtinImports}\n scope={scope}\n />\n </TypescriptFileHeader>\n )\n }\n filetype={tsx ? \"tsx\" : \"typescript\"}>\n {children}\n </SourceFile>\n </Scope>\n </SourceFileContext.Provider>\n );\n}\n\nexport interface TypescriptFileHeaderProps extends SourceFileHeaderProps {\n header?: Children;\n hashbang?: Children | true;\n}\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function TypescriptFileHeader(props: TypescriptFileHeaderProps) {\n const {\n header,\n hashbang,\n disableEslint = true,\n disableBiome = true,\n children\n } = props;\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n <Show when={Boolean(hashbang)}>\n {hashbang === true\n ? code`#!/usr/bin/env ${\n context?.config.mode === \"development\"\n ? \"-S NODE_OPTIONS=--enable-source-maps\"\n : \"\"\n } node`\n : hashbang}\n <hbr />\n </Show>\n <Show when={Boolean(header)}>\n {header}\n <hbr />\n </Show>\n <hbr />\n <Show when={Boolean(disableEslint)}>\n <SingleLineComment variant=\"slash-star\">\n {\"eslint-disable\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disableBiome)}>\n <SingleLineComment>{\"biome-ignore lint: disable\"}</SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disableEslint) || Boolean(disableBiome)}>\n <hbr />\n </Show>\n <Show when={Boolean(children)}>\n {children}\n <hbr />\n </Show>\n <SingleLineComment>{`Generated by ${\n titleCase(context?.config?.framework?.name) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment>{getFileHeaderWarning(context!)}</SingleLineComment>\n <hbr />\n </>\n );\n}\n\nexport interface TypescriptFileHeaderImportsProps extends SourceFileHeaderProps {\n imports?: TypescriptFileImports;\n builtinImports?: TypescriptFileImports;\n scope?: TSModuleScope;\n}\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function TypescriptFileHeaderImports(\n props: TypescriptFileHeaderImportsProps\n) {\n const { imports: importProps, builtinImports: builtinImportsProps } = props;\n\n const context = usePowerlinesSafe();\n const sourceFile = useSourceFile();\n\n const scope = props.scope ?? sourceFile.scope;\n\n const imports = computed(() => {\n return Object.fromEntries(\n Object.entries(importProps ?? {}).map(([module, importItem]) => [\n module,\n Array.isArray(importItem)\n ? getUniqueBy(importItem, i => (isString(i) ? i : i.alias || i.name))\n : importItem\n ])\n );\n });\n const builtinImports = computed(() => {\n return Object.fromEntries(\n Object.entries(builtinImportsProps ?? {}).map(([module, importItem]) => [\n module,\n Array.isArray(importItem)\n ? getUniqueBy(importItem, i => (isString(i) ? i : i.alias || i.name))\n : importItem\n ])\n );\n });\n\n return (\n <Show\n when={\n scope.importedModules.size > 0 ||\n (!!imports.value && Object.keys(imports.value).length > 0) ||\n (!!builtinImports.value && Object.keys(builtinImports.value).length > 0)\n }>\n <Show when={!!imports.value && Object.keys(imports.value).length > 0}>\n <For\n each={Object.entries(imports.value ?? {})}\n hardline\n ender={<hbr />}>\n {([module, importItem]) =>\n code`import ${\n importItem === null\n ? \"\"\n : isString(importItem)\n ? importItem\n : `${\n (\n importItem.filter(\n i => !isString(i) && i.default\n ) as TypescriptFileImportItem[]\n )\n .map(\n i =>\n `${i.type ? \"type \" : \"\"}${\n i.alias ? i.alias : i.name\n }`\n )\n .join(\", \") +\n (importItem.filter(i => !isString(i) && i.default)\n .length > 0 &&\n importItem.filter(i => isString(i) || !i.default).length >\n 0\n ? \", \"\n : \"\") +\n (importItem.filter(i => isString(i) || !i.default)\n .length > 0\n ? `{ ${importItem\n .filter(i => isString(i) || !i.default)\n .map(i =>\n isString(i)\n ? i\n : `${i.type ? \"type \" : \"\"}${\n i.alias ? `${i.name} as ${i.alias}` : i.name\n }`\n )\n .join(\", \")} }`\n : \"\")\n }`\n } from \"${module}\";`\n }\n </For>\n </Show>\n <Show\n when={\n builtinImports.value && Object.keys(builtinImports.value).length > 0\n }>\n <For\n each={Object.entries(\n (builtinImports.value ?? {}) as Record<\n string,\n null | Array<TypescriptFileImportItem | string>\n >\n )}\n hardline\n ender={<hbr />}>\n {([module, importItem]) =>\n code`import ${\n importItem === null\n ? \"\"\n : isString(importItem)\n ? importItem\n : `${\n (\n importItem.filter(\n i => !isString(i) && i.default\n ) as TypescriptFileImportItem[]\n )\n .map(\n i =>\n `${i.type ? \"type \" : \"\"}${\n i.alias ? i.alias : i.name\n }`\n )\n .join(\", \") +\n (importItem.filter(i => !isString(i) && i.default)\n .length > 0 &&\n importItem.filter(i => isString(i) || !i.default).length >\n 0\n ? \", \"\n : \"\") +\n (importItem.filter(i => isString(i) || !i.default)\n .length > 0\n ? `{ ${importItem\n .filter(i => isString(i) || !i.default)\n .map(i =>\n isString(i)\n ? i\n : `${i.type ? \"type \" : \"\"}${\n i.alias ? `${i.name} as ${i.alias}` : i.name\n }`\n )\n .join(\", \")} }`\n : \"\")\n }`\n } from \"${\n module.includes(\":\")\n ? module\n : `${context?.config?.framework?.name || \"powerlines\"}:${module}`\n }\";`\n }\n </For>\n </Show>\n <Show when={scope.importedModules.size > 0}>\n <ImportStatements records={scope.importedModules} />\n </Show>\n <hbr />\n </Show>\n );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AAA,KAAA,CAAA,EAAA,OAAA,EAAA,SAAA,IAAA,OAAA,OAAA,WAAA,QAAA,MAAA,SAAA,CAAA,KAAA,CAAA,EAAA,OAAA,EAAA,SAAA,IAAA,KAAA,WAAA,QAAA,MAAA,SAAA,CAAA,KAAA,CAAA,EAAA,OAAA,EAAA,KAAA,MAAA,SAAA,CAAA,IAAA,IAAA,GAAA,EAAA,OAAA,UAAA,KAAA,EAAA,QAAA,GAAA,EAAA,KAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,KAAA,IAAA,EAAA,MAAA,MAAA,SAAA,OAAA,SAAA,GAAA,IAAA,SAAA,GAAA,SAAA,QAAA,WAAA,QAAA,aAAA,GAAA,SAAA;MACvB,CAAC;KACL;IACA,CAAC;IAAC,gBAAM,MAAA;KACN,IAAA,OAAM;MACJ,OAAE,MAAW,gBAAgB,OAAG;KAClC;KACD,IAAA,WAAA;MACF,OAAA,gBAAA,kBAAA,EACD,IAAA,UAAA;OACI,OAAA,MAAiB;MACd,EACL,CAAA;KACE;IACF,CAAC;IAAC,gBAAc,OAAU,CAAA,CAAA;GAAA;EAC5B;CACF,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"typescript-file.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lexical-scope.d.mts","names":[],"sources":["../../../src/typescript/contexts/lexical-scope.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"lexical-scope.d.mts","names":[],"sources":["../../../src/typescript/contexts/lexical-scope.tsx"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lexical-scope.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"lexical-scope.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member-scope.d.mts","names":[],"sources":["../../../src/typescript/contexts/member-scope.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"member-scope.d.mts","names":[],"sources":["../../../src/typescript/contexts/member-scope.tsx"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member-scope.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"member-scope.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-call-signature-props.d.mts","names":[],"sources":["../../../src/typescript/helpers/get-call-signature-props.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-call-signature-props.d.mts","names":[],"sources":["../../../src/typescript/helpers/get-call-signature-props.ts"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-call-signature-props.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"get-call-signature-props.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.d.mts","names":[],"sources":["../../../src/typescript/helpers/utilities.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"utilities.d.mts","names":[],"sources":["../../../src/typescript/helpers/utilities.ts"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"utilities.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yaml-file.d.mts","names":[],"sources":["../../../src/yaml/components/yaml-file.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"yaml-file.d.mts","names":[],"sources":["../../../src/yaml/components/yaml-file.tsx"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yaml-file.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"yaml-file.mjs","names":[],"sources":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-alloy",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.217",
|
|
4
4
|
"description": "A package containing various Alloy framework components and helper utilities.",
|
|
5
5
|
"keywords": ["alloy-js", "powerlines", "powerlines-plugin"],
|
|
6
6
|
"homepage": "https://stormsoftware.com",
|
|
@@ -906,8 +906,8 @@
|
|
|
906
906
|
"@alloy-js/json": "^0.23.0",
|
|
907
907
|
"@alloy-js/markdown": "^0.23.0",
|
|
908
908
|
"@alloy-js/typescript": "^0.23.0",
|
|
909
|
-
"@powerlines/deepkit": "
|
|
910
|
-
"@powerlines/plugin-babel": "0.13.
|
|
909
|
+
"@powerlines/deepkit": "0.9.78",
|
|
910
|
+
"@powerlines/plugin-babel": "0.13.120",
|
|
911
911
|
"@storm-software/config-tools": "^1.190.40",
|
|
912
912
|
"@stryke/capnp": "^0.12.111",
|
|
913
913
|
"@stryke/convert": "^0.7.15",
|
|
@@ -920,16 +920,16 @@
|
|
|
920
920
|
"@stryke/types": "^0.12.12",
|
|
921
921
|
"@stryke/unique-id": "^0.3.96",
|
|
922
922
|
"defu": "^6.1.7",
|
|
923
|
-
"powerlines": "0.47.
|
|
923
|
+
"powerlines": "0.47.124",
|
|
924
924
|
"prettier": "^3.8.3",
|
|
925
925
|
"unctx": "^2.5.0"
|
|
926
926
|
},
|
|
927
927
|
"devDependencies": {
|
|
928
|
-
"@powerlines/plugin-plugin": "0.12.
|
|
928
|
+
"@powerlines/plugin-plugin": "0.12.536",
|
|
929
929
|
"@types/node": "^25.9.1"
|
|
930
930
|
},
|
|
931
931
|
"peerDependencies": { "@alloy-js/babel-preset": ">=0.3.0" },
|
|
932
932
|
"peerDependenciesMeta": { "@alloy-js/babel-preset": { "optional": false } },
|
|
933
933
|
"publishConfig": { "access": "public" },
|
|
934
|
-
"gitHead": "
|
|
934
|
+
"gitHead": "1530c8cbb090f1f728d112475074eb3a86070557"
|
|
935
935
|
}
|