@vibesdotdev/infra-core 0.0.1 → 1.0.0-rc.11
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/LICENSE +18 -0
- package/README.md +34 -63
- package/dist/bootstrap/seed.descriptor.d.ts +1 -1
- package/dist/bootstrap/seed.descriptor.d.ts.map +1 -1
- package/dist/bootstrap/seed.descriptor.js +1 -1
- package/dist/bootstrap/seed.descriptor.js.map +1 -1
- package/dist/bootstrap/seed.impl-shape.d.ts +1 -1
- package/dist/bootstrap/seed.impl-shape.d.ts.map +1 -1
- package/dist/bootstrap/seed.kind.d.ts +1 -3
- package/dist/bootstrap/seed.kind.d.ts.map +1 -1
- package/dist/bootstrap/seed.kind.js +17 -4
- package/dist/bootstrap/seed.kind.js.map +1 -1
- package/dist/bootstrap/seed.runner.d.ts +9 -2
- package/dist/bootstrap/seed.runner.d.ts.map +1 -1
- package/dist/bootstrap/seed.runner.js +37 -18
- package/dist/bootstrap/seed.runner.js.map +1 -1
- package/dist/capped-id.d.ts +19 -0
- package/dist/capped-id.d.ts.map +1 -0
- package/dist/capped-id.js +64 -0
- package/dist/capped-id.js.map +1 -0
- package/dist/cli/generate/artifact/artifact.cli-command.descriptor.d.ts +23 -0
- package/dist/cli/generate/artifact/artifact.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/generate/artifact/artifact.cli-command.descriptor.js +33 -0
- package/dist/cli/generate/artifact/artifact.cli-command.descriptor.js.map +1 -0
- package/dist/cli/generate/artifact/artifact.cli-command.impl.d.ts +24 -0
- package/dist/cli/generate/artifact/artifact.cli-command.impl.d.ts.map +1 -0
- package/dist/cli/generate/artifact/artifact.cli-command.impl.js +73 -0
- package/dist/cli/generate/artifact/artifact.cli-command.impl.js.map +1 -0
- package/dist/cli/generate/context.d.ts +17 -0
- package/dist/cli/generate/context.d.ts.map +1 -0
- package/dist/cli/generate/context.js +24 -0
- package/dist/cli/generate/context.js.map +1 -0
- package/dist/cli/generate/generate/generate.cli-command.descriptor.d.ts +30 -0
- package/dist/cli/generate/generate/generate.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/generate/generate/generate.cli-command.descriptor.js +25 -0
- package/dist/cli/generate/generate/generate.cli-command.descriptor.js.map +1 -0
- package/dist/cli/generate/generate/generate.cli-command.impl.d.ts +25 -0
- package/dist/cli/generate/generate/generate.cli-command.impl.d.ts.map +1 -0
- package/dist/cli/generate/generate/generate.cli-command.impl.js +64 -0
- package/dist/cli/generate/generate/generate.cli-command.impl.js.map +1 -0
- package/dist/cli/generate/generate-core.d.ts +51 -0
- package/dist/cli/generate/generate-core.d.ts.map +1 -0
- package/dist/cli/generate/generate-core.js +172 -0
- package/dist/cli/generate/generate-core.js.map +1 -0
- package/dist/cli/generate/index.d.ts +5 -0
- package/dist/cli/generate/index.d.ts.map +1 -0
- package/dist/cli/generate/index.js +5 -0
- package/dist/cli/generate/index.js.map +1 -0
- package/dist/credentials/resolve.d.ts +82 -22
- package/dist/credentials/resolve.d.ts.map +1 -1
- package/dist/credentials/resolve.js +251 -77
- package/dist/credentials/resolve.js.map +1 -1
- package/dist/deployment-budget.d.ts +319 -0
- package/dist/deployment-budget.d.ts.map +1 -0
- package/dist/deployment-budget.js +660 -0
- package/dist/deployment-budget.js.map +1 -0
- package/dist/deployment-environment.d.ts +30 -0
- package/dist/deployment-environment.d.ts.map +1 -0
- package/dist/deployment-environment.js +53 -0
- package/dist/deployment-environment.js.map +1 -0
- package/dist/deployment-graph.d.ts +185 -0
- package/dist/deployment-graph.d.ts.map +1 -0
- package/dist/deployment-graph.js +705 -0
- package/dist/deployment-graph.js.map +1 -0
- package/dist/deployment.d.ts +25 -4
- package/dist/deployment.d.ts.map +1 -1
- package/dist/deployment.js +105 -0
- package/dist/deployment.js.map +1 -1
- package/dist/doks/cloud/base.d.ts +49 -0
- package/dist/doks/cloud/base.d.ts.map +1 -0
- package/dist/doks/cloud/base.js +138 -0
- package/dist/doks/cloud/base.js.map +1 -0
- package/dist/doks/cloud/factory.d.ts +18 -0
- package/dist/doks/cloud/factory.d.ts.map +1 -0
- package/dist/doks/cloud/factory.js +22 -0
- package/dist/doks/cloud/factory.js.map +1 -0
- package/dist/doks/cloud/index.d.ts +5 -0
- package/dist/doks/cloud/index.d.ts.map +1 -0
- package/dist/doks/cloud/index.js +4 -0
- package/dist/doks/cloud/index.js.map +1 -0
- package/dist/doks/types.d.ts +95 -0
- package/dist/doks/types.d.ts.map +1 -0
- package/dist/doks/types.js +14 -0
- package/dist/doks/types.js.map +1 -0
- package/dist/generate/index.d.ts +29 -0
- package/dist/generate/index.d.ts.map +1 -0
- package/dist/generate/index.js +28 -0
- package/dist/generate/index.js.map +1 -0
- package/dist/generate/infra-generate.plugin.d.ts +3 -0
- package/dist/generate/infra-generate.plugin.d.ts.map +1 -0
- package/dist/generate/infra-generate.plugin.js +23 -0
- package/dist/generate/infra-generate.plugin.js.map +1 -0
- package/dist/generate/plugin.d.ts +2 -0
- package/dist/generate/plugin.d.ts.map +1 -0
- package/dist/generate/plugin.js +2 -0
- package/dist/generate/plugin.js.map +1 -0
- package/dist/heartbeat/cron-heartbeat.d.ts +97 -0
- package/dist/heartbeat/cron-heartbeat.d.ts.map +1 -0
- package/dist/heartbeat/cron-heartbeat.js +200 -0
- package/dist/heartbeat/cron-heartbeat.js.map +1 -0
- package/dist/index.d.ts +37 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -14
- package/dist/index.js.map +1 -1
- package/dist/infra.plugin.d.ts +1 -1
- package/dist/infra.plugin.d.ts.map +1 -1
- package/dist/infra.plugin.js +64 -12
- package/dist/infra.plugin.js.map +1 -1
- package/dist/kinds/alerts.kind.d.ts +64 -25
- package/dist/kinds/alerts.kind.d.ts.map +1 -1
- package/dist/kinds/alerts.kind.js +43 -16
- package/dist/kinds/alerts.kind.js.map +1 -1
- package/dist/kinds/artifact.kind.d.ts +58 -10
- package/dist/kinds/artifact.kind.d.ts.map +1 -1
- package/dist/kinds/artifact.kind.js +26 -9
- package/dist/kinds/artifact.kind.js.map +1 -1
- package/dist/kinds/billing.kind.d.ts +88 -0
- package/dist/kinds/billing.kind.d.ts.map +1 -0
- package/dist/kinds/billing.kind.js +48 -0
- package/dist/kinds/billing.kind.js.map +1 -0
- package/dist/kinds/build-job.kind.d.ts +383 -0
- package/dist/kinds/build-job.kind.d.ts.map +1 -0
- package/dist/kinds/build-job.kind.js +218 -0
- package/dist/kinds/build-job.kind.js.map +1 -0
- package/dist/kinds/cache-byte-store.d.ts +23 -0
- package/dist/kinds/cache-byte-store.d.ts.map +1 -0
- package/dist/kinds/cache-byte-store.js +9 -0
- package/dist/kinds/cache-byte-store.js.map +1 -0
- package/dist/kinds/cache.kind.d.ts +38 -94
- package/dist/kinds/cache.kind.d.ts.map +1 -1
- package/dist/kinds/cache.kind.js +39 -50
- package/dist/kinds/cache.kind.js.map +1 -1
- package/dist/kinds/cluster.kind.d.ts +154 -0
- package/dist/kinds/cluster.kind.d.ts.map +1 -0
- package/dist/kinds/cluster.kind.js +99 -0
- package/dist/kinds/cluster.kind.js.map +1 -0
- package/dist/kinds/compute-source.kind.d.ts +155 -0
- package/dist/kinds/compute-source.kind.d.ts.map +1 -0
- package/dist/kinds/compute-source.kind.js +158 -0
- package/dist/kinds/compute-source.kind.js.map +1 -0
- package/dist/kinds/container-registry.kind.d.ts +62 -0
- package/dist/kinds/container-registry.kind.d.ts.map +1 -0
- package/dist/kinds/container-registry.kind.js +47 -0
- package/dist/kinds/container-registry.kind.js.map +1 -0
- package/dist/kinds/database-migrator.kind.d.ts +6 -0
- package/dist/kinds/database-migrator.kind.d.ts.map +1 -0
- package/dist/kinds/database-migrator.kind.js +28 -0
- package/dist/kinds/database-migrator.kind.js.map +1 -0
- package/dist/kinds/database.kind.d.ts +114 -93
- package/dist/kinds/database.kind.d.ts.map +1 -1
- package/dist/kinds/database.kind.js +93 -54
- package/dist/kinds/database.kind.js.map +1 -1
- package/dist/kinds/deployment-provider.kind.d.ts +5 -0
- package/dist/kinds/deployment-provider.kind.d.ts.map +1 -0
- package/dist/kinds/deployment-provider.kind.js +11 -0
- package/dist/kinds/deployment-provider.kind.js.map +1 -0
- package/dist/kinds/discovery.d.ts +5 -12
- package/dist/kinds/discovery.d.ts.map +1 -1
- package/dist/kinds/discovery.js +5 -17
- package/dist/kinds/discovery.js.map +1 -1
- package/dist/kinds/dns.kind.d.ts +162 -0
- package/dist/kinds/dns.kind.d.ts.map +1 -0
- package/dist/kinds/dns.kind.js +54 -0
- package/dist/kinds/dns.kind.js.map +1 -0
- package/dist/kinds/drift.kind.d.ts +115 -0
- package/dist/kinds/drift.kind.d.ts.map +1 -0
- package/dist/kinds/drift.kind.js +60 -0
- package/dist/kinds/drift.kind.js.map +1 -0
- package/dist/kinds/edge-hostname.kind.d.ts +124 -0
- package/dist/kinds/edge-hostname.kind.d.ts.map +1 -0
- package/dist/kinds/edge-hostname.kind.js +87 -0
- package/dist/kinds/edge-hostname.kind.js.map +1 -0
- package/dist/kinds/edge-tls.kind.d.ts +194 -0
- package/dist/kinds/edge-tls.kind.d.ts.map +1 -0
- package/dist/kinds/edge-tls.kind.js +58 -0
- package/dist/kinds/edge-tls.kind.js.map +1 -0
- package/dist/kinds/firewall.kind.d.ts +92 -0
- package/dist/kinds/firewall.kind.d.ts.map +1 -0
- package/dist/kinds/firewall.kind.js +59 -0
- package/dist/kinds/firewall.kind.js.map +1 -0
- package/dist/kinds/git-hosting.kind.d.ts +36 -38
- package/dist/kinds/git-hosting.kind.d.ts.map +1 -1
- package/dist/kinds/git-hosting.kind.js +23 -34
- package/dist/kinds/git-hosting.kind.js.map +1 -1
- package/dist/kinds/index.d.ts +41 -15
- package/dist/kinds/index.d.ts.map +1 -1
- package/dist/kinds/index.js +40 -14
- package/dist/kinds/index.js.map +1 -1
- package/dist/kinds/inventory.kind.d.ts +245 -0
- package/dist/kinds/inventory.kind.d.ts.map +1 -0
- package/dist/kinds/inventory.kind.js +243 -0
- package/dist/kinds/inventory.kind.js.map +1 -0
- package/dist/kinds/load-balancer.kind.d.ts +135 -0
- package/dist/kinds/load-balancer.kind.d.ts.map +1 -0
- package/dist/kinds/load-balancer.kind.js +71 -0
- package/dist/kinds/load-balancer.kind.js.map +1 -0
- package/dist/kinds/logs.kind.d.ts +74 -3
- package/dist/kinds/logs.kind.d.ts.map +1 -1
- package/dist/kinds/logs.kind.js +26 -17
- package/dist/kinds/logs.kind.js.map +1 -1
- package/dist/kinds/nfs.kind.d.ts +67 -0
- package/dist/kinds/nfs.kind.d.ts.map +1 -0
- package/dist/kinds/nfs.kind.js +45 -0
- package/dist/kinds/nfs.kind.js.map +1 -0
- package/dist/kinds/node-pool.kind.d.ts +134 -0
- package/dist/kinds/node-pool.kind.d.ts.map +1 -0
- package/dist/kinds/node-pool.kind.js +88 -0
- package/dist/kinds/node-pool.kind.js.map +1 -0
- package/dist/kinds/object-storage.kind.d.ts +50 -24
- package/dist/kinds/object-storage.kind.d.ts.map +1 -1
- package/dist/kinds/object-storage.kind.js +40 -23
- package/dist/kinds/object-storage.kind.js.map +1 -1
- package/dist/kinds/observability.kind.d.ts +104 -6
- package/dist/kinds/observability.kind.d.ts.map +1 -1
- package/dist/kinds/observability.kind.js +67 -9
- package/dist/kinds/observability.kind.js.map +1 -1
- package/dist/kinds/package-registry.kind.d.ts +141 -35
- package/dist/kinds/package-registry.kind.d.ts.map +1 -1
- package/dist/kinds/package-registry.kind.js +55 -25
- package/dist/kinds/package-registry.kind.js.map +1 -1
- package/dist/kinds/queue.kind.d.ts +67 -63
- package/dist/kinds/queue.kind.d.ts.map +1 -1
- package/dist/kinds/queue.kind.js +55 -33
- package/dist/kinds/queue.kind.js.map +1 -1
- package/dist/kinds/read-descriptor.d.ts +15 -0
- package/dist/kinds/read-descriptor.d.ts.map +1 -0
- package/dist/kinds/read-descriptor.js +11 -0
- package/dist/kinds/read-descriptor.js.map +1 -0
- package/dist/kinds/rum.kind.d.ts +36 -6
- package/dist/kinds/rum.kind.d.ts.map +1 -1
- package/dist/kinds/rum.kind.js +6 -7
- package/dist/kinds/rum.kind.js.map +1 -1
- package/dist/kinds/sandbox.kind.d.ts +136 -40
- package/dist/kinds/sandbox.kind.d.ts.map +1 -1
- package/dist/kinds/sandbox.kind.js +82 -43
- package/dist/kinds/sandbox.kind.js.map +1 -1
- package/dist/kinds/select-compute-source.d.ts +72 -0
- package/dist/kinds/select-compute-source.d.ts.map +1 -0
- package/dist/kinds/select-compute-source.js +170 -0
- package/dist/kinds/select-compute-source.js.map +1 -0
- package/dist/kinds/service-release.kind.d.ts +771 -0
- package/dist/kinds/service-release.kind.d.ts.map +1 -0
- package/dist/kinds/service-release.kind.js +676 -0
- package/dist/kinds/service-release.kind.js.map +1 -0
- package/dist/kinds/spend-guard.kind.d.ts +41 -0
- package/dist/kinds/spend-guard.kind.d.ts.map +1 -0
- package/dist/kinds/spend-guard.kind.js +140 -0
- package/dist/kinds/spend-guard.kind.js.map +1 -0
- package/dist/kinds/utilization.kind.d.ts +88 -0
- package/dist/kinds/utilization.kind.d.ts.map +1 -0
- package/dist/kinds/utilization.kind.js +62 -0
- package/dist/kinds/utilization.kind.js.map +1 -0
- package/dist/kinds/volume.kind.d.ts +54 -0
- package/dist/kinds/volume.kind.d.ts.map +1 -0
- package/dist/kinds/volume.kind.js +39 -0
- package/dist/kinds/volume.kind.js.map +1 -0
- package/dist/kinds/vpc.kind.d.ts +61 -0
- package/dist/kinds/vpc.kind.d.ts.map +1 -0
- package/dist/kinds/vpc.kind.js +51 -0
- package/dist/kinds/vpc.kind.js.map +1 -0
- package/dist/kinds/web-app.kind.d.ts +118 -45
- package/dist/kinds/web-app.kind.d.ts.map +1 -1
- package/dist/kinds/web-app.kind.js +69 -42
- package/dist/kinds/web-app.kind.js.map +1 -1
- package/dist/kinds/worker.kind.d.ts +129 -188
- package/dist/kinds/worker.kind.d.ts.map +1 -1
- package/dist/kinds/worker.kind.js +45 -123
- package/dist/kinds/worker.kind.js.map +1 -1
- package/dist/schemas/database-migration.d.ts +173 -0
- package/dist/schemas/database-migration.d.ts.map +1 -0
- package/dist/schemas/database-migration.js +88 -0
- package/dist/schemas/database-migration.js.map +1 -0
- package/dist/schemas/deployment-environment.d.ts +11 -0
- package/dist/schemas/deployment-environment.d.ts.map +1 -0
- package/dist/schemas/deployment-environment.js +9 -0
- package/dist/schemas/deployment-environment.js.map +1 -0
- package/dist/schemas/deployment-provider.d.ts +383 -0
- package/dist/schemas/deployment-provider.d.ts.map +1 -0
- package/dist/schemas/deployment-provider.js +211 -0
- package/dist/schemas/deployment-provider.js.map +1 -0
- package/dist/schemas/log-stream.d.ts +27 -0
- package/dist/schemas/log-stream.d.ts.map +1 -0
- package/dist/schemas/log-stream.js +31 -0
- package/dist/schemas/log-stream.js.map +1 -0
- package/dist/schemas/spend-guard.d.ts +155 -0
- package/dist/schemas/spend-guard.d.ts.map +1 -0
- package/dist/schemas/spend-guard.js +61 -0
- package/dist/schemas/spend-guard.js.map +1 -0
- package/dist/schemas.d.ts +195 -20
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +151 -31
- package/dist/schemas.js.map +1 -1
- package/dist/service.d.ts +87 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +199 -0
- package/dist/service.js.map +1 -0
- package/dist/settle-work.d.ts +20 -0
- package/dist/settle-work.d.ts.map +1 -0
- package/dist/settle-work.js +22 -0
- package/dist/settle-work.js.map +1 -0
- package/dist/web-app-projection.d.ts +208 -0
- package/dist/web-app-projection.d.ts.map +1 -0
- package/dist/web-app-projection.js +95 -0
- package/dist/web-app-projection.js.map +1 -0
- package/package.json +123 -40
- package/SPEC.md +0 -169
- package/src/bootstrap/index.ts +0 -15
- package/src/bootstrap/seed.descriptor.ts +0 -24
- package/src/bootstrap/seed.impl-shape.ts +0 -5
- package/src/bootstrap/seed.kind.ts +0 -26
- package/src/bootstrap/seed.runner.ts +0 -87
- package/src/credentials/resolve.ts +0 -205
- package/src/deployment.ts +0 -57
- package/src/index.ts +0 -149
- package/src/infra.plugin.ts +0 -54
- package/src/kinds/alerts.kind.ts +0 -164
- package/src/kinds/artifact.kind.ts +0 -96
- package/src/kinds/cache.kind.ts +0 -104
- package/src/kinds/database.kind.ts +0 -120
- package/src/kinds/discovery.ts +0 -26
- package/src/kinds/git-hosting.kind.ts +0 -100
- package/src/kinds/index.ts +0 -139
- package/src/kinds/logs.kind.ts +0 -104
- package/src/kinds/object-storage.kind.ts +0 -101
- package/src/kinds/observability.kind.ts +0 -178
- package/src/kinds/package-registry.kind.ts +0 -95
- package/src/kinds/queue.kind.ts +0 -102
- package/src/kinds/rum.kind.ts +0 -135
- package/src/kinds/sandbox.kind.ts +0 -115
- package/src/kinds/web-app.kind.ts +0 -103
- package/src/kinds/worker.kind.ts +0 -203
- package/src/schemas.ts +0 -127
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kind: infra/vpc
|
|
3
|
+
*
|
|
4
|
+
* Provider-neutral virtual private cloud (VPC) descriptor.
|
|
5
|
+
*
|
|
6
|
+
* `config` is an open, adapter-keyed shape (DigitalOcean's VPC config lives
|
|
7
|
+
* in `@vibesdotdev/integrations-digitalocean`); this kind names no provider,
|
|
8
|
+
* so a config for any adapter parses here and the adapter validates its own
|
|
9
|
+
* grammar.
|
|
10
|
+
*/
|
|
11
|
+
import * as z from 'zod/v4';
|
|
12
|
+
import { createRuntimeKind } from '@vibesdotdev/kernel/factory/kind';
|
|
13
|
+
import { RuntimeDescriptorSchema } from '@vibesdotdev/kernel/schemas/descriptor';
|
|
14
|
+
import { readKindDescriptor } from "./read-descriptor.js";
|
|
15
|
+
import { INFRA_DISCOVERY_PATTERNS } from "./discovery.js";
|
|
16
|
+
const VpcBaseSchema = RuntimeDescriptorSchema.extend({
|
|
17
|
+
kind: z.literal('infra/vpc'),
|
|
18
|
+
region: z.string().min(1).optional(),
|
|
19
|
+
ipRange: z.string().min(1).optional()
|
|
20
|
+
});
|
|
21
|
+
/**
|
|
22
|
+
* Adapter-specific configuration: the adapter id plus its own fields. Each
|
|
23
|
+
* adapter package defines and parses its own config schema; this kind names
|
|
24
|
+
* no provider, so a config for any adapter — including one contributed by a
|
|
25
|
+
* user plugin — parses here, and the adapter validates its own grammar.
|
|
26
|
+
*/
|
|
27
|
+
export const VpcConfigSchema = z.looseObject({
|
|
28
|
+
adapter: z.string().min(1)
|
|
29
|
+
});
|
|
30
|
+
export const VpcDescriptorSchema = VpcBaseSchema.extend({
|
|
31
|
+
/** Adapter-specific configuration, parsed by the adapter that owns it. */
|
|
32
|
+
config: VpcConfigSchema.optional()
|
|
33
|
+
});
|
|
34
|
+
class DefaultVpcImplementation {
|
|
35
|
+
descriptor;
|
|
36
|
+
context;
|
|
37
|
+
/** The descriptor as this kind's schema reads it. */
|
|
38
|
+
config;
|
|
39
|
+
constructor(descriptor, context) {
|
|
40
|
+
this.descriptor = descriptor;
|
|
41
|
+
this.context = context;
|
|
42
|
+
this.config = readKindDescriptor(VpcDescriptorSchema, descriptor);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export const vpcKind = createRuntimeKind({
|
|
46
|
+
id: 'infra/vpc',
|
|
47
|
+
descriptorSchema: VpcDescriptorSchema,
|
|
48
|
+
defaultImplementation: DefaultVpcImplementation,
|
|
49
|
+
discoveryPatterns: INFRA_DISCOVERY_PATTERNS
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=vpc.kind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vpc.kind.js","sourceRoot":"","sources":["../../src/kinds/vpc.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAGjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EA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strict common base + embedded `deployment` + open provider `config`.
|
|
7
7
|
*
|
|
8
8
|
* - The base defines fields universal across every adapter:
|
|
9
9
|
* id/kind/name + the deployment shape every web-app declares
|
|
10
10
|
* (domain, appDir, outputDir, runtime, env, dependsOn).
|
|
11
|
+
* - `deployment` carries the complete neutral deployment declaration; the
|
|
12
|
+
* common base fields must agree with it, so the two surfaces cannot drift.
|
|
11
13
|
* - Adapter-specific fields (cfWorkerName, secretsStoreId, digitaloceanAppName, …)
|
|
12
|
-
* live exclusively under `config
|
|
13
|
-
*
|
|
14
|
+
* live exclusively under `config`, keyed by the `adapter` discriminator.
|
|
15
|
+
* A neutral kind cannot enumerate every vendor grammar, so `config`
|
|
16
|
+
* retains all provider fields and the selected provider validates them.
|
|
17
|
+
* Provider config schemas are owned by the integrations that implement
|
|
18
|
+
* each adapter: Cloudflare Workers' lives in
|
|
19
|
+
* `@vibesdotdev/integrations-cloudflare`
|
|
20
|
+
* (`CloudflareWorkersWebAppConfigSchema`), DigitalOcean App Platform's in
|
|
21
|
+
* `@vibesdotdev/integrations-digitalocean`
|
|
22
|
+
* (`DigitalOceanAppWebAppConfigSchema`).
|
|
14
23
|
*/
|
|
15
|
-
import * as z from
|
|
16
|
-
import type {
|
|
17
|
-
import type {
|
|
24
|
+
import * as z from "zod/v4";
|
|
25
|
+
import type { RuntimeDescriptor } from '@vibesdotdev/kernel/schemas/descriptor';
|
|
26
|
+
import type { KindContext } from '@vibesdotdev/kernel/schemas/kind';
|
|
27
|
+
import type { WebAppProjection, WebAppProjectionOptions } from "../web-app-projection.ts";
|
|
18
28
|
export declare const WebAppDependencySchema: z.ZodObject<{
|
|
19
29
|
serviceId: z.ZodString;
|
|
20
30
|
reason: z.ZodOptional<z.ZodString>;
|
|
21
31
|
}, z.core.$strip>;
|
|
22
32
|
export type WebAppDependency = z.infer<typeof WebAppDependencySchema>;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}, z.core.$
|
|
31
|
-
export
|
|
32
|
-
digitaloceanAppName: z.ZodString;
|
|
33
|
-
}, z.core.$strip>;
|
|
34
|
-
export declare const WebAppConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
35
|
-
cfWorkerName: z.ZodString;
|
|
36
|
-
workerEntry: z.ZodDefault<z.ZodString>;
|
|
37
|
-
compatibilityDate: z.ZodOptional<z.ZodString>;
|
|
38
|
-
compatibilityFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
39
|
-
env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
40
|
-
secretsStoreId: z.ZodOptional<z.ZodString>;
|
|
41
|
-
adapter: z.ZodLiteral<"cloudflare-workers">;
|
|
42
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
43
|
-
digitaloceanAppName: z.ZodString;
|
|
44
|
-
adapter: z.ZodLiteral<"digitalocean-apps">;
|
|
45
|
-
}, z.core.$strip>]>;
|
|
33
|
+
/**
|
|
34
|
+
* Open, adapter-discriminated provider config: only the non-empty `adapter`
|
|
35
|
+
* discriminator is fixed; every provider field is retained for the adapter
|
|
36
|
+
* that owns it to validate.
|
|
37
|
+
*/
|
|
38
|
+
export declare const WebAppConfigSchema: z.ZodObject<{
|
|
39
|
+
adapter: z.ZodString;
|
|
40
|
+
}, z.core.$catchall<z.ZodUnknown>>;
|
|
41
|
+
export type WebAppConfig = z.infer<typeof WebAppConfigSchema>;
|
|
46
42
|
export declare const WebAppDescriptorSchema: z.ZodObject<{
|
|
47
43
|
id: z.ZodString;
|
|
48
44
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -51,8 +47,18 @@ export declare const WebAppDescriptorSchema: z.ZodObject<{
|
|
|
51
47
|
hardware: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
52
48
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
53
49
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
capabilityId: z.ZodOptional<z.ZodString>;
|
|
54
51
|
requiredContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
55
52
|
optionalContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
53
|
+
retention: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
54
|
+
maxAgeDays: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
maxEntries: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
maxBytes: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
cascadeFrom: z.ZodOptional<z.ZodString>;
|
|
58
|
+
ageField: z.ZodOptional<z.ZodString>;
|
|
59
|
+
reason: z.ZodString;
|
|
60
|
+
enforcedBy: z.ZodOptional<z.ZodString>;
|
|
61
|
+
}, z.core.$strip>]>>;
|
|
56
62
|
kind: z.ZodLiteral<"infra/web-app">;
|
|
57
63
|
domain: z.ZodString;
|
|
58
64
|
appDir: z.ZodString;
|
|
@@ -69,31 +75,98 @@ export declare const WebAppDescriptorSchema: z.ZodObject<{
|
|
|
69
75
|
secret: z.ZodOptional<z.ZodBoolean>;
|
|
70
76
|
description: z.ZodOptional<z.ZodString>;
|
|
71
77
|
storeKey: z.ZodOptional<z.ZodString>;
|
|
78
|
+
storeBinding: z.ZodOptional<z.ZodBoolean>;
|
|
72
79
|
}, z.core.$strip>>>;
|
|
73
80
|
dependsOn: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
74
81
|
serviceId: z.ZodString;
|
|
75
82
|
reason: z.ZodOptional<z.ZodString>;
|
|
76
83
|
}, z.core.$strip>>>;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
deployment: z.ZodObject<{
|
|
85
|
+
appId: z.ZodString;
|
|
86
|
+
appName: z.ZodString;
|
|
87
|
+
provider: z.ZodString;
|
|
88
|
+
providerPlugin: z.ZodOptional<z.ZodString>;
|
|
89
|
+
runtime: z.ZodEnum<{
|
|
90
|
+
browser: "browser";
|
|
91
|
+
worker: "worker";
|
|
92
|
+
edge: "edge";
|
|
93
|
+
node: "node";
|
|
94
|
+
}>;
|
|
95
|
+
build: z.ZodObject<{
|
|
96
|
+
workspaceRootDir: z.ZodDefault<z.ZodString>;
|
|
97
|
+
appDir: z.ZodString;
|
|
98
|
+
installCommand: z.ZodOptional<z.ZodString>;
|
|
99
|
+
buildCommand: z.ZodString;
|
|
100
|
+
outputDir: z.ZodString;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
origins: z.ZodArray<z.ZodObject<{
|
|
103
|
+
hostname: z.ZodString;
|
|
104
|
+
origin: z.ZodString;
|
|
105
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
106
|
+
internal: "internal";
|
|
107
|
+
primary: "primary";
|
|
108
|
+
redirect: "redirect";
|
|
109
|
+
preview: "preview";
|
|
110
|
+
alias: "alias";
|
|
111
|
+
}>>;
|
|
112
|
+
description: z.ZodOptional<z.ZodString>;
|
|
113
|
+
}, z.core.$strip>>;
|
|
114
|
+
env: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
115
|
+
name: z.ZodString;
|
|
116
|
+
public: z.ZodOptional<z.ZodBoolean>;
|
|
117
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
118
|
+
value: z.ZodOptional<z.ZodString>;
|
|
119
|
+
secret: z.ZodOptional<z.ZodBoolean>;
|
|
120
|
+
description: z.ZodOptional<z.ZodString>;
|
|
121
|
+
storeKey: z.ZodOptional<z.ZodString>;
|
|
122
|
+
storeBinding: z.ZodOptional<z.ZodBoolean>;
|
|
123
|
+
}, z.core.$strip>>>;
|
|
124
|
+
dependsOn: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
125
|
+
appId: z.ZodString;
|
|
126
|
+
reason: z.ZodString;
|
|
127
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
128
|
+
}, z.core.$strip>>>;
|
|
129
|
+
upstreams: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
130
|
+
name: z.ZodString;
|
|
131
|
+
origin: z.ZodString;
|
|
132
|
+
purpose: z.ZodString;
|
|
133
|
+
originEnvVar: z.ZodOptional<z.ZodString>;
|
|
134
|
+
}, z.core.$strip>>>;
|
|
135
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
136
|
+
kvNamespaces: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
137
|
+
binding: z.ZodString;
|
|
138
|
+
id: z.ZodString;
|
|
139
|
+
preview_id: z.ZodOptional<z.ZodString>;
|
|
140
|
+
}, z.core.$strip>>>;
|
|
141
|
+
preDeployCommands: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
142
|
+
command: z.ZodString;
|
|
143
|
+
description: z.ZodOptional<z.ZodString>;
|
|
144
|
+
}, z.core.$strip>>>;
|
|
145
|
+
execution: z.ZodOptional<z.ZodObject<{
|
|
146
|
+
pty: z.ZodOptional<z.ZodBoolean>;
|
|
147
|
+
shell: z.ZodOptional<z.ZodBoolean>;
|
|
148
|
+
maxSessions: z.ZodOptional<z.ZodNumber>;
|
|
149
|
+
}, z.core.$strip>>;
|
|
150
|
+
edge: z.ZodOptional<z.ZodObject<{
|
|
151
|
+
purgePaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
152
|
+
}, z.core.$strip>>;
|
|
153
|
+
migrations: z.ZodOptional<z.ZodObject<{
|
|
154
|
+
requiredForLocalDev: z.ZodDefault<z.ZodBoolean>;
|
|
155
|
+
}, z.core.$strip>>;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
config: z.ZodObject<{
|
|
158
|
+
adapter: z.ZodString;
|
|
159
|
+
}, z.core.$catchall<z.ZodUnknown>>;
|
|
89
160
|
}, z.core.$strip>;
|
|
90
161
|
export type WebAppDescriptor = z.infer<typeof WebAppDescriptorSchema>;
|
|
91
162
|
declare class DefaultWebAppImplementation {
|
|
92
163
|
readonly descriptor: RuntimeDescriptor;
|
|
93
|
-
readonly context:
|
|
94
|
-
|
|
95
|
-
|
|
164
|
+
readonly context: KindContext;
|
|
165
|
+
/** The descriptor as this kind's schema reads it. */
|
|
166
|
+
readonly config: WebAppDescriptor;
|
|
167
|
+
constructor(descriptor: RuntimeDescriptor, context: KindContext);
|
|
168
|
+
project(input: WebAppProjectionOptions): Promise<WebAppProjection>;
|
|
96
169
|
}
|
|
97
|
-
export declare const webAppKind: RuntimeKindDescriptorRecord<DefaultWebAppImplementation>;
|
|
170
|
+
export declare const webAppKind: import("@vibesdotdev/kernel").RuntimeKindDescriptorRecord<DefaultWebAppImplementation>;
|
|
98
171
|
export {};
|
|
99
172
|
//# sourceMappingURL=web-app.kind.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-app.kind.d.ts","sourceRoot":"","sources":["../../src/kinds/web-app.kind.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"web-app.kind.d.ts","sourceRoot":"","sources":["../../src/kinds/web-app.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAIpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAI1F,eAAO,MAAM,sBAAsB;;;iBAGjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAwBtE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;;kCAEP,CAAC;AACzB,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,cAAM,2BAA2B;aAIb,UAAU,EAAE,iBAAiB;aAC7B,OAAO,EAAE,WAAW;IAJtC,qDAAqD;IACrD,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;gBAEhB,UAAU,EAAE,iBAAiB,EAC7B,OAAO,EAAE,WAAW;IAKhC,OAAO,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAezE;AAED,eAAO,MAAM,UAAU,wFAQrB,CAAC"}
|
|
@@ -3,26 +3,37 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Describes a deployable web application (SvelteKit, static site, etc.).
|
|
5
5
|
*
|
|
6
|
-
* Schema shape: strict common base + `
|
|
6
|
+
* Schema shape: strict common base + embedded `deployment` + open provider `config`.
|
|
7
7
|
*
|
|
8
8
|
* - The base defines fields universal across every adapter:
|
|
9
9
|
* id/kind/name + the deployment shape every web-app declares
|
|
10
10
|
* (domain, appDir, outputDir, runtime, env, dependsOn).
|
|
11
|
+
* - `deployment` carries the complete neutral deployment declaration; the
|
|
12
|
+
* common base fields must agree with it, so the two surfaces cannot drift.
|
|
11
13
|
* - Adapter-specific fields (cfWorkerName, secretsStoreId, digitaloceanAppName, …)
|
|
12
|
-
* live exclusively under `config
|
|
13
|
-
*
|
|
14
|
+
* live exclusively under `config`, keyed by the `adapter` discriminator.
|
|
15
|
+
* A neutral kind cannot enumerate every vendor grammar, so `config`
|
|
16
|
+
* retains all provider fields and the selected provider validates them.
|
|
17
|
+
* Provider config schemas are owned by the integrations that implement
|
|
18
|
+
* each adapter: Cloudflare Workers' lives in
|
|
19
|
+
* `@vibesdotdev/integrations-cloudflare`
|
|
20
|
+
* (`CloudflareWorkersWebAppConfigSchema`), DigitalOcean App Platform's in
|
|
21
|
+
* `@vibesdotdev/integrations-digitalocean`
|
|
22
|
+
* (`DigitalOceanAppWebAppConfigSchema`).
|
|
14
23
|
*/
|
|
15
|
-
import * as z from
|
|
16
|
-
import { createRuntimeKind } from
|
|
17
|
-
import { RuntimeDescriptorSchema } from
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
24
|
+
import * as z from "zod/v4";
|
|
25
|
+
import { createRuntimeKind } from "@vibesdotdev/kernel/factory/kind";
|
|
26
|
+
import { RuntimeDescriptorSchema } from "@vibesdotdev/kernel/schemas/descriptor";
|
|
27
|
+
import { readKindDescriptor } from "./read-descriptor.js";
|
|
28
|
+
import { appDeploymentSchema, deploymentEnvRequirementSchema } from "../schemas.js";
|
|
29
|
+
import { CapabilityError } from "@vibesdotdev/kernel";
|
|
30
|
+
import { INFRA_DISCOVERY_PATTERNS } from "./discovery.js";
|
|
20
31
|
export const WebAppDependencySchema = z.object({
|
|
21
32
|
serviceId: z.string().min(1),
|
|
22
|
-
reason: z.string().optional()
|
|
33
|
+
reason: z.string().optional(),
|
|
23
34
|
});
|
|
24
35
|
const WebAppBaseSchema = RuntimeDescriptorSchema.extend({
|
|
25
|
-
kind: z.literal(
|
|
36
|
+
kind: z.literal("infra/web-app"),
|
|
26
37
|
/** Primary domain for this app (e.g., 'auth.vibes.dev'). */
|
|
27
38
|
domain: z.string().min(1),
|
|
28
39
|
/** Application source directory (e.g., 'apps/auth-web'). */
|
|
@@ -30,57 +41,73 @@ const WebAppBaseSchema = RuntimeDescriptorSchema.extend({
|
|
|
30
41
|
/** Build output directory (e.g., '.svelte-kit/cloudflare'). */
|
|
31
42
|
outputDir: z.string().min(1),
|
|
32
43
|
/** Runtime environment for app deployments. */
|
|
33
|
-
runtime: z.enum([
|
|
44
|
+
runtime: z.enum(["edge", "node"]),
|
|
34
45
|
/** Environment variable requirements. */
|
|
35
46
|
env: z.array(deploymentEnvRequirementSchema).optional(),
|
|
36
47
|
/** Service dependencies. */
|
|
37
|
-
dependsOn: z.array(WebAppDependencySchema).optional()
|
|
48
|
+
dependsOn: z.array(WebAppDependencySchema).optional(),
|
|
38
49
|
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
compatibilityFlags: z.array(z.string()).default(['nodejs_compat']),
|
|
48
|
-
/** Environment variables to include. */
|
|
49
|
-
env: z.record(z.string(), z.string()).default({}),
|
|
50
|
-
/** Cloudflare Secrets Store ID for secret bindings. */
|
|
51
|
-
secretsStoreId: z.string().min(1).optional()
|
|
52
|
-
});
|
|
53
|
-
export const DigitalOceanAppWebAppConfigSchema = z.object({
|
|
54
|
-
/** DigitalOcean App name. */
|
|
55
|
-
digitaloceanAppName: z.string().min(1)
|
|
56
|
-
});
|
|
57
|
-
export const WebAppConfigSchema = z.union([
|
|
58
|
-
CloudflareWorkersWebAppConfigSchema.extend({ adapter: z.literal('cloudflare-workers') }),
|
|
59
|
-
DigitalOceanAppWebAppConfigSchema.extend({ adapter: z.literal('digitalocean-apps') })
|
|
60
|
-
]);
|
|
50
|
+
/**
|
|
51
|
+
* Open, adapter-discriminated provider config: only the non-empty `adapter`
|
|
52
|
+
* discriminator is fixed; every provider field is retained for the adapter
|
|
53
|
+
* that owns it to validate.
|
|
54
|
+
*/
|
|
55
|
+
export const WebAppConfigSchema = z.strictObject({
|
|
56
|
+
adapter: z.string().min(1),
|
|
57
|
+
}).catchall(z.unknown());
|
|
61
58
|
export const WebAppDescriptorSchema = WebAppBaseSchema.extend({
|
|
59
|
+
/** Complete deployment choices; no module evaluator supplies missing data. */
|
|
60
|
+
deployment: appDeploymentSchema,
|
|
62
61
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
62
|
+
* Provider fields are retained here, and validated by the selected provider.
|
|
63
|
+
* A neutral kind cannot strip fields through an incomplete vendor grammar.
|
|
65
64
|
*/
|
|
66
|
-
config: WebAppConfigSchema
|
|
65
|
+
config: WebAppConfigSchema,
|
|
66
|
+
}).superRefine((descriptor, context) => {
|
|
67
|
+
const primary = descriptor.deployment.origins.find((origin) => origin.kind === 'primary') ??
|
|
68
|
+
descriptor.deployment.origins[0];
|
|
69
|
+
for (const [field, expected] of [
|
|
70
|
+
['domain', primary?.hostname],
|
|
71
|
+
['appDir', descriptor.deployment.build.appDir],
|
|
72
|
+
['outputDir', descriptor.deployment.build.outputDir],
|
|
73
|
+
['runtime', descriptor.deployment.runtime],
|
|
74
|
+
]) {
|
|
75
|
+
if (descriptor[field] !== expected) {
|
|
76
|
+
context.addIssue({
|
|
77
|
+
code: 'custom',
|
|
78
|
+
path: [field],
|
|
79
|
+
message: 'Common deployment metadata must agree with the declared deployment.',
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
67
83
|
});
|
|
68
84
|
class DefaultWebAppImplementation {
|
|
69
85
|
descriptor;
|
|
70
86
|
context;
|
|
87
|
+
/** The descriptor as this kind's schema reads it. */
|
|
88
|
+
config;
|
|
71
89
|
constructor(descriptor, context) {
|
|
72
90
|
this.descriptor = descriptor;
|
|
73
91
|
this.context = context;
|
|
92
|
+
this.config = readKindDescriptor(WebAppDescriptorSchema, descriptor);
|
|
74
93
|
}
|
|
75
|
-
|
|
76
|
-
|
|
94
|
+
async project(input) {
|
|
95
|
+
const providers = this.context.runtime
|
|
96
|
+
.query('infra/deployment-provider')
|
|
97
|
+
.withId(this.config.deployment.provider);
|
|
98
|
+
const unavailable = () => new CapabilityError('No provider projection is registered for this web app.', 'UNAVAILABLE', { reason: 'web-app-projection-unavailable', details: { id: this.descriptor.id } });
|
|
99
|
+
if (providers.descriptors({ requireImpl: true }).length === 0)
|
|
100
|
+
throw unavailable();
|
|
101
|
+
const provider = await providers.resolve();
|
|
102
|
+
if (provider.projectWebApp === undefined)
|
|
103
|
+
throw unavailable();
|
|
104
|
+
return provider.projectWebApp(this.config, input);
|
|
77
105
|
}
|
|
78
106
|
}
|
|
79
107
|
export const webAppKind = createRuntimeKind({
|
|
80
|
-
id:
|
|
108
|
+
id: "infra/web-app",
|
|
81
109
|
descriptorSchema: WebAppDescriptorSchema,
|
|
82
110
|
defaultImplementation: DefaultWebAppImplementation,
|
|
83
|
-
|
|
84
|
-
extractStem
|
|
111
|
+
discoveryPatterns: INFRA_DISCOVERY_PATTERNS,
|
|
85
112
|
});
|
|
86
113
|
//# sourceMappingURL=web-app.kind.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-app.kind.js","sourceRoot":"","sources":["../../src/kinds/web-app.kind.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"web-app.kind.js","sourceRoot":"","sources":["../../src/kinds/web-app.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAGjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC;AAGH,MA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