@intentius/chant-lexicon-docker 0.37.0 → 0.37.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.
@@ -1,5 +1,10 @@
1
1
  /**
2
2
  * Docker lexicon docs generation.
3
+ *
4
+ * The docker site is hand-authored under docs/src/content/docs/, unlike every
5
+ * other lexicon's generated Starlight site. The rules table is the exception:
6
+ * a hand-maintained one can fall behind the rules in src/lint/ without anything
7
+ * catching it, so it is generated from source here (#1312).
3
8
  */
4
9
  export declare function generateDocs(opts?: {
5
10
  verbose?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/codegen/docs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,wBAAsB,YAAY,CAAC,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAO9E"}
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/codegen/docs.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,wBAAsB,YAAY,CAAC,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA2B9E"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "f11c869972afd4ef2b352b93dcc42eba59cd88a1bfa31367ff1a4260e1208b4a",
4
+ "manifest.json": "df0b370be9a339c848af54491bdee061b586c8fef60ea71296d22b130281bcc8",
5
5
  "meta.json": "ae27dc809e705d37a645ee83b9789c50051282f7891d21d6b9e6ce8d111624ff",
6
6
  "types/index.d.ts": "758f989ff86af54284d7f841a2db2259038d51ce1f3ed839a5d8e83fa20d95b8",
7
7
  "rules/no-latest-tag.ts": "efd060453d8ca3d5b85c3972906c6650b6f63eb5f67cb6cdb0f16a41cad91228",
@@ -15,5 +15,5 @@
15
15
  "skills/chant-docker.md": "3ff0708e3c76e245f202948949c768464563af2b60cc9aa2ca52f494ef8357f1",
16
16
  "skills/chant-docker-patterns.md": "ad1b0196d8150b2df579a699ff107f604340c799c04f3460ebf65003e287b12a"
17
17
  },
18
- "composite": "60662403f5abe4718c201c8e733a13732ebcfffa49a613aa6af6393d0b498765"
18
+ "composite": "4af15929d7e6918691ba82dca58bac5a19ea3b388f57fae7fd21bb15a8b06694"
19
19
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docker",
3
- "version": "0.37.0",
3
+ "version": "0.37.2",
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.37.0",
3
+ "version": "0.37.2",
4
4
  "description": "Docker lexicon for chant — declarative IaC in TypeScript",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -67,7 +67,7 @@
67
67
  "typescript": "^5.9.3"
68
68
  },
69
69
  "peerDependencies": {
70
- "@intentius/chant": "^0.37.0",
70
+ "@intentius/chant": "^0.37.2",
71
71
  "typescript": "^5.9.3"
72
72
  }
73
73
  }
@@ -1,12 +1,42 @@
1
1
  /**
2
2
  * Docker lexicon docs generation.
3
+ *
4
+ * The docker site is hand-authored under docs/src/content/docs/, unlike every
5
+ * other lexicon's generated Starlight site. The rules table is the exception:
6
+ * a hand-maintained one can fall behind the rules in src/lint/ without anything
7
+ * catching it, so it is generated from source here (#1312).
3
8
  */
4
9
 
10
+ import { dirname, join } from "path";
11
+ import { fileURLToPath } from "url";
12
+ import { writeFileSync } from "fs";
13
+ import { generateRulesPage, type DocsConfig } from "@intentius/chant/codegen/docs";
14
+
5
15
  export async function generateDocs(opts?: { verbose?: boolean }): Promise<void> {
16
+ const pkgDir = dirname(dirname(dirname(fileURLToPath(import.meta.url))));
17
+
6
18
  if (opts?.verbose) {
7
19
  console.error("Generating Docker lexicon docs...");
8
20
  }
9
- // Docs are currently hand-authored in docs/src/content/docs/
21
+
22
+ const config = {
23
+ name: "docker",
24
+ displayName: "Docker",
25
+ description: "Typed constructors for Docker Compose files and Dockerfiles",
26
+ distDir: join(pkgDir, "dist"),
27
+ outDir: join(pkgDir, "docs"),
28
+ } as DocsConfig;
29
+
30
+ const rules = generateRulesPage(config, join(pkgDir, "src"));
31
+ if (rules) {
32
+ const out = join(pkgDir, "docs", "src", "content", "docs", "rules.mdx");
33
+ writeFileSync(out, rules);
34
+ if (opts?.verbose) {
35
+ console.error(`Wrote ${out}`);
36
+ }
37
+ }
38
+
39
+ // Every other page is hand-authored in docs/src/content/docs/.
10
40
  // Future: auto-generate entity reference pages from lexicon-docker.json
11
- console.error("Docker docs: see docs/src/content/docs/overview.mdx");
41
+ console.error("Docker docs: rules.mdx generated; prose pages are hand-authored");
12
42
  }