Skip to content

DEV: Update typescript & pnpm - #107

Merged
davidtaylorhq merged 4 commits into
mainfrom
typescript-7
Oct 19, 2026
Merged

davidtaylorhq merged 4 commits into
mainfrom
typescript-7

Conversation

@davidtaylorhq

@davidtaylorhq davidtaylorhq commented Oct 16, 2026 •

Copy link
Copy Markdown
Member
  • Typescript 7, with new ember-content-mapper instead of ember-tsc
  • pnpm 12
  • Fix lint:js which was failing silently due to the brace-expansion

Plugins now type-check with TypeScript 7, which checks `.gts` and `.gjs` files through `ember-content-mapper` instead of Glint's `ember-tsc`. `pnpm lint:types` runs `tsc -b --runExternalCode`.

- `typescript` is the 7.1 nightly that core uses. Content mappers need 7.1, which is only available as a nightly.
- `tsconfig.json` registers the content mapper. The plugin's own paths also try `.gjs` and `.gts`, and the bare `admin/*`, `float-kit/*`, `select-kit/*` and `truth-helpers/*` paths also try `.d.gjs.ts` and `.d.gts.ts`, the declaration names TypeScript 7 emits for those files.
- `.npmrc` turns on strict peer dependencies, so a peer mismatch fails the install. lint-configs 3.8.2, lint-to-the-future 3.2 and lint-to-the-future-eslint 4.0 fix the mismatches the skeleton had.
- `@discourse/types` moves to the latest release, whose shared config turns on strict mode.

Relative imports of `.gjs` and `.gts` files must include the extension, because TypeScript 7 only resolves a mapped file when the import names it. `pnpm lint:js:fix` adds them. In VS Code, use the TypeScript 7 extension (`TypeScriptTeam.native-preview`) with Glint 2 1.4.0 or newer.
The skeleton now pins pnpm 12.11.2. pnpm 11 and newer only read auth and registry settings from `.npmrc`, so the install settings move to `pnpm-workspace.yaml`.

- `@discourse/*` packages are exempt from `minimumReleaseAge`, as in core. pnpm 12 checks every lockfile entry against it, even when the lockfile is up to date, so without the exemption installs and CI would fail for a day after each lint-configs or `@discourse/types` release.
`lint:js` and `lint:js:fix` passed `{assets,admin/assets,test}/javascripts` to ESLint and relied on the shell to expand the braces. pnpm runs scripts with `sh`, which is dash on Debian, including the CI images, and dash does not expand braces. ESLint then got a pattern that matched no files, and `--no-error-on-unmatched-pattern` let it pass without linting anything.

The directories are now separate arguments. A plugin that has been passing CI may now report ESLint errors that were there all along.
pnpm reads its settings from `pnpm-workspace.yaml`, but npm still reads `.npmrc`. With `engine-strict`, `npm install` fails on the `"npm": "please-use-pnpm"` engine instead of only warning, so nobody installs with npm by mistake. pnpm ignores the line.
@davidtaylorhq davidtaylorhq changed the title DEV: Type-check with TypeScript 7 DEV: Update typescript & pnpm Oct 16, 2026
@davidtaylorhq
davidtaylorhq marked this pull request as ready for review October 16, 2026 13:20
@davidtaylorhq
davidtaylorhq merged commit 9c79225 into main Oct 19, 2026
5 checks passed
@davidtaylorhq
davidtaylorhq deleted the typescript-7 branch October 19, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants