/tsed:tsed-migrationfrom Ts.ED
Migrates Ts.ED applications from v7 to v8, with guidance for v6 and plain Express apps. Covers ESM switch, useDefineForClassFields, deprecated DI APIs, and Jest to Vitest migration.
Ships in Ts.ED. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Migrate in small, verifiable steps. v7 already supports ESM, useDefineForClassFields: false and settings.get(), so do all preparation on v7, verify, and only then bump to v8.
References, loaded on demand:
Live guide: https://tsed.dev/introduction/migrate-from-v7.md and https://tsed.dev/introduction/what-is-news-v8.md.
package.json: the @tsed/* major, the type field, the test runner, the dev runner (ts-node, ts-node-dev, tsx, SWC), barrelsby.tsconfig.json, .swcrc, vite.config.ts / vitest.config.ts, jest.config.*.| Starting point | Path |
|---|---|
| v7 | Sections 2 to 7 |
| v6 | First reach the latest v7 with https://tsed.dev/introduction/migrate-from-v6.md, verify, then sections 2 to 7 |
| v5 or older | Do not upgrade in place. Scaffold a v8 project with the tsed-cli skill and port code feature by feature |
| Plain Express app | Section 8 |
Do not bump @tsed/* to 8.x before sections 2 to 4 pass on v7.
@tsed/* package to the latest 7.x.useDefineForClassFields: false in every transpiler configuration that exists:
tsconfig.json → compilerOptions.useDefineForClassFields.swcrc and SWC options in vite.config.ts / vitest.config.ts → jsc.transform.useDefineForClassFieldslegacyDecorator: true and decoratorMetadata: true (SWC), experimentalDecorators and emitDecoratorMetadata (tsc).import {Configuration, Injectable} from "@tsed/di";
@Injectable()
export class MyService {
constructor(@Configuration() private settings: Configuration) {
settings.get<string>("myOption"); // v7 and v8
// settings.myOption // v7 only, undefined in v8
}
}
settings., configuration. and this.settings. followed by a custom key. Built-in accessors (rootDir, env, imports, routes, mount, logger, debug, version) keep working; anything else must use .get("key"), constant("key") or @Constant("key").package.json: set "type": "module".tsconfig.json: "module": "NodeNext", "moduleResolution": "NodeNext", "target": "esnext"..js to every relative import and export, and /index.js to directory imports:import {ProductsService} from "./services/ProductsService.js";
import * as rest from "./controllers/rest/index.js";
lodash/get → lodash/get.js) and named imports from CommonJS-only packages (import fs from "fs-extra").__dirname / __filename with import.meta.dirname / import.meta.filename, and require() with import.import config from "./config.json" with {type: "json"}, or read the file with node:fs.barrelsby with @tsed/barrels (binary barrels, configuration .barrels.json); the barrelsby configuration format is accepted.ts-node / ts-node-dev with SWC: install @swc-node/register @swc/core @swc/helpers, run with node --import @swc-node/register/esm-register src/index.ts, and add nodemon for watch mode. Details: https://tsed.dev/introduction/migrate-from-v7.md.Do not mix require and import to work around a failing import; fix the import form.
npx tsc --noEmit
grep -rnE "from \"\.{1,2}/[^\"]*\"" src | grep -vE "\.(js|json)\"" # must print nothing
npm test
npm start # boot, hit one route, stop
Stop and fix before continuing. A failure here is not a v8 problem.
@tsed/* runtime package to the same 8.x version. Do not align @tsed/logger*, @tsed/barrels or @tsed/cli*; they are versioned separately.@tsed/common 8.x still exists as a compatibility barrel, so the application should start before step 6.import "@tsed/platform-log-request"; in Server.ts and set logger: {logRequest: true}. PlatformLogMiddleware from @tsed/platform-log-middleware is deprecated.import "@tsed/engines/PugEngine.js";.Configurable, Enumerable, Writable and the @tsed/core versions of ReadOnly and Deprecated are removed.@tsed/hooks ($on, $asyncEmit, $alter, $asyncAlter).@tsed/commongrep -rn "@tsed/common" src test.// before: import {BodyParams, Controller, Post, Req, UseBefore, PlatformTest} from "@tsed/common";
import {Controller} from "@tsed/di";
import {Req} from "@tsed/platform-http";
import {UseBefore} from "@tsed/platform-middlewares";
import {BodyParams} from "@tsed/platform-params";
import {Post} from "@tsed/schema";
// tests only
import {PlatformTest} from "@tsed/platform-http/testing";
dependencies, then remove @tsed/common.@tsed/common imported @tsed/logger-file as a side effect. If file appenders are used, add import "@tsed/logger-file"; explicitly.tsed-di skill.Do not import PlatformTest from @tsed/platform-http in application code; it lives in @tsed/platform-http/testing.
Jest is unstable with ESM. Migrate when the suite fails after section 3.
vitest unplugin-swc @swc/core @vitest/coverage-v8; create vitest.config.ts from https://tsed.dev/tutorials/vitest.md (SWC plugin with useDefineForClassFields: false).jest.fn, jest.spyOn, jest.mock with vi.fn, vi.spyOn, vi.mock (import vi from vitest unless globals: true).PlatformTest.inject([...], fn) with PlatformTest.invoke(Token) or PlatformTest.get(Token).tsed-testing skill for test structure and the tsed-cli skill to add @tsed/cli-plugin-vitest.src/legacy/ and make sure src/index.ts does not exist.package.json with the tsed-cli skill (tsed init ., platform express); rename conflicting scripts first.express.Router() and mount it in @Configuration: middlewares: [{use: expressRouter, hook: "$beforeRoutesInit"}], so existing routes keep working.inject(MyService) from @tsed/di.tsed-controllers, tsed-middlewares). Guide: https://tsed.dev/introduction/migrate-from-express.md.undefined in constructors or at runtime: useDefineForClassFields is still true in one of tsconfig.json, .swcrc, vite.config.ts, vitest.config.ts.ERR_MODULE_NOT_FOUND on a relative path: missing .js extension or a directory import without /index.js.ERR_REQUIRE_ESM: a CommonJS entry point or loader (ts-node, --require) is still in use. Use --import.Module '"@tsed/common"' has no exported member 'Returns' (or Property, Required): in v8 the barrel re-exports only the routing decorators of @tsed/schema. Import from @tsed/schema.@tsed/platform-log-request is not imported.import ... from "./config.json.js" assert {type: "json"} and @swc-node/register/register-esm. Use ./config.json with with {type: "json"} and @swc-node/register/esm-register.barrels is not run before start. Keep "barrels": "barrels" in the start script chain."type": "module", NodeNext, .js extensions everywhere, no require, no __dirname.useDefineForClassFields: false in every transpiler configuration.settings.<key>.@tsed/* runtime packages on the same 8.x version; @tsed/common removed and no import of it left.@tsed/platform-log-request and view engines imported explicitly where needed.npx tsc --noEmit, the test suite and a manual boot all pass.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub tsedio/tsed --plugin tsed13 skills in this plugin
/tsed-cliScaffolds Ts.ED v8 projects and generates files with the Ts.ED CLI v7, through its MCP server (tools set-workspace, init-project, list-templates, get-template, generate-file) or the tsed binary (tsed init, generate, template, add, run, update, dev, build). Use when creating a Ts.ED project, adding a controller, service, middleware, model, interceptor, pipe, decorator or custom template, when package.json has a "tsed" key or @tsed/cli, when a .templates/ directory exists, or on errors E_CWD_NOT_SET, E_PROJECT_NOT_INITIALIZED, E_TEMPLATE_UNKNOWN, E_ARGS_INVALID./tsed-configurationConfigure and bootstrap a Ts.ED v8 server - the @Configuration decorator or configuration() on the Server class, PlatformExpress/PlatformKoa/PlatformFastify.bootstrap, server options (mount, middlewares, httpPort, httpsPort, acceptMimes, logger, statics, views, responseFilters, imports), per-platform express/koa/fastify options, and @tsed/config sources (envs, dotenv, json, yaml). Use when editing Server.ts, index.ts or src/config, adding @tsed/config or the extends option, or reading settings with constant(), refValue(), @Constant, @Value or configuration().get()./tsed-controllersWrite Ts.ED v8 HTTP controllers and routes - @Controller paths and nested children, mounting through the `mount` configuration, verb decorators from @tsed/schema, parameter decorators from @tsed/platform-params, typed inputs, response decorators and custom endpoint decorators. Use when adding or fixing a REST endpoint, when a route returns 404 or is shadowed by another route, when @BodyParams/@QueryParams/@PathParams receive a plain object or the wrong type, or when working with @Returns, @Status, @Redirect, @View, @Hidden, @Req/@Res or useDecorators./tsed-diDeclare, inject and scope Ts.ED v8 providers and wire lifecycle hooks - @Injectable, @Module, @Controller, @Inject, the functional API (inject, injectMany, lazyInject, constant, refValue, injectable().factory/asyncFactory/class/value, injector, context, logger), ProviderScope, custom tokens, @tsed/hooks ($on, $emit, $asyncEmit, $alter) and request context. Use when writing services or modules with @tsed/di, fixing InjectionError, "Given token is undefined" or undefined injected properties, choosing a scope, adding $onInit/$onDestroy/$onReady, or replacing registerProvider and other deprecated DI APIs./tsed-docsLocates authoritative Ts.ED v8 documentation and API reference instead of guessing framework APIs. Routes a topic to the right tsed.dev page, its markdown twin, the llms.txt indexes (tsed.dev, cli.tsed.dev, logger.tsed.dev) and the sibling tsed-* skills. Use when working in a project that depends on @tsed/* packages and an import path, decorator (@Controller, @Injectable, @Returns), function (inject, injectable, configuration), option name or error message is uncertain, when an example imports from @tsed/common, or before answering any "how do I ... in Ts.ED" question./tsed-exceptionsHandle errors and shape responses in a Ts.ED v8 application with @tsed/exceptions, exception filters from @tsed/platform-exceptions and response filters from @tsed/platform-response-filter. Use when throwing BadRequest/NotFound/Unauthorized or a custom exception, customizing the JSON error payload, writing a @Catch filter, customizing the 404 ResourceNotFound page, wrapping all responses in an envelope with @ResponseFilter, documenting errors with @Returns(404, NotFound), or debugging responses such as "InternalServerError", AJV_VALIDATION_ERROR or a response filter that is never called.Other plugins' skills for the same job