typekro 0.16.1 → 0.18.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.
Files changed (28) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/core/deployment/kro-factory.d.ts +9 -0
  3. package/dist/core/deployment/kro-factory.d.ts.map +1 -1
  4. package/dist/core/deployment/kro-factory.js +197 -8
  5. package/dist/core/deployment/kro-factory.js.map +1 -1
  6. package/dist/core/expressions/composition/composition-analyzer-helpers.d.ts.map +1 -1
  7. package/dist/core/expressions/composition/composition-analyzer-helpers.js +9 -7
  8. package/dist/core/expressions/composition/composition-analyzer-helpers.js.map +1 -1
  9. package/dist/core/types/deployment.d.ts +31 -1
  10. package/dist/core/types/deployment.d.ts.map +1 -1
  11. package/dist/core/types/deployment.js.map +1 -1
  12. package/dist/factories/caddy/compositions/caddy-ingress.d.ts +39 -7
  13. package/dist/factories/caddy/compositions/caddy-ingress.d.ts.map +1 -1
  14. package/dist/factories/caddy/compositions/caddy-ingress.js +67 -34
  15. package/dist/factories/caddy/compositions/caddy-ingress.js.map +1 -1
  16. package/dist/factories/caddy/compositions/index.d.ts +1 -1
  17. package/dist/factories/caddy/compositions/index.d.ts.map +1 -1
  18. package/dist/factories/caddy/compositions/index.js +1 -1
  19. package/dist/factories/caddy/compositions/index.js.map +1 -1
  20. package/dist/factories/caddy/index.d.ts +7 -4
  21. package/dist/factories/caddy/index.d.ts.map +1 -1
  22. package/dist/factories/caddy/index.js +7 -4
  23. package/dist/factories/caddy/index.js.map +1 -1
  24. package/dist/factories/caddy/types.d.ts +35 -14
  25. package/dist/factories/caddy/types.d.ts.map +1 -1
  26. package/dist/factories/caddy/types.js +22 -8
  27. package/dist/factories/caddy/types.js.map +1 -1
  28. package/package.json +1 -1
@@ -3,35 +3,30 @@
3
3
  *
4
4
  * Caddy here is a CONFIG-DRIVEN reverse proxy (not the Caddy ingress-controller, and not a Helm
5
5
  * bootstrap): the composition runs the official `caddy` image with a Caddyfile we supply, and emits a
6
- * ConfigMap (Caddyfile) + Deployment + Service + PVC. Caddy's built-in `tls internal` issues certs from a
7
- * local CA (no cert-manager), so the PVC persists `/data` (the CA root) across restarts.
6
+ * ConfigMap (Caddyfile) + Deployment + Service + a `/data` volume. Caddy's built-in `tls internal` issues
7
+ * certs from a local CA (no cert-manager). By default `/data` is a PVC so the CA root persists across
8
+ * restarts; `makeCaddyIngress({ ephemeral: true })` uses an `emptyDir` instead (CA regenerates per pod),
9
+ * and that variant takes no `persistence` config (see `CaddyIngressEphemeralConfigSchema`).
8
10
  *
9
11
  * KRO-safety note: the Caddyfile is supplied as a STRING (`caddyfile`), not derived from a structured
10
12
  * `routes` array inside the composition. A `routes` array would be a graph proxy in KRO mode and cannot be
11
13
  * `.map()`-ed into a string (see integration-skill rules 32/48). Use the exported `renderCaddyfile()`
12
14
  * helper to build the string from routes in concrete (consumer/direct) contexts, then pass it here.
13
15
  */
