@wild-framework/cli 0.1.1 → 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/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +109 -5
- package/dist/cli.js.map +1 -1
- package/dist/client/codegen.d.ts +32 -0
- package/dist/client/codegen.d.ts.map +1 -0
- package/dist/client/codegen.js +94 -0
- package/dist/client/codegen.js.map +1 -0
- package/dist/client/command.d.ts +29 -0
- package/dist/client/command.d.ts.map +1 -0
- package/dist/client/command.js +95 -0
- package/dist/client/command.js.map +1 -0
- package/dist/client/contract.d.ts +86 -0
- package/dist/client/contract.d.ts.map +1 -0
- package/dist/client/contract.js +12 -0
- package/dist/client/contract.js.map +1 -0
- package/dist/client/core.d.ts +80 -0
- package/dist/client/core.d.ts.map +1 -0
- package/dist/client/core.js +52 -0
- package/dist/client/core.js.map +1 -0
- package/dist/client/fs-writer.d.ts +13 -0
- package/dist/client/fs-writer.d.ts.map +1 -0
- package/dist/client/fs-writer.js +24 -0
- package/dist/client/fs-writer.js.map +1 -0
- package/dist/client/inspector.d.ts +19 -0
- package/dist/client/inspector.d.ts.map +1 -0
- package/dist/client/inspector.js +71 -0
- package/dist/client/inspector.js.map +1 -0
- package/dist/client/spec.d.ts +13 -0
- package/dist/client/spec.d.ts.map +1 -0
- package/dist/client/spec.js +235 -0
- package/dist/client/spec.js.map +1 -0
- package/dist/client/targets/index.d.ts +9 -0
- package/dist/client/targets/index.d.ts.map +1 -0
- package/dist/client/targets/index.js +11 -0
- package/dist/client/targets/index.js.map +1 -0
- package/dist/client/targets/react.d.ts +20 -0
- package/dist/client/targets/react.d.ts.map +1 -0
- package/dist/client/targets/react.js +519 -0
- package/dist/client/targets/react.js.map +1 -0
- package/dist/commands/ci.d.ts +5 -0
- package/dist/commands/ci.d.ts.map +1 -0
- package/dist/commands/ci.js +254 -0
- package/dist/commands/ci.js.map +1 -0
- package/dist/commands/db.d.ts +13 -0
- package/dist/commands/db.d.ts.map +1 -0
- package/dist/commands/db.js +104 -0
- package/dist/commands/db.js.map +1 -0
- package/dist/commands/docker.d.ts +9 -0
- package/dist/commands/docker.d.ts.map +1 -0
- package/dist/commands/docker.js +175 -0
- package/dist/commands/docker.js.map +1 -0
- package/dist/commands/graph.d.ts +9 -0
- package/dist/commands/graph.d.ts.map +1 -0
- package/dist/commands/graph.js +36 -0
- package/dist/commands/graph.js.map +1 -0
- package/dist/commands/make.d.ts +1 -1
- package/dist/commands/make.d.ts.map +1 -1
- package/dist/commands/make.js +51 -0
- package/dist/commands/make.js.map +1 -1
- package/dist/commands/new.d.ts +24 -0
- package/dist/commands/new.d.ts.map +1 -0
- package/dist/commands/new.js +374 -0
- package/dist/commands/new.js.map +1 -0
- package/dist/commands/resource.d.ts +33 -0
- package/dist/commands/resource.d.ts.map +1 -0
- package/dist/commands/resource.js +291 -0
- package/dist/commands/resource.js.map +1 -0
- package/dist/frontend/codegen.d.ts +27 -0
- package/dist/frontend/codegen.d.ts.map +1 -0
- package/dist/frontend/codegen.js +97 -0
- package/dist/frontend/codegen.js.map +1 -0
- package/dist/frontend/command.d.ts +22 -0
- package/dist/frontend/command.d.ts.map +1 -0
- package/dist/frontend/command.js +57 -0
- package/dist/frontend/command.js.map +1 -0
- package/dist/frontend/react.d.ts +14 -0
- package/dist/frontend/react.d.ts.map +1 -0
- package/dist/frontend/react.js +156 -0
- package/dist/frontend/react.js.map +1 -0
- package/dist/frontend/scaffold.d.ts +20 -0
- package/dist/frontend/scaffold.d.ts.map +1 -0
- package/dist/frontend/scaffold.js +157 -0
- package/dist/frontend/scaffold.js.map +1 -0
- package/dist/frontend/spec.d.ts +33 -0
- package/dist/frontend/spec.d.ts.map +1 -0
- package/dist/frontend/spec.js +74 -0
- package/dist/frontend/spec.js.map +1 -0
- package/dist/templates/resource-slice.d.ts +87 -0
- package/dist/templates/resource-slice.d.ts.map +1 -0
- package/dist/templates/resource-slice.js +513 -0
- package/dist/templates/resource-slice.js.map +1 -0
- package/package.json +8 -2
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA2DzD"}
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { makeCommand } from "./commands/make.js";
|
|
2
2
|
import { runWizard } from "./wizard.js";
|
|
3
|
+
import { runClient } from "./client/command.js";
|
|
4
|
+
import { runNew } from "./commands/new.js";
|
|
5
|
+
import { runResourceCli } from "./commands/resource.js";
|
|
6
|
+
import { runDb } from "./commands/db.js";
|
|
7
|
+
import { runGraph } from "./commands/graph.js";
|
|
8
|
+
import { runDocker } from "./commands/docker.js";
|
|
9
|
+
import { runCi } from "./commands/ci.js";
|
|
3
10
|
/**
|
|
4
11
|
* Parse and dispatch a CLI command.
|
|
5
12
|
*
|
|
@@ -15,15 +22,81 @@ export async function run(argv) {
|
|
|
15
22
|
console.log("wild 0.1.1");
|
|
16
23
|
return 0;
|
|
17
24
|
}
|
|
25
|
+
if (command === "new") {
|
|
26
|
+
return runNew(rest);
|
|
27
|
+
}
|
|
28
|
+
if (command === "resource") {
|
|
29
|
+
return runResourceCli(rest);
|
|
30
|
+
}
|
|
31
|
+
if (command === "db:migrate") {
|
|
32
|
+
return runDb("migrate", rest);
|
|
33
|
+
}
|
|
34
|
+
if (command === "db:rollback") {
|
|
35
|
+
return runDb("rollback", rest);
|
|
36
|
+
}
|
|
37
|
+
if (command === "db:status") {
|
|
38
|
+
return runDb("status", rest);
|
|
39
|
+
}
|
|
40
|
+
if (command === "graph") {
|
|
41
|
+
return runGraph(rest);
|
|
42
|
+
}
|
|
43
|
+
if (command === "docker") {
|
|
44
|
+
return runDocker(rest);
|
|
45
|
+
}
|
|
46
|
+
if (command === "ci") {
|
|
47
|
+
return runCi(rest);
|
|
48
|
+
}
|
|
18
49
|
if (command === "make" || command === "make:interactive" || command === "--interactive" || command === "-i") {
|
|
19
50
|
return runWizard();
|
|
20
51
|
}
|
|
21
52
|
if (command.startsWith("make:")) {
|
|
22
53
|
return runMake(command.slice("make:".length), rest);
|
|
23
54
|
}
|
|
55
|
+
if (command === "client") {
|
|
56
|
+
return (await runClient(parseClientArgs(rest))) ? 0 : 1;
|
|
57
|
+
}
|
|
24
58
|
console.error(`wild: unknown command "${command}". Run "wild --help" for usage.`);
|
|
25
59
|
return 1;
|
|
26
60
|
}
|
|
61
|
+
function parseClientArgs(args) {
|
|
62
|
+
const opts = {};
|
|
63
|
+
for (let i = 0; i < args.length; i++) {
|
|
64
|
+
const arg = args[i];
|
|
65
|
+
const next = args[i + 1];
|
|
66
|
+
switch (arg) {
|
|
67
|
+
case "--spec":
|
|
68
|
+
opts.spec = next;
|
|
69
|
+
i++;
|
|
70
|
+
break;
|
|
71
|
+
case "--output":
|
|
72
|
+
opts.output = next;
|
|
73
|
+
i++;
|
|
74
|
+
break;
|
|
75
|
+
case "--target":
|
|
76
|
+
opts.target = next;
|
|
77
|
+
i++;
|
|
78
|
+
break;
|
|
79
|
+
case "--base-url":
|
|
80
|
+
opts.baseUrl = next;
|
|
81
|
+
i++;
|
|
82
|
+
break;
|
|
83
|
+
case "--resource":
|
|
84
|
+
opts.resource = next;
|
|
85
|
+
i++;
|
|
86
|
+
break;
|
|
87
|
+
case "--examples":
|
|
88
|
+
opts.examples = true;
|
|
89
|
+
break;
|
|
90
|
+
case "--dry-run":
|
|
91
|
+
opts.dryRun = true;
|
|
92
|
+
break;
|
|
93
|
+
default:
|
|
94
|
+
// ignore unknown flags
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return opts;
|
|
99
|
+
}
|
|
27
100
|
function runMake(piece, args) {
|
|
28
101
|
try {
|
|
29
102
|
const result = makeCommand(piece, args);
|
|
@@ -39,13 +112,39 @@ function runMake(piece, args) {
|
|
|
39
112
|
}
|
|
40
113
|
function printHelp() {
|
|
41
114
|
console.log(`
|
|
42
|
-
Wild Framework CLI —
|
|
115
|
+
Wild Framework CLI — generate instead of typing boilerplate.
|
|
116
|
+
|
|
117
|
+
Project:
|
|
118
|
+
wild new <name> → scaffold a new project (multi-step wizard)
|
|
119
|
+
wild resource <Name> → full CRUD feature slice (interactive or --field flags)
|
|
120
|
+
|
|
121
|
+
Field types: string | text | email | url | uuid | date | datetime | time |
|
|
122
|
+
int | float | boolean | enum | json
|
|
123
|
+
Rules (inline): required=false | min=0 | max=100 | minLength=2 | maxLength=40 |
|
|
124
|
+
pattern=^[a-z]+$ | options=a|b|c | default=x | array=true
|
|
125
|
+
Add-ons (more bindings): --with event | listener | job | policy
|
|
126
|
+
|
|
127
|
+
wild resource Product --field name:string --field price:float:min=0 --field status:enum:options=draft|published
|
|
128
|
+
wild resource Product --with listener --with job
|
|
43
129
|
|
|
44
|
-
|
|
130
|
+
Database:
|
|
131
|
+
wild db:migrate → apply pending migrations (env-driven DB)
|
|
132
|
+
wild db:status → list applied vs pending migrations
|
|
133
|
+
wild db:rollback [steps] → revert the most recent migration(s)
|
|
134
|
+
wild make:migration <name> → migrations/<ts>_<name>.sql (+ .down.sql)
|
|
135
|
+
|
|
136
|
+
Graph (introspection for visual builders / AI agents):
|
|
137
|
+
wild graph [--url http://localhost:3000] → fetch /graph.json from a running app
|
|
138
|
+
|
|
139
|
+
Infrastructure (containerization + CI/CD):
|
|
140
|
+
wild docker [--compose] → detect + generate Dockerfile, .dockerignore
|
|
141
|
+
wild ci [--host gcp|aws|ftp|ssh] [--branch main]
|
|
142
|
+
→ GitHub Actions workflow (quality gates + deploy)
|
|
143
|
+
|
|
144
|
+
Pieces (fine-grained):
|
|
45
145
|
wild make → interactive wizard (guided prompts)
|
|
46
146
|
wild make:<piece> <Name> [targetDir]
|
|
47
147
|
|
|
48
|
-
Pieces:
|
|
49
148
|
module wild make:module users → features/users/ (provider + service)
|
|
50
149
|
provider wild make:provider UserProvider → user-provider.ts
|
|
51
150
|
service wild make:service UserService → user-service.ts
|
|
@@ -57,15 +156,20 @@ Pieces:
|
|
|
57
156
|
policy wild make:policy PostPolicy → post-policy.ts
|
|
58
157
|
listener wild make:listener SendWelcomeEmail → send-welcome-email.ts
|
|
59
158
|
|
|
159
|
+
Client generation (integration, never app scaffolding):
|
|
160
|
+
wild client [--spec ./openapi.json] [--output ./generated] [--target react]
|
|
161
|
+
wild client --examples --dry-run
|
|
162
|
+
|
|
60
163
|
Options:
|
|
61
164
|
-i, --interactive run the guided wizard
|
|
62
|
-
|
|
63
|
-
|
|
165
|
+
-h, --help show this help
|
|
166
|
+
wild client --resource users
|
|
64
167
|
|
|
65
168
|
Examples:
|
|
66
169
|
wild make:provider OrderProvider features/orders
|
|
67
170
|
wild make:event OrderPlaced features/orders
|
|
68
171
|
wild make:module users
|
|
172
|
+
wild client --spec http://localhost:3200/openapi.json --output ../my-react-app
|
|
69
173
|
`);
|
|
70
174
|
}
|
|
71
175
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAsB,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM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SAAS;IACd,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Df,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ContractField, ContractOperation } from "./contract.js";
|
|
2
|
+
/** PascalCase → camelCase. */
|
|
3
|
+
export declare function camelCase(name: string): string;
|
|
4
|
+
/** Uppercase first char. */
|
|
5
|
+
export declare function capitalize(name: string): string;
|
|
6
|
+
/** kebab → PascalCase ("user-profile" → "UserProfile"). */
|
|
7
|
+
export declare function toPascal(kebab: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* Derive the plural resource name (best-effort):
|
|
10
|
+
* "user" → "users", "person" → "people", "category" → "categories"
|
|
11
|
+
*/
|
|
12
|
+
export declare function pluralize(name: string): string;
|
|
13
|
+
/** kebab → camel ("user-profile" → "userProfile"). */
|
|
14
|
+
export declare function toCamelKebab(kebab: string): string;
|
|
15
|
+
/** Path param keys from a template ("/users/{id}" → ["id"]). */
|
|
16
|
+
export declare function pathParamKeys(path: string): string[];
|
|
17
|
+
/**
|
|
18
|
+
* Render a path template as a TS template literal expression.
|
|
19
|
+
* "/users/{id}" → "`/users/${encodeURIComponent(String(id))}`"
|
|
20
|
+
*/
|
|
21
|
+
export declare function pathToTemplateLiteral(path: string): string;
|
|
22
|
+
/** Given a request-schema name like "CreateUserRequest", derive the entity type. */
|
|
23
|
+
export declare function requestEntityName(requestSchema: string): string;
|
|
24
|
+
/** Map a ContractField to a TS type string. */
|
|
25
|
+
export declare function fieldToTs(field: ContractField, knownTypes: Set<string>, indent?: number): string;
|
|
26
|
+
/** Build the set of known schema type names. */
|
|
27
|
+
export declare function knownTypeNames(schemas: {
|
|
28
|
+
name: string;
|
|
29
|
+
}[]): Set<string>;
|
|
30
|
+
/** All distinct resources in a contract (kebab). */
|
|
31
|
+
export declare function resourcesInContract(operations: ContractOperation[]): string[];
|
|
32
|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
1
|
+
/** PascalCase → camelCase. */
|
|
2
|
+
export function camelCase(name) {
|
|
3
|
+
return name.charAt(0).toLowerCase() + name.slice(1);
|
|
4
|
+
}
|
|
5
|
+
/** Uppercase first char. */
|
|
6
|
+
export function capitalize(name) {
|
|
7
|
+
return name.charAt(0).toUpperCase() + name.slice(1);
|
|
8
|
+
}
|
|
9
|
+
/** kebab → PascalCase ("user-profile" → "UserProfile"). */
|
|
10
|
+
export function toPascal(kebab) {
|
|
11
|
+
return kebab.split("-").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join("");
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Derive the plural resource name (best-effort):
|
|
15
|
+
* "user" → "users", "person" → "people", "category" → "categories"
|
|
16
|
+
*/
|
|
17
|
+
export function pluralize(name) {
|
|
18
|
+
if (name.endsWith("y"))
|
|
19
|
+
return name.slice(0, -1) + "ies";
|
|
20
|
+
if (name.endsWith("s") || name.endsWith("x") || name.endsWith("z"))
|
|
21
|
+
return name + "es";
|
|
22
|
+
if (name.endsWith("ch") || name.endsWith("sh"))
|
|
23
|
+
return name + "es";
|
|
24
|
+
return name + "s";
|
|
25
|
+
}
|
|
26
|
+
/** kebab → camel ("user-profile" → "userProfile"). */
|
|
27
|
+
export function toCamelKebab(kebab) {
|
|
28
|
+
const parts = kebab.split("-");
|
|
29
|
+
const [first, ...rest] = parts;
|
|
30
|
+
return (first ?? "") + rest.map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join("");
|
|
31
|
+
}
|
|
32
|
+
/** Path param keys from a template ("/users/{id}" → ["id"]). */
|
|
33
|
+
export function pathParamKeys(path) {
|
|
34
|
+
const keys = [];
|
|
35
|
+
const re = /\{([^}]+)\}/g;
|
|
36
|
+
let m;
|
|
37
|
+
while ((m = re.exec(path)) !== null) {
|
|
38
|
+
keys.push(m[1]);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Render a path template as a TS template literal expression.
|
|
44
|
+
* "/users/{id}" → "`/users/${encodeURIComponent(String(id))}`"
|
|
45
|
+
*/
|
|
46
|
+
export function pathToTemplateLiteral(path) {
|
|
47
|
+
const body = path.replace(/\{([^}]+)\}/g, (_, k) => `\${encodeURIComponent(String(${k}))}`);
|
|
48
|
+
return `\`${body}\``;
|
|
49
|
+
}
|
|
50
|
+
/** Given a request-schema name like "CreateUserRequest", derive the entity type. */
|
|
51
|
+
export function requestEntityName(requestSchema) {
|
|
52
|
+
// CreateUserRequest → User ; UpdateUserRequest → User
|
|
53
|
+
return requestSchema
|
|
54
|
+
.replace(/^(Create|Update|Delete|Post|Put|Patch)/i, "")
|
|
55
|
+
.replace(/Request$/, "");
|
|
56
|
+
}
|
|
57
|
+
/** Map a ContractField to a TS type string. */
|
|
58
|
+
export function fieldToTs(field, knownTypes, indent = 2) {
|
|
59
|
+
const pad = " ".repeat(indent);
|
|
60
|
+
const innerPad = " ".repeat(indent + 2);
|
|
61
|
+
if (field.type === "array") {
|
|
62
|
+
// Array of inline objects (e.g. order line items)
|
|
63
|
+
if (field.itemFields && field.itemFields.length > 0) {
|
|
64
|
+
const inner = field.itemFields.map((f) => {
|
|
65
|
+
const opt = f.optional ? "?" : "";
|
|
66
|
+
return `${innerPad}${f.name}${opt}: ${fieldToTs(f, knownTypes, indent + 2)};`;
|
|
67
|
+
});
|
|
68
|
+
return `{\n${inner.join("\n")}\n${pad}}[]`;
|
|
69
|
+
}
|
|
70
|
+
const item = field.itemType && knownTypes.has(field.itemType) ? field.itemType : field.itemType ?? "unknown";
|
|
71
|
+
return `${item}[]`;
|
|
72
|
+
}
|
|
73
|
+
if (field.type === "object" && field.fields && field.fields.length > 0) {
|
|
74
|
+
const lines = field.fields.map((f) => {
|
|
75
|
+
const opt = f.optional ? "?" : "";
|
|
76
|
+
return `${innerPad}${f.name}${opt}: ${fieldToTs(f, knownTypes, indent + 2)};`;
|
|
77
|
+
});
|
|
78
|
+
return `{\n${lines.join("\n")}\n${pad}}`;
|
|
79
|
+
}
|
|
80
|
+
return field.type;
|
|
81
|
+
}
|
|
82
|
+
/** Build the set of known schema type names. */
|
|
83
|
+
export function knownTypeNames(schemas) {
|
|
84
|
+
return new Set(schemas.map((s) => s.name));
|
|
85
|
+
}
|
|
86
|
+
/** All distinct resources in a contract (kebab). */
|
|
87
|
+
export function resourcesInContract(operations) {
|
|
88
|
+
const seen = new Set();
|
|
89
|
+
for (const op of operations) {
|
|
90
|
+
seen.add(op.resourceKebab);
|
|
91
|
+
}
|
|
92
|
+
return [...seen];
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=codegen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codegen.js","sourceRoot":"","sources":["../../src/client/codegen.ts"],"names":[],"mappings":"AAEA,8BAA8B;AAC9B,MAAM,UAAU,SAAS,CAAC,IAAY;IAClC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACxD,CAAC;AAED,4BAA4B;AAC5B,MAAM,UAAU,UAAU,CAAC,IAAY;IACnC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACxD,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,QAAQ,CAAC,KAAa;IAClC,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IAClC,IAAI,IAAI,CAAC,QAAQ,CAAC,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,CAAC,GAAG,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for the `wild client` command.
|
|
3
|
+
*/
|
|
4
|
+
export interface ClientOptions {
|
|
5
|
+
/** OpenAPI spec source: URL or file path. Default "./openapi.json". */
|
|
6
|
+
spec?: string;
|
|
7
|
+
/** Output directory. Default: detected source dir (or cwd). */
|
|
8
|
+
output?: string;
|
|
9
|
+
/** Client target adapter. Default "react". */
|
|
10
|
+
target?: string;
|
|
11
|
+
/** Base URL the generated client calls. Default "/". */
|
|
12
|
+
baseUrl?: string;
|
|
13
|
+
/** Emit example components (target-dependent). Default false. */
|
|
14
|
+
examples?: boolean;
|
|
15
|
+
/** Print what would be generated, write nothing. */
|
|
16
|
+
dryRun?: boolean;
|
|
17
|
+
/** Restrict generation to one resource (kebab name). Default all. */
|
|
18
|
+
resource?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Run the `wild client` generator.
|
|
22
|
+
*
|
|
23
|
+
* Philosophy: generate the deterministic integration (clients, types,
|
|
24
|
+
* validation, query/mutation hooks), never scaffold an application.
|
|
25
|
+
*
|
|
26
|
+
* @returns true on success, false on error (error already printed)
|
|
27
|
+
*/
|
|
28
|
+
export declare function runClient(options: ClientOptions): Promise<boolean>;
|
|
29
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/client/command.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,uEAAuE;IACvE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oDAAoD;IACpD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAmFxE"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { loadSpec, parseContract } from "./spec.js";
|
|
3
|
+
import { ClientGenerator } from "./core.js";
|
|
4
|
+
import { DiskWriter } from "./fs-writer.js";
|
|
5
|
+
import { targets } from "./targets/index.js";
|
|
6
|
+
import { inspectProject, resolveSourceDir } from "./inspector.js";
|
|
7
|
+
/**
|
|
8
|
+
* Run the `wild client` generator.
|
|
9
|
+
*
|
|
10
|
+
* Philosophy: generate the deterministic integration (clients, types,
|
|
11
|
+
* validation, query/mutation hooks), never scaffold an application.
|
|
12
|
+
*
|
|
13
|
+
* @returns true on success, false on error (error already printed)
|
|
14
|
+
*/
|
|
15
|
+
export async function runClient(options) {
|
|
16
|
+
const specSource = options.spec ?? "./openapi.json";
|
|
17
|
+
const targetName = options.target ?? "react";
|
|
18
|
+
if (!targets[targetName]) {
|
|
19
|
+
console.error(`wild: unknown client target "${targetName}". Available: ${Object.keys(targets).join(", ")}`);
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
console.log(`\nLoading OpenAPI spec from ${specSource}...`);
|
|
23
|
+
let raw;
|
|
24
|
+
try {
|
|
25
|
+
raw = await loadSpec(specSource);
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.error(`wild: ${error instanceof Error ? error.message : String(error)}`);
|
|
29
|
+
console.error("\nHint: start your app (so /openapi.json is served) or pass --spec <file>.");
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
const contract = parseContract(raw);
|
|
33
|
+
console.log(` ${contract.title} v${contract.version} — ${contract.operations.length} operation(s)`);
|
|
34
|
+
console.log(` ${contract.schemas.length} schema(s), ${new Set(contract.operations.map((o) => o.resourceKebab)).size} resource(s)`);
|
|
35
|
+
// Restrict to a single resource if requested
|
|
36
|
+
if (options.resource) {
|
|
37
|
+
const before = contract.operations.length;
|
|
38
|
+
contract.operations = contract.operations.filter((o) => o.resourceKebab === options.resource);
|
|
39
|
+
if (contract.operations.length === 0) {
|
|
40
|
+
console.error(`wild: no operations for resource "${options.resource}".`);
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
console.log(` restricted to resource "${options.resource}" (${before} → ${contract.operations.length} operation(s))`);
|
|
44
|
+
}
|
|
45
|
+
// Detect the destination project
|
|
46
|
+
const cwd = process.cwd();
|
|
47
|
+
const detection = inspectProject(cwd);
|
|
48
|
+
const outRoot = resolve(options.output ?? resolveSourceDir(cwd));
|
|
49
|
+
const baseUrl = options.baseUrl ?? "/";
|
|
50
|
+
console.log(`\nDestination: ${outRoot}`);
|
|
51
|
+
if (detection.packageManager)
|
|
52
|
+
console.log(` package manager : ${detection.packageManager}`);
|
|
53
|
+
if (detection.framework)
|
|
54
|
+
console.log(` framework : ${detection.framework}`);
|
|
55
|
+
if (detection.typescript)
|
|
56
|
+
console.log(` typescript : yes`);
|
|
57
|
+
if (detection.tanstackQuery)
|
|
58
|
+
console.log(` tanstack query : yes`);
|
|
59
|
+
if (!detection.typescript) {
|
|
60
|
+
console.warn(" ⚠ no tsconfig.json found — generated code assumes TypeScript");
|
|
61
|
+
}
|
|
62
|
+
if (detection.framework && detection.framework !== "react") {
|
|
63
|
+
console.warn(` ⚠ detected framework "${detection.framework}" — the ${targetName} target may not fit`);
|
|
64
|
+
}
|
|
65
|
+
const generator = new ClientGenerator(targets, new DiskWriter());
|
|
66
|
+
if (options.dryRun) {
|
|
67
|
+
const files = targets[targetName].generateFiles({
|
|
68
|
+
contract,
|
|
69
|
+
baseUrl,
|
|
70
|
+
examples: options.examples ?? false,
|
|
71
|
+
});
|
|
72
|
+
console.log(`\nDry-run — would generate ${files.length} file(s) under ${outRoot}:\n`);
|
|
73
|
+
for (const f of files) {
|
|
74
|
+
console.log(` ${f.path}`);
|
|
75
|
+
}
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
console.log(`\nGenerating ${targetName} client under ${outRoot}...\n`);
|
|
79
|
+
const result = generator.generate(contract, targetName, {
|
|
80
|
+
outputDir: outRoot,
|
|
81
|
+
baseUrl,
|
|
82
|
+
examples: options.examples ?? false,
|
|
83
|
+
});
|
|
84
|
+
if (result.filesWritten.length === 0) {
|
|
85
|
+
console.log("\nNothing to do — all files already exist.");
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
console.log(`\nDone. ${result.filesWritten.length} file(s) generated, ${result.filesSkipped.length} skipped.`);
|
|
89
|
+
console.log("\nNext steps:");
|
|
90
|
+
console.log(" Import the generated hooks/clients in your existing app.");
|
|
91
|
+
console.log(" Ensure these deps exist: @tanstack/react-query, zod (for the react target).");
|
|
92
|
+
}
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/client/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAsBlE;;;;;;;GAOG;AACH,MAA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AE,CAAC;QACnC,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;IAC9D,CAAC;SAAM,CAAC;QACJ,OAAO,CAAC,GAAG,CAAC,WAAW,MAAM,CAAC,YAAY,CAAC,MAAM,uBAAuB,MAAM,CAAC,YAAY,CAAC,MAAM,WAAW,CAAC,CAAC;QAC/G,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,4DAA4D,CAAC,CAAC;QAC1E,OAAO,CAAC,GAAG,CAAC,+EAA+E,CAAC,CAAC;IACjG,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client Generator Core — framework-agnostic contract.
|
|
3
|
+
*
|
|
4
|
+
* A "Resource Contract" is a normalized, framework-agnostic description of an
|
|
5
|
+
* API, derived from an OpenAPI spec. The generator core consumes only this
|
|
6
|
+
* contract — never the OpenAPI document directly — so the same contract can
|
|
7
|
+
* drive any client adapter (React, Vue, Svelte, Solid, plain JS, …).
|
|
8
|
+
*
|
|
9
|
+
* This module is intentionally free of any frontend-framework vocabulary.
|
|
10
|
+
*/
|
|
11
|
+
/** Supported HTTP methods. */
|
|
12
|
+
export type HttpMethod = "get" | "post" | "put" | "patch" | "delete";
|
|
13
|
+
/** Where a parameter appears in the request. */
|
|
14
|
+
export type ParamLocation = "path" | "query" | "header";
|
|
15
|
+
/** A single request parameter. */
|
|
16
|
+
export interface ContractParam {
|
|
17
|
+
name: string;
|
|
18
|
+
location: ParamLocation;
|
|
19
|
+
type: string;
|
|
20
|
+
required: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** A single field of a schema. */
|
|
23
|
+
export interface ContractField {
|
|
24
|
+
name: string;
|
|
25
|
+
type: string;
|
|
26
|
+
/** null-able / optional (union with undefined). */
|
|
27
|
+
optional?: boolean;
|
|
28
|
+
/** Nested fields for object-typed fields. */
|
|
29
|
+
fields?: ContractField[];
|
|
30
|
+
/** Element type for array-typed fields. */
|
|
31
|
+
itemType?: string;
|
|
32
|
+
/** Element fields when the array holds inline objects. */
|
|
33
|
+
itemFields?: ContractField[];
|
|
34
|
+
}
|
|
35
|
+
/** A named schema (from request validators / resources). */
|
|
36
|
+
export interface ContractSchema {
|
|
37
|
+
name: string;
|
|
38
|
+
fields: ContractField[];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The role an operation plays in REST terms. Derived structurally so the
|
|
42
|
+
* generator never invents endpoints that don't exist in the spec.
|
|
43
|
+
*/
|
|
44
|
+
export type OperationKind = "list" | "detail" | "create" | "update" | "delete" | "action";
|
|
45
|
+
/** An operation (one HTTP endpoint) in the contract. */
|
|
46
|
+
export interface ContractOperation {
|
|
47
|
+
method: HttpMethod;
|
|
48
|
+
/** Path template, e.g. "/users/{id}". */
|
|
49
|
+
path: string;
|
|
50
|
+
/** PascalCase resource name, e.g. "User". */
|
|
51
|
+
resource: string;
|
|
52
|
+
/** kebab-case resource, e.g. "users" (used for file/function names). */
|
|
53
|
+
resourceKebab: string;
|
|
54
|
+
/** Structural REST role of this operation. */
|
|
55
|
+
kind: OperationKind;
|
|
56
|
+
/** Whether this is a collection (list) operation. */
|
|
57
|
+
isCollection: boolean;
|
|
58
|
+
params: ContractParam[];
|
|
59
|
+
/** Request body schema name, if any. */
|
|
60
|
+
requestSchema?: string;
|
|
61
|
+
/** Whether the operation returns a single resource vs a collection. */
|
|
62
|
+
returnsList?: boolean;
|
|
63
|
+
}
|
|
64
|
+
/** The complete framework-agnostic contract. */
|
|
65
|
+
export interface ResourceContract {
|
|
66
|
+
title: string;
|
|
67
|
+
version: string;
|
|
68
|
+
schemas: ContractSchema[];
|
|
69
|
+
operations: ContractOperation[];
|
|
70
|
+
}
|
|
71
|
+
/** Options accepted by the core generator. */
|
|
72
|
+
export interface GenerateOptions {
|
|
73
|
+
/** Destination root directory (absolute). Defaults to process.cwd(). */
|
|
74
|
+
outputDir?: string;
|
|
75
|
+
/** Base URL the generated client calls. Defaults to "/". */
|
|
76
|
+
baseUrl?: string;
|
|
77
|
+
/** Emit example components (React adapter). Defaults to false. */
|
|
78
|
+
examples?: boolean;
|
|
79
|
+
}
|
|
80
|
+
/** Result of a generation run. */
|
|
81
|
+
export interface GenerateResult {
|
|
82
|
+
filesWritten: string[];
|
|
83
|
+
filesSkipped: string[];
|
|
84
|
+
target: string;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/client/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,8BAA8B;AAC9B,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAErE,gDAAgD;AAChD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAExD,kCAAkC;AAClC,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACrB;AAED,kCAAkC;AAClC,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC;IACzB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;CAChC;AAED,4DAA4D;AAC5D,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,aAAa,EAAE,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE1F,wDAAwD;AACxD,MAAM,WAAW,iBAAiB;IAC9B,MAAM,EAAE,UAAU,CAAC;IACnB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,aAAa,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,IAAI,EAAE,aAAa,CAAC;IACpB,qDAAqD;IACrD,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,wCAAwC;IACxC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,gDAAgD;AAChD,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,UAAU,EAAE,iBAAiB,EAAE,CAAC;CACnC;AAED,8CAA8C;AAC9C,MAAM,WAAW,eAAe;IAC5B,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,kCAAkC;AAClC,MAAM,WAAW,cAAc;IAC3B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client Generator Core — framework-agnostic contract.
|
|
3
|
+
*
|
|
4
|
+
* A "Resource Contract" is a normalized, framework-agnostic description of an
|
|
5
|
+
* API, derived from an OpenAPI spec. The generator core consumes only this
|
|
6
|
+
* contract — never the OpenAPI document directly — so the same contract can
|
|
7
|
+
* drive any client adapter (React, Vue, Svelte, Solid, plain JS, …).
|
|
8
|
+
*
|
|
9
|
+
* This module is intentionally free of any frontend-framework vocabulary.
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src/client/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { ResourceContract, GenerateOptions, GenerateResult } from "./contract.js";
|
|
2
|
+
/**
|
|
3
|
+
* A generated file: relative path + content.
|
|
4
|
+
*/
|
|
5
|
+
export interface GeneratedFile {
|
|
6
|
+
path: string;
|
|
7
|
+
content: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* What the core generator asks a target adapter to produce.
|
|
11
|
+
*/
|
|
12
|
+
export interface TargetRequest {
|
|
13
|
+
/** The framework-agnostic contract. */
|
|
14
|
+
contract: ResourceContract;
|
|
15
|
+
/** Base URL the client should call. */
|
|
16
|
+
baseUrl: string;
|
|
17
|
+
/** Whether to emit example components (adapter-defined). */
|
|
18
|
+
examples: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The target-adapter contract.
|
|
22
|
+
*
|
|
23
|
+
* Every adapter (react, vue, svelte, solid, plain-js, …) implements this.
|
|
24
|
+
* The core generator never knows about a specific frontend framework.
|
|
25
|
+
*/
|
|
26
|
+
export interface ClientTarget {
|
|
27
|
+
/** Stable identifier, e.g. "react". */
|
|
28
|
+
name: string;
|
|
29
|
+
/** Human-readable label. */
|
|
30
|
+
label: string;
|
|
31
|
+
/**
|
|
32
|
+
* Produce the full file set for this target from the contract.
|
|
33
|
+
* The adapter decides structure (e.g. generated/users/api.ts),
|
|
34
|
+
* naming, and content.
|
|
35
|
+
*/
|
|
36
|
+
generateFiles(request: TargetRequest): GeneratedFile[];
|
|
37
|
+
}
|
|
38
|
+
/** Placeholder adapter interface (kept for symmetry with other targets). */
|
|
39
|
+
export interface ProjectDetection {
|
|
40
|
+
/** Detected package manager (npm/pnpm/yarn/bun) or null. */
|
|
41
|
+
packageManager: string | null;
|
|
42
|
+
/** Detected source dir, e.g. "src" or null. */
|
|
43
|
+
sourceDir: string | null;
|
|
44
|
+
/** Detected framework, e.g. "react" or null. */
|
|
45
|
+
framework: string | null;
|
|
46
|
+
/** Whether the project uses TypeScript. */
|
|
47
|
+
typescript: boolean;
|
|
48
|
+
/** Whether TanStack Query is present (for react target). */
|
|
49
|
+
tanstackQuery: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Generator core — framework-agnostic.
|
|
53
|
+
*
|
|
54
|
+
* Orchestrates: contract → target adapter → file emission, with an
|
|
55
|
+
* overwrite/update strategy (existing files are skipped unless they're
|
|
56
|
+
* marked as regenerable).
|
|
57
|
+
*/
|
|
58
|
+
export declare class ClientGenerator {
|
|
59
|
+
private readonly targets;
|
|
60
|
+
private readonly writer;
|
|
61
|
+
constructor(targets: Record<string, ClientTarget>, writer: FileWriter);
|
|
62
|
+
/** Register a target adapter. */
|
|
63
|
+
register(target: ClientTarget): void;
|
|
64
|
+
/** List available target names. */
|
|
65
|
+
availableTargets(): string[];
|
|
66
|
+
/**
|
|
67
|
+
* Generate a client for a target into an output directory.
|
|
68
|
+
*
|
|
69
|
+
* The generator only writes files the adapter returns; it never
|
|
70
|
+
* creates package.json, bundler config, entry points, or UI scaffolding.
|
|
71
|
+
*/
|
|
72
|
+
generate(contract: ResourceContract, targetName: string, options?: GenerateOptions): GenerateResult;
|
|
73
|
+
}
|
|
74
|
+
/** Result of a single file write. */
|
|
75
|
+
export type WriteOutcome = "written" | "skipped";
|
|
76
|
+
/** Abstraction over the filesystem, injectable for tests. */
|
|
77
|
+
export interface FileWriter {
|
|
78
|
+
write(file: GeneratedFile, root: string): WriteOutcome;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/client/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEvF;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,uCAAuC;IACvC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,QAAQ,EAAE,OAAO,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IACzB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa,EAAE,CAAC;CAC1D;AAED,4EAA4E;AAC5E,MAAM,WAAW,gBAAgB;IAC7B,4DAA4D;IAC5D,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,+CAA+C;IAC/C,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,gDAAgD;IAChD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,2CAA2C;IAC3C,UAAU,EAAE,OAAO,CAAC;IACpB,4DAA4D;IAC5D,aAAa,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,qBAAa,eAAe;IAEpB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,YA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