@alloy-js/typescript 0.17.0 → 0.18.0-dev.3

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 (100) hide show
  1. package/dist/src/builtins/node.d.ts +4 -3
  2. package/dist/src/builtins/node.d.ts.map +1 -1
  3. package/dist/src/builtins/node.js +3 -0
  4. package/dist/src/components/ArrowFunction.d.ts +4 -4
  5. package/dist/src/components/ArrowFunction.d.ts.map +1 -1
  6. package/dist/src/components/BarrelFile.d.ts +1 -1
  7. package/dist/src/components/BarrelFile.d.ts.map +1 -1
  8. package/dist/src/components/BlockScope.d.ts +1 -1
  9. package/dist/src/components/BlockScope.d.ts.map +1 -1
  10. package/dist/src/components/CallSignature.d.ts +1 -1
  11. package/dist/src/components/CallSignature.d.ts.map +1 -1
  12. package/dist/src/components/EnumDeclaration.d.ts +1 -1
  13. package/dist/src/components/EnumDeclaration.d.ts.map +1 -1
  14. package/dist/src/components/ExportStatement.d.ts +1 -1
  15. package/dist/src/components/ExportStatement.d.ts.map +1 -1
  16. package/dist/src/components/FunctionBase.d.ts +5 -5
  17. package/dist/src/components/FunctionBase.d.ts.map +1 -1
  18. package/dist/src/components/FunctionDeclaration.d.ts +4 -4
  19. package/dist/src/components/FunctionDeclaration.d.ts.map +1 -1
  20. package/dist/src/components/FunctionExpression.d.ts +4 -4
  21. package/dist/src/components/FunctionExpression.d.ts.map +1 -1
  22. package/dist/src/components/FunctionType.d.ts +3 -3
  23. package/dist/src/components/FunctionType.d.ts.map +1 -1
  24. package/dist/src/components/IfStatement.d.ts +1 -1
  25. package/dist/src/components/IfStatement.d.ts.map +1 -1
  26. package/dist/src/components/ImportStatement.d.ts +1 -1
  27. package/dist/src/components/ImportStatement.d.ts.map +1 -1
  28. package/dist/src/components/InterfaceMethod.d.ts +3 -4
  29. package/dist/src/components/InterfaceMethod.d.ts.map +1 -1
  30. package/dist/src/components/JSDoc.d.ts +1 -1
  31. package/dist/src/components/JSDoc.d.ts.map +1 -1
  32. package/dist/src/components/JSDocComment.d.ts +1 -1
  33. package/dist/src/components/JSDocComment.d.ts.map +1 -1
  34. package/dist/src/components/JSDocExample.d.ts +1 -1
  35. package/dist/src/components/JSDocExample.d.ts.map +1 -1
  36. package/dist/src/components/JSDocParam.d.ts +1 -1
  37. package/dist/src/components/JSDocParam.d.ts.map +1 -1
  38. package/dist/src/components/MemberDeclaration.d.ts +1 -1
  39. package/dist/src/components/MemberDeclaration.d.ts.map +1 -1
  40. package/dist/src/components/NewExpression.d.ts +1 -1
  41. package/dist/src/components/NewExpression.d.ts.map +1 -1
  42. package/dist/src/components/ObjectExpression.js +4 -4
  43. package/dist/src/components/PackageJson.d.ts +1 -1
  44. package/dist/src/components/PackageJson.d.ts.map +1 -1
  45. package/dist/src/components/PropertyName.d.ts +1 -1
  46. package/dist/src/components/PropertyName.d.ts.map +1 -1
  47. package/dist/src/components/Reference.d.ts +1 -1
  48. package/dist/src/components/Reference.d.ts.map +1 -1
  49. package/dist/src/components/SingleLineCommentBlock.d.ts +1 -1
  50. package/dist/src/components/SingleLineCommentBlock.d.ts.map +1 -1
  51. package/dist/src/components/SourceFile.d.ts +1 -2
  52. package/dist/src/components/SourceFile.d.ts.map +1 -1
  53. package/dist/src/components/SwitchStatement.d.ts +1 -1
  54. package/dist/src/components/SwitchStatement.d.ts.map +1 -1
  55. package/dist/src/components/TsConfigJson.d.ts +1 -1
  56. package/dist/src/components/TsConfigJson.d.ts.map +1 -1
  57. package/dist/src/components/TypeDeclaration.d.ts +1 -1
  58. package/dist/src/components/TypeDeclaration.d.ts.map +1 -1
  59. package/dist/src/components/TypeRefContext.d.ts +1 -1
  60. package/dist/src/components/TypeRefContext.d.ts.map +1 -1
  61. package/dist/src/create-package.d.ts +1 -1
  62. package/dist/src/create-package.d.ts.map +1 -1
  63. package/dist/src/index.d.ts +2 -0
  64. package/dist/src/index.d.ts.map +1 -1
  65. package/dist/src/index.js +2 -0
  66. package/dist/src/parameter-descriptor.d.ts +1 -1
  67. package/dist/src/parameter-descriptor.d.ts.map +1 -1
  68. package/dist/src/utils.js +1 -1
  69. package/dist/test/values.test.d.ts.map +1 -1
  70. package/dist/test/values.test.js +48 -1
  71. package/dist/tsconfig.tsbuildinfo +1 -1
  72. package/package.json +22 -21
  73. package/src/builtins/node.ts +4 -0
  74. package/src/components/ArrowFunction.tsx +1 -1
  75. package/src/components/CallSignature.tsx +1 -1
  76. package/src/components/FunctionBase.tsx +1 -1
  77. package/src/components/FunctionDeclaration.tsx +1 -1
  78. package/src/components/FunctionExpression.tsx +1 -1
  79. package/src/components/FunctionType.tsx +1 -1
  80. package/src/components/IfStatement.tsx +1 -2
  81. package/src/components/InterfaceMethod.tsx +1 -1
  82. package/src/components/JSDoc.tsx +1 -2
  83. package/src/components/JSDocComment.tsx +1 -1
  84. package/src/components/JSDocExample.tsx +1 -2
  85. package/src/components/JSDocParam.tsx +1 -2
  86. package/src/components/ObjectExpression.tsx +4 -4
  87. package/src/components/SingleLineCommentBlock.tsx +1 -2
  88. package/src/components/SourceFile.tsx +1 -1
  89. package/src/components/SwitchStatement.tsx +1 -2
  90. package/src/components/TypeRefContext.tsx +1 -1
  91. package/src/create-package.ts +2 -2
  92. package/src/index.ts +2 -0
  93. package/src/parameter-descriptor.ts +1 -1
  94. package/src/utils.ts +1 -1
  95. package/temp/api.json +145 -39
  96. package/test/values.test.tsx +33 -0
  97. package/tsconfig.json +2 -1
  98. package/LICENSE +0 -7
  99. package/dist/test/vitest.d.js +0 -1
  100. package/test/vitest.d.ts +0 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alloy-js/typescript",
