@alloy-js/java 0.10.0 → 0.12.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 (95) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/src/builtins/util.js +1 -2
  3. package/dist/src/components/Annotation.js +2 -4
  4. package/dist/src/components/ArgumentList.js +2 -5
  5. package/dist/src/components/Class.js +2 -6
  6. package/dist/src/components/Constructor.js +2 -4
  7. package/dist/src/components/Declaration.js +1 -2
  8. package/dist/src/components/Enum.js +2 -5
  9. package/dist/src/components/ExtendsClause.js +2 -5
  10. package/dist/src/components/ImplementsClause.js +2 -5
  11. package/dist/src/components/ImportStatement.js +1 -2
  12. package/dist/src/components/Interface.js +2 -5
  13. package/dist/src/components/MavenProject.js +2 -6
  14. package/dist/src/components/Method.js +1 -2
  15. package/dist/src/components/Modifiers.js +1 -2
  16. package/dist/src/components/Name.js +1 -2
  17. package/dist/src/components/NamedArgumentList.js +2 -4
  18. package/dist/src/components/ObjectDeclaration.js +2 -4
  19. package/dist/src/components/PackageDirectory.js +2 -4
  20. package/dist/src/components/Parameters.js +1 -2
  21. package/dist/src/components/ProjectDirectory.js +2 -4
  22. package/dist/src/components/Reference.js +1 -2
  23. package/dist/src/components/SourceFile.js +2 -5
  24. package/dist/src/components/TypeArguments.js +2 -5
  25. package/dist/src/components/TypeParameters.js +2 -5
  26. package/dist/src/components/Value.js +1 -2
  27. package/dist/src/components/Variable.js +1 -2
  28. package/dist/src/components/index.js +1 -2
  29. package/dist/src/components/stc/index.js +1 -2
  30. package/dist/src/create-library.js +1 -2
  31. package/dist/src/index.js +1 -2
  32. package/dist/src/name-policy.js +1 -2
  33. package/dist/src/symbols/index.js +1 -2
  34. package/dist/src/symbols/java-output-symbol.js +1 -2
  35. package/dist/src/symbols/java-package-scope.js +1 -2
  36. package/dist/src/symbols/java-project-scope.js +1 -2
  37. package/dist/src/symbols/reference.js +1 -2
  38. package/dist/test/annotation.test.js +77 -0
  39. package/dist/test/class.test.js +164 -0
  40. package/dist/test/constructor.test.js +101 -0
  41. package/dist/test/enum.test.js +136 -0
  42. package/dist/test/externals.test.js +72 -0
  43. package/dist/test/interface.test.js +110 -0
  44. package/dist/test/maven.test.js +251 -0
  45. package/dist/test/method.test.js +270 -0
  46. package/dist/test/package.test.js +18 -0
  47. package/dist/test/reference.test.js +108 -0
  48. package/dist/test/type-arguments.test.js +83 -0
  49. package/dist/test/utils.js +61 -0
  50. package/dist/test/values.test.js +32 -0
  51. package/dist/test/variables.test.js +143 -0
  52. package/dist/test/vitest.d.js +1 -0
  53. package/dist/tsconfig.tsbuildinfo +1 -1
  54. package/package.json +12 -17
  55. package/temp/api.json +1 -1
  56. package/tsdoc-metadata.json +1 -1
  57. package/babel.config.cjs +0 -4
  58. package/dist/src/builtins/index.js.map +0 -1
  59. package/dist/src/builtins/util.js.map +0 -1
  60. package/dist/src/components/Annotation.js.map +0 -1
  61. package/dist/src/components/ArgumentList.js.map +0 -1
  62. package/dist/src/components/Class.js.map +0 -1
  63. package/dist/src/components/Constructor.js.map +0 -1
  64. package/dist/src/components/Declaration.js.map +0 -1
  65. package/dist/src/components/Enum.js.map +0 -1
  66. package/dist/src/components/ExtendsClause.js.map +0 -1
  67. package/dist/src/components/ImplementsClause.js.map +0 -1
  68. package/dist/src/components/ImportStatement.js.map +0 -1
  69. package/dist/src/components/Interface.js.map +0 -1
  70. package/dist/src/components/MavenProject.js.map +0 -1
  71. package/dist/src/components/Method.js.map +0 -1
  72. package/dist/src/components/Modifiers.js.map +0 -1
  73. package/dist/src/components/Name.js.map +0 -1
  74. package/dist/src/components/NamedArgumentList.js.map +0 -1
  75. package/dist/src/components/ObjectDeclaration.js.map +0 -1
  76. package/dist/src/components/PackageDirectory.js.map +0 -1
  77. package/dist/src/components/Parameters.js.map +0 -1
  78. package/dist/src/components/ProjectDirectory.js.map +0 -1
  79. package/dist/src/components/Reference.js.map +0 -1
  80. package/dist/src/components/SourceFile.js.map +0 -1
  81. package/dist/src/components/TypeArguments.js.map +0 -1
  82. package/dist/src/components/TypeParameters.js.map +0 -1
  83. package/dist/src/components/Value.js.map +0 -1
  84. package/dist/src/components/Variable.js.map +0 -1
  85. package/dist/src/components/index.js.map +0 -1
  86. package/dist/src/components/stc/index.js.map +0 -1
  87. package/dist/src/create-library.js.map +0 -1
  88. package/dist/src/index.js.map +0 -1
  89. package/dist/src/name-policy.js.map +0 -1
  90. package/dist/src/symbols/index.js.map +0 -1
  91. package/dist/src/symbols/java-output-symbol.js.map +0 -1
  92. package/dist/src/symbols/java-package-scope.js.map +0 -1
  93. package/dist/src/symbols/java-project-scope.js.map +0 -1
  94. package/dist/src/symbols/reference.js.map +0 -1
  95. package/dist/src/symbols/scopes.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog - @alloy-js/java
