@alloy-js/java 0.9.0 → 0.11.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 +11 -0
- package/dist/src/builtins/util.js +1 -2
- package/dist/src/components/Annotation.js +2 -4
- package/dist/src/components/ArgumentList.js +2 -5
- package/dist/src/components/Class.js +2 -6
- package/dist/src/components/Constructor.js +2 -4
- package/dist/src/components/Declaration.js +1 -2
- package/dist/src/components/Enum.js +2 -5
- package/dist/src/components/ExtendsClause.js +2 -5
- package/dist/src/components/ImplementsClause.js +2 -5
- package/dist/src/components/ImportStatement.js +1 -2
- package/dist/src/components/Interface.js +2 -5
- package/dist/src/components/MavenProject.js +2 -6
- package/dist/src/components/Method.js +1 -2
- package/dist/src/components/Modifiers.js +1 -2
- package/dist/src/components/Name.js +1 -2
- package/dist/src/components/NamedArgumentList.js +2 -4
- package/dist/src/components/ObjectDeclaration.js +2 -4
- package/dist/src/components/PackageDirectory.js +2 -4
- package/dist/src/components/Parameters.js +1 -2
- package/dist/src/components/ProjectDirectory.js +2 -4
- package/dist/src/components/Reference.js +1 -2
- package/dist/src/components/SourceFile.js +2 -5
- package/dist/src/components/TypeArguments.js +2 -5
- package/dist/src/components/TypeParameters.js +2 -5
- package/dist/src/components/Value.js +1 -2
- package/dist/src/components/Variable.js +1 -2
- package/dist/src/components/index.js +1 -2
- package/dist/src/components/stc/index.js +1 -2
- package/dist/src/create-library.js +1 -2
- package/dist/src/index.js +1 -2
- package/dist/src/name-policy.js +1 -2
- package/dist/src/symbols/index.js +1 -2
- package/dist/src/symbols/java-output-symbol.js +1 -2
- package/dist/src/symbols/java-package-scope.js +1 -2
- package/dist/src/symbols/java-project-scope.js +1 -2
- package/dist/src/symbols/reference.js +1 -2
- package/dist/test/annotation.test.js +77 -0
- package/dist/test/class.test.js +164 -0
- package/dist/test/constructor.test.js +101 -0
- package/dist/test/enum.test.js +136 -0
- package/dist/test/externals.test.js +72 -0
- package/dist/test/interface.test.js +110 -0
- package/dist/test/maven.test.js +251 -0
- package/dist/test/method.test.js +270 -0
- package/dist/test/package.test.js +18 -0
- package/dist/test/reference.test.js +108 -0
- package/dist/test/type-arguments.test.js +83 -0
- package/dist/test/utils.js +61 -0
- package/dist/test/values.test.js +32 -0
- package/dist/test/variables.test.js +143 -0
- package/dist/test/vitest.d.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -17
- package/temp/api.json +1 -1
- package/tsdoc-metadata.json +1 -1
- package/babel.config.cjs +0 -4
- package/dist/src/builtins/index.js.map +0 -1
- package/dist/src/builtins/util.js.map +0 -1
- package/dist/src/components/Annotation.js.map +0 -1
- package/dist/src/components/ArgumentList.js.map +0 -1
- package/dist/src/components/Class.js.map +0 -1
- package/dist/src/components/Constructor.js.map +0 -1
- package/dist/src/components/Declaration.js.map +0 -1
- package/dist/src/components/Enum.js.map +0 -1
- package/dist/src/components/ExtendsClause.js.map +0 -1
- package/dist/src/components/ImplementsClause.js.map +0 -1
- package/dist/src/components/ImportStatement.js.map +0 -1
- package/dist/src/components/Interface.js.map +0 -1
- package/dist/src/components/MavenProject.js.map +0 -1
- package/dist/src/components/Method.js.map +0 -1
- package/dist/src/components/Modifiers.js.map +0 -1
- package/dist/src/components/Name.js.map +0 -1
- package/dist/src/components/NamedArgumentList.js.map +0 -1
- package/dist/src/components/ObjectDeclaration.js.map +0 -1
- package/dist/src/components/PackageDirectory.js.map +0 -1
- package/dist/src/components/Parameters.js.map +0 -1
- package/dist/src/components/ProjectDirectory.js.map +0 -1
- package/dist/src/components/Reference.js.map +0 -1
- package/dist/src/components/SourceFile.js.map +0 -1
- package/dist/src/components/TypeArguments.js.map +0 -1
- package/dist/src/components/TypeParameters.js.map +0 -1
- package/dist/src/components/Value.js.map +0 -1
- package/dist/src/components/Variable.js.map +0 -1
- package/dist/src/components/index.js.map +0 -1
- package/dist/src/components/stc/index.js.map +0 -1
- package/dist/src/create-library.js.map +0 -1
- package/dist/src/index.js.map +0 -1
- package/dist/src/name-policy.js.map +0 -1
- package/dist/src/symbols/index.js.map +0 -1
- package/dist/src/symbols/java-output-symbol.js.map +0 -1
- package/dist/src/symbols/java-package-scope.js.map +0 -1
- package/dist/src/symbols/java-project-scope.js.map +0 -1
- package/dist/src/symbols/reference.js.map +0 -1
- 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.11.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- [#105](https://github.com/alloy-framework/alloy/pull/105) Updated dependencies
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## 0.10.0
|
|
11
|
+
|
|
12
|
+
No changes, version bump only.
|
|
13
|
+
|
|
3
14
|
## 0.9.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
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -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);
|
package/dist/src/index.js
CHANGED
package/dist/src/name-policy.js
CHANGED
|
@@ -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
|
+
});
|