14
- /**
15
- * Caddy ingress config. `caddyfile` is the raw Caddyfile content (the routing + TLS config), supplied as
16
- * a string so it passes through unchanged in both direct and KRO modes.
17
- *
18
- * Undeclared keys are REJECTED (`'+': 'reject'`) so misconfig fails loudly rather than being silently
19
- * dropped — notably `replicaCount`: this composition is single-replica by design (the `tls internal` CA
20
- * lives in a RWO PVC one pod owns), so a replica knob would invite a broken multi-pod-shares-RWO setup.
21
- */
16
+ /** The default (PVC-backed) Caddy-ingress config. `persistence` sizes the `/data` PVC. */
22
17
  export declare const CaddyIngressConfigSchema: import("arktype/internal/variants/object.ts").ObjectType<{
23
18
  name: string;
24
19
  caddyfile: string;
20
+ persistence?: {
21
+ size?: string;
22
+ storageClass?: string;
23
+ };
25
24
  namespace?: string;
26
25
  image?: string;
27
26
  version?: string;
28
27
  httpPort?: number;
29
28
  httpsPort?: number;
30
29
  serviceType?: "ClusterIP" | "NodePort" | "LoadBalancer";
31
- persistence?: {
32
- size?: string;
33
- storageClass?: string;
34
- };
35
30
  resources?: {
36
31
  requests?: {
37
32
  cpu?: string;
@@ -44,6 +39,32 @@ export declare const CaddyIngressConfigSchema: import("arktype/internal/variants
44
39
  };
45
40
  }, {}>;
46
41
  export type CaddyIngressConfig = typeof CaddyIngressConfigSchema.infer;
42
+ /**
43
+ * The ephemeral (emptyDir) Caddy-ingress config — used by `makeCaddyIngress({ ephemeral: true })`. It has
44
+ * NO `persistence` field: there is no PVC to size, so a `persistence` value would be silently ignored.
45
+ * The inherited `'+': 'reject'` makes passing `persistence` (or any unknown key) fail loudly instead.
46
+ */
47
+ export declare const CaddyIngressEphemeralConfigSchema: import("arktype/internal/variants/object.ts").ObjectType<{
48
+ name: string;
49
+ caddyfile: string;
50
+ namespace?: string;
51
+ image?: string;
52
+ version?: string;
53
+ httpPort?: number;
54
+ httpsPort?: number;
55
+ serviceType?: "ClusterIP" | "NodePort" | "LoadBalancer";
56
+ resources?: {
57
+ requests?: {
58
+ cpu?: string;
59
+ memory?: string;
60
+ };
61
+ limits?: {
62
+ cpu?: string;
63
+ memory?: string;
64
+ };
65
+ };
66
+ }, {}>;
67
+ export type CaddyIngressEphemeralConfig = typeof CaddyIngressEphemeralConfigSchema.infer;
47
68
  /**
48
69
  * Caddy ingress status. `ready` is a direct Deployment-proxy comparison (multi-resource non-Helm
49
70
  * composition → no `Cel.expr`/conditions array): `status.readyReplicas >= spec.replicas`. The Deployment
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/factories/caddy/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAoBH;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;MAsBnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,wBAAwB,CAAC,KAAK,CAAC;AAEvE;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB;;;MAGnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,wBAAwB,CAAC,KAAK,CAAC;AAEvE,uGAAuG;AACvG,MAAM,WAAW,UAAU;IACzB,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,qGAAqG;IACrG,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,uCAAuC;AACvC,MAAM,WAAW,sBAAsB;IACrC,8FAA8F;IAC9F,GAAG,CAAC,EAAE,UAAU,GAAG,KAAK,CAAC;CAC1B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/factories/caddy/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAoDH,0FAA0F;AAC1F,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;MAInC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,wBAAwB,CAAC,KAAK,CAAC;AAEvE;;;;GAIG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;MAAqC,CAAC;AACpF,MAAM,MAAM,2BAA2B,GAAG,OAAO,iCAAiC,CAAC,KAAK,CAAC;AAEzF;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB;;;MAGnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,wBAAwB,CAAC,KAAK,CAAC;AAEvE,uGAAuG;AACvG,MAAM,WAAW,UAAU;IACzB,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,qGAAqG;IACrG,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,uCAAuC;AACvC,MAAM,WAAW,sBAAsB;IACrC,8FAA8F;IAC9F,GAAG,CAAC,EAAE,UAAU,GAAG,KAAK,CAAC;CAC1B"}
@@ -3,8 +3,10 @@
3
3
  *
4
4
  * Caddy here is a CONFIG-DRIVEN reverse proxy (not the Caddy ingress-controller, and not a Helm
5
5
  * bootstrap): the composition runs the official `caddy` image with a Caddyfile we supply, and emits a
6
- * ConfigMap (Caddyfile) + Deployment + Service + PVC. Caddy's built-in `tls internal` issues certs from a
7
- * local CA (no cert-manager), so the PVC persists `/data` (the CA root) across restarts.
6
+ * ConfigMap (Caddyfile) + Deployment + Service + a `/data` volume. Caddy's built-in `tls internal` issues
7
+ * certs from a local CA (no cert-manager). By default `/data` is a PVC so the CA root persists across
8
+ * restarts; `makeCaddyIngress({ ephemeral: true })` uses an `emptyDir` instead (CA regenerates per pod),
9
+ * and that variant takes no `persistence` config (see `CaddyIngressEphemeralConfigSchema`).
8
10
  *
9
11
  * KRO-safety note: the Caddyfile is supplied as a STRING (`caddyfile`), not derived from a structured
10
12
  * `routes` array inside the composition. A `routes` array would be a graph proxy in KRO mode and cannot be
@@ -18,9 +20,11 @@ const resourceRequirementsSchemaShape = {
18
20
  'limits?': { 'cpu?': 'string', 'memory?': 'string' },
19
21
  };
20
22
  /**
21
- * Sizing for the PVC backing Caddy's `/data` (the `tls internal` CA root + issued certs). The PVC is
22
- * always created persisting the CA root is required so it's stable across restarts; an ephemeral/emptyDir
23
- * mode isn't offered because a conditional volume can't be expressed safely in KRO (compound includeWhen).
23
+ * Sizing for the PVC backing Caddy's `/data` (the `tls internal` CA root + issued certs), persisting the
24
+ * CA across restarts. An `emptyDir` alternative IS available, but as a BUILD-TIME option on the
25
+ * composition (`makeCaddyIngress({ ephemeral: true })`), not a spec field the storage choice is made
26
+ * when the composition is constructed, so it selects the resource set statically and never needs a KRO
27
+ * runtime conditional. (A spec-field toggle would require an unsafe compound `includeWhen`.)
24
28
  */
25
29
  const persistenceSchemaShape = {
26
30
  'size?': 'string',
@@ -34,7 +38,7 @@ const persistenceSchemaShape = {
34
38
  * dropped — notably `replicaCount`: this composition is single-replica by design (the `tls internal` CA
35
39
  * lives in a RWO PVC one pod owns), so a replica knob would invite a broken multi-pod-shares-RWO setup.
36
40
  */
37
- export const CaddyIngressConfigSchema = type({
41
+ const baseCaddyIngressShape = {
38
42
  '+': 'reject',
39
43
  name: 'string',
40
44
  'namespace?': 'string',
@@ -53,10 +57,20 @@ export const CaddyIngressConfigSchema = type({
53
57
  'httpsPort?': 'number',
54
58
  /** Service type (default ClusterIP — reached via the access tunnel; no public LB). */
55
59
  'serviceType?': '"ClusterIP" | "NodePort" | "LoadBalancer"',
56
- /** Sizing for the always-created `/data` PVC that holds the `tls internal` CA root (default 1Gi). */
57
- 'persistence?': persistenceSchemaShape,
58
60
  'resources?': resourceRequirementsSchemaShape,
61
+ };
62
+ /** The default (PVC-backed) Caddy-ingress config. `persistence` sizes the `/data` PVC. */
63
+ export const CaddyIngressConfigSchema = type({
64
+ ...baseCaddyIngressShape,
65
+ /** Sizing for the `/data` PVC that holds the `tls internal` CA root (default 1Gi). PVC mode only. */
66
+ 'persistence?': persistenceSchemaShape,
59
67
  });
68
+ /**
69
+ * The ephemeral (emptyDir) Caddy-ingress config — used by `makeCaddyIngress({ ephemeral: true })`. It has
70
+ * NO `persistence` field: there is no PVC to size, so a `persistence` value would be silently ignored.
71
+ * The inherited `'+': 'reject'` makes passing `persistence` (or any unknown key) fail loudly instead.
72
+ */
73
+ export const CaddyIngressEphemeralConfigSchema = type({ ...baseCaddyIngressShape });
60
74
  /**
61
75
  * Caddy ingress status. `ready` is a direct Deployment-proxy comparison (multi-resource non-Helm
62
76
  * composition → no `Cel.expr`/conditions array): `status.readyReplicas >= spec.replicas`. The Deployment
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/factories/caddy/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,yDAAyD;AACzD,MAAM,+BAA+B,GAAG;IACtC,WAAW,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE;IACtD,SAAS,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE;CAC5C,CAAC;AAEX;;;;GAIG;AACH,MAAM,sBAAsB,GAAG;IAC7B,OAAO,EAAE,QAAQ;IACjB,eAAe,EAAE,QAAQ;CACj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E,QAAQ;IACnB,2EAA2E;IAC3E,QAAQ,EAAE,QAAQ;IAClB;;;OAGG;IACH,UAAU,EAAE,QAAQ;IACpB,kEAAkE;IAClE,WAAW,EAAE,QAAQ;IACrB,oEAAoE;IACpE,YAAY,EAAE,QAAQ;IACtB,sFAAsF;IACtF,cAAc,EAAE,2CAA2C;IAC3D,YAAY,EAAE,+BAA+B;CACrC,CAAC;AAEX,0FAA0F;AAC1F,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;IAC3C,GAAG,qBAAqB;IACxB,qGAAqG;IACrG,cAAc,EAAE,sBAAsB;CACvC,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,IAAI,CAAC,EAAE,GAAG,qBAAqB,EAAE,CAAC,CAAC;AAGpF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;IAC3C,KAAK,EAAE,SAAS;IAChB,UAAU,EAAE,QAAQ;CACrB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typekro",
3
- "version": "0.16.1",
3
+ "version": "0.18.0",
4
4
  "description": "A control plane aware framework for orchestrating kubernetes resources like a programmer.",
5
5
  "type": "module",
6
6
  "repository": {