2
2
 
3
+ ## 0.12.0
4
+
5
+ No changes, version bump only.
6
+
7
+ ## 0.11.0
8
+
9
+ ### Features
10
+
11
+ - [#105](https://github.com/alloy-framework/alloy/pull/105) Updated dependencies
12
+
13
+
3
14
  ## 0.10.0
4
15
 
5
16
  No changes, version bump only.
@@ -6,5 +6,4 @@ export const javaUtil = createLibrary({
6
6
  descriptor: {
7
7
  "java.util": ["Collection", "Comparator", "Deque", "Enumeration", "EventListener", "Formattable", "Iterator", "List", "ListIterator", "Map", "Map.Entry", "NavigableMap", "NavigableSet", "Observer", "PrimitiveIterator", "Queue", "RandomAccess", "Set", "SortedMap", "SortedSet", "Spliterator", "AbstractCollection", "AbstractList", "AbstractMap", "AbstractQueue", "AbstractSequentialList", "AbstractSet", "ArrayDeque", "ArrayList", "Arrays", "Base64", "BitSet", "Calendar", "Collections", "Currency", "Date", "Dictionary", "DoubleSummaryStatistics", "EnumMap", "EnumSet", "EventListenerProxy", "EventObject", "FormattableFlags", "Formatter", "GregorianCalendar", "HashMap", "HashSet", "Hashtable", "IdentityHashMap", "IntSummaryStatistics", "LinkedHashMap", "LinkedHashSet", "LinkedList", "ListResourceBundle", "Locale", "LongSummaryStatistics", "Objects", "Observable", "Optional", "OptionalDouble", "OptionalInt", "OptionalLong", "PriorityQueue", "Properties", "PropertyPermission", "PropertyResourceBundle", "Random", "ResourceBundle", "ResourceBundle.Control", "Scanner", "ServiceLoader", "SimpleTimeZone", "Spliterators", "SplittableRandom", "Stack", "StringJoiner", "StringTokenizer", "Timer", "TimerTask", "TimeZone", "TreeMap", "TreeSet", "UUID", "Vector", "WeakHashMap", "ConcurrentModificationException", "DuplicateFormatFlagsException", "EmptyStackException", "FormatFlagsConversionMismatchException", "FormatterClosedException", "IllegalFormatCodePointException", "IllegalFormatConversionException", "IllegalFormatException", "IllegalFormatFlagsException", "IllegalFormatPrecisionException", "IllegalFormatWidthException", "IllformedLocaleException", "InputMismatchException", "InvalidPropertiesFormatException", "MissingFormatArgumentException", "MissingFormatWidthException", "MissingResourceException", "NoSuchElementException", "TooManyListenersException", "UnknownFormatConversionException", "UnknownFormatFlagsException"]
8
8
  }
9
- });
10
- //# sourceMappingURL=util.js.map
9
+ });
@@ -1,5 +1,4 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
2
  import { Match, Switch } from "@alloy-js/core";
