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..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 requires TypeScript 7. +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 af33bec..e10d7fe 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": "tsdown", "test": "vitest run --typecheck", "test:types": "tsc -p tsconfig.test.json" - }, - "peerDependencies": { - "typescript": "^7.0.2" } } 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, +}); 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/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: