@descryy/adapter-kotlin 0.4.1 → 0.5.1
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/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +86 -14
- package/dist/adapter.js.map +1 -1
- package/dist/client-base.d.ts +114 -0
- package/dist/client-base.d.ts.map +1 -0
- package/dist/client-base.js +102 -0
- package/dist/client-base.js.map +1 -0
- package/dist/client.d.ts +23 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +207 -13
- package/dist/client.js.map +1 -1
- package/dist/external.d.ts +149 -0
- package/dist/external.d.ts.map +1 -0
- package/dist/external.js +226 -0
- package/dist/external.js.map +1 -0
- package/dist/extract.d.ts +34 -0
- package/dist/extract.d.ts.map +1 -1
- package/dist/extract.js +476 -47
- package/dist/extract.js.map +1 -1
- package/dist/jpa-reads.d.ts +26 -0
- package/dist/jpa-reads.d.ts.map +1 -0
- package/dist/jpa-reads.js +35 -0
- package/dist/jpa-reads.js.map +1 -0
- package/dist/jpa.d.ts +147 -0
- package/dist/jpa.d.ts.map +1 -0
- package/dist/jpa.js +415 -0
- package/dist/jpa.js.map +1 -0
- package/dist/parse.d.ts +44 -0
- package/dist/parse.d.ts.map +1 -1
- package/dist/parse.js +106 -9
- package/dist/parse.js.map +1 -1
- package/dist/retrofit.d.ts +12 -0
- package/dist/retrofit.d.ts.map +1 -1
- package/dist/retrofit.js +53 -0
- package/dist/retrofit.js.map +1 -1
- package/dist/routes.d.ts +15 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js.map +1 -1
- package/dist/serialization.d.ts +47 -0
- package/dist/serialization.d.ts.map +1 -0
- package/dist/serialization.js +55 -0
- package/dist/serialization.js.map +1 -0
- package/dist/shape-reach.d.ts +97 -0
- package/dist/shape-reach.d.ts.map +1 -0
- package/dist/shape-reach.js +156 -0
- package/dist/shape-reach.js.map +1 -0
- package/dist/spring.d.ts.map +1 -1
- package/dist/spring.js +28 -6
- package/dist/spring.js.map +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which resolution level this repository actually gets Kotlin to.
|
|
3
|
+
*
|
|
4
|
+
* **R3 on ORM-mapped shape facts, R2 on everything else** — a per-fact split,
|
|
5
|
+
* not a ceiling raised across the batch. `adapter-java` and `adapter-csharp`
|
|
6
|
+
* publish the same split on the same ground, and this file is Java's
|
|
7
|
+
* `shape-reach.ts` held to the same bar for the same reason.
|
|
8
|
+
*
|
|
9
|
+
* ## What is R3 here, and what is not
|
|
10
|
+
*
|
|
11
|
+
* R3 is "+ type checker (shapes)", and **no type checker runs here.** DEC-202
|
|
12
|
+
* is the precedent: *a declared schema is R3-grade because the declaration
|
|
13
|
+
* states the shape rather than inferring it.* A JPA mapping is exactly that,
|
|
14
|
+
* and it is the same mapping `adapter-java` already claims R3 on.
|
|
15
|
+
*
|
|
16
|
+
* Everything else Kotlin produces stays at R2 and is emitted at R2. Kotlin
|
|
17
|
+
* writes its package, its imports and its declared types down, so a reference
|
|
18
|
+
* resolves to a definition with no LSP and no compiler — that is name-and-path
|
|
19
|
+
* resolution, and no shape is checked by it.
|
|
20
|
+
*
|
|
21
|
+
* **Two fact kinds in this package reach 3**, both declared schema in
|
|
22
|
+
* DEC-202's sense rather than inferred shape: the mapped field shape on a
|
|
23
|
+
* `MODEL` (`extract.ts`, the only `SHAPE_LEVEL` there), and — since
|
|
24
|
+
* `DEC-NEXT-dto-shape-evidence-for-api-contracts` — a declaration's wire
|
|
25
|
+
* shape when it carries real kotlinx.serialization evidence
|
|
26
|
+
* (`serialization.ts`'s `@Serializable`, provenance-gated on a
|
|
27
|
+
* `kotlinx.serialization` import). Routes, client calls, Retrofit endpoints,
|
|
28
|
+
* type references, inheritance and test coverage all push at 2 or below and
|
|
29
|
+
* are unaffected. If a third fact kind ever earns R3, it is added here in the
|
|
30
|
+
* same commit that earns it — never inferred from the fact that some
|
|
31
|
+
* extractor exists.
|
|
32
|
+
*
|
|
33
|
+
* ## Why a count of shapes and not a density
|
|
34
|
+
*
|
|
35
|
+
* `adapter-python` gates its R3 on measured annotation density, because
|
|
36
|
+
* Python's R3 comes from annotations spread across ordinary code and "enough
|
|
37
|
+
* of them" is a real question with a distribution behind it. Kotlin's comes
|
|
38
|
+
* from a mapping that is either declared or is not, so there is no density to
|
|
39
|
+
* measure and a threshold would be a number with nothing under it.
|
|
40
|
+
*
|
|
41
|
+
* ## What a refusal does to the level
|
|
42
|
+
*
|
|
43
|
+
* A refused shape (`jpa.ts`'s four completeness gates) counts for **nothing**
|
|
44
|
+
* here. An entity whose shape was withheld is an entity this run read no shape
|
|
45
|
+
* from, so a repository whose every entity is refused publishes R2 — the same
|
|
46
|
+
* level it would publish with no entity at all, which is the honest answer.
|
|
47
|
+
*
|
|
48
|
+
* ## What this does NOT do
|
|
49
|
+
*
|
|
50
|
+
* It does not mint `DATABASE_TABLE`/`DATABASE_COLUMN`. The physical column
|
|
51
|
+
* name is decided by a *configurable* naming strategy (Spring Boot's
|
|
52
|
+
* camel-to-snake, plain Hibernate's implicit strategy as-written) that no
|
|
53
|
+
* source file states — `discountCode` in the entity against `discount_code`
|
|
54
|
+
* in the migration, measured on this corpus. Minting from the class would
|
|
55
|
+
* mint ids that do not join with `adapter-sql`'s for the same table (DEC-240).
|
|
56
|
+
* Precision over recall: the shape is claimed, the physical schema is not.
|
|
57
|
+
*/
|
|
58
|
+
import type { ResolutionLevel } from "@descryy/ir";
|
|
59
|
+
import { type JpaModel, type JpaRefusal } from "./jpa.ts";
|
|
60
|
+
import type { KotlinFile } from "./parse.ts";
|
|
61
|
+
/**
|
|
62
|
+
* The one level `adapter-kotlin` can reach that R2 machinery cannot supply,
|
|
63
|
+
* and the one place in this package that mints at it.
|
|
64
|
+
*/
|
|
65
|
+
export declare const SHAPE_LEVEL: ResolutionLevel;
|
|
66
|
+
export interface ShapeReach {
|
|
67
|
+
/** `identityPackage::path` -> the model, handed on so the caller never pays twice. */
|
|
68
|
+
readonly entities: ReadonlyMap<string, JpaModel>;
|
|
69
|
+
/** Shapes withheld by a completeness gate, for disclosure. */
|
|
70
|
+
readonly refusals: readonly (JpaRefusal & {
|
|
71
|
+
readonly file: string;
|
|
72
|
+
})[];
|
|
73
|
+
/**
|
|
74
|
+
* Entities carrying at least one mapped column whose shape this run actually
|
|
75
|
+
* decided — the exact condition `extract.ts` uses before writing
|
|
76
|
+
* `attrs.fields`, so this cannot drift into counting a shape never emitted.
|
|
77
|
+
*/
|
|
78
|
+
readonly mappedShapes: number;
|
|
79
|
+
/** True when at least one fact in this repository genuinely rests on R3. */
|
|
80
|
+
readonly reachesShapes: boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Read every entity in the batch, resolving supertypes across files.
|
|
84
|
+
*
|
|
85
|
+
* Resolution is by the *written* package: a single-type import names the
|
|
86
|
+
* parent's package outright, and an unqualified name otherwise means this
|
|
87
|
+
* file's own package. **Two declarations answering to one key make the name
|
|
88
|
+
* ambiguous, and an ambiguous parent resolves to nothing** — which routes
|
|
89
|
+
* straight into `jpa.ts`'s E1 refusal rather than picking a winner.
|
|
90
|
+
*/
|
|
91
|
+
export declare function readEntities(units: readonly KotlinFile[]): ShapeReach;
|
|
92
|
+
/**
|
|
93
|
+
* The level to publish for a run: never above the caller's ceiling, never
|
|
94
|
+
* above what the repository supplied, and 0 when nothing anchored at all.
|
|
95
|
+
*/
|
|
96
|
+
export declare function reachedFor(ceiling: ResolutionLevel, anchoredAnything: boolean, reach: ShapeReach | undefined): ResolutionLevel;
|
|
97
|
+
//# sourceMappingURL=shape-reach.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape-reach.d.ts","sourceRoot":"","sources":["../src/shape-reach.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAa,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAgB,MAAM,UAAU,CAAC;AACnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAG7C;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,eAAmB,CAAC;AAE9C,MAAM,WAAW,UAAU;IACzB,sFAAsF;IACtF,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACjD,8DAA8D;IAC9D,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,UAAU,GAAG;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IACvE;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,4EAA4E;IAC5E,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC;AAID;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,GAAG,UAAU,CAgErE;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,eAAe,EACxB,gBAAgB,EAAE,OAAO,EACzB,KAAK,EAAE,UAAU,GAAG,SAAS,GAC5B,eAAe,CAIjB"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which resolution level this repository actually gets Kotlin to.
|
|
3
|
+
*
|
|
4
|
+
* **R3 on ORM-mapped shape facts, R2 on everything else** — a per-fact split,
|
|
5
|
+
* not a ceiling raised across the batch. `adapter-java` and `adapter-csharp`
|
|
6
|
+
* publish the same split on the same ground, and this file is Java's
|
|
7
|
+
* `shape-reach.ts` held to the same bar for the same reason.
|
|
8
|
+
*
|
|
9
|
+
* ## What is R3 here, and what is not
|
|
10
|
+
*
|
|
11
|
+
* R3 is "+ type checker (shapes)", and **no type checker runs here.** DEC-202
|
|
12
|
+
* is the precedent: *a declared schema is R3-grade because the declaration
|
|
13
|
+
* states the shape rather than inferring it.* A JPA mapping is exactly that,
|
|
14
|
+
* and it is the same mapping `adapter-java` already claims R3 on.
|
|
15
|
+
*
|
|
16
|
+
* Everything else Kotlin produces stays at R2 and is emitted at R2. Kotlin
|
|
17
|
+
* writes its package, its imports and its declared types down, so a reference
|
|
18
|
+
* resolves to a definition with no LSP and no compiler — that is name-and-path
|
|
19
|
+
* resolution, and no shape is checked by it.
|
|
20
|
+
*
|
|
21
|
+
* **Two fact kinds in this package reach 3**, both declared schema in
|
|
22
|
+
* DEC-202's sense rather than inferred shape: the mapped field shape on a
|
|
23
|
+
* `MODEL` (`extract.ts`, the only `SHAPE_LEVEL` there), and — since
|
|
24
|
+
* `DEC-NEXT-dto-shape-evidence-for-api-contracts` — a declaration's wire
|
|
25
|
+
* shape when it carries real kotlinx.serialization evidence
|
|
26
|
+
* (`serialization.ts`'s `@Serializable`, provenance-gated on a
|
|
27
|
+
* `kotlinx.serialization` import). Routes, client calls, Retrofit endpoints,
|
|
28
|
+
* type references, inheritance and test coverage all push at 2 or below and
|
|
29
|
+
* are unaffected. If a third fact kind ever earns R3, it is added here in the
|
|
30
|
+
* same commit that earns it — never inferred from the fact that some
|
|
31
|
+
* extractor exists.
|
|
32
|
+
*
|
|
33
|
+
* ## Why a count of shapes and not a density
|
|
34
|
+
*
|
|
35
|
+
* `adapter-python` gates its R3 on measured annotation density, because
|
|
36
|
+
* Python's R3 comes from annotations spread across ordinary code and "enough
|
|
37
|
+
* of them" is a real question with a distribution behind it. Kotlin's comes
|
|
38
|
+
* from a mapping that is either declared or is not, so there is no density to
|
|
39
|
+
* measure and a threshold would be a number with nothing under it.
|
|
40
|
+
*
|
|
41
|
+
* ## What a refusal does to the level
|
|
42
|
+
*
|
|
43
|
+
* A refused shape (`jpa.ts`'s four completeness gates) counts for **nothing**
|
|
44
|
+
* here. An entity whose shape was withheld is an entity this run read no shape
|
|
45
|
+
* from, so a repository whose every entity is refused publishes R2 — the same
|
|
46
|
+
* level it would publish with no entity at all, which is the honest answer.
|
|
47
|
+
*
|
|
48
|
+
* ## What this does NOT do
|
|
49
|
+
*
|
|
50
|
+
* It does not mint `DATABASE_TABLE`/`DATABASE_COLUMN`. The physical column
|
|
51
|
+
* name is decided by a *configurable* naming strategy (Spring Boot's
|
|
52
|
+
* camel-to-snake, plain Hibernate's implicit strategy as-written) that no
|
|
53
|
+
* source file states — `discountCode` in the entity against `discount_code`
|
|
54
|
+
* in the migration, measured on this corpus. Minting from the class would
|
|
55
|
+
* mint ids that do not join with `adapter-sql`'s for the same table (DEC-240).
|
|
56
|
+
* Precision over recall: the shape is claimed, the physical schema is not.
|
|
57
|
+
*/
|
|
58
|
+
import { jpaModels } from "./jpa.js";
|
|
59
|
+
import { hasSerializationEvidence } from "./serialization.js";
|
|
60
|
+
/**
|
|
61
|
+
* The one level `adapter-kotlin` can reach that R2 machinery cannot supply,
|
|
62
|
+
* and the one place in this package that mints at it.
|
|
63
|
+
*/
|
|
64
|
+
export const SHAPE_LEVEL = 3;
|
|
65
|
+
const pathKey = (identityPackage, path) => `${identityPackage}::${path.join(".")}`;
|
|
66
|
+
/**
|
|
67
|
+
* Read every entity in the batch, resolving supertypes across files.
|
|
68
|
+
*
|
|
69
|
+
* Resolution is by the *written* package: a single-type import names the
|
|
70
|
+
* parent's package outright, and an unqualified name otherwise means this
|
|
71
|
+
* file's own package. **Two declarations answering to one key make the name
|
|
72
|
+
* ambiguous, and an ambiguous parent resolves to nothing** — which routes
|
|
73
|
+
* straight into `jpa.ts`'s E1 refusal rather than picking a winner.
|
|
74
|
+
*/
|
|
75
|
+
export function readEntities(units) {
|
|
76
|
+
const byFqn = new Map();
|
|
77
|
+
for (const unit of units) {
|
|
78
|
+
for (const declaration of unit.jpaDeclarations) {
|
|
79
|
+
const fqn = `${unit.packageName}.${[...declaration.owners, declaration.name].join(".")}`;
|
|
80
|
+
const bucket = byFqn.get(fqn);
|
|
81
|
+
if (bucket === undefined)
|
|
82
|
+
byFqn.set(fqn, [{ unit, declaration }]);
|
|
83
|
+
else
|
|
84
|
+
bucket.push({ unit, declaration });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const entities = new Map();
|
|
88
|
+
const refusals = [];
|
|
89
|
+
for (const unit of units) {
|
|
90
|
+
if (unit.identityPackage === undefined || unit.jpaDeclarations.length === 0)
|
|
91
|
+
continue;
|
|
92
|
+
const importedFqn = new Map();
|
|
93
|
+
for (const each of unit.imports) {
|
|
94
|
+
if (each.isWildcard)
|
|
95
|
+
continue;
|
|
96
|
+
importedFqn.set(each.alias ?? each.path.slice(each.path.lastIndexOf(".") + 1), each.path);
|
|
97
|
+
}
|
|
98
|
+
const jpaUnit = { packageName: unit.packageName, jpaDeclarations: unit.jpaDeclarations };
|
|
99
|
+
const { models, refusals: refused } = jpaModels(jpaUnit, (written, from) => {
|
|
100
|
+
const fqn = importedFqn.get(written) ?? `${from.packageName}.${written}`;
|
|
101
|
+
const found = byFqn.get(fqn);
|
|
102
|
+
// One candidate or none. Two is an ambiguity this adapter cannot settle.
|
|
103
|
+
if (found === undefined || found.length !== 1)
|
|
104
|
+
return undefined;
|
|
105
|
+
const [only] = found;
|
|
106
|
+
if (only === undefined)
|
|
107
|
+
return undefined;
|
|
108
|
+
return {
|
|
109
|
+
declaration: only.declaration,
|
|
110
|
+
unit: { packageName: only.unit.packageName, jpaDeclarations: only.unit.jpaDeclarations },
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
for (const model of models)
|
|
114
|
+
entities.set(pathKey(unit.identityPackage, [...model.owners, model.className]), model);
|
|
115
|
+
for (const refusal of refused)
|
|
116
|
+
refusals.push({ ...refusal, file: unit.file });
|
|
117
|
+
}
|
|
118
|
+
let mappedShapes = 0;
|
|
119
|
+
for (const model of entities.values())
|
|
120
|
+
if (model.fields.length > 0)
|
|
121
|
+
mappedShapes += 1;
|
|
122
|
+
// The second R3 fact kind (see module header): does at least one
|
|
123
|
+
// declaration carry real kotlinx.serialization evidence? A `MODEL` is
|
|
124
|
+
// excluded (`entities.has(key)`) — the same narrower-evidence-wins
|
|
125
|
+
// tie-break `extract.ts`'s node-kind decision uses, kept here so this
|
|
126
|
+
// count can never disagree with what `responseShapeEvidence` would emit.
|
|
127
|
+
let serializationReach = false;
|
|
128
|
+
for (const unit of units) {
|
|
129
|
+
if (unit.identityPackage === undefined)
|
|
130
|
+
continue;
|
|
131
|
+
for (const decl of unit.decls) {
|
|
132
|
+
const key = pathKey(unit.identityPackage, [...decl.owners, decl.name]);
|
|
133
|
+
if (entities.has(key))
|
|
134
|
+
continue;
|
|
135
|
+
if (hasSerializationEvidence(unit, decl)) {
|
|
136
|
+
serializationReach = true;
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (serializationReach)
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
return { entities, refusals, mappedShapes, reachesShapes: mappedShapes > 0 || serializationReach };
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* The level to publish for a run: never above the caller's ceiling, never
|
|
147
|
+
* above what the repository supplied, and 0 when nothing anchored at all.
|
|
148
|
+
*/
|
|
149
|
+
export function reachedFor(ceiling, anchoredAnything, reach) {
|
|
150
|
+
if (!anchoredAnything)
|
|
151
|
+
return 0;
|
|
152
|
+
if (ceiling < SHAPE_LEVEL)
|
|
153
|
+
return ceiling;
|
|
154
|
+
return reach?.reachesShapes === true ? ceiling : Math.min(2, ceiling);
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=shape-reach.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape-reach.js","sourceRoot":"","sources":["../src/shape-reach.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAIH,OAAO,EAAE,SAAS,EAAgD,MAAM,UAAU,CAAC;AAEnF,OAAO,EAAE,wBAAwB,E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7B,IAAI,CAAC,gBAAgB;QAAE,OAAO,CAAC,CAAC;IAChC,IAAI,OAAO,GAAG,WAAW;QAAE,OAAO,OAAO,CAAC;IAC1C,OAAO,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAqB,CAAC;AAC7F,CAAC"}
|
package/dist/spring.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spring.d.ts","sourceRoot":"","sources":["../src/spring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAkJ/C,qEAAqE;AACrE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"spring.d.ts","sourceRoot":"","sources":["../src/spring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAkJ/C,qEAAqE;AACrE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,WAAW,EAAE,CAmFrG"}
|
package/dist/spring.js
CHANGED
|
@@ -160,19 +160,29 @@ export function readSpringRoutes(root, imports) {
|
|
|
160
160
|
if (!importsSpring(imports))
|
|
161
161
|
return [];
|
|
162
162
|
const routes = [];
|
|
163
|
-
|
|
163
|
+
// `owners` mirrors `parse.ts`'s own `Scope.owners` walk — the same class-name-chain
|
|
164
|
+
// accumulation `extract.ts` used to key every FUNCTION node in `funcsByKey`, so a handler
|
|
165
|
+
// found here resolves through the identical key rather than a second naming scheme.
|
|
166
|
+
const walkClasses = (node, owners) => {
|
|
164
167
|
for (const child of namedChildren(node)) {
|
|
165
168
|
if (child.type !== "class_declaration" && child.type !== "object_declaration") {
|
|
166
169
|
if (child.namedChildCount > 0)
|
|
167
|
-
walkClasses(child);
|
|
170
|
+
walkClasses(child, owners);
|
|
168
171
|
continue;
|
|
169
172
|
}
|
|
173
|
+
// An unnamed class/object cannot be placed in the owner chain. `parse.ts` refuses the
|
|
174
|
+
// same way (`if (name === undefined) break`) rather than fabricate a path segment that
|
|
175
|
+
// would never match a real FUNCTION node's own key.
|
|
176
|
+
const className = firstOfType(child, "type_identifier")?.text;
|
|
177
|
+
if (className === undefined)
|
|
178
|
+
continue;
|
|
179
|
+
const innerOwners = [...owners, className];
|
|
170
180
|
const classAnnotations = annotationsOf(child);
|
|
171
181
|
const kind = controllerKind(classAnnotations);
|
|
172
182
|
const body = namedChildren(child).find((c) => c.type === "class_body" || c.type === "enum_class_body");
|
|
173
183
|
if (kind === null) {
|
|
174
184
|
if (body !== undefined)
|
|
175
|
-
walkClasses(body);
|
|
185
|
+
walkClasses(body, innerOwners);
|
|
176
186
|
continue;
|
|
177
187
|
}
|
|
178
188
|
const classMapping = mappingOf(classAnnotations);
|
|
@@ -195,13 +205,25 @@ export function readSpringRoutes(root, imports) {
|
|
|
195
205
|
if (unreadable)
|
|
196
206
|
continue;
|
|
197
207
|
const parts = suffixes.length > 0 ? suffixes : [""];
|
|
208
|
+
// The annotated method IS the handler — no lambda dispatch to resolve, unlike Ktor.
|
|
209
|
+
// Defensively absent when this reader can't read the function's own name back, which
|
|
210
|
+
// leaves the route real but its handler edge unestablished rather than guessed.
|
|
211
|
+
const fnName = firstOfType(fn, "simple_identifier")?.text;
|
|
212
|
+
const handler = fnName === undefined ? undefined : { owners: innerOwners, name: fnName };
|
|
198
213
|
for (const prefix of prefixes) {
|
|
199
214
|
for (const suffix of parts) {
|
|
200
215
|
const template = join(prefix, suffix);
|
|
201
216
|
if (!template.startsWith("/"))
|
|
202
217
|
continue;
|
|
203
218
|
for (const verb of verbsOf(mapping)) {
|
|
204
|
-
routes.push({
|
|
219
|
+
routes.push({
|
|
220
|
+
method: verb,
|
|
221
|
+
template,
|
|
222
|
+
written: `@${mapping.name}`,
|
|
223
|
+
framework: "spring",
|
|
224
|
+
line: mapping.line,
|
|
225
|
+
...(handler === undefined ? {} : { handler }),
|
|
226
|
+
});
|
|
205
227
|
}
|
|
206
228
|
}
|
|
207
229
|
}
|
|
@@ -210,10 +232,10 @@ export function readSpringRoutes(root, imports) {
|
|
|
210
232
|
// never nests a controller, but an unrelated nested type in the same
|
|
211
233
|
// file must not be silently skipped.
|
|
212
234
|
if (body !== undefined)
|
|
213
|
-
walkClasses(body);
|
|
235
|
+
walkClasses(body, innerOwners);
|
|
214
236
|
}
|
|
215
237
|
};
|
|
216
|
-
walkClasses(root);
|
|
238
|
+
walkClasses(root, []);
|
|
217
239
|
return routes;
|
|
218
240
|
}
|
|
219
241
|
//# sourceMappingURL=spring.js.map
|
package/dist/spring.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spring.js","sourceRoot":"","sources":["../src/spring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAOH,MAAM,aAAa,GAAG,CAAC,IAAU,EAAU,EAAE;IAC3C,MAAM,GAAG,GAAW,EAAE,CAAC;IACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACjD,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,C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,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gBAEzF,KAAK,MAAM,MAAM,IAAI,QAAQ,EAAE,CAAC;oBAC9B,KAAK,MAAM,MAAM,IAAI,KAAK,EAAE,CAAC;wBAC3B,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;wBACtC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC;4BAAE,SAAS;wBACxC,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;4BACpC,MAAM,CAAC,IAAI,CAAC;gCACV,MAAM,EAAE,IAAI;gCACZ,QAAQ;gCACR,OAAO,EAAE,IAAI,OAAO,CAAC,IAAI,EAAE;gCAC3B,SAAS,EAAE,QAAQ;gCACnB,IAAI,EAAE,OAAO,CAAC,IAAI;gCAClB,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC;6BAC9C,CAAC,CAAC;wBACL,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;YAED,uEAAuE;YACvE,qEAAqE;YACrE,qCAAqC;YACrC,IAAI,IAAI,KAAK,SAAS;gBAAE,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACzD,CAAC;IACH,CAAC,CAAC;IACF,WAAW,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAEtB,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@descryy/adapter-kotlin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Kotlin adapter, breadth tier. The tenth language, and the first to share an identity anchor with another language rather than defining its own — it reuses @descryy/adapter-jvm, because Kotlin and Java answer the identity question the same way. Where a file does not sit where its package declaration says, the node is refused rather than anchored on the package alone: Kotlin Multiplatform declares one qualified name in several source sets by design, and a bare-package fallback collapses them onto one id.",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"build:assets": "node ../../scripts/install-grammar.mjs"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@descryy/adapter-common": "0.3.
|
|
38
|
-
"@descryy/adapter-jvm": "0.1.
|
|
39
|
-
"@descryy/adapter-openapi": "0.
|
|
40
|
-
"@descryy/adapter-sql": "0.
|
|
41
|
-
"@descryy/adapter-treesitter": "0.2.
|
|
42
|
-
"@descryy/ir": "0.
|
|
37
|
+
"@descryy/adapter-common": "0.3.1",
|
|
38
|
+
"@descryy/adapter-jvm": "0.1.1",
|
|
39
|
+
"@descryy/adapter-openapi": "0.5.1",
|
|
40
|
+
"@descryy/adapter-sql": "0.5.1",
|
|
41
|
+
"@descryy/adapter-treesitter": "0.2.1",
|
|
42
|
+
"@descryy/ir": "0.10.0"
|
|
43
43
|
}
|
|
44
44
|
}
|