@mp-lb/arcnet 0.5.9 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/compileArcnet.d.ts.map +1 -1
- package/dist/compileArcnet.js +11 -0
- package/dist/compileArcnet.js.map +1 -1
- package/docs/public/llms-full.txt +2 -0
- package/package.json +2 -2
- package/src/compileArcnet.ts +12 -0
package/README.md
CHANGED
|
@@ -13,6 +13,8 @@ A package-only project gets no deploy workflow or cloud configuration. Vercel si
|
|
|
13
13
|
|
|
14
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. Set `vercel.dnsZone` and a site's `domain` to attach a custom domain and reconcile its Cloudflare CNAME on production deploy; the deploy consumer must provide `CLOUDFLARE_API_TOKEN`. Existing unrelated DNS records cause a clear error rather than being replaced. 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
|
+
When `aws-s3` is selected, the conventional `s3` service gets a private `arcnet.<project>.backend` bucket by default. Other S3 services use `arcnet.<project>.<service>`; set `params.bucket` to override either name. ArcNet derives browser CORS origins from the HTTPS domains of selected services and Vercel sites. This permits browser requests made with backend-issued presigned URLs while the bucket remains private.
|
|
17
|
+
|
|
16
18
|
For a new Vercel site, set `mode: new`, `creationApproved: true`, and its `projectName`. The first approved push to `main` creates it if missing; subsequent deploys verify and reuse the named project. `mode: existing` still requires a committed project ID and never creates a project. `arcnet inspect` reports missing new projects without creating them.
|
|
17
19
|
|
|
18
20
|
`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.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compileArcnet.d.ts","sourceRoot":"","sources":["../src/compileArcnet.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,eAAO,MAAM,UAAU,GAAI,QAAQ,YAAY,iDACoE,CAAC;AAEpH,eAAO,MAAM,aAAa,GAAI,QAAQ,YAAY,EAAE,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;CAU/D,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,QAAQ,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"compileArcnet.d.ts","sourceRoot":"","sources":["../src/compileArcnet.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,eAAO,MAAM,UAAU,GAAI,QAAQ,YAAY,iDACoE,CAAC;AAEpH,eAAO,MAAM,aAAa,GAAI,QAAQ,YAAY,EAAE,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;CAU/D,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,QAAQ,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuEpD,CAAC"}
|
package/dist/compileArcnet.js
CHANGED
|
@@ -21,6 +21,8 @@ export const compileTerraform = (config) => {
|
|
|
21
21
|
if (Object.values(services).some((service) => service.module === "gce-worker"))
|
|
22
22
|
throw new Error("GCE workers are deferred until the startup module is replaced.");
|
|
23
23
|
for (const [name, service] of Object.entries(services)) {
|
|
24
|
+
if (service.module === "aws-s3")
|
|
25
|
+
service.params.bucket ??= `arcnet.${config.project}.${name === "s3" ? "backend" : name}`;
|
|
24
26
|
if (["cloud-run-web", "gce-worker"].includes(service.module) &&
|
|
25
27
|
!service.dockerfile)
|
|
26
28
|
service.dockerfile = `.arcnet/${name}.Dockerfile`;
|
|
@@ -28,6 +30,15 @@ export const compileTerraform = (config) => {
|
|
|
28
30
|
!service.domain)
|
|
29
31
|
service.domain = `${["frontend", "web", "landing-page"].includes(name) ? "" : `${name === "backend" ? "api" : name}.`}${config.project}.mp-lb.dev`;
|
|
30
32
|
}
|
|
33
|
+
const corsOrigins = [
|
|
34
|
+
...Object.values(services).map((service) => service.domain),
|
|
35
|
+
...Object.values(config.vercel?.sites ?? {}).map((site) => site.domain),
|
|
36
|
+
]
|
|
37
|
+
.filter((domain) => Boolean(domain))
|
|
38
|
+
.map((domain) => `https://${domain}`);
|
|
39
|
+
for (const service of Object.values(services))
|
|
40
|
+
if (service.module === "aws-s3")
|
|
41
|
+
service.params["cors-origins"] ??= [...new Set(corsOrigins)].sort();
|
|
31
42
|
const infrastructure = deployBlockSchema.shape.project.parse(config.infrastructure ?? {});
|
|
32
43
|
const modules = [
|
|
33
44
|
...Object.values(services),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compileArcnet.js","sourceRoot":"","sources":["../src/compileArcnet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAoB,EAAE,EAAE,CACjD,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CA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;QAC1B,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC;KACjC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACrC,MAAM,OAAO,GAAG,kBAAkB,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAChE,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;QAC3C,IAAI,OAAO,CAAC,MAAM,KAAK,eAAe;YACpC,OAAO,CAAC,MAAM,GAAG,sDAAsD,CAAC;IAE5E,MAAM,OAAO,GAAG;QACd,GAAG,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE;QAC9B,QAAQ,EAAE,EAAE,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC,KAAK,CAAC,EAAE;QAC3D,EAAE,EAAE;YACF,MAAM,EAAE,WAAW;YACnB,YAAY,EAAE,CAAC,KAAK,CAAC;YACrB,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE;SAC1C;QACD,GAAG,cAAc;KAClB,CAAC;IAEF,MAAM,UAAU,GAAG,iBAAiB,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;IAElE,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI;QAClC,wBAAwB,EAAE,EAAE;QAC5B,cAAc,EAAE,qBAAqB,MAAM,CAAC,OAAO,0BAA0B;KAC9E,CAAC;IAEF,OAAO;QACL,UAAU;QACV,OAAO;QACP,QAAQ;KACT,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -13,6 +13,8 @@ A package-only project gets no deploy workflow or cloud configuration. Vercel si
|
|
|
13
13
|
|
|
14
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. Set `vercel.dnsZone` and a site's `domain` to attach a custom domain and reconcile its Cloudflare CNAME on production deploy; the deploy consumer must provide `CLOUDFLARE_API_TOKEN`. Existing unrelated DNS records cause a clear error rather than being replaced. 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
|
+
When `aws-s3` is selected, the conventional `s3` service gets a private `arcnet.<project>.backend` bucket by default. Other S3 services use `arcnet.<project>.<service>`; set `params.bucket` to override either name. ArcNet derives browser CORS origins from the HTTPS domains of selected services and Vercel sites. This permits browser requests made with backend-issued presigned URLs while the bucket remains private.
|
|
17
|
+
|
|
16
18
|
For a new Vercel site, set `mode: new`, `creationApproved: true`, and its `projectName`. The first approved push to `main` creates it if missing; subsequent deploys verify and reuse the named project. `mode: existing` still requires a committed project ID and never creates a project. `arcnet inspect` reports missing new projects without creating them.
|
|
17
19
|
|
|
18
20
|
`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.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mp-lb/arcnet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "ArcNet project installation and deployment CLI.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@mp-lb/forum-secrets": "0.2.1",
|
|
39
|
-
"@mp-lb/zapper": "0.21.
|
|
39
|
+
"@mp-lb/zapper": "0.21.5",
|
|
40
40
|
"commander": "14.0.3",
|
|
41
41
|
"yaml": "2.8.1",
|
|
42
42
|
"zod": "4.4.1"
|
package/src/compileArcnet.ts
CHANGED
|
@@ -30,6 +30,8 @@ export const compileTerraform = (config: ArcnetConfig) => {
|
|
|
30
30
|
);
|
|
31
31
|
|
|
32
32
|
for (const [name, service] of Object.entries(services)) {
|
|
33
|
+
if (service.module === "aws-s3")
|
|
34
|
+
service.params.bucket ??= `arcnet.${config.project}.${name === "s3" ? "backend" : name}`;
|
|
33
35
|
if (
|
|
34
36
|
["cloud-run-web", "gce-worker"].includes(service.module) &&
|
|
35
37
|
!service.dockerfile
|
|
@@ -42,6 +44,16 @@ export const compileTerraform = (config: ArcnetConfig) => {
|
|
|
42
44
|
service.domain = `${["frontend", "web", "landing-page"].includes(name) ? "" : `${name === "backend" ? "api" : name}.`}${config.project}.mp-lb.dev`;
|
|
43
45
|
}
|
|
44
46
|
|
|
47
|
+
const corsOrigins = [
|
|
48
|
+
...Object.values(services).map((service) => service.domain),
|
|
49
|
+
...Object.values(config.vercel?.sites ?? {}).map((site) => site.domain),
|
|
50
|
+
]
|
|
51
|
+
.filter((domain): domain is string => Boolean(domain))
|
|
52
|
+
.map((domain) => `https://${domain}`);
|
|
53
|
+
for (const service of Object.values(services))
|
|
54
|
+
if (service.module === "aws-s3")
|
|
55
|
+
service.params["cors-origins"] ??= [...new Set(corsOrigins)].sort();
|
|
56
|
+
|
|
45
57
|
const infrastructure = deployBlockSchema.shape.project.parse(
|
|
46
58
|
config.infrastructure ?? {},
|
|
47
59
|
);
|