4
3
  import { NamedArgumentList } from "./NamedArgumentList.js";
5
4
  /**
@@ -30,5 +29,4 @@ export function Annotation(props) {
30
29
  })];
31
30
  }
32
31
  })];
33
- }
34
- //# sourceMappingURL=Annotation.js.map
32
+ }
@@ -1,6 +1,4 @@
1
- import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
2
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createComponent as _$createComponent, createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
4
2
  import { For, Indent } from "@alloy-js/core";
5
3
  /**
6
4
  * A list of arguments to be passed to a function, constructor, enum, and so
@@ -29,5 +27,4 @@ export function ArgumentList(props) {
29
27
  }), ")"];
30
28
  }
31
29
  });
32
- }
33
- //# sourceMappingURL=ArgumentList.js.map
30
+ }
@@ -1,7 +1,4 @@
1
- import { mergeProps as _$mergeProps } from "@alloy-js/core/jsx-runtime";
2
- import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
3
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
4
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
1
+ import { createComponent as _$createComponent, memo as _$memo, createIntrinsic as _$createIntrinsic, mergeProps as _$mergeProps } from "@alloy-js/core/jsx-runtime";
5
2
  import { Block, Scope, Show } from "@alloy-js/core";
6
3
  import { useJavaNamePolicy } from "../name-policy.js";
7
4
  import { Declaration } from "./Declaration.js";
@@ -51,5 +48,4 @@ export function Class(props) {
51
48
  });
52
49
  }
53
50
  }));
54
- }
55
- //# sourceMappingURL=Class.js.map
51
+ }
@@ -1,5 +1,4 @@
1
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
2
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
1
+ import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
3
2
  import { Block } from "@alloy-js/core";
4
3
  import { Modifiers } from "./Modifiers.js";
5
4
  import { Name } from "./Name.js";
@@ -18,5 +17,4 @@ export function Constructor(props) {
18
17
  return props.children;
19
18
  }
20
19
  })];
21
- }
22
- //# sourceMappingURL=Constructor.js.map
20
+ }
@@ -13,5 +13,4 @@ export function Declaration(props) {
13
13
  return props.children;
14
14
  }
15
15
  });
16
- }
17
- //# sourceMappingURL=Declaration.js.map
16
+ }
@@ -1,6 +1,4 @@
1
- import { mergeProps as _$mergeProps } from "@alloy-js/core/jsx-runtime";
2
- import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
3
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
1
+ import { createComponent as _$createComponent, createIntrinsic as _$createIntrinsic, mergeProps as _$mergeProps } from "@alloy-js/core/jsx-runtime";
4
2
  import { Block, List, Scope } from "@alloy-js/core";
5
3
  import { useJavaNamePolicy } from "../name-policy.js";
6
4
  import { ArgumentList } from "./ArgumentList.js";
@@ -56,5 +54,4 @@ export function EnumMemberList(props) {
56
54
  hardline: true,
57
55
  ender: ";"
58
56
  });
59
- }
60
- //# sourceMappingURL=Enum.js.map
57
+ }
@@ -1,6 +1,4 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
3
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createIntrinsic as _$createIntrinsic, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
4
2
  import { List, Show } from "@alloy-js/core";
5
3
  /**
6
4
  * The extends clause for a class or interface.
@@ -24,5 +22,4 @@ export function ExtendsClause(props) {
24
22
  });
25
23
  }
26
24
  });
27
- }
28
- //# sourceMappingURL=ExtendsClause.js.map
25
+ }
@@ -1,6 +1,4 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
3
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createIntrinsic as _$createIntrinsic, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
4
2
  import { List, Show } from "@alloy-js/core";
5
3
  /**
6
4
  * The implements clause for a class, interface, or enum.
@@ -24,5 +22,4 @@ export function ImplementsClause(props) {
24
22
  });
25
23
  }
26
24
  });
27
- }
28
- //# sourceMappingURL=ImplementsClause.js.map
25
+ }
@@ -5,5 +5,4 @@ export function ImportStatements(props) {
5
5
  }
6
6
  export function ImportStatement(props) {
7
7
  return () => `import ${props.package}.${props.wildcard ? "*" : props.name};`;
8
- }
9
- //# sourceMappingURL=ImportStatement.js.map
8
+ }
@@ -1,6 +1,4 @@
1
- import { mergeProps as _$mergeProps } from "@alloy-js/core/jsx-runtime";
2
- import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
3
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
1
+ import { createComponent as _$createComponent, createIntrinsic as _$createIntrinsic, mergeProps as _$mergeProps } from "@alloy-js/core/jsx-runtime";
4
2
  import { Block, Scope } from "@alloy-js/core";
5
3
  import { useJavaNamePolicy } from "../name-policy.js";
6
4
  import { Declaration } from "./Declaration.js";
@@ -38,5 +36,4 @@ export function Interface(props) {
38
36
  })];
39
37
  }
40
38
  }));
41
- }
42
- //# sourceMappingURL=Interface.js.map
39
+ }
@@ -1,7 +1,4 @@
1
- import { mergeProps as _$mergeProps } from "@alloy-js/core/jsx-runtime";
2
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
3
- import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
4
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
1
+ import { createComponent as _$createComponent, createIntrinsic as _$createIntrinsic, memo as _$memo, mergeProps as _$mergeProps } from "@alloy-js/core/jsx-runtime";
5
2
  import { code, List, mapJoin, Show, SourceFile } from "@alloy-js/core";
6
3
  import { useProject } from "./ProjectDirectory.js";
7
4
  /**
@@ -216,5 +213,4 @@ function PomFileBuildResources(props) {
216
213
  `)}
217
214
  </resources>
218
215
  `;
219
- }
220
- //# sourceMappingURL=MavenProject.js.map
216
+ }
@@ -26,5 +26,4 @@ export function Method(props) {
26
26
  return code`
27
27
  ${modifiers}${generics}${props.return ?? "void"} ${name}(${params})${throwsClause}${sBody}
28
28
  `;
29
- }
30
- //# sourceMappingURL=Method.js.map
29
+ }
@@ -23,5 +23,4 @@ export function Modifiers(props) {
23
23
  ender: " ",
24
24
  children: modifier => modifier
25
25
  });
26
- }
27
- //# sourceMappingURL=Modifiers.js.map
26
+ }
@@ -6,5 +6,4 @@ export function Name() {
6
6
  return "";
7
7
  }
8
8
  return [_$memo(() => declSymbol.name)];
9
- }
10
- //# sourceMappingURL=Name.js.map
9
+ }
@@ -1,5 +1,4 @@
1
- import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
2
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
1
+ import { createComponent as _$createComponent, createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
3
2
  import { For, Indent } from "@alloy-js/core";
4
3
  /**
5
4
  * Collect a set of named arguments. Will pass to object as named arguments.
@@ -26,5 +25,4 @@ export function NamedArgumentList(props) {
26
25
  }), _$createIntrinsic("sbr", {}), ")"];
27
26
  }
28
27
  });
29
- }
30
- //# sourceMappingURL=NamedArgumentList.js.map
28
+ }
@@ -1,5 +1,4 @@
1
- import { mergeProps as _$mergeProps } from "@alloy-js/core/jsx-runtime";
2
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
1
+ import { createComponent as _$createComponent, mergeProps as _$mergeProps } from "@alloy-js/core/jsx-runtime";
3
2
  import { code } from "@alloy-js/core";
4
3
  import { ArgumentList } from "./ArgumentList.js";
5
4
  import { Variable } from "./Variable.js";
@@ -17,5 +16,4 @@ export function ObjectDeclaration(props) {
17
16
  return _$createComponent(Variable, _$mergeProps(props, {
18
17
  value: value
19
18
  }));
20
- }
21
- //# sourceMappingURL=ObjectDeclaration.js.map
19
+ }
@@ -1,5 +1,4 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
2
  import { createContext, Scope, SourceDirectory, SourceDirectoryContext, useBinder, useContext, useScope } from "@alloy-js/core";
4
3
  import { createJavaPackageScope } from "../symbols/java-package-scope.js";
5
4
  export const PackageDirectoryContext = createContext();
@@ -54,5 +53,4 @@ export function PackageDirectory(props) {
54
53
  });
55
54
  }
56
55
  });
57
- }
58
- //# sourceMappingURL=PackageDirectory.js.map
56
+ }
@@ -13,5 +13,4 @@ export function Parameters(props) {
13
13
  }, {
14
14
  joiner: ", "
15
15
  });
16
- }
17
- //# sourceMappingURL=Parameters.js.map
16
+ }
@@ -1,5 +1,4 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
2
  import { createContext, Scope, SourceDirectory, useBinder, useContext, useScope } from "@alloy-js/core";
4
3
  import { createJavaProjectScope } from "../symbols/index.js";
5
4
  import { MavenProject } from "./MavenProject.js";
@@ -38,5 +37,4 @@ export function ProjectDirectory(props) {
38
37
  });
39
38
  }
40
39
  })];
41
- }
42
- //# sourceMappingURL=ProjectDirectory.js.map
40
+ }
@@ -2,5 +2,4 @@ import { ref } from "../symbols/index.js";
2
2
  export function Reference(props) {
3
3
  const reference = ref(props.refkey);
4
4
  return [reference];
5
- }
6
- //# sourceMappingURL=Reference.js.map
5
+ }
@@ -1,6 +1,4 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
3
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createIntrinsic as _$createIntrinsic, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
4
2
  import { SourceFile as CoreSourceFile, createContext, reactive, Scope } from "@alloy-js/core";
5
3
  import { ImportStatements } from "./ImportStatement.js";
6
4
  import { usePackage } from "./PackageDirectory.js";
@@ -67,5 +65,4 @@ export function SourceFile(props) {
67
65
  })];
68
66
  }
69
67
  });
70
- }
71
- //# sourceMappingURL=SourceFile.js.map
68
+ }
@@ -1,6 +1,4 @@
1
- import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
2
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createComponent as _$createComponent, createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
4
2
  import { For, Indent, Match, Switch } from "@alloy-js/core";
5
3
  /**
6
4
  * Type arguments for a generic type. Can be called with either an array of
@@ -78,5 +76,4 @@ export function TypeArguments(props) {
78
76
  }
79
77
  function isTypeArgumentDescriptor(value) {
80
78
  return typeof value === "object" && value !== null && ("extends" in value || "super" in value || "argument" in value || "wildcard" in value);
81
- }
82
- //# sourceMappingURL=TypeArguments.js.map
79
+ }
@@ -1,6 +1,4 @@
1
- import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
2
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createComponent as _$createComponent, createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
4
2
  import { For, Indent, Show } from "@alloy-js/core";
5
3
  /**
6
4
  * Render a set of generic types for a method or class.
@@ -36,5 +34,4 @@ export function TypeParameters(props) {
36
34
  });
37
35
  }
38
36
  })];
39
- }
40
- //# sourceMappingURL=TypeParameters.js.map
37
+ }
@@ -13,5 +13,4 @@ export function Value(props) {
13
13
  return value;
14
14
  }
15
15
  });
16
- }
17
- //# sourceMappingURL=Value.js.map
16
+ }
@@ -6,5 +6,4 @@ export function Variable(props) {
6
6
  const name = useJavaNamePolicy().getName(props.name, "variable");
7
7
  const modifiers = _$createComponent(Modifiers, props);
8
8
  return code`${modifiers}${props.type} ${name}${props.value ? code` = ${props.value}` : ""}`;
9
- }
10
- //# sourceMappingURL=Variable.js.map
9
+ }
@@ -23,5 +23,4 @@ export * from "./SourceFile.js";
23
23
  export * from "./TypeArguments.js";
24
24
  export * from "./TypeParameters.js";
25
25
  export * from "./Value.js";
26
- export * from "./Variable.js";
27
- //# sourceMappingURL=index.js.map
26
+ export * from "./Variable.js";
@@ -25,5 +25,4 @@ export const SourceFile = stc(base.SourceFile);
25
25
  export const Value = stc(base.Value);
26
26
  export const Variable = stc(base.Variable);
27
27
  export const TypeParameters = stc(base.TypeParameters);
28
- export const NamedArgumentList = stc(base.NamedArgumentList);
29
- //# sourceMappingURL=index.js.map
28
+ export const NamedArgumentList = stc(base.NamedArgumentList);
@@ -30,5 +30,4 @@ export function createLibrary(props) {
30
30
  }
31
31
  }
32
32
  return refkeys;
33
- }
34
- //# sourceMappingURL=create-library.js.map
33
+ }
package/dist/src/index.js CHANGED
@@ -2,5 +2,4 @@ export * from "./builtins/index.js";
2
2
  export * from "./components/index.js";
3
3
  export * from "./create-library.js";
4
4
  export * from "./name-policy.js";
5
- export * from "./symbols/index.js";
6
- //# sourceMappingURL=index.js.map
5
+ export * from "./symbols/index.js";
@@ -17,5 +17,4 @@ export function createJavaNamePolicy() {
17
17
  }
18
18
  export function useJavaNamePolicy() {
19
19
  return useNamePolicy();
20
- }
21
- //# sourceMappingURL=name-policy.js.map
20
+ }
@@ -2,5 +2,4 @@ export * from "./java-output-symbol.js";
2
2
  export * from "./java-package-scope.js";
3
3
  export * from "./java-project-scope.js";
4
4
  export * from "./reference.js";
5
- export * from "./scopes.js";
6
- //# sourceMappingURL=index.js.map
5
+ export * from "./scopes.js";
@@ -17,5 +17,4 @@ export function createJavaSymbol(props) {
17
17
  package: parentPackage !== null ? parentPackage?.qualifiedName : ""
18
18
  });
19
19
  return sym;
20
- }
21
- //# sourceMappingURL=java-output-symbol.js.map
20
+ }
@@ -4,5 +4,4 @@ export function createJavaPackageScope(binder, parent, name) {
4
4
  name,
5
5
  parent
6
6
  });
7
- }
8
- //# sourceMappingURL=java-package-scope.js.map
7
+ }
@@ -25,5 +25,4 @@ export function createJavaProjectScope(binder, parent, name, mavenProjectConfig,
25
25
  mavenProjectConfig,
26
26
  gradleProjectConfig
27
27
  });
28
- }
29
- //# sourceMappingURL=java-project-scope.js.map
28
+ }
@@ -17,5 +17,4 @@ export function ref(refkey) {
17
17
  } = result.value;
18
18
  return untrack(() => sourceFile.addImport(targetDeclaration));
19
19
  });
20
- }
21
- //# sourceMappingURL=reference.js.map
20
+ }
@@ -0,0 +1,77 @@
1
+ import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
+ import { d } from "@alloy-js/core/testing";
3
+ import { expect, it } from "vitest";
4
+ import * as jv from "../src/components/index.js";
5
+ import { toSourceText } from "./utils.js";
6
+ it("Annotates object", () => {
7
+ const res = toSourceText(_$createComponent(jv.Annotation, {
8
+ type: "Getter"
9
+ }));
10
+ expect(res).toBe(d`
11
+ package me.test.code;
12
+
13
+ @Getter
14
+ `);
15
+ });
16
+ it("Takes single parameter", () => {
17
+ const res = toSourceText(_$createComponent(jv.Annotation, {
18
+ type: "Getter",
19
+ get value() {
20
+ return {
21
+ value: _$createComponent(jv.Value, {
22
+ value: "Test"
23
+ })
24
+ };
25
+ }
26
+ }));
27
+ expect(res).toBe(d`
28
+ package me.test.code;
29
+
30
+ @Getter("Test")
31
+ `);
32
+ });
33
+ it("Takes named parameters", () => {
34
+ const res = toSourceText(_$createComponent(jv.Annotation, {
35
+ type: "Getter",
36
+ get value() {
37
+ return {
38
+ value1: _$createComponent(jv.Value, {
39
+ value: "Tester"
40
+ }),
41
+ value2: _$createComponent(jv.Value, {
42
+ value: "Tested"
43
+ })
44
+ };
45
+ }
46
+ }));
47
+ expect(res).toBe(d`
48
+ package me.test.code;
49
+
50
+ @Getter(value1 = "Tester", value2 = "Tested")
51
+ `);
52
+ });
53
+ it("breaks named parameters across multiple lines", () => {
54
+ const res = toSourceText(_$createComponent(jv.Annotation, {
55
+ type: "Getter",
56
+ get value() {
57
+ return {
58
+ value1: _$createComponent(jv.Value, {
59
+ value: "Tester"
60
+ }),
61
+ value2: _$createComponent(jv.Value, {
62
+ value: "Tested"
63
+ })
64
+ };
65
+ }
66
+ }), {
67
+ printWidth: 20
68
+ });
69
+ expect(res).toBe(d`
70
+ package me.test.code;
71
+
72
+ @Getter(
73
+ value1 = "Tester",
74
+ value2 = "Tested"
75
+ )
76
+ `);
77
+ });