Skip to content

Migrate excerpt/feed/headings/icons/images/prism/pwa + iles node type emission from tsc to tsdown dts with default .d.mts outputs#339

Merged
ElMassimo merged 6 commits into
claude/migrate-to-vite-plus-IOxGjfrom
copilot/migrate-away-from-tsc
Mar 27, 2026
Merged

Migrate excerpt/feed/headings/icons/images/prism/pwa + iles node type emission from tsc to tsdown dts with default .d.mts outputs#339
ElMassimo merged 6 commits into
claude/migrate-to-vite-plus-IOxGjfrom
copilot/migrate-away-from-tsc

Conversation

Copilot AI commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Seven packages (excerpt, feed, headings, icons, images, prism, pwa) were still generating declarations via explicit tsc --emitDeclarationOnly calls. This change moves type generation into tsdown (dts: true) and uses tsdown’s default declaration output (.d.mts), updating package metadata/exports accordingly.

  • Build pipeline migration (targeted packages)

    • Enabled declaration generation in each package’s tsdown.config.ts with:
      • dts: true
    • Removed explicit declaration extension overrides so tsdown emits its default .d.mts files.
    • This removes the remaining package-local reliance on tsc for declarations in these modules.
  • Script simplification

    • Updated each affected package build script from:
      • vp pack --clean && tsc --emitDeclarationOnly ...
    • To:
      • vp pack --clean
    • Result: single source of truth for JS + type emission in package builds.
  • Package type/export alignment

    • Updated each affected package types field to point to .d.mts outputs.
    • Updated package exports to include types entries for exported paths (including feed subpath exports), aligning runtime and type resolution.
  • Sub-package dependency cleanup

    • Removed unnecessary typescript devDependencies from migrated packages that no longer run local tsc in their package scripts:
      • @islands/excerpt
      • @islands/headings
      • @islands/images
      • @islands/prism
    • Updated pnpm-lock.yaml accordingly.
  • iles package follow-up migration

    • Replaced packages/iles build:node script:
      • from vp pack --clean && tsc --emitDeclarationOnly ...
      • to vp pack --clean
    • Added a named type re-export in packages/iles/src/node/index.ts:
      • export type { UserConfig } from '../../types/shared'
    • Updated packages/iles/types/index.d.ts to re-export node types from:
      • ../dist/node/index.d.mts
    • This aligns the iles node type surface with tsdown .d.mts outputs while preserving downstream type-check compatibility.
  • Type checking coverage verification

    • Confirmed type checking is still executed in CI/workflow-equivalent commands:
      • build:client runs vue-tsc --noEmit -p src/client && tsc -p src/client
      • pipeline also runs pnpm blog:check and pnpm docs:check (vue-tsc --noEmit).
  • Type output consistency guard

    • Added a focused test (packages/iles/tests/package-types.spec.ts) that builds the migrated packages and asserts:
      • expected .d.mts files are present per package
      • .d.ts files are not produced for these packages

Example of the config pattern applied:

export default defineConfig({
  entry: ['src/pwa.ts'],
  target: 'node20',
  dts: true,
})

> [!WARNING]
>
>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Mar 27, 2026

Copy link
Copy Markdown

Deploying iles with  Cloudflare Pages  Cloudflare Pages

Latest commit: 93b62a3
Status: ✅  Deploy successful!
Preview URL: https://8f656b48.iles.pages.dev
Branch Preview URL: https://copilot-migrate-away-from-ts.iles.pages.dev

View logs

Copilot AI changed the title [WIP] Migrate packages to use dts: true in tsdown Migrate excerpt/feed/headings/icons/images/prism/pwa type emission from tsc to tsdown dts Mar 27, 2026
Copilot AI requested a review from ElMassimo March 27, 2026 01:33
@ElMassimo

Copy link
Copy Markdown
Owner

@copilot Use the default .d.mts output instead, and update the package exports.

Copilot AI commented Mar 27, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Use the default .d.mts output instead, and update the package exports.

