@alloy-js/java 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.
Files changed (279) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/dev/src/builtins/index.js.map +1 -1
  3. package/dist/dev/src/builtins/util.js.map +1 -1
  4. package/dist/dev/src/components/Annotation.js +4 -4
  5. package/dist/dev/src/components/Annotation.js.map +1 -1
  6. package/dist/dev/src/components/ArgumentList.js +3 -3
  7. package/dist/dev/src/components/ArgumentList.js.map +1 -1
  8. package/dist/dev/src/components/Class.js +10 -10
  9. package/dist/dev/src/components/Class.js.map +1 -1
  10. package/dist/dev/src/components/Constructor.js +5 -5
  11. package/dist/dev/src/components/Constructor.js.map +1 -1
  12. package/dist/dev/src/components/Declaration.js +1 -1
  13. package/dist/dev/src/components/Declaration.js.map +1 -1
  14. package/dist/dev/src/components/Enum.js +9 -9
  15. package/dist/dev/src/components/Enum.js.map +1 -1
  16. package/dist/dev/src/components/ExtendsClause.js +4 -4
  17. package/dist/dev/src/components/ExtendsClause.js.map +1 -1
  18. package/dist/dev/src/components/ImplementsClause.js +4 -4
  19. package/dist/dev/src/components/ImplementsClause.js.map +1 -1
  20. package/dist/dev/src/components/ImportStatement.js.map +1 -1
  21. package/dist/dev/src/components/Interface.js +8 -8
  22. package/dist/dev/src/components/Interface.js.map +1 -1
  23. package/dist/dev/src/components/LexicalScope.js +1 -1
  24. package/dist/dev/src/components/LexicalScope.js.map +1 -1
  25. package/dist/dev/src/components/MavenProject.js +24 -24
  26. package/dist/dev/src/components/MavenProject.js.map +1 -1
  27. package/dist/dev/src/components/Method.js +4 -4
  28. package/dist/dev/src/components/Method.js.map +1 -1
  29. package/dist/dev/src/components/Modifiers.js.map +1 -1
  30. package/dist/dev/src/components/Name.js.map +1 -1
  31. package/dist/dev/src/components/NamedArgumentList.js.map +1 -1
  32. package/dist/dev/src/components/ObjectDeclaration.js +2 -2
  33. package/dist/dev/src/components/ObjectDeclaration.js.map +1 -1
  34. package/dist/dev/src/components/PackageDirectory.js +5 -5
  35. package/dist/dev/src/components/PackageDirectory.js.map +1 -1
  36. package/dist/dev/src/components/Parameters.js.map +1 -1
  37. package/dist/dev/src/components/ProjectDirectory.js +1 -1
  38. package/dist/dev/src/components/ProjectDirectory.js.map +1 -1
  39. package/dist/dev/src/components/Reference.js.map +1 -1
  40. package/dist/dev/src/components/SourceFile.js +9 -9
  41. package/dist/dev/src/components/SourceFile.js.map +1 -1
  42. package/dist/dev/src/components/TypeArguments.js +11 -11
  43. package/dist/dev/src/components/TypeArguments.js.map +1 -1
  44. package/dist/dev/src/components/TypeParameters.js +5 -5
  45. package/dist/dev/src/components/TypeParameters.js.map +1 -1
  46. package/dist/dev/src/components/Value.js.map +1 -1
  47. package/dist/dev/src/components/Variable.js +1 -1
  48. package/dist/dev/src/components/Variable.js.map +1 -1
  49. package/dist/dev/src/components/index.js.map +1 -1
  50. package/dist/dev/src/components/stc/index.js.map +1 -1
  51. package/dist/dev/src/create-library.js.map +1 -1
  52. package/dist/dev/src/index.js.map +1 -1
  53. package/dist/dev/src/name-policy.js.map +1 -1
  54. package/dist/dev/src/symbols/index.js +0 -1
  55. package/dist/dev/src/symbols/index.js.map +1 -1
  56. package/dist/dev/src/symbols/java-lexical-scope.js.map +1 -1
  57. package/dist/dev/src/symbols/java-output-symbol.js.map +1 -1
  58. package/dist/dev/src/symbols/java-package-scope.js.map +1 -1
  59. package/dist/dev/src/symbols/java-project-scope.js.map +1 -1
  60. package/dist/dev/src/symbols/reference.js.map +1 -1
  61. package/dist/dev/src/symbols/scopes.js.map +1 -1
  62. package/dist/dev/src/utils.js.map +1 -1
  63. package/dist/dev/test/annotation.test.js +13 -13
  64. package/dist/dev/test/annotation.test.js.map +1 -1
  65. package/dist/dev/test/class.test.js +29 -29
  66. package/dist/dev/test/class.test.js.map +1 -1
  67. package/dist/dev/test/constructor.test.js +16 -16
  68. package/dist/dev/test/constructor.test.js.map +1 -1
  69. package/dist/dev/test/enum.test.js +28 -28
  70. package/dist/dev/test/enum.test.js.map +1 -1
  71. package/dist/dev/test/externals.test.js +6 -6
  72. package/dist/dev/test/externals.test.js.map +1 -1
  73. package/dist/dev/test/interface.test.js +22 -22
  74. package/dist/dev/test/interface.test.js.map +1 -1
  75. package/dist/dev/test/maven.test.js +4 -4
  76. package/dist/dev/test/maven.test.js.map +1 -1
  77. package/dist/dev/test/method.test.js +40 -40
  78. package/dist/dev/test/method.test.js.map +1 -1
  79. package/dist/dev/test/package.test.js +4 -4
  80. package/dist/dev/test/package.test.js.map +1 -1
  81. package/dist/dev/test/reference.test.js +21 -21
  82. package/dist/dev/test/reference.test.js.map +1 -1
  83. package/dist/dev/test/type-arguments.test.js +21 -21
  84. package/dist/dev/test/type-arguments.test.js.map +1 -1
  85. package/dist/dev/test/utils.js +3 -3
  86. package/dist/dev/test/utils.js.map +1 -1
  87. package/dist/dev/test/values.test.js +5 -5
  88. package/dist/dev/test/values.test.js.map +1 -1
  89. package/dist/dev/test/variables.test.js +32 -32
  90. package/dist/dev/test/variables.test.js.map +1 -1
  91. package/dist/dev/test/vitest.setup.js.map +1 -1
  92. package/dist/src/builtins/index.js.map +1 -1
  93. package/dist/src/builtins/util.d.ts.map +1 -1
  94. package/dist/src/builtins/util.js.map +1 -1
  95. package/dist/src/components/Annotation.d.ts +1 -1
  96. package/dist/src/components/Annotation.d.ts.map +1 -1
  97. package/dist/src/components/Annotation.js.map +1 -1
  98. package/dist/src/components/ArgumentList.d.ts +1 -1
  99. package/dist/src/components/ArgumentList.d.ts.map +1 -1
  100. package/dist/src/components/ArgumentList.js.map +1 -1
  101. package/dist/src/components/Class.d.ts +4 -4
  102. package/dist/src/components/Class.d.ts.map +1 -1
  103. package/dist/src/components/Class.js.map +1 -1
  104. package/dist/src/components/Constructor.d.ts +2 -2
  105. package/dist/src/components/Constructor.d.ts.map +1 -1
  106. package/dist/src/components/Constructor.js.map +1 -1
  107. package/dist/src/components/Declaration.d.ts +2 -2
  108. package/dist/src/components/Declaration.d.ts.map +1 -1
  109. package/dist/src/components/Declaration.js.map +1 -1
  110. package/dist/src/components/Enum.d.ts +3 -3
  111. package/dist/src/components/Enum.d.ts.map +1 -1
  112. package/dist/src/components/Enum.js.map +1 -1
  113. package/dist/src/components/ExtendsClause.d.ts +1 -1
  114. package/dist/src/components/ExtendsClause.d.ts.map +1 -1
  115. package/dist/src/components/ExtendsClause.js.map +1 -1
  116. package/dist/src/components/ImplementsClause.d.ts +1 -1
  117. package/dist/src/components/ImplementsClause.d.ts.map +1 -1
  118. package/dist/src/components/ImplementsClause.js.map +1 -1
  119. package/dist/src/components/ImportStatement.js.map +1 -1
  120. package/dist/src/components/Interface.d.ts +4 -4
  121. package/dist/src/components/Interface.d.ts.map +1 -1
  122. package/dist/src/components/Interface.js.map +1 -1
  123. package/dist/src/components/LexicalScope.d.ts +1 -1
  124. package/dist/src/components/LexicalScope.d.ts.map +1 -1
  125. package/dist/src/components/LexicalScope.js.map +1 -1
  126. package/dist/src/components/MavenProject.d.ts +2 -2
  127. package/dist/src/components/MavenProject.d.ts.map +1 -1
  128. package/dist/src/components/MavenProject.js.map +1 -1
  129. package/dist/src/components/Method.d.ts +3 -3
  130. package/dist/src/components/Method.d.ts.map +1 -1
  131. package/dist/src/components/Method.js.map +1 -1
  132. package/dist/src/components/Modifiers.js.map +1 -1
  133. package/dist/src/components/Name.js.map +1 -1
  134. package/dist/src/components/NamedArgumentList.d.ts +1 -1
  135. package/dist/src/components/NamedArgumentList.d.ts.map +1 -1
  136. package/dist/src/components/NamedArgumentList.js.map +1 -1
  137. package/dist/src/components/ObjectDeclaration.d.ts +3 -3
  138. package/dist/src/components/ObjectDeclaration.d.ts.map +1 -1
  139. package/dist/src/components/ObjectDeclaration.js.map +1 -1
  140. package/dist/src/components/PackageDirectory.d.ts +1 -1
  141. package/dist/src/components/PackageDirectory.d.ts.map +1 -1
  142. package/dist/src/components/PackageDirectory.js.map +1 -1
  143. package/dist/src/components/Parameters.d.ts +2 -2
  144. package/dist/src/components/Parameters.d.ts.map +1 -1
  145. package/dist/src/components/Parameters.js.map +1 -1
  146. package/dist/src/components/ProjectDirectory.d.ts +3 -2
  147. package/dist/src/components/ProjectDirectory.d.ts.map +1 -1
  148. package/dist/src/components/ProjectDirectory.js.map +1 -1
  149. package/dist/src/components/Reference.d.ts +1 -1
  150. package/dist/src/components/Reference.d.ts.map +1 -1
  151. package/dist/src/components/Reference.js.map +1 -1
  152. package/dist/src/components/SourceFile.d.ts +2 -2
  153. package/dist/src/components/SourceFile.d.ts.map +1 -1
  154. package/dist/src/components/SourceFile.js.map +1 -1
  155. package/dist/src/components/TypeArguments.d.ts +1 -1
  156. package/dist/src/components/TypeArguments.d.ts.map +1 -1
  157. package/dist/src/components/TypeArguments.js.map +1 -1
  158. package/dist/src/components/TypeParameters.d.ts +1 -1
  159. package/dist/src/components/TypeParameters.d.ts.map +1 -1
  160. package/dist/src/components/TypeParameters.js.map +1 -1
  161. package/dist/src/components/Value.js.map +1 -1
  162. package/dist/src/components/Variable.d.ts +2 -2
  163. package/dist/src/components/Variable.d.ts.map +1 -1
  164. package/dist/src/components/Variable.js.map +1 -1
  165. package/dist/src/components/index.js.map +1 -1
  166. package/dist/src/components/stc/index.d.ts.map +1 -1
  167. package/dist/src/components/stc/index.js.map +1 -1
  168. package/dist/src/create-library.d.ts +1 -1
  169. package/dist/src/create-library.d.ts.map +1 -1
  170. package/dist/src/create-library.js.map +1 -1
  171. package/dist/src/index.js.map +1 -1
  172. package/dist/src/name-policy.d.ts +1 -1
  173. package/dist/src/name-policy.d.ts.map +1 -1
  174. package/dist/src/name-policy.js.map +1 -1
  175. package/dist/src/symbols/index.d.ts +1 -1
  176. package/dist/src/symbols/index.d.ts.map +1 -1
  177. package/dist/src/symbols/index.js +0 -1
  178. package/dist/src/symbols/index.js.map +1 -1
  179. package/dist/src/symbols/java-lexical-scope.js.map +1 -1
  180. package/dist/src/symbols/java-output-symbol.d.ts +2 -1
  181. package/dist/src/symbols/java-output-symbol.d.ts.map +1 -1
  182. package/dist/src/symbols/java-output-symbol.js.map +1 -1
  183. package/dist/src/symbols/java-package-scope.d.ts.map +1 -1
  184. package/dist/src/symbols/java-package-scope.js.map +1 -1
  185. package/dist/src/symbols/java-project-scope.d.ts +2 -1
  186. package/dist/src/symbols/java-project-scope.d.ts.map +1 -1
  187. package/dist/src/symbols/java-project-scope.js.map +1 -1
  188. package/dist/src/symbols/reference.d.ts +1 -1
  189. package/dist/src/symbols/reference.d.ts.map +1 -1
  190. package/dist/src/symbols/reference.js.map +1 -1
  191. package/dist/src/symbols/scopes.d.ts +2 -2
  192. package/dist/src/symbols/scopes.d.ts.map +1 -1
  193. package/dist/src/symbols/scopes.js.map +1 -1
  194. package/dist/src/utils.d.ts.map +1 -1
  195. package/dist/src/utils.js.map +1 -1
  196. package/dist/test/annotation.test.js.map +1 -1
  197. package/dist/test/class.test.js.map +1 -1
  198. package/dist/test/constructor.test.js.map +1 -1
  199. package/dist/test/enum.test.js.map +1 -1
  200. package/dist/test/externals.test.js.map +1 -1
  201. package/dist/test/interface.test.js.map +1 -1
  202. package/dist/test/maven.test.js.map +1 -1
  203. package/dist/test/method.test.js.map +1 -1
  204. package/dist/test/package.test.js.map +1 -1
  205. package/dist/test/reference.test.js.map +1 -1
  206. package/dist/test/type-arguments.test.js.map +1 -1
  207. package/dist/test/utils.d.ts +1 -1
  208. package/dist/test/utils.d.ts.map +1 -1
  209. package/dist/test/utils.js.map +1 -1
  210. package/dist/test/values.test.js.map +1 -1
  211. package/dist/test/variables.test.js.map +1 -1
  212. package/dist/test/vitest.setup.js.map +1 -1
  213. package/dist/tsconfig.tsbuildinfo +1 -1
  214. package/docs/api/components/ArgumentList.md +4 -4
  215. package/docs/api/components/Class.md +4 -4
  216. package/docs/api/components/Constructor.md +1 -1
  217. package/docs/api/components/Declaration.md +6 -6
  218. package/docs/api/components/Enum.md +18 -18
  219. package/docs/api/components/EnumMember.md +16 -16
  220. package/docs/api/components/Interface.md +3 -3
  221. package/docs/api/components/Method.md +3 -3
  222. package/docs/api/components/ObjectDeclaration.md +19 -19
  223. package/docs/api/components/PackageDirectory.md +4 -4
  224. package/docs/api/components/ProjectDirectory.md +6 -6
  225. package/docs/api/components/SourceFile.md +4 -4
  226. package/docs/api/components/TypeArguments.md +3 -3
  227. package/docs/api/components/Variable.md +17 -17
  228. package/docs/api/types/CommonDeclarationProps.md +5 -5
  229. package/docs/api/types/JavaProjectScopeOptions.md +4 -4
  230. package/package.json +8 -8
  231. package/src/builtins/util.ts +1 -0
  232. package/src/components/Annotation.tsx +2 -1
  233. package/src/components/ArgumentList.tsx +2 -1
  234. package/src/components/Class.tsx +9 -4
  235. package/src/components/Constructor.tsx +4 -2
  236. package/src/components/Declaration.tsx +5 -8
  237. package/src/components/Enum.tsx +7 -3
  238. package/src/components/ExtendsClause.tsx +2 -1
  239. package/src/components/ImplementsClause.tsx +2 -1
  240. package/src/components/Interface.tsx +9 -4
  241. package/src/components/LexicalScope.tsx +3 -7
  242. package/src/components/MavenProject.tsx +12 -17
  243. package/src/components/Method.tsx +12 -9
  244. package/src/components/NamedArgumentList.tsx +1 -1
  245. package/src/components/ObjectDeclaration.tsx +5 -3
  246. package/src/components/PackageDirectory.tsx +4 -5
  247. package/src/components/Parameters.tsx +2 -1
  248. package/src/components/ProjectDirectory.tsx +6 -6
  249. package/src/components/Reference.tsx +2 -1
  250. package/src/components/SourceFile.tsx +8 -7
  251. package/src/components/TypeArguments.tsx +2 -1
  252. package/src/components/TypeParameters.tsx +2 -1
  253. package/src/components/Variable.tsx +5 -2
  254. package/src/components/stc/index.ts +1 -0
  255. package/src/create-library.ts +5 -5
  256. package/src/name-policy.ts +2 -1
  257. package/src/symbols/index.ts +1 -1
  258. package/src/symbols/java-output-symbol.ts +6 -11
  259. package/src/symbols/java-project-scope.ts +1 -1
  260. package/src/symbols/reference.ts +5 -3
  261. package/src/symbols/scopes.ts +2 -2
  262. package/src/utils.ts +1 -0
  263. package/temp/api.json +8 -8
  264. package/test/annotation.test.tsx +1 -0
  265. package/test/class.test.tsx +1 -0
  266. package/test/constructor.test.tsx +3 -2
  267. package/test/enum.test.tsx +1 -0
  268. package/test/externals.test.tsx +1 -0
  269. package/test/interface.test.tsx +1 -0
  270. package/test/maven.test.tsx +2 -1
  271. package/test/method.test.tsx +4 -3
  272. package/test/package.test.tsx +1 -0
  273. package/test/reference.test.tsx +1 -0
  274. package/test/type-arguments.test.tsx +4 -3
  275. package/test/utils.tsx +3 -1
  276. package/test/values.test.tsx +1 -0
  277. package/test/variables.test.tsx +5 -4
  278. package/tsdoc-metadata.json +1 -1
  279. package/vitest.config.ts +0 -12
