@intentius/chant-lexicon-gitlab 0.0.3 → 0.0.6

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/README.md CHANGED
@@ -1,58 +1,21 @@
1
1
  # @intentius/chant-lexicon-gitlab
2
2
 
3
- > Part of the [chant](../../README.md) monorepo. Published as [`@intentius/chant-lexicon-gitlab`](https://www.npmjs.com/package/@intentius/chant-lexicon-gitlab) on npm.
3
+ GitLab CI lexicon for [chant](https://intentius.io/chant/) declare CI/CD pipelines as typed TypeScript that serializes to `.gitlab-ci.yml`.
4
4
 
5
- GitLab CI lexicon for chant declare CI/CD pipelines as flat, typed TypeScript that serializes to `.gitlab-ci.yml`.
5
+ This package provides typed constructors for all GitLab CI keywords (Jobs, Workflows, Defaults, and property types like Artifacts, Cache, Image, Rule, Environment, and Trigger), the `CI` pseudo-parameter object for predefined variables, the `reference()` intrinsic for YAML `!reference` tags, and GitLab-specific lint rules. It also includes LSP and MCP server support for editor completions and hover.
6
6
 
7
- ## Overview
8
-
9
- This package provides:
10
-
11
- - **GitLab CI serializer** — converts chant declarables to GitLab CI YAML
12
- - **Resource types** — typed constructors for `Job`, `Default`, `Workflow`, and all GitLab CI keywords
13
- - **Property types** — `Artifacts`, `Cache`, `Image`, `Rule`, `Retry`, `Environment`, `Trigger`, and more
14
- - **Lint rules** — GitLab-specific validation (e.g. missing script, deprecated only/except)
15
- - **Code generation** — generates TypeScript types from the GitLab CI JSON schema
16
- - **LSP/MCP support** — completions and hover for GitLab CI keywords
17
-
18
- ## Usage
19
-
20
- ```typescript
21
- import { Job, Artifacts, Image } from "@intentius/chant-lexicon-gitlab";
22
-
23
- export const testJob = new Job({
24
- stage: "test",
25
- image: new Image({ name: "node:20" }),
26
- script: ["npm ci", "npm test"],
27
- artifacts: new Artifacts({
28
- paths: ["coverage/"],
29
- expireIn: "1 week",
30
- }),
31
- });
7
+ ```bash
8
+ npm install --save-dev @intentius/chant @intentius/chant-lexicon-gitlab
32
9
  ```
33
10
 
34
- ## Lint Rules
35
-
36
- | Rule | Description |
37
- |------|-------------|
38
- | `missing-script` | Job must have a `script` keyword |
39
- | `missing-stage` | Job should declare a `stage` |
40
- | `deprecated-only-except` | Flags use of deprecated `only`/`except` keywords |
41
- | `artifact-no-expiry` | Artifacts should have `expire_in` set |
42
-
43
- ## Code Generation
44
-
45
- The GitLab lexicon generates types from the [GitLab CI JSON schema](https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json):
46
-
47
- - `codegen/generate.ts` — calls core `generatePipeline<GitLabParseResult>` with GitLab callbacks
48
- - `codegen/naming.ts` — extends core `NamingStrategy` for GitLab CI keywords
49
- - `codegen/package.ts` — calls core `packagePipeline` with GitLab manifest
50
- - `codegen/parse.ts` — parses the GitLab CI JSON schema into typed entities
11
+ **[Documentation →](https://intentius.io/chant/lexicons/gitlab/)**
51
12
 
52
13
  ## Related Packages
53
14
 
54
- - `@intentius/chant` core functionality, type system, and CLI
55
- - `@intentius/chant-lexicon-aws` — AWS CloudFormation lexicon
15
+ | Package | Role |
16
+ |---------|------|
17
+ | [@intentius/chant](https://www.npmjs.com/package/@intentius/chant) | Core type system, CLI, build pipeline |
18
+ | [@intentius/chant-lexicon-aws](https://www.npmjs.com/package/@intentius/chant-lexicon-aws) | AWS CloudFormation lexicon |
56
19
 
57
20
  ## License
58
21
 
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "algorithm": "xxhash64",
3
3
  "artifacts": {
4
- "manifest.json": "ebbf7a6ac4cb48ce",
5
- "meta.json": "3a60a5c15437a93b",
6
- "types/index.d.ts": "2ab52d25cd1a5a14",
4
+ "manifest.json": "c72b64b58dec21e0",
5
+ "meta.json": "9ee0d2f2d1679f09",
6
+ "types/index.d.ts": "4e56a7de40d655c0",
7
7
  "rules/missing-stage.ts": "6d5379e74209a735",
8
8
  "rules/missing-script.ts": "923dde9acb46cc28",
9
9
  "rules/deprecated-only-except.ts": "1f5a8c785777fb03",
10
10
  "rules/artifact-no-expiry.ts": "26874cb6adfbca26",
11
11
  "rules/wgl011.ts": "b6b97e5104d91267",
12
- "rules/wgl010.ts": "1548cad287cdf286",
13
12
  "rules/yaml-helpers.ts": "a66cc193b4ef4f0a",
13
+ "rules/wgl010.ts": "1548cad287cdf286",
14
14
  "skills/gitlab-ci.md": "f860e40c2643c327"
15
15
  },
16
- "composite": "93408e2ccfc0086a"
16
+ "composite": "95b9f28f579d5862"
17
17
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitlab",
3
- "version": "0.0.3",
3
+ "version": "0.0.6",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "GitLab",
6
6
  "intrinsics": [
package/dist/meta.json CHANGED
@@ -64,6 +64,11 @@
64
64
  "kind": "property",
65
65
  "lexicon": "gitlab"
66
66
  },
67
+ "Service": {
68
+ "resourceType": "GitLab::CI::Service",
69
+ "kind": "property",
70
+ "lexicon": "gitlab"
71
+ },
67
72
  "Trigger": {
68
73
  "resourceType": "GitLab::CI::Trigger",
69
74
  "kind": "property",
@@ -203,6 +203,19 @@ export declare class Rule {
203
203
  });
204
204
  }
205
205
 
206
+ export declare class Service {
207
+ constructor(props: {
208
+ /** Full name of the image that should be used. It should contain the Registry part if needed. */
209
+ name: string;
210
+ alias?: string;
211
+ command?: string[];
212
+ docker?: Record<string, unknown>;
213
+ entrypoint?: string[];
214
+ pull_policy?: "always" | "never" | "if-not-present" | "always" | "never" | "if-not-present"[];
215
+ variables?: Record<string, unknown>;
216
+ });
217
+ }
218
+
206
219
  export declare class Trigger {
207
220
  constructor(props: {
208
221
  /** Path to the project, e.g. `group/project`, or `group/sub-group/project`. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-gitlab",
3
- "version": "0.0.3",
3
+ "version": "0.0.6",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "files": ["src/", "dist/"],
@@ -21,7 +21,7 @@
21
21
  "prepack": "bun run bundle && bun run validate"
22
22
  },
23
23
  "dependencies": {
24
- "@intentius/chant": "0.0.1"
24
+ "@intentius/chant": "0.0.5"
25
25
  },
26
26
  "devDependencies": {
27
27
  "typescript": "^5.9.3"