3
- "version": "0.17.0",
3
+ "version": "0.18.0-dev.3",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": {
@@ -10,30 +10,31 @@
10
10
  "import": "./dist/src/components/stc/index.js"
11
11
  }
12
12
  },
13
+ "scripts": {
14
+ "generate-docs": "api-extractor run",
15
+ "build": "alloy build && pnpm run generate-docs",
16
+ "clean": "rimraf dist/ .temp/",
17
+ "test:watch": "vitest -w",
18
+ "watch": "alloy build --watch",
19
+ "test": "vitest run",
20
+ "prepack": "node ../../scripts/strip-dev-exports.js"
21
+ },
13
22
  "keywords": [],
14
23
  "author": "brian.terlson@microsoft.com",
15
24
  "license": "MIT",
16
25
  "dependencies": {
17
- "change-case": "^5.4.4",
18
- "pathe": "^2.0.3",
19
- "@alloy-js/core": "~0.17.0"
26
+ "@alloy-js/core": "~0.17.0 || >= 0.18.0-dev.2",
27
+ "change-case": "catalog:",
28
+ "pathe": "catalog:"
20
29
  },
21
30
  "devDependencies": {
22
- "@microsoft/api-extractor": "~7.52.8",
23
- "@rollup/plugin-typescript": "^12.1.2",
24
- "concurrently": "^9.1.2",
25
- "typescript": "^5.8.3",
26
- "vitest": "^3.1.1",
27
- "@alloy-js/cli": "~0.17.0",
28
- "@alloy-js/rollup-plugin": "~0.1.0"
31
+ "@alloy-js/cli": "~0.17.0 || >= 0.18.0-dev.0",
32
+ "@alloy-js/rollup-plugin": "~0.1.0 || >= 0.1.1-dev.0",
33
+ "@microsoft/api-extractor": "catalog:",
34
+ "@rollup/plugin-typescript": "catalog:",
35
+ "concurrently": "catalog:",
36
+ "typescript": "catalog:",
37
+ "vitest": "catalog:"
29
38
  },
