@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.
@@ -28,20 +28,7 @@ npm install --save-dev @intentius/chant-lexicon-gitlab
28
28
 
29
29
  ## Quick Start
30
30
 
31
- \`\`\`typescript
32
- import { Job, Image, Cache, Artifacts, CI } from "@intentius/chant-lexicon-gitlab";
33
-
34
- export const test = new Job({
35
- stage: "test",
36
- image: new Image({ name: "node:20" }),
37
- cache: new Cache({ key: CI.CommitRef, paths: ["node_modules/"] }),
38
- script: ["npm ci", "npm test"],
39
- artifacts: new Artifacts({
40
- paths: ["coverage/"],
41
- expireIn: "1 week",
42
- }),
43
- });
44
- \`\`\`
31
+ {{file:docs-snippets/src/quickstart.ts}}
45
32
 
46
33
  The lexicon provides **3 resources** (Job, Workflow, Default), **13 property types** (Image, Cache, Artifacts, Rule, Environment, Trigger, and more), the \`CI\` pseudo-parameter object for predefined variables, and the \`reference()\` intrinsic for YAML \`!reference\` tags.
47
34
  `;
@@ -113,6 +100,7 @@ export async function generateDocs(opts?: { verbose?: boolean }): Promise<void>
113
100
  outputFormat,
114
101
  serviceFromType,
115
102
  suppressPages: ["intrinsics", "rules"],
