镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Commit 44af1e2

Browse files
chrisbbreuerclaude
andcommitted
feat: publish the SDK as @dtsx/dtsx
Renames @stacksjs/dtsx to @dtsx/dtsx, in the dtsx npm org next to @dtsx/vite-plugin. Every plugin depends on @dtsx/dtsx; the API, the dtsx CLI, the config and all subpath exports are unchanged. READMEs, the install guide and MIGRATION.md explain the move from @stacksjs/dtsx. Tests pin the new name, the plugin dependencies, and that the former name only appears in migration notes; the docs matcher now also checks subpath imports and require() calls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent ca1e003 commit 44af1e2

66 files changed

Lines changed: 241 additions & 174 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
tar -czf "../dtsx/bin/zig-dtsx-lib-${plat}.tar.gz" -C "zig-out/${lib_dir}" "${lib_file}"
9292
mkdir -p "prebuilt/${plat}"
9393
cp "zig-out/${lib_dir}/${lib_file}" "prebuilt/${plat}/"
94-
# @stacksjs/dtsx ships the native engine for every platform; the SDK
94+
# @dtsx/dtsx ships the native engine for every platform; the SDK
9595
# loads native/<platform>/ in-process and falls back to its
9696
# TypeScript engine where none applies.
9797
mkdir -p "../dtsx/native/${plat}"

‎README.md‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p align="center"><img src="https://github.com/stacksjs/dtsx/blob/main/.github/art/cover.jpg?raw=true" alt="Social Card of this repo"></p>
22

