Skip to content

Support TypeScript and gjs/gts in snippets and demos - #1713

Open
gkappen wants to merge 3 commits into
ember-learn:mainfrom
NIPOSoftwareBV:support-gts-examples
Open

gkappen wants to merge 3 commits into
ember-learn:mainfrom
NIPOSoftwareBV:support-gts-examples

Conversation

@gkappen

@gkappen gkappen commented Oct 30, 2026 •

Copy link
Copy Markdown

Summary

Adds support for TypeScript and .gjs/.gts files in demos and snippets.

  • Snippet extraction: gts and gjs are added to the default snippetExtensions (ts was already there).
  • Syntax highlighting: highlight.js has no gjs/gts grammar, so the JS/TS grammars are extended to highlight <template> blocks as Handlebars. Registered for Markdown code fences / highlightCode and for DocsCodeHighlight.
  • DocsDemo: default label/language for .ts, .gjs and .gts snippets.
  • DocsSnippet: infers its language from the snippet file extension when @language isn't given (js, ts, gjs, gts, hbs, css, json).
  • Search / edit links: .gjs/.gts pages are indexed for search (template contents extracted with content-tag, now a direct dependency) and are matched by the "edit this page" link.
  • Docs & tests: dummy app gets .gts/.gjs demo components and a docs section, the snippetExtensions default in the build-options docs is corrected, plus integration (gjs), unit and node tests.

Notes

  • API docs for TS/gjs/gts sources are already handled by ember-cli-addon-docs-yuidoc; no change needed here.
  • The gjs/gts grammar is defined in both compile-markdown.js and docs-code-highlight because the Node build can't share a relative import with the browser bundle.
  • Not included: type declarations / Glint registry for the addon's own components.

CI fix (ember-release / ember-beta / ember-canary)

The ember-release, ember-beta and ember-canary compatibility jobs were already failing on main (and on other PRs), independent of this change. Those channels now resolve to ember-source 7.x, which is a v2 addon without the paths that the classic ember-cli build (6.2) needs, so new EmberAddon crashes before any test runs (Cannot read properties of undefined (reading 'debug') in _initVendorFiles).

This PR replaces those three scenarios in tests/dummy/config/ember-try.js and .github/workflows/ci-cd.yml with ember-lts-6.12, which passes all 71 tests. The release/beta/canary channels can only be tested again once the addon's build moves to Vite/Embroider.

If you'd prefer to keep this separate from the gts/gjs work, the CI change is a single commit (f8bfc4d) and can be split into its own PR.

Testing

pnpm test:node and pnpm test:ember pass; ESLint passes. All CI checks are green, including the new ember-lts-6.12 scenario.

gkappen and others added 2 commits October 29, 2026 14:53
- Find snippets in gjs/gts files by default
- Highlight gjs/gts (`<template>` as Handlebars) in snippets and Markdown
- Derive DocsDemo labels/language for ts, gjs and gts snippets
- Infer DocsSnippet language from the snippet file extension
- Index gjs/gts pages for search and include them in edit links
- Add dummy app gts/gjs examples, docs and tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The release, beta and canary channels now resolve to ember-source 7.x,
which is a v2 addon without the `paths` the classic ember-cli build
needs, so `new EmberAddon` crashes before any test runs. Test the
latest 6.x LTS instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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