@ir-kit/codegen-core 0.1.0 → 0.2.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/README.md +1 -1
- package/dist/identifiers.d.ts +6 -0
- package/dist/identifiers.d.ts.map +1 -1
- package/dist/identifiers.js +13 -0
- package/dist/identifiers.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/namespace.d.ts +34 -0
- package/dist/namespace.d.ts.map +1 -0
- package/dist/namespace.js +40 -0
- package/dist/namespace.js.map +1 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -51,4 +51,4 @@ defaultProjectName("./out/petstore-sdk"); // "petstore-sdk"
|
|
|
51
51
|
|
|
52
52
|
## Repo
|
|
53
53
|
|
|
54
|
-
Source at [
|
|
54
|
+
Source at [ahmedrowaihi/ir-kit](https://github.com/ahmedrowaihi/ir-kit/tree/main/packages/shared/codegen-core).
|
package/dist/identifiers.d.ts
CHANGED
|
@@ -48,4 +48,10 @@ export declare function escapeIfReserved(name: string, reserved: ReadonlySet<str
|
|
|
48
48
|
* pascal regex over the joined string.
|
|
49
49
|
*/
|
|
50
50
|
export declare function synthName(owner: string, path: ReadonlyArray<string>): string;
|
|
51
|
+
/**
|
|
52
|
+
* PascalCase that keeps `_` as a word separator (`Owner_Path` stays
|
|
53
|
+
* intact) while collapsing every other non-alphanumeric run. Leading
|
|
54
|
+
* digits get a `_` prefix. Empty results become `"Empty"`.
|
|
55
|
+
*/
|
|
56
|
+
export declare function typeIdent(s: string): string;
|
|
51
57
|
//# sourceMappingURL=identifiers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identifiers.d.ts","sourceRoot":"","sources":["../src/identifiers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAA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MAAM,CAEnD;AAED;;;+BAG+B;AAC/B,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,EAC7B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAC/B,MAAM,CAER;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAE5E;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAO3C"}
|
package/dist/identifiers.js
CHANGED
|
@@ -69,4 +69,17 @@ export function escapeIfReserved(name, reserved, escape) {
|
|
|
69
69
|
export function synthName(owner, path) {
|
|
70
70
|
return [owner, ...path.map(pascal)].join("_");
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* PascalCase that keeps `_` as a word separator (`Owner_Path` stays
|
|
74
|
+
* intact) while collapsing every other non-alphanumeric run. Leading
|
|
75
|
+
* digits get a `_` prefix. Empty results become `"Empty"`.
|
|
76
|
+
*/
|
|
77
|
+
export function typeIdent(s) {
|
|
78
|
+
const p = s
|
|
79
|
+
.replace(/^[^a-zA-Z0-9_]+/, "")
|
|
80
|
+
.replace(/[^a-zA-Z0-9_]+$/, "")
|
|
81
|
+
.replace(/[^a-zA-Z0-9_]+(.)/g, (_, c) => c.toUpperCase())
|
|
82
|
+
.replace(/^./, (c) => c.toUpperCase());
|
|
83
|
+
return avoidLeadingDigit(p) || "Empty";
|
|
84
|
+
}
|
|
72
85
|
//# sourceMappingURL=identifiers.js.map
|
package/dist/identifiers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identifiers.js","sourceRoot":"","sources":["../src/identifiers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,MAAM,CAAC,CAAS;IAC9B,OAAO,C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,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IACzC,OAAO,iBAAiB,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC;AACzC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { assertSafeOutputDir, defaultProjectName } from "./fs.js";
|
|
2
|
-
export { avoidLeadingDigit, camel, escapeIfReserved, pascal, safeCaseName, safeIdent, softCamel, synthName, } from "./identifiers.js";
|
|
2
|
+
export { avoidLeadingDigit, camel, escapeIfReserved, pascal, safeCaseName, safeIdent, softCamel, synthName, typeIdent, } from "./identifiers.js";
|
|
3
|
+
export { Namespace, type NamingPolicy } from "./namespace.js";
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EACL,iBAAiB,EACjB,KAAK,EACL,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,SAAS,EACT,SAAS,EACT,SAAS,GACV,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EACL,iBAAiB,EACjB,KAAK,EACL,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { assertSafeOutputDir, defaultProjectName } from "./fs.js";
|
|
2
|
-
export { avoidLeadingDigit, camel, escapeIfReserved, pascal, safeCaseName, safeIdent, softCamel, synthName, } from "./identifiers.js";
|
|
2
|
+
export { avoidLeadingDigit, camel, escapeIfReserved, pascal, safeCaseName, safeIdent, softCamel, synthName, typeIdent, } from "./identifiers.js";
|
|
3
|
+
export { Namespace } from "./namespace.js";
|
|
3
4
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EACL,iBAAiB,EACjB,KAAK,EACL,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,SAAS,EACT,SAAS,EACT,SAAS,GACV,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EACL,iBAAiB,EACjB,KAAK,EACL,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAqB,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Target-specific rules for turning a source string into an identifier
|
|
3
|
+
* and resolving clashes. A {@link Namespace} applies one policy to every
|
|
4
|
+
* name it hands out, so declaration and reference sites can never
|
|
5
|
+
* disagree on spelling.
|
|
6
|
+
*/
|
|
7
|
+
export interface NamingPolicy {
|
|
8
|
+
/** Source string → candidate identifier. Must be deterministic. */
|
|
9
|
+
normalize(raw: string): string;
|
|
10
|
+
/** n-th alternative (n ≥ 2) when `base` is already owned by another
|
|
11
|
+
* key. Default: `${base}${n}`. */
|
|
12
|
+
disambiguate?(base: string, n: number): string;
|
|
13
|
+
/** Identifiers that are never handed out (keywords, runtime decls). */
|
|
14
|
+
reserved?: ReadonlySet<string>;
|
|
15
|
+
/** Treat names differing only by case as clashing. */
|
|
16
|
+
foldCase?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Owns a set of identifiers. Each name is claimed by a semantic key
|
|
20
|
+
* (`schema:Pet`, `synth:Pet/status`, a raw enum value, …). Claiming is
|
|
21
|
+
* idempotent per key, and two keys never receive the same name — clashes
|
|
22
|
+
* are resolved deterministically via the policy instead of throwing.
|
|
23
|
+
*/
|
|
24
|
+
export declare class Namespace {
|
|
25
|
+
#private;
|
|
26
|
+
readonly policy: NamingPolicy;
|
|
27
|
+
constructor(policy: NamingPolicy);
|
|
28
|
+
/** Resolve `key` to its identifier, claiming `raw` (normalized) on
|
|
29
|
+
* first sight. Later calls with the same key return the same name
|
|
30
|
+
* whatever `raw` they pass. */
|
|
31
|
+
claim(key: string, raw?: string): string;
|
|
32
|
+
get(key: string): string | undefined;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=namespace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../src/namespace.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,mEAAmE;IACnE,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B;uCACmC;IACnC,YAAY,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/C,uEAAuE;IACvE,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/B,sDAAsD;IACtD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;GAKG;AACH,qBAAa,SAAS;;IAIR,QAAQ,CAAC,MAAM,EAAE,YAAY;gBAApB,MAAM,EAAE,YAAY;IAIzC;;oCAEgC;IAChC,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,GAAE,MAAY,GAAG,MAAM;IAe7C,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAOrC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Owns a set of identifiers. Each name is claimed by a semantic key
|
|
3
|
+
* (`schema:Pet`, `synth:Pet/status`, a raw enum value, …). Claiming is
|
|
4
|
+
* idempotent per key, and two keys never receive the same name — clashes
|
|
5
|
+
* are resolved deterministically via the policy instead of throwing.
|
|
6
|
+
*/
|
|
7
|
+
export class Namespace {
|
|
8
|
+
policy;
|
|
9
|
+
#byKey = new Map();
|
|
10
|
+
#taken = new Set();
|
|
11
|
+
constructor(policy) {
|
|
12
|
+
this.policy = policy;
|
|
13
|
+
for (const r of policy.reserved ?? [])
|
|
14
|
+
this.#taken.add(this.#fold(r));
|
|
15
|
+
}
|
|
16
|
+
/** Resolve `key` to its identifier, claiming `raw` (normalized) on
|
|
17
|
+
* first sight. Later calls with the same key return the same name
|
|
18
|
+
* whatever `raw` they pass. */
|
|
19
|
+
claim(key, raw = key) {
|
|
20
|
+
const existing = this.#byKey.get(key);
|
|
21
|
+
if (existing !== undefined)
|
|
22
|
+
return existing;
|
|
23
|
+
const base = this.policy.normalize(raw);
|
|
24
|
+
const disambiguate = this.policy.disambiguate ?? ((b, n) => `${b}${n}`);
|
|
25
|
+
let name = base;
|
|
26
|
+
for (let n = 2; this.#taken.has(this.#fold(name)); n++) {
|
|
27
|
+
name = disambiguate(base, n);
|
|
28
|
+
}
|
|
29
|
+
this.#taken.add(this.#fold(name));
|
|
30
|
+
this.#byKey.set(key, name);
|
|
31
|
+
return name;
|
|
32
|
+
}
|
|
33
|
+
get(key) {
|
|
34
|
+
return this.#byKey.get(key);
|
|
35
|
+
}
|
|
36
|
+
#fold(name) {
|
|
37
|
+
return this.policy.foldCase ? name.toLowerCase() : name;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=namespace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namespace.js","sourceRoot":"","sources":["../src/namespace.ts"],"names":[],"mappings":"AAkBA;;;;;GAKG;AACH,MAAM,OAAO,SAAS;IAIC;IAHZ,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACnC,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IAEpC,YAAqB,MAAoB;QAApB,WAAM,GAAN,MAAM,CAAc;QACvC,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,IAAI,EAAE;YAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACxE,CAAC;IAED;;oCAEgC;IAChC,KAAK,CAAC,GAAW,EAAE,MAAc,GAAG;QAClC,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACtC,IAAI,QAAQ,KAAK,SAAS;YAAE,OAAO,QAAQ,CAAC;QAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACxC,MAAM,YAAY,GAChB,IAAI,CAAC,MAAM,CAAC,YAAY,IAAI,CAAC,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACrE,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YACvD,IAAI,GAAG,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAC/B,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QAClC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,GAAG,CAAC,GAAW;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,IAAY;QAChB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1D,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ir-kit/codegen-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Spec-agnostic codegen primitives shared by OpenAPI and AsyncAPI generator families — identifier transforms (pascal/camel/safeIdent), filesystem safety, project-name derivation. Pure functions, no spec dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"codegen",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"shared",
|
|
11
11
|
"identifiers"
|
|
12
12
|
],
|
|
13
|
-
"homepage": "https://github.com/
|
|
13
|
+
"homepage": "https://github.com/ahmedrowaihi/ir-kit/tree/main/packages/shared/codegen-core",
|
|
14
14
|
"bugs": {
|
|
15
|
-
"url": "https://github.com/
|
|
15
|
+
"url": "https://github.com/ahmedrowaihi/ir-kit/issues"
|
|
16
16
|
},
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"author": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
|
24
|
-
"url": "git+https://github.com/
|
|
24
|
+
"url": "git+https://github.com/ahmedrowaihi/ir-kit.git",
|
|
25
25
|
"directory": "packages/shared/codegen-core"
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|