@mp-lb/arcnet 0.7.9 → 0.7.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/README.md +2 -2
- package/dist/arcnetConfig.d.ts +0 -2
- package/dist/arcnetConfig.d.ts.map +1 -1
- package/dist/arcnetConfig.js +0 -1
- package/dist/arcnetConfig.js.map +1 -1
- package/dist/ciOutputs.d.ts.map +1 -1
- package/dist/ciOutputs.js +20 -34
- package/dist/ciOutputs.js.map +1 -1
- package/dist/compileArcnet.d.ts +0 -2
- package/dist/compileArcnet.d.ts.map +1 -1
- package/dist/compileArcnet.js +0 -1
- package/dist/compileArcnet.js.map +1 -1
- package/dist/createCli.js +2 -2
- package/dist/createCli.js.map +1 -1
- package/dist/createProject.d.ts +0 -2
- package/dist/createProject.d.ts.map +1 -1
- package/dist/createProject.js +0 -4
- package/dist/createProject.js.map +1 -1
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +0 -2
- package/dist/deploy.js.map +1 -1
- package/dist/renderPlan.d.ts +0 -1
- package/dist/renderPlan.d.ts.map +1 -1
- package/dist/renderPlan.js +1 -2
- package/dist/renderPlan.js.map +1 -1
- package/dist/resolveDeploymentProjects.d.ts.map +1 -1
- package/dist/resolveDeploymentProjects.js +0 -3
- package/dist/resolveDeploymentProjects.js.map +1 -1
- package/dist/runTerraform.d.ts.map +1 -1
- package/dist/runTerraform.js +1 -4
- package/dist/runTerraform.js.map +1 -1
- package/dist/runVercel.d.ts +0 -1
- package/dist/runVercel.d.ts.map +1 -1
- package/dist/runVercel.js +2 -6
- package/dist/runVercel.js.map +1 -1
- package/dist/schemas.d.ts +0 -5
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +2 -5
- package/dist/schemas.js.map +1 -1
- package/dist/secrets/provisionSource.d.ts.map +1 -1
- package/dist/secrets/provisionSource.js +13 -11
- package/dist/secrets/provisionSource.js.map +1 -1
- package/dist/setup.d.ts.map +1 -1
- package/dist/setup.js +1 -2
- package/dist/setup.js.map +1 -1
- package/dist/setupArcnet.d.ts.map +1 -1
- package/dist/setupArcnet.js +0 -2
- package/dist/setupArcnet.js.map +1 -1
- package/dist/setupVercel.d.ts.map +1 -1
- package/dist/setupVercel.js +3 -5
- package/dist/setupVercel.js.map +1 -1
- package/docs/public/commands.md +2 -2
- package/docs/public/llms-full.txt +4 -4
- package/package.json +1 -1
- package/src/arcnetConfig.ts +0 -1
- package/src/ciOutputs.ts +23 -63
- package/src/compileArcnet.ts +0 -1
- package/src/createCli.ts +2 -2
- package/src/createProject.ts +0 -7
- package/src/deploy.ts +0 -4
- package/src/renderPlan.ts +1 -2
- package/src/resolveDeploymentProjects.ts +0 -4
- package/src/runTerraform.ts +1 -7
- package/src/runVercel.ts +2 -8
- package/src/schemas.ts +3 -6
- package/src/secrets/provisionSource.ts +20 -17
- package/src/setup.ts +1 -2
- package/src/setupArcnet.ts +0 -2
- package/src/setupVercel.ts +3 -5
- package/templates/deploy-arc.yaml +1 -2
- package/templates/deploy-mixed.yaml +1 -2
- package/templates/deploy-vercel.yaml +1 -3
|
@@ -38,9 +38,6 @@ export const resolveDeploymentProjects = async (
|
|
|
38
38
|
);
|
|
39
39
|
continue;
|
|
40
40
|
}
|
|
41
|
-
if (site.creationApproved !== true)
|
|
42
|
-
fail(`Project creation is disabled for ${site.projectName}.`);
|
|
43
|
-
|
|
44
41
|
const project = await request(
|
|
45
42
|
"GET",
|
|
46
43
|
`/v9/projects/${encodeURIComponent(site.projectName)}`,
|
|
@@ -76,7 +73,6 @@ export const resolveDeploymentProjects = async (
|
|
|
76
73
|
|
|
77
74
|
for (const site of Object.values(resolved.sites)) {
|
|
78
75
|
site.mode = "existing";
|
|
79
|
-
delete site.creationApproved;
|
|
80
76
|
}
|
|
81
77
|
return resolved;
|
|
82
78
|
};
|
package/src/runTerraform.ts
CHANGED
|
@@ -41,7 +41,6 @@ export const runTerraform = (
|
|
|
41
41
|
const config = {
|
|
42
42
|
slug: modern?.project ?? legacy!.slug,
|
|
43
43
|
repository: modern?.repository ?? legacy!.repository,
|
|
44
|
-
approved: modern?.approved ?? legacy!.approved,
|
|
45
44
|
services: modern ? Object.keys(modern.services ?? {}) : legacy!.services,
|
|
46
45
|
workloadIdentityProvider: modern
|
|
47
46
|
? compiled!.identity.workloadIdentityProvider
|
|
@@ -126,11 +125,6 @@ export const runTerraform = (
|
|
|
126
125
|
};
|
|
127
126
|
}
|
|
128
127
|
|
|
129
|
-
if (command === "deploy" && config.approved !== true)
|
|
130
|
-
throw new Error(
|
|
131
|
-
"Deployment disabled. Complete prerequisites and obtain target/cost/IAM/DNS approval before committing approved=true.",
|
|
132
|
-
);
|
|
133
|
-
|
|
134
128
|
if (process.env.GITHUB_ACTIONS === "true") {
|
|
135
129
|
if (
|
|
136
130
|
process.env.GITHUB_REPOSITORY !== config.repository ||
|
|
@@ -145,7 +139,7 @@ export const runTerraform = (
|
|
|
145
139
|
)
|
|
146
140
|
)
|
|
147
141
|
throw new Error(
|
|
148
|
-
"Set workloadIdentityProvider
|
|
142
|
+
"Set workloadIdentityProvider after the first local deployment.",
|
|
149
143
|
);
|
|
150
144
|
}
|
|
151
145
|
|
package/src/runVercel.ts
CHANGED
|
@@ -44,10 +44,6 @@ export const runVercel = async (
|
|
|
44
44
|
throw new Error(
|
|
45
45
|
"Project creation is a separate local operator step, never a CI side effect.",
|
|
46
46
|
);
|
|
47
|
-
if (["deploy", "preview"].includes(command) && !config.approved)
|
|
48
|
-
throw new Error(
|
|
49
|
-
"Deployment disabled (approved=false). No remote calls made.",
|
|
50
|
-
);
|
|
51
47
|
const request = apiClient(process.env.VERCEL_TOKEN);
|
|
52
48
|
|
|
53
49
|
if (command === "inspect") {
|
|
@@ -56,7 +52,7 @@ export const runVercel = async (
|
|
|
56
52
|
operation: command,
|
|
57
53
|
missing,
|
|
58
54
|
message: missing.length
|
|
59
|
-
? `Existing project identities match; ${missing.length} site(s) will be created on the first
|
|
55
|
+
? `Existing project identities match; ${missing.length} site(s) will be created on the first production deploy. No settings or DNS changed.`
|
|
60
56
|
: "All project IDs, names and account scopes match. No settings or DNS changed.",
|
|
61
57
|
};
|
|
62
58
|
}
|
|
@@ -78,7 +74,6 @@ export const runVercel = async (
|
|
|
78
74
|
const content = modern
|
|
79
75
|
? stringify({
|
|
80
76
|
...modern,
|
|
81
|
-
approved: false,
|
|
82
77
|
vercel: {
|
|
83
78
|
...modern.vercel,
|
|
84
79
|
sites: {
|
|
@@ -87,7 +82,6 @@ export const runVercel = async (
|
|
|
87
82
|
...modern.vercel!.sites[argument],
|
|
88
83
|
mode: "existing",
|
|
89
84
|
projectId: next.sites[argument]!.projectId,
|
|
90
|
-
creationApproved: undefined,
|
|
91
85
|
},
|
|
92
86
|
},
|
|
93
87
|
},
|
|
@@ -103,7 +97,7 @@ export const runVercel = async (
|
|
|
103
97
|
operation: command,
|
|
104
98
|
projectId: next.sites[argument]!.projectId,
|
|
105
99
|
message:
|
|
106
|
-
"Created project; review and commit project.json before CI.
|
|
100
|
+
"Created project; review and commit project.json before CI.",
|
|
107
101
|
};
|
|
108
102
|
}
|
|
109
103
|
|
package/src/schemas.ts
CHANGED
|
@@ -35,7 +35,6 @@ const siteSchema = z
|
|
|
35
35
|
.optional(),
|
|
36
36
|
root: z.string().optional(),
|
|
37
37
|
framework: z.enum(["static", "vercel"]).optional(),
|
|
38
|
-
creationApproved: z.boolean().optional(),
|
|
39
38
|
build: z
|
|
40
39
|
.array(
|
|
41
40
|
z
|
|
@@ -66,9 +65,9 @@ const siteSchema = z
|
|
|
66
65
|
.refine(
|
|
67
66
|
(s) =>
|
|
68
67
|
s.mode === "existing"
|
|
69
|
-
? Boolean(s.projectId)
|
|
70
|
-
: s.projectId === undefined
|
|
71
|
-
"Existing sites require projectId; new sites
|
|
68
|
+
? Boolean(s.projectId)
|
|
69
|
+
: s.projectId === undefined,
|
|
70
|
+
"Existing sites require projectId; new sites must not specify projectId.",
|
|
72
71
|
)
|
|
73
72
|
.refine(
|
|
74
73
|
(s) =>
|
|
@@ -106,7 +105,6 @@ export const vercelConfigSchema = vercelInputSchema
|
|
|
106
105
|
version: z.literal(1),
|
|
107
106
|
mode: z.literal("vercel"),
|
|
108
107
|
slug: z.string().regex(/^[a-z][a-z0-9-]{0,22}$/),
|
|
109
|
-
approved: z.boolean(),
|
|
110
108
|
})
|
|
111
109
|
.strict()
|
|
112
110
|
.superRefine((config, context) => {
|
|
@@ -152,7 +150,6 @@ export const terraformConfigSchema = z.object({
|
|
|
152
150
|
version: z.literal(1),
|
|
153
151
|
slug: z.string(),
|
|
154
152
|
repository: z.string(),
|
|
155
|
-
approved: z.boolean(),
|
|
156
153
|
services: z.array(z.string()),
|
|
157
154
|
workloadIdentityProvider: z.string(),
|
|
158
155
|
serviceAccount: z.string(),
|
|
@@ -89,25 +89,20 @@ export const provisionSource = async (
|
|
|
89
89
|
throw new Error("Repository differs from secrets configuration.");
|
|
90
90
|
const prior = config.sources.find((entry) => entry.name === source.name);
|
|
91
91
|
|
|
92
|
-
if (
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
if (
|
|
93
|
+
prior &&
|
|
94
|
+
(prior.store !== source.store ||
|
|
95
95
|
prior.path !== source.path ||
|
|
96
|
-
prior.keyEnv !== source.keyEnv
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return {
|
|
100
|
-
operation: `secrets.${mode}`,
|
|
101
|
-
status: "unchanged",
|
|
102
|
-
message:
|
|
103
|
-
"Source is already configured; use secrets sync to refresh snapshots.",
|
|
104
|
-
};
|
|
105
|
-
}
|
|
96
|
+
prior.keyEnv !== source.keyEnv)
|
|
97
|
+
)
|
|
98
|
+
throw new Error("Source name already has different settings.");
|
|
106
99
|
|
|
107
|
-
const next =
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
100
|
+
const next = prior
|
|
101
|
+
? config
|
|
102
|
+
: secretsConfigSchema.parse({
|
|
103
|
+
...config,
|
|
104
|
+
sources: [...config.sources, source],
|
|
105
|
+
});
|
|
111
106
|
|
|
112
107
|
const known = JSON.parse(
|
|
113
108
|
secretCommand(
|
|
@@ -117,6 +112,14 @@ export const provisionSource = async (
|
|
|
117
112
|
),
|
|
118
113
|
) as { name: string }[];
|
|
119
114
|
|
|
115
|
+
if (prior && known.some((entry) => entry.name === source.keyEnv))
|
|
116
|
+
return {
|
|
117
|
+
operation: `secrets.${mode}`,
|
|
118
|
+
status: "unchanged",
|
|
119
|
+
message:
|
|
120
|
+
"Source and GitHub key are already configured; use secrets sync to refresh snapshots.",
|
|
121
|
+
};
|
|
122
|
+
|
|
120
123
|
if (
|
|
121
124
|
options.existingKey &&
|
|
122
125
|
!known.some((entry) => entry.name === source.keyEnv)
|
package/src/setup.ts
CHANGED
|
@@ -221,7 +221,6 @@ export const setup = (args: string[], root = process.cwd()) => {
|
|
|
221
221
|
dockerfile: options.dockerfile,
|
|
222
222
|
selection,
|
|
223
223
|
services: selection ? Object.keys(selection) : [options.service],
|
|
224
|
-
approved: false,
|
|
225
224
|
workloadIdentityProvider: "",
|
|
226
225
|
serviceAccount: `arc-deploy@${gcpProject}.iam.gserviceaccount.com`,
|
|
227
226
|
};
|
|
@@ -291,6 +290,6 @@ export const setup = (args: string[], root = process.cwd()) => {
|
|
|
291
290
|
return setupReport(
|
|
292
291
|
"installed",
|
|
293
292
|
[...files.keys(), "package.json", "zap.yaml"],
|
|
294
|
-
"ArcNet files generated.
|
|
293
|
+
"ArcNet files generated. Review the StackForge ArcNet prerequisites, network REPLACE_ placeholders, Dockerfile, domain, env whitelist and Git diff. Install: pnpm install. Offline check: pnpm exec arcnet check. Only the selected services are included; no existing Vercel project is automatically adopted. MyShop stays local-only.",
|
|
295
294
|
);
|
|
296
295
|
};
|
package/src/setupArcnet.ts
CHANGED
|
@@ -61,8 +61,6 @@ export const setupArcnet = (root: string, dry: boolean) => {
|
|
|
61
61
|
const workflowPath = workflow && join(root, workflow);
|
|
62
62
|
if (workflowPath && existsSync(workflowPath) && !hasDependency(root))
|
|
63
63
|
throw new Error(`Refusing to overwrite existing ${workflow}.`);
|
|
64
|
-
if (config.approved && !hasDependency(root))
|
|
65
|
-
throw new Error("Start a new installation with approved: false.");
|
|
66
64
|
const files = ["package.json", ...(workflow ? [workflow] : [])];
|
|
67
65
|
if (dry)
|
|
68
66
|
return setupReport(
|
package/src/setupVercel.ts
CHANGED
|
@@ -39,7 +39,6 @@ export const setupVercel = ({
|
|
|
39
39
|
mode: "vercel",
|
|
40
40
|
slug,
|
|
41
41
|
repository: input.repository,
|
|
42
|
-
approved: false,
|
|
43
42
|
account: input.account,
|
|
44
43
|
sites: input.sites,
|
|
45
44
|
},
|
|
@@ -67,8 +66,8 @@ export const setupVercel = ({
|
|
|
67
66
|
|
|
68
67
|
if (existsSync(path)) {
|
|
69
68
|
const old = validateConfig(JSON.parse(readFileSync(path, "utf8")), root);
|
|
70
|
-
const previous =
|
|
71
|
-
const expected =
|
|
69
|
+
const previous = old;
|
|
70
|
+
const expected = structuredClone(config);
|
|
72
71
|
|
|
73
72
|
// Creation promotes a planned new site to an explicit reference; a setup rerun must preserve that receipt.
|
|
74
73
|
for (const [name, site] of Object.entries(expected.sites)) {
|
|
@@ -79,7 +78,6 @@ export const setupVercel = ({
|
|
|
79
78
|
projectId: previous.sites[name].projectId,
|
|
80
79
|
};
|
|
81
80
|
|
|
82
|
-
delete expected.sites[name]!.creationApproved;
|
|
83
81
|
}
|
|
84
82
|
}
|
|
85
83
|
|
|
@@ -121,6 +119,6 @@ export const setupVercel = ({
|
|
|
121
119
|
return setupReport(
|
|
122
120
|
"installed",
|
|
123
121
|
[...files.keys(), "package.json"],
|
|
124
|
-
"Generated Vercel-only config and GitHub workflow
|
|
122
|
+
"Generated Vercel-only config and GitHub workflow. No zap.yaml changes, GCP, Terraform, DNS or project settings ownership. Offline plan: pnpm install, then pnpm exec arcnet plan",
|
|
125
123
|
);
|
|
126
124
|
};
|
|
@@ -12,7 +12,6 @@ jobs:
|
|
|
12
12
|
configuration:
|
|
13
13
|
runs-on: ubuntu-latest
|
|
14
14
|
outputs:
|
|
15
|
-
approved: ${{ steps.config.outputs.approved }}
|
|
16
15
|
provider: ${{ steps.config.outputs.provider }}
|
|
17
16
|
account: ${{ steps.config.outputs.account }}
|
|
18
17
|
registry: ${{ steps.config.outputs.registry }}
|
|
@@ -31,7 +30,7 @@ jobs:
|
|
|
31
30
|
|
|
32
31
|
deploy:
|
|
33
32
|
needs: configuration
|
|
34
|
-
if:
|
|
33
|
+
if: github.ref == 'refs/heads/main'
|
|
35
34
|
runs-on: ubuntu-latest
|
|
36
35
|
timeout-minutes: 45
|
|
37
36
|
environment: arcnet-production
|
|
@@ -12,7 +12,6 @@ jobs:
|
|
|
12
12
|
configuration:
|
|
13
13
|
runs-on: ubuntu-latest
|
|
14
14
|
outputs:
|
|
15
|
-
approved: ${{ steps.config.outputs.approved }}
|
|
16
15
|
provider: ${{ steps.config.outputs.provider }}
|
|
17
16
|
account: ${{ steps.config.outputs.account }}
|
|
18
17
|
registry: ${{ steps.config.outputs.registry }}
|
|
@@ -31,7 +30,7 @@ jobs:
|
|
|
31
30
|
|
|
32
31
|
deploy:
|
|
33
32
|
needs: configuration
|
|
34
|
-
if:
|
|
33
|
+
if: github.ref == 'refs/heads/main'
|
|
35
34
|
runs-on: ubuntu-latest
|
|
36
35
|
timeout-minutes: 45
|
|
37
36
|
environment: arcnet-production
|
|
@@ -11,8 +11,6 @@ concurrency:
|
|
|
11
11
|
jobs:
|
|
12
12
|
configuration:
|
|
13
13
|
runs-on: ubuntu-latest
|
|
14
|
-
outputs:
|
|
15
|
-
approved: ${{ steps.config.outputs.approved }}
|
|
16
14
|
steps:
|
|
17
15
|
- uses: actions/checkout@v4
|
|
18
16
|
- uses: actions/setup-node@v4
|
|
@@ -26,7 +24,7 @@ jobs:
|
|
|
26
24
|
|
|
27
25
|
deploy:
|
|
28
26
|
needs: configuration
|
|
29
|
-
if:
|
|
27
|
+
if: github.ref == 'refs/heads/main'
|
|
30
28
|
environment: arcnet-production
|
|
31
29
|
runs-on: ubuntu-latest
|
|
32
30
|
timeout-minutes: 30
|