Skip to content

kit: ship the editor WASM when packed, and make the editor's colours themeable - #121

Merged
Kinflou merged 2 commits into
masterfrom
kit/pack-editor
Nov 14, 2026
Merged

Kinflou merged 2 commits into
masterfrom
kit/pack-editor

Conversation

@Kinflou

@Kinflou Kinflou commented Nov 14, 2026

Copy link
Copy Markdown
Member

Two fixes to comline-web-kit that the tutorial needs to use the kit's editor.

The editor WASM was missing from the packed kit. wasm-pack writes a .gitignore containing * into pkg-editor/, and yarn pack honours it. So anyone installing the kit by git (#workspace=comline-web-kit) got it without pkg-editor/, and importing comline-web-kit/editor failed. scripts/prepare.sh now removes that file after building, and also when it skips an existing build.

The editor's colours can be themed. The syntax colours, the active line and the selection were fixed in editor.ts, and suited only a dark background. They now read custom properties, defaulting to today's colours:

  • --cl-tok-kw, -type, -str, -comment, -num, -ann, -var, -fn, -op and -self;
  • --cl-active-line and --cl-selection.

The playground sets none of them, so its colours are unchanged. The tutorial's light theme uses them.

Testing

  • The kit's tests pass: 39 of 39.
  • I packed the kit from a fresh clone. pkg-editor/ is now in the archive, and wasn't before.
  • The tutorial, installed from this branch, compiles a schema in the browser in both of its themes.

wasm-pack writes a .gitignore of * into pkg-editor/, and yarn pack honours
it, so a consumer installing the kit by git got it without the editor WASM.
prepare.sh now removes that file after building (and when it skips an
existing build).
The token colours, the active line and the selection read --cl-tok-*,
--cl-active-line and --cl-selection, defaulting to the playground's
current colours, so a page can restyle the editor (a light theme
included). The playground looks the same.
@Kinflou
Kinflou merged commit f6077cc into master Nov 14, 2026
8 checks passed
@Kinflou
Kinflou deleted the kit/pack-editor branch November 14, 2026 16:23
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