@intentius/chant-lexicon-forgejo 0.44.13 → 0.45.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.
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/codegen/docs.ts"],"names":[],"mappings":"AA4JA;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA2BjF"}
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/codegen/docs.ts"],"names":[],"mappings":"AA0EA;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBjF"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "442315688032da239edaa393ac16144e8a2004f1a79453b5aaf99086e415908f",
4
+ "manifest.json": "555aa3b0e474678770fea6386d4701aad58712db4ae1d7a74ca17c6ed330143e",
5
5
  "meta.json": "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
6
6
  "types/index.d.ts": "66204549b2a864ab5489e3f02c1878e73ab4b3c9d938cfb480b66f71543a43de",
7
7
  "rules/delegate-to-github.ts": "1060cda40f4b73d6cca3ba3fa13b80b4886147d4034c88584c2d80c5510dbe5e",
@@ -9,5 +9,5 @@
9
9
  "rules/wfj011.ts": "fcb8bf6685d744af20ad804ce929488257995c74b9a3353b2eacae3768d1c83e",
10
10
  "skills/chant-forgejo.md": "a1a560429db736c187e0b34cf8dd9efc6ad771afefcbf6f802d160d3d5274257"
11
11
  },
12
- "composite": "efdbb5cfcaaa8d5d3500551675b56cdb2094a53cea2d0024ece39b6b3044283f"
12
+ "composite": "6940d2fecdab00121da700e1170a5df5a74184c0a2d8122b0ccb0d31c9516f3f"
13
13
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forgejo",
3
- "version": "0.44.13",
3
+ "version": "0.45.0",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "Forgejo",
6
6
  "intrinsics": [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-forgejo",
3
- "version": "0.44.13",
3
+ "version": "0.45.0",
4
4
  "description": "Forgejo / Codeberg / Gitea Actions lexicon for chant — a thin GitHub Actions dialect",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -54,8 +54,8 @@
54
54
  },
55
55
  "peerDependencies": {
56
56
  "zod": "^4.3.6",
57
- "@intentius/chant": "^0.44.13",
58
- "@intentius/chant-lexicon-github": "^0.44.13"
57
+ "@intentius/chant": "^0.45.0",
58
+ "@intentius/chant-lexicon-github": "^0.45.0"
59
59
  },
