@intentius/chant-lexicon-docker 0.1.13 → 0.1.15
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 +0 -1
- package/dist/integrity.json +4 -4
- package/dist/manifest.json +1 -1
- package/dist/meta.json +2 -2
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/generated/index.d.ts +1 -1
- package/src/generated/lexicon-docker.json +2 -2
- package/src/serializer.test.ts +25 -0
- package/src/spec/parse-compose.ts +7 -1
package/README.md
CHANGED
|
@@ -17,7 +17,6 @@ npm install --save-dev @intentius/chant @intentius/chant-lexicon-docker
|
|
|
17
17
|
| [@intentius/chant](https://www.npmjs.com/package/@intentius/chant) | Core type system, CLI, build pipeline |
|
|
18
18
|
| [@intentius/chant-lexicon-k8s](https://www.npmjs.com/package/@intentius/chant-lexicon-k8s) | Kubernetes lexicon |
|
|
19
19
|
| [@intentius/chant-lexicon-aws](https://www.npmjs.com/package/@intentius/chant-lexicon-aws) | AWS CloudFormation lexicon |
|
|
20
|
-
| [@intentius/chant-lexicon-flyway](https://www.npmjs.com/package/@intentius/chant-lexicon-flyway) | Flyway database migrations lexicon |
|
|
21
20
|
|
|
22
21
|
## License
|
|
23
22
|
|
package/dist/integrity.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"algorithm": "sha256",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"manifest.json": "
|
|
5
|
-
"meta.json": "
|
|
6
|
-
"types/index.d.ts": "
|
|
4
|
+
"manifest.json": "4381ebbf1d9f00679dbc0b0e1950590b95ec8b6874e30a5f0889a1f24f6b2aee",
|
|
5
|
+
"meta.json": "ae27dc809e705d37a645ee83b9789c50051282f7891d21d6b9e6ce8d111624ff",
|
|
6
|
+
"types/index.d.ts": "758f989ff86af54284d7f841a2db2259038d51ce1f3ed839a5d8e83fa20d95b8",
|
|
7
7
|
"rules/no-latest-tag.ts": "efd060453d8ca3d5b85c3972906c6650b6f63eb5f67cb6cdb0f16a41cad91228",
|
|
8
8
|
"rules/apt-no-recommends.ts": "579ea54435b1cbd59088994aaaf7b249a42064facd74b62163b302fe31e769e0",
|
|
9
9
|
"rules/docker-helpers.ts": "c76ea1294b630df086a23b24c0435c9daac8cdf21dd371a8aabf74e9984e6b13",
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
"skills/chant-docker.md": "3ff0708e3c76e245f202948949c768464563af2b60cc9aa2ca52f494ef8357f1",
|
|
16
16
|
"skills/chant-docker-patterns.md": "ad1b0196d8150b2df579a699ff107f604340c799c04f3460ebf65003e287b12a"
|
|
17
17
|
},
|
|
18
|
-
"composite": "
|
|
18
|
+
"composite": "64e857cbd8f5ae559f11974e01808b366d18e6dfb470e26e6d161d5f2feb6140"
|
|
19
19
|
}
|
package/dist/manifest.json
CHANGED
package/dist/meta.json
CHANGED
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"description": "Networks to attach"
|
|
38
38
|
},
|
|
39
39
|
"depends_on": {
|
|
40
|
-
"type": "string[]",
|
|
41
|
-
"description": "Service dependencies"
|
|
40
|
+
"type": "string[] | Record<string, { condition: \"service_started\" | \"service_healthy\" | \"service_completed_successfully\"; restart?: boolean; required?: boolean }>",
|
|
41
|
+
"description": "Service dependencies (short list-form, or long form with a wait condition)"
|
|
42
42
|
},
|
|
43
43
|
"restart": {
|
|
44
44
|
"type": "string",
|
package/dist/types/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface ServiceProps {
|
|
|
10
10
|
ports?: string[];
|
|
11
11
|
volumes?: string[];
|
|
12
12
|
networks?: string[];
|
|
13
|
-
depends_on?: string[];
|
|
13
|
+
depends_on?: string[] | Record<string, { condition: "service_started" | "service_healthy" | "service_completed_successfully"; restart?: boolean; required?: boolean }>;
|
|
14
14
|
restart?: string;
|
|
15
15
|
labels?: Record<string, string>;
|
|
16
16
|
healthcheck?: object;
|
package/package.json
CHANGED
package/src/generated/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface ServiceProps {
|
|
|
10
10
|
ports?: string[];
|
|
11
11
|
volumes?: string[];
|
|
12
12
|
networks?: string[];
|
|
13
|
-
depends_on?: string[];
|
|
13
|
+
depends_on?: string[] | Record<string, { condition: "service_started" | "service_healthy" | "service_completed_successfully"; restart?: boolean; required?: boolean }>;
|
|
14
14
|
restart?: string;
|
|
15
15
|
labels?: Record<string, string>;
|
|
16
16
|
healthcheck?: object;
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"description": "Networks to attach"
|
|
38
38
|
},
|
|
39
39
|
"depends_on": {
|
|
40
|
-
"type": "string[]",
|
|
41
|
-
"description": "Service dependencies"
|
|
40
|
+
"type": "string[] | Record<string, { condition: \"service_started\" | \"service_healthy\" | \"service_completed_successfully\"; restart?: boolean; required?: boolean }>",
|
|
41
|
+
"description": "Service dependencies (short list-form, or long form with a wait condition)"
|
|
42
42
|
},
|
|
43
43
|
"restart": {
|
|
44
44
|
"type": "string",
|
package/src/serializer.test.ts
CHANGED
|
@@ -119,6 +119,31 @@ describe("dockerSerializer.serialize — single service", () => {
|
|
|
119
119
|
const output = dockerSerializer.serialize(entities) as string;
|
|
120
120
|
expect(output).not.toContain("restart:");
|
|
121
121
|
});
|
|
122
|
+
|
|
123
|
+
test("emits short-form depends_on (list)", () => {
|
|
124
|
+
const entities = new Map<string, Declarable>();
|
|
125
|
+
entities.set("api", new MockService({ image: "nginx", depends_on: ["db"] }));
|
|
126
|
+
|
|
127
|
+
const output = dockerSerializer.serialize(entities) as string;
|
|
128
|
+
expect(output).toContain("depends_on:");
|
|
129
|
+
expect(output).toContain("- db");
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
test("emits long-form depends_on with a wait condition", () => {
|
|
133
|
+
const entities = new Map<string, Declarable>();
|
|
134
|
+
entities.set(
|
|
135
|
+
"api",
|
|
136
|
+
new MockService({
|
|
137
|
+
image: "nginx",
|
|
138
|
+
depends_on: { db: { condition: "service_healthy" } },
|
|
139
|
+
}),
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
const output = dockerSerializer.serialize(entities) as string;
|
|
143
|
+
expect(output).toContain("depends_on:");
|
|
144
|
+
expect(output).toContain("db:");
|
|
145
|
+
expect(output).toContain("condition: service_healthy");
|
|
146
|
+
});
|
|
122
147
|
});
|
|
123
148
|
|
|
124
149
|
// ── Multi-resource ────────────────────────────────────────────────
|
|
@@ -46,7 +46,13 @@ export function parseComposeSpec(_data: Buffer): ComposeParseResult[] {
|
|
|
46
46
|
{ name: "ports", type: "string[]", description: "Published ports" },
|
|
47
47
|
{ name: "volumes", type: "string[]", description: "Volume mounts" },
|
|
48
48
|
{ name: "networks", type: "string[]", description: "Networks to attach" },
|
|
49
|
-
{
|
|
49
|
+
{
|
|
50
|
+
name: "depends_on",
|
|
51
|
+
// Compose `depends_on` is a oneOf: short list-form, or long form with a
|
|
52
|
+
// wait condition (service_started/healthy/completed_successfully).
|
|
53
|
+
type: 'string[] | Record<string, { condition: "service_started" | "service_healthy" | "service_completed_successfully"; restart?: boolean; required?: boolean }>',
|
|
54
|
+
description: "Service dependencies (short list-form, or long form with a wait condition)",
|
|
55
|
+
},
|
|
50
56
|
{ name: "restart", type: "string", description: "Restart policy" },
|
|
51
57
|
{ name: "labels", type: "Record<string, string>", description: "Container labels" },
|
|
52
58
|
{ name: "healthcheck", type: "object", description: "Health check configuration" },
|