@fabrika/provider-cloudflare 0.9.0-cloudflare.3 → 0.9.0-dev.10
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/package.json +10 -10
- package/src/cli-args.ts +2 -2
- package/src/installation/templates/README.md +1 -1
- package/src/provider.ts +12 -0
- package/types/src/provider.d.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabrika/provider-cloudflare",
|
|
3
|
-
"version": "0.9.0-
|
|
3
|
+
"version": "0.9.0-dev.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"zod": "^3.25.76",
|
|
46
|
-
"@fabrika/app": "0.9.0-
|
|
47
|
-
"@fabrika/auth": "0.9.0-
|
|
48
|
-
"@fabrika/auth-core": "0.9.0-
|
|
49
|
-
"@fabrika/check": "0.9.0-
|
|
50
|
-
"@fabrika/email": "0.9.0-
|
|
51
|
-
"@fabrika/iam-contract": "0.9.0-
|
|
52
|
-
"@fabrika/installation-init": "0.9.0-
|
|
53
|
-
"@fabrika/proxy-core": "0.9.0-
|
|
54
|
-
"@fabrika/provider-contract": "0.9.0-
|
|
46
|
+
"@fabrika/app": "0.9.0-dev.10",
|
|
47
|
+
"@fabrika/auth": "0.9.0-dev.10",
|
|
48
|
+
"@fabrika/auth-core": "0.9.0-dev.10",
|
|
49
|
+
"@fabrika/check": "0.9.0-dev.10",
|
|
50
|
+
"@fabrika/email": "0.9.0-dev.10",
|
|
51
|
+
"@fabrika/iam-contract": "0.9.0-dev.10",
|
|
52
|
+
"@fabrika/installation-init": "0.9.0-dev.10",
|
|
53
|
+
"@fabrika/proxy-core": "0.9.0-dev.10",
|
|
54
|
+
"@fabrika/provider-contract": "0.9.0-dev.10",
|
|
55
55
|
"ignore": "^5.3.2",
|
|
56
56
|
"oblaka-iac": "^0.0.18"
|
|
57
57
|
}
|
package/src/cli-args.ts
CHANGED
|
@@ -84,7 +84,7 @@ export const platformComponents = (selection: PlatformComponentSelection): reado
|
|
|
84
84
|
throw new Error('Missing --worker-config=<path> for `platform deploy`')
|
|
85
85
|
}
|
|
86
86
|
return [
|
|
87
|
-
{ label: '
|
|
88
|
-
{ label: '
|
|
87
|
+
{ label: 'runner', configPath: runnerConfig },
|
|
88
|
+
{ label: 'control', configPath: workerConfig },
|
|
89
89
|
]
|
|
90
90
|
}
|
|
@@ -7,7 +7,7 @@ fabrika control-plane base so the control plane never deploys itself:
|
|
|
7
7
|
Stage 1 — IAM (root authz)
|
|
8
8
|
Stage 2 — Operations
|
|
9
9
|
Stage 3 — fabrika runner + control plane
|
|
10
|
-
apps (
|
|
10
|
+
apps (crm, notes, …) ← deployed through fabrika, not here
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
Generated and maintained by **`fabrika platform init --provider=cloudflare {{ACCOUNT}}`** (`@fabrika/cli`). Secrets and variables live in
|
package/src/provider.ts
CHANGED
|
@@ -532,6 +532,15 @@ const stageAssets = async (env: StepEnv, assets: NonNullable<StepEnv['spaAssets'
|
|
|
532
532
|
env.run.log(` staged ${staged} SPA files into ${SPA_ASSETS_DIRECTORY}: ${mounts}`)
|
|
533
533
|
}
|
|
534
534
|
|
|
535
|
+
/**
|
|
536
|
+
* The secrets stored for the environment that `fabrika.config.ts` does not name in `pipeline.secrets`, by name. The deploy
|
|
537
|
+
* writes only declared ones, so these never reach the Worker; the run log says so, as an author would otherwise wonder.
|
|
538
|
+
*/
|
|
539
|
+
export const undeclaredSecrets = (config: CloudflareAppConfig, run: Pick<CloudflareDeployRun, 'secrets'>): string[] => {
|
|
540
|
+
const declared = new Set(config.pipeline?.secrets ?? [])
|
|
541
|
+
return Object.keys(run.secrets).filter((name) => !declared.has(name)).sort()
|
|
542
|
+
}
|
|
543
|
+
|
|
535
544
|
const runStep = async (spec: CloudflareStep, env: StepEnv): Promise<void> => {
|
|
536
545
|
const { config, run, credentials, worker, dir, cf } = env
|
|
537
546
|
const { signal, dryRun } = run
|
|
@@ -587,6 +596,9 @@ const runStep = async (spec: CloudflareStep, env: StepEnv): Promise<void> => {
|
|
|
587
596
|
return
|
|
588
597
|
}
|
|
589
598
|
case 'deploy-worker': {
|
|
599
|
+
for (const name of undeclaredSecrets(config, run)) {
|
|
600
|
+
run.log(` the secret ${name} is stored for this environment but not named in pipeline.secrets, so the Worker does not get it`)
|
|
601
|
+
}
|
|
590
602
|
const configs = env.generatedConfigs
|
|
591
603
|
// The configs oblaka wrote, not the generation checked before the run: a stateful binding can emit differently twice.
|
|
592
604
|
assertGeneratedConfigs(configs, env.bounds)
|
package/types/src/provider.d.ts
CHANGED
|
@@ -5,6 +5,11 @@ import type { CloudflareAppConfig } from './authoring';
|
|
|
5
5
|
import { type CloudflareCollaborators } from './collaborators';
|
|
6
6
|
import type { RunnerApprovedAccess } from './runner-protocol';
|
|
7
7
|
import { type AssetMount } from './spa-assets';
|
|
8
|
+
/**
|
|
9
|
+
* The secrets stored for the environment that `fabrika.config.ts` does not name in `pipeline.secrets`, by name. The deploy
|
|
10
|
+
* writes only declared ones, so these never reach the Worker; the run log says so, as an author would otherwise wonder.
|
|
11
|
+
*/
|
|
12
|
+
export declare const undeclaredSecrets: (config: CloudflareAppConfig, run: Pick<CloudflareDeployRun, "secrets">) => string[];
|
|
8
13
|
export interface CloudflareDeployerOptions {
|
|
9
14
|
readonly accountId: string;
|
|
10
15
|
readonly apiToken: string;
|