@intentius/chant-lexicon-docker 0.124.87 → 0.124.89

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "2e0ea3e7ab92d77dcaa7211c157aa4c0d18c145056a0b846bc6bddd0c1e0d371",
4
+ "manifest.json": "05bbd000d8b778c94abcdbbfebf4f3c06397f581cbdc4d6c96dfb45517522f45",
5
5
  "meta.json": "b566d5cb84a87836a861dc5840c229577e860c5427123192810b7839f764a9ee",
6
6
  "types/index.d.ts": "256644d2bffa2845900cf86984cc7dde3d9e79da5994ab13a22b0b83edf7f62a",
7
7
  "rules/no-latest-tag.ts": "2281be0457c02e782fbafe015f65ff5fd2b008ef0f879226e9b548a3ea65399b",
@@ -24,5 +24,5 @@
24
24
  "skills/chant-docker.md": "d499e18525f2cfd7ecc5b5be4a4c52c6931ebdef8d70f872d53279e53bed6f7e",
25
25
  "skills/chant-docker-patterns.md": "655f437c833796e0d520bbe08740a4226d48fcec4912b0438672ed5a299897e7"
26
26
  },
27
- "composite": "0f426338c5204e317171a302c36bb06525dff75110f01203bc2426c457ce830b"
27
+ "composite": "5a0c054c2199227dd1160dafe0e3763adba5c4c79dd71e0595821b43abccab8a"
28
28
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docker",
3
- "version": "0.124.87",
3
+ "version": "0.124.89",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "Docker",
6
6
  "intrinsics": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-docker",
3
- "version": "0.124.87",
3
+ "version": "0.124.89",
4
4
  "description": "Docker lexicon for chant — declarative IaC in TypeScript",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -63,13 +63,13 @@
63
63
  "build": "../../scripts/tsc7.sh -p tsconfig.build.json --sourceMap false && tsc-alias -p tsconfig.build.json"
64
64
  },
65
65
  "dependencies": {
66
- "@intentius/chant-lexicon-otel": "^0.124.87"
66
+ "@intentius/chant-lexicon-otel": "^0.124.89"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@intentius/chant": "*",
70
70
  "typescript": "^5.9.3"
71
71
  },
72
72
  "peerDependencies": {
73
- "@intentius/chant": "^0.124.87"
73
+ "@intentius/chant": "^0.124.89"
74
74
  }
75
75
  }
@@ -204,6 +204,16 @@ describe("dockerSerializer.serialize — Dockerfile", () => {
204
204
  expect(result.primary).toContain("web:");
205
205
  });
206
206
 
207
+ test("Dockerfiles alone leave the compose output blank, so `chant build -o <dir>/` writes only them (#4950)", () => {
208
+ const entities = new Map<string, Declarable>();
209
+ entities.set("tofu", new MockDockerfile({ from: "tofu" }));
210
+ entities.set("node", new MockDockerfile({ from: "node:22" }));
211
+
212
+ const result = dockerSerializer.serialize(entities) as { primary: string; files: Record<string, string> };
213
+ expect(result.primary.trim()).toBe("");
214
+ expect(Object.keys(result.files).sort()).toEqual(["Dockerfile.node", "Dockerfile.tofu"]);
215
+ });
216
+
207
217
  test("returns string (no SerializerResult) when no Dockerfile entities", () => {
208
218
  const entities = new Map<string, Declarable>();
209
219
  entities.set("web", new MockService({ image: "nginx" }));
@@ -38,10 +38,10 @@ function blocks(file: string): Block[] {
38
38
  }
39
39
 
40
40
  /** Type errors in in-memory files, compiled against the lexicon's source with the repo typecheck's options. */
41
- function typeErrors(files: Map<string, string>): string[] {
41
+ function typeErrors(files: Map<string, string>, extra: ts.CompilerOptions = {}): string[] {
42
42
  const config = ts.readConfigFile(join(repoRoot, "tsconfig.typecheck.json"), ts.sys.readFile);
43
43
  const { options } = ts.parseJsonConfigFileContent(config.config, ts.sys, repoRoot);
44
- const checkOptions = { ...options, noEmit: true, types: [], skipLibCheck: true, declaration: false, declarationMap: false, sourceMap: false };
44
+ const checkOptions = { ...options, noEmit: true, types: [], skipLibCheck: true, declaration: false, declarationMap: false, sourceMap: false, ...extra };
45
45
  const host = ts.createCompilerHost(checkOptions);
46
46
  const getSourceFile = host.getSourceFile.bind(host);
47
47
  host.getSourceFile = (name, lang, ...rest) =>
@@ -104,4 +104,22 @@ describe("docker TypeScript outside the repo typecheck type-checks", () => {
104
104
  expect(files.size).toBeGreaterThanOrEqual(4);
105
105
  expect(typeErrors(files)).toEqual([]);
106
106
  }, 120_000);
107
+
108
+ test("a product's image as ci-image's stages, under exactOptionalPropertyTypes (#4932)", () => {
109
+ // As sql-yodeler writes it: its tsconfig sets exactOptionalPropertyTypes, which CiImageStep's Partial record did not satisfy.
110
+ const code = [
111
+ `import { Dockerfile, type DockerfileStage } from "@intentius/chant-lexicon-docker";`,
112
+ `import { productImageStages } from "@intentius/chant/ci-image";`,
113
+ `const stages = productImageStages({`,
114
+ ` name: "sql-yodeler", product: "yodel", description: "yodel on Node 22", source: "https://github.com/INTENTIUS/sql-yodeler",`,
115
+ ` tools: [{ tool: "pulumi", version: "3.272.0" }],`,
116
+ ` steps: [{ run: "true" }, { env: "A=1" }],`,
117
+ ` bundle: { npm: '"$PKG"', prefix: "/opt/yodel", mountContext: true, require: ["PKG"] },`,
118
+ `});`,
119
+ `export const typed: DockerfileStage[] = stages;`,
120
+ `export const image = new Dockerfile({ stages: productImageStages({ name: "x", product: "x", description: "d", source: "s", bundle: { file: "a", bin: "a" } }) });`,
121
+ ].join("\n");
122
+ const files = new Map([[join(virtualRoot, "ci-image", "image.ts"), code]]);
123
+ expect(typeErrors(files, { exactOptionalPropertyTypes: true })).toEqual([]);
124
+ }, 120_000);
107
125
  });