@mp-lb/arcnet 0.5.1 → 0.5.2
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 +4 -4
- package/dist/arcnetConfig.d.ts +9 -4
- package/dist/arcnetConfig.d.ts.map +1 -1
- package/dist/arcnetConfig.js +1 -2
- package/dist/arcnetConfig.js.map +1 -1
- package/dist/ciOutputs.d.ts.map +1 -1
- package/dist/ciOutputs.js +6 -3
- package/dist/ciOutputs.js.map +1 -1
- package/dist/compileArcnet.d.ts +10 -8
- package/dist/compileArcnet.d.ts.map +1 -1
- package/dist/compileArcnet.js +5 -7
- package/dist/compileArcnet.js.map +1 -1
- package/dist/createCli.d.ts.map +1 -1
- package/dist/createCli.js +18 -3
- package/dist/createCli.js.map +1 -1
- package/dist/createProject.d.ts +8 -6
- package/dist/createProject.d.ts.map +1 -1
- package/dist/createProject.js +2 -1
- package/dist/createProject.js.map +1 -1
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +18 -6
- package/dist/deploy.js.map +1 -1
- package/dist/renderPlan.d.ts +4 -3
- package/dist/renderPlan.d.ts.map +1 -1
- package/dist/renderPlan.js +3 -2
- package/dist/renderPlan.js.map +1 -1
- package/dist/resolveVercelSite.d.ts +3 -0
- package/dist/resolveVercelSite.d.ts.map +1 -0
- package/dist/resolveVercelSite.js +38 -0
- package/dist/resolveVercelSite.js.map +1 -0
- package/dist/runVercel.d.ts +4 -3
- package/dist/runVercel.d.ts.map +1 -1
- package/dist/runVercel.js +2 -2
- package/dist/runVercel.js.map +1 -1
- package/dist/schemas.d.ts +27 -12
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +11 -4
- package/dist/schemas.js.map +1 -1
- package/dist/setupArcnet.d.ts.map +1 -1
- package/dist/setupArcnet.js +6 -4
- package/dist/setupArcnet.js.map +1 -1
- package/dist/stageSite.d.ts.map +1 -1
- package/dist/stageSite.js +2 -0
- package/dist/stageSite.js.map +1 -1
- package/dist/validateConfig.d.ts.map +1 -1
- package/dist/validateConfig.js +10 -2
- package/dist/validateConfig.js.map +1 -1
- package/docs/public/commands.md +2 -2
- package/docs/public/llms-full.txt +6 -6
- package/package.json +1 -1
- package/src/arcnetConfig.ts +1 -5
- package/src/ciOutputs.ts +6 -3
- package/src/compileArcnet.ts +5 -9
- package/src/createCli.ts +18 -3
- package/src/createProject.ts +2 -1
- package/src/deploy.ts +19 -8
- package/src/renderPlan.ts +3 -2
- package/src/resolveVercelSite.ts +35 -0
- package/src/runVercel.ts +2 -2
- package/src/schemas.ts +14 -3
- package/src/setupArcnet.ts +10 -8
- package/src/stageSite.ts +1 -0
- package/src/validateConfig.ts +8 -2
- package/templates/deploy-arc.yaml +1 -0
- package/templates/deploy-mixed.yaml +75 -0
- package/templates/deploy-vercel.yaml +1 -0
package/dist/schemas.d.ts
CHANGED
|
@@ -13,14 +13,19 @@ declare const siteSchema: z.ZodObject<{
|
|
|
13
13
|
}>;
|
|
14
14
|
projectId: z.ZodOptional<z.ZodString>;
|
|
15
15
|
projectName: z.ZodString;
|
|
16
|
+
root: z.ZodOptional<z.ZodString>;
|
|
17
|
+
framework: z.ZodOptional<z.ZodEnum<{
|
|
18
|
+
static: "static";
|
|
19
|
+
vercel: "vercel";
|
|
20
|
+
}>>;
|
|
16
21
|
creationApproved: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
-
build: z.ZodArray<z.ZodString
|
|
18
|
-
output: z.ZodString
|
|
19
|
-
outputConfig: z.ZodObject<{
|
|
22
|
+
build: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
23
|
+
output: z.ZodOptional<z.ZodString>;
|
|
24
|
+
outputConfig: z.ZodOptional<z.ZodObject<{
|
|
20
25
|
version: z.ZodLiteral<3>;
|
|
21
26
|
routes: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
22
27
|
overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
23
|
-
}, z.core.$strict
|
|
28
|
+
}, z.core.$strict>>;
|
|
24
29
|
}, z.core.$strict>;
|
|
25
30
|
export declare const vercelInputSchema: z.ZodObject<{
|
|
26
31
|
repository: z.ZodString;
|
|
@@ -38,14 +43,19 @@ export declare const vercelInputSchema: z.ZodObject<{
|
|
|
38
43
|
}>;
|
|
39
44
|
projectId: z.ZodOptional<z.ZodString>;
|
|
40
45
|
projectName: z.ZodString;
|
|
46
|
+
root: z.ZodOptional<z.ZodString>;
|
|
47
|
+
framework: z.ZodOptional<z.ZodEnum<{
|
|
48
|
+
static: "static";
|
|
49
|
+
vercel: "vercel";
|
|
50
|
+
}>>;
|
|
41
51
|
creationApproved: z.ZodOptional<z.ZodBoolean>;
|
|
42
|
-
build: z.ZodArray<z.ZodString
|
|
43
|
-
output: z.ZodString
|
|
44
|
-
outputConfig: z.ZodObject<{
|
|
52
|
+
build: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
53
|
+
output: z.ZodOptional<z.ZodString>;
|
|
54
|
+
outputConfig: z.ZodOptional<z.ZodObject<{
|
|
45
55
|
version: z.ZodLiteral<3>;
|
|
46
56
|
routes: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
47
57
|
overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
48
|
-
}, z.core.$strict
|
|
58
|
+
}, z.core.$strict>>;
|
|
49
59
|
}, z.core.$strict>>;
|
|
50
60
|
}, z.core.$strict>;
|
|
51
61
|
export declare const vercelConfigSchema: z.ZodObject<{
|
|
@@ -64,14 +74,19 @@ export declare const vercelConfigSchema: z.ZodObject<{
|
|
|
64
74
|
}>;
|
|
65
75
|
projectId: z.ZodOptional<z.ZodString>;
|
|
66
76
|
projectName: z.ZodString;
|
|
77
|
+
root: z.ZodOptional<z.ZodString>;
|
|
78
|
+
framework: z.ZodOptional<z.ZodEnum<{
|
|
79
|
+
static: "static";
|
|
80
|
+
vercel: "vercel";
|
|
81
|
+
}>>;
|
|
67
82
|
creationApproved: z.ZodOptional<z.ZodBoolean>;
|
|
68
|
-
build: z.ZodArray<z.ZodString
|
|
69
|
-
output: z.ZodString
|
|
70
|
-
outputConfig: z.ZodObject<{
|
|
83
|
+
build: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
84
|
+
output: z.ZodOptional<z.ZodString>;
|
|
85
|
+
outputConfig: z.ZodOptional<z.ZodObject<{
|
|
71
86
|
version: z.ZodLiteral<3>;
|
|
72
87
|
routes: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
73
88
|
overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
74
|
-
}, z.core.$strict
|
|
89
|
+
}, z.core.$strict>>;
|
|
75
90
|
}, z.core.$strict>>;
|
|
76
91
|
version: z.ZodLiteral<1>;
|
|
77
92
|
mode: z.ZodLiteral<"vercel">;
|
package/dist/schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,QAAA,MAAM,aAAa;;;;;;kBAYhB,CAAC;AAEJ,QAAA,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,QAAA,MAAM,aAAa;;;;;;kBAYhB,CAAC;AAEJ,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;kBAoDb,CAAC;AAYJ,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAQnB,CAAC;AACZ,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAOpB,CAAC;AACZ,eAAO,MAAM,oBAAoB;;;;;;;iBAK/B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AACpD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,aAAa,GAAG,CAC1B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,aAAa,EACtB,IAAI,CAAC,EAAE,OAAO,KACX,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;AACpC,MAAM,MAAM,UAAU,GAAG,CACvB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,CAAC,UAAU,KACnB,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAC1B,eAAO,MAAM,qBAAqB;;;;;;;;iBAQhC,CAAC;AACH,eAAO,MAAM,aAAa,uCAGzB,CAAC"}
|
package/dist/schemas.js
CHANGED
|
@@ -23,6 +23,8 @@ const siteSchema = z
|
|
|
23
23
|
.refine((v) => !/REPLACE/i.test(v))
|
|
24
24
|
.optional(),
|
|
25
25
|
projectName,
|
|
26
|
+
root: z.string().optional(),
|
|
27
|
+
framework: z.enum(["static", "vercel"]).optional(),
|
|
26
28
|
creationApproved: z.boolean().optional(),
|
|
27
29
|
build: z
|
|
28
30
|
.array(z
|
|
@@ -30,20 +32,25 @@ const siteSchema = z
|
|
|
30
32
|
.min(1)
|
|
31
33
|
.refine((v) => !/myshop|[\n\r\0]/i.test(v), "MyShop must remain local-only."))
|
|
32
34
|
.min(1)
|
|
33
|
-
.refine((v) => v[0] === "pnpm", "Build must be an explicit pnpm argument array.")
|
|
34
|
-
|
|
35
|
+
.refine((v) => v[0] === "pnpm", "Build must be an explicit pnpm argument array.")
|
|
36
|
+
.optional(),
|
|
37
|
+
output: z.string().optional(),
|
|
35
38
|
outputConfig: z
|
|
36
39
|
.object({
|
|
37
40
|
version: z.literal(3),
|
|
38
41
|
routes: z.array(z.unknown()).optional(),
|
|
39
42
|
overrides: z.record(z.string(), z.unknown()).optional(),
|
|
40
43
|
})
|
|
41
|
-
.strict()
|
|
44
|
+
.strict()
|
|
45
|
+
.optional(),
|
|
42
46
|
})
|
|
43
47
|
.strict()
|
|
44
48
|
.refine((s) => s.mode === "existing"
|
|
45
49
|
? Boolean(s.projectId) && s.creationApproved === undefined
|
|
46
|
-
: s.projectId === undefined && typeof s.creationApproved === "boolean", "Existing sites require projectId; new sites require creationApproved.")
|
|
50
|
+
: s.projectId === undefined && typeof s.creationApproved === "boolean", "Existing sites require projectId; new sites require creationApproved.")
|
|
51
|
+
.refine((s) => s.framework === "vercel" || (s.root && !s.build && !s.output)
|
|
52
|
+
? Boolean(s.root) && !s.output && !s.outputConfig
|
|
53
|
+
: Boolean(s.build && s.output && s.outputConfig), "Framework sites require root; static sites require build, output and outputConfig.");
|
|
47
54
|
const sitesSchema = z
|
|
48
55
|
.record(z
|
|
49
56
|
.string()
|
package/dist/schemas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,GAAG,CAAC;KAClB,MAAM,EAAE;KACR,KAAK,CAAC,yCAAyC,CAAC;KAChD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;KACjC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AA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AAI,MAAM,MAAM,EAAE,KAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"setupArcnet.d.ts","sourceRoot":"","sources":["../src/setupArcnet.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,EAAE,KAAK,OAAO,2CAkFrD,CAAC"}
|
package/dist/setupArcnet.js
CHANGED
|
@@ -31,7 +31,7 @@ export const setupArcnet = (root, dry) => {
|
|
|
31
31
|
throw new Error("Pin packageManager to an exact pnpm version.");
|
|
32
32
|
const nextManifest = addDependency(manifestPath);
|
|
33
33
|
const mode = arcnetMode(config);
|
|
34
|
-
if (mode === "terraform") {
|
|
34
|
+
if (mode === "terraform" || mode === "mixed") {
|
|
35
35
|
const { deployment } = compileTerraform(config);
|
|
36
36
|
for (const [name, service] of Object.entries(deployment.services)) {
|
|
37
37
|
if (["cloud-run-web", "gce-worker"].includes(service.module) &&
|
|
@@ -39,8 +39,8 @@ export const setupArcnet = (root, dry) => {
|
|
|
39
39
|
throw new Error(`Service ${name} requires its Dockerfile.`);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
if (mode === "vercel")
|
|
43
|
-
compileVercel(config);
|
|
42
|
+
if (mode === "vercel" || mode === "mixed")
|
|
43
|
+
compileVercel(config, root);
|
|
44
44
|
const workflow = mode === "package" ? undefined : ".github/workflows/deploy-arc.yaml";
|
|
45
45
|
const workflowPath = workflow && join(root, workflow);
|
|
46
46
|
if (workflowPath && existsSync(workflowPath) && !hasDependency(root))
|
|
@@ -52,7 +52,9 @@ export const setupArcnet = (root, dry) => {
|
|
|
52
52
|
return setupReport("dry-run", files, `Would install ArcNet ${mode} configuration; no cloud resources changed.`);
|
|
53
53
|
if (workflowPath && !existsSync(workflowPath)) {
|
|
54
54
|
mkdirSync(dirname(workflowPath), { recursive: true });
|
|
55
|
-
|
|
55
|
+
const template = readFileSync(join(packageRoot, `templates/deploy-${mode === "vercel" ? "vercel" : mode === "mixed" ? "mixed" : "arc"}.yaml`), "utf8");
|
|
56
|
+
const secretKeys = config.secrets?.sources.map((source) => ` ${source.key}: \${{ secrets.${source.key} }}`).join("\n") ?? "";
|
|
57
|
+
writeFileSync(workflowPath, template.replace(" # ARCNET_SECRET_KEYS", secretKeys), { flag: "wx" });
|
|
56
58
|
}
|
|
57
59
|
if (!hasDependency(root))
|
|
58
60
|
writeFileSync(manifestPath, nextManifest);
|
package/dist/setupArcnet.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupArcnet.js","sourceRoot":"","sources":["../src/setupArcnet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,GAAY,EAAE,EAAE;IACxD,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,GAAG,GAAG,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IAChE,IAAI,GAAG,CAA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AC;IAED,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;QAAE,aAAa,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IACpE,IAAI,MAAM,CAAC,OAAO;QAChB,oBAAoB,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,qBAAqB,CAAC,CAAC;IAC7E,OAAO,WAAW,CAChB,WAAW,EACX,KAAK,EACL,yFAAyF,CAC1F,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/stageSite.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stageSite.d.ts","sourceRoot":"","sources":["../src/stageSite.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE9D,eAAO,MAAM,SAAS,GACpB,MAAM,MAAM,EACZ,MAAM,UAAU,EAChB,SAAS,aAAa,
|
|
1
|
+
{"version":3,"file":"stageSite.d.ts","sourceRoot":"","sources":["../src/stageSite.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE9D,eAAO,MAAM,SAAS,GACpB,MAAM,MAAM,EACZ,MAAM,UAAU,EAChB,SAAS,aAAa,WAmCvB,CAAC"}
|
package/dist/stageSite.js
CHANGED
|
@@ -5,6 +5,8 @@ import { fail } from "./fail.js";
|
|
|
5
5
|
import { inspectStaticTree } from "./inspectStaticTree.js";
|
|
6
6
|
import { safePath } from "./safePath.js";
|
|
7
7
|
export const stageSite = (root, site, account) => {
|
|
8
|
+
if (!site.output || !site.outputConfig)
|
|
9
|
+
fail("Static site needs output and outputConfig.");
|
|
8
10
|
const output = safePath(root, site.output);
|
|
9
11
|
if (!existsSync(output) ||
|
|
10
12
|
!lstatSync(output).isDirectory() ||
|
package/dist/stageSite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stageSite.js","sourceRoot":"","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YAAY,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"validateConfig.d.ts","sourceRoot":"","sources":["../src/validateConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjD,eAAO,MAAM,cAAc,GAAI,OAAO,OAAO,EAAE,MAAM,MAAM,KAAG,YAqB7D,CAAC"}
|
package/dist/validateConfig.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { fail } from "./fail.js";
|
|
2
2
|
import { safePath } from "./safePath.js";
|
|
3
3
|
import { vercelConfigSchema } from "./schemas.js";
|
|
4
|
+
import { resolveVercelSite } from "./resolveVercelSite.js";
|
|
4
5
|
export const validateConfig = (input, root) => {
|
|
5
|
-
const
|
|
6
|
+
const raw = input;
|
|
7
|
+
const config = vercelConfigSchema.parse({
|
|
8
|
+
...raw,
|
|
9
|
+
sites: Object.fromEntries(Object.entries(raw.sites).map(([name, site]) => [name, resolveVercelSite(root, site)])),
|
|
10
|
+
});
|
|
6
11
|
const identities = new Set();
|
|
7
12
|
for (const site of Object.values(config.sites)) {
|
|
8
13
|
for (const id of [site.projectId, site.projectName].filter((id) => Boolean(id))) {
|
|
@@ -10,7 +15,10 @@ export const validateConfig = (input, root) => {
|
|
|
10
15
|
fail("Duplicate Vercel project selection.");
|
|
11
16
|
identities.add(id);
|
|
12
17
|
}
|
|
13
|
-
|
|
18
|
+
if (site.output)
|
|
19
|
+
safePath(root, site.output);
|
|
20
|
+
if (site.root)
|
|
21
|
+
safePath(root, site.root);
|
|
14
22
|
}
|
|
15
23
|
return config;
|
|
16
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateConfig.js","sourceRoot":"","sources":["../src/validateConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO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I,CAAC,MAAM;YAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7C,IAAI,IAAI,CAAC,IAAI;YAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/docs/public/commands.md
CHANGED
|
@@ -144,11 +144,11 @@ Deploy the approved project.
|
|
|
144
144
|
|
|
145
145
|
## `arcnet preview`
|
|
146
146
|
|
|
147
|
-
Deploy
|
|
147
|
+
Deploy Vercel sites to preview.
|
|
148
148
|
|
|
149
149
|
## `arcnet inspect`
|
|
150
150
|
|
|
151
|
-
Verify
|
|
151
|
+
Verify Vercel project identities remotely.
|
|
152
152
|
|
|
153
153
|
## `arcnet create <site>`
|
|
154
154
|
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
ArcNet installs selected delivery capabilities into a Zap/pnpm/GitHub project. The project owns one `.arcnet/arcnet.yaml`; this package owns the standard environment preset, runners, validation and workflow templates. [Project setup](https://github.com/mp-lb/stackforge/blob/main/arcnet/SETUP.md) · [File tree](https://github.com/mp-lb/stackforge/blob/main/arcnet/README.md) · [Command reference](docs/public/commands.md)
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
|
-
pnpm dlx @mp-lb/arcnet
|
|
7
|
-
pnpm dlx @mp-lb/arcnet
|
|
6
|
+
pnpm dlx @mp-lb/arcnet setup <project-slug> --dry-run
|
|
7
|
+
pnpm dlx @mp-lb/arcnet setup <project-slug>
|
|
8
8
|
pnpm install
|
|
9
9
|
pnpm exec arcnet check
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
A package-only project gets no deploy workflow or cloud configuration.
|
|
12
|
+
A package-only project gets no deploy workflow or cloud configuration. Vercel sites can use static output or a Next.js framework build; Terraform services use the bundled `mp-lb` environment and Zap Arc. Both can be selected in one project file. ArcNet passes Zap Arc a temporary manifest, leaving the project's `zap.yaml` unchanged. Existing multi-file installations remain supported until explicitly migrated.
|
|
13
13
|
|
|
14
|
-
The project file can contain `services` (Zap Arc service blocks), `vercel` (
|
|
14
|
+
The project file can contain `services` (Zap Arc service blocks), `vercel` (site roots and project identities), non-secret `variables`, and a `secrets` source/consumer map. For a Vercel site, `root: apps/<site>` selects its package. ArcNet infers a static build for Vite, VitePress, or prerendered React Router packages and uses Vercel's framework build for Next.js. Explicit `build`, `output`, and `outputConfig` override static detection. Container services default to `.arcnet/<service>.Dockerfile`. The package selects standard Cloud Run domains when omitted; set `domain` for exceptions. The `gce-worker` module is deferred until its startup mechanism is replaced.
|
|
15
15
|
|
|
16
16
|
`arcnet secrets add --key KEY` attaches a Forum encrypted JSON source and provisions its GitHub decryption key. `arcnet secrets init --key KEY` creates a source. A new project's `arcnet.yaml` records only the key, Forum store/path, and consumer mappings. The committed ciphertext lives at `.arcnet/secrets/KEY.json.enc`; `arcnet secrets sync` refreshes it atomically. CI decrypts that file using the GitHub key and does not fetch from Forum. `arcnet env run --consumer publish -- <command>` gives a publish command only its selected credentials; the project release workflow must call it. Older source definitions with names and snapshot metadata remain readable.
|
|
17
17
|
|
|
@@ -163,11 +163,11 @@ Deploy the approved project.
|
|
|
163
163
|
|
|
164
164
|
## `arcnet preview`
|
|
165
165
|
|
|
166
|
-
Deploy
|
|
166
|
+
Deploy Vercel sites to preview.
|
|
167
167
|
|
|
168
168
|
## `arcnet inspect`
|
|
169
169
|
|
|
170
|
-
Verify
|
|
170
|
+
Verify Vercel project identities remotely.
|
|
171
171
|
|
|
172
172
|
## `arcnet create <site>`
|
|
173
173
|
|
package/package.json
CHANGED
package/src/arcnetConfig.ts
CHANGED
|
@@ -40,11 +40,7 @@ const arcnetConfigSchema = z
|
|
|
40
40
|
.strict()
|
|
41
41
|
.optional(),
|
|
42
42
|
})
|
|
43
|
-
.strict()
|
|
44
|
-
.refine(
|
|
45
|
-
(config) => !config.vercel || !config.services,
|
|
46
|
-
"Vercel references and Terraform services cannot yet be combined.",
|
|
47
|
-
);
|
|
43
|
+
.strict();
|
|
48
44
|
|
|
49
45
|
export type ArcnetConfig = z.infer<typeof arcnetConfigSchema>;
|
|
50
46
|
|
package/src/ciOutputs.ts
CHANGED
|
@@ -11,8 +11,8 @@ export const ciOutputs = (root: string): Record<string, string> => {
|
|
|
11
11
|
if (hasArcnetConfig(root)) {
|
|
12
12
|
const config = readArcnetConfig(root);
|
|
13
13
|
|
|
14
|
-
if (config.vercel) {
|
|
15
|
-
const site = validateConfig(compileVercel(config), root);
|
|
14
|
+
if (config.vercel && !config.services) {
|
|
15
|
+
const site = validateConfig(compileVercel(config, root), root);
|
|
16
16
|
return {
|
|
17
17
|
approved: String(
|
|
18
18
|
site.approved &&
|
|
@@ -34,8 +34,11 @@ export const ciOutputs = (root: string): Record<string, string> => {
|
|
|
34
34
|
))
|
|
35
35
|
)
|
|
36
36
|
throw new Error("Complete WIF configuration before approval.");
|
|
37
|
+
const sitesReady = config.vercel
|
|
38
|
+
? Object.values(validateConfig(compileVercel(config, root), root).sites).every((site) => site.mode === "existing")
|
|
39
|
+
: true;
|
|
37
40
|
return {
|
|
38
|
-
approved: String(config.approved),
|
|
41
|
+
approved: String(config.approved && sitesReady),
|
|
39
42
|
provider: config.approved ? identity.workloadIdentityProvider : "",
|
|
40
43
|
account: config.approved ? identity.serviceAccount : "",
|
|
41
44
|
registry: `${compiled.network.region}-docker.pkg.dev`,
|
package/src/compileArcnet.ts
CHANGED
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
import { deployBlockSchema } from "@mp-lb/zapper/dist/arc/schemas.js";
|
|
2
2
|
import type { ArcnetConfig } from "./arcnetConfig.js";
|
|
3
3
|
import { resolveEnvironment } from "./resolveEnvironment.js";
|
|
4
|
-
import {
|
|
4
|
+
import { validateConfig } from "./validateConfig.js";
|
|
5
5
|
|
|
6
6
|
export const arcnetMode = (config: ArcnetConfig) =>
|
|
7
|
-
config.vercel ? "vercel" : config.services ? "terraform" : "package";
|
|
7
|
+
config.vercel && config.services ? "mixed" : config.vercel ? "vercel" : config.services ? "terraform" : "package";
|
|
8
8
|
|
|
9
|
-
export const compileVercel = (config: ArcnetConfig) => {
|
|
9
|
+
export const compileVercel = (config: ArcnetConfig, root: string) => {
|
|
10
10
|
if (!config.vercel) throw new Error("No Vercel sites selected.");
|
|
11
|
-
return
|
|
11
|
+
return validateConfig({
|
|
12
12
|
version: 1,
|
|
13
13
|
mode: "vercel",
|
|
14
14
|
slug: config.project,
|
|
15
15
|
repository: config.repository,
|
|
16
16
|
approved: config.approved,
|
|
17
17
|
...config.vercel,
|
|
18
|
-
});
|
|
18
|
+
}, root);
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export const compileTerraform = (config: ArcnetConfig) => {
|
|
22
22
|
if (!config.services || !Object.keys(config.services).length)
|
|
23
23
|
throw new Error("No Terraform services selected.");
|
|
24
|
-
if (config.vercel)
|
|
25
|
-
throw new Error(
|
|
26
|
-
"Vercel references cannot yet be mixed with Terraform services.",
|
|
27
|
-
);
|
|
28
24
|
const services = deployBlockSchema.shape.services.parse(config.services);
|
|
29
25
|
if (
|
|
30
26
|
Object.values(services).some((service) => service.module === "gce-worker")
|
package/src/createCli.ts
CHANGED
|
@@ -97,8 +97,8 @@ export const createCli = () => {
|
|
|
97
97
|
check: "Validate project configuration offline.",
|
|
98
98
|
plan: "Plan deployment (Terraform contacts providers; static Vercel stays offline).",
|
|
99
99
|
deploy: "Deploy the approved project.",
|
|
100
|
-
preview: "Deploy
|
|
101
|
-
inspect: "Verify
|
|
100
|
+
preview: "Deploy Vercel sites to preview.",
|
|
101
|
+
inspect: "Verify Vercel project identities remotely.",
|
|
102
102
|
create: "Create one explicitly approved Vercel project.",
|
|
103
103
|
})) {
|
|
104
104
|
const command = cli.command(name).description(description);
|
|
@@ -134,6 +134,21 @@ export const createCli = () => {
|
|
|
134
134
|
throw new Error("This project has no ArcNet deployment services.");
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
if (mode === "mixed") {
|
|
138
|
+
if (name === "check") {
|
|
139
|
+
runTerraform("check", root, machine);
|
|
140
|
+
return runVercel("check", root, undefined, machine);
|
|
141
|
+
}
|
|
142
|
+
if (name === "create" || name === "inspect" || name === "preview")
|
|
143
|
+
return runVercel(name, root, typeof site === "string" ? site : undefined, machine);
|
|
144
|
+
if (name === "plan") {
|
|
145
|
+
const terraform = runTerraform("plan", root, machine);
|
|
146
|
+
const vercel = await runVercel("plan", root, undefined, machine);
|
|
147
|
+
return { terraform, vercel };
|
|
148
|
+
}
|
|
149
|
+
runTerraform("deploy", root, machine);
|
|
150
|
+
return runVercel("deploy", root, undefined, machine);
|
|
151
|
+
}
|
|
137
152
|
if (mode === "vercel")
|
|
138
153
|
return runVercel(
|
|
139
154
|
name,
|
|
@@ -144,7 +159,7 @@ export const createCli = () => {
|
|
|
144
159
|
if (name === "check" || name === "plan" || name === "deploy")
|
|
145
160
|
return runTerraform(name, root, machine);
|
|
146
161
|
throw new Error(
|
|
147
|
-
`${name} is only supported for
|
|
162
|
+
`${name} is only supported for Vercel sites.`,
|
|
148
163
|
);
|
|
149
164
|
};
|
|
150
165
|
|
package/src/createProject.ts
CHANGED
|
@@ -46,7 +46,8 @@ export const createProject = async (
|
|
|
46
46
|
|
|
47
47
|
const created = await request("POST", "/v11/projects", config.account, {
|
|
48
48
|
name: site.projectName,
|
|
49
|
-
framework: null,
|
|
49
|
+
framework: site.framework === "vercel" ? "nextjs" : null,
|
|
50
|
+
...(site.root ? { rootDirectory: site.root } : {}),
|
|
50
51
|
});
|
|
51
52
|
|
|
52
53
|
if (
|
package/src/deploy.ts
CHANGED
|
@@ -34,38 +34,49 @@ export const deploy = async (
|
|
|
34
34
|
"CI deployment is restricted to the configured repository main branch.",
|
|
35
35
|
);
|
|
36
36
|
await inspectReferences(config, request); // Check every identity before building or uploading any site.
|
|
37
|
-
const stages: Array<[VercelSite, string]> = [];
|
|
37
|
+
const stages: Array<[VercelSite, string | null]> = [];
|
|
38
38
|
|
|
39
39
|
try {
|
|
40
40
|
for (const site of Object.values(config.sites)) {
|
|
41
|
+
if (site.framework === "vercel") {
|
|
42
|
+
stages.push([site, null]);
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
41
45
|
const buildEnv = Object.fromEntries(
|
|
42
46
|
Object.entries(environment).filter(([k]) => !k.startsWith("VERCEL_")),
|
|
43
47
|
);
|
|
44
48
|
|
|
45
|
-
await run(site.build[0]!, site.build
|
|
49
|
+
await run(site.build![0]!, site.build!.slice(1), root, buildEnv);
|
|
46
50
|
stages.push([site, stageSite(root, site, config.account)]);
|
|
47
51
|
}
|
|
48
52
|
|
|
49
53
|
for (const [site, stage] of stages) {
|
|
54
|
+
const siteEnv = {
|
|
55
|
+
...environment,
|
|
56
|
+
VERCEL_PROJECT_ID: site.projectId,
|
|
57
|
+
VERCEL_ORG_ID: config.account.id,
|
|
58
|
+
};
|
|
59
|
+
if (site.framework === "vercel") {
|
|
60
|
+
const cli = ["--yes", "vercel@63.1.2"];
|
|
61
|
+
await run("npx", [...cli, "pull", "--project", site.projectId!, "--yes", `--environment=${target}`, "--token", environment.VERCEL_TOKEN!], root, siteEnv);
|
|
62
|
+
await run("npx", [...cli, "build", "--project", site.projectId!, ...(target === "production" ? ["--prod"] : []), "--yes", "--token", environment.VERCEL_TOKEN!], root, siteEnv);
|
|
63
|
+
}
|
|
50
64
|
const args = [
|
|
51
65
|
"--yes",
|
|
52
66
|
"vercel@63.1.2",
|
|
53
67
|
"deploy",
|
|
54
68
|
"--prebuilt",
|
|
69
|
+
...(site.framework === "vercel" ? ["--project", site.projectId!] : []),
|
|
55
70
|
"--yes",
|
|
56
71
|
...(target === "production" ? ["--prod"] : []),
|
|
57
72
|
"--token",
|
|
58
73
|
environment.VERCEL_TOKEN!,
|
|
59
74
|
];
|
|
60
75
|
|
|
61
|
-
await run("npx", args, stage,
|
|
62
|
-
...environment,
|
|
63
|
-
VERCEL_PROJECT_ID: site.projectId,
|
|
64
|
-
VERCEL_ORG_ID: config.account.id,
|
|
65
|
-
});
|
|
76
|
+
await run("npx", args, stage ?? root, siteEnv);
|
|
66
77
|
}
|
|
67
78
|
} finally {
|
|
68
79
|
for (const [, stage] of stages)
|
|
69
|
-
rmSync(stage, { recursive: true, force: true });
|
|
80
|
+
if (stage) rmSync(stage, { recursive: true, force: true });
|
|
70
81
|
}
|
|
71
82
|
};
|
package/src/renderPlan.ts
CHANGED
|
@@ -8,7 +8,7 @@ export const renderPlan = (config: VercelConfig, root: string) => {
|
|
|
8
8
|
account: config.account,
|
|
9
9
|
approved: config.approved,
|
|
10
10
|
terraform: false,
|
|
11
|
-
changesProjectSettings:
|
|
11
|
+
changesProjectSettings: Object.values(config.sites).some((site) => site.mode === "new"),
|
|
12
12
|
changesDNS: false,
|
|
13
13
|
sites: Object.entries(config.sites).map(([name, site]) => ({
|
|
14
14
|
name,
|
|
@@ -18,10 +18,11 @@ export const renderPlan = (config: VercelConfig, root: string) => {
|
|
|
18
18
|
: "reference-existing",
|
|
19
19
|
projectId: site.projectId ?? null,
|
|
20
20
|
projectName: site.projectName,
|
|
21
|
+
root: site.root ?? null,
|
|
21
22
|
build: site.build,
|
|
22
23
|
output: site.output,
|
|
23
24
|
outputConfig: site.outputConfig,
|
|
24
|
-
deployment: "prebuilt-static",
|
|
25
|
+
deployment: site.framework === "vercel" ? "framework-build" : "prebuilt-static",
|
|
25
26
|
})),
|
|
26
27
|
};
|
|
27
28
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { join, relative } from "node:path";
|
|
3
|
+
import { fail } from "./fail.js";
|
|
4
|
+
import { safePath } from "./safePath.js";
|
|
5
|
+
import type { VercelSite } from "./schemas.js";
|
|
6
|
+
|
|
7
|
+
export const resolveVercelSite = (root: string, site: VercelSite): VercelSite => {
|
|
8
|
+
if (!site.root) return site;
|
|
9
|
+
const directory = safePath(root, site.root);
|
|
10
|
+
const path = join(directory, "package.json");
|
|
11
|
+
if (!existsSync(path)) fail(`Vercel site needs package.json: ${site.root}`);
|
|
12
|
+
const manifest = JSON.parse(readFileSync(path, "utf8"));
|
|
13
|
+
const deps = { ...manifest.dependencies, ...manifest.devDependencies };
|
|
14
|
+
const framework = site.framework ?? (deps.next ? "vercel" : "static");
|
|
15
|
+
if (framework === "vercel") {
|
|
16
|
+
if (!deps.next) fail(`Unsupported Vercel framework at ${site.root}; specify a static build explicitly.`);
|
|
17
|
+
return { ...site, framework };
|
|
18
|
+
}
|
|
19
|
+
const name = manifest.name;
|
|
20
|
+
if (typeof name !== "string" || !manifest.scripts?.build)
|
|
21
|
+
fail(`Vercel site needs a named package with a build script: ${site.root}`);
|
|
22
|
+
const output = site.output ?? (deps.vitepress
|
|
23
|
+
? join(site.root, ".vitepress/dist")
|
|
24
|
+
: deps["react-router"] && manifest.scripts.start?.includes("build/client")
|
|
25
|
+
? join(site.root, "build/client")
|
|
26
|
+
: join(site.root, "dist"));
|
|
27
|
+
if (relative(root, safePath(root, output)).startsWith("..")) fail("Invalid output path.");
|
|
28
|
+
return {
|
|
29
|
+
...site,
|
|
30
|
+
framework,
|
|
31
|
+
build: site.build ?? ["pnpm", "--filter", name, "build"],
|
|
32
|
+
output,
|
|
33
|
+
outputConfig: site.outputConfig ?? { version: 3 },
|
|
34
|
+
};
|
|
35
|
+
};
|
package/src/runVercel.ts
CHANGED
|
@@ -30,7 +30,7 @@ export const runVercel = async (
|
|
|
30
30
|
const original = readFileSync(path, "utf8");
|
|
31
31
|
|
|
32
32
|
const config = validateConfig(
|
|
33
|
-
modern ? compileVercel(modern) : JSON.parse(original),
|
|
33
|
+
modern ? compileVercel(modern, root) : JSON.parse(original),
|
|
34
34
|
root,
|
|
35
35
|
);
|
|
36
36
|
|
|
@@ -99,5 +99,5 @@ export const runVercel = async (
|
|
|
99
99
|
command === "preview" ? "preview" : "production",
|
|
100
100
|
);
|
|
101
101
|
|
|
102
|
-
return { operation: command, message: "Selected
|
|
102
|
+
return { operation: command, message: "Selected sites deployed." };
|
|
103
103
|
};
|
package/src/schemas.ts
CHANGED
|
@@ -29,6 +29,8 @@ const siteSchema = z
|
|
|
29
29
|
.refine((v) => !/REPLACE/i.test(v))
|
|
30
30
|
.optional(),
|
|
31
31
|
projectName,
|
|
32
|
+
root: z.string().optional(),
|
|
33
|
+
framework: z.enum(["static", "vercel"]).optional(),
|
|
32
34
|
creationApproved: z.boolean().optional(),
|
|
33
35
|
build: z
|
|
34
36
|
.array(
|
|
@@ -44,15 +46,17 @@ const siteSchema = z
|
|
|
44
46
|
.refine(
|
|
45
47
|
(v) => v[0] === "pnpm",
|
|
46
48
|
"Build must be an explicit pnpm argument array.",
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
+
)
|
|
50
|
+
.optional(),
|
|
51
|
+
output: z.string().optional(),
|
|
49
52
|
outputConfig: z
|
|
50
53
|
.object({
|
|
51
54
|
version: z.literal(3),
|
|
52
55
|
routes: z.array(z.unknown()).optional(),
|
|
53
56
|
overrides: z.record(z.string(), z.unknown()).optional(),
|
|
54
57
|
})
|
|
55
|
-
.strict()
|
|
58
|
+
.strict()
|
|
59
|
+
.optional(),
|
|
56
60
|
})
|
|
57
61
|
.strict()
|
|
58
62
|
.refine(
|
|
@@ -61,6 +65,13 @@ const siteSchema = z
|
|
|
61
65
|
? Boolean(s.projectId) && s.creationApproved === undefined
|
|
62
66
|
: s.projectId === undefined && typeof s.creationApproved === "boolean",
|
|
63
67
|
"Existing sites require projectId; new sites require creationApproved.",
|
|
68
|
+
)
|
|
69
|
+
.refine(
|
|
70
|
+
(s) =>
|
|
71
|
+
s.framework === "vercel" || (s.root && !s.build && !s.output)
|
|
72
|
+
? Boolean(s.root) && !s.output && !s.outputConfig
|
|
73
|
+
: Boolean(s.build && s.output && s.outputConfig),
|
|
74
|
+
"Framework sites require root; static sites require build, output and outputConfig.",
|
|
64
75
|
);
|
|
65
76
|
|
|
66
77
|
const sitesSchema = z
|