Updated in commit 54433ab. Removed the .d.ts override so these packages use default .d.mts outputs, and updated package types plus exports to include types mappings (including feed subpath exports).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cloud.nx.app
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./node_modules/.bin/../nx/bin/nx.js run-many --target=build --projects=@islands/excerpt,@islands/feed,@islands/headings,@islands/icons,@islands/images,@islands/prism,@islands/pwa (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./node_modules/.bin/../nx/bin/nx.js run-many --target=build --projects @islands/excerpt,@islands/feed,@islands/headings,@islands/icons,@islands/images,@islands/prism,@islands/pwa --global de/node/bin/node user.email ages/mdx (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Migrate excerpt/feed/headings/icons/images/prism/pwa type emission from tsc to tsdown dts Migrate excerpt/feed/headings/icons/images/prism/pwa type emission from tsc to tsdown dts with default .d.mts outputs Mar 27, 2026
@ElMassimo
ElMassimo marked this pull request as ready for review March 27, 2026 10:52
@nx-cloud

nx-cloud Bot commented Mar 27, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 93b62a3

Command Status Duration Result
nx run-many --target=build --projects @islands/... ✅ Succeeded <1s View ↗
nx run-many --target=build --all --exclude docs... ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-27 14:22:46 UTC

@ElMassimo

Copy link
Copy Markdown
Owner

@copilot remove the typescript dev dependency from sub packages that don't need it.

Copilot AI commented Mar 27, 2026

Copy link
Copy Markdown
Contributor Author

@copilot remove the typescript dev dependency from sub packages that don't need it.

Done in 65383c0. Removed unnecessary typescript devDependencies from @islands/excerpt, @islands/headings, @islands/images, and @islands/prism.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cloud.nx.app
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./node_modules/.bin/../nx/bin/nx.js run-many --target=build --projects=@islands/excerpt,@islands/headings,@islands/images,@islands/prism (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./node_modules/.bin/../nx/bin/nx.js run-many --target=build --projects @islands/excerpt,@islands/feed,@islands/headings,@islands/icons,@islands/images,@islands/prism,@islands/pwa --global _modules/.pnpm/nx@19.8.4/node_modules/.bin/sh copilot.originalrm (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@ElMassimo

Copy link
Copy Markdown
Owner

@copilot attempt to replace tsc in build:node with dts in rolldown, and update exports according to the d.mts output. Verify that type checking is run in the CI for all projects (if vp pack is not already doing type checking).

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/7b458719-9ff3-40f8-87ff-ff350f0729f2

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

Copilot AI commented Mar 27, 2026

Copy link
Copy Markdown
Contributor Author

@copilot attempt to replace tsc in build:node with dts in rolldown, and update exports according to the d.mts output. Verify that type checking is run in the CI for all projects (if vp pack is n...

Done in 5452cb1. packages/iles now uses tsdown-only type emission in build:node (vp pack --clean), and type exports were aligned with .d.mts by re-exporting node types from dist/node/index.d.mts plus exporting UserConfig from the node entry. I also verified type-check coverage in CI/workflow-equivalent commands: build:client runs vue-tsc --noEmit -p src/client && tsc -p src/client, and the pipeline also runs pnpm blog:check + pnpm docs:check (both vue-tsc --noEmit).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cloud.nx.app
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./node_modules/.bin/../nx/bin/nx.js run-many --target=build --all --exclude docs --exclude vue-blog (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./node_modules/.bin/../nx/bin/nx.js run-many --target=build --projects @islands/excerpt,@islands/feed,@islands/headings,@islands/icons,@islands/images,@islands/prism,@islands/pwa --local k/iles/iles/node_modules/.bin/sh committer.name ts|dist/node/ind-rf t.js git conf�� ages/mdx/dist _modules/.cache/nx/43d8bad9b1e0d51f3ed27fa260971b1af156b0abb934ef57ec2615276450005b/outputs/pack-c /usr/lib/git-core/git (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./node_modules/.bin/../nx/bin/nx.js run iles:build _mod�� nx/43d8bad9b1e0d51f3ed27fa260971b1af156b0abb934ef57ec2615276450005b/outputs/packages/mdx/dist /home/REDACTED/work/iles/iles/node_modules/.cache/nx/73d695e24ce24060c9750c3a52bfc5204ad77fa7be5a3-c ages/pwa/node_modules/.bin/sh t (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Migrate excerpt/feed/headings/icons/images/prism/pwa type emission from tsc to tsdown dts with default .d.mts outputs Migrate excerpt/feed/headings/icons/images/prism/pwa + iles node type emission from tsc to tsdown dts with default .d.mts outputs Mar 27, 2026
….mjs` (#340)

* Initial plan

* chore: enable type-aware linting in tsdown configs

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/8d2d6c99-a9d1-4c3a-aadf-fe6c70c7d37c

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

* chore: add root lint script using nx run-many

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/e4ed89d0-8715-4493-8e4d-e08a6123d9a2

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

* chore: fix lint issue

* fix: remove tsdown.config.ts, use `vite.config.ts` instead

`typeAware` and `typeCheck` should be in `lint.options`, not `lint`.

* fix: linting, avoid using tsdown.config.ts, use vite.config.ts instead

* chore: remove unused vite config

* fix: load package lint configs as mjs in CI

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/031c0250-2bd3-434c-a3ae-9a8c59646e62

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>
Co-authored-by: Maximo Mussini <maximomussini@gmail.com>
@ElMassimo
ElMassimo merged commit e28d77f into claude/migrate-to-vite-plus-IOxGj Mar 27, 2026
6 checks passed
@ElMassimo
ElMassimo deleted the copilot/migrate-away-from-tsc branch March 27, 2026 14:22
ElMassimo added a commit that referenced this pull request Mar 27, 2026
…-plus (#335)

* Migrate project to Vite+ unified toolchain

- Replace vite imports with vite-plus across 20 source files
- Replace vitest imports with vite-plus/test across 12 test files
- Add vite-plus as dependency, remove standalone vite/vitest deps
- Remove Nx task orchestration (nx.json, @nrwl/* deps)
- Remove ESLint and related plugins, migrate to oxlint via @oxlint/migrate
- Create root vite.config.ts for Vite+ configuration
- Create .oxlintrc.json with migrated lint rules
- Update root scripts: lint/fmt/check now use vp commands
- Update per-package lint scripts to use vp lint
- Update iles CLI test command to use vp test
- Fix type-only import in shared.d.ts for oxfmt compatibility
- Apply oxfmt formatting across entire codebase
- Retain tsup for package builds (vp pack incompatible with
  workspace type resolution for DTS generation)

https://claude.ai/code/session_01Fsp32NvHiLU7Y141BfEsit

* chore: update local claude settings

https://claude.ai/code/session_01Fsp32NvHiLU7Y141BfEsit

* Replace tsup with vp pack, restore Nx, make packages ESM-only

- Replace tsup with `vp pack` for all 12 packages
- Restore nx.json for build orchestration with cloud caching
- Remove CJS builds and exports (ESM-only)
- Update package exports from .js/.d.ts to .mjs/.d.mts
- Remove all tsup.config.ts files (13 files)
- Add tsc --emitDeclarationOnly for DTS generation where rolldown
  DTS plugin cannot handle postcss type syntax
- Update bin/iles.js and config.js to reference .mjs output

https://claude.ai/code/session_01Fsp32NvHiLU7Y141BfEsit

* Configure formatter to omit semicolons

Add .oxfmtrc.json with semi: false and reformat all source files.

https://claude.ai/code/session_01Fsp32NvHiLU7Y141BfEsit

* Configure formatter to use single quotes

https://claude.ai/code/session_01Fsp32NvHiLU7Y141BfEsit

* Revert formatting changes to keep PR focused on migration

Reverts the semicolon removal and single-quote formatting commits.
The .oxfmtrc.json config is preserved for future application.

https://claude.ai/code/session_01Fsp32NvHiLU7Y141BfEsit

* Revert all formatting-only changes from PR

Restore original formatting for files that only had oxfmt
reformatting (semicolons, quotes, whitespace) without any
migration-related changes. Keeps only files with actual
vite-plus migration work.

https://claude.ai/code/session_01Fsp32NvHiLU7Y141BfEsit

* fix: build `hydration` as a browser library

* fix: externalize framework deps in hydration and prerender packages

The vp pack migration bundled framework dependencies (preact, vue, svelte,
solid-js) into the hydration and prerender outputs, causing duplicate
instances at runtime. For preact, this meant hooks state (__H) lived on
the wrong instance, breaking component mounting.

Add peerDependencies so vp pack's DepPlugin externalizes them, and add
per-package vite.config.ts files with deps configuration. Also fix the
headings package build by disabling auto-DTS in vp pack (it uses tsc
separately) and configuring deps.onlyBundle for slugo.

https://claude.ai/code/session_01UKpPTEVDMf22aaUSsUhrfD

* chore: add svelte.md for claude

* fix: add browser resolve condition to prevent Svelte server module loading

When vite-plugin-solid sets resolve.conditions to ['solid', 'development'],
it replaces Vite's defaults (module, browser). The Svelte plugin then appends
'svelte' but 'browser' is missing, causing Svelte's export map to resolve to
index-server.js instead of the browser bundle. This resulted in mount() being
unavailable at runtime.

Setting conditions explicitly in iles's Vite config defaults ensures browser
is always present regardless of framework plugin ordering.

https://claude.ai/code/session_01YNwMyHwufBk4A4mLukiHom

* Update Svelte to 5.46.4 and add module resolution conditions (#337)

* fix: prevent client:none islands from hydrating in dev mode

The Island component's `client:none` strategy only skipped hydration
during SSR but not in the browser. In dev mode (SPA), this caused a
script to be generated that imported `mount` from svelte's server entry,
triggering the "mount(...) is not available on the server" error.

Also bumps svelte from ^5.1.13 to ^5.46.4 in hydration and prerender
packages to satisfy @sveltejs/vite-plugin-svelte@7's peer dependency.

https://claude.ai/code/session_01DyKgnqFPLT1z1z4ewaEtMT

* fix: add default resolve conditions to prevent server-side Svelte resolution

The `vite-plugin-solid` config hook sets `resolve.conditions` to
`['solid', 'development']`, replacing Vite's defaults which include
`browser` and `module`. Without `browser`, Svelte's package exports
resolve to `index-server.js` instead of `index-client.js`, causing
`mount(...)` to throw "not available on the server" in the browser.

Add `['module', 'browser', 'development']` to the base Vite config so
framework plugins append to these defaults rather than replacing them.

https://claude.ai/code/session_01DyKgnqFPLT1z1z4ewaEtMT

* chore: revert changes and update solid plugin instead

---------

Co-authored-by: Claude <noreply@anthropic.com>

* chore: avoid importing vite-plus when we intend vite

* chore: fix lint issues

* Move package `vp pack` CLI flags into per-package `tsdown.config.ts` and add `pnpm pkg-size` utility (#338)

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Maximo Mussini <maximomussini@gmail.com>

* Migrate excerpt/feed/headings/icons/images/prism/pwa + iles node type emission from `tsc` to tsdown `dts` with default `.d.mts` outputs (#339)

* Initial plan

* refactor: migrate package type generation from tsc to tsdown dts

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/fa271805-854d-48e3-92f6-dc936a87f21c

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

* refactor: use default d.mts type outputs and export type entries

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/09a276ea-1d81-4b51-8159-b5da49e6a427

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

* chore: remove unnecessary typescript devDependencies

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/7bdca0c4-6073-4609-a3fe-266b33931b5a

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

* refactor: use tsdown dts for iles build:node

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/7b458719-9ff3-40f8-87ff-ff350f0729f2

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

* Fix CI lint config loading by switching package Vite configs to ESM `.mjs` (#340)

* Initial plan

* chore: enable type-aware linting in tsdown configs

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/8d2d6c99-a9d1-4c3a-aadf-fe6c70c7d37c

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

* chore: add root lint script using nx run-many

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/e4ed89d0-8715-4493-8e4d-e08a6123d9a2

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

* chore: fix lint issue

* fix: remove tsdown.config.ts, use `vite.config.ts` instead

`typeAware` and `typeCheck` should be in `lint.options`, not `lint`.

* fix: linting, avoid using tsdown.config.ts, use vite.config.ts instead

* chore: remove unused vite config

* fix: load package lint configs as mjs in CI

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/031c0250-2bd3-434c-a3ae-9a8c59646e62

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>
Co-authored-by: Maximo Mussini <maximomussini@gmail.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>
Co-authored-by: Maximo Mussini <maximomussini@gmail.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>
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.

2 participants