@intentius/chant-lexicon-github 0.1.7 → 0.1.9

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.
Files changed (57) hide show
  1. package/README.md +21 -0
  2. package/dist/integrity.json +37 -37
  3. package/dist/manifest.json +1 -1
  4. package/dist/types/index.d.ts +13 -22
  5. package/package.json +7 -7
  6. package/src/codegen/docs.test.ts +4 -4
  7. package/src/codegen/docs.ts +2 -2
  8. package/src/codegen/generate-cli.ts +1 -1
  9. package/src/codegen/generate.test.ts +1 -1
  10. package/src/codegen/package.test.ts +1 -1
  11. package/src/codegen/package.ts +2 -5
  12. package/src/composites/composites.test.ts +1 -1
  13. package/src/coverage.test.ts +1 -1
  14. package/src/expression.test.ts +1 -1
  15. package/src/generated/index.d.ts +13 -22
  16. package/src/import/generator.test.ts +1 -1
  17. package/src/import/parser.test.ts +1 -1
  18. package/src/import/roundtrip.test.ts +1 -1
  19. package/src/lint/post-synth/gha006.test.ts +1 -1
  20. package/src/lint/post-synth/gha009.test.ts +1 -1
  21. package/src/lint/post-synth/gha011.test.ts +1 -1
  22. package/src/lint/post-synth/gha017.test.ts +1 -1
  23. package/src/lint/post-synth/gha018.test.ts +1 -1
  24. package/src/lint/post-synth/gha019.test.ts +1 -1
  25. package/src/lint/post-synth/gha020.test.ts +1 -1
  26. package/src/lint/post-synth/gha021.test.ts +1 -1
  27. package/src/lint/post-synth/gha022.test.ts +1 -1
  28. package/src/lint/post-synth/gha023.test.ts +1 -1
  29. package/src/lint/post-synth/gha024.test.ts +1 -1
  30. package/src/lint/post-synth/gha025.test.ts +1 -1
  31. package/src/lint/post-synth/gha026.test.ts +1 -1
  32. package/src/lint/post-synth/gha027.test.ts +1 -1
  33. package/src/lint/post-synth/gha028.test.ts +1 -1
  34. package/src/lint/post-synth/post-synth.test.ts +1 -1
  35. package/src/lint/rules/deprecated-action-version.test.ts +1 -1
  36. package/src/lint/rules/detect-secrets.test.ts +1 -1
  37. package/src/lint/rules/extract-inline-structs.test.ts +1 -1
  38. package/src/lint/rules/file-job-limit.test.ts +1 -1
  39. package/src/lint/rules/job-timeout.test.ts +1 -1
  40. package/src/lint/rules/missing-recommended-inputs.test.ts +1 -1
  41. package/src/lint/rules/no-hardcoded-secrets.test.ts +1 -1
  42. package/src/lint/rules/no-raw-expressions.test.ts +1 -1
  43. package/src/lint/rules/rules.test.ts +1 -1
  44. package/src/lint/rules/suggest-cache.test.ts +1 -1
  45. package/src/lint/rules/use-condition-builders.test.ts +1 -1
  46. package/src/lint/rules/use-matrix-builder.test.ts +1 -1
  47. package/src/lint/rules/use-typed-actions.test.ts +1 -1
  48. package/src/lint/rules/validate-concurrency.test.ts +1 -1
  49. package/src/lsp/completions.test.ts +1 -1
  50. package/src/lsp/hover.test.ts +1 -1
  51. package/src/package-cli.ts +2 -2
  52. package/src/plugin.test.ts +3 -3
  53. package/src/plugin.ts +19 -21
  54. package/src/serializer.test.ts +1 -1
  55. package/src/validate-cli.ts +2 -2
  56. package/src/validate.test.ts +2 -2
  57. package/src/variables.test.ts +1 -1
