@solid-stack/builder 3.0.0 → 3.1.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 +4 -2
- package/dist/bin.js +73 -5
- package/dist/bin.js.map +1 -1
- package/dist/core/buildSchema.d.ts +6 -0
- package/dist/core/buildSchema.d.ts.map +1 -1
- package/dist/core/composition/compileGraphComposition.d.ts.map +1 -1
- package/dist/core/composition/composeEnvironment.d.ts +1 -0
- package/dist/core/composition/composeEnvironment.d.ts.map +1 -1
- package/dist/core/composition/validateOverrideCompose.d.ts.map +1 -1
- package/dist/core/config/resolveBuildStage.d.ts.map +1 -1
- package/dist/core/config/types.d.ts +3 -0
- package/dist/core/config/types.d.ts.map +1 -1
- package/dist/core/mesh/applyMeshExtends.d.ts.map +1 -1
- package/dist/index.js +73 -5
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/schemas/build-schema.json +30 -0
- package/schemas/mesh-schema.json +24 -0
|
@@ -37,6 +37,7 @@ export declare const serviceEndpointSchema: z.ZodObject<{
|
|
|
37
37
|
}>;
|
|
38
38
|
export declare const mainServiceSchema: z.ZodObject<{
|
|
39
39
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
40
|
+
buildArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
40
41
|
endpoints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
41
42
|
port: z.ZodNumber;
|
|
42
43
|
publicPort: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodLiteral<"AUTO">]>>;
|
|
@@ -57,6 +58,7 @@ export declare const mainServiceSchema: z.ZodObject<{
|
|
|
57
58
|
"override-compose": z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
58
59
|
}, "strict", z.ZodTypeAny, {
|
|
59
60
|
env?: Record<string, string> | undefined;
|
|
61
|
+
buildArgs?: Record<string, string> | undefined;
|
|
60
62
|
endpoints?: Record<string, {
|
|
61
63
|
port: number;
|
|
62
64
|
publicPort?: number | "AUTO" | undefined;
|
|
@@ -67,6 +69,7 @@ export declare const mainServiceSchema: z.ZodObject<{
|
|
|
67
69
|
"override-compose"?: string | undefined;
|
|
68
70
|
}, {
|
|
69
71
|
env?: Record<string, string> | undefined;
|
|
72
|
+
buildArgs?: Record<string, string> | undefined;
|
|
70
73
|
endpoints?: Record<string, {
|
|
71
74
|
port: number;
|
|
72
75
|
publicPort?: number | "AUTO" | undefined;
|
|
@@ -165,6 +168,7 @@ export declare const ordinaryServiceSchema: z.ZodEffects<z.ZodObject<{
|
|
|
165
168
|
}>;
|
|
166
169
|
export declare const mainOverlaySchema: z.ZodObject<{
|
|
167
170
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
171
|
+
buildArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
168
172
|
endpoints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
169
173
|
port: z.ZodOptional<z.ZodNumber>;
|
|
170
174
|
publicPort: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodLiteral<"AUTO">]>>>;
|
|
@@ -185,6 +189,7 @@ export declare const mainOverlaySchema: z.ZodObject<{
|
|
|
185
189
|
"override-compose": z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
186
190
|
}, "strict", z.ZodTypeAny, {
|
|
187
191
|
env?: Record<string, string> | undefined;
|
|
192
|
+
buildArgs?: Record<string, string> | undefined;
|
|
188
193
|
endpoints?: Record<string, {
|
|
189
194
|
port?: number | undefined;
|
|
190
195
|
publicPort?: number | "AUTO" | undefined;
|
|
@@ -195,6 +200,7 @@ export declare const mainOverlaySchema: z.ZodObject<{
|
|
|
195
200
|
"override-compose"?: string | undefined;
|
|
196
201
|
}, {
|
|
197
202
|
env?: Record<string, string> | undefined;
|
|
203
|
+
buildArgs?: Record<string, string> | undefined;
|
|
198
204
|
endpoints?: Record<string, {
|
|
199
205
|
port?: number | undefined;
|
|
200
206
|
publicPort?: number | "AUTO" | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildSchema.d.ts","sourceRoot":"","sources":["../../src/core/buildSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"buildSchema.d.ts","sourceRoot":"","sources":["../../src/core/buildSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;EAAgK,CAAC;AAChM,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;EAA4D,CAAC;AAC/F,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA0N,CAAC;AACzP,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAAmF,CAAC;AACpH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAyV,CAAC;AAC5X,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAmP,CAAC;AAClR,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAAyC,CAAC;AAC1E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAwO,CAAC;AAC3Q,eAAO,MAAM,mBAAmB,wGAO9B,CAAC;AACH,eAAO,MAAM,gBAAgB;;;;;;EAMJ,CAAC;AAC1B,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAiP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compileGraphComposition.d.ts","sourceRoot":"","sources":["../../../src/core/composition/compileGraphComposition.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,sBAAsB,CAAC;AAUvE,OAAO,KAAK,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"compileGraphComposition.d.ts","sourceRoot":"","sources":["../../../src/core/composition/compileGraphComposition.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,sBAAsB,CAAC;AAUvE,OAAO,KAAK,EAAE,oBAAoB,EAAiC,mBAAmB,EAA+C,MAAM,oBAAoB,CAAC;AAWhK,OAAO,KAAK,EAAE,mBAAmB,EAA4E,MAAM,YAAY,CAAC;AAQhI,MAAM,WAAW,iBAAiB;IAAG,KAAK,EAAE,WAAW,CAAC;IAAC,WAAW,EAAE,SAAS,GAAC,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAC,oBAAoB,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE;AAC7O,eAAO,MAAM,mBAAmB,iCAA+B,CAAC;AAqDhE,wBAAgB,uBAAuB,CAAC,KAAK,EAAC,iBAAiB,GAAE,mBAAmB,CAuFnF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ComposeService, ComposeEnvironmentMap } from "./types.js";
|
|
2
2
|
export declare function normalizeComposeEnvironment(value: unknown, context: string): ComposeEnvironmentMap;
|
|
3
3
|
export declare function mergeComposeEnvironment(service: ComposeService, overlay: Record<string, string>): void;
|
|
4
|
+
export declare function normalizeComposeBuildArgs(value: unknown, context: string, sourceFile?: string): Record<string, string>;
|
|
4
5
|
//# sourceMappingURL=composeEnvironment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composeEnvironment.d.ts","sourceRoot":"","sources":["../../../src/core/composition/composeEnvironment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxE,wBAAgB,2BAA2B,CAAC,KAAK,EAAC,OAAO,EAAC,OAAO,EAAC,MAAM,GAAE,qBAAqB,CAK9F;AACD,wBAAgB,uBAAuB,CAAC,OAAO,EAAC,cAAc,EAAC,OAAO,EAAC,MAAM,CAAC,MAAM,EAAC,MAAM,CAAC,GAAE,IAAI,CAA6G"}
|
|
1
|
+
{"version":3,"file":"composeEnvironment.d.ts","sourceRoot":"","sources":["../../../src/core/composition/composeEnvironment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxE,wBAAgB,2BAA2B,CAAC,KAAK,EAAC,OAAO,EAAC,OAAO,EAAC,MAAM,GAAE,qBAAqB,CAK9F;AACD,wBAAgB,uBAAuB,CAAC,OAAO,EAAC,cAAc,EAAC,OAAO,EAAC,MAAM,CAAC,MAAM,EAAC,MAAM,CAAC,GAAE,IAAI,CAA6G;AAC/M,wBAAgB,yBAAyB,CAAC,KAAK,EAAC,OAAO,EAAC,OAAO,EAAC,MAAM,EAAC,UAAU,CAAC,EAAC,MAAM,GAAE,MAAM,CAAC,MAAM,EAAC,MAAM,CAAC,CAO/G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateOverrideCompose.d.ts","sourceRoot":"","sources":["../../../src/core/composition/validateOverrideCompose.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAQpE,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAClE,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,GAAE,oBAAoB,CAgFlI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveBuildStage.d.ts","sourceRoot":"","sources":["../../../src/core/config/resolveBuildStage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAA+C,MAAM,sBAAsB,CAAC;AAGhH,OAAO,KAAK,EAAE,oBAAoB,EAA4B,MAAM,YAAY,CAAC;AAIjF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,GAAG,oBAAoB,
|
|
1
|
+
{"version":3,"file":"resolveBuildStage.d.ts","sourceRoot":"","sources":["../../../src/core/config/resolveBuildStage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAA+C,MAAM,sBAAsB,CAAC;AAGhH,OAAO,KAAK,EAAE,oBAAoB,EAA4B,MAAM,YAAY,CAAC;AAIjF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,GAAG,oBAAoB,CA+DhH"}
|
|
@@ -23,6 +23,7 @@ export type Edge = {
|
|
|
23
23
|
export type EffectiveMain = MainService & {
|
|
24
24
|
kind: "main";
|
|
25
25
|
env: Record<string, string>;
|
|
26
|
+
buildArgs: Record<string, string>;
|
|
26
27
|
endpoints: Record<string, MainEndpoint>;
|
|
27
28
|
requisites: Requisites;
|
|
28
29
|
};
|
|
@@ -44,6 +45,7 @@ export interface EffectiveBuildConfig {
|
|
|
44
45
|
layers: EffectiveBuildLayer[];
|
|
45
46
|
origins: Map<string, Origin>;
|
|
46
47
|
envOrigins: Map<string, Map<string, Origin>>;
|
|
48
|
+
buildArgsOrigins: Map<string, Map<string, Origin>>;
|
|
47
49
|
requisiteOrigins: Map<string, Map<string, Origin>>;
|
|
48
50
|
sourceFile: string;
|
|
49
51
|
projectDir: string;
|
|
@@ -79,6 +81,7 @@ export interface GraphNode {
|
|
|
79
81
|
envLayers: EnvironmentLayer[];
|
|
80
82
|
origin: Origin;
|
|
81
83
|
envOrigins: Map<string, Origin>;
|
|
84
|
+
buildArgsOrigins: Map<string, Origin>;
|
|
82
85
|
requisiteOrigins: Map<string, Origin>;
|
|
83
86
|
}
|
|
84
87
|
export interface EnvironmentLayer {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/config/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1K,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC;AACtC,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAC5B,MAAM,MAAM,MAAM,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAA;CAAE,CAAC;AAC7J,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI;IAAE,KAAK,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AACtD,MAAM,MAAM,IAAI,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAC7F,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IA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,GAAG,gBAAgB,GAAG,YAAY,CAAC;AACrK,MAAM,WAAW,aAAa;IAAG,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,gBAAgB,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE;AACvH,eAAO,MAAM,MAAM,aAAc,MAAM,GAAG,SAAS,iBAAiB,MAAM,KAAG,MAA2D,CAAC;AACzI,eAAO,MAAM,WAAW,OAAQ,MAAM,KAAG,MAAkI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyMeshExtends.d.ts","sourceRoot":"","sources":["../../../src/core/mesh/applyMeshExtends.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAU,MAAM,oBAAoB,CAAC;AAE5F,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,mBAAmB,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAC,oBAAoB,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"applyMeshExtends.d.ts","sourceRoot":"","sources":["../../../src/core/mesh/applyMeshExtends.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAU,MAAM,oBAAoB,CAAC;AAE5F,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,mBAAmB,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAC,oBAAoB,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAsCzH"}
|
package/dist/index.js
CHANGED
|
@@ -59,6 +59,7 @@ var AUTO_PORT_SCAN_START = 2e4;
|
|
|
59
59
|
var identifier = z.string().regex(BUILDER_IDENTIFIER_PATTERN);
|
|
60
60
|
var nonblank = z.string().min(1).refine((value) => value.trim().length > 0, "must not be blank");
|
|
61
61
|
var env = z.record(z.string(), z.string());
|
|
62
|
+
var buildArgs = z.record(z.string(), z.string());
|
|
62
63
|
var port = z.number().int().min(1).max(65535);
|
|
63
64
|
var publicPort = z.union([port, z.literal("AUTO")]);
|
|
64
65
|
var requisite = z.enum(["requirement", "dependency", "prerequisite"]);
|
|
@@ -66,10 +67,10 @@ var requisites = z.record(identifier, requisite);
|
|
|
66
67
|
var requisiteOverlay = z.record(identifier, z.union([requisite, z.literal(false)]));
|
|
67
68
|
var mainEndpointSchema = z.object({ port, publicPort: publicPort.optional(), primary: z.boolean().optional(), scheme: z.string().regex(ENDPOINT_SCHEME_PATTERN).optional() }).strict();
|
|
68
69
|
var serviceEndpointSchema = mainEndpointSchema.extend({ service: nonblank }).strict();
|
|
69
|
-
var mainServiceSchema = z.object({ env: env.optional(), endpoints: z.record(identifier, mainEndpointSchema).optional(), requisites: requisites.optional(), "override-compose": nonblank.optional() }).strict();
|
|
70
|
+
var mainServiceSchema = z.object({ env: env.optional(), buildArgs: buildArgs.optional(), endpoints: z.record(identifier, mainEndpointSchema).optional(), requisites: requisites.optional(), "override-compose": nonblank.optional() }).strict();
|
|
70
71
|
var testerServiceSchema = z.object({ compose: nonblank, service: nonblank, env: env.optional() }).strict();
|
|
71
72
|
var ordinaryServiceSchema = z.object({ compose: nonblank, service: nonblank.optional(), env: env.optional(), endpoints: z.record(identifier, serviceEndpointSchema).optional(), requisites: requisites.optional() }).strict().refine((value) => Boolean(value.service) || Boolean(value.endpoints && Object.keys(value.endpoints).length), "endpoint-less service requires service");
|
|
72
|
-
var mainOverlaySchema = z.object({ env: env.optional(), endpoints: z.record(identifier, mainEndpointSchema.partial().strict()).optional(), requisites: requisiteOverlay.optional(), "override-compose": nonblank.optional() }).strict();
|
|
73
|
+
var mainOverlaySchema = z.object({ env: env.optional(), buildArgs: buildArgs.optional(), endpoints: z.record(identifier, mainEndpointSchema.partial().strict()).optional(), requisites: requisiteOverlay.optional(), "override-compose": nonblank.optional() }).strict();
|
|
73
74
|
var testerOverlaySchema = testerServiceSchema.partial().strict();
|
|
74
75
|
var ordinaryOverlaySchema = z.object({ compose: nonblank.optional(), service: nonblank.optional(), env: env.optional(), endpoints: z.record(identifier, serviceEndpointSchema.partial().strict()).optional(), requisites: requisiteOverlay.optional() }).strict();
|
|
75
76
|
var buildServicesSchema = z.record(identifier, z.unknown()).superRefine((value, context) => {
|
|
@@ -411,6 +412,7 @@ function resolveBuildStage(build, stage2, sourceFile) {
|
|
|
411
412
|
const services2 = structuredClone(build.services);
|
|
412
413
|
const origins = /* @__PURE__ */ new Map();
|
|
413
414
|
const envOrigins = /* @__PURE__ */ new Map();
|
|
415
|
+
const buildArgsOrigins = /* @__PURE__ */ new Map();
|
|
414
416
|
const requisiteOrigins = /* @__PURE__ */ new Map();
|
|
415
417
|
const layers = [];
|
|
416
418
|
const deletedRequisiteTargets = [];
|
|
@@ -421,6 +423,9 @@ function resolveBuildStage(build, stage2, sourceFile) {
|
|
|
421
423
|
const env2 = envOrigins.get(name) ?? /* @__PURE__ */ new Map();
|
|
422
424
|
for (const key of Object.keys(entry.env ?? {})) env2.set(key, originFor(sourceFile, `${where}.env.${key}`, layer));
|
|
423
425
|
envOrigins.set(name, env2);
|
|
426
|
+
const args = buildArgsOrigins.get(name) ?? /* @__PURE__ */ new Map();
|
|
427
|
+
for (const key of Object.keys(entry.buildArgs ?? {})) args.set(key, originFor(sourceFile, `${where}.buildArgs.${key}`, layer));
|
|
428
|
+
buildArgsOrigins.set(name, args);
|
|
424
429
|
const edges = requisiteOrigins.get(name) ?? /* @__PURE__ */ new Map();
|
|
425
430
|
for (const [key, value] of Object.entries(entry.requisites ?? {})) {
|
|
426
431
|
if (value === false) edges.delete(key);
|
|
@@ -464,11 +469,12 @@ function resolveBuildStage(build, stage2, sourceFile) {
|
|
|
464
469
|
if (primary?.service && value.service !== primary.service) fail(sourceFile, stage2, `${originPath}.service`, "top-level service must equal primary endpoint owner", value.service);
|
|
465
470
|
}
|
|
466
471
|
value.env ??= {};
|
|
472
|
+
if (name === "main") value.buildArgs ??= {};
|
|
467
473
|
value.endpoints ??= {};
|
|
468
474
|
value.requisites ??= {};
|
|
469
475
|
value.kind = name === "main" ? "main" : "ordinary";
|
|
470
476
|
}
|
|
471
|
-
return { name: build.name, services: services2, layers, origins, envOrigins, requisiteOrigins, sourceFile, projectDir: path.dirname(sourceFile) };
|
|
477
|
+
return { name: build.name, services: services2, layers, origins, envOrigins, buildArgsOrigins, requisiteOrigins, sourceFile, projectDir: path.dirname(sourceFile) };
|
|
472
478
|
}
|
|
473
479
|
function normalizeProjectName(name, projectDir) {
|
|
474
480
|
let normalized = name.toLowerCase().replace(/[^a-z0-9_-]/g, "-").replace(/^[-_]+/, "").replace(/[-_]+$/, "");
|
|
@@ -881,6 +887,34 @@ function normalizeComposeEnvironment(value, context) {
|
|
|
881
887
|
}
|
|
882
888
|
return result;
|
|
883
889
|
}
|
|
890
|
+
function normalizeComposeBuildArgs(value, context, sourceFile) {
|
|
891
|
+
const result = {};
|
|
892
|
+
if (value == null) return result;
|
|
893
|
+
const fail4 = (configPath, reason, item) => {
|
|
894
|
+
throw new ConfigError({ ...sourceFile ? { sourceFile } : {}, configPath, value: item, reason });
|
|
895
|
+
};
|
|
896
|
+
if (Array.isArray(value)) {
|
|
897
|
+
for (const item of value) {
|
|
898
|
+
if (typeof item !== "string") fail4(context, "Compose build arg entries must be strings", item);
|
|
899
|
+
const at = item.indexOf("=");
|
|
900
|
+
const key = at < 0 ? item : item.slice(0, at);
|
|
901
|
+
if (!key) fail4(context, "Compose build arg key must not be empty", item);
|
|
902
|
+
result[key] = at < 0 ? "" : item.slice(at + 1);
|
|
903
|
+
}
|
|
904
|
+
return result;
|
|
905
|
+
}
|
|
906
|
+
if (typeof value !== "object") fail4(context, "Compose build args must be a map or list", value);
|
|
907
|
+
for (const [key, val] of Object.entries(value)) {
|
|
908
|
+
if (!key) fail4(context, "Compose build arg key must not be empty", key);
|
|
909
|
+
if (val === null || val === void 0) {
|
|
910
|
+
result[key] = "";
|
|
911
|
+
continue;
|
|
912
|
+
}
|
|
913
|
+
if (typeof val === "object") fail4(`${context}.${key}`, "Compose build arg value must be scalar", val);
|
|
914
|
+
result[key] = String(val);
|
|
915
|
+
}
|
|
916
|
+
return result;
|
|
917
|
+
}
|
|
884
918
|
|
|
885
919
|
// src/core/composition/composeNetworks.ts
|
|
886
920
|
function normalizeNetworks(value) {
|
|
@@ -1419,6 +1453,7 @@ function validateAndPrepareMainOverride(document, context) {
|
|
|
1419
1453
|
fail4("services.main.build.context", "override cannot change main build context", build.context);
|
|
1420
1454
|
}
|
|
1421
1455
|
}
|
|
1456
|
+
if (build.args !== void 0) build.args = normalizeComposeBuildArgs(build.args, "services.main.build.args", context.file);
|
|
1422
1457
|
}
|
|
1423
1458
|
const env2 = normalizeComposeEnvironment(main.environment, "services.main.environment");
|
|
1424
1459
|
for (const k of ["EXEC_MODE", "INFRA_MODE"]) if (k in env2) fail4(`services.main.environment.${k}`, "override cannot set Builder-owned environment");
|
|
@@ -1628,7 +1663,7 @@ function makeGraph(input) {
|
|
|
1628
1663
|
for (const [name, declaration] of Object.entries(build.services)) {
|
|
1629
1664
|
if (name === "tester") continue;
|
|
1630
1665
|
const id = nodeId(root, name), origin = copyOrigin(build.origins.get(name), root);
|
|
1631
|
-
nodes.set(id, { id, kind: name === "main" ? "main" : "ordinary", projectDir: build.projectDir, sourceService: name, ...root ? { meshRoot: root } : {}, declaration, envLayers: [], origin, envOrigins: new Map([...build.envOrigins.get(name) ?? []].map(([key, value]) => [key, copyOrigin(value, root)])), requisiteOrigins: new Map([...build.requisiteOrigins.get(name) ?? []].map(([key, value]) => [key, copyOrigin(value, root)])) });
|
|
1666
|
+
nodes.set(id, { id, kind: name === "main" ? "main" : "ordinary", projectDir: build.projectDir, sourceService: name, ...root ? { meshRoot: root } : {}, declaration, envLayers: [], origin, envOrigins: new Map([...build.envOrigins.get(name) ?? []].map(([key, value]) => [key, copyOrigin(value, root)])), buildArgsOrigins: new Map([...build.buildArgsOrigins.get(name) ?? []].map(([key, value]) => [key, copyOrigin(value, root)])), requisiteOrigins: new Map([...build.requisiteOrigins.get(name) ?? []].map(([key, value]) => [key, copyOrigin(value, root)])) });
|
|
1632
1667
|
}
|
|
1633
1668
|
}
|
|
1634
1669
|
input.mesh?.tester ?? input.instances.get("")?.services.tester;
|
|
@@ -1695,6 +1730,22 @@ function resolveJsonEnv(node, graph, endpoints, stage2, composition, shadowed) {
|
|
|
1695
1730
|
function validateJsonEnv(node, graph, endpoints, stage2, composition, shadowed) {
|
|
1696
1731
|
resolveJsonEnv(node, graph, endpoints, stage2, composition, shadowed);
|
|
1697
1732
|
}
|
|
1733
|
+
function resolveJsonBuildArgs(node, graph, endpoints, stage2, composition, shadowed) {
|
|
1734
|
+
const output = {};
|
|
1735
|
+
const main = node.declaration;
|
|
1736
|
+
for (const [key, value] of Object.entries(main.buildArgs)) {
|
|
1737
|
+
if (shadowed.has(key)) continue;
|
|
1738
|
+
const origin = node.buildArgsOrigins.get(key) ?? node.origin;
|
|
1739
|
+
output[key] = interpolateBuilderReferences(value, { graph, endpoints, consumer: node.id, origin, stage: stage2, composition }).replace(/\$/g, "$$$$");
|
|
1740
|
+
}
|
|
1741
|
+
return output;
|
|
1742
|
+
}
|
|
1743
|
+
function assertNoReservedBuildArgs(args, origin, stage2, composition) {
|
|
1744
|
+
for (const key of Object.keys(args)) if (key.startsWith("BUILDER_")) {
|
|
1745
|
+
const where = origin(key);
|
|
1746
|
+
throw new ConfigError({ sourceFile: where.sourceFile, configPath: where.configPath, stage: stage2, composition, reason: "BUILDER_ build arguments are reserved for Builder", value: key });
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1698
1749
|
function validateReserved(node, keys, stage2, composition) {
|
|
1699
1750
|
for (const key of keys) if (key in node.declaration.env) {
|
|
1700
1751
|
const origin = node.envOrigins.get(key) ?? node.origin;
|
|
@@ -1706,6 +1757,7 @@ function compileGraphComposition(input) {
|
|
|
1706
1757
|
const projectName = deriveProjectName(input.name, input.stage, input.projectDir), compose = { name: projectName, services: {}, networks: { builder: { driver: "bridge" } } };
|
|
1707
1758
|
const mainServiceNames = /* @__PURE__ */ new Map(), modules = /* @__PURE__ */ new Map(), runtimeServiceNames = [], deferredHealthChecks = [];
|
|
1708
1759
|
const mainOverrideEnv = /* @__PURE__ */ new Map();
|
|
1760
|
+
const mainOverrideBuildArgs = /* @__PURE__ */ new Map();
|
|
1709
1761
|
for (const [id, node] of [...graph.nodes].sort(([a], [b]) => a.localeCompare(b))) {
|
|
1710
1762
|
if (node.kind === "main") {
|
|
1711
1763
|
resolveApplicationDockerfile(node.projectDir, "Dockerfile", input.stage);
|
|
@@ -1728,11 +1780,11 @@ function compileGraphComposition(input) {
|
|
|
1728
1780
|
validateMaterializedComposeFiles(raw, file, input.stage, { baseDir: selected.origin.projectDir, composition: input.composition });
|
|
1729
1781
|
for (const section of ["volumes", "networks", "configs", "secrets"]) if (prepared.resources[section]) mergeDocument(compose, { services: {}, [section]: prepared.resources[section] }, selected.origin, input.stage);
|
|
1730
1782
|
mainOverrideEnv.set(id, normalizeComposeEnvironment(prepared.main.environment, `${selected.origin.configPath}.services.main.environment`));
|
|
1783
|
+
if (prepared.main.build && typeof prepared.main.build === "object" && Object.hasOwn(prepared.main.build, "args")) mainOverrideBuildArgs.set(id, normalizeComposeBuildArgs(prepared.main.build.args, "services.main.build.args", file));
|
|
1731
1784
|
const overlay = { ...prepared.main };
|
|
1732
1785
|
delete overlay.environment;
|
|
1733
1786
|
delete overlay.build;
|
|
1734
1787
|
Object.assign(service, mergeMainOverride(service, overlay));
|
|
1735
|
-
if (prepared.main.build && typeof prepared.main.build === "object") Object.assign(service.build, { args: prepared.main.build.args });
|
|
1736
1788
|
}
|
|
1737
1789
|
withBuilderNetwork(service);
|
|
1738
1790
|
compose.services[serviceName] = service;
|
|
@@ -1794,6 +1846,13 @@ function compileGraphComposition(input) {
|
|
|
1794
1846
|
const override = mainOverrideEnv.get(id) ?? {};
|
|
1795
1847
|
const shadowed = new Set(node.kind === "main" ? Object.keys(override).filter((key) => node.envOrigins.get(key)?.scope !== "mesh") : []);
|
|
1796
1848
|
validateJsonEnv(node, graph, endpoints, input.stage, input.composition, shadowed);
|
|
1849
|
+
if (node.kind === "main") {
|
|
1850
|
+
const args = node.declaration.buildArgs, overrideArgs = mainOverrideBuildArgs.get(id) ?? {};
|
|
1851
|
+
assertNoReservedBuildArgs(args, (key) => node.buildArgsOrigins.get(key) ?? node.origin, input.stage, input.composition);
|
|
1852
|
+
const overrideFile = selectedOverride(input.instances.get(node.meshRoot ?? ""), "main");
|
|
1853
|
+
assertNoReservedBuildArgs(overrideArgs, (key) => ({ sourceFile: overrideFile?.origin.sourceFile ?? node.origin.sourceFile, configPath: `services.main.build.args.${key}`, projectDir: node.projectDir, scope: node.origin.scope, layer: node.origin.layer }), input.stage, input.composition);
|
|
1854
|
+
resolveJsonBuildArgs(node, graph, endpoints, input.stage, input.composition, new Set(Object.keys(overrideArgs).filter((key) => node.buildArgsOrigins.get(key)?.scope !== "mesh")));
|
|
1855
|
+
}
|
|
1797
1856
|
}
|
|
1798
1857
|
const tester = input.mesh?.tester ?? input.instances.get("")?.services.tester;
|
|
1799
1858
|
const testerOrigin = input.mesh ? { sourceFile: input.mesh.sourceFile, configPath: "services.tester", projectDir: input.projectDir, scope: "mesh", layer: "base" } : { sourceFile: input.instances.get("").sourceFile, configPath: "services.tester", projectDir: input.projectDir, scope: "build", layer: "base" };
|
|
@@ -1826,6 +1885,12 @@ function compileGraphComposition(input) {
|
|
|
1826
1885
|
const sourceEnv = Object.fromEntries(Object.entries(buildEnv).filter(([key]) => node.envOrigins.get(key)?.scope !== "mesh"));
|
|
1827
1886
|
const meshEnv = Object.fromEntries(Object.entries(buildEnv).filter(([key]) => node.envOrigins.get(key)?.scope === "mesh"));
|
|
1828
1887
|
service.environment = { ...sourceEnv, ...override, ...meshEnv, EXEC_MODE: profile.execMode, INFRA_MODE: profile.infraMode, ...primary ? { PORT: String(primary.port) } : {} };
|
|
1888
|
+
const overrideArgs = mainOverrideBuildArgs.get(id) ?? {}, shadowedArgs = new Set(Object.keys(overrideArgs).filter((key) => node.buildArgsOrigins.get(key)?.scope !== "mesh"));
|
|
1889
|
+
const resolvedArgs = resolveJsonBuildArgs(node, graph, endpoints, input.stage, input.composition, shadowedArgs);
|
|
1890
|
+
const sourceArgs = Object.fromEntries(Object.entries(resolvedArgs).filter(([key]) => node.buildArgsOrigins.get(key)?.scope !== "mesh"));
|
|
1891
|
+
const meshArgs = Object.fromEntries(Object.entries(resolvedArgs).filter(([key]) => node.buildArgsOrigins.get(key)?.scope === "mesh"));
|
|
1892
|
+
const effectiveArgs = { ...sourceArgs, ...overrideArgs, ...meshArgs };
|
|
1893
|
+
if (Object.keys(effectiveArgs).length || mainOverrideBuildArgs.has(id)) service.build.args = effectiveArgs;
|
|
1829
1894
|
} else {
|
|
1830
1895
|
const module = modules.get(id);
|
|
1831
1896
|
for (const name of module.serviceNames) {
|
|
@@ -2114,6 +2179,9 @@ function applyMeshExtends(mesh, builds, stage2) {
|
|
|
2114
2179
|
const env2 = build.envOrigins.get(name) ?? /* @__PURE__ */ new Map();
|
|
2115
2180
|
for (const key of Object.keys(patch.env ?? {})) env2.set(key, { ...origin, configPath: `${origin.configPath}.env.${key}` });
|
|
2116
2181
|
build.envOrigins.set(name, env2);
|
|
2182
|
+
const args = build.buildArgsOrigins.get(name) ?? /* @__PURE__ */ new Map();
|
|
2183
|
+
for (const key of Object.keys(patch.buildArgs ?? {})) args.set(key, { ...origin, configPath: `${origin.configPath}.buildArgs.${key}` });
|
|
2184
|
+
build.buildArgsOrigins.set(name, args);
|
|
2117
2185
|
const edges = build.requisiteOrigins.get(name) ?? /* @__PURE__ */ new Map();
|
|
2118
2186
|
for (const [target, kind] of Object.entries(patch.requisites ?? {})) {
|
|
2119
2187
|
const canonical = target.startsWith("source.") ? target.slice(7) : `@mesh:${target}`;
|