@intentius/chant-lexicon-k3d 0.0.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/README.md +26 -0
- package/dist/codegen/docs.d.ts +7 -0
- package/dist/codegen/docs.d.ts.map +1 -0
- package/dist/codegen/generate-cli.d.ts +6 -0
- package/dist/codegen/generate-cli.d.ts.map +1 -0
- package/dist/codegen/generate-lexicon.d.ts +19 -0
- package/dist/codegen/generate-lexicon.d.ts.map +1 -0
- package/dist/codegen/generate-typescript.d.ts +11 -0
- package/dist/codegen/generate-typescript.d.ts.map +1 -0
- package/dist/codegen/generate.d.ts +15 -0
- package/dist/codegen/generate.d.ts.map +1 -0
- package/dist/codegen/naming.d.ts +13 -0
- package/dist/codegen/naming.d.ts.map +1 -0
- package/dist/codegen/package.d.ts +17 -0
- package/dist/codegen/package.d.ts.map +1 -0
- package/dist/codegen/parse.d.ts +57 -0
- package/dist/codegen/parse.d.ts.map +1 -0
- package/dist/describe-resources.d.ts +34 -0
- package/dist/describe-resources.d.ts.map +1 -0
- package/dist/generated/index.d.ts +22 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/runtime.d.ts +5 -0
- package/dist/generated/runtime.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/integrity.json +9 -0
- package/dist/lint/audit-catalog.d.ts +9 -0
- package/dist/lint/audit-catalog.d.ts.map +1 -0
- package/dist/lint/post-synth/index.d.ts +3 -0
- package/dist/lint/post-synth/index.d.ts.map +1 -0
- package/dist/lint/post-synth/k3d101.d.ts +19 -0
- package/dist/lint/post-synth/k3d101.d.ts.map +1 -0
- package/dist/lint/post-synth/k3d102.d.ts +12 -0
- package/dist/lint/post-synth/k3d102.d.ts.map +1 -0
- package/dist/lint/rules/index.d.ts +5 -0
- package/dist/lint/rules/index.d.ts.map +1 -0
- package/dist/lint/rules/registry-proxy-password.d.ts +17 -0
- package/dist/lint/rules/registry-proxy-password.d.ts.map +1 -0
- package/dist/lint/rules/sample.d.ts +8 -0
- package/dist/lint/rules/sample.d.ts.map +1 -0
- package/dist/lsp/completions.d.ts +7 -0
- package/dist/lsp/completions.d.ts.map +1 -0
- package/dist/lsp/hover.d.ts +6 -0
- package/dist/lsp/hover.d.ts.map +1 -0
- package/dist/manifest.json +6 -0
- package/dist/meta.json +184 -0
- package/dist/op/activities/index.d.ts +17 -0
- package/dist/op/activities/index.d.ts.map +1 -0
- package/dist/op/activities/k3d.d.ts +93 -0
- package/dist/op/activities/k3d.d.ts.map +1 -0
- package/dist/package-cli.d.ts +3 -0
- package/dist/package-cli.d.ts.map +1 -0
- package/dist/plugin.d.ts +8 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/serializer.d.ts +35 -0
- package/dist/serializer.d.ts.map +1 -0
- package/dist/spec/fetch.d.ts +39 -0
- package/dist/spec/fetch.d.ts.map +1 -0
- package/dist/testdata/load-fixtures.d.ts +16 -0
- package/dist/testdata/load-fixtures.d.ts.map +1 -0
- package/dist/types/index.d.ts +189 -0
- package/dist/validate-cli.d.ts +3 -0
- package/dist/validate-cli.d.ts.map +1 -0
- package/dist/validate.d.ts +15 -0
- package/dist/validate.d.ts.map +1 -0
- package/package.json +58 -0
- package/src/codegen/docs.ts +25 -0
- package/src/codegen/generate-cli.ts +36 -0
- package/src/codegen/generate-lexicon.ts +58 -0
- package/src/codegen/generate-typescript.ts +102 -0
- package/src/codegen/generate.test.ts +154 -0
- package/src/codegen/generate.ts +139 -0
- package/src/codegen/naming.ts +56 -0
- package/src/codegen/package.ts +27 -0
- package/src/codegen/parse.ts +359 -0
- package/src/describe-resources.test.ts +142 -0
- package/src/describe-resources.ts +144 -0
- package/src/generated/.gitkeep +0 -0
- package/src/generated/index.d.ts +189 -0
- package/src/generated/index.ts +27 -0
- package/src/generated/lexicon-k3d.json +184 -0
- package/src/generated/runtime.ts +4 -0
- package/src/index.ts +8 -0
- package/src/lint/audit-catalog.ts +26 -0
- package/src/lint/post-synth/index.ts +9 -0
- package/src/lint/post-synth/k3d101.ts +87 -0
- package/src/lint/post-synth/k3d102.ts +40 -0
- package/src/lint/post-synth/post-synth.test.ts +76 -0
- package/src/lint/rules/index.ts +7 -0
- package/src/lint/rules/registry-proxy-password.test.ts +53 -0
- package/src/lint/rules/registry-proxy-password.ts +93 -0
- package/src/lsp/completions.test.ts +10 -0
- package/src/lsp/completions.ts +21 -0
- package/src/lsp/hover.test.ts +10 -0
- package/src/lsp/hover.ts +39 -0
- package/src/op/activities/index.ts +24 -0
- package/src/op/activities/k3d.test.ts +168 -0
- package/src/op/activities/k3d.ts +183 -0
- package/src/package-cli.ts +41 -0
- package/src/plugin.test.ts +17 -0
- package/src/plugin.ts +114 -0
- package/src/serializer.acceptance.test.ts +94 -0
- package/src/serializer.test.ts +189 -0
- package/src/serializer.ts +202 -0
- package/src/spec/fetch.ts +66 -0
- package/src/testdata/k3d-schema-fixture.json +431 -0
- package/src/testdata/load-fixtures.ts +27 -0
- package/src/validate-cli.ts +5 -0
- package/src/validate.ts +28 -0
package/dist/meta.json
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Cluster": {
|
|
3
|
+
"resourceType": "K3d::Cluster",
|
|
4
|
+
"kind": "resource",
|
|
5
|
+
"lexicon": "k3d",
|
|
6
|
+
"constraints": {
|
|
7
|
+
"apiVersion": {
|
|
8
|
+
"default": "k3d.io/v1alpha5",
|
|
9
|
+
"enum": [
|
|
10
|
+
"k3d.io/v1alpha5"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
"kind": {
|
|
14
|
+
"default": "Simple",
|
|
15
|
+
"enum": [
|
|
16
|
+
"Simple"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"servers": {
|
|
20
|
+
"minimum": 1
|
|
21
|
+
},
|
|
22
|
+
"agents": {
|
|
23
|
+
"minimum": 0
|
|
24
|
+
},
|
|
25
|
+
"subnet": {
|
|
26
|
+
"default": "auto"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"EnvVar": {
|
|
31
|
+
"resourceType": "K3d::EnvVar",
|
|
32
|
+
"kind": "property",
|
|
33
|
+
"lexicon": "k3d"
|
|
34
|
+
},
|
|
35
|
+
"File": {
|
|
36
|
+
"resourceType": "K3d::File",
|
|
37
|
+
"kind": "property",
|
|
38
|
+
"lexicon": "k3d"
|
|
39
|
+
},
|
|
40
|
+
"HostAlias": {
|
|
41
|
+
"resourceType": "K3d::HostAlias",
|
|
42
|
+
"kind": "property",
|
|
43
|
+
"lexicon": "k3d"
|
|
44
|
+
},
|
|
45
|
+
"K3dOptions": {
|
|
46
|
+
"resourceType": "K3d::K3dOptions",
|
|
47
|
+
"kind": "property",
|
|
48
|
+
"lexicon": "k3d",
|
|
49
|
+
"constraints": {
|
|
50
|
+
"wait": {
|
|
51
|
+
"default": true
|
|
52
|
+
},
|
|
53
|
+
"disableLoadbalancer": {
|
|
54
|
+
"default": false
|
|
55
|
+
},
|
|
56
|
+
"disableImageVolume": {
|
|
57
|
+
"default": false
|
|
58
|
+
},
|
|
59
|
+
"disableRollback": {
|
|
60
|
+
"default": false
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"K3sExtraArg": {
|
|
65
|
+
"resourceType": "K3d::K3sExtraArg",
|
|
66
|
+
"kind": "property",
|
|
67
|
+
"lexicon": "k3d"
|
|
68
|
+
},
|
|
69
|
+
"K3sOptions": {
|
|
70
|
+
"resourceType": "K3d::K3sOptions",
|
|
71
|
+
"kind": "property",
|
|
72
|
+
"lexicon": "k3d"
|
|
73
|
+
},
|
|
74
|
+
"KubeAPI": {
|
|
75
|
+
"resourceType": "K3d::KubeAPI",
|
|
76
|
+
"kind": "property",
|
|
77
|
+
"lexicon": "k3d",
|
|
78
|
+
"constraints": {
|
|
79
|
+
"host": {
|
|
80
|
+
"format": "hostname"
|
|
81
|
+
},
|
|
82
|
+
"hostIP": {
|
|
83
|
+
"format": "ipv4"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"KubeconfigOptions": {
|
|
88
|
+
"resourceType": "K3d::KubeconfigOptions",
|
|
89
|
+
"kind": "property",
|
|
90
|
+
"lexicon": "k3d",
|
|
91
|
+
"constraints": {
|
|
92
|
+
"updateDefaultKubeconfig": {
|
|
93
|
+
"default": true
|
|
94
|
+
},
|
|
95
|
+
"switchCurrentContext": {
|
|
96
|
+
"default": true
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"LoadbalancerOptions": {
|
|
101
|
+
"resourceType": "K3d::LoadbalancerOptions",
|
|
102
|
+
"kind": "property",
|
|
103
|
+
"lexicon": "k3d"
|
|
104
|
+
},
|
|
105
|
+
"Metadata": {
|
|
106
|
+
"resourceType": "K3d::Metadata",
|
|
107
|
+
"kind": "property",
|
|
108
|
+
"lexicon": "k3d",
|
|
109
|
+
"constraints": {
|
|
110
|
+
"name": {
|
|
111
|
+
"format": "hostname"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"NodeLabel": {
|
|
116
|
+
"resourceType": "K3d::NodeLabel",
|
|
117
|
+
"kind": "property",
|
|
118
|
+
"lexicon": "k3d"
|
|
119
|
+
},
|
|
120
|
+
"Options": {
|
|
121
|
+
"resourceType": "K3d::Options",
|
|
122
|
+
"kind": "property",
|
|
123
|
+
"lexicon": "k3d"
|
|
124
|
+
},
|
|
125
|
+
"Port": {
|
|
126
|
+
"resourceType": "K3d::Port",
|
|
127
|
+
"kind": "property",
|
|
128
|
+
"lexicon": "k3d"
|
|
129
|
+
},
|
|
130
|
+
"Registries": {
|
|
131
|
+
"resourceType": "K3d::Registries",
|
|
132
|
+
"kind": "property",
|
|
133
|
+
"lexicon": "k3d"
|
|
134
|
+
},
|
|
135
|
+
"RegistryCreate": {
|
|
136
|
+
"resourceType": "K3d::RegistryCreate",
|
|
137
|
+
"kind": "property",
|
|
138
|
+
"lexicon": "k3d",
|
|
139
|
+
"constraints": {
|
|
140
|
+
"host": {
|
|
141
|
+
"default": "0.0.0.0"
|
|
142
|
+
},
|
|
143
|
+
"hostPort": {
|
|
144
|
+
"default": "random"
|
|
145
|
+
},
|
|
146
|
+
"image": {
|
|
147
|
+
"default": "docker.io/library/registry:2"
|
|
148
|
+
},
|
|
149
|
+
"enforcePortMatch": {
|
|
150
|
+
"default": false
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"RegistryProxy": {
|
|
155
|
+
"resourceType": "K3d::RegistryProxy",
|
|
156
|
+
"kind": "property",
|
|
157
|
+
"lexicon": "k3d"
|
|
158
|
+
},
|
|
159
|
+
"RuntimeLabel": {
|
|
160
|
+
"resourceType": "K3d::RuntimeLabel",
|
|
161
|
+
"kind": "property",
|
|
162
|
+
"lexicon": "k3d"
|
|
163
|
+
},
|
|
164
|
+
"RuntimeOptions": {
|
|
165
|
+
"resourceType": "K3d::RuntimeOptions",
|
|
166
|
+
"kind": "property",
|
|
167
|
+
"lexicon": "k3d",
|
|
168
|
+
"constraints": {
|
|
169
|
+
"hostPidMode": {
|
|
170
|
+
"default": false
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"Ulimit": {
|
|
175
|
+
"resourceType": "K3d::Ulimit",
|
|
176
|
+
"kind": "property",
|
|
177
|
+
"lexicon": "k3d"
|
|
178
|
+
},
|
|
179
|
+
"Volume": {
|
|
180
|
+
"resourceType": "K3d::Volume",
|
|
181
|
+
"kind": "property",
|
|
182
|
+
"lexicon": "k3d"
|
|
183
|
+
}
|
|
184
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* k3d Op activities — resolved by the core activity registry when a project's
|
|
3
|
+
* `chant.config.ts` lists the `k3d` lexicon. Relocated from the k8s lexicon
|
|
4
|
+
* (chant #1410) so the local-cluster tooling lives with its product:
|
|
5
|
+
* - k3dUp / k3dDown — boot/tear down a local k3d cluster. Since #1411 the
|
|
6
|
+
* kubeconfig default is safe: the caller's default kubeconfig and current
|
|
7
|
+
* context are left alone unless explicitly requested, and `k3dUp` returns
|
|
8
|
+
* `{ context, kubeconfigPath? }` so later steps know what to talk to.
|
|
9
|
+
*
|
|
10
|
+
* The step builders (k3dUp, k3dDown) stay in core, re-exported from the
|
|
11
|
+
* temporal Op-authoring barrel like the other core builders. The activities are
|
|
12
|
+
* dependency-light — they shell out to the k3d CLI and do not import the k3d
|
|
13
|
+
* declarable surface — so a Temporal worker loads them cheaply.
|
|
14
|
+
*/
|
|
15
|
+
export { k3dUp, k3dDown, k3dUpCommand, k3dDownCommand, k3dExistsCommand, k3dKubeconfigWriteCommand, k3dContextName, } from "./k3d.js";
|
|
16
|
+
export type { K3dUpArgs, K3dDownArgs, K3dUpResult } from "./k3d.js";
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/op/activities/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EACL,KAAK,EACL,OAAO,EACP,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EACzB,cAAc,GACf,MAAM,OAAO,CAAC;AACf,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export interface K3dUpArgs {
|
|
2
|
+
/** Cluster name (`k3d cluster create <name>`). */
|
|
3
|
+
name: string;
|
|
4
|
+
/** Number of server (control-plane) nodes. */
|
|
5
|
+
servers?: number;
|
|
6
|
+
/** Number of agent (worker) nodes. */
|
|
7
|
+
agents?: number;
|
|
8
|
+
/** k3s image, e.g. `rancher/k3s:v1.31.4-k3s1`. */
|
|
9
|
+
image?: string;
|
|
10
|
+
/** Port mappings, e.g. `["8080:80@loadbalancer"]`. */
|
|
11
|
+
ports?: string[];
|
|
12
|
+
/** Create a managed local registry with this name (`--registry-create`). */
|
|
13
|
+
registryCreate?: string;
|
|
14
|
+
/** Path to a k3d config file (`--config`). */
|
|
15
|
+
configFile?: string;
|
|
16
|
+
/** Readiness timeout for `--wait`. Default: `120s`. */
|
|
17
|
+
timeout?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Merge the new cluster into the caller's default kubeconfig
|
|
20
|
+
* (`--kubeconfig-update-default=<bool>`). Chant's default is `false` —
|
|
21
|
+
* deliberately the opposite of upstream k3d's `true`: a tool that reconciles
|
|
22
|
+
* infrastructure must not repoint the caller's shell. The context-hijack
|
|
23
|
+
* false-failure during #1394's scoping is the receipt. When the default
|
|
24
|
+
* kubeconfig is left alone, {@link k3dUp} writes a dedicated kubeconfig and
|
|
25
|
+
* returns its path so later steps can still reach the cluster.
|
|
26
|
+
*
|
|
27
|
+
* With a `configFile` and this arg unset, no flag is passed at all — the
|
|
28
|
+
* declared config's own `options.kubeconfig` governs (k3d gives CLI flags
|
|
29
|
+
* precedence over config, so a declared `true` keeps working).
|
|
30
|
+
*/
|
|
31
|
+
updateDefaultKubeconfig?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Switch the caller's current kubectl context to the new cluster
|
|
34
|
+
* (`--kubeconfig-switch-context=<bool>`). Chant's default is `false` — see
|
|
35
|
+
* {@link K3dUpArgs.updateDefaultKubeconfig} for why chant inverts upstream's
|
|
36
|
+
* default. Same `configFile` rule: unset alongside a `configFile`, no flag
|
|
37
|
+
* is passed and the config governs.
|
|
38
|
+
*/
|
|
39
|
+
switchCurrentContext?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface K3dDownArgs {
|
|
42
|
+
/** Cluster name to delete. */
|
|
43
|
+
name: string;
|
|
44
|
+
}
|
|
45
|
+
/** What {@link k3dUp} resolved for talking to the cluster. */
|
|
46
|
+
export interface K3dUpResult {
|
|
47
|
+
/** kubectl context name for the cluster — always `k3d-<name>`. */
|
|
48
|
+
context: string;
|
|
49
|
+
/**
|
|
50
|
+
* Path of the dedicated kubeconfig (`k3d kubeconfig write <name>`), present
|
|
51
|
+
* whenever the caller did not explicitly merge into the default kubeconfig —
|
|
52
|
+
* without it the context exists nowhere a later `kubectl` step could find it.
|
|
53
|
+
*/
|
|
54
|
+
kubeconfigPath?: string;
|
|
55
|
+
}
|
|
56
|
+
/** `k3d cluster list <name> --no-headers` — non-empty stdout means the cluster exists. */
|
|
57
|
+
export declare function k3dExistsCommand(name: string): string;
|
|
58
|
+
/** kubectl context name k3d assigns a cluster: `k3d-<name>`. */
|
|
59
|
+
export declare function k3dContextName(name: string): string;
|
|
60
|
+
/** `k3d kubeconfig write <name>` — prints the path of the written kubeconfig. */
|
|
61
|
+
export declare function k3dKubeconfigWriteCommand(name: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* Build the `k3d cluster create` command.
|
|
64
|
+
*
|
|
65
|
+
* Kubeconfig behavior: upstream k3d merges the new cluster into the default
|
|
66
|
+
* kubeconfig and switches the current context. Chant defaults both to `false`
|
|
67
|
+
* (see {@link K3dUpArgs.updateDefaultKubeconfig}) — but only forces its
|
|
68
|
+
* defaults when no `configFile` is given. Each kubeconfig flag is emitted when
|
|
69
|
+
* the caller set it explicitly, or when there is no `configFile`; with a
|
|
70
|
+
* `configFile` and the arg unset, the flag is omitted so the declared config's
|
|
71
|
+
* `options.kubeconfig` governs.
|
|
72
|
+
*/
|
|
73
|
+
export declare function k3dUpCommand(args: K3dUpArgs): string;
|
|
74
|
+
/** Build the `k3d cluster delete` command. */
|
|
75
|
+
export declare function k3dDownCommand(args: K3dDownArgs): string;
|
|
76
|
+
/**
|
|
77
|
+
* Create a local k3d cluster (vanilla Kubernetes in Docker). Idempotent: if a
|
|
78
|
+
* cluster of the same name already exists it is left as-is. Uses longInfra
|
|
79
|
+
* profile — 20m timeout, heartbeat every 15s (creation may pull the k3s image).
|
|
80
|
+
*
|
|
81
|
+
* Unlike the upstream CLI, this does NOT touch the caller's default kubeconfig
|
|
82
|
+
* or current context unless asked (see {@link K3dUpArgs.updateDefaultKubeconfig}).
|
|
83
|
+
* It returns the context name and, when the default kubeconfig was left alone,
|
|
84
|
+
* the path of a dedicated kubeconfig — pass those to the steps that apply
|
|
85
|
+
* manifests afterwards.
|
|
86
|
+
*/
|
|
87
|
+
export declare function k3dUp(args: K3dUpArgs, signal?: AbortSignal): Promise<K3dUpResult>;
|
|
88
|
+
/**
|
|
89
|
+
* Delete a local k3d cluster. Uses fastIdempotent profile — 5m timeout.
|
|
90
|
+
* `k3d cluster delete` is a no-op success when the cluster is already gone.
|
|
91
|
+
*/
|
|
92
|
+
export declare function k3dDown(args: K3dDownArgs, signal?: AbortSignal): Promise<void>;
|
|
93
|
+
//# sourceMappingURL=k3d.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"k3d.d.ts","sourceRoot":"","sources":["../../../src/op/activities/k3d.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,SAAS;IACxB,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;;;;;OAYG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,WAAW;IAC1B,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,8DAA8D;AAC9D,MAAM,WAAW,WAAW;IAC1B,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,0FAA0F;AAC1F,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,gEAAgE;AAChE,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,iFAAiF;AACjF,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAiBpD;AAED,8CAA8C;AAC9C,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAExD;AAyBD;;;;;;;;;;GAUG;AACH,wBAAsB,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAwBvF;AAED;;;GAGG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAIpF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-cli.d.ts","sourceRoot":"","sources":["../src/package-cli.ts"],"names":[],"mappings":""}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAiC,MAAM,0BAA0B,CAAC;AAa7F;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,aA+FvB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* k3d SimpleConfig YAML serializer.
|
|
3
|
+
*
|
|
4
|
+
* Emits the config file `k3d cluster create --config` consumes verbatim —
|
|
5
|
+
* the walk-away artifact that justifies a lexicon here at all. One YAML
|
|
6
|
+
* document per declared Cluster: the first is the primary output, any
|
|
7
|
+
* further clusters land in files[] keyed `<name>.k3d.yaml`.
|
|
8
|
+
*
|
|
9
|
+
* Three things are non-negotiable in the output (#1408):
|
|
10
|
+
*
|
|
11
|
+
* - `apiVersion` and `kind` are literal schema properties, not derived
|
|
12
|
+
* from a type name. They default when undeclared and are never dropped.
|
|
13
|
+
* - Booleans stay booleans and zero stays zero. `agents: 0` is the normal
|
|
14
|
+
* local shape and `updateDefaultKubeconfig: "false"` is truthy.
|
|
15
|
+
* - `nodeFilters` pass through untouched — they are k3d's own syntax
|
|
16
|
+
* (`server:0`, `agent:*`, `loadbalancer`) and rewriting them here would
|
|
17
|
+
* be inventing a dialect.
|
|
18
|
+
*
|
|
19
|
+
* ## The kubeconfig default is chant's, not upstream's
|
|
20
|
+
*
|
|
21
|
+
* When a declaration says nothing about `options.kubeconfig`, the emitted
|
|
22
|
+
* config pins `updateDefaultKubeconfig: false` and `switchCurrentContext:
|
|
23
|
+
* false` — the opposite of k3d's own defaults, chosen deliberately (#1411):
|
|
24
|
+
* a tool that reconciles infrastructure must not rewrite ~/.kube/config or
|
|
25
|
+
* repoint the caller's shell as a side effect. Injecting the values into the
|
|
26
|
+
* artifact rather than relying on activity flags means the emitted YAML says
|
|
27
|
+
* on its face what creating the cluster will do, and `k3d --config` applied
|
|
28
|
+
* by hand behaves identically. A declaration that sets `options.kubeconfig`
|
|
29
|
+
* itself — either key — is passed through exactly as written; upstream
|
|
30
|
+
* defaults then apply to whatever it left unset, because a partially
|
|
31
|
+
* explicit block is the author taking the wheel.
|
|
32
|
+
*/
|
|
33
|
+
import type { Serializer } from "@intentius/chant/serializer";
|
|
34
|
+
export declare const k3dSerializer: Serializer;
|
|
35
|
+
//# sourceMappingURL=serializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAsC,MAAM,6BAA6B,CAAC;AA8IlG,eAAO,MAAM,aAAa,EAAE,UAwB3B,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* k3d SimpleConfig schema fetching — downloads the JSON Schema and
|
|
3
|
+
* caches it locally.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Pinned upstream k3d release.
|
|
7
|
+
*
|
|
8
|
+
* The schema is fetched from the tagged source tree, not a moving branch:
|
|
9
|
+
* https://raw.githubusercontent.com/k3d-io/k3d/v5.9.0/pkg/config/v1alpha5/schema.json
|
|
10
|
+
*
|
|
11
|
+
* v1alpha5 is the config apiVersion this lexicon models. Older config
|
|
12
|
+
* versions (v1alpha2..v1alpha4) each ship their own migrate.go upstream —
|
|
13
|
+
* k3d migrates old configs itself, so modelling superseded versions here
|
|
14
|
+
* would duplicate upstream's job. Bump this constant (and re-generate)
|
|
15
|
+
* when adopting a newer k3d release.
|
|
16
|
+
*/
|
|
17
|
+
export declare const K3D_VERSION = "v5.9.0";
|
|
18
|
+
/**
|
|
19
|
+
* Get the cache file path for the k3d schema.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getCachePath(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Fetch the k3d SimpleConfig JSON Schema.
|
|
24
|
+
* Uses local file caching with 24-hour TTL.
|
|
25
|
+
*/
|
|
26
|
+
export declare function fetchConfigSchema(force?: boolean): Promise<Buffer>;
|
|
27
|
+
/**
|
|
28
|
+
* Fetch the config schema as a Map<typeName, Buffer> compatible with the
|
|
29
|
+
* generatePipeline fetchSchemas callback.
|
|
30
|
+
*
|
|
31
|
+
* Single document keyed by "K3d::Cluster" — the parse step splits it into
|
|
32
|
+
* multiple entities.
|
|
33
|
+
*/
|
|
34
|
+
export declare function fetchSchemas(force?: boolean): Promise<Map<string, Buffer>>;
|
|
35
|
+
/**
|
|
36
|
+
* Clear the cached schema file.
|
|
37
|
+
*/
|
|
38
|
+
export declare function clearCache(): void;
|
|
39
|
+
//# sourceMappingURL=fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/spec/fetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,WAAW,CAAC;AAIpC;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAQxE;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAKhF;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAEjC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test fixture loader for the k3d lexicon.
|
|
3
|
+
*
|
|
4
|
+
* The fixture is a verbatim copy of the pinned upstream schema
|
|
5
|
+
* (see src/spec/fetch.ts for the pin), committed so codegen tests
|
|
6
|
+
* run offline.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Load the pinned SimpleConfig schema fixture for offline testing.
|
|
10
|
+
*/
|
|
11
|
+
export declare function loadSchemaFixture(): Buffer;
|
|
12
|
+
/**
|
|
13
|
+
* Load the schema fixture as a Map compatible with generatePipeline.
|
|
14
|
+
*/
|
|
15
|
+
export declare function loadSchemaFixtureMap(): Map<string, Buffer>;
|
|
16
|
+
//# sourceMappingURL=load-fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-fixtures.d.ts","sourceRoot":"","sources":["../../src/testdata/load-fixtures.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAG1C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAI1D"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
// Code generated by chant k3d generate. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
// --- k3d Entity classes ---
|
|
4
|
+
|
|
5
|
+
export declare class Cluster {
|
|
6
|
+
constructor(props: {
|
|
7
|
+
apiVersion: "k3d.io/v1alpha5";
|
|
8
|
+
kind: "Simple";
|
|
9
|
+
agents?: number;
|
|
10
|
+
env?: EnvVar[];
|
|
11
|
+
files?: File[];
|
|
12
|
+
/** Additional IP to multiple hostnames mappings */
|
|
13
|
+
hostAliases?: HostAlias[];
|
|
14
|
+
image?: string;
|
|
15
|
+
kubeAPI?: KubeAPI;
|
|
16
|
+
metadata?: Metadata;
|
|
17
|
+
network?: string;
|
|
18
|
+
options?: Options;
|
|
19
|
+
ports?: Port[];
|
|
20
|
+
registries?: Registries;
|
|
21
|
+
servers?: number;
|
|
22
|
+
subnet?: string;
|
|
23
|
+
token?: string;
|
|
24
|
+
volumes?: Volume[];
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export declare class EnvVar {
|
|
29
|
+
constructor(props: {
|
|
30
|
+
envVar?: string;
|
|
31
|
+
nodeFilters?: string[];
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export declare class File {
|
|
36
|
+
constructor(props: {
|
|
37
|
+
destination: string;
|
|
38
|
+
source: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
nodeFilters?: string[];
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export declare class HostAlias {
|
|
45
|
+
constructor(props: {
|
|
46
|
+
hostnames?: string[];
|
|
47
|
+
ip?: string;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export declare class K3dOptions {
|
|
52
|
+
constructor(props: {
|
|
53
|
+
disableImageVolume?: boolean;
|
|
54
|
+
disableLoadbalancer?: boolean;
|
|
55
|
+
disableRollback?: boolean;
|
|
56
|
+
loadbalancer?: LoadbalancerOptions;
|
|
57
|
+
timeout?: string;
|
|
58
|
+
wait?: boolean;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export declare class K3sExtraArg {
|
|
63
|
+
constructor(props: {
|
|
64
|
+
arg?: string;
|
|
65
|
+
nodeFilters?: string[];
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export declare class K3sOptions {
|
|
70
|
+
constructor(props: {
|
|
71
|
+
extraArgs?: K3sExtraArg[];
|
|
72
|
+
nodeLabels?: NodeLabel[];
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export declare class KubeAPI {
|
|
77
|
+
constructor(props: {
|
|
78
|
+
host?: string;
|
|
79
|
+
hostIP?: string;
|
|
80
|
+
hostPort?: string;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export declare class KubeconfigOptions {
|
|
85
|
+
constructor(props: {
|
|
86
|
+
switchCurrentContext?: boolean;
|
|
87
|
+
updateDefaultKubeconfig?: boolean;
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export declare class LoadbalancerOptions {
|
|
92
|
+
constructor(props: {
|
|
93
|
+
configOverrides?: any[];
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export declare class Metadata {
|
|
98
|
+
constructor(props: {
|
|
99
|
+
/** Name of the cluster (must be a valid hostname and will be prefixed with 'k3d-'). Example: 'mycluster'. */
|
|
100
|
+
name?: string;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export declare class NodeLabel {
|
|
105
|
+
constructor(props: {
|
|
106
|
+
label?: string;
|
|
107
|
+
nodeFilters?: string[];
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export declare class Options {
|
|
112
|
+
constructor(props: {
|
|
113
|
+
k3d?: K3dOptions;
|
|
114
|
+
k3s?: K3sOptions;
|
|
115
|
+
kubeconfig?: KubeconfigOptions;
|
|
116
|
+
runtime?: RuntimeOptions;
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export declare class Port {
|
|
121
|
+
constructor(props: {
|
|
122
|
+
nodeFilters?: string[];
|
|
123
|
+
port?: string;
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export declare class Registries {
|
|
128
|
+
constructor(props: {
|
|
129
|
+
/** Reference a K3s registry configuration file or at it's contents here. */
|
|
130
|
+
config?: string;
|
|
131
|
+
/** Create a new container image registry alongside the cluster. */
|
|
132
|
+
create?: RegistryCreate;
|
|
133
|
+
/** Connect another container image registry to the cluster. */
|
|
134
|
+
use?: string[];
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export declare class RegistryCreate {
|
|
139
|
+
constructor(props: {
|
|
140
|
+
enforcePortMatch?: boolean;
|
|
141
|
+
host?: string;
|
|
142
|
+
hostPort?: string;
|
|
143
|
+
image?: string;
|
|
144
|
+
name?: string;
|
|
145
|
+
proxy?: RegistryProxy;
|
|
146
|
+
volumes?: string[];
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export declare class RegistryProxy {
|
|
151
|
+
constructor(props: {
|
|
152
|
+
password?: string;
|
|
153
|
+
remoteURL?: string;
|
|
154
|
+
username?: string;
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export declare class RuntimeLabel {
|
|
159
|
+
constructor(props: {
|
|
160
|
+
label?: string;
|
|
161
|
+
nodeFilters?: string[];
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export declare class RuntimeOptions {
|
|
166
|
+
constructor(props: {
|
|
167
|
+
agentsMemory?: string;
|
|
168
|
+
gpuRequest?: string;
|
|
169
|
+
hostPidMode?: boolean;
|
|
170
|
+
labels?: RuntimeLabel[];
|
|
171
|
+
serversMemory?: string;
|
|
172
|
+
ulimits?: Ulimit[];
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export declare class Ulimit {
|
|
177
|
+
constructor(props: {
|
|
178
|
+
hard?: number;
|
|
179
|
+
name?: string;
|
|
180
|
+
soft?: number;
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export declare class Volume {
|
|
185
|
+
constructor(props: {
|
|
186
|
+
nodeFilters?: string[];
|
|
187
|
+
volume?: string;
|
|
188
|
+
});
|
|
189
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-cli.d.ts","sourceRoot":"","sources":["../src/validate-cli.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate generated lexicon-k3d artifacts.
|
|
3
|
+
*
|
|
4
|
+
* Thin wrapper around the core validation framework
|
|
5
|
+
* with k3d-specific configuration.
|
|
6
|
+
*/
|
|
7
|
+
import { type ValidateResult } from "@intentius/chant/codegen/validate";
|
|
8
|
+
export type { ValidateCheck, ValidateResult } from "@intentius/chant/codegen/validate";
|
|
9
|
+
/**
|
|
10
|
+
* Validate the generated lexicon-k3d artifacts.
|
|
11
|
+
*/
|
|
12
|
+
export declare function validate(opts?: {
|
|
13
|
+
basePath?: string;
|
|
14
|
+
}): Promise<ValidateResult>;
|
|
15
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAElG,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAKvF;;GAEG;AACH,wBAAsB,QAAQ,CAAC,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAQpF"}
|