3-
[![npm version](https://img.shields.io/npm/v/@stacksjs/dtsx?style=flat-square)](https://npmjs.com/package/@stacksjs/dtsx)
3+
[![npm version](https://img.shields.io/npm/v/@dtsx/dtsx?style=flat-square)](https://npmjs.com/package/@dtsx/dtsx)
44
[![GitHub Actions](https://img.shields.io/github/actions/workflow/status/stacksjs/dtsx/ci.yml?style=flat-square&branch=main)](https://github.com/stacksjs/dtsx/actions?query=workflow%3Aci)
55
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
66
<!-- [![npm downloads][npm-downloads-src]][npm-downloads-href] -->
@@ -29,9 +29,12 @@
2929
## Install
3030

3131
```bash
32-
bun install -d @stacksjs/dtsx
32+
bun install -d @dtsx/dtsx
3333
```
3434

35+
> [!NOTE]
36+
> dtsx was published as `@stacksjs/dtsx` up to v0.11.36. Install `@dtsx/dtsx` instead and change imports from `@stacksjs/dtsx` to `@dtsx/dtsx`; the API, CLI and config are unchanged. See [Migrating from @stacksjs/dtsx](https://github.com/stacksjs/dtsx/blob/main/docs/MIGRATION.md#from-stacksjsdtsx).
37+
3538
> _@npmjs.com, please allow us to use the `dtsx` package name 🙏_
3639
3740
<!-- _Alternatively, you can install:_
@@ -48,8 +51,8 @@ There are two ways to use dtsx: _as a library or as a CLI._ Both work out of the
4851
### Library
4952

5053
```ts
51-
import type { DtsGenerationOptions } from '@stacksjs/dtsx'
52-
import { generate, processSource } from '@stacksjs/dtsx'
54+
import type { DtsGenerationOptions } from '@dtsx/dtsx'
55+
import { generate, processSource } from '@dtsx/dtsx'
5356

5457
const options: DtsGenerationOptions = {
5558
cwd: './', // default: process.cwd()
@@ -474,7 +477,7 @@ _A whole directory of generated modules. dtsx and tsc use multiple threads; the
474477

475478
### JavaScript SDK
476479

477-
_The `@stacksjs/dtsx` SDK, which powers the bundler and build-tool plugins, called in-process like any other JavaScript SDK. It ships the native engine for each platform and runs it in-process through Bun FFI, falling back to its TypeScript engine where no native library applies._
480+
_The `@dtsx/dtsx` SDK, which powers the bundler and build-tool plugins, called in-process like any other JavaScript SDK. It ships the native engine for each platform and runs it in-process through Bun FFI, falling back to its TypeScript engine where no native library applies._
478481

479482
#### JS SDK: in-process, no cache
480483

‎benchmark/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ const inputs: Input[] = [
104104
// The SDK emits through its in-process native engine; timing its TypeScript
105105
// fallback instead would misreport what users of a supported platform run.
106106
if (!nativeEngineAvailable())
107-
throw new Error('The @stacksjs/dtsx native engine did not load; build packages/zig-dtsx (zig build lib) first')
107+
throw new Error('The @dtsx/dtsx native engine did not load; build packages/zig-dtsx (zig build lib) first')
108108

109109
function dtsxNoCache(source: string, filename: string): string {
110110
clearResultCache()

‎benchmark/render.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ ${project}
150150
151151
${h2} JavaScript SDK
152152
153-
_The \`@stacksjs/dtsx\` SDK, which powers the bundler and build-tool plugins, called in-process like any other JavaScript SDK. It ships the native engine for each platform and runs it in-process through Bun FFI, falling back to its TypeScript engine where no native library applies._
153+
_The \`@dtsx/dtsx\` SDK, which powers the bundler and build-tool plugins, called in-process like any other JavaScript SDK. It ships the native engine for each platform and runs it in-process through Bun FFI, falling back to its TypeScript engine where no native library applies._
154154
155155
${h3} JS SDK: in-process, no cache
156156

‎benchmark/tools.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export function machineInfo(): MachineInfo {
106106
arch: arch(),
107107
bun: Bun.version,
108108
versions: {
109-
'dtsx': pkgVersion('@stacksjs/dtsx'),
109+
'dtsx': pkgVersion('@dtsx/dtsx'),
110110
'zig': zig || 'unknown',
111111
'oxc-transform': pkgVersion('oxc-transform'),
112112
'typescript': pkgVersion('typescript'),

‎bun.lock‎

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/ARCHITECTURE.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ dtsx is designed as a modular, pipeline-based system that processes TypeScript s
3434
The main entry point that orchestrates the entire generation process.
3535

3636
```typescript
37-
import { generate } from '@stacksjs/dtsx'
37+
import { generate } from '@dtsx/dtsx'
3838

3939
await generate({
4040
cwd: process.cwd(),
@@ -114,7 +114,7 @@ Applies transformations to declarations.
114114
- `removeUnusedImports` - Dead code elimination
115115
116116
```typescript
117-
import { createTransformerPipeline } from '@stacksjs/dtsx'
117+
import { createTransformerPipeline } from '@dtsx/dtsx'
118118

119119
const pipeline = createTransformerPipeline([
120120
removePrivateMembers(),
@@ -233,7 +233,7 @@ Memory optimization utilities.
233233
Worker thread parallelization.
234234

235235
```typescript
236-
import { WorkerPool, parallelProcess } from '@stacksjs/dtsx'
236+
import { WorkerPool, parallelProcess } from '@dtsx/dtsx'
237237

238238
const pool = new WorkerPool({ maxWorkers: 4 })
239239
await pool.init()

‎docs/MIGRATION.md‎

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This guide helps you migrate from other TypeScript declaration generation tools
44

55
## Table of Contents
66

7+
- [From @stacksjs/dtsx](#from-stacksjsdtsx)
78
- [From tsc --declaration](#from-tsc---declaration)
89
- [From dts-bundle-generator](#from-dts-bundle-generator)
910
- [From api-extractor](#from-api-extractor)
@@ -12,6 +13,30 @@ This guide helps you migrate from other TypeScript declaration generation tools
1213
- [Common Migration Tasks](#common-migration-tasks)
1314
- [Feature Comparison](#feature-comparison)
1415

16+
## From @stacksjs/dtsx
17+
18+
dtsx was published as `@stacksjs/dtsx` up to v0.11.36. From v0.11.37 it is published as `@dtsx/dtsx`, alongside the Vite plugin `@dtsx/vite-plugin`. Only the package name changed: the API, the `dtsx` CLI, the config file and every subpath export (`/vite`, `/esbuild`, `/tsup`, `/tsdown`, `/webpack`, `/plugins`, `/checker`) are the same.
19+
20+
1. Swap the dependency:
21+
22+
```bash
23+
bun remove @stacksjs/dtsx
24+
bun add -d @dtsx/dtsx
25+
```
26+
27+
2. Update imports:
28+
29+
```diff
30+
- import { defineConfig, generate } from '@stacksjs/dtsx'
31+
+ import { defineConfig, generate } from '@dtsx/dtsx'
32+
- import { dts } from '@stacksjs/dtsx/tsdown'
33+
+ import { dts } from '@dtsx/dtsx/tsdown'
34+
```
35+
36+
A project-wide search and replace of `@stacksjs/dtsx` with `@dtsx/dtsx` covers it.
37+
38+
The bundler plugins (`bun-plugin-dtsx`, `esbuild-plugin-dtsx`, `tsup-plugin-dtsx`, `webpack-plugin-dtsx`, `@dtsx/vite-plugin`) depend on `@dtsx/dtsx` from v0.11.37; update them to the same version.
39+
1540
## From tsc --declaration
1641

1742
### Before (tsc)
@@ -40,7 +65,7 @@ This guide helps you migrate from other TypeScript declaration generation tools
4065

4166
```bash
4267
# Install
43-
bun add @stacksjs/dtsx -d
68+
bun add @dtsx/dtsx -d
4469
```
4570

4671
```json
@@ -54,7 +79,7 @@ bun add @stacksjs/dtsx -d
5479

5580
```typescript
5681
// dtsx.config.ts
57-
import { defineConfig } from '@stacksjs/dtsx'
82+
import { defineConfig } from '@dtsx/dtsx'
5883

5984
export default defineConfig({
6085
entrypoints: ['src/index.ts'],
@@ -75,7 +100,7 @@ export default defineConfig({
75100

76101
### Migration Steps
77102

78-
1. Install dtsx: `bun add @stacksjs/dtsx -d`
103+
1. Install dtsx: `bun add @dtsx/dtsx -d`
79104
2. Create `dtsx.config.ts`
80105
3. Update build script in `package.json`
81106
4. Remove `declaration` options from tsconfig (optional)
@@ -98,7 +123,7 @@ export default defineConfig({
98123

99124
```typescript
100125
// dtsx.config.ts
101-
import { defineConfig } from '@stacksjs/dtsx'
126+
import { defineConfig } from '@dtsx/dtsx'
102127

103128
export default defineConfig({
104129
entrypoints: ['src/index.ts'],
@@ -154,7 +179,7 @@ export default defineConfig({
154179

155180
```typescript
156181
// dtsx.config.ts
157-
import { defineConfig } from '@stacksjs/dtsx'
182+
import { defineConfig } from '@dtsx/dtsx'
158183

159184
export default defineConfig({
160185
entrypoints: ['src/index.ts'],
@@ -192,7 +217,7 @@ export default defineConfig({
192217
### Preserving @internal Behavior
193218

194219
```typescript
195-
import { defineConfig, stripInternalPlugin } from '@stacksjs/dtsx'
220+
import { defineConfig, stripInternalPlugin } from '@dtsx/dtsx'
196221

197222
export default defineConfig({
198223
plugins: [

‎docs/TROUBLESHOOTING.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ touch dtsx.config.ts
7777

7878
```typescript
7979
// dtsx.config.ts
80-
import { defineConfig } from '@stacksjs/dtsx'
80+
import { defineConfig } from '@dtsx/dtsx'
8181

8282
export default defineConfig({
8383
// Valid options:
@@ -232,7 +232,7 @@ export * from './types'
232232
**Solution**: Use the merger:
233233

234234
```typescript
235-
import { mergeDeclarations } from '@stacksjs/dtsx'
235+
import { mergeDeclarations } from '@dtsx/dtsx'
236236

237237
// Or enable in config
238238
export default defineConfig({
@@ -378,7 +378,7 @@ NODE_OPTIONS="--max-old-space-size=4096" dtsx generate
378378
2. Use streaming for large files:
379379

380380
```typescript
381-
import { StreamingProcessor } from '@stacksjs/dtsx'
381+
import { StreamingProcessor } from '@dtsx/dtsx'
382382

383383
const processor = new StreamingProcessor({
384384
maxMemoryMB: 512,
@@ -596,7 +596,7 @@ type Mutable<T> = { -readonly [K in keyof T]: T[K] }
596596
1. Install globally:
597597

598598
```bash
599-
bun add -g @stacksjs/dtsx
599+
bun add -g @dtsx/dtsx
600600
```
601601

602602
2. Or use npx/bunx:

‎docs/advanced/integration.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This guide covers how to integrate dtsx with various build tools and development
88

99
```ts
1010
// tsdown.config.ts
11-
import { dts } from '@stacksjs/dtsx/tsdown'
11+
import { dts } from '@dtsx/dtsx/tsdown'
1212
import { defineConfig } from 'tsdown'
1313

1414
export default defineConfig({

0 commit comments

Comments
 (0)