From 7d89d33d06315bcdd57d6a1ca3e6bfe37967a64d Mon Sep 17 00:00:00 2001 From: YLfjuk Date: Mon, 16 Nov 2026 12:45:13 +0200 Subject: [PATCH 1/4] fix(types): publish declarations without compiler peer --- .changeset/core17-declarations.md | 5 +++++ packages/types/README.md | 2 +- packages/types/package.json | 11 ++++------- pnpm-lock.yaml | 6 +----- 4 files changed, 11 insertions(+), 13 deletions(-) create mode 100644 .changeset/core17-declarations.md diff --git a/.changeset/core17-declarations.md b/.changeset/core17-declarations.md new file mode 100644 index 0000000..32e72b7 --- /dev/null +++ b/.changeset/core17-declarations.md @@ -0,0 +1,5 @@ +--- +"@ylfjuk-core/types": patch +--- + +Publish generated `.d.ts` files instead of TypeScript source and remove the TypeScript peer dependency. Type exports are unchanged; consumers still need a compiler that supports the declaration syntax they use. The development source export remains available in the repository. diff --git a/packages/types/README.md b/packages/types/README.md index 8fd9f63..599a4ef 100644 --- a/packages/types/README.md +++ b/packages/types/README.md @@ -8,7 +8,7 @@ TypeScript utility types used by [`@ylfjuk/core`](../core/README.md). pnpm add @ylfjuk-core/types ``` -The package is type-only, uses ESM package metadata, and requires TypeScript 7. +The package is type-only, uses ESM package metadata, and publishes declaration files without a TypeScript peer dependency. ```ts import type { Result } from "@ylfjuk-core/types"; diff --git a/packages/types/package.json b/packages/types/package.json index af33bec..1bd8926 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -14,23 +14,20 @@ "directory": "packages/types" }, "files": [ - "src" + "dist" ], "type": "module", "sideEffects": false, - "types": "./src/index.ts", + "types": "./dist/index.d.ts", "exports": { ".": { "@ylfjuk-core/dev.src": "./src/index.ts", - "types": "./src/index.ts" + "types": "./dist/index.d.ts" } }, "scripts": { - "build": "pnpm run test && pnpm run test:types && publint && attw --pack --profile esm-only", + "build": "pnpm run test && pnpm run test:types && tsc --emitDeclarationOnly --outDir dist --rootDir src && publint && attw --pack --profile esm-only", "test": "vitest run --typecheck", "test:types": "tsc -p tsconfig.test.json" - }, - "peerDependencies": { - "typescript": "^7.0.2" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0de737c..8306b15 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -63,11 +63,7 @@ importers: specifier: workspace:* version: link:../utils - packages/types: - dependencies: - typescript: - specifier: ^7.0.2 - version: 7.0.2 + packages/types: {} packages/utils: dependencies: From 241e2b992193260635a52e2f747b30192f61eebc Mon Sep 17 00:00:00 2001 From: YLfjuk Date: Mon, 16 Nov 2026 18:57:28 +0200 Subject: [PATCH 2/4] build(types): emit declarations with tsdown --- packages/types/README.md | 2 +- packages/types/package.json | 2 +- packages/types/tsdown.config.ts | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 packages/types/tsdown.config.ts diff --git a/packages/types/README.md b/packages/types/README.md index 599a4ef..4ec2426 100644 --- a/packages/types/README.md +++ b/packages/types/README.md @@ -8,7 +8,7 @@ TypeScript utility types used by [`@ylfjuk/core`](../core/README.md). pnpm add @ylfjuk-core/types ``` -The package is type-only, uses ESM package metadata, and publishes declaration files without a TypeScript peer dependency. +This package is type-only. ```ts import type { Result } from "@ylfjuk-core/types"; diff --git a/packages/types/package.json b/packages/types/package.json index 1bd8926..f804d33 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -26,7 +26,7 @@ } }, "scripts": { - "build": "pnpm run test && pnpm run test:types && tsc --emitDeclarationOnly --outDir dist --rootDir src && publint && attw --pack --profile esm-only", + "build": "pnpm run test && pnpm run test:types && tsdown", "test": "vitest run --typecheck", "test:types": "tsc -p tsconfig.test.json" } diff --git a/packages/types/tsdown.config.ts b/packages/types/tsdown.config.ts new file mode 100644 index 0000000..f8ccf11 --- /dev/null +++ b/packages/types/tsdown.config.ts @@ -0,0 +1,13 @@ +import { defineConfig } from "tsdown"; + +export default defineConfig({ + attw: { + profile: "esm-only", + }, + dts: { + emitDtsOnly: true, + }, + entry: ["src/index.ts"], + fixedExtension: false, + publint: true, +}); From 78292a0575deae4a6f8d5cbd375a4102cfbd8857 Mon Sep 17 00:00:00 2001 From: YLfjuk Date: Mon, 16 Nov 2026 19:21:25 +0200 Subject: [PATCH 3/4] build: declare type package dependencies in Turbo --- packages/types/package.json | 2 +- turbo.json | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/types/package.json b/packages/types/package.json index f804d33..e10d7fe 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -26,7 +26,7 @@ } }, "scripts": { - "build": "pnpm run test && pnpm run test:types && tsdown", + "build": "tsdown", "test": "vitest run --typecheck", "test:types": "tsc -p tsconfig.test.json" } diff --git a/turbo.json b/turbo.json index a20982e..3d031c1 100644 --- a/turbo.json +++ b/turbo.json @@ -19,6 +19,10 @@ }, "lint": { "dependsOn": ["^lint"] + }, + "@ylfjuk-core/types#build": { + "dependsOn": ["test", "test:types", "^build"], + "outputs": ["dist/**"] } } } From d3194767c43e5579731ddb79a560cf564f4eb6d8 Mon Sep 17 00:00:00 2001 From: YLfjuk Date: Mon, 16 Nov 2026 19:31:00 +0200 Subject: [PATCH 4/4] build(types): scope Turbo dependencies to package --- packages/types/turbo.json | 8 ++++++++ turbo.json | 4 ---- 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 packages/types/turbo.json diff --git a/packages/types/turbo.json b/packages/types/turbo.json new file mode 100644 index 0000000..825c427 --- /dev/null +++ b/packages/types/turbo.json @@ -0,0 +1,8 @@ +{ + "extends": ["//"], + "tasks": { + "build": { + "dependsOn": ["test", "test:types", "^build"] + } + } +} diff --git a/turbo.json b/turbo.json index 3d031c1..a20982e 100644 --- a/turbo.json +++ b/turbo.json @@ -19,10 +19,6 @@ }, "lint": { "dependsOn": ["^lint"] - }, - "@ylfjuk-core/types#build": { - "dependsOn": ["test", "test:types", "^build"], - "outputs": ["dist/**"] } } }