30
- "type": "module",
31
- "scripts": {
32
- "generate-docs": "api-extractor run",
33
- "build": "alloy build && pnpm run generate-docs",
34
- "clean": "rimraf dist/ .temp/",
35
- "test:watch": "vitest -w",
36
- "watch": "alloy build --watch",
37
- "test": "vitest run"
38
- }
39
- }
39
+ "type": "module"
40
+ }
@@ -1,5 +1,9 @@
1
+ import { SymbolCreator } from "@alloy-js/core";
1
2
  import { createPackage } from "../create-package.js";
2
3
 
4
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
5
+ type dummy = SymbolCreator;
6
+
3
7
  export const path = createPackage({
4
8
  name: "node:path",
5
9
  version: "22.5.1",
@@ -3,8 +3,8 @@ import {
3
3
  findKeyedChild,
4
4
  findUnkeyedChildren,
5
5
  Scope,
6
+ type Children,
6
7
  } from "@alloy-js/core";
7
- import { Children } from "@alloy-js/core/jsx-runtime";
8
8
  import { getCallSignatureProps } from "../utils.js";
9
9
  import { CallSignature, CallSignatureProps } from "./CallSignature.jsx";
10
10
  import { Declaration } from "./Declaration.jsx";
@@ -1,4 +1,4 @@
1
- import { Children } from "@alloy-js/core/jsx-runtime";
1
+ import { type Children } from "@alloy-js/core";
2
2
  import {
3
3
  ParameterDescriptor,
4
4
  TypeParameterDescriptor,
@@ -7,8 +7,8 @@ import {
7
7
  onCleanup,
8
8
  Show,
9
9
  taggedComponent,
10
+ type Children,
10
11
  } from "@alloy-js/core";
11
- import type { Children } from "@alloy-js/core/jsx-runtime";
12
12
  import { useTSNamePolicy } from "../name-policy.js";
13
13
  import type {
14
14
  FunctionTypeParameterDescriptor,
@@ -6,8 +6,8 @@ import {
6
6
  Prose,
7
7
  Scope,
8
8
  Show,
9
+ type Children,
9
10
  } from "@alloy-js/core";
10
- import { Children } from "@alloy-js/core/jsx-runtime";
11
11
  import { getCallSignatureProps } from "../utils.js";
12
12
  import { CallSignature, CallSignatureProps } from "./CallSignature.jsx";
13
13
  import { BaseDeclarationProps, Declaration } from "./Declaration.js";
@@ -3,8 +3,8 @@ import {
3
3
  findKeyedChild,
4
4
  findUnkeyedChildren,
5
5
  Scope,
6
+ type Children,
6
7
  } from "@alloy-js/core";
7
- import { Children } from "@alloy-js/core/jsx-runtime";
8
8
  import { getCallSignatureProps } from "../utils.js";
9
9
  import { CallSignature, CallSignatureProps } from "./CallSignature.jsx";
10
10
  import { Declaration } from "./Declaration.jsx";
@@ -4,8 +4,8 @@ import {
4
4
  Prose,
5
5
  Scope,
6
6
  Show,
7
+ type Children,
7
8
  } from "@alloy-js/core";
8
- import { Children } from "@alloy-js/core/jsx-runtime";
9
9
  import { getCallSignatureProps } from "../utils.js";
10
10
  import { CallSignature, CallSignatureProps } from "./CallSignature.jsx";
11
11
  import {
@@ -1,5 +1,4 @@
1
- import { Block } from "@alloy-js/core";
2
- import { Children } from "@alloy-js/core/jsx-runtime";
1
+ import { Block, type Children } from "@alloy-js/core";
3
2
 
4
3
  export interface IfStatementProps {
5
4
  condition: Children;
@@ -6,8 +6,8 @@ import {
6
6
  Refkey,
7
7
  Scope,
8
8
  Show,
9
+ type Children,
9
10
  } from "@alloy-js/core";
10
- import { Children } from "@alloy-js/core/jsx-runtime";
11
11
  import { useTSNamePolicy } from "../name-policy.js";
12
12
  import { getCallSignatureProps } from "../utils.js";
13
13
  import { CallSignature, CallSignatureProps } from "./CallSignature.jsx";
@@ -1,5 +1,4 @@
1
- import { List, childrenArray } from "@alloy-js/core";
2
- import { Children } from "@alloy-js/core/jsx-runtime";
1
+ import { List, childrenArray, type Children } from "@alloy-js/core";
3
2
  import { JSDocComment } from "./JSDocComment.jsx";
4
3
 
5
4
  export interface JSDocProps {
@@ -1,4 +1,4 @@
1
- import { Children } from "@alloy-js/core/jsx-runtime";
1
+ import { type Children } from "@alloy-js/core";
2
2
 
3
3
  export interface JSDocCommentProps {
4
4
  children: Children;
@@ -1,5 +1,4 @@
1
- import { Show } from "@alloy-js/core";
2
- import { Children } from "@alloy-js/core/jsx-runtime";
1
+ import { Show, type Children } from "@alloy-js/core";
3
2
 
4
3
  export interface JSDocExampleProps {
5
4
  fenced?: boolean;
@@ -1,5 +1,4 @@
1
- import { For, Prose, Show } from "@alloy-js/core";
2
- import { Children } from "@alloy-js/core/jsx-runtime";
1
+ import { For, Prose, Show, type Children } from "@alloy-js/core";
3
2
  import { ParameterDescriptor } from "../parameter-descriptor.js";
4
3
 
5
4
  export interface JSDocParamsProps {
@@ -95,11 +95,11 @@ export interface ObjectPropertyProps {
95
95
 
96
96
  export function ObjectProperty(props: ObjectPropertyProps) {
97
97
  let name;
98
+ let symbolName = props.name;
98
99
  if (props.name) {
99
100
  const namer = useTSNamePolicy();
100
- name = (
101
- <PropertyName name={namer.getName(props.name, "object-member-data")} />
102
- );
101
+ symbolName = namer.getName(props.name, "object-member-data");
102
+ name = <PropertyName name={symbolName} />;
103
103
  } else if (props.nameExpression) {
104
104
  name = <>[{props.nameExpression}]</>;
105
105
  } else {
@@ -108,7 +108,7 @@ export function ObjectProperty(props: ObjectPropertyProps) {
108
108
 
109
109
  let sym = undefined;
110
110
  if (props.refkey && props.name) {
111
- sym = new TSOutputSymbol(props.name, {
111
+ sym = new TSOutputSymbol(symbolName!, {
112
112
  refkeys: props.refkey,
113
113
  flags: OutputSymbolFlags.StaticMember,
114
114
  });
@@ -1,5 +1,4 @@
1
- import { Prose } from "@alloy-js/core";
2
- import { Children } from "@alloy-js/core/jsx-runtime";
1
+ import { Prose, type Children } from "@alloy-js/core";
3
2
 
4
3
  export interface SingleLineCommentBlockProps {
5
4
  children: Children;
@@ -6,9 +6,9 @@ import {
6
6
  Show,
7
7
  SourceDirectoryContext,
8
8
  useContext,
9
+ type Children,
9
10
  } from "@alloy-js/core";
10
11
 
11
- import { Children } from "@alloy-js/core/jsx-runtime";
12
12
  import { join } from "pathe";
13
13
  import { getSourceDirectoryData } from "../source-directory-data.js";
14
14
  import { TSModuleScope } from "../symbols/index.js";
@@ -1,5 +1,4 @@
1
- import { Block, Indent, Match, Switch } from "@alloy-js/core";
2
- import { Children } from "@alloy-js/core/jsx-runtime";
1
+ import { Block, Indent, Match, Switch, type Children } from "@alloy-js/core";
3
2
  import { BlockScope } from "./BlockScope.jsx";
4
3
  import { ValueExpression } from "./ValueExpression.jsx";
5
4
 
@@ -1,4 +1,4 @@
1
- import type { Children } from "@alloy-js/core/jsx-runtime";
1
+ import type { Children } from "@alloy-js/core";
2
2
  import {
3
3
  isTypeRefContext,
4
4
  TypeRefContext as TypeRefContextDef,
@@ -1,8 +1,8 @@
1
1
  import {
2
- Binder,
2
+ type Binder,
3
3
  getSymbolCreatorSymbol,
4
4
  OutputSymbolFlags,
5
- Refkey,
5
+ type Refkey,
6
6
  refkey,
7
7
  SymbolCreator,
8
8
  } from "@alloy-js/core";
package/src/index.ts CHANGED
@@ -4,4 +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";
8
+ export * from "./source-directory-data.js";
7
9
  export * from "./symbols/index.js";
@@ -1,4 +1,4 @@
1
- import { Children, Refkey } from "@alloy-js/core";
1
+ import type { Children, Refkey } from "@alloy-js/core";
2
2
 
3
3
  /**
4
4
  * Common properties for ParameterDescriptor and FunctionTypeParameterDescriptor.
package/src/utils.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { defaultProps, splitProps } from "@alloy-js/core/jsx-runtime";
1
+ import { defaultProps, splitProps } from "@alloy-js/core";
2
2
  import { CallSignatureProps } from "./components/CallSignature.jsx";
3
3
 
4
4
  export function modulePath(path: string) {