@alloy-js/typescript 0.25.0-dev.1 → 0.25.0
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/CHANGELOG.md +4 -0
- package/api-extractor.json +13 -1
- package/dist/dev/src/builtins/index.js.map +1 -1
- package/dist/dev/src/builtins/node.js.map +1 -1
- package/dist/dev/src/components/ArrayExpression.js +8 -8
- package/dist/dev/src/components/ArrayExpression.js.map +1 -1
- package/dist/dev/src/components/ArrowFunction.js +3 -3
- package/dist/dev/src/components/ArrowFunction.js.map +1 -1
- package/dist/dev/src/components/BarrelFile.js +3 -3
- package/dist/dev/src/components/BarrelFile.js.map +1 -1
- package/dist/dev/src/components/BlockScope.js +2 -2
- package/dist/dev/src/components/BlockScope.js.map +1 -1
- package/dist/dev/src/components/CallSignature.js +6 -5
- package/dist/dev/src/components/CallSignature.js.map +1 -1
- package/dist/dev/src/components/ClassDeclaration.js +4 -4
- package/dist/dev/src/components/ClassDeclaration.js.map +1 -1
- package/dist/dev/src/components/CommaList.js +1 -1
- package/dist/dev/src/components/CommaList.js.map +1 -1
- package/dist/dev/src/components/Declaration.js +5 -5
- package/dist/dev/src/components/Declaration.js.map +1 -1
- package/dist/dev/src/components/EnumDeclaration.js +12 -12
- package/dist/dev/src/components/EnumDeclaration.js.map +1 -1
- package/dist/dev/src/components/EnumMember.js +6 -6
- package/dist/dev/src/components/EnumMember.js.map +1 -1
- package/dist/dev/src/components/ExportStatement.js +1 -1
- package/dist/dev/src/components/ExportStatement.js.map +1 -1
- package/dist/dev/src/components/FunctionBase.js +27 -27
- package/dist/dev/src/components/FunctionBase.js.map +1 -1
- package/dist/dev/src/components/FunctionCallExpression.js +3 -3
- package/dist/dev/src/components/FunctionCallExpression.js.map +1 -1
- package/dist/dev/src/components/FunctionDeclaration.js +12 -12
- package/dist/dev/src/components/FunctionDeclaration.js.map +1 -1
- package/dist/dev/src/components/FunctionExpression.js +3 -3
- package/dist/dev/src/components/FunctionExpression.js.map +1 -1
- package/dist/dev/src/components/FunctionType.js +9 -9
- package/dist/dev/src/components/FunctionType.js.map +1 -1
- package/dist/dev/src/components/IfStatement.js +4 -3
- package/dist/dev/src/components/IfStatement.js.map +1 -1
- package/dist/dev/src/components/ImportStatement.js +10 -10
- package/dist/dev/src/components/ImportStatement.js.map +1 -1
- package/dist/dev/src/components/Interface.js +19 -19
- package/dist/dev/src/components/Interface.js.map +1 -1
- package/dist/dev/src/components/InterfaceMethod.js +11 -11
- package/dist/dev/src/components/InterfaceMethod.js.map +1 -1
- package/dist/dev/src/components/JSDoc.js +2 -2
- package/dist/dev/src/components/JSDoc.js.map +1 -1
- package/dist/dev/src/components/JSDocComment.js +1 -0
- package/dist/dev/src/components/JSDocComment.js.map +1 -1
- package/dist/dev/src/components/JSDocExample.js.map +1 -1
- package/dist/dev/src/components/JSDocParam.js +14 -14
- package/dist/dev/src/components/JSDocParam.js.map +1 -1
- package/dist/dev/src/components/LexicalScope.js +1 -1
- package/dist/dev/src/components/LexicalScope.js.map +1 -1
- package/dist/dev/src/components/MemberDeclaration.js.map +1 -1
- package/dist/dev/src/components/MemberExpression.js +17 -17
- package/dist/dev/src/components/MemberExpression.js.map +1 -1
- package/dist/dev/src/components/MemberScope.js +1 -1
- package/dist/dev/src/components/MemberScope.js.map +1 -1
- package/dist/dev/src/components/NewExpression.js +1 -1
- package/dist/dev/src/components/NewExpression.js.map +1 -1
- package/dist/dev/src/components/ObjectExpression.js +14 -14
- package/dist/dev/src/components/ObjectExpression.js.map +1 -1
- package/dist/dev/src/components/PackageDirectory.js +6 -6
- package/dist/dev/src/components/PackageDirectory.js.map +1 -1
- package/dist/dev/src/components/PackageJson.js +1 -1
- package/dist/dev/src/components/PackageJson.js.map +1 -1
- package/dist/dev/src/components/PropertyName.js +1 -1
- package/dist/dev/src/components/PropertyName.js.map +1 -1
- package/dist/dev/src/components/Reference.js +1 -1
- package/dist/dev/src/components/Reference.js.map +1 -1
- package/dist/dev/src/components/SingleLineCommentBlock.js.map +1 -1
- package/dist/dev/src/components/SourceFile.js.map +1 -1
- package/dist/dev/src/components/SwitchStatement.js +9 -9
- package/dist/dev/src/components/SwitchStatement.js.map +1 -1
- package/dist/dev/src/components/TryStatement.js +5 -5
- package/dist/dev/src/components/TryStatement.js.map +1 -1
- package/dist/dev/src/components/TryStatement.test.js +21 -21
- package/dist/dev/src/components/TryStatement.test.js.map +1 -1
- package/dist/dev/src/components/TsConfigJson.js +1 -1
- package/dist/dev/src/components/TsConfigJson.js.map +1 -1
- package/dist/dev/src/components/TypeDeclaration.js +5 -5
- package/dist/dev/src/components/TypeDeclaration.js.map +1 -1
- package/dist/dev/src/components/TypeRefContext.js +4 -4
- package/dist/dev/src/components/TypeRefContext.js.map +1 -1
- package/dist/dev/src/components/ValueExpression.js +2 -2
- package/dist/dev/src/components/ValueExpression.js.map +1 -1
- package/dist/dev/src/components/VarDeclaration.js +13 -13
- package/dist/dev/src/components/VarDeclaration.js.map +1 -1
- package/dist/dev/src/components/index.js +0 -1
- package/dist/dev/src/components/index.js.map +1 -1
- package/dist/dev/src/components/interface/expression.test.js +22 -22
- package/dist/dev/src/components/interface/expression.test.js.map +1 -1
- package/dist/dev/src/components/stc/index.js.map +1 -1
- package/dist/dev/src/context/index.js.map +1 -1
- package/dist/dev/src/context/package-metadata.js.map +1 -1
- package/dist/dev/src/context/type-ref-context.js.map +1 -1
- package/dist/dev/src/create-package.js.map +1 -1
- package/dist/dev/src/index.js +0 -1
- package/dist/dev/src/index.js.map +1 -1
- package/dist/dev/src/name-conflict-resolver.js.map +1 -1
- package/dist/dev/src/name-policy.js.map +1 -1
- package/dist/dev/src/parameter-descriptor.js.map +1 -1
- package/dist/dev/src/source-directory-data.js.map +1 -1
- package/dist/dev/src/symbols/index.js.map +1 -1
- package/dist/dev/src/symbols/reference.js +6 -6
- package/dist/dev/src/symbols/reference.js.map +1 -1
- package/dist/dev/src/symbols/scopes.js.map +1 -1
- package/dist/dev/src/symbols/ts-lexical-scope.js.map +1 -1
- package/dist/dev/src/symbols/ts-member-scope.js.map +1 -1
- package/dist/dev/src/symbols/ts-module-scope.js.map +1 -1
- package/dist/dev/src/symbols/ts-output-symbol.js.map +1 -1
- package/dist/dev/src/symbols/ts-package-scope.js.map +1 -1
- package/dist/dev/src/utils.js.map +1 -1
- package/dist/dev/test/array.test.js +24 -24
- package/dist/dev/test/array.test.js.map +1 -1
- package/dist/dev/test/arrow-function.test.js +38 -38
- package/dist/dev/test/arrow-function.test.js.map +1 -1
- package/dist/dev/test/barrel.test.js +13 -13
- package/dist/dev/test/barrel.test.js.map +1 -1
- package/dist/dev/test/basic.test.js +11 -11
- package/dist/dev/test/basic.test.js.map +1 -1
- package/dist/dev/test/block-scope.test.js +7 -7
- package/dist/dev/test/block-scope.test.js.map +1 -1
- package/dist/dev/test/class.test.js +104 -104
- package/dist/dev/test/class.test.js.map +1 -1
- package/dist/dev/test/decl-helpers.test.js +17 -17
- package/dist/dev/test/decl-helpers.test.js.map +1 -1
- package/dist/dev/test/enum-jsdoc.test.js +13 -13
- package/dist/dev/test/enum-jsdoc.test.js.map +1 -1
- package/dist/dev/test/enum.test.js.map +1 -1
- package/dist/dev/test/externals.test.js +33 -33
- package/dist/dev/test/externals.test.js.map +1 -1
- package/dist/dev/test/function-call-expression.test.js +14 -14
- package/dist/dev/test/function-call-expression.test.js.map +1 -1
- package/dist/dev/test/function-declaration-jsdoc.test.js +12 -12
- package/dist/dev/test/function-declaration-jsdoc.test.js.map +1 -1
- package/dist/dev/test/function-declaration.test.js +75 -75
- package/dist/dev/test/function-declaration.test.js.map +1 -1
- package/dist/dev/test/function-expression.test.js +38 -38
- package/dist/dev/test/function-expression.test.js.map +1 -1
- package/dist/dev/test/function-type.test.js +27 -27
- package/dist/dev/test/function-type.test.js.map +1 -1
- package/dist/dev/test/if-statement.test.js +4 -4
- package/dist/dev/test/if-statement.test.js.map +1 -1
- package/dist/dev/test/imports-reactive.test.js +14 -14
- package/dist/dev/test/imports-reactive.test.js.map +1 -1
- package/dist/dev/test/imports.test.js +161 -161
- package/dist/dev/test/imports.test.js.map +1 -1
- package/dist/dev/test/interface-jsdoc.test.js +27 -27
- package/dist/dev/test/interface-jsdoc.test.js.map +1 -1
- package/dist/dev/test/interface.test.js +118 -118
- package/dist/dev/test/interface.test.js.map +1 -1
- package/dist/dev/test/jscomment.test.js +13 -13
- package/dist/dev/test/jscomment.test.js.map +1 -1
- package/dist/dev/test/jsdoc.test.js +17 -17
- package/dist/dev/test/jsdoc.test.js.map +1 -1
- package/dist/dev/test/jsdocparam.test.js +18 -18
- package/dist/dev/test/jsdocparam.test.js.map +1 -1
- package/dist/dev/test/member-expression.test.js +282 -282
- package/dist/dev/test/member-expression.test.js.map +1 -1
- package/dist/dev/test/name-conflict.test.js +3 -3
- package/dist/dev/test/name-conflict.test.js.map +1 -1
- package/dist/dev/test/name-policy.test.js +24 -24
- package/dist/dev/test/name-policy.test.js.map +1 -1
- package/dist/dev/test/new-expression.test.js +9 -9
- package/dist/dev/test/new-expression.test.js.map +1 -1
- package/dist/dev/test/object.test.js +19 -19
- package/dist/dev/test/object.test.js.map +1 -1
- package/dist/dev/test/package-external.test.js +20 -20
- package/dist/dev/test/package-external.test.js.map +1 -1
- package/dist/dev/test/package-json.test.js +4 -4
- package/dist/dev/test/package-json.test.js.map +1 -1
- package/dist/dev/test/package.test.js +14 -14
- package/dist/dev/test/package.test.js.map +1 -1
- package/dist/dev/test/reference.test.js +12 -12
- package/dist/dev/test/reference.test.js.map +1 -1
- package/dist/dev/test/source-file.test.js +4 -4
- package/dist/dev/test/source-file.test.js.map +1 -1
- package/dist/dev/test/switch-statement.test.js +9 -9
- package/dist/dev/test/switch-statement.test.js.map +1 -1
- package/dist/dev/test/utils.js +2 -2
- package/dist/dev/test/utils.js.map +1 -1
- package/dist/dev/test/value-expression.test.js +2 -2
- package/dist/dev/test/value-expression.test.js.map +1 -1
- package/dist/dev/test/values.test.js.map +1 -1
- package/dist/dev/test/var-declaration-jsdoc.test.js +6 -6
- package/dist/dev/test/var-declaration-jsdoc.test.js.map +1 -1
- package/dist/dev/test/var-declaration.test.js +40 -40
- package/dist/dev/test/var-declaration.test.js.map +1 -1
- package/dist/dev/test/vitest.setup.js.map +1 -1
- package/dist/dev/testing/create-wrapper.js +1 -1
- package/dist/dev/testing/create-wrapper.js.map +1 -1
- package/dist/dev/testing/create-wrapper.test.js +20 -20
- package/dist/dev/testing/create-wrapper.test.js.map +1 -1
- package/dist/dev/testing/index.js.map +1 -1
- package/dist/src/builtins/index.js.map +1 -1
- package/dist/src/builtins/node.d.ts +58 -58
- package/dist/src/builtins/node.d.ts.map +1 -1
- package/dist/src/builtins/node.js.map +1 -1
- package/dist/src/components/ArrayExpression.d.ts +1 -1
- package/dist/src/components/ArrayExpression.d.ts.map +1 -1
- package/dist/src/components/ArrayExpression.js.map +1 -1
- package/dist/src/components/ArrowFunction.d.ts +5 -4
- package/dist/src/components/ArrowFunction.d.ts.map +1 -1
- package/dist/src/components/ArrowFunction.js.map +1 -1
- package/dist/src/components/BarrelFile.d.ts.map +1 -1
- package/dist/src/components/BarrelFile.js.map +1 -1
- package/dist/src/components/BlockScope.d.ts +1 -1
- package/dist/src/components/BlockScope.d.ts.map +1 -1
- package/dist/src/components/BlockScope.js.map +1 -1
- package/dist/src/components/CallSignature.d.ts +1 -1
- package/dist/src/components/CallSignature.d.ts.map +1 -1
- package/dist/src/components/CallSignature.js +1 -0
- package/dist/src/components/CallSignature.js.map +1 -1
- package/dist/src/components/ClassDeclaration.d.ts +3 -3
- package/dist/src/components/ClassDeclaration.d.ts.map +1 -1
- package/dist/src/components/ClassDeclaration.js.map +1 -1
- package/dist/src/components/CommaList.d.ts +1 -1
- package/dist/src/components/CommaList.d.ts.map +1 -1
- package/dist/src/components/CommaList.js.map +1 -1
- package/dist/src/components/Declaration.d.ts +3 -3
- package/dist/src/components/Declaration.d.ts.map +1 -1
- package/dist/src/components/Declaration.js +3 -3
- package/dist/src/components/Declaration.js.map +1 -1
- package/dist/src/components/EnumDeclaration.d.ts +1 -1
- package/dist/src/components/EnumDeclaration.d.ts.map +1 -1
- package/dist/src/components/EnumDeclaration.js.map +1 -1
- package/dist/src/components/EnumMember.d.ts +1 -1
- package/dist/src/components/EnumMember.d.ts.map +1 -1
- package/dist/src/components/EnumMember.js.map +1 -1
- package/dist/src/components/ExportStatement.d.ts +2 -2
- package/dist/src/components/ExportStatement.d.ts.map +1 -1
- package/dist/src/components/ExportStatement.js.map +1 -1
- package/dist/src/components/FunctionBase.d.ts +1 -1
- package/dist/src/components/FunctionBase.d.ts.map +1 -1
- package/dist/src/components/FunctionBase.js.map +1 -1
- package/dist/src/components/FunctionCallExpression.d.ts +1 -1
- package/dist/src/components/FunctionCallExpression.d.ts.map +1 -1
- package/dist/src/components/FunctionCallExpression.js.map +1 -1
- package/dist/src/components/FunctionDeclaration.d.ts +6 -5
- package/dist/src/components/FunctionDeclaration.d.ts.map +1 -1
- package/dist/src/components/FunctionDeclaration.js.map +1 -1
- package/dist/src/components/FunctionExpression.d.ts +5 -4
- package/dist/src/components/FunctionExpression.d.ts.map +1 -1
- package/dist/src/components/FunctionExpression.js.map +1 -1
- package/dist/src/components/FunctionType.d.ts +1 -1
- package/dist/src/components/FunctionType.d.ts.map +1 -1
- package/dist/src/components/FunctionType.js.map +1 -1
- package/dist/src/components/IfStatement.d.ts.map +1 -1
- package/dist/src/components/IfStatement.js +1 -0
- package/dist/src/components/IfStatement.js.map +1 -1
- package/dist/src/components/ImportStatement.d.ts +1 -1
- package/dist/src/components/ImportStatement.d.ts.map +1 -1
- package/dist/src/components/ImportStatement.js.map +1 -1
- package/dist/src/components/Interface.d.ts +5 -4
- package/dist/src/components/Interface.d.ts.map +1 -1
- package/dist/src/components/Interface.js.map +1 -1
- package/dist/src/components/InterfaceMethod.d.ts +6 -4
- package/dist/src/components/InterfaceMethod.d.ts.map +1 -1
- package/dist/src/components/InterfaceMethod.js.map +1 -1
- package/dist/src/components/JSDoc.d.ts.map +1 -1
- package/dist/src/components/JSDoc.js.map +1 -1
- package/dist/src/components/JSDocComment.js +1 -0
- package/dist/src/components/JSDocComment.js.map +1 -1
- package/dist/src/components/JSDocExample.js.map +1 -1
- package/dist/src/components/JSDocParam.d.ts +1 -1
- package/dist/src/components/JSDocParam.d.ts.map +1 -1
- package/dist/src/components/JSDocParam.js.map +1 -1
- package/dist/src/components/LexicalScope.d.ts +1 -1
- package/dist/src/components/LexicalScope.d.ts.map +1 -1
- package/dist/src/components/LexicalScope.js.map +1 -1
- package/dist/src/components/MemberDeclaration.d.ts +3 -3
- package/dist/src/components/MemberDeclaration.d.ts.map +1 -1
- package/dist/src/components/MemberDeclaration.js.map +1 -1
- package/dist/src/components/MemberExpression.d.ts +4 -2
- package/dist/src/components/MemberExpression.d.ts.map +1 -1
- package/dist/src/components/MemberExpression.js.map +1 -1
- package/dist/src/components/MemberScope.d.ts +2 -2
- package/dist/src/components/MemberScope.d.ts.map +1 -1
- package/dist/src/components/MemberScope.js.map +1 -1
- package/dist/src/components/NewExpression.d.ts +1 -1
- package/dist/src/components/NewExpression.d.ts.map +1 -1
- package/dist/src/components/NewExpression.js.map +1 -1
- package/dist/src/components/ObjectExpression.d.ts +1 -1
- package/dist/src/components/ObjectExpression.d.ts.map +1 -1
- package/dist/src/components/ObjectExpression.js.map +1 -1
- package/dist/src/components/PackageDirectory.d.ts +3 -3
- package/dist/src/components/PackageDirectory.d.ts.map +1 -1
- package/dist/src/components/PackageDirectory.js.map +1 -1
- package/dist/src/components/PackageJson.d.ts.map +1 -1
- package/dist/src/components/PackageJson.js.map +1 -1
- package/dist/src/components/PropertyName.d.ts.map +1 -1
- package/dist/src/components/PropertyName.js.map +1 -1
- package/dist/src/components/Reference.d.ts +1 -1
- package/dist/src/components/Reference.d.ts.map +1 -1
- package/dist/src/components/Reference.js.map +1 -1
- package/dist/src/components/SingleLineCommentBlock.js.map +1 -1
- package/dist/src/components/SourceFile.d.ts +2 -1
- package/dist/src/components/SourceFile.d.ts.map +1 -1
- package/dist/src/components/SourceFile.js.map +1 -1
- package/dist/src/components/SwitchStatement.d.ts.map +1 -1
- package/dist/src/components/SwitchStatement.js.map +1 -1
- package/dist/src/components/TryStatement.d.ts.map +1 -1
- package/dist/src/components/TryStatement.js.map +1 -1
- package/dist/src/components/TryStatement.test.js.map +1 -1
- package/dist/src/components/TsConfigJson.d.ts.map +1 -1
- package/dist/src/components/TsConfigJson.js.map +1 -1
- package/dist/src/components/TypeDeclaration.d.ts +1 -1
- package/dist/src/components/TypeDeclaration.d.ts.map +1 -1
- package/dist/src/components/TypeDeclaration.js.map +1 -1
- package/dist/src/components/TypeRefContext.d.ts.map +1 -1
- package/dist/src/components/TypeRefContext.js.map +1 -1
- package/dist/src/components/ValueExpression.d.ts +1 -1
- package/dist/src/components/ValueExpression.d.ts.map +1 -1
- package/dist/src/components/ValueExpression.js.map +1 -1
- package/dist/src/components/VarDeclaration.d.ts +2 -2
- package/dist/src/components/VarDeclaration.d.ts.map +1 -1
- package/dist/src/components/VarDeclaration.js.map +1 -1
- package/dist/src/components/index.d.ts +1 -1
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +0 -1
- package/dist/src/components/index.js.map +1 -1
- package/dist/src/components/interface/expression.test.js.map +1 -1
- package/dist/src/components/stc/index.js.map +1 -1
- package/dist/src/context/index.js.map +1 -1
- package/dist/src/context/package-metadata.d.ts +2 -2
- package/dist/src/context/package-metadata.d.ts.map +1 -1
- package/dist/src/context/package-metadata.js.map +1 -1
- package/dist/src/context/type-ref-context.d.ts +1 -1
- package/dist/src/context/type-ref-context.d.ts.map +1 -1
- package/dist/src/context/type-ref-context.js.map +1 -1
- package/dist/src/create-package.d.ts +6 -5
- package/dist/src/create-package.d.ts.map +1 -1
- package/dist/src/create-package.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +0 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/name-conflict-resolver.d.ts +1 -1
- package/dist/src/name-conflict-resolver.d.ts.map +1 -1
- package/dist/src/name-conflict-resolver.js.map +1 -1
- package/dist/src/name-policy.d.ts +1 -1
- package/dist/src/name-policy.d.ts.map +1 -1
- package/dist/src/name-policy.js.map +1 -1
- package/dist/src/parameter-descriptor.js.map +1 -1
- package/dist/src/source-directory-data.d.ts +2 -2
- package/dist/src/source-directory-data.d.ts.map +1 -1
- package/dist/src/source-directory-data.js.map +1 -1
- package/dist/src/symbols/index.d.ts +3 -2
- package/dist/src/symbols/index.d.ts.map +1 -1
- package/dist/src/symbols/index.js.map +1 -1
- package/dist/src/symbols/reference.d.ts +2 -2
- package/dist/src/symbols/reference.d.ts.map +1 -1
- package/dist/src/symbols/reference.js.map +1 -1
- package/dist/src/symbols/scopes.d.ts +2 -2
- package/dist/src/symbols/scopes.d.ts.map +1 -1
- package/dist/src/symbols/scopes.js.map +1 -1
- package/dist/src/symbols/ts-lexical-scope.js.map +1 -1
- package/dist/src/symbols/ts-member-scope.d.ts +3 -3
- package/dist/src/symbols/ts-member-scope.d.ts.map +1 -1
- package/dist/src/symbols/ts-member-scope.js.map +1 -1
- package/dist/src/symbols/ts-module-scope.d.ts +1 -1
- package/dist/src/symbols/ts-module-scope.d.ts.map +1 -1
- package/dist/src/symbols/ts-module-scope.js.map +1 -1
- package/dist/src/symbols/ts-output-symbol.d.ts +3 -2
- package/dist/src/symbols/ts-output-symbol.d.ts.map +1 -1
- package/dist/src/symbols/ts-output-symbol.js.map +1 -1
- package/dist/src/symbols/ts-package-scope.d.ts +3 -2
- package/dist/src/symbols/ts-package-scope.d.ts.map +1 -1
- package/dist/src/symbols/ts-package-scope.js.map +1 -1
- package/dist/src/utils.d.ts +2 -2
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js.map +1 -1
- package/dist/test/array.test.js.map +1 -1
- package/dist/test/arrow-function.test.js.map +1 -1
- package/dist/test/barrel.test.js.map +1 -1
- package/dist/test/basic.test.js.map +1 -1
- package/dist/test/block-scope.test.js.map +1 -1
- package/dist/test/class.test.js.map +1 -1
- package/dist/test/decl-helpers.test.js.map +1 -1
- package/dist/test/enum-jsdoc.test.js.map +1 -1
- package/dist/test/enum.test.js.map +1 -1
- package/dist/test/externals.test.js.map +1 -1
- package/dist/test/function-call-expression.test.js.map +1 -1
- package/dist/test/function-declaration-jsdoc.test.js.map +1 -1
- package/dist/test/function-declaration.test.js.map +1 -1
- package/dist/test/function-expression.test.js.map +1 -1
- package/dist/test/function-type.test.js.map +1 -1
- package/dist/test/if-statement.test.js.map +1 -1
- package/dist/test/imports-reactive.test.js.map +1 -1
- package/dist/test/imports.test.js.map +1 -1
- package/dist/test/interface-jsdoc.test.js.map +1 -1
- package/dist/test/interface.test.js.map +1 -1
- package/dist/test/jscomment.test.js.map +1 -1
- package/dist/test/jsdoc.test.js.map +1 -1
- package/dist/test/jsdocparam.test.js.map +1 -1
- package/dist/test/member-expression.test.js.map +1 -1
- package/dist/test/name-conflict.test.js.map +1 -1
- package/dist/test/name-policy.test.js.map +1 -1
- package/dist/test/new-expression.test.js.map +1 -1
- package/dist/test/object.test.js.map +1 -1
- package/dist/test/package-external.test.js.map +1 -1
- package/dist/test/package-json.test.js.map +1 -1
- package/dist/test/package.test.js.map +1 -1
- package/dist/test/reference.test.js.map +1 -1
- package/dist/test/source-file.test.js.map +1 -1
- package/dist/test/switch-statement.test.js.map +1 -1
- package/dist/test/utils.d.ts +1 -1
- package/dist/test/utils.d.ts.map +1 -1
- package/dist/test/utils.js.map +1 -1
- package/dist/test/value-expression.test.js.map +1 -1
- package/dist/test/values.test.js.map +1 -1
- package/dist/test/var-declaration-jsdoc.test.js.map +1 -1
- package/dist/test/var-declaration.test.js.map +1 -1
- package/dist/test/vitest.setup.js.map +1 -1
- package/dist/testing/create-wrapper.d.ts.map +1 -1
- package/dist/testing/create-wrapper.js +1 -1
- package/dist/testing/create-wrapper.js.map +1 -1
- package/dist/testing/create-wrapper.test.js +1 -1
- package/dist/testing/create-wrapper.test.js.map +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/api/components/ArrowFunction.md +9 -9
- package/docs/api/components/BlockScope.md +20 -20
- package/docs/api/components/CallSignature.md +7 -7
- package/docs/api/components/CatchClause.md +4 -4
- package/docs/api/components/ClassDeclaration.md +4 -4
- package/docs/api/components/ClassField.md +15 -15
- package/docs/api/components/ClassMember.md +12 -12
- package/docs/api/components/ClassMethod.md +19 -19
- package/docs/api/components/Declaration.md +16 -16
- package/docs/api/components/EnumMember.md +8 -8
- package/docs/api/components/ExportStatement.md +4 -4
- package/docs/api/components/FunctionCallExpression.md +4 -4
- package/docs/api/components/FunctionDeclaration.md +9 -9
- package/docs/api/components/FunctionExpression.md +9 -9
- package/docs/api/components/InterfaceDeclaration.md +4 -4
- package/docs/api/components/InterfaceMember.md +18 -18
- package/docs/api/components/InterfaceMethod.md +12 -12
- package/docs/api/components/NewExpression.md +4 -4
- package/docs/api/components/ObjectExpression.md +1 -1
- package/docs/api/components/ObjectProperty.md +8 -8
- package/docs/api/components/ObjectSpreadProperty.md +5 -5
- package/docs/api/components/PackageDirectory.md +2 -2
- package/docs/api/components/PackageJsonFile.md +16 -16
- package/docs/api/components/SourceFile.md +7 -7
- package/docs/api/components/VarDeclaration.md +8 -8
- package/docs/api/functions/createInstanceMemberSymbol.md +16 -16
- package/docs/api/functions/createLexicalScope.md +5 -5
- package/docs/api/functions/createMemberScope.md +5 -5
- package/docs/api/functions/createMemberSymbol.md +16 -16
- package/docs/api/functions/createPrivateInstanceMemberSymbol.md +16 -16
- package/docs/api/functions/createPrivateStaticMemberSymbol.md +16 -16
- package/docs/api/functions/createStaticMemberSymbol.md +16 -16
- package/docs/api/functions/createTypeAndValueSymbol.md +16 -16
- package/docs/api/functions/createTypeSymbol.md +16 -16
- package/docs/api/functions/createValueSymbol.md +16 -16
- package/docs/api/functions/decl.md +16 -16
- package/docs/api/functions/declMember.md +16 -16
- package/docs/api/functions/declType.md +16 -16
- package/docs/api/types/CreateTsSymbolOptions.md +6 -6
- package/docs/api/types/DeclarationPropsBase.md +4 -4
- package/docs/api/types/FunctionBodyProps.md +3 -3
- package/docs/api/types/FunctionParametersProps.md +4 -4
- package/docs/api/types/FunctionTypeParametersProps.md +4 -4
- package/docs/api/types/FunctionTypeProps.md +5 -5
- package/docs/api/types/InterfaceExpressionProps.md +3 -3
- package/docs/api/types/InterfaceMemberPropsBase.md +7 -7
- package/docs/api/types/MemberExpressionPartProps.md +11 -11
- package/docs/api/types/ModuleSymbolsDescriptor.md +4 -4
- package/docs/api/types/NamedMap.md +4 -4
- package/docs/api/types/ParameterDescriptor.md +3 -3
- package/docs/api/types/ParameterDescriptorBase.md +10 -10
- package/docs/api/types/SourceFileHeaderProps.md +4 -4
- package/docs/api/types/TypeParameterDescriptor.md +7 -7
- package/docs/api/types/TypeParametersProps.md +4 -4
- package/package.json +8 -8
- package/src/builtins/node.ts +2 -1
- package/src/components/ArrayExpression.tsx +3 -1
- package/src/components/ArrowFunction.tsx +3 -1
- package/src/components/BarrelFile.tsx +2 -1
- package/src/components/BlockScope.tsx +3 -2
- package/src/components/CallSignature.tsx +14 -13
- package/src/components/ClassDeclaration.tsx +5 -5
- package/src/components/CommaList.tsx +2 -1
- package/src/components/Declaration.tsx +8 -15
- package/src/components/EnumDeclaration.tsx +2 -1
- package/src/components/EnumMember.tsx +7 -3
- package/src/components/ExportStatement.tsx +2 -1
- package/src/components/FunctionBase.tsx +8 -10
- package/src/components/FunctionCallExpression.tsx +2 -1
- package/src/components/FunctionDeclaration.tsx +5 -2
- package/src/components/FunctionExpression.tsx +3 -1
- package/src/components/FunctionType.tsx +3 -1
- package/src/components/IfStatement.tsx +1 -0
- package/src/components/ImportStatement.tsx +7 -8
- package/src/components/Interface.tsx +17 -16
- package/src/components/InterfaceMethod.tsx +4 -3
- package/src/components/JSDoc.tsx +1 -0
- package/src/components/JSDocParam.tsx +2 -1
- package/src/components/LexicalScope.tsx +3 -1
- package/src/components/MemberDeclaration.tsx +10 -10
- package/src/components/MemberExpression.tsx +34 -39
- package/src/components/MemberScope.tsx +4 -6
- package/src/components/NewExpression.tsx +3 -4
- package/src/components/ObjectExpression.tsx +2 -3
- package/src/components/PackageDirectory.tsx +6 -5
- package/src/components/PackageJson.tsx +4 -3
- package/src/components/PropertyName.tsx +2 -1
- package/src/components/Reference.tsx +3 -1
- package/src/components/SourceFile.tsx +4 -4
- package/src/components/SwitchStatement.tsx +5 -3
- package/src/components/TryStatement.test.tsx +1 -0
- package/src/components/TryStatement.tsx +4 -3
- package/src/components/TsConfigJson.tsx +1 -0
- package/src/components/TypeDeclaration.tsx +3 -1
- package/src/components/TypeRefContext.tsx +1 -0
- package/src/components/ValueExpression.tsx +3 -1
- package/src/components/VarDeclaration.tsx +9 -12
- package/src/components/index.ts +1 -1
- package/src/components/interface/expression.test.tsx +1 -0
- package/src/context/package-metadata.ts +4 -2
- package/src/context/type-ref-context.tsx +2 -5
- package/src/create-package.ts +15 -15
- package/src/index.ts +1 -1
- package/src/name-conflict-resolver.ts +4 -2
- package/src/name-policy.ts +2 -1
- package/src/source-directory-data.ts +4 -2
- package/src/symbols/index.ts +4 -3
- package/src/symbols/reference.tsx +12 -7
- package/src/symbols/scopes.ts +3 -2
- package/src/symbols/ts-member-scope.ts +4 -3
- package/src/symbols/ts-module-scope.ts +3 -6
- package/src/symbols/ts-output-symbol.ts +3 -4
- package/src/symbols/ts-package-scope.ts +4 -7
- package/src/utils.ts +2 -1
- package/temp/api.json +231 -1190
- package/test/array.test.tsx +1 -0
- package/test/arrow-function.test.tsx +4 -2
- package/test/barrel.test.tsx +1 -0
- package/test/basic.test.tsx +1 -0
- package/test/block-scope.test.tsx +1 -0
- package/test/class.test.tsx +1 -0
- package/test/decl-helpers.test.tsx +1 -0
- package/test/enum-jsdoc.test.tsx +1 -0
- package/test/externals.test.tsx +1 -0
- package/test/function-call-expression.test.tsx +1 -0
- package/test/function-declaration-jsdoc.test.tsx +1 -0
- package/test/function-declaration.test.tsx +3 -2
- package/test/function-expression.test.tsx +4 -2
- package/test/function-type.test.tsx +4 -2
- package/test/if-statement.test.tsx +1 -0
- package/test/imports-reactive.test.tsx +1 -0
- package/test/imports.test.tsx +1 -0
- package/test/interface-jsdoc.test.tsx +1 -0
- package/test/interface.test.tsx +3 -2
- package/test/jscomment.test.tsx +1 -0
- package/test/jsdoc.test.tsx +1 -0
- package/test/jsdocparam.test.tsx +1 -0
- package/test/member-expression.test.tsx +2 -1
- package/test/name-conflict.test.tsx +5 -3
- package/test/name-policy.test.tsx +1 -0
- package/test/new-expression.test.tsx +1 -0
- package/test/object.test.tsx +1 -0
- package/test/package-external.test.tsx +1 -0
- package/test/package-json.test.tsx +1 -0
- package/test/package.test.tsx +1 -0
- package/test/reference.test.tsx +1 -0
- package/test/source-file.test.tsx +1 -0
- package/test/switch-statement.test.tsx +1 -0
- package/test/utils.tsx +3 -1
- package/test/value-expression.test.tsx +1 -0
- package/test/var-declaration-jsdoc.test.tsx +1 -0
- package/test/var-declaration.test.tsx +1 -0
- package/testing/create-wrapper.test.tsx +6 -3
- package/testing/create-wrapper.tsx +3 -1
- package/tsdoc-metadata.json +1 -1
- package/vitest.config.ts +0 -12
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
OutputSymbol,
|
|
7
|
-
Refkey,
|
|
8
|
-
Show,
|
|
9
|
-
} from "@alloy-js/core";
|
|
10
|
-
|
|
11
|
-
import { TSOutputSymbol, TSSymbolFlags } from "../symbols/ts-output-symbol.js";
|
|
1
|
+
import type { Children, OutputSymbol, Refkey } from "@alloy-js/core";
|
|
2
|
+
import { computed, createAccessExpression, For, Show } from "@alloy-js/core";
|
|
3
|
+
|
|
4
|
+
import type { TSOutputSymbol } from "../symbols/ts-output-symbol.js";
|
|
5
|
+
import { TSSymbolFlags } from "../symbols/ts-output-symbol.js";
|
|
12
6
|
import { isValidJSIdentifier } from "../utils.js";
|
|
13
7
|
|
|
14
8
|
export interface MemberExpressionProps {
|
|
@@ -65,9 +59,8 @@ const { Expression, Part, registerOuterComponent } = createAccessExpression<
|
|
|
65
59
|
} else if (first && partProps.refkey) {
|
|
66
60
|
id = partProps.refkey;
|
|
67
61
|
} else if (partProps.id !== undefined) {
|
|
68
|
-
id =
|
|
69
|
-
|
|
70
|
-
partProps.id
|
|
62
|
+
id = isNumericIdentifier(partProps.id)
|
|
63
|
+
? partProps.id
|
|
71
64
|
: escapeId(partProps.id);
|
|
72
65
|
} else if (partProps.index !== undefined) {
|
|
73
66
|
id = partProps.index;
|
|
@@ -80,20 +73,19 @@ const { Expression, Part, registerOuterComponent } = createAccessExpression<
|
|
|
80
73
|
let accessStyle: "dot" | "bracket";
|
|
81
74
|
if (partProps.children !== undefined) {
|
|
82
75
|
accessStyle =
|
|
83
|
-
typeof partProps.children === "string"
|
|
84
|
-
partProps.quoteId
|
|
85
|
-
"bracket"
|
|
86
|
-
|
|
87
|
-
|
|
76
|
+
typeof partProps.children === "string"
|
|
77
|
+
? partProps.quoteId
|
|
78
|
+
? "bracket"
|
|
79
|
+
: accessStyleForMemberName(partProps.children)
|
|
80
|
+
: "bracket";
|
|
88
81
|
} else if (partProps.args) {
|
|
89
82
|
accessStyle = "dot";
|
|
90
83
|
} else if (partProps.quoteId) {
|
|
91
84
|
accessStyle = "bracket";
|
|
92
85
|
} else if (partProps.id !== undefined) {
|
|
93
|
-
accessStyle =
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
);
|
|
86
|
+
accessStyle = isNumericIdentifier(partProps.id)
|
|
87
|
+
? "bracket"
|
|
88
|
+
: accessStyleForMemberName(partProps.id);
|
|
97
89
|
} else if (partProps.index !== undefined) {
|
|
98
90
|
accessStyle = "bracket";
|
|
99
91
|
} else if (sym) {
|
|
@@ -105,17 +97,20 @@ const { Expression, Part, registerOuterComponent } = createAccessExpression<
|
|
|
105
97
|
return {
|
|
106
98
|
id,
|
|
107
99
|
accessStyle,
|
|
108
|
-
quoteId:
|
|
109
|
-
|
|
110
|
-
: partProps.id !== undefined
|
|
111
|
-
isNumericIdentifier(partProps.id)
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
100
|
+
quoteId: partProps.quoteId
|
|
101
|
+
? partProps.quoteId
|
|
102
|
+
: partProps.id !== undefined
|
|
103
|
+
? isNumericIdentifier(partProps.id)
|
|
104
|
+
? false
|
|
105
|
+
: !isValidJSIdentifier(partProps.id)
|
|
106
|
+
: sym
|
|
107
|
+
? !isValidJSIdentifier(sym.name)
|
|
108
|
+
: false,
|
|
109
|
+
nullish: partProps.nullish
|
|
110
|
+
? partProps.nullish
|
|
111
|
+
: sym
|
|
112
|
+
? isNullish(sym)
|
|
113
|
+
: false,
|
|
119
114
|
args: partProps.args === true ? [] : partProps.args,
|
|
120
115
|
jsPrivate: !!sym && (sym as TSOutputSymbol).isPrivateMemberSymbol,
|
|
121
116
|
type: !!sym && (sym as TSOutputSymbol).isTypeSymbol,
|
|
@@ -293,11 +288,11 @@ function formatDotAccess(prevPart: PartDescriptor, part: PartDescriptor) {
|
|
|
293
288
|
<indent>
|
|
294
289
|
<sbr />
|
|
295
290
|
{prevPart.nullish ? "?." : "."}
|
|
296
|
-
{isIdPartDescriptor(part)
|
|
297
|
-
part.jsPrivate
|
|
298
|
-
`#${part.id}`
|
|
299
|
-
|
|
300
|
-
|
|
291
|
+
{isIdPartDescriptor(part)
|
|
292
|
+
? part.jsPrivate
|
|
293
|
+
? `#${part.id}`
|
|
294
|
+
: part.id
|
|
295
|
+
: part.index}
|
|
301
296
|
</indent>
|
|
302
297
|
</group>
|
|
303
298
|
);
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
createScope,
|
|
5
|
-
} from "@alloy-js/core";
|
|
1
|
+
import type { Children } from "@alloy-js/core";
|
|
2
|
+
import { MemberScope as CoreMemberScope, createScope } from "@alloy-js/core";
|
|
3
|
+
|
|
6
4
|
import { useTSLexicalScopeIfPresent } from "../symbols/scopes.js";
|
|
7
5
|
import { TSMemberScope } from "../symbols/ts-member-scope.js";
|
|
8
|
-
import { TSOutputSymbol } from "../symbols/ts-output-symbol.js";
|
|
6
|
+
import type { TSOutputSymbol } from "../symbols/ts-output-symbol.js";
|
|
9
7
|
|
|
10
8
|
export interface MemberScopeProps {
|
|
11
9
|
children: Children;
|
|
@@ -2,11 +2,10 @@ import {
|
|
|
2
2
|
emitSymbol,
|
|
3
3
|
instantiateTakenMembersTo as instantiateTakenSymbolsTo,
|
|
4
4
|
} from "@alloy-js/core";
|
|
5
|
+
|
|
5
6
|
import { createValueSymbol } from "../symbols/index.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
FunctionCallExpressionProps,
|
|
9
|
-
} from "./FunctionCallExpression.jsx";
|
|
7
|
+
import type { FunctionCallExpressionProps } from "./FunctionCallExpression.jsx";
|
|
8
|
+
import { FunctionCallExpression } from "./FunctionCallExpression.jsx";
|
|
10
9
|
|
|
11
10
|
export interface NewExpressionProps extends FunctionCallExpressionProps {}
|
|
12
11
|
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
+
import type { Children, Namekey, Refkey } from "@alloy-js/core";
|
|
1
2
|
import {
|
|
2
3
|
Block,
|
|
3
|
-
Children,
|
|
4
4
|
computed,
|
|
5
5
|
emitSymbol,
|
|
6
6
|
For,
|
|
7
7
|
isNamekey,
|
|
8
8
|
Match,
|
|
9
9
|
moveTakenMembersTo,
|
|
10
|
-
Namekey,
|
|
11
|
-
Refkey,
|
|
12
10
|
Switch,
|
|
13
11
|
takeSymbols,
|
|
14
12
|
} from "@alloy-js/core";
|
|
13
|
+
|
|
15
14
|
import { useTSNamePolicy } from "../name-policy.js";
|
|
16
15
|
import {
|
|
17
16
|
createStaticMemberSymbol,
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
import type { Children, ComponentContext, Ref } from "@alloy-js/core";
|
|
1
2
|
import {
|
|
2
|
-
Children,
|
|
3
|
-
ComponentContext,
|
|
4
3
|
createNamedContext,
|
|
5
4
|
createScope,
|
|
6
|
-
Ref,
|
|
7
5
|
Scope,
|
|
8
6
|
shallowRef,
|
|
9
7
|
SourceDirectory,
|
|
@@ -13,11 +11,14 @@ import {
|
|
|
13
11
|
Wrap,
|
|
14
12
|
} from "@alloy-js/core";
|
|
15
13
|
import { join } from "pathe";
|
|
14
|
+
|
|
16
15
|
import { PackageMetadataContext } from "../context/package-metadata.js";
|
|
17
|
-
import { ExternalPackage
|
|
16
|
+
import type { ExternalPackage } from "../create-package.js";
|
|
17
|
+
import { getPackageScope } from "../create-package.js";
|
|
18
18
|
import { TSPackageScope } from "../symbols/index.js";
|
|
19
19
|
import { modulePath } from "../utils.js";
|
|
20
|
-
import {
|
|
20
|
+
import type { PackageJsonFileProps } from "./PackageJson.js";
|
|
21
|
+
import { PackageJsonFile } from "./PackageJson.js";
|
|
21
22
|
import { TSConfigJson } from "./TsConfigJson.js";
|
|
22
23
|
|
|
23
24
|
export interface PackageDirectoryProps extends PackageJsonFileProps {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { memo, SourceFile, useContext } from "@alloy-js/core";
|
|
2
|
+
|
|
2
3
|
import { PackageMetadataContext } from "../context/package-metadata.js";
|
|
3
4
|
import { modulePath } from "../utils.js";
|
|
4
5
|
import { usePackage } from "./PackageDirectory.js";
|
|
@@ -133,9 +134,9 @@ export function PackageJsonFile(props: PackageJsonFileProps) {
|
|
|
133
134
|
}
|
|
134
135
|
|
|
135
136
|
pkgJson.exports =
|
|
136
|
-
exportsEntries.length === 0
|
|
137
|
-
undefined
|
|
138
|
-
|
|
137
|
+
exportsEntries.length === 0
|
|
138
|
+
? undefined
|
|
139
|
+
: Object.fromEntries(exportsEntries);
|
|
139
140
|
}
|
|
140
141
|
|
|
141
142
|
return JSON.stringify(pkgJson, null, 2);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { MemberDeclarationContext, memo, useContext } from "@alloy-js/core";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import type { TSOutputSymbol } from "../symbols/ts-output-symbol.js";
|
|
3
4
|
import { isValidJSIdentifier } from "../utils.js";
|
|
4
5
|
|
|
5
6
|
export interface PropertyNameProps {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Refkey } from "@alloy-js/core";
|
|
2
|
+
import { computed, emitSymbol } from "@alloy-js/core";
|
|
3
|
+
|
|
2
4
|
import { isTypeRefContext } from "../context/type-ref-context.js";
|
|
3
5
|
import { ref } from "../symbols/index.js";
|
|
4
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { ComponentContext } from "@alloy-js/core";
|
|
1
2
|
import {
|
|
2
|
-
ComponentContext,
|
|
3
3
|
SourceFile as CoreSourceFile,
|
|
4
4
|
createNamedContext,
|
|
5
5
|
createScope,
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
useScope,
|
|
11
11
|
type Children,
|
|
12
12
|
} from "@alloy-js/core";
|
|
13
|
-
|
|
14
13
|
import { join } from "pathe";
|
|
14
|
+
|
|
15
15
|
import { getSourceDirectoryData } from "../source-directory-data.js";
|
|
16
16
|
import { TSModuleScope } from "../symbols/index.js";
|
|
17
17
|
import { ImportStatements } from "./ImportStatement.js";
|
|
@@ -65,12 +65,12 @@ export function SourceFile(props: SourceFileProps) {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
const header =
|
|
68
|
-
props.header || props.headerComment ?
|
|
68
|
+
props.header || props.headerComment ? (
|
|
69
69
|
<SourceFileHeader
|
|
70
70
|
header={props.header}
|
|
71
71
|
headerComment={props.headerComment}
|
|
72
72
|
/>
|
|
73
|
-
: undefined;
|
|
73
|
+
) : undefined;
|
|
74
74
|
|
|
75
75
|
return (
|
|
76
76
|
<CoreSourceFile
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Block, Indent, Match, Switch, type Children } from "@alloy-js/core";
|
|
2
|
+
|
|
2
3
|
import { BlockScope } from "./BlockScope.jsx";
|
|
3
4
|
import { ValueExpression } from "./ValueExpression.jsx";
|
|
4
5
|
|
|
@@ -54,12 +55,13 @@ export function CaseClause(props: CaseClauseProps) {
|
|
|
54
55
|
<Match when={"default" in props && props.default}>default</Match>
|
|
55
56
|
<Match else>
|
|
56
57
|
case{" "}
|
|
57
|
-
{"expression" in props ?
|
|
58
|
+
{"expression" in props ? (
|
|
58
59
|
props.expression
|
|
59
|
-
:
|
|
60
|
+
) : (
|
|
61
|
+
<ValueExpression
|
|
60
62
|
jsValue={(props as CaseClausePropsWithValue).jsValue}
|
|
61
63
|
/>
|
|
62
|
-
}
|
|
64
|
+
)}
|
|
63
65
|
</Match>
|
|
64
66
|
</Switch>
|
|
65
67
|
{": "}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { refkey, StatementList } from "@alloy-js/core";
|
|
2
2
|
import { expect, it } from "vitest";
|
|
3
|
+
|
|
3
4
|
import { TestFile } from "../../test/utils.js";
|
|
4
5
|
import { CatchClause, FinallyClause, TryStatement } from "./TryStatement.jsx";
|
|
5
6
|
import { VarDeclaration } from "./VarDeclaration.jsx";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { onCleanup, type Children } from "@alloy-js/core";
|
|
2
|
+
|
|
2
3
|
import { useTSNamePolicy } from "../name-policy.js";
|
|
3
4
|
import type { ParameterDescriptor } from "../parameter-descriptor.js";
|
|
4
5
|
import { createValueSymbol, TSSymbolFlags } from "../symbols/index.js";
|
|
@@ -76,9 +77,9 @@ export function CatchClause(props: CatchClauseProps) {
|
|
|
76
77
|
|
|
77
78
|
const namePolicy = useTSNamePolicy();
|
|
78
79
|
const paramDesc =
|
|
79
|
-
typeof props.parameter === "string"
|
|
80
|
-
{ name: props.parameter }
|
|
81
|
-
|
|
80
|
+
typeof props.parameter === "string"
|
|
81
|
+
? { name: props.parameter }
|
|
82
|
+
: props.parameter;
|
|
82
83
|
|
|
83
84
|
const symbol = createValueSymbol(paramDesc.name, {
|
|
84
85
|
refkeys: paramDesc.refkey,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Name, Show } from "@alloy-js/core";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import type { CommonDeclarationProps } from "./Declaration.js";
|
|
4
|
+
import { Declaration } from "./Declaration.js";
|
|
3
5
|
import { JSDoc } from "./JSDoc.jsx";
|
|
4
6
|
import { ensureTypeRefContext } from "./TypeRefContext.jsx";
|
|
5
7
|
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import type { Children } from "@alloy-js/core";
|
|
1
2
|
import {
|
|
2
|
-
Children,
|
|
3
3
|
Declaration as CoreDeclaration,
|
|
4
4
|
createSymbolSlot,
|
|
5
5
|
Name,
|
|
6
6
|
Show,
|
|
7
7
|
} from "@alloy-js/core";
|
|
8
|
+
|
|
8
9
|
import { useTSNamePolicy } from "../name-policy.js";
|
|
9
10
|
import { createValueSymbol } from "../symbols/index.js";
|
|
10
11
|
import { TSSymbolFlags } from "../symbols/ts-output-symbol.js";
|
|
11
|
-
import { CommonDeclarationProps } from "./Declaration.js";
|
|
12
|
+
import type { CommonDeclarationProps } from "./Declaration.js";
|
|
12
13
|
import { JSDoc } from "./JSDoc.jsx";
|
|
13
14
|
import { TypeRefContext } from "./TypeRefContext.jsx";
|
|
14
15
|
|
|
@@ -38,16 +39,12 @@ export function VarDeclaration(props: VarDeclarationProps) {
|
|
|
38
39
|
ValueTypeSymbolSlot.moveMembersTo(sym);
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
const keyword =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<TypeRefContext>
|
|
48
|
-
: <TypeSymbolSlot>{props.type}</TypeSymbolSlot>
|
|
49
|
-
</TypeRefContext>
|
|
50
|
-
: undefined;
|
|
42
|
+
const keyword = props.var ? "var" : props.let ? "let" : "const";
|
|
43
|
+
const type = props.type ? (
|
|
44
|
+
<TypeRefContext>
|
|
45
|
+
: <TypeSymbolSlot>{props.type}</TypeSymbolSlot>
|
|
46
|
+
</TypeRefContext>
|
|
47
|
+
) : undefined;
|
|
51
48
|
|
|
52
49
|
return (
|
|
53
50
|
<>
|
package/src/components/index.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { ComponentContext
|
|
2
|
-
import {
|
|
1
|
+
import type { ComponentContext } from "@alloy-js/core";
|
|
2
|
+
import { createNamedContext } from "@alloy-js/core";
|
|
3
|
+
|
|
4
|
+
import type { TSPackageScope } from "../symbols/ts-package-scope.js";
|
|
3
5
|
|
|
4
6
|
export interface PackageMetadataContext {
|
|
5
7
|
versionSpecifiers: Map<TSPackageScope, string>;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
createNamedContext,
|
|
4
|
-
useContext,
|
|
5
|
-
} from "@alloy-js/core";
|
|
1
|
+
import type { ComponentContext } from "@alloy-js/core";
|
|
2
|
+
import { createNamedContext, useContext } from "@alloy-js/core";
|
|
6
3
|
|
|
7
4
|
interface TypeRefContext {
|
|
8
5
|
/** If in a type context */
|
package/src/create-package.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import type { OutputMemberSpace, SymbolCreator } from "@alloy-js/core";
|
|
1
2
|
import {
|
|
2
3
|
type Binder,
|
|
3
4
|
createScope,
|
|
4
5
|
createSymbol,
|
|
5
6
|
getSymbolCreatorSymbol,
|
|
6
|
-
OutputMemberSpace,
|
|
7
7
|
type Refkey,
|
|
8
8
|
refkey,
|
|
9
|
-
SymbolCreator,
|
|
10
9
|
} from "@alloy-js/core";
|
|
10
|
+
|
|
11
11
|
import {
|
|
12
12
|
TSModuleScope,
|
|
13
13
|
TSOutputSymbol,
|
|
@@ -101,16 +101,16 @@ export type NamedMap<TDescriptor extends readonly NamedModuleDescriptor[]> =
|
|
|
101
101
|
TDescriptor[number],
|
|
102
102
|
{ name: string }
|
|
103
103
|
> as O["name"]]: Refkey & {
|
|
104
|
-
static: O extends
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
NamedMap<SM>
|
|
108
|
-
|
|
109
|
-
instance: O extends
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
NamedMap<IM>
|
|
113
|
-
|
|
104
|
+
static: O extends {
|
|
105
|
+
staticMembers: infer SM extends NamedModuleDescriptor[];
|
|
106
|
+
}
|
|
107
|
+
? NamedMap<SM>
|
|
108
|
+
: {};
|
|
109
|
+
instance: O extends {
|
|
110
|
+
instanceMembers: infer IM extends NamedModuleDescriptor[];
|
|
111
|
+
}
|
|
112
|
+
? NamedMap<IM>
|
|
113
|
+
: {};
|
|
114
114
|
};
|
|
115
115
|
};
|
|
116
116
|
|
|
@@ -220,9 +220,9 @@ function createSymbols(
|
|
|
220
220
|
|
|
221
221
|
for (const exportedName of symbols.named ?? []) {
|
|
222
222
|
const namedRef =
|
|
223
|
-
typeof exportedName === "string"
|
|
224
|
-
{ name: exportedName }
|
|
225
|
-
|
|
223
|
+
typeof exportedName === "string"
|
|
224
|
+
? { name: exportedName }
|
|
225
|
+
: exportedName;
|
|
226
226
|
const key = keys[namedRef.name];
|
|
227
227
|
const ownerSym = createSymbol(
|
|
228
228
|
TSOutputSymbol,
|
package/src/index.ts
CHANGED
|
@@ -4,6 +4,6 @@ export * from "./context/index.js";
|
|
|
4
4
|
export * from "./create-package.js";
|
|
5
5
|
export * from "./name-conflict-resolver.js";
|
|
6
6
|
export * from "./name-policy.js";
|
|
7
|
-
export * from "./parameter-descriptor.js";
|
|
7
|
+
export type * from "./parameter-descriptor.js";
|
|
8
8
|
export * from "./source-directory-data.js";
|
|
9
9
|
export * from "./symbols/index.js";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { OutputSymbol } from "@alloy-js/core";
|
|
2
|
-
|
|
1
|
+
import type { OutputSymbol } from "@alloy-js/core";
|
|
2
|
+
|
|
3
|
+
import type { TSOutputSymbol } from "./symbols/index.js";
|
|
4
|
+
import { TSSymbolFlags } from "./symbols/index.js";
|
|
3
5
|
|
|
4
6
|
export function tsNameConflictResolver(name: string, symbols: OutputSymbol[]) {
|
|
5
7
|
const goodNamedSymbols = (symbols as TSOutputSymbol[]).filter(
|
package/src/name-policy.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { NamePolicy } from "@alloy-js/core";
|
|
2
|
+
import { createNamePolicy, useNamePolicy } from "@alloy-js/core";
|
|
2
3
|
import { camelCase, pascalCase } from "change-case";
|
|
3
4
|
|
|
4
5
|
export type TypeScriptElements =
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { SourceDirectoryContext } from "@alloy-js/core";
|
|
2
|
+
import { shallowReactive } from "@alloy-js/core";
|
|
3
|
+
|
|
4
|
+
import type { TSModuleScope } from "./symbols/index.js";
|
|
3
5
|
|
|
4
6
|
export interface SourceDirectoryData {
|
|
5
7
|
modules: Set<TSModuleScope>;
|
package/src/symbols/index.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import type { Namekey, OutputScopeOptions } from "@alloy-js/core";
|
|
1
2
|
import {
|
|
2
3
|
createComponent,
|
|
3
4
|
createScope,
|
|
4
5
|
createSymbol,
|
|
5
|
-
Namekey,
|
|
6
6
|
onCleanup,
|
|
7
|
-
OutputScopeOptions,
|
|
8
7
|
toRef,
|
|
9
8
|
} from "@alloy-js/core";
|
|
9
|
+
|
|
10
10
|
import { useLexicalScope, useMemberOwner } from "../utils.js";
|
|
11
11
|
import { useTSScope } from "./scopes.js";
|
|
12
12
|
import { TSLexicalScope } from "./ts-lexical-scope.js";
|
|
13
13
|
import { TSMemberScope } from "./ts-member-scope.js";
|
|
14
|
-
import { CreateTsSymbolOptions
|
|
14
|
+
import type { CreateTsSymbolOptions } from "./ts-output-symbol.js";
|
|
15
|
+
import { TSOutputSymbol } from "./ts-output-symbol.js";
|
|
15
16
|
|
|
16
17
|
export * from "./reference.js";
|
|
17
18
|
export * from "./scopes.js";
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
Children,
|
|
3
3
|
MemberResolutionContext,
|
|
4
4
|
MemberResolver,
|
|
5
|
+
Refkey,
|
|
6
|
+
} from "@alloy-js/core";
|
|
7
|
+
import {
|
|
5
8
|
memo,
|
|
6
9
|
onCleanup,
|
|
7
|
-
Refkey,
|
|
8
10
|
resolve,
|
|
9
11
|
unresolvedRefkey,
|
|
10
12
|
untrack,
|
|
11
13
|
useContext,
|
|
12
14
|
} from "@alloy-js/core";
|
|
15
|
+
|
|
13
16
|
import { MemberExpression } from "../components/MemberExpression.jsx";
|
|
14
17
|
import { usePackage } from "../components/PackageDirectory.jsx";
|
|
15
18
|
import { SourceFileContext } from "../components/SourceFile.jsx";
|
|
16
|
-
import { TSOutputScope } from "./scopes.js";
|
|
19
|
+
import type { TSOutputScope } from "./scopes.js";
|
|
17
20
|
import { TSLexicalScope } from "./ts-lexical-scope.js";
|
|
18
21
|
import { TSModuleScope } from "./ts-module-scope.js";
|
|
19
|
-
import { TSOutputSymbol } from "./ts-output-symbol.js";
|
|
22
|
+
import type { TSOutputSymbol } from "./ts-output-symbol.js";
|
|
20
23
|
import { TSPackageScope } from "./ts-package-scope.js";
|
|
21
24
|
|
|
22
25
|
export interface RefOptions {
|
|
@@ -48,9 +51,11 @@ export function ref(
|
|
|
48
51
|
// * module: target symbol is in a different module
|
|
49
52
|
// * local: target symbol is within the current module
|
|
50
53
|
const targetLocation =
|
|
51
|
-
pathDown[0] instanceof TSPackageScope
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
pathDown[0] instanceof TSPackageScope
|
|
55
|
+
? "package"
|
|
56
|
+
: pathDown[0] instanceof TSModuleScope
|
|
57
|
+
? "module"
|
|
58
|
+
: "local";
|
|
54
59
|
let localSymbol: TSOutputSymbol | undefined;
|
|
55
60
|
|
|
56
61
|
if (targetLocation === "package") {
|
package/src/symbols/scopes.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useScope } from "@alloy-js/core";
|
|
2
|
+
|
|
2
3
|
import { TSLexicalScope } from "./ts-lexical-scope.js";
|
|
3
4
|
import { TSMemberScope } from "./ts-member-scope.js";
|
|
4
|
-
import { TSModuleScope } from "./ts-module-scope.js";
|
|
5
|
-
import { TSPackageScope } from "./ts-package-scope.js";
|
|
5
|
+
import type { TSModuleScope } from "./ts-module-scope.js";
|
|
6
|
+
import type { TSPackageScope } from "./ts-package-scope.js";
|
|
6
7
|
|
|
7
8
|
export type TSOutputScope = TSPackageScope | TSModuleScope | TSLexicalScope;
|
|
8
9
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { OutputScopeOptions } from "@alloy-js/core";
|
|
2
|
-
|
|
1
|
+
import type { OutputScopeOptions } from "@alloy-js/core";
|
|
2
|
+
|
|
3
|
+
import type { TSOutputScope } from "./scopes.js";
|
|
3
4
|
import { TSLexicalScope } from "./ts-lexical-scope.js";
|
|
4
|
-
import { TSOutputSymbol } from "./ts-output-symbol.js";
|
|
5
|
+
import type { TSOutputSymbol } from "./ts-output-symbol.js";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* A member scope for TypeScript. Member declarations create symbols in this
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Refkey,
|
|
5
|
-
shallowReactive,
|
|
6
|
-
} from "@alloy-js/core";
|
|
1
|
+
import type { Refkey } from "@alloy-js/core";
|
|
2
|
+
import { createSymbol, reactive, shallowReactive } from "@alloy-js/core";
|
|
3
|
+
|
|
7
4
|
import { TSLexicalScope } from "./ts-lexical-scope.js";
|
|
8
5
|
import { TSOutputSymbol, TSSymbolFlags } from "./ts-output-symbol.js";
|
|
9
6
|
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
+
import type { Namekey, OutputSpace, OutputSymbolOptions } from "@alloy-js/core";
|
|
1
2
|
import {
|
|
2
3
|
createSymbol,
|
|
3
|
-
Namekey,
|
|
4
|
-
OutputSpace,
|
|
5
4
|
OutputSymbol,
|
|
6
|
-
OutputSymbolOptions,
|
|
7
5
|
track,
|
|
8
6
|
TrackOpTypes,
|
|
9
7
|
trigger,
|
|
10
8
|
TriggerOpTypes,
|
|
11
9
|
watch,
|
|
12
10
|
} from "@alloy-js/core";
|
|
13
|
-
|
|
11
|
+
|
|
12
|
+
import type { TSOutputScope } from "./scopes.js";
|
|
14
13
|
import { TSModuleScope } from "./ts-module-scope.js";
|
|
15
14
|
|
|
16
15
|
// prettier-ignore
|