@@ -1,8 +1,12 @@
1
- import { Children, code } from "@alloy-js/core";
1
+ import type { Children } from "@alloy-js/core";
2
+ import { code } from "@alloy-js/core";
3
+
2
4
  import { useJavaNamePolicy } from "../name-policy.js";
3
- import { ModifierProps, Modifiers } from "./Modifiers.jsx";
5
+ import type { ModifierProps } from "./Modifiers.jsx";
6
+ import { Modifiers } from "./Modifiers.jsx";
4
7
  import { Parameters } from "./Parameters.js";
5
- import { TypeParameters, TypeParametersProps } from "./TypeParameters.jsx";
8
+ import type { TypeParametersProps } from "./TypeParameters.jsx";
9
+ import { TypeParameters } from "./TypeParameters.jsx";
6
10
 
7
11
  export interface MethodProps extends ModifierProps, TypeParametersProps {
8
12
  name: string;
@@ -17,18 +21,17 @@ export function Method(props: MethodProps) {
17
21
  const name = useJavaNamePolicy().getName(props.name, "method");
18
22
  const modifiers = <Modifiers {...props} />;
19
23
  const throwsClause = props.throws ? code` throws ${props.throws}` : "";
20
- const generics =
21
- props.generics ?
22
- code`${(<TypeParameters generics={props.generics} />)}${" "}`
24
+ const generics = props.generics
25
+ ? code`${<TypeParameters generics={props.generics} />}${" "}`
23
26
  : "";
24
27
  const sBody =
25
- props.children !== undefined ?
26
- code`
28
+ props.children !== undefined
29
+ ? code`
27
30
  ${" "}{
28
31
  ${props.children}
29
32
  }
30
33
  `
31
- : ";";
34
+ : ";";
32
35
  return code`
33
36
  ${modifiers}${generics}${props.return ?? "void"} ${name}(${params})${throwsClause}${sBody}
34
37
  `;
@@ -1,5 +1,5 @@
1
1
  import { For, Indent } from "@alloy-js/core";
2
- import { Children } from "@alloy-js/core/jsx-runtime";
2
+ import type { Children } from "@alloy-js/core/jsx-runtime";
3
3
 
4
4
  export interface NamedArgumentListProps {
5
5
  args: Record<string, Children>;
@@ -1,7 +1,9 @@
1
- import { Children, code } from "@alloy-js/core";
1
+ import type { Children } from "@alloy-js/core";
2
+ import { code } from "@alloy-js/core";
3
+
2
4
  import { ArgumentList } from "./ArgumentList.jsx";
3
- import { CommonDeclarationProps } from "./Declaration.js";
4
- import { ModifierProps } from "./Modifiers.jsx";
5
+ import type { CommonDeclarationProps } from "./Declaration.js";
6
+ import type { ModifierProps } from "./Modifiers.jsx";
5
7
  import { Variable } from "./Variable.js";
6
8
 
7
9
  export interface ObjectDeclarationProps
@@ -1,6 +1,5 @@
1
+ import type { Children, ComponentContext } from "@alloy-js/core";
1
2
  import {
2
- Children,
3
- ComponentContext,
4
3
  createContext,
5
4
  createScope,
6
5
  Scope,
@@ -9,6 +8,7 @@ import {
9
8
  useContext,
10
9
  useScope,
11
10
  } from "@alloy-js/core";
11
+
12
12
  import { JavaPackageScope } from "../symbols/java-package-scope.js";
13
13
 
14
14
  export interface PackageDirectoryContext {
@@ -40,9 +40,8 @@ export function PackageDirectory(props: PackageDirectoryProps) {
40
40
  const packageNames = props.package.split(".");
41
41
  const packageName = packageNames[0];
42
42
 
43
- const fullyQualifiedPackageName =
44
- parentPackage ?
45
- parentPackage.qualifiedName + "." + packageName
43
+ const fullyQualifiedPackageName = parentPackage
44
+ ? parentPackage.qualifiedName + "." + packageName
46
45
  : packageName;
47
46
 
48
47
  const parentScope = useScope();
@@ -1,4 +1,5 @@
1
- import { Children, mapJoin } from "@alloy-js/core";
1
+ import type { Children } from "@alloy-js/core";
2
+ import { mapJoin } from "@alloy-js/core";
2
3
 
3
4
  export interface ParametersProps {
4
5
  parameters?: Record<string, Children>; // Map parameter name to type
@@ -1,17 +1,17 @@
1
+ import type { Children, ComponentContext } from "@alloy-js/core";
1
2
  import {
2
- Children,
3
- ComponentContext,
4
3
  createContext,
5
4
  createScope,
6
5
  Scope,
7
6
  SourceDirectory,
8
7
  useContext,
9
8
  } from "@alloy-js/core";
10
- import {
9
+
10
+ import type {
11
11
  GradleProjectConfig,
12
- JavaProjectScope,
13
12
  MavenProjectConfig,
14
13
  } from "../symbols/index.js";
14
+ import { JavaProjectScope } from "../symbols/index.js";
15
15
  import { MavenProject } from "./MavenProject.js";
16
16
 
17
17
  export interface ProjectContext {
@@ -63,9 +63,9 @@ export function ProjectDirectory(props: ProjectDirectoryProps) {
63
63
  <SourceDirectory path={defaultCodePath}>
64
64
  {props.children}
65
65
  </SourceDirectory>
66
- {scope.mavenProjectConfig ?
66
+ {scope.mavenProjectConfig ? (
67
67
  <MavenProject projectConfig={scope.mavenProjectConfig} />
68
- : undefined}
68
+ ) : undefined}
69
69
  </ProjectContext.Provider>
70
70
  </Scope>
71
71
  </>
@@ -1,4 +1,5 @@
1
- import { Refkey } from "@alloy-js/core";
1
+ import type { Refkey } from "@alloy-js/core";
2
+
2
3
  import { ref } from "../symbols/index.js";
3
4
 
4
5
  export interface ReferenceProps {
@@ -1,13 +1,14 @@
1
+ import type { ComponentContext, OutputSymbol } from "@alloy-js/core";
1
2
  import {
2
- ComponentContext,
3
3
  SourceFile as CoreSourceFile,
4
4
  createContext,
5
- OutputSymbol,
6
5
  reactive,
7
6
  } from "@alloy-js/core";
8
- import { Children } from "@alloy-js/core/jsx-runtime";
9
- import { JavaOutputSymbol } from "../symbols/index.js";
10
- import { ImportStatements, ImportSymbol } from "./ImportStatement.js";
7
+ import type { Children } from "@alloy-js/core/jsx-runtime";
8
+
9
+ import type { JavaOutputSymbol } from "../symbols/index.js";
10
+ import type { ImportSymbol } from "./ImportStatement.js";
11
+ import { ImportStatements } from "./ImportStatement.js";
11
12
  import { LexicalScope } from "./LexicalScope.jsx";
12
13
  import { usePackage } from "./PackageDirectory.js";
13
14
  import { Reference } from "./Reference.js";
@@ -71,13 +72,13 @@ export function SourceFile(props: SourceFileProps) {
71
72
  <CoreSourceFile path={props.path} filetype="java" reference={Reference}>
72
73
  package {packageCtx.qualifiedName};<hbr />
73
74
  <hbr />
74
- {importRecords.length > 0 ?
75
+ {importRecords.length > 0 ? (
75
76
  <>
76
77
  <ImportStatements imports={importRecords} />
77
78
  <hbr />
78
79
  <hbr />
79
80
  </>
80
- : undefined}
81
+ ) : undefined}
81
82
  <SourceFileContext.Provider value={sfContext}>
82
83
  <LexicalScope name={props.path}>{props.children}</LexicalScope>
83
84
  </SourceFileContext.Provider>
@@ -1,4 +1,5 @@
1
- import { Children, For, Indent, Match, Switch } from "@alloy-js/core";
1
+ import type { Children } from "@alloy-js/core";
2
+ import { For, Indent, Match, Switch } from "@alloy-js/core";
2
3
 
3
4
  export interface TypeArgumentsProps {
4
5
  args?: Children[] | TypeArgumentDescriptor[];
@@ -1,4 +1,5 @@
1
- import { Children, For, Indent, Show } from "@alloy-js/core";
1
+ import type { Children } from "@alloy-js/core";
2
+ import { For, Indent, Show } from "@alloy-js/core";
2
3
 
3
4
  export interface TypeParametersProps {
4
5
  generics?: Record<string, Children>;
@@ -1,6 +1,9 @@
1
- import { Children, code, Namekey } from "@alloy-js/core";
1
+ import type { Children, Namekey } from "@alloy-js/core";
2
+ import { code } from "@alloy-js/core";
3
+
2
4
  import { useJavaNamePolicy } from "../name-policy.js";
3
- import { ModifierProps, Modifiers } from "./Modifiers.jsx";
5
+ import type { ModifierProps } from "./Modifiers.jsx";
6
+ import { Modifiers } from "./Modifiers.jsx";
4
7
 
5
8
  export interface VariableProps extends ModifierProps {
6
9
  type: Children;
@@ -1,4 +1,5 @@
1
1
  import * as core from "@alloy-js/core";
2
+
2
3
  import * as base from "../index.js";
3
4
 
4
5
  export const Annotation = core.stc(base.Annotation);
@@ -1,15 +1,14 @@
1
1
  // Declare libraries (dependencies) that you are adding to the project.
2
2
  // Allows discovery of symbols from these libraries for use in the program
3
3
 
4
+ import type { Binder, Refkey, SymbolCreator } from "@alloy-js/core";
4
5
  import {
5
- Binder,
6
6
  createScope,
7
7
  createSymbol,
8
8
  getSymbolCreatorSymbol,
9
- Refkey,
10
9
  refkey,
11
- SymbolCreator,
12
10
  } from "@alloy-js/core";
11
+
13
12
  import {
14
13
  JavaOutputSymbol,
15
14
  JavaPackageScope,
@@ -43,8 +42,9 @@ function createSymbols(
43
42
  }
44
43
 
45
44
  export type LibraryRefkeys<T extends LibraryDescriptor> = {
46
- [S in T[keyof T] extends readonly string[] ? T[keyof T][number]
47
- : never]: Refkey;
45
+ [S in T[keyof T] extends readonly string[]
46
+ ? T[keyof T][number]
47
+ : never]: Refkey;
48
48
  };
49
49
 
50
50
  export interface CreateLibraryProps<T extends LibraryDescriptor> {
@@ -1,4 +1,5 @@
1
- import { createNamePolicy, NamePolicy, useNamePolicy } from "@alloy-js/core";
1
+ import type { NamePolicy } from "@alloy-js/core";
2
+ import { createNamePolicy, useNamePolicy } from "@alloy-js/core";
2
3
  import { camelCase, constantCase, pascalCase } from "change-case";
3
4
 
4
5
  export type JavaElements =
@@ -3,4 +3,4 @@ export * from "./java-output-symbol.js";
3
3
  export * from "./java-package-scope.js";
4
4
  export * from "./java-project-scope.js";
5
5
  export * from "./reference.js";
6
- export * from "./scopes.js";
6
+ export type * from "./scopes.js";
@@ -1,11 +1,6 @@
1
- import {
2
- createSymbol,
3
- Namekey,
4
- OutputSpace,
5
- OutputSymbol,
6
- OutputSymbolOptions,
7
- refkey,
8
- } from "@alloy-js/core";
1
+ import type { Namekey, OutputSpace, OutputSymbolOptions } from "@alloy-js/core";
2
+ import { createSymbol, OutputSymbol, refkey } from "@alloy-js/core";
3
+
9
4
  import { usePackage } from "../components/PackageDirectory.jsx";
10
5
 
11
6
  export interface JavaOutputSymbolOptions extends OutputSymbolOptions {
@@ -41,9 +36,9 @@ export class JavaOutputSymbol extends OutputSymbol {
41
36
  } else {
42
37
  const parentPackage = usePackage();
43
38
  this.#package =
44
- (options.package ?? parentPackage !== null) ?
45
- parentPackage?.qualifiedName
46
- : "";
39
+ (options.package ?? parentPackage !== null)
40
+ ? parentPackage?.qualifiedName
41
+ : "";
47
42
  }
48
43
  }
49
44
 
@@ -1,6 +1,6 @@
1
+ import type { OutputScopeOptions } from "@alloy-js/core";
1
2
  import {
2
3
  OutputScope,
3
- OutputScopeOptions,
4
4
  track,
5
5
  TrackOpTypes,
6
6
  trigger,
@@ -1,7 +1,9 @@
1
- import { memo, Refkey, resolve, untrack, useContext } from "@alloy-js/core";
1
+ import type { Refkey } from "@alloy-js/core";
2
+ import { memo, resolve, untrack, useContext } from "@alloy-js/core";
3
+
2
4
  import { SourceFileContext } from "../components/index.js";
3
- import { JavaOutputSymbol } from "./java-output-symbol.js";
4
- import { JavaOutputScope } from "./scopes.js";
5
+ import type { JavaOutputSymbol } from "./java-output-symbol.js";
6
+ import type { JavaOutputScope } from "./scopes.js";
5
7
 
6
8
  /**
7
9
  * Resolve reference to symbol reference, and handle dependency management
@@ -1,4 +1,4 @@
1
- import { JavaPackageScope } from "./java-package-scope.js";
2
- import { JavaProjectScope } from "./java-project-scope.js";
1
+ import type { JavaPackageScope } from "./java-package-scope.js";
2
+ import type { JavaProjectScope } from "./java-project-scope.js";
3
3
 
4
4
  export type JavaOutputScope = JavaProjectScope | JavaPackageScope;
package/src/utils.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { useScope } from "@alloy-js/core";
2
+
2
3
  import { JavaLexicalScope } from "./symbols/java-lexical-scope.js";
3
4
 
4
5
  export function useLexicalScope(): JavaLexicalScope | undefined {
package/temp/api.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "metadata": {
3
3
  "toolPackage": "@microsoft/api-extractor",
4
- "toolVersion": "7.58.8",
4
+ "toolVersion": "7.58.11",
5
5
  "schemaVersion": 1011,
6
6
  "oldestForwardsCompatibleVersion": 1001,
7
7
  "tsdocConfig": {
@@ -5214,25 +5214,25 @@
5214
5214
  },
5215
5215
  {
5216
5216
  "kind": "Content",
5217
- "text": "() => (string | import(\"@alloy-js/core\")."
5217
+ "text": "() => (string | "
5218
5218
  },
5219
5219
  {
5220
5220
  "kind": "Reference",
5221
- "text": "CustomContext",
5222
- "canonicalReference": "@alloy-js/core!CustomContext:interface"
5221
+ "text": "Children",
5222
+ "canonicalReference": "@alloy-js/core!Children:type"
5223
5223
  },
5224
5224
  {
5225
5225
  "kind": "Content",
5226
- "text": " | "
5226
+ "text": "[] | import(\"@alloy-js/core\")."
5227
5227
  },
5228
5228
  {
5229
5229
  "kind": "Reference",
5230
- "text": "Children",
5231
- "canonicalReference": "@alloy-js/core!Children:type"
5230
+ "text": "CustomContext",
5231
+ "canonicalReference": "@alloy-js/core!CustomContext:interface"
5232
5232
  },
5233
5233
  {
5234
5234
  "kind": "Content",
5235
- "text": "[] | undefined)[]"
5235
+ "text": " | undefined)[]"
5236
5236
  },
5237
5237
  {
5238
5238
  "kind": "Content",
@@ -1,4 +1,5 @@
1
1
  import { expect, it } from "vitest";
2
+
2
3
  import * as jv from "../src/components/index.js";
3
4
  import { TestPackage } from "./utils.js";
4
5
 
@@ -1,5 +1,6 @@
1
1
  import { code, namekey, Output, refkey } from "@alloy-js/core";
2
2
  import { expect, it } from "vitest";
3
+
3
4
  import * as jv from "../src/components/index.js";
4
5
  import { TestPackage } from "./utils.js";
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { code, Output, refkey } from "@alloy-js/core";
2
2
  import { expect, it } from "vitest";
3
+
3
4
  import * as jv from "../src/components/index.js";
4
5
  import { TestPackage } from "./utils.js";
5
6
 
@@ -9,7 +10,7 @@ it("works", () => {
9
10
  <jv.Declaration name="TestClass">
10
11
  {code`
11
12
  public class TestClass {
12
- ${(<jv.Constructor public name="TestClass" />)}
13
+ ${<jv.Constructor public name="TestClass" />}
13
14
  }
14
15
  `}
15
16
  </jv.Declaration>
@@ -29,7 +30,7 @@ it("takes name from class", () => {
29
30
  <jv.Declaration name="TestClass">
30
31
  {code`
31
32
  public class TestClass {
32
- ${(<jv.Constructor public />)}
33
+ ${<jv.Constructor public />}
33
34
  }
34
35
  `}
35
36
  </jv.Declaration>
@@ -1,5 +1,6 @@
1
1
  import { code, namekey, Output, refkey } from "@alloy-js/core";
2
2
  import { expect, it } from "vitest";
3
+
3
4
  import * as jv from "../src/components/index.js";
4
5
  import { TestPackage } from "./utils.js";
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { StatementList } from "@alloy-js/core";
2
2
  import { expect, it } from "vitest";
3
+
3
4
  import * as jv from "../src/components/index.js";
4
5
  import { createLibrary } from "../src/index.js";
5
6
  import { TestPackage } from "./utils.js";
@@ -1,5 +1,6 @@
1
1
  import { namekey, Output, refkey } from "@alloy-js/core";
2
2
  import { expect, it } from "vitest";
3
+
3
4
  import * as jv from "../src/components/index.js";
4
5
  import { TestPackage } from "./utils.js";
5
6
 
@@ -1,7 +1,8 @@
1
1
  import { Output } from "@alloy-js/core";
2
2
  import { expect, it } from "vitest";
3
+
3
4
  import { ProjectDirectory } from "../src/components/index.js";
4
- import { MavenProjectConfig } from "../src/index.js";
5
+ import type { MavenProjectConfig } from "../src/index.js";
5
6
 
6
7
  it("generates barebones pom.xml file", () => {
7
8
  const projectConfig: MavenProjectConfig = {
@@ -1,5 +1,6 @@
1
1
  import { code, Output, refkey } from "@alloy-js/core";
2
2
  import { describe, expect, it } from "vitest";
3
+
3
4
  import * as jv from "../src/components/index.js";
4
5
  import { TestPackage } from "./utils.js";
5
6
 
@@ -35,7 +36,7 @@ it("declares bodyless function", () => {
35
36
  <jv.Declaration name="Test">
36
37
  {code`
37
38
  class Test {
38
- ${(<jv.Method public name="testMethod" />)}
39
+ ${<jv.Method public name="testMethod" />}
39
40
  }
40
41
  `}
41
42
  </jv.Declaration>
@@ -56,7 +57,7 @@ describe("can throw errors", () => {
56
57
  <jv.Declaration name="Test">
57
58
  {code`
58
59
  class Test {
59
- ${(<jv.Method public name="testMethod" throws={"Exception"} />)}
60
+ ${<jv.Method public name="testMethod" throws={"Exception"} />}
60
61
  }
61
62
  `}
62
63
  </jv.Declaration>
@@ -78,7 +79,7 @@ describe("can throw errors", () => {
78
79
  <jv.Declaration name="Test">
79
80
  {code`
80
81
  class Test {
81
- ${(<jv.Method public name="testMethod" throws={refkey("CustomError")} />)}
82
+ ${<jv.Method public name="testMethod" throws={refkey("CustomError")} />}
82
83
  }
83
84
  `}
84
85
  </jv.Declaration>
@@ -1,5 +1,6 @@
1
1
  import { Output } from "@alloy-js/core";
2
2
  import { expect, it } from "vitest";
3
+
3
4
  import * as jv from "../src/components/index.js";
4
5
 
5
6
  it("emits correct package directory", () => {
@@ -1,5 +1,6 @@
1
1
  import { Block, Output, refkey } from "@alloy-js/core";
2
2
  import { expect, it } from "vitest";
3
+
3
4
  import * as jv from "../src/components/index.js";
4
5
 
5
6
  it("imports reference to source file", () => {
@@ -1,5 +1,6 @@
1
1
  import { Output, code, refkey } from "@alloy-js/core";
2
2
  import { expect, it } from "vitest";
3
+
3
4
  import * as jv from "../src/components/index.js";
4
5
 
5
6
  it("passes types", () => {
@@ -27,9 +28,9 @@ it("passes types", () => {
27
28
  <jv.Class public name="TestGenerics">
28
29
  {code`
29
30
  public TestGenerics() {
30
- List${(<jv.TypeArguments args={[refkey("TypeOne")]} />)} list = new ArrayList${(<jv.TypeArguments />)}();
31
- List${(<jv.TypeArguments args={[{ extends: refkey("TypeTwo") }]} />)} list2 = new ArrayList${(<jv.TypeArguments />)}();
32
- List${(<jv.TypeArguments args={[{ wildcard: true }]} />)} list3 = new ArrayList${(<jv.TypeArguments />)}();
31
+ List${<jv.TypeArguments args={[refkey("TypeOne")]} />} list = new ArrayList${<jv.TypeArguments />}();
32
+ List${<jv.TypeArguments args={[{ extends: refkey("TypeTwo") }]} />} list2 = new ArrayList${<jv.TypeArguments />}();
33
+ List${<jv.TypeArguments args={[{ wildcard: true }]} />} list3 = new ArrayList${<jv.TypeArguments />}();
33
34
  }
34
35
  `}
35
36
  </jv.Class>
package/test/utils.tsx CHANGED
@@ -1,4 +1,6 @@
1
- import { Children, Output, SymbolCreator } from "@alloy-js/core";
1
+ import type { Children, SymbolCreator } from "@alloy-js/core";
2
+ import { Output } from "@alloy-js/core";
3
+
2
4
  import * as jv from "../src/index.js";
3
5
 
4
6
  export interface TestPackageProps {
@@ -1,4 +1,5 @@
1
1
  import { expect, it } from "vitest";
2
+
2
3
  import * as jv from "../src/components/index.js";
3
4
 
4
5
  it("renders string value", () => {
@@ -1,5 +1,6 @@
1
1
  import { code, namekey, Output, refkey } from "@alloy-js/core";
2
2
  import { expect, it } from "vitest";
3
+
3
4
  import * as jv from "../src/components/index.js";
4
5
  import { TestPackage } from "./utils.js";
5
6
 
@@ -9,7 +10,7 @@ it("works", () => {
9
10
  <jv.Declaration name="Test">
10
11
  {code`
11
12
  class Test {
12
- ${(<jv.Variable public static final type="String" name="myVar" value={<jv.Value value="Test" />} />)};
13
+ ${<jv.Variable public static final type="String" name="myVar" value={<jv.Value value="Test" />} />};
13
14
  }
14
15
  `}
15
16
  </jv.Declaration>
@@ -29,7 +30,7 @@ it("takes a namekey", () => {
29
30
  <jv.Declaration name={namekey("Test")}>
30
31
  {code`
31
32
  class Test {
32
- ${(<jv.Variable public static final type="String" name="myVar" value={<jv.Value value="Test" />} />)};
33
+ ${<jv.Variable public static final type="String" name="myVar" value={<jv.Value value="Test" />} />};
33
34
  }
34
35
  `}
35
36
  </jv.Declaration>
@@ -60,7 +61,7 @@ it("works with external type", () => {
60
61
  <jv.Declaration name="Test">
61
62
  {code`
62
63
  public class Test {
63
- ${(<jv.Variable public static type={refkey("Model")} name="myModel" />)};
64
+ ${<jv.Variable public static type={refkey("Model")} name="myModel" />};
64
65
  }
65
66
  `}
66
67
  </jv.Declaration>
@@ -99,7 +100,7 @@ it("declares new object", () => {
99
100
  <jv.Declaration name="Test">
100
101
  {code`
101
102
  public class Test {
102
- ${(<jv.ObjectDeclaration public static type={refkey("Model")} name="myModel" args={[<jv.Value value="initValue" />]} />)};
103
+ ${<jv.ObjectDeclaration public static type={refkey("Model")} name="myModel" args={[<jv.Value value="initValue" />]} />};
103
104
  }
104
105
  `}
105
106
  </jv.Declaration>
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.58.8"
8
+ "packageVersion": "7.58.11"
9
9
  }
10
10
  ]
11
11
  }
package/vitest.config.ts CHANGED
@@ -2,18 +2,6 @@ import alloyPlugin from "@alloy-js/rollup-plugin";
2
2
  import { defineConfig } from "vitest/config";
3
3
 
4
4
  export default defineConfig({
5
- resolve: {
6
- conditions: ["source"],
7
- },
8
- ssr: {
9
- resolve: {
10
- conditions: ["source"],
11
- },
12
- },
13
- esbuild: {
14
- jsx: "preserve",
15
- sourcemap: "both",
16
- },
17
5
  test: {
18
6
  exclude: ["**/dist/**", "**/node_modules/**"],
19
7
  setupFiles: ["./test/vitest.setup.ts"],