103
+ examplesDir: join(pkgDir, "examples"),
116
104
  extraPages: [
117
105
  {
118
106
  slug: "pipeline-concepts",
@@ -125,14 +113,7 @@ export async function generateDocs(opts?: { verbose?: boolean }): Promise<void>
125
113
  - Collects stages from all jobs into a \`stages:\` list
126
114
  - Collapses single-property objects (\`new Image({ name: "node:20" })\` → \`image: node:20\`)
127
115
 
128
- \`\`\`typescript
129
- // This chant declaration...
130
- export const buildApp = new Job({
131
- stage: "build",
132
- image: new Image({ name: "node:20" }),
133
- script: ["npm ci", "npm run build"],
134
- });
135
- \`\`\`
116
+ {{file:docs-snippets/src/job-basic.ts}}
136
117
 
137
118
  Produces this YAML:
138
119
 
@@ -177,47 +158,17 @@ The lexicon provides 3 resource types and 13 property types:
177
158
  | \`Release\` | Job | GitLab Release creation |
178
159
  | \`AutoCancel\` | Workflow | Pipeline auto-cancellation settings |
179
160
 
180
- ## The barrel file
181
-
182
- Every chant project has a barrel file (conventionally \`_.ts\`) that re-exports the lexicon:
183
-
184
- \`\`\`typescript
185
- // _.ts — the barrel file
186
- export * from "@intentius/chant-lexicon-gitlab";
187
- export * from "./config";
188
- \`\`\`
161
+ ## Shared config
189
162
 
190
- Other files import the barrel and use its exports:
163
+ Extract reusable objects into a shared config file and import them across your pipeline files:
191
164
 
192
- \`\`\`typescript
193
- // pipeline.ts
194
- import * as _ from "./_";
195
-
196
- export const build = new _.Job({
197
- stage: "build",
198
- image: _.nodeImage, // from config.ts via barrel
199
- cache: _.npmCache, // from config.ts via barrel
200
- script: ["npm ci", "npm run build"],
201
- artifacts: _.buildArtifacts,
202
- });
203
- \`\`\`
165
+ {{file:docs-snippets/src/pipeline-barrel.ts}}
204
166
 
205
167
  ## Jobs
206
168
 
207
169
  A \`Job\` is the fundamental unit. Every exported \`Job\` becomes a job entry in the YAML:
208
170
 
209
- \`\`\`typescript
210
- export const test = new Job({
211
- stage: "test",
212
- image: new Image({ name: "node:20-alpine" }),
213
- script: ["npm ci", "npm test"],
214
- artifacts: new Artifacts({
215
- paths: ["coverage/"],
216
- expireIn: "1 week",
217
- reports: { junit: "coverage/junit.xml" },
218
- }),
219
- });
220
- \`\`\`
171
+ {{file:docs-snippets/src/job-test.ts}}
221
172
 
222
173
  Key properties:
223
174
  - \`script\` — **required** (or \`trigger\`/\`run\`). Array of shell commands to execute.
@@ -229,12 +180,7 @@ Key properties:
229
180
 
230
181
  Stages define the execution order of a pipeline. The serializer automatically collects unique stage values from all jobs:
231
182
 
232
- \`\`\`typescript
233
- export const lint = new Job({ stage: "test", script: ["npm run lint"] });
234
- export const test = new Job({ stage: "test", script: ["npm test"] });
235
- export const build = new Job({ stage: "build", script: ["npm run build"] });
236
- export const deploy = new Job({ stage: "deploy", script: ["npm run deploy"] });
237
- \`\`\`
183
+ {{file:docs-snippets/src/stages.ts}}
238
184
 
239
185
  Produces:
240
186
 
@@ -249,30 +195,9 @@ Jobs in the same stage run in parallel. Stages run sequentially in declaration o
249
195
 
250
196
  ## Artifacts and caching
251
197
 
252
- **Artifacts** are files produced by a job and passed to later stages or stored for download:
253
-
254
- \`\`\`typescript
255
- export const buildArtifacts = new Artifacts({
256
- paths: ["dist/"],
257
- expireIn: "1 hour", // always set expiry (WGL004 warns if missing)
258
- });
259
-
260
- export const testArtifacts = new Artifacts({
261
- paths: ["coverage/"],
262
- expireIn: "1 week",
263
- reports: { junit: "coverage/junit.xml" }, // parsed by GitLab for MR display
264
- });
265
- \`\`\`
198
+ **Artifacts** are files produced by a job and passed to later stages or stored for download. **Caches** persist files between pipeline runs to speed up builds. Both are shown in the shared config:
266
199
 
267
- **Caches** persist files between pipeline runs to speed up builds:
268
-
269
- \`\`\`typescript
270
- export const npmCache = new Cache({
271
- key: "$CI_COMMIT_REF_SLUG", // cache per branch
272
- paths: ["node_modules/"],
273
- policy: "pull-push", // "pull" for read-only, "push" for write-only
274
- });
275
- \`\`\`
200
+ {{file:docs-snippets/src/config.ts:4-22}}
276
201
 
277
202
  The key difference: artifacts are for passing files between **stages in the same pipeline**; caches are for speeding up **repeated pipeline runs**.
278
203
 
@@ -280,22 +205,7 @@ The key difference: artifacts are for passing files between **stages in the same
280
205
 
281
206
  \`Rule\` objects control when a job runs. They map to \`rules:\` entries in the YAML:
282
207
 
283
- \`\`\`typescript
284
- export const onMergeRequest = new Rule({
285
- ifCondition: CI.MergeRequestIid, // → if: $CI_MERGE_REQUEST_IID
286
- });
287
-
288
- export const onDefaultBranch = new Rule({
289
- ifCondition: \`\${CI.CommitBranch} == \${CI.DefaultBranch}\`,
290
- when: "manual", // require manual trigger
291
- });
292
-
293
- export const deploy = new Job({
294
- stage: "deploy",
295
- script: ["npm run deploy"],
296
- rules: [onDefaultBranch],
297
- });
298
- \`\`\`
208
+ {{file:docs-snippets/src/rules-conditions.ts}}
299
209
 
300
210
  Produces:
301
211
 
@@ -315,19 +225,7 @@ The \`ifCondition\` property maps to \`if:\` in the YAML (since \`if\` is a rese
315
225
 
316
226
  \`Environment\` defines a deployment target:
317
227
 
318
- \`\`\`typescript
319
- export const productionEnv = new Environment({
320
- name: "production",
321
- url: "https://example.com",
322
- });
323
-
324
- export const deploy = new Job({
325
- stage: "deploy",
326
- script: ["npm run deploy"],
327
- environment: productionEnv,
328
- rules: [onDefaultBranch],
329
- });
330
- \`\`\`
228
+ {{file:docs-snippets/src/environment.ts}}
331
229
 
332
230
  GitLab tracks deployments to environments and provides rollback capabilities in the UI.
333
231
 
@@ -335,44 +233,19 @@ GitLab tracks deployments to environments and provides rollback capabilities in
335
233
 
336
234
  \`Image\` specifies the Docker image for a job:
337
235
 
338
- \`\`\`typescript
339
- export const nodeImage = new Image({ name: "node:20-alpine" });
340
-
341
- // With entrypoint override
342
- export const customImage = new Image({
343
- name: "registry.example.com/my-image:latest",
344
- entrypoint: ["/bin/sh", "-c"],
345
- });
346
- \`\`\`
236
+ {{file:docs-snippets/src/images.ts}}
347
237
 
348
238
  ## Workflow
349
239
 
350
240
  \`Workflow\` controls pipeline-level settings — when pipelines run, auto-cancellation, and global includes:
351
241
 
352
- \`\`\`typescript
353
- export const workflow = new Workflow({
354
- name: "CI Pipeline for $CI_COMMIT_REF_NAME",
355
- rules: [
356
- new Rule({ ifCondition: CI.MergeRequestIid }),
357
- new Rule({ ifCondition: CI.CommitBranch }),
358
- ],
359
- autoCancel: new AutoCancel({
360
- onNewCommit: "interruptible",
361
- }),
362
- });
363
- \`\`\`
242
+ {{file:docs-snippets/src/workflow.ts}}
364
243
 
365
244
  ## Default
366
245
 
367
246
  \`Default\` sets shared configuration inherited by all jobs:
368
247
 
369
- \`\`\`typescript
370
- export const defaults = new Default({
371
- image: new Image({ name: "node:20-alpine" }),
372
- cache: new Cache({ key: CI.CommitRef, paths: ["node_modules/"] }),
373
- retry: new Retry({ max: 2, when: ["runner_system_failure"] }),
374
- });
375
- \`\`\`
248
+ {{file:docs-snippets/src/defaults.ts}}
376
249
 
377
250
  Jobs can override any default property individually.
378
251
 
@@ -380,16 +253,7 @@ Jobs can override any default property individually.
380
253
 
381
254
  \`Trigger\` creates downstream pipeline jobs:
382
255
 
383
- \`\`\`typescript
384
- export const deployInfra = new Job({
385
- stage: "deploy",
386
- trigger: new Trigger({
387
- project: "my-group/infra-repo",
388
- branch: "main",
389
- strategy: "depend",
390
- }),
391
- });
392
- \`\`\``,
256
+ {{file:docs-snippets/src/trigger.ts}}`,
393
257
  },
394
258
  {
395
259
  slug: "variables",
@@ -397,25 +261,7 @@ export const deployInfra = new Job({
397
261
  description: "GitLab CI/CD predefined variable references",
398
262
  content: `The \`CI\` object provides type-safe access to GitLab CI/CD predefined variables. These map to \`$CI_*\` environment variables at runtime.
399
263
 
400
- \`\`\`typescript
401
- import { CI, Job, Rule } from "@intentius/chant-lexicon-gitlab";
402
-
403
- // Use in rule conditions
404
- const onDefault = new Rule({
405
- ifCondition: \`\${CI.CommitBranch} == \${CI.DefaultBranch}\`,
406
- });
407
-
408
- // Use in cache keys
409
- const cache = new Cache({
410
- key: CI.CommitRef, // → $CI_COMMIT_REF_NAME
411
- paths: ["node_modules/"],
412
- });
413
-
414
- // Use in workflow names
415
- const workflow = new Workflow({
416
- name: \`Pipeline for \${CI.CommitRef}\`,
417
- });
418
- \`\`\`
264
+ {{file:docs-snippets/src/variables-usage.ts}}
419
265
 
420
266
  ## Variable reference
421
267
 
@@ -442,44 +288,7 @@ const workflow = new Workflow({
442
288
 
443
289
  ## Common patterns
444
290
 
445
- **Conditional on branch type:**
446
-
447
- \`\`\`typescript
448
- // Only on merge requests
449
- new Rule({ ifCondition: CI.MergeRequestIid })
450
-
451
- // Only on default branch
452
- new Rule({ ifCondition: \`\${CI.CommitBranch} == \${CI.DefaultBranch}\` })
453
-
454
- // Only on tags
455
- new Rule({ ifCondition: CI.CommitTag })
456
- \`\`\`
457
-
458
- **Dynamic naming:**
459
-
460
- \`\`\`typescript
461
- export const deploy = new Job({
462
- stage: "deploy",
463
- environment: new Environment({
464
- name: \`review/\${CI.CommitRef}\`,
465
- url: \`https://\${CI.CommitRef}.preview.example.com\`,
466
- }),
467
- script: ["deploy-preview"],
468
- });
469
- \`\`\`
470
-
471
- **Container registry:**
472
-
473
- \`\`\`typescript
474
- export const buildImage = new Job({
475
- stage: "build",
476
- image: new Image({ name: "docker:24" }),
477
- script: [
478
- \`docker build -t \${CI.RegistryImage}:\${CI.CommitSha} .\`,
479
- \`docker push \${CI.RegistryImage}:\${CI.CommitSha}\`,
480
- ],
481
- });
482
- \`\`\`
291
+ {{file:docs-snippets/src/variables-patterns.ts}}
483
292
  `,
484
293
  },
485
294
  {
@@ -488,21 +297,11 @@ export const buildImage = new Job({
488
297
  description: "GitLab CI/CD intrinsic functions and their chant syntax",
489
298
  content: `The GitLab lexicon provides one intrinsic function: \`reference()\`, which maps to GitLab's \`!reference\` YAML tag.
490
299
 
491
- \`\`\`typescript
492
- import { reference } from "@intentius/chant-lexicon-gitlab";
493
- \`\`\`
494
-
495
300
  ## \`reference()\` — reuse job properties
496
301
 
497
302
  The \`reference()\` intrinsic lets you reuse properties from other jobs or hidden keys. It produces the \`!reference\` YAML tag:
498
303
 
499
- \`\`\`typescript
500
- import { reference, Job } from "@intentius/chant-lexicon-gitlab";
501
-
502
- export const deploy = new Job({
503
- script: reference(".setup", "script"),
504
- });
505
- \`\`\`
304
+ {{file:docs-snippets/src/reference-basic.ts}}
506
305
 
507
306
  Serializes to:
508
307
 
@@ -522,24 +321,7 @@ reference(jobName: string, property: string): ReferenceTag
522
321
 
523
322
  ### Use cases
524
323
 
525
- **Shared setup scripts:**
526
-
527
- \`\`\`typescript
528
- // Hidden key with shared setup (defined in .gitlab-ci.yml or included)
529
- // Reference its script from multiple jobs:
530
-
531
- export const test = new Job({
532
- stage: "test",
533
- beforeScript: reference(".node-setup", "before_script"),
534
- script: ["npm test"],
535
- });
536
-
537
- export const lint = new Job({
538
- stage: "test",
539
- beforeScript: reference(".node-setup", "before_script"),
540
- script: ["npm run lint"],
541
- });
542
- \`\`\`
324
+ {{file:docs-snippets/src/reference-shared.ts}}
543
325
 
544
326
  Produces:
545
327
 
@@ -557,46 +339,9 @@ lint:
557
339
  - npm run lint
558
340
  \`\`\`
559
341
 
560
- **Shared rules:**
561
-
562
- \`\`\`typescript
563
- export const build = new Job({
564
- stage: "build",
565
- rules: reference(".default-rules", "rules"),
566
- script: ["npm run build"],
567
- });
568
- \`\`\`
569
-
570
- **Nested references (multi-level):**
571
-
572
- \`\`\`typescript
573
- // Reference a specific nested element
574
- export const deploy = new Job({
575
- script: reference(".setup", "script"),
576
- environment: reference(".deploy-defaults", "environment"),
577
- });
578
- \`\`\`
579
-
580
342
  ### When to use \`reference()\` vs barrel imports
581
343
 
582
- Use **barrel imports** (\`_.$\`) when referencing chant-managed objects — the serializer resolves them at build time:
583
-
584
- \`\`\`typescript
585
- // Preferred for chant-managed config
586
- export const test = new Job({
587
- cache: _.npmCache, // resolved at build time
588
- artifacts: _.testArtifacts, // resolved at build time
589
- });
590
- \`\`\`
591
-
592
- Use **\`reference()\`** when referencing jobs or hidden keys defined outside chant (e.g. in included YAML files or templates):
593
-
594
- \`\`\`typescript
595
- // For external/included YAML definitions
596
- export const test = new Job({
597
- beforeScript: reference(".ci-setup", "before_script"),
598
- });
599
- \`\`\`
344
+ {{file:docs-snippets/src/reference-vs-barrel.ts}}
600
345
  `,
601
346
  },
602
347
  {
@@ -615,23 +360,7 @@ Lint rules analyze your TypeScript source code before build.
615
360
 
616
361
  Flags usage of \`only:\` and \`except:\` keywords, which are deprecated in favor of \`rules:\`. The \`rules:\` syntax is more flexible and is the recommended approach.
617
362
 
618
- \`\`\`typescript
619
- // Triggers WGL001
620
- export const deploy = new Job({
621
- stage: "deploy",
622
- script: ["npm run deploy"],
623
- only: ["main"], // deprecated
624
- });
625
-
626
- // Fixed — use rules instead
627
- export const deploy = new Job({
628
- stage: "deploy",
629
- script: ["npm run deploy"],
630
- rules: [new Rule({
631
- ifCondition: \`\${CI.CommitBranch} == \${CI.DefaultBranch}\`,
632
- })],
633
- });
634
- \`\`\`
363
+ {{file:docs-snippets/src/lint-wgl001.ts}}
635
364
 
636
365
  ### WGL002 — Missing script
637
366
 
@@ -639,26 +368,7 @@ export const deploy = new Job({
639
368
 
640
369
  A GitLab CI job must have \`script\`, \`trigger\`, or \`run\` defined. Jobs without any of these will fail pipeline validation.
641
370
 
642
- \`\`\`typescript
643
- // Triggers WGL002
644
- export const build = new Job({
645
- stage: "build",
646
- image: new Image({ name: "node:20" }),
647
- // Missing script!
648
- });
649
-
650
- // Fixed — add script
651
- export const build = new Job({
652
- stage: "build",
653
- image: new Image({ name: "node:20" }),
654
- script: ["npm run build"],
655
- });
656
-
657
- // Also valid — trigger job (no script needed)
658
- export const downstream = new Job({
659
- trigger: new Trigger({ project: "my-group/other-repo" }),
660
- });
661
- \`\`\`
371
+ {{file:docs-snippets/src/lint-wgl002.ts}}
662
372
 
663
373
  ### WGL003 — Missing stage
664
374
 
@@ -666,19 +376,7 @@ export const downstream = new Job({
666
376
 
667
377
  Jobs should declare a \`stage\` property. Without it, the job defaults to the \`test\` stage, which may not be the intended behavior.
668
378
 
669
- \`\`\`typescript
670
- // Triggers WGL003
671
- export const build = new Job({
672
- script: ["npm run build"],
673
- // No stage — defaults to "test"
674
- });
675
-
676
- // Fixed — declare the stage
677
- export const build = new Job({
678
- stage: "build",
679
- script: ["npm run build"],
680
- });
681
- \`\`\`
379
+ {{file:docs-snippets/src/lint-wgl003.ts}}
682
380
 
683
381
  ### WGL004 — Artifacts without expiry
684
382
 
@@ -686,25 +384,7 @@ export const build = new Job({
686
384
 
687
385
  Flags \`Artifacts\` without \`expireIn\`. Artifacts without expiry are kept indefinitely, consuming storage. Always set an expiration.
688
386
 
689
- \`\`\`typescript
690
- // Triggers WGL004
691
- export const build = new Job({
692
- script: ["npm run build"],
693
- artifacts: new Artifacts({
694
- paths: ["dist/"],
695
- // Missing expireIn!
696
- }),
697
- });
698
-
699
- // Fixed — set expiry
700
- export const build = new Job({
701
- script: ["npm run build"],
702
- artifacts: new Artifacts({
703
- paths: ["dist/"],
704
- expireIn: "1 hour",
705
- }),
706
- });
707
- \`\`\`
387
+ {{file:docs-snippets/src/lint-wgl004.ts}}
708
388
 
709
389
  ## Post-synth checks
710
390
 
@@ -722,16 +402,7 @@ Flags jobs that reference a stage not present in the collected stages list. This
722
402
 
723
403
  Flags jobs where all \`rules:\` entries have \`when: "never"\`, making the job unreachable. This usually indicates a configuration error.
724
404
 
725
- \`\`\`typescript
726
- // Triggers WGL011 — job can never run
727
- export const noop = new Job({
728
- script: ["echo unreachable"],
729
- rules: [
730
- new Rule({ ifCondition: CI.CommitBranch, when: "never" }),
731
- new Rule({ ifCondition: CI.CommitTag, when: "never" }),
732
- ],
733
- });
734
- \`\`\`
405
+ {{file:docs-snippets/src/lint-wgl011.ts}}
735
406
 
736
407
  ## Running lint
737
408
 
@@ -756,7 +427,7 @@ To suppress globally in \`chant.config.ts\`:
756
427
  export default {
757
428
  lint: {
758
429
  rules: {
759
- WGL003: "off", // don't require stage on every job
430
+ WGL003: "off",
760
431
  },
761
432
  },
762
433
  };
@@ -783,100 +454,21 @@ bun test # runs the example's tests
783
454
 
784
455
  \`\`\`
785
456
  src/
786
- ├── _.ts # Barrel — re-exports lexicon + shared config
787
457
  ├── config.ts # Shared config: images, caches, artifacts, rules, environments
788
458
  └── pipeline.ts # Job definitions: build, test, deploy
789
459
  \`\`\`
790
460
 
791
- ### Barrel file
792
-
793
- The barrel re-exports both the lexicon and shared config, so pipeline files only need one import:
794
-
795
- \`\`\`typescript
796
- // _.ts
797
- export * from "@intentius/chant-lexicon-gitlab";
798
- export * from "./config";
799
- \`\`\`
800
-
801
461
  ### Shared configuration
802
462
 
803
463
  \`config.ts\` extracts reusable objects — images, caches, artifacts, rules, and environments — so jobs stay concise:
804
464
 
805
- \`\`\`typescript
806
- // config.ts
807
- import * as _ from "./_";
808
-
809
- export const nodeImage = new _.Image({ name: "node:20-alpine" });
810
-
811
- export const npmCache = new _.Cache({
812
- key: "$CI_COMMIT_REF_SLUG",
813
- paths: ["node_modules/"],
814
- policy: "pull-push",
815
- });
816
-
817
- export const buildArtifacts = new _.Artifacts({
818
- paths: ["dist/"],
819
- expireIn: "1 hour",
820
- });
821
-
822
- export const testArtifacts = new _.Artifacts({
823
- paths: ["coverage/"],
824
- expireIn: "1 week",
825
- reports: { junit: "coverage/junit.xml" },
826
- });
827
-
828
- export const onMergeRequest = new _.Rule({
829
- ifCondition: _.CI.MergeRequestIid,
830
- });
831
-
832
- export const onCommit = new _.Rule({
833
- ifCondition: _.CI.CommitBranch,
834
- });
835
-
836
- export const onDefaultBranch = new _.Rule({
837
- ifCondition: \`\${_.CI.CommitBranch} == \${_.CI.DefaultBranch}\`,
838
- when: "manual",
839
- });
840
-
841
- export const productionEnv = new _.Environment({
842
- name: "production",
843
- url: "https://example.com",
844
- });
845
- \`\`\`
465
+ {{file:getting-started/src/config.ts}}
846
466
 
847
467
  ### Pipeline jobs
848
468
 
849
- \`pipeline.ts\` defines three jobs that reference shared config via the barrel:
469
+ \`pipeline.ts\` defines three jobs that import shared config directly:
850
470
 
851
- \`\`\`typescript
852
- // pipeline.ts
853
- import * as _ from "./_";
854
-
855
- export const build = new _.Job({
856
- stage: "build",
857
- image: _.nodeImage,
858
- cache: _.npmCache,
859
- script: ["npm ci", "npm run build"],
860
- artifacts: _.buildArtifacts,
861
- });
862
-
863
- export const test = new _.Job({
864
- stage: "test",
865
- image: _.nodeImage,
866
- cache: _.npmCache,
867
- script: ["npm ci", "npm test"],
868
- artifacts: _.testArtifacts,
869
- rules: [_.onMergeRequest, _.onCommit],
870
- });
871
-
872
- export const deploy = new _.Job({
873
- stage: "deploy",
874
- image: _.nodeImage,
875
- script: ["npm run deploy"],
876
- environment: _.productionEnv,
877
- rules: [_.onDefaultBranch],
878
- });
879
- \`\`\`
471
+ {{file:getting-started/src/pipeline.ts}}
880
472
 
881
473
  ### Generated output
882
474
 
@@ -29,7 +29,7 @@ export function generateLexiconJSON(
29
29
  typeName: r.resource.typeName,
30
30
  attributes: r.resource.attributes,
31
31
  properties: r.resource.properties,
32
- propertyTypes: r.propertyTypes.map((pt) => ({ name: pt.name, cfnType: pt.defType })),
32
+ propertyTypes: r.propertyTypes.map((pt) => ({ name: pt.name, specType: pt.defType })),
33
33
  }));
34
34
 
35
35
  const entries = buildRegistry<LexiconEntry>(registryResources, naming, {
@@ -5,9 +5,9 @@ import { loadSchemaFixture } from "../testdata/load-fixtures";
5
5
  const fixture = loadSchemaFixture();
6
6
 
7
7
  describe("parseCISchema", () => {
8
- test("returns 15 entities", () => {
8
+ test("returns 16 entities", () => {
9
9
  const results = parseCISchema(fixture);
10
- expect(results).toHaveLength(15);
10
+ expect(results).toHaveLength(16);
11
11
  });
12
12
 
13
13
  test("returns 3 resource entities", () => {
@@ -20,14 +20,15 @@ describe("parseCISchema", () => {
20
20
  expect(names).toContain("GitLab::CI::Workflow");
21
21
  });
22
22
 
23
- test("returns 12 property entities", () => {
23
+ test("returns 13 property entities", () => {
24
24
  const results = parseCISchema(fixture);
25
25
  const properties = results.filter((r) => r.isProperty);
26
- expect(properties).toHaveLength(12);
26
+ expect(properties).toHaveLength(13);
27
27
  const names = properties.map((r) => r.resource.typeName);
28
28
  expect(names).toContain("GitLab::CI::Artifacts");
29
29
  expect(names).toContain("GitLab::CI::Cache");
30
30
  expect(names).toContain("GitLab::CI::Image");
31
+ expect(names).toContain("GitLab::CI::Service");
31
32
  expect(names).toContain("GitLab::CI::Rule");
32
33
  expect(names).toContain("GitLab::CI::Retry");
33
34
  expect(names).toContain("GitLab::CI::AllowFailure");