@intentius/chant-lexicon-forgejo 0.124.18 → 0.124.19
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/dist/integrity.json +2 -2
- package/dist/manifest.json +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/graph-edges.test.ts +33 -0
- package/src/plugin.ts +4 -0
package/dist/integrity.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"algorithm": "sha256",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"manifest.json": "
|
|
4
|
+
"manifest.json": "04864ef6ca4abd4f961382237f6307af454cb9ceece5200e8aba35c19f620d9f",
|
|
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": "f28d7fb69fb1cfd992496ef41fda0ea5ccd54a29b84ea1c501a44f6a3992c4d5"
|
|
11
11
|
},
|
|
12
|
-
"composite": "
|
|
12
|
+
"composite": "4e5a0ca8d47845cdbbf5929ba95e187bbde2d31267d656cb0af1228428bb82bf"
|
|
13
13
|
}
|
package/dist/manifest.json
CHANGED
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAoC,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAoC,MAAM,0BAA0B,CAAC;AAqBhG,eAAO,MAAM,aAAa,EAAE,aAsM3B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/chant-lexicon-forgejo",
|
|
3
|
-
"version": "0.124.
|
|
3
|
+
"version": "0.124.19",
|
|
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.124.
|
|
58
|
-
"@intentius/chant-lexicon-github": "^0.124.
|
|
57
|
+
"@intentius/chant": "^0.124.19",
|
|
58
|
+
"@intentius/chant-lexicon-github": "^0.124.19"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"generate": "tsx src/codegen/generate-cli.ts",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { DECLARABLE_MARKER, type Declarable } from "@intentius/chant/declarable";
|
|
3
|
+
import { forgejoPlugin } from "./plugin";
|
|
4
|
+
|
|
5
|
+
function entity(entityType: string, props: Record<string, unknown>): Declarable {
|
|
6
|
+
return { [DECLARABLE_MARKER]: true, lexicon: "github", entityType, kind: "resource", props } as unknown as Declarable;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// Forgejo workflows are github entities, so the github lexicon resolves their
|
|
10
|
+
// edges (#3910). This checks the forgejo plugin hands them over, every kind
|
|
11
|
+
// and the dangling case included; github's own tests cover each rule.
|
|
12
|
+
describe("forgejo graphEdges (#3910)", () => {
|
|
13
|
+
it("reports needs, calls, triggers and dangling references for a forgejo project", () => {
|
|
14
|
+
const build = entity("GitHub::Actions::Job", {});
|
|
15
|
+
const test = entity("GitHub::Actions::Job", { needs: ["build", "lint"] });
|
|
16
|
+
const call = entity("GitHub::Actions::Job", { uses: "./.forgejo/workflows/shared.yml" });
|
|
17
|
+
const entities = new Map<string, Declarable>([
|
|
18
|
+
["ci", entity("GitHub::Actions::Workflow", { name: "CI", jobs: { build, test, call } })],
|
|
19
|
+
["shared", entity("GitHub::Actions::Workflow", { name: "Shared", on: { workflow_run: { workflows: ["CI"] } }, jobs: { s: entity("GitHub::Actions::Job", {}) } })],
|
|
20
|
+
["build", build],
|
|
21
|
+
["test", test],
|
|
22
|
+
["call", call],
|
|
23
|
+
]);
|
|
24
|
+
const report = forgejoPlugin.graphEdges!(entities)!;
|
|
25
|
+
expect(report.references).toEqual([
|
|
26
|
+
{ from: "test", to: "build", kind: "needs", viaAttr: "needs" },
|
|
27
|
+
{ from: "test", to: "lint", kind: "needs", viaAttr: "needs", dangling: true },
|
|
28
|
+
{ from: "call", to: "shared", kind: "calls", viaAttr: "uses", crossPipeline: true },
|
|
29
|
+
{ from: "shared", to: "ci", kind: "triggers", viaAttr: "workflow_run", crossPipeline: true },
|
|
30
|
+
]);
|
|
31
|
+
expect(report.pipelines).toEqual({ ci: ["ci", "build", "test", "call"], shared: ["shared"] });
|
|
32
|
+
});
|
|
33
|
+
});
|
package/src/plugin.ts
CHANGED
|
@@ -24,6 +24,7 @@ import { forgejoLintRules } from "./lint/rules/delegate-to-github";
|
|
|
24
24
|
import { forgejoCompletions } from "./lsp/completions";
|
|
25
25
|
import { forgejoHover } from "./lsp/hover";
|
|
26
26
|
import { forgejoConfigSchema } from "./config";
|
|
27
|
+
import { githubGraphEdges } from "@intentius/chant-lexicon-github";
|
|
27
28
|
|
|
28
29
|
const reuseNote =
|
|
29
30
|
"forgejo reuses the github lexicon's entities — run `chant generate` in the github lexicon instead.";
|
|
@@ -33,6 +34,9 @@ export const forgejoPlugin: LexiconPlugin = {
|
|
|
33
34
|
configSchema: forgejoConfigSchema,
|
|
34
35
|
auditCatalog: () => forgejoAuditCatalog,
|
|
35
36
|
serializer: forgejoSerializer,
|
|
37
|
+
// Forgejo workflows are github entities, so github resolves their `needs`,
|
|
38
|
+
// `uses:` and `workflow_run` edges (#3910); `.forgejo/workflows/` paths too.
|
|
39
|
+
graphEdges: (entities) => githubGraphEdges(entities),
|
|
36
40
|
|
|
37
41
|
// Generate mode (#969): component graph → Forgejo Actions workflow. Reuses
|
|
38
42
|
// github's pipeline structure and applies the Forgejo dialect (runner labels,
|