package/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # @intentius/chant-lexicon-github
2
+
3
+ GitHub Actions lexicon for [chant](https://intentius.io/chant/) — declare workflow definitions as typed TypeScript that serializes to `.github/workflows/*.yml`.
4
+
5
+ ```bash
6
+ npm install --save-dev @intentius/chant @intentius/chant-lexicon-github
7
+ ```
8
+
9
+ ## Runtime observation: N/A
10
+
11
+ `chant state snapshot` and `chant state diff --live` operate by querying a runtime equivalent of each declared resource. The GitHub lexicon doesn't fit that model:
12
+
13
+ - The lexicon's chant entities describe **GitHub Actions workflow definitions**, which are git-tracked. Drift in the definition itself is just `git diff` — no observation surface needed.
14
+ - Workflow **runs** are events (per-execution), not declared state. They're observable via the GitHub API but the abstraction is `listRecentRuns()`, not `describeResources()` or `listArtifacts()`. That's a separate plugin contract if/when it's needed.
15
+ - "Is this workflow enabled in the GitHub UI?" is theoretically observable but a marginal use case.
16
+
17
+ If a concrete observation use case surfaces, file a focused issue rather than retrofitting `listArtifacts()` to fit.
18
+
19
+ ## License
20
+
21
+ See the main project LICENSE file.
@@ -1,41 +1,41 @@
1
1
  {
2
- "algorithm": "xxhash64",
2
+ "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "4f79e2db52795eab",
5
- "meta.json": "2d1cccf3c19883a7",
6
- "types/index.d.ts": "9d6f903cca5de1e9",
7
- "rules/deprecated-action-version.ts": "9ec91b190557f25f",
8
- "rules/extract-inline-structs.ts": "646dce2eccf1fab4",
9
- "rules/job-timeout.ts": "68f85c741c3d0ae8",
10
- "rules/validate-concurrency.ts": "c12a1aa4ee8badb5",
11
- "rules/file-job-limit.ts": "7c46a302f6ba2744",
12
- "rules/use-typed-actions.ts": "eeedcc6145b7a132",
13
- "rules/suggest-cache.ts": "c45f7659afde2f15",
14
- "rules/detect-secrets.ts": "999e6c5b4e048764",
15
- "rules/no-hardcoded-secrets.ts": "adcdb23f0480a4b7",
16
- "rules/use-matrix-builder.ts": "6b1c0ebf43378805",
17
- "rules/missing-recommended-inputs.ts": "42f2f3b0b6c7b52c",
18
- "rules/use-condition-builders.ts": "7406215df1f79fb8",
19
- "rules/no-raw-expressions.ts": "6359f4d3135ed351",
20
- "rules/gha017.ts": "ff1c08fdedf83afa",
21
- "rules/gha018.ts": "46acbe27d4c0c817",
22
- "rules/gha026.ts": "5ace32df6cb850af",
23
- "rules/gha019.ts": "d9184093f36ac167",
24
- "rules/gha023.ts": "2d00140d63591c9",
25
- "rules/gha027.ts": "6071aedb178c90a8",
26
- "rules/yaml-helpers.ts": "df426df288c175c9",
27
- "rules/gha024.ts": "88df51d8e5a01651",
28
- "rules/gha025.ts": "d196899f490521ba",
29
- "rules/gha006.ts": "baca27402ba18d",
30
- "rules/gha028.ts": "9c1ba1eb9a93d8b6",
31
- "rules/gha022.ts": "d1dfc25f1409a8bc",
32
- "rules/gha011.ts": "105e2d4faeaa9977",
33
- "rules/gha020.ts": "36ef5e141524bab0",
34
- "rules/gha009.ts": "df140c0cac573bc4",
35
- "rules/gha021.ts": "da7e2491926d1817",
36
- "skills/chant-github.md": "dc14037edaace2af",
37
- "skills/chant-github-patterns.md": "7678ef5c6b4b9bdf",
38
- "skills/chant-github-security.md": "f3fcfcd84475b73c"
4
+ "manifest.json": "756ca264dcfdb5e7ba812c7d88a6c08f9fea4df8d31bbfa4f4efb9374982de07",
5
+ "meta.json": "18d445d9df6b533016ab023bd606a2598034412003d2f110f1ce017738e1a76f",
6
+ "types/index.d.ts": "64e1dcb5c0e1995b576300ca1be3ec014f7d32600113858bf096861763e090ee",
7
+ "rules/deprecated-action-version.ts": "d41e6e532ab7f623af1bee4ac5279fcb2baada7defa1c5d022a5bc71983e8797",
8
+ "rules/detect-secrets.ts": "5829832eb7b43993424971041ed386b196850183bffd34bddd6439f99061e4ae",
9
+ "rules/extract-inline-structs.ts": "8f8147c200de8ffd0620dfdcca2e2cea76a520303ce431479ebecad6aa26aab5",
10
+ "rules/file-job-limit.ts": "80f494c9e2eedd70b1df0c672215968faad18be139a430197e452a72ad38a7d6",
11
+ "rules/job-timeout.ts": "312b249ee3fd9d3d0b11f95ab6567c586ec366af9dd4f19d43b280de892838ad",
12
+ "rules/missing-recommended-inputs.ts": "547faca227a7e43fa137e3d79fb77b79193a3a59c9455a152711b7d079c3b3df",
13
+ "rules/no-hardcoded-secrets.ts": "b9e73a7233d64d4037a48857faba43d14fa5f9c22e22d3525bb0917fa64db474",
14
+ "rules/no-raw-expressions.ts": "a266fceae6522a31df509210153d3f1f88dbba323f443e0f9263961884583179",
15
+ "rules/suggest-cache.ts": "cf8e59ea29031fc0c26229260708a00784691a51e67ac5d65521fb1c25481f9e",
16
+ "rules/use-condition-builders.ts": "75aa7dc377f14068676614d9bfa85646a04aeed14738a002ad19117efb915169",
17
+ "rules/use-matrix-builder.ts": "cbabb3e91222243627c558c2106ee91a34a59e41c003ee507e37da29926e2e55",
18
+ "rules/use-typed-actions.ts": "ad0775b64b268365d450eaa4c08e7ff17f02074392e04d7a746708bf214afd27",
19
+ "rules/validate-concurrency.ts": "848a6cedc6aeb7f0bc3715368436e40d96f8074e6c6987f1ea010f7e53ce9541",
20
+ "rules/gha006.ts": "7e2977d34851ce2ed9f91c4dd78ecda8d4de099ceaac1cd9ab74960a193133a3",
21
+ "rules/gha009.ts": "0f9a261e886309679494da32b72a0d9ea20017e5da75a9d59a04846a0e4d78db",
22
+ "rules/gha011.ts": "53b7ca79b5bf56e5793a9b7a44ae0ac766eb5acf0669005e7810cb7762bab79c",
23
+ "rules/gha017.ts": "ec62dac7f9d69f36978cb461c4ba391a7e445d410bbfa497cddcb1b12cfd5904",
24
+ "rules/gha018.ts": "2c71c5accb96bccfa01075e7f8f4ad66e6d9a68a81b86f89a68cabb9c144e140",
25
+ "rules/gha019.ts": "d0b33d63812c9cba2ebf9f2d85d8cf22068ea96460cd2143bdfb4d2a4d58fe2e",
26
+ "rules/gha020.ts": "72dc68a1eae98e0e4611dfe62eecda6900c22f286825bc3c5133f1f5e2e62d43",
27
+ "rules/gha021.ts": "01463240871326c2798abb3a3cdccba95b44efa1e0083e54a81824e8875dcc37",
28
+ "rules/gha022.ts": "7bfb5e280ace280f06b8b64645863210320cd38380a2fc7b95a3455753a50f9c",
29
+ "rules/gha023.ts": "708468e098e434739bd62573d8559318c08a2830aa8ac39d2bf465e7da012b38",
30
+ "rules/gha024.ts": "4500e91debb6e9ca23f247d6a8c3f0f7c74785ff852db130143590328353ab4d",
31
+ "rules/gha025.ts": "e2a8f0f67d07fd0f83a40d0fce443b8d0f1dd8f4cd3e3ed045937f3cc3305afc",
32
+ "rules/gha026.ts": "1c0278cb453dad28f417fd11fd30d83402a64ccb809f366a5b46ffceb3466da6",
33
+ "rules/gha027.ts": "5a266987c65dc92ca77c1d4c9b8fa29d6435275d399819dec5027be3f2d96239",
34
+ "rules/gha028.ts": "5d1f06b635354b67557f0dbdc2f11ca4c5b8e8541b85b1c135b6f02ef147d9a0",
35
+ "rules/yaml-helpers.ts": "4729afd9ff287dbef38b84298b130f5ab8822a351d9d37111a7ed4cb589ced58",
36
+ "skills/chant-github.md": "f3707f09634be4bbb45a6be279f17bb27f275b98e6d3337cc8872c1623ba050f",
37
+ "skills/chant-github-patterns.md": "bb3abef289a8fdfcf07d6bb2d7289dcb2f38bc0cb0321ea320b78b45a6f548c0",
38
+ "skills/chant-github-security.md": "aab111cb0871cad30281ce48d7da23663689619351029219e2be019a1a61e394"
39
39
  },
40
- "composite": "a1b4fdb253dcc4a0"
40
+ "composite": "3a9f002213bccc16afe61ffd7b492bd376a15c875b7d854e3bbb47898d06eaed"
41
41
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "github",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "GitHub",
6
6
  "intrinsics": [
@@ -13,19 +13,17 @@ export declare class Concurrency {
13
13
 
14
14
  export declare class Container {
15
15
  constructor(props: {
16
- /** The Docker image to use as the container to run the action. The value can be the Docker Hub image name or a registry name. */
16
+ /** Docker image */
17
17
  image: string;
18
- /** If the image's container registry requires authentication to pull the image, you can use credentials to set a map of the username and password. The credentials are the same values that you would provide to the `docker login` command. */
19
- credentials?: Record<string, unknown>;
20
- /** Sets an array of environment variables in the container. */
21
- env?: any;
22
- /** Additional Docker container resource options. For a list of options, see https://docs.docker.com/engine/reference/commandline/create/#options. */
18
+ /** Registry credentials */
19
+ credentials?: Record<string, string>;
20
+ /** Environment variables */
21
+ env?: Record<string, string>;
22
+ /** Docker options */
23
23
  options?: string;
24
- /** Sets an array of ports to expose on the container. */
25
- ports?: (number | string)[];
26
- /** Sets an array of volumes for the container to use. You can use volumes to share data between services or other steps in a job. You can specify named Docker volumes, anonymous Docker volumes, or bind mounts on the host.
27
- To specify a volume, you specify the source and destination path: <source>:<destinationPath>
28
- The <source> is a volume name or an absolute path on the host machine, and <destinationPath> is an absolute path in the container. */
24
+ /** Exposed ports */
25
+ ports?: number[];
26
+ /** Volume mounts */
29
27
  volumes?: string[];
30
28
  });
31
29
  }
@@ -183,19 +181,12 @@ export declare class ScheduleTrigger {
183
181
 
184
182
  export declare class Service {
185
183
  constructor(props: {
186
- /** The Docker image to use as the container to run the action. The value can be the Docker Hub image name or a registry name. */
184
+ /** Docker image */
187
185
  image: string;
188
- /** If the image's container registry requires authentication to pull the image, you can use credentials to set a map of the username and password. The credentials are the same values that you would provide to the `docker login` command. */
189
- credentials?: Record<string, unknown>;
190
- /** Sets an array of environment variables in the container. */
191
- env?: any;
192
- /** Additional Docker container resource options. For a list of options, see https://docs.docker.com/engine/reference/commandline/create/#options. */
186
+ credentials?: Record<string, string>;
187
+ env?: Record<string, string>;
193
188
  options?: string;
194
- /** Sets an array of ports to expose on the container. */
195
- ports?: (number | string)[];
196
- /** Sets an array of volumes for the container to use. You can use volumes to share data between services or other steps in a job. You can specify named Docker volumes, anonymous Docker volumes, or bind mounts on the host.
197
- To specify a volume, you specify the source and destination path: <source>:<destinationPath>
198
- The <source> is a volume name or an absolute path on the host machine, and <destinationPath> is an absolute path in the container. */
189
+ ports?: number[];
199
190
  volumes?: string[];
200
191
  });
201
192
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-github",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "GitHub Actions lexicon for chant — declarative IaC in TypeScript",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -36,14 +36,14 @@
36
36
  "./types": "./dist/types/index.d.ts"
37
37
  },
38
38
  "scripts": {
39
- "generate": "bun run src/codegen/generate-cli.ts",
40
- "bundle": "bun run src/package-cli.ts",
41
- "validate": "bun run src/validate-cli.ts",
42
- "docs": "bun run src/codegen/docs-cli.ts",
43
- "prepack": "bun run generate && bun run bundle && bun run validate"
39
+ "generate": "tsx src/codegen/generate-cli.ts",
40
+ "bundle": "tsx src/package-cli.ts",
41
+ "validate": "tsx src/validate-cli.ts",
42
+ "docs": "tsx src/codegen/docs-cli.ts",
43
+ "prepack": "npm run generate && npm run bundle && npm run validate"
44
44
  },
45
45
  "devDependencies": {
46
- "@intentius/chant": "0.1.4",
46
+ "@intentius/chant": "*",
47
47
  "typescript": "^5.9.3"
48
48
  },
49
49
  "peerDependencies": {
@@ -1,5 +1,5 @@
1
- import { describe, test, expect } from "bun:test";
2
- import { existsSync } from "fs";
1
+ import { describe, test, expect } from "vitest";
2
+ import { existsSync, readFileSync } from "fs";
3
3
  import { join, dirname } from "path";
4
4
  import { fileURLToPath } from "url";
5
5
 
@@ -13,7 +13,7 @@ describe("docs pipeline", () => {
13
13
  test("docs.ts exports generateDocs function", () => {
14
14
  // docs.ts has template literal parse issues in Bun due to ${{ }} expressions
15
15
  // in inline strings. Verify the file exists and contains the export.
16
- const content = Bun.file(join(thisDir, "docs.ts")).text();
17
- expect(content).resolves.toContain("export async function generateDocs");
16
+ const content = readFileSync(join(thisDir, "docs.ts"), "utf8");
17
+ expect(content).toContain("export async function generateDocs");
18
18
  });
19
19
  });
@@ -1001,10 +1001,10 @@ export default {
1001
1001
 
1002
1002
  \`\`\`bash
1003
1003
  cd examples/getting-started
1004
- bun install
1004
+ npm install
1005
1005
  chant build # produces .github/workflows/ci.yml
1006
1006
  chant lint # runs lint rules
1007
- bun test # runs the example's tests
1007
+ npx vitest run # run the tests
1008
1008
  \`\`\`
1009
1009
 
1010
1010
  ## Getting Started
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env bun
1
+ #!/usr/bin/env tsx
2
2
  /**
3
3
  * CLI entry point for GitHub Actions lexicon generation.
4
4
  */
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import { generate, writeGeneratedFiles } from "./generate";
3
3
 
4
4
  describe("generate pipeline", () => {
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import { packageLexicon } from "./package";
3
3
 
4
4
  describe("package pipeline", () => {
@@ -2,9 +2,8 @@
2
2
  * GitHub Actions lexicon packaging — delegates to core packagePipeline.
3
3
  */
4
4
 
5
- import { createRequire } from "module";
6
5
  import { readFileSync } from "fs";
7
- const require = createRequire(import.meta.url);
6
+ import { githubPlugin } from "../plugin";
8
7
  import { join, dirname } from "path";
9
8
  import { fileURLToPath } from "url";
10
9
  import type { IntrinsicDef } from "@intentius/chant/lexicon";
@@ -52,9 +51,7 @@ export async function packageLexicon(opts: PackageOptions = {}): Promise<Package
52
51
 
53
52
  srcDir: pkgDir,
54
53
 
55
- collectSkills: () => {
56
- const { githubPlugin } = require("../plugin");
57
- const skillDefs = githubPlugin.skills?.() ?? [];
54
+ collectSkills: () => { const skillDefs = githubPlugin.skills?.() ?? [];
58
55
  return collectSkills(skillDefs);
59
56
  },
60
57
 
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import { Checkout } from "./checkout";
3
3
  import { SetupNode } from "./setup-node";
4
4
  import { SetupGo } from "./setup-go";
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import {
3
3
  analyzeGitHubCoverage,
4
4
  computeCoverage,
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import {
3
3
  Expression,
4
4
  github, runner, secrets, matrix, steps, needs, inputs, vars, env,
@@ -13,19 +13,17 @@ export declare class Concurrency {
13
13
 
14
14
  export declare class Container {
15
15
  constructor(props: {
16
- /** The Docker image to use as the container to run the action. The value can be the Docker Hub image name or a registry name. */
16
+ /** Docker image */
17
17
  image: string;
18
- /** If the image's container registry requires authentication to pull the image, you can use credentials to set a map of the username and password. The credentials are the same values that you would provide to the `docker login` command. */
19
- credentials?: Record<string, unknown>;
20
- /** Sets an array of environment variables in the container. */
21
- env?: any;
22
- /** Additional Docker container resource options. For a list of options, see https://docs.docker.com/engine/reference/commandline/create/#options. */
18
+ /** Registry credentials */
19
+ credentials?: Record<string, string>;
20
+ /** Environment variables */
21
+ env?: Record<string, string>;
22
+ /** Docker options */
23
23
  options?: string;
24
- /** Sets an array of ports to expose on the container. */
25
- ports?: (number | string)[];
26
- /** Sets an array of volumes for the container to use. You can use volumes to share data between services or other steps in a job. You can specify named Docker volumes, anonymous Docker volumes, or bind mounts on the host.
27
- To specify a volume, you specify the source and destination path: <source>:<destinationPath>
28
- The <source> is a volume name or an absolute path on the host machine, and <destinationPath> is an absolute path in the container. */
24
+ /** Exposed ports */
25
+ ports?: number[];
26
+ /** Volume mounts */
29
27
  volumes?: string[];
30
28
  });
31
29
  }
@@ -183,19 +181,12 @@ export declare class ScheduleTrigger {
183
181
 
184
182
  export declare class Service {
185
183
  constructor(props: {
186
- /** The Docker image to use as the container to run the action. The value can be the Docker Hub image name or a registry name. */
184
+ /** Docker image */
187
185
  image: string;
188
- /** If the image's container registry requires authentication to pull the image, you can use credentials to set a map of the username and password. The credentials are the same values that you would provide to the `docker login` command. */
189
- credentials?: Record<string, unknown>;
190
- /** Sets an array of environment variables in the container. */
191
- env?: any;
192
- /** Additional Docker container resource options. For a list of options, see https://docs.docker.com/engine/reference/commandline/create/#options. */
186
+ credentials?: Record<string, string>;
187
+ env?: Record<string, string>;
193
188
  options?: string;
194
- /** Sets an array of ports to expose on the container. */
195
- ports?: (number | string)[];
196
- /** Sets an array of volumes for the container to use. You can use volumes to share data between services or other steps in a job. You can specify named Docker volumes, anonymous Docker volumes, or bind mounts on the host.
197
- To specify a volume, you specify the source and destination path: <source>:<destinationPath>
198
- The <source> is a volume name or an absolute path on the host machine, and <destinationPath> is an absolute path in the container. */
189
+ ports?: number[];
199
190
  volumes?: string[];
200
191
  });
201
192
  }
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import { GitHubActionsGenerator } from "./generator";
3
3
  import type { TemplateIR } from "@intentius/chant/import/parser";
4
4
 
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import { GitHubActionsParser } from "./parser";
3
3
 
4
4
  const parser = new GitHubActionsParser();
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import { GitHubActionsParser } from "./parser";
3
3
  import { GitHubActionsGenerator } from "./generator";
4
4
 
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
3
3
  import type { SerializerResult } from "@intentius/chant/serializer";
4
4
  import { gha006 } from "./gha006";
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
3
3
  import { gha009 } from "./gha009";
4
4
 
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
3
3
  import { gha011 } from "./gha011";
4
4
 
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
3
3
  import { gha017 } from "./gha017";
4
4
 
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
3
3
  import { gha018 } from "./gha018";
4
4
 
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
3
3
  import { gha019 } from "./gha019";
4
4
 
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
3
3
  import { gha020 } from "./gha020";
4
4
 
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
3
3
  import { gha021 } from "./gha021";
4
4
 
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
3
3
  import { gha022 } from "./gha022";
4
4
 
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
3
3
  import { gha023 } from "./gha023";
4
4
 
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
3
3
  import { gha024 } from "./gha024";
4
4
 
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
3
3
  import { gha025 } from "./gha025";
4
4
 
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
3
3
  import { gha026 } from "./gha026";
4
4
 
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
3
3
  import { gha027 } from "./gha027";
4
4
 
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
3
3
  import { gha028 } from "./gha028";
4
4
 
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
3
3
  import { gha006 } from "./gha006";
4
4
  import { gha009 } from "./gha009";
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import * as ts from "typescript";
3
3
  import type { LintContext } from "@intentius/chant/lint/rule";
4
4
  import { deprecatedActionVersionRule } from "./deprecated-action-version";
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import * as ts from "typescript";
3
3
  import type { LintContext } from "@intentius/chant/lint/rule";
4
4
  import { detectSecretsRule } from "./detect-secrets";
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import * as ts from "typescript";
3
3
  import type { LintContext } from "@intentius/chant/lint/rule";
4
4
  import { extractInlineStructsRule } from "./extract-inline-structs";
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import * as ts from "typescript";
3
3
  import type { LintContext } from "@intentius/chant/lint/rule";
4
4
  import { fileJobLimitRule } from "./file-job-limit";
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import * as ts from "typescript";
3
3
  import type { LintContext } from "@intentius/chant/lint/rule";
4
4
  import { jobTimeoutRule } from "./job-timeout";
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import * as ts from "typescript";
3
3
  import type { LintContext } from "@intentius/chant/lint/rule";
4
4
  import { missingRecommendedInputsRule } from "./missing-recommended-inputs";
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import * as ts from "typescript";
3
3
  import type { LintContext } from "@intentius/chant/lint/rule";
4
4
  import { noHardcodedSecretsRule } from "./no-hardcoded-secrets";
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import * as ts from "typescript";
3
3
  import type { LintContext } from "@intentius/chant/lint/rule";
4
4
  import { noRawExpressionsRule } from "./no-raw-expressions";
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import * as ts from "typescript";
3
3
  import type { LintContext } from "@intentius/chant/lint/rule";
4
4
  import { useTypedActionsRule } from "./use-typed-actions";
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import * as ts from "typescript";
3
3
  import type { LintContext } from "@intentius/chant/lint/rule";
4
4
  import { suggestCacheRule } from "./suggest-cache";
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import * as ts from "typescript";
3
3
  import type { LintContext } from "@intentius/chant/lint/rule";
4
4
  import { useConditionBuildersRule } from "./use-condition-builders";
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import * as ts from "typescript";
3
3
  import type { LintContext } from "@intentius/chant/lint/rule";
4
4
  import { useMatrixBuilderRule } from "./use-matrix-builder";
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import * as ts from "typescript";
3
3
  import type { LintContext } from "@intentius/chant/lint/rule";
4
4
  import { useTypedActionsRule } from "./use-typed-actions";
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import * as ts from "typescript";
3
3
  import type { LintContext } from "@intentius/chant/lint/rule";
4
4
  import { validateConcurrencyRule } from "./validate-concurrency";
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
 
3
3
  describe("github completions", () => {
4
4
  test("completions module exports githubCompletions", async () => {
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
 
3
3
  describe("github hover", () => {
4
4
  test("hover module exports githubHover", async () => {
@@ -1,6 +1,6 @@
1
- #!/usr/bin/env bun
1
+ #!/usr/bin/env tsx
2
2
  /**
3
- * Thin entry point for `bun run bundle` in lexicon-github.
3
+ * Thin entry point for `npm run bundle` in lexicon-github.
4
4
  */
5
5
  import { generate, writeGeneratedFiles } from "./codegen/generate";
6
6
  import { packageLexicon } from "./codegen/package";
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import { githubPlugin } from "./plugin";
3
3
 
4
4
  describe("githubPlugin", () => {
@@ -80,13 +80,13 @@ describe("githubPlugin", () => {
80
80
  test("provides MCP tools", () => {
81
81
  const tools = githubPlugin.mcpTools!();
82
82
  expect(tools.length).toBe(1);
83
- expect(tools[0].name).toBe("diff");
83
+ expect(tools[0].name).toBe("github:diff");
84
84
  });
85
85
 
86
86
  test("provides MCP resources", () => {
87
87
  const resources = githubPlugin.mcpResources!();
88
88
  expect(resources.length).toBe(2);
89
- expect(resources[0].uri).toBe("resource-catalog");
89
+ expect(resources[0].uri).toBe("github:resource-catalog");
90
90
  expect(resources[1].uri).toBe("examples/basic-ci");
91
91
  });
92
92
 
package/src/plugin.ts CHANGED
@@ -5,34 +5,36 @@
5
5
  * for GitHub Actions workflows.
6
6
  */
7
7
 
8
- import { createRequire } from "module";
9
8
  import type { LexiconPlugin, IntrinsicDef, InitTemplateSet } from "@intentius/chant/lexicon";
10
- const require = createRequire(import.meta.url);
11
9
  import type { LintRule } from "@intentius/chant/lint/rule";
12
10
  import { discoverPostSynthChecks } from "@intentius/chant/lint/discover";
13
11
  import { createSkillsLoader, createDiffTool, createCatalogResource } from "@intentius/chant/lexicon-plugin-helpers";
14
12
  import { join, dirname } from "path";
15
13
  import { fileURLToPath } from "url";
16
14
  import { githubSerializer } from "./serializer";
15
+ import { useTypedActionsRule } from "./lint/rules/use-typed-actions";
16
+ import { useConditionBuildersRule } from "./lint/rules/use-condition-builders";
17
+ import { noHardcodedSecretsRule } from "./lint/rules/no-hardcoded-secrets";
18
+ import { useMatrixBuilderRule } from "./lint/rules/use-matrix-builder";
19
+ import { extractInlineStructsRule } from "./lint/rules/extract-inline-structs";
20
+ import { fileJobLimitRule } from "./lint/rules/file-job-limit";
21
+ import { noRawExpressionsRule } from "./lint/rules/no-raw-expressions";
22
+ import { missingRecommendedInputsRule } from "./lint/rules/missing-recommended-inputs";
23
+ import { deprecatedActionVersionRule } from "./lint/rules/deprecated-action-version";
24
+ import { jobTimeoutRule } from "./lint/rules/job-timeout";
25
+ import { suggestCacheRule } from "./lint/rules/suggest-cache";
26
+ import { validateConcurrencyRule } from "./lint/rules/validate-concurrency";
27
+ import { detectSecretsRule } from "./lint/rules/detect-secrets";
28
+ import { githubCompletions } from "./lsp/completions";
29
+ import { githubHover } from "./lsp/hover";
30
+ import { GitHubActionsParser } from "./import/parser";
31
+ import { GitHubActionsGenerator } from "./import/generator";
17
32
 
18
33
  export const githubPlugin: LexiconPlugin = {
19
34
  name: "github",
20
35
  serializer: githubSerializer,
21
36
 
22
37
  lintRules(): LintRule[] {
23
- const { useTypedActionsRule } = require("./lint/rules/use-typed-actions");
24
- const { useConditionBuildersRule } = require("./lint/rules/use-condition-builders");
25
- const { noHardcodedSecretsRule } = require("./lint/rules/no-hardcoded-secrets");
26
- const { useMatrixBuilderRule } = require("./lint/rules/use-matrix-builder");
27
- const { extractInlineStructsRule } = require("./lint/rules/extract-inline-structs");
28
- const { fileJobLimitRule } = require("./lint/rules/file-job-limit");
29
- const { noRawExpressionsRule } = require("./lint/rules/no-raw-expressions");
30
- const { missingRecommendedInputsRule } = require("./lint/rules/missing-recommended-inputs");
31
- const { deprecatedActionVersionRule } = require("./lint/rules/deprecated-action-version");
32
- const { jobTimeoutRule } = require("./lint/rules/job-timeout");
33
- const { suggestCacheRule } = require("./lint/rules/suggest-cache");
34
- const { validateConcurrencyRule } = require("./lint/rules/validate-concurrency");
35
- const { detectSecretsRule } = require("./lint/rules/detect-secrets");
36
38
  return [
37
39
  useTypedActionsRule,
38
40
  useConditionBuildersRule,
@@ -159,22 +161,18 @@ export const build = new Job({
159
161
  },
160
162
 
161
163
  completionProvider(ctx: import("@intentius/chant/lsp/types").CompletionContext) {
162
- const { githubCompletions } = require("./lsp/completions");
163
164
  return githubCompletions(ctx);
164
165
  },
165
166
 
166
167
  hoverProvider(ctx: import("@intentius/chant/lsp/types").HoverContext) {
167
- const { githubHover } = require("./lsp/hover");
168
168
  return githubHover(ctx);
169
169
  },
170
170
 
171
171
  templateParser() {
172
- const { GitHubActionsParser } = require("./import/parser");
173
172
  return new GitHubActionsParser();
174
173
  },
175
174
 
176
175
  templateGenerator() {
177
- const { GitHubActionsGenerator } = require("./import/generator");
178
176
  return new GitHubActionsGenerator();
179
177
  },
180
178
 
@@ -226,12 +224,12 @@ export const build = new Job({
226
224
  },
227
225
 
228
226
  mcpTools() {
229
- return [createDiffTool(githubSerializer, "Compare current build output against previous output for GitHub Actions")];
227
+ return [createDiffTool(githubSerializer, "Compare current build output against previous output for GitHub Actions", "github")];
230
228
  },
231
229
 
232
230
  mcpResources() {
233
231
  return [
234
- createCatalogResource(import.meta.url, "GitHub Actions Entity Catalog", "JSON list of all supported GitHub Actions entity types", "lexicon-github.json"),
232
+ createCatalogResource(import.meta.url, "GitHub Actions Entity Catalog", "JSON list of all supported GitHub Actions entity types", "lexicon-github.json", "github"),
235
233
  {
236
234
  uri: "examples/basic-ci",
237
235
  name: "Basic CI Example",
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import { githubSerializer } from "./serializer";
3
3
  import { DECLARABLE_MARKER, type Declarable } from "@intentius/chant/declarable";
4
4
  import { INTRINSIC_MARKER } from "@intentius/chant/intrinsic";
@@ -1,6 +1,6 @@
1
- #!/usr/bin/env bun
1
+ #!/usr/bin/env tsx
2
2
  /**
3
- * Thin entry point for `bun run validate` in lexicon-github.
3
+ * Thin entry point for `npm run validate` in lexicon-github.
4
4
  */
5
5
  import { validate } from "./validate";
6
6
 
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import { validate } from "./validate";
3
3
 
4
4
  describe("validate", () => {
@@ -8,5 +8,5 @@ describe("validate", () => {
8
8
 
9
9
  // Note: Full validation requires generated artifacts to exist.
10
10
  // This test verifies the validate module loads correctly.
11
- // Run `bun run generate` first for full validation tests.
11
+ // Run `npm run generate` first for full validation tests.
12
12
  });
@@ -1,4 +1,4 @@
1
- import { describe, test, expect } from "bun:test";
1
+ import { describe, test, expect } from "vitest";
2
2
  import { GitHub, Runner } from "./variables";
3
3
 
4
4
  describe("GitHub context variables", () => {