Repository navigation
chore: upgrade to TypeScript 6 + pin tsgo beta + fix dual-load config - #1074
Conversation
🦋 Changeset detectedLatest commit: 6d7faee The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-perf-coordinator | 6d7faee | May 17 2026, 08:09 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-i18n | 6d7faee | May 17 2026, 08:09 AM |
Scope checkThis PR changes 1,155 lines across 7 files. Large PRs are harder to review and more likely to be closed without review. If this scope is intentional, no action needed. A maintainer will review it. If not, please consider splitting this into smaller PRs. See CONTRIBUTING.md for contribution guidelines. |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
docs | 6d7faee | May 17 2026, 08:10 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-demo-cache | 6d7faee | May 17 2026, 08:11 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-playground | 6d7faee | May 17 2026, 08:10 AM |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/blocks
@emdash-cms/cloudflare
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
PR template validation failedPlease fix the following issues by editing your PR description:
See CONTRIBUTING.md for the full contribution policy. |
- catalog typescript ^5.9.3 -> ^6.0.3 (current stable) - pin @typescript/native-preview to 7.0.0-dev.20260421.2 (beta) to stop silent compiler drift from the floating ^7.0.0-dev range - runtime.ts: key stored config on a Symbol.for registry entry instead of a typed globalThis var, removing the TS2403 dual-load (dist+src) error and matching the existing isolate-singleton pattern - auth/create-emdash: add explicit types:[node]; the catalog bump's lockfile re-resolution stopped implicit @types/node auto-inclusion
ba4be71 to
6d7faee
Compare
* fix: resolve #1053 type errors for strict consumers Closes #1053. Two parts: 1. wordpress-plugin.ts: the analyze-endpoint error body from response.json() is unknown under @cloudflare/workers-types; narrow it before reading .message (was the reported TS18046). The other reported error (byline.ts kysely Transaction variance) was TS5.x behaviour, resolved by the TS6 upgrade in #1074. 2. Stop shipping raw .ts for the source-exported subpaths (emdash/routes/*, emdash/api/route-utils, emdash/api/schemas, emdash/auth/providers/*). They are compiled to dist (.mjs + .d.mts), so a strict consumer's tsc only ever sees declarations (skipLibCheck covers them), eliminating the dual-package Database identity wall that is #1053's root cause. ./ui and .astro stay source (the consumer's Astro build must process them). - tsdown: route entrypoints fed via inputOptions.input (literal object, not entry globs -- [param] dirs are glob char-classes). entryFileNames + resolveRoute share one routeArtifactName() so rolldown's reserved [name]/[hash] placeholders cannot mangle dynamic-route artifacts. - A fast static guard (scripts/typecheck-public-source.mjs, wired into CI) fails if any subpath export ships raw .ts/.tsx again. Verified: pnpm build, pnpm typecheck, demos+templates typecheck, demo build (route injection e2e), lint baseline unchanged. * style: format * fix(build): externalize self/optional deps so route entries don't bundle them Compiling the route/admin entries made tsdown try to bundle deps it could not resolve at build time -- 'emdash' (the package importing itself) and '@cloudflare/kumo' (admin-only, not an emdash dep). CI escalates tsdown's bundling advisory to a fatal error. - Externalize 'emdash' (self): compiled routes import it; resolved at the consumer's runtime where the package is installed. - Externalize @aws-sdk/* (optional S3 deps, runtime-only). - Keep the *-admin.tsx providers as source (bridge the admin React + @cloudflare/kumo runtime, like .astro/./ui); revert their exports. - inlineOnly: false -- nothing is unintentionally bundled (all deps external, only our own src is); silences the CI-escalated advisory. Guard's allowlist generalized to RUNTIME_COUPLED (Astro + admin React). * test: route-injection entrypoint now resolves to compiled artifact resolveRoute resolves emdash/routes/* to the compiled dist artifact with routeArtifactName applied ([ ] -> _), so the media catch-all route's entrypoint is api/media/file/_...key_ not [...key].ts. The catch-all pattern assertion (the actual guarantee) is unchanged. --------- Co-authored-by: emdashbot[bot] <emdashbot[bot]@users.noreply.github.com>
* fix: resolve #1053 type errors for strict consumers Closes #1053. Two parts: 1. wordpress-plugin.ts: the analyze-endpoint error body from response.json() is unknown under @cloudflare/workers-types; narrow it before reading .message (was the reported TS18046). The other reported error (byline.ts kysely Transaction variance) was TS5.x behaviour, resolved by the TS6 upgrade in #1074. 2. Stop shipping raw .ts for the source-exported subpaths (emdash/routes/*, emdash/api/route-utils, emdash/api/schemas, emdash/auth/providers/*). They are compiled to dist (.mjs + .d.mts), so a strict consumer's tsc only ever sees declarations (skipLibCheck covers them), eliminating the dual-package Database identity wall that is #1053's root cause. ./ui and .astro stay source (the consumer's Astro build must process them). - tsdown: route entrypoints fed via inputOptions.input (literal object, not entry globs -- [param] dirs are glob char-classes). entryFileNames + resolveRoute share one routeArtifactName() so rolldown's reserved [name]/[hash] placeholders cannot mangle dynamic-route artifacts. - A fast static guard (scripts/typecheck-public-source.mjs, wired into CI) fails if any subpath export ships raw .ts/.tsx again. Verified: pnpm build, pnpm typecheck, demos+templates typecheck, demo build (route injection e2e), lint baseline unchanged. * style: format * fix(build): externalize self/optional deps so route entries don't bundle them Compiling the route/admin entries made tsdown try to bundle deps it could not resolve at build time -- 'emdash' (the package importing itself) and '@cloudflare/kumo' (admin-only, not an emdash dep). CI escalates tsdown's bundling advisory to a fatal error. - Externalize 'emdash' (self): compiled routes import it; resolved at the consumer's runtime where the package is installed. - Externalize @aws-sdk/* (optional S3 deps, runtime-only). - Keep the *-admin.tsx providers as source (bridge the admin React + @cloudflare/kumo runtime, like .astro/./ui); revert their exports. - inlineOnly: false -- nothing is unintentionally bundled (all deps external, only our own src is); silences the CI-escalated advisory. Guard's allowlist generalized to RUNTIME_COUPLED (Astro + admin React). * test: route-injection entrypoint now resolves to compiled artifact resolveRoute resolves emdash/routes/* to the compiled dist artifact with routeArtifactName applied ([ ] -> _), so the media catch-all route's entrypoint is api/media/file/_...key_ not [...key].ts. The catch-all pattern assertion (the actual guarantee) is unchanged. * fix(types): correct shipped locals.d.ts EmDashHandlers path locals.d.ts imported EmDashHandlers from ./dist/types.d.mts, a path tsdown never emits (it is ./dist/astro/types.d.mts). The augmentation silently resolved to nothing, so Astro.locals.emdash was `any` for every consumer. Point it at the real artifact. This un-masks one real, previously-hidden mismatch: auth-atproto's callback.ts passed Kysely<Database> to createKyselyAdapter (expects Kysely<AuthTables>). Fixed with the canonical cast already used in core's cleanup.ts (Database uses Generated<> wrappers that confuse structural checks; the adapter casts internally; safe at runtime). Stacked on the compile-subpaths change (#1076): with routes compiled, fixing locals only surfaces this single bounded mismatch rather than the dual-package wall. Verified: pnpm typecheck, demos+templates typecheck, lint baseline unchanged, public-source guard. --------- Co-authored-by: emdashbot[bot] <emdashbot[bot]@users.noreply.github.com>
* fix: resolve #1053 type errors for strict consumers Closes #1053. Two parts: 1. wordpress-plugin.ts: the analyze-endpoint error body from response.json() is unknown under @cloudflare/workers-types; narrow it before reading .message (was the reported TS18046). The other reported error (byline.ts kysely Transaction variance) was TS5.x behaviour, resolved by the TS6 upgrade in #1074. 2. Stop shipping raw .ts for the source-exported subpaths (emdash/routes/*, emdash/api/route-utils, emdash/api/schemas, emdash/auth/providers/*). They are compiled to dist (.mjs + .d.mts), so a strict consumer's tsc only ever sees declarations (skipLibCheck covers them), eliminating the dual-package Database identity wall that is #1053's root cause. ./ui and .astro stay source (the consumer's Astro build must process them). - tsdown: route entrypoints fed via inputOptions.input (literal object, not entry globs -- [param] dirs are glob char-classes). entryFileNames + resolveRoute share one routeArtifactName() so rolldown's reserved [name]/[hash] placeholders cannot mangle dynamic-route artifacts. - A fast static guard (scripts/typecheck-public-source.mjs, wired into CI) fails if any subpath export ships raw .ts/.tsx again. Verified: pnpm build, pnpm typecheck, demos+templates typecheck, demo build (route injection e2e), lint baseline unchanged. * style: format * fix(build): externalize self/optional deps so route entries don't bundle them Compiling the route/admin entries made tsdown try to bundle deps it could not resolve at build time -- 'emdash' (the package importing itself) and '@cloudflare/kumo' (admin-only, not an emdash dep). CI escalates tsdown's bundling advisory to a fatal error. - Externalize 'emdash' (self): compiled routes import it; resolved at the consumer's runtime where the package is installed. - Externalize @aws-sdk/* (optional S3 deps, runtime-only). - Keep the *-admin.tsx providers as source (bridge the admin React + @cloudflare/kumo runtime, like .astro/./ui); revert their exports. - inlineOnly: false -- nothing is unintentionally bundled (all deps external, only our own src is); silences the CI-escalated advisory. Guard's allowlist generalized to RUNTIME_COUPLED (Astro + admin React). * test: route-injection entrypoint now resolves to compiled artifact resolveRoute resolves emdash/routes/* to the compiled dist artifact with routeArtifactName applied ([ ] -> _), so the media catch-all route's entrypoint is api/media/file/_...key_ not [...key].ts. The catch-all pattern assertion (the actual guarantee) is unchanged. --------- Co-authored-by: emdashbot[bot] <emdashbot[bot]@users.noreply.github.com>
* chore: harden pnpm supply-chain config Pin pnpm (packageManager: [email protected]) so the build-script/trust schema is deterministic, and add supply-chain hardening to pnpm-workspace.yaml: - minimumReleaseAge 1440 (24h publish cooldown); @rolldown/* and @emnapi/* excluded (vite8/rolldown-rc exact-pins these per-arch binaries; their release cadence structurally conflicts with the cooldown and they are not an attack surface worth the friction) - strictDepBuilds + explicit allowBuilds: build scripts run only for @parcel/watcher, sharp, better-sqlite3, esbuild, workerd; core-js-pure denied (donation postinstall, not needed) - dangerouslyAllowAllBuilds false - blockExoticSubdeps true, with an @astrojs/telemetry -> 3.3.0 override (infra/cache-demo's pkg.pr.new Astro cache-support preview pulls telemetry via URL; the override keeps the guard on) - trustPolicy no-downgrade with a reviewed, version-pinned trustPolicyExclude ([email protected], [email protected], [email protected], @portabletext/[email protected], [email protected] -- all benign publish-method changes / old pre-provenance pins, not takeovers) - verifyStoreIntegrity, strictStorePkgContentCheck, verifyDepsBeforeRun error Move enable-pre-post-scripts from .npmrc to pnpm-workspace.yaml (enablePrePostScripts: true; canonical location, also silences the npm "unknown config" warning). Remove .npmrc entirely -- provenance is implied by OIDC trusted publishing. Lockfile regenerated under the hardened config with pnpm 11.1.2. * chore: address Copilot review on supply-chain hardening - Remove stale root pnpm.onlyBuiltDependencies (dead under pinned pnpm 11; allowBuilds in pnpm-workspace.yaml is the single source) - Narrow cooldown excludes: @rolldown/* -> @rolldown/binding-*, and @emnapi/* -> @emnapi/core/@emnapi/runtime, so the cooldown stays active for JS like @rolldown/pluginutils / @emnapi/wasi-threads - Drop the dangling CONTRIBUTING.md pointer (no such policy doc) - Override @ungap/structured-clone to ^1.3.1 (1.3.0 deprecated, CWE-502) - Regenerate the lockfile from a clean store so the astro pkg.pr.new tarball regains its SRI integrity (the earlier warm-store regen dropped it; @astrojs/cloudflare and @lunariajs/core never had SRI, pre-PR included -- pnpm doesn't record it for those URLs) Re-resolved clean under pnpm 11.1.2 with the narrowed excludes. * fix: resolve #1053 type errors for strict consumers (#1076) * fix: resolve #1053 type errors for strict consumers Closes #1053. Two parts: 1. wordpress-plugin.ts: the analyze-endpoint error body from response.json() is unknown under @cloudflare/workers-types; narrow it before reading .message (was the reported TS18046). The other reported error (byline.ts kysely Transaction variance) was TS5.x behaviour, resolved by the TS6 upgrade in #1074. 2. Stop shipping raw .ts for the source-exported subpaths (emdash/routes/*, emdash/api/route-utils, emdash/api/schemas, emdash/auth/providers/*). They are compiled to dist (.mjs + .d.mts), so a strict consumer's tsc only ever sees declarations (skipLibCheck covers them), eliminating the dual-package Database identity wall that is #1053's root cause. ./ui and .astro stay source (the consumer's Astro build must process them). - tsdown: route entrypoints fed via inputOptions.input (literal object, not entry globs -- [param] dirs are glob char-classes). entryFileNames + resolveRoute share one routeArtifactName() so rolldown's reserved [name]/[hash] placeholders cannot mangle dynamic-route artifacts. - A fast static guard (scripts/typecheck-public-source.mjs, wired into CI) fails if any subpath export ships raw .ts/.tsx again. Verified: pnpm build, pnpm typecheck, demos+templates typecheck, demo build (route injection e2e), lint baseline unchanged. * style: format * fix(build): externalize self/optional deps so route entries don't bundle them Compiling the route/admin entries made tsdown try to bundle deps it could not resolve at build time -- 'emdash' (the package importing itself) and '@cloudflare/kumo' (admin-only, not an emdash dep). CI escalates tsdown's bundling advisory to a fatal error. - Externalize 'emdash' (self): compiled routes import it; resolved at the consumer's runtime where the package is installed. - Externalize @aws-sdk/* (optional S3 deps, runtime-only). - Keep the *-admin.tsx providers as source (bridge the admin React + @cloudflare/kumo runtime, like .astro/./ui); revert their exports. - inlineOnly: false -- nothing is unintentionally bundled (all deps external, only our own src is); silences the CI-escalated advisory. Guard's allowlist generalized to RUNTIME_COUPLED (Astro + admin React). * test: route-injection entrypoint now resolves to compiled artifact resolveRoute resolves emdash/routes/* to the compiled dist artifact with routeArtifactName applied ([ ] -> _), so the media catch-all route's entrypoint is api/media/file/_...key_ not [...key].ts. The catch-all pattern assertion (the actual guarantee) is unchanged. --------- Co-authored-by: emdashbot[bot] <emdashbot[bot]@users.noreply.github.com> --------- Co-authored-by: emdashbot[bot] <emdashbot[bot]@users.noreply.github.com>
Catches deployment/suhail-ski up with emdash-cms/emdash main. Conflict in pnpm-lock.yaml resolved by taking upstream's lock and re-running pnpm install to pick up the @suhailski/57th-parallel template deps. Notable upstream changes folded in: - Plugin authoring CLI + manifest format (emdash-cms#1057, emdash-cms#1059) - Registry packages — lexicons, client, CLI (emdash-cms#923) - Migration 036 taxonomy preservation (emdash-cms#1086) - WXR import w/ WPML/Polylang translations (emdash-cms#1087) - TypeScript 6 upgrade, tsgo beta (emdash-cms#1074) - FTS5 corruption fix on publish (emdash-cms#768) - Plugin bundle size caps (emdash-cms#978) - And ~280 smaller fixes / chores CLI rebuilt against the new core. Verified by listing posts on suhail.ski — both tutorial posts come back as expected. 57th-parallel template untouched by upstream. Our 5 local commits preserved across the merge. Used --config.manage-package-manager-versions=false to bypass pnpm's self-switch to 11.1.3, which packages weirdly on Windows. The current shell's pnpm 10.12.4 worked fine against the merged manifests.
What does this PR do?
Upgrades the workspace to TypeScript 6.0.3 (current stable; the catalog was stale at
^5.9.3while root already pinnedtypescript: 6.0.0-beta) and pins thetsgoengine to a fixed beta to stop silent compiler drift. Also fixes the one real failure the upgrade surfaces.pnpm-workspace.yaml: catalogtypescript ^5.9.3 → ^6.0.3.package.json:@typescript/native-previewpinned^7.0.0-dev → 7.0.0-dev.20260421.2(the@betachannel). The floating^7.0.0-devrange meant CI could silently change compilers between runs; verified the pinned beta is not a regressor (isolation-tested against the prior20260213.1).packages/core/src/astro/integration/runtime.ts: the stored integration config was adeclare global { var __emdashConfig: EmDashConfig }. Under TS6/tsgo, when core is loaded as both compileddistand rawsrcin one process (Vite SSR / dual-package),EmDashConfighas two module identities →TS2403. Re-keyed onto aSymbol.for("emdash:stored-config")global registry entry, matching the existing isolate-singleton pattern insettings/index.ts/request-context.ts. PublicgetStoredConfig/setStoredConfigsignatures unchanged. Adversarially reviewed: no behavioral change (the path is dormant —setStoredConfighas no callers, see admin branding config (logo, siteName, favicon) not applied to admin — /_emdash/api/manifest always returns null for admin #835 — and?? null≡|| nullfor an object config).packages/auth/tsconfig.json,packages/create-emdash/tsconfig.json: add explicit"types": ["node"]. The catalog bump forces a lockfile re-resolution; the new pnpm hoisting no longer auto-includes@types/nodefor packages that relied on implicit@types/*inclusion. Both packages already declare@types/node; this just stops depending on hoisting (matches the working sibling@emdash-cms/registry-client). All ofcreate-emdash's apparent logic errors were cascade artifacts of the missing node types and are resolved by this single fix.Verified green under TS6 + pinned beta tsgo:
pnpm typecheck(CI), the demo typecheck (CI),pnpm typecheck:templates(CI — confirms Astro works on TS6), and a cleanemdashbuild (tsdown dts emit).Related context: #1053 (one of its two reported type errors is a TS5.x-only variance that TS6 fixes; the remaining one and a regression-guard harness land in a follow-up PR on top of this).
Type of change
Checklist
pnpm typecheckpassespnpm lintpasses (PR adds 0 diagnostics; pre-existing repo baseline unchanged)pnpm testpasses (or targeted tests for my change) — no tests cover the dormant stored-config path; change is verified by green typecheck + build + adversarial reviewpnpm formathas been runemdashpatch for the dual-load config fixAI-generated code disclosure