60
60
  "scripts": {
61
61
  "generate": "tsx src/codegen/generate-cli.ts",
@@ -1,87 +1,5 @@
1
1
  import { docsPipeline, writeDocsSite } from "@intentius/chant/codegen/docs";
2
2
 
3
- const DIALECT_CONTENT = `Forgejo (the forge behind Codeberg, self-hosted Forgejo, and Gitea) runs
4
- GitHub-Actions-compatible workflows. You author exactly as you would for
5
- GitHub Actions — same \`Workflow\`, \`Job\`, \`Step\`, and composites, imported
6
- from \`@intentius/chant-lexicon-forgejo\` instead of the github package:
7
-
8
- \`\`\`ts
9
- import { Workflow, Job, Step, Checkout, SetupNode } from "@intentius/chant-lexicon-forgejo";
10
-
11
- export const workflow = new Workflow({
12
- name: "CI",
13
- on: { push: { branches: ["main"] } },
14
- });
15
-
16
- export const build = new Job({
17
- "runs-on": "ubuntu-latest",
18
- steps: [
19
- Checkout({}).step,
20
- SetupNode({ nodeVersion: "22", cache: "npm" }).step,
21
- new Step({ name: "Test", run: "npm test" }),
22
- ],
23
- });
24
- \`\`\`
25
-
26
- On build, the dialect:
27
-
28
- - **Drops keys Forgejo ignores** — \`permissions\` and \`continue-on-error\` are
29
- silently ignored by the Forgejo runner, so they are removed from the output
30
- and reported as build warnings (emitting them is misleading).
31
- - **Maps runner labels** — GitHub-hosted labels like \`ubuntu-latest\` have no
32
- fixed meaning on Forgejo. They are mapped to a default Forgejo label
33
- (\`docker\`), overridable per project. Unmapped labels pass through with a
34
- warning.
35
- - **Resolves \`uses:\` action refs** — Forgejo has no GitHub Marketplace, so a
36
- bare \`uses: actions/checkout@v4\` is rewritten to a resolvable form. Common
37
- \`actions/*\` are mapped under an actions root (\`https://code.forgejo.org\` by
38
- default, overridable via \`forgejo.actionsRoot\`); \`docker/*\` are pinned to
39
- their full GitHub URL. Local (\`./...\`), \`docker://\`, and full-URL refs pass
40
- through untouched. Anything else passes through **and is reported** as a
41
- warning so it's never silently unresolvable.
42
-
43
- Everything else is emitted by the github serializer, which already produces
44
- the exact YAML shape Forgejo executes.
45
-
46
- ## Lint rules and editor support
47
-
48
- Forgejo has no lint rules or LSP completions/hover of its own — a forgejo
49
- workflow is TypeScript indistinguishable in shape from an equivalent github
50
- one, so \`chant lint\` and editor tooling run github's checks and catalog
51
- against forgejo source unmodified (\`completionProvider()\` and
52
- \`hoverProvider()\` forward straight to \`githubPlugin\`'s). Lint rules are
53
- wrapped rather than re-exported verbatim — each GHA0xx rule appears under a
54
- \`WFJ-\` prefix (e.g. \`WFJ-GHA001\`) with its check logic untouched, so a
55
- project (or \`chant audit\`) can load the github and forgejo plugins together
56
- without an id collision. See the
57
- [github lexicon's Lint Rules page](/chant/lexicons/github/lint-rules/) for
58
- the full GHA0xx catalog.
59
-
60
- ## Migrating from GitHub Actions
61
-
62
- Because github → forgejo YAML is near-identical, the migration is thin — it
63
- applies the same dialect as a build. Its real value is the **compare**: what
64
- the move costs.
65
-
66
- \`\`\`sh
67
- chant migrate .github/workflows/ci.yml --to forgejo -o .forgejo/workflows/ci.yml --validate
68
- \`\`\`
69
-
70
- \`--validate\` prints a **security posture** report classifying each property's
71
- fate across the edge:
72
-
73
- | Fate | Meaning |
74
- |---|---|
75
- | \`translated\` | carried across as-is |
76
- | \`approximated\` | carried with a close equivalent |
77
- | \`needs-review\` | confirm/adjust on Forgejo (unresolved \`uses:\`, unmapped runner label) |
78
- | \`lost\` | the Forgejo runner ignores it (\`permissions\`, \`continue-on-error\`) |
79
-
80
- The same view is available to agents as the \`forgejo:compare\` MCP tool, which
81
- takes a workflow file and returns per-property fates plus summary counts —
82
- read-only.
83
- `;
84
-
85
3
  const OVERVIEW_CONTENT = `\`@intentius/chant-lexicon-forgejo\` targets **Forgejo Actions** — the CI behind
86
4
  [Codeberg](https://codeberg.org), self-hosted [Forgejo](https://forgejo.org),
87
5
  and [Gitea](https://about.gitea.com). Forgejo runs **GitHub-Actions-compatible**
@@ -168,14 +86,6 @@ export async function generateDocs(options?: { verbose?: boolean }): Promise<voi
168
86
  overview: OVERVIEW_CONTENT,
169
87
  outputFormat:
170
88
  "The Forgejo lexicon serializes entities into the same YAML shape as GitHub Actions, then applies the Forgejo dialect (see [The Forgejo Dialect](/chant/lexicons/forgejo/dialect/)) before writing to `.forgejo/workflows/*.yml` (or `.gitea/workflows/*.yml` for Gitea).",
171
- extraPages: [
172
- {
173
- slug: "dialect",
174
- title: "The Forgejo Dialect",
175
- description: "What changes when a GitHub Actions workflow serializes to Forgejo, and how migration works",
176
- content: DIALECT_CONTENT,
177
- },
178
- ],
179
89
  };
180
90
 
181
91
  const result = docsPipeline(config);
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import { describe, test, expect, beforeAll, afterAll } from "vitest";
7
- import { mkdtempSync, mkdirSync, writeFileSync, rmSync } from "node:fs";
7
+ import { mkdtempSync, mkdirSync, writeFileSync, rmSync, symlinkSync } from "node:fs";
8
8
  import { join } from "node:path";
9
9
  import { tmpdir } from "node:os";
10
10
  import { forgejoContextTools } from "./context-tools";
@@ -39,6 +39,12 @@ const tool = (name: string) => tools.find((t) => t.name === name)!;
39
39
  beforeAll(() => {
40
40
  dir = mkdtempSync(join(tmpdir(), "fj-ctx-"));
41
41
  mkdirSync(join(dir, "src"));
42
+ // The fixture imports `@intentius/chant-lexicon-forgejo` by bare specifier
43
+ // from outside the repo. Vitest 3's vite-node silently resolved that
44
+ // against the repo root; Vitest 4's module runner resolves from the
45
+ // importing file, the way Node does, so give the temp project a
46
+ // node_modules the same way a consumer project would have one.
47
+ symlinkSync(join(__dirname, "..", "..", "..", "..", "node_modules"), join(dir, "node_modules"), "dir");
42
48
  writeFileSync(join(dir, "src", "pipeline.ts"), SOURCE);
43
49
  });
44
50