@alloy-js/typescript 0.23.0-dev.2 → 0.23.0-dev.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/src/components/FunctionType.d.ts +1 -1
  2. package/dist/src/components/FunctionType.js +1 -1
  3. package/dist/src/components/FunctionType.js.map +1 -1
  4. package/dist/src/components/Interface.d.ts +1 -1
  5. package/dist/src/components/Interface.d.ts.map +1 -1
  6. package/dist/src/components/Interface.js +14 -9
  7. package/dist/src/components/Interface.js.map +1 -1
  8. package/dist/src/components/MemberExpression.d.ts +1 -1
  9. package/dist/src/components/MemberExpression.d.ts.map +1 -1
  10. package/dist/src/components/MemberExpression.js +115 -330
  11. package/dist/src/components/MemberExpression.js.map +1 -1
  12. package/dist/src/components/MemberScope.d.ts.map +1 -1
  13. package/dist/src/components/MemberScope.js +6 -2
  14. package/dist/src/components/MemberScope.js.map +1 -1
  15. package/dist/src/components/PackageDirectory.d.ts.map +1 -1
  16. package/dist/src/components/PackageDirectory.js +2 -2
  17. package/dist/src/components/PackageDirectory.js.map +1 -1
  18. package/dist/src/components/SourceFile.d.ts.map +1 -1
  19. package/dist/src/components/SourceFile.js +4 -2
  20. package/dist/src/components/SourceFile.js.map +1 -1
  21. package/dist/src/components/TypeDeclaration.d.ts +1 -1
  22. package/dist/src/components/TypeDeclaration.d.ts.map +1 -1
  23. package/dist/src/components/TypeDeclaration.js +1 -1
  24. package/dist/src/components/TypeDeclaration.js.map +1 -1
  25. package/dist/src/components/TypeRefContext.d.ts +1 -1
  26. package/dist/src/components/TypeRefContext.d.ts.map +1 -1
  27. package/dist/src/components/TypeRefContext.js +1 -1
  28. package/dist/src/components/TypeRefContext.js.map +1 -1
  29. package/dist/src/context/type-ref-context.d.ts.map +1 -1
  30. package/dist/src/context/type-ref-context.js +2 -2
  31. package/dist/src/context/type-ref-context.js.map +1 -1
  32. package/dist/src/create-package.d.ts.map +1 -1
  33. package/dist/src/create-package.js +7 -6
  34. package/dist/src/create-package.js.map +1 -1
  35. package/dist/src/symbols/index.d.ts.map +1 -1
  36. package/dist/src/symbols/index.js +47 -11
  37. package/dist/src/symbols/index.js.map +1 -1
  38. package/dist/src/symbols/ts-module-scope.d.ts +1 -0
  39. package/dist/src/symbols/ts-module-scope.d.ts.map +1 -1
  40. package/dist/src/symbols/ts-module-scope.js +14 -3
  41. package/dist/src/symbols/ts-module-scope.js.map +1 -1
  42. package/dist/src/symbols/ts-output-symbol.d.ts +1 -0
  43. package/dist/src/symbols/ts-output-symbol.d.ts.map +1 -1
  44. package/dist/src/symbols/ts-output-symbol.js +20 -3
  45. package/dist/src/symbols/ts-output-symbol.js.map +1 -1
  46. package/dist/src/symbols/ts-package-scope.d.ts +1 -0
  47. package/dist/src/symbols/ts-package-scope.d.ts.map +1 -1
  48. package/dist/src/symbols/ts-package-scope.js +8 -0
  49. package/dist/src/symbols/ts-package-scope.js.map +1 -1
  50. package/dist/tsconfig.tsbuildinfo +1 -1
  51. package/package.json +9 -5
  52. package/src/components/FunctionType.tsx +1 -1
  53. package/src/components/Interface.tsx +24 -13
  54. package/src/components/MemberExpression.tsx +194 -454
  55. package/src/components/MemberScope.tsx +13 -3
  56. package/src/components/PackageDirectory.tsx +2 -1
  57. package/src/components/SourceFile.tsx +4 -1
  58. package/src/components/TypeDeclaration.tsx +15 -15
  59. package/src/components/TypeRefContext.tsx +2 -2
  60. package/src/context/type-ref-context.tsx +6 -2
  61. package/src/create-package.ts +29 -15
  62. package/src/symbols/index.ts +36 -10
  63. package/src/symbols/ts-module-scope.ts +36 -9
  64. package/src/symbols/ts-output-symbol.ts +21 -2
  65. package/src/symbols/ts-package-scope.ts +9 -0
  66. package/temp/api.json +162 -65
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "@alloy-js/typescript",
3
- "version": "0.23.0-dev.2",
3
+ "version": "0.23.0-dev.5",
4
4
  "description": "",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/alloy-framework/alloy.git"
8
+ },
5
9
  "exports": {
6
10
  ".": {
7
11
  "import": "./dist/src/index.js"
@@ -22,18 +26,18 @@
22
26
  "author": "brian.terlson@microsoft.com",
23
27
  "license": "MIT",
24
28
  "dependencies": {
25
- "@alloy-js/core": "~0.22.0 || >= 0.23.0-dev.0",
29
+ "@alloy-js/core": "~0.22.0 || >= 0.23.0-dev.10",
26
30
  "change-case": "^5.4.4",
27
31
  "pathe": "^2.0.3"
28
32
  },
29
33
  "devDependencies": {
30
- "@alloy-js/cli": "~0.22.0 || >= 0.23.0-dev.0",
31
- "@alloy-js/rollup-plugin": "~0.1.0 || >= 0.1.1-dev.0",
34
+ "@alloy-js/cli": "~0.22.0 || >= 0.23.0-dev.3",
35
+ "@alloy-js/rollup-plugin": "~0.1.0 || >= 0.1.1-dev.1",
32
36
  "@microsoft/api-extractor": "~7.52.8",
33
37
  "@rollup/plugin-typescript": "^12.1.2",
34
38
  "concurrently": "^9.2.0",
35
39
  "typescript": "^5.8.3",
36
- "vitest": "^3.2.4"
40
+ "vitest": "3.2.4"
37
41
  },
38
42
  "type": "module",
39
43
  "scripts": {
@@ -31,7 +31,7 @@ export interface FunctionTypeProps extends CallSignatureProps {
31
31
  }
32
32
 
33
33
  const FunctionTypeComponent = ensureTypeRefContext(
34
- (props: FunctionTypeProps) => {
34
+ function FunctionTypeComponent(props: FunctionTypeProps) {
35
35
  const children = childrenArray(() => props.children);
36
36
  const typeParametersChildren =
37
37
  findKeyedChild(children, TypeParameters.tag) ?? undefined;
@@ -2,6 +2,7 @@ import {
2
2
  Block,
3
3
  Children,
4
4
  childrenArray,
5
+ createSymbol,
5
6
  createSymbolSlot,
6
7
  effect,
7
8
  emitSymbol,
@@ -35,7 +36,7 @@ export interface InterfaceDeclarationProps extends CommonDeclarationProps {
35
36
  }
36
37
 
37
38
  const _InterfaceDeclaration = ensureTypeRefContext(
38
- (props: InterfaceDeclarationProps) => {
39
+ function InterfaceDeclaration(props: InterfaceDeclarationProps) {
39
40
  const ExprSlot = createSymbolSlot();
40
41
 
41
42
  effect(() => {
@@ -68,13 +69,15 @@ const _InterfaceDeclaration = ensureTypeRefContext(
68
69
  const filteredChildren = findUnkeyedChildren(children);
69
70
  const currentScope = useTSLexicalScope();
70
71
 
71
- const sym = new TSOutputSymbol(props.name, currentScope.types, {
72
+ const binder = currentScope?.binder;
73
+ const sym = createSymbol(TSOutputSymbol, props.name, currentScope.types, {
72
74
  refkeys: props.refkey,
73
75
  default: props.default,
74
76
  export: props.export,
75
77
  metadata: props.metadata,
76
78
  tsFlags: TSSymbolFlags.TypeSymbol,
77
79
  namePolicy: useTSNamePolicy().for("interface"),
80
+ binder,
78
81
  });
79
82
  return (
80
83
  <>
@@ -115,9 +118,11 @@ export interface InterfaceExpressionProps {
115
118
  }
116
119
 
117
120
  export const InterfaceExpression = ensureTypeRefContext(
118
- (props: InterfaceExpressionProps) => {
119
- const symbol = new TSOutputSymbol("", undefined, {
121
+ function InterfaceExpression(props: InterfaceExpressionProps) {
122
+ const scope = useTSLexicalScope();
123
+ const symbol = createSymbol(TSOutputSymbol, "", undefined, {
120
124
  transient: true,
125
+ binder: scope?.binder,
121
126
  });
122
127
 
123
128
  emitSymbol(symbol);
@@ -180,15 +185,21 @@ export function InterfaceMember(props: InterfaceMemberProps) {
180
185
 
181
186
  const optionality = props.optional ? "?" : "";
182
187
  const scope = useTSMemberScope();
183
- const sym = new TSOutputSymbol(props.name, scope.ownerSymbol.staticMembers, {
184
- refkeys: props.refkey,
185
- tsFlags:
186
- TSSymbolFlags.TypeSymbol |
187
- ((props.nullish ?? props.optional) ?
188
- TSSymbolFlags.Nullish
189
- : TSSymbolFlags.None),
190
- namePolicy: useTSNamePolicy().for("interface-member"),
191
- });
188
+ const sym = createSymbol(
189
+ TSOutputSymbol,
190
+ props.name,
191
+ scope.ownerSymbol.staticMembers,
192
+ {
193
+ refkeys: props.refkey,
194
+ tsFlags:
195
+ TSSymbolFlags.TypeSymbol |
196
+ ((props.nullish ?? props.optional) ?
197
+ TSSymbolFlags.Nullish
198
+ : TSSymbolFlags.None),
199
+ namePolicy: useTSNamePolicy().for("interface-member"),
200
+ binder: scope.binder,
201
+ },
202
+ );
192
203
 
193
204
  const taken = takeSymbols();
194
205