Skip to content

Add standalone CDL and PDL Monaco language modules, publish to npm - #43

Merged
einari merged 4 commits into
mainfrom
feature/standalone-sub-languages
Jul 29, 2026
Merged

Add standalone CDL and PDL Monaco language modules, publish to npm#43
einari merged 4 commits into
mainfrom
feature/standalone-sub-languages

Conversation

@einari

@einari einari commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Added

  • Standalone Monaco language modules for the Capture Declaration Language (CDL) and Projection Declaration Language (PDL), each registrable as its own top-level language (own id, tokenizer, completion/hover/validation providers) via the new @cratis/screenplay-language/capture and @cratis/screenplay-language/projection subpath exports — usable independently of the full .play construct set.
  • publish-npm-packages CI job that publishes @cratis/screenplay-language to npm via OIDC trusted publishing, matching the existing pattern in the Components repo.

Changed

  • Corrected the Capture Declaration Language's keyword surface to the current grammar: the auth/bearer keywords and inline url on API sources are gone — an API source now references a named External Service via api <ServiceName>, with an optional route.
  • Extracted the shared Monarch token rules used by every sub-language block in the composite .play tokenizer into an exported commonTokenRules constant.
  • Bumped the monaco-editor devDependency to match the version range downstream consumers use.

einari added 4 commits July 29, 2026 06:04
Pull the string/number/operator/variable common rules used by every
sub-language block in the composite `.play` tokenizer into an exported
commonTokenRules constant, so a standalone sub-language module can
reuse the same fragments instead of duplicating them.
…n Language modules

Register CDL and PDL as their own top-level Monaco languages (own
language id, tokenizer, completion/hover/validation providers) rather
than only as sub-grammars embedded inside a `.play` document, so a
consumer can use just one of them without pulling in the rest of the
Screenplay construct set. Exposed as the `./capture` and `./projection`
subpath exports.

Port the full richness of Chronicle's existing hand-rolled Monaco
tooling for both languages (every completion context, hover
documentation, and validation rule), correcting CDL's keyword surface
to the current grammar in the process — `auth`/`bearer`/inline `url`
are gone (an API source now references a named External Service via
`api <ServiceName>`, with an optional `route`), which the previously
duplicated Chronicle-side tooling had drifted from.

PDL's schema-aware behavior (event/read-model completions, hover, and
validation) is parameterized through data setters and callbacks that a
host application feeds live data into, mirroring the exact shape
Chronicle's existing setter functions already used.

Also bump the monaco-editor devDependency to match the version range
downstream consumers use, avoiding a type-shape mismatch when this
package is portal-linked for local development.
Add a publish-npm-packages job modeled on the Components repo's
existing OIDC trusted-publish job: no long-lived npm token, just the
GitHub Actions OIDC token exchanged at publish time. Mark the package
publicly accessible via publishConfig, required for a scoped package.
…b-languages

# Conflicts:
#	Source/Screenplay/Monaco/screenplay-language/tokens.ts
@einari
einari merged commit b2beca2 into main Jul 29, 2026
@einari
einari deleted the feature/standalone-sub-languages branch July 29, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant