@d1g1tal/tsbuild 1.5.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +605 -0
- package/README.md +3 -3
- package/dist/{UYXU5EAU.js → 7FPDHUPW.js} +0 -2
- package/dist/{RBRXNRTQ.js → LEZQQWX3.js} +1 -1
- package/dist/{4BKT57QY.js → W52DJ7GZ.js} +25 -18
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/tsbuild.js +3 -3
- package/package.json +16 -12
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,605 @@
|
|
|
1
|
+
## [1.6.1](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.6.0...v1.6.1) (2026-03-18)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **test:** workaround vitest 4.1 decorator regression (e018d99561fad324f4f8c73bf34fd6b4fcd881e5)
|
|
6
|
+
- add @rolldown/plugin-babel and @babel/plugin-proposal-decorators to devDependencies
|
|
7
|
+
- update vitest.config.ts to transform decorators using babel
|
|
8
|
+
- introduce tests/tsconfig.json for test environment typing
|
|
9
|
+
- bump typescript-eslint and @types/node dependencies
|
|
10
|
+
- sync pnpm-lock.yaml with updated dependencies
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Miscellaneous Chores
|
|
14
|
+
|
|
15
|
+
* **pkg:** update package manager and project scripts (57a0ff3aa552d49aa56745bd0179ee245fd70ac7)
|
|
16
|
+
- bump pnpm packageManager field to 10.32.1
|
|
17
|
+
- include CHANGELOG.md in the list of published files
|
|
18
|
+
- remove deprecated prepare script
|
|
19
|
+
- add test:watch convenience script for vitest
|
|
20
|
+
|
|
21
|
+
* **style:** add editorconfig (55d07cb8090f6874e7f16a5c7943309e6ade8f64)
|
|
22
|
+
- establish consistent coding styles across the workspace
|
|
23
|
+
- configure standard indents, charsets, and newline rules
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Continuous Integration
|
|
27
|
+
|
|
28
|
+
* force actions to use Node.js 24 (9eaac47d702c40ce9d8aeb7b7e6d990ccfa3b51d)
|
|
29
|
+
* updated actions to latest versions (a5a7b0f36420cad83192fca489c5ff9bc376b9d7)
|
|
30
|
+
* upgrade github actions runner versions (b9ed4f72294dee56713155623b016fc4951c8931)
|
|
31
|
+
- bump actions/checkout to v6
|
|
32
|
+
- bump pnpm/action-setup to v5
|
|
33
|
+
- bump actions/setup-node to v6
|
|
34
|
+
- enforce using latest npm globally in publish workflow
|
|
35
|
+
|
|
36
|
+
## [1.6.0](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.5.0...v1.6.0) (2026-03-12)
|
|
37
|
+
|
|
38
|
+
### Features
|
|
39
|
+
|
|
40
|
+
* **logger:** add ANSI-safe header width and styled build banner (6dd2e72306dcc29998b2a1900c51e044d5cd0b9a)
|
|
41
|
+
- Fix header box width calculation by stripping ANSI escape codes before measuring message length
|
|
42
|
+
- Add TextFormat import to TypeScriptProject for use in the build header
|
|
43
|
+
- Prefix build header message with a styled blue TS logo
|
|
44
|
+
- Rename logPerformance label from 'Process Declarations' to 'Bundle Declarations'
|
|
45
|
+
- Update logger subSteps test to cover filtering behaviour and new PerformanceSubStep shape
|
|
46
|
+
- Add test case asserting nothing is logged when all steps are below the threshold
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### Bug Fixes
|
|
50
|
+
|
|
51
|
+
* **incremental:** prevent false change detection on .tsbuildinfo writes (8cb4d9631336d1a2a4401da0b1bcdacdc873bb6a)
|
|
52
|
+
- Remove forced declarationDir: undefined override from compiler option overrides
|
|
53
|
+
- Remove corresponding type entry from CompilerOptionOverrides
|
|
54
|
+
- Move hasEmittedFiles tracking inside the non-buildinfo branch of fileWriter so only real output files (not .tsbuildinfo) set the flag
|
|
55
|
+
- Return true from the hasChanged check when declaration:false is set, ensuring esbuild always runs when declarations are disabled
|
|
56
|
+
- Add test verifying that writing only .tsbuildinfo does not set the emitted flag
|
|
57
|
+
- Update existing incremental no-changes test to properly simulate a prior build with cached declarations
|
|
58
|
+
- Update test asserting esbuild is always invoked for declaration:false projects
|
|
59
|
+
- Remove outdated declarationDir override test
|
|
60
|
+
- Remove outdated test asserting esbuild was skipped for declaration:false incremental builds
|
|
61
|
+
- Add incremental: false to basic build integration tests to keep them hermetic
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
### Performance Improvements
|
|
65
|
+
|
|
66
|
+
* **logger:** filter sub-steps below 5ms to reduce build output noise (fe37d375ca8f3ee79f3c1602cc0240f0d6aefd94)
|
|
67
|
+
- Add ms field to PerformanceSubStep type to carry the raw numeric duration
|
|
68
|
+
- Update addPerformanceStep to accept a number and derive the formatted string internally
|
|
69
|
+
- Update TypeScriptProject.elapsed() to return a number instead of a pre-formatted string
|
|
70
|
+
- Update all call sites to pass numeric millisecond values
|
|
71
|
+
- Filter out sub-steps with ms < 5 before logging; return early if nothing remains
|
|
72
|
+
- Update tests to reflect the new numeric API and updated PerformanceSubStep shape
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
### Documentation
|
|
76
|
+
|
|
77
|
+
* update runtime requirements, watchr link, and exports docs (5fe88a82785f56743f82e68622e9986924444b10)
|
|
78
|
+
- Bump minimum Node.js requirement from 20.16.0 to 22+ in README and copilot instructions
|
|
79
|
+
- Bump minimum pnpm requirement from 9+ to 10+ in copilot instructions
|
|
80
|
+
- Update watchr link in README to point to the correct fork repository
|
|
81
|
+
- Update exports condition list to include node and module conditions
|
|
82
|
+
- Remove stale Performance Notes and Testing Gaps sections from copilot instructions
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
### Miscellaneous Chores
|
|
86
|
+
|
|
87
|
+
* **deps:** update dependencies (3b4a3acacd4306e9110b1d1858ce2e43326c8c31)
|
|
88
|
+
|
|
89
|
+
### Build System
|
|
90
|
+
|
|
91
|
+
* **deps:** bump esbuild, vitest, and related packages (4f10321b7772e0ea6c94faa86d38f3156d3a0f7b)
|
|
92
|
+
- Upgrade esbuild from 0.27.3 to 0.27.4
|
|
93
|
+
- Upgrade vitest and @vitest/* packages from 4.0.18 to 4.1.0
|
|
94
|
+
- Upgrade @vitest/coverage-v8 from 4.0.18 to 4.1.0
|
|
95
|
+
- Upgrade eslint-plugin-jsdoc from 62.7.1 to 62.8.0
|
|
96
|
+
- Add convert-source-map 2.0.0 as new transitive dependency
|
|
97
|
+
- Upgrade ast-v8-to-istanbul from 0.3.12 to 1.0.0
|
|
98
|
+
- Upgrade es-module-lexer from 1.7.0 to 2.0.0
|
|
99
|
+
- Upgrade std-env from 3.10.0 to 4.0.0
|
|
100
|
+
- Upgrade tinyrainbow from 3.0.3 to 3.1.0
|
|
101
|
+
- Update pnpm-lock.yaml to reflect all dependency changes
|
|
102
|
+
- Remove prepublishOnly script from package.json
|
|
103
|
+
|
|
104
|
+
## [1.5.0](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.4.1...v1.5.0) (2026-03-08)
|
|
105
|
+
|
|
106
|
+
### Features
|
|
107
|
+
|
|
108
|
+
* **compiler:** always inject 'node' into compiler types (04f1e680dc9a8a76458fd82831f007463588fa6b)
|
|
109
|
+
- Merges 'node' into the resolved types array when building the TypeScript incremental program, using a Set to deduplicate
|
|
110
|
+
- User-specified types from tsconfig and tool options are preserved and merged, so 'node' is always present without overwriting other entries
|
|
111
|
+
|
|
112
|
+
* **compiler:** force declarationDir to undefined in overrides (f1fd8efb22658cedf75f296567fc96af618731c8)
|
|
113
|
+
- Adds declarationDir: undefined to CompilerOptionOverrides type and constant so .d.ts output always goes to outDir, making declaration files reliably discoverable by the bundler regardless of user tsconfig settings
|
|
114
|
+
- Updates the constants test to assert declarationDir is undefined in the overrides object
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
### Documentation
|
|
118
|
+
|
|
119
|
+
* update minimum node.js version to 22+ (39e4a319afe4718b052ee2170583e9a928c2dc8a)
|
|
120
|
+
- Updates the README description to reflect that the tool targets Node.js 22+ instead of the previously stated 20.16.0+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
### Miscellaneous Chores
|
|
124
|
+
|
|
125
|
+
* **ci:** update the noode version for the README.md badge and packageManager pnpm version (89467c98966ea232fc015df8c6e5fbcaeb327b55)
|
|
126
|
+
* **docs:** moved quick start section after installation and fixed some spelling errors (ea23a1a3e2a576c73caaa79514db3306576cd1fd)
|
|
127
|
+
* **docs:** update the incremental builds section (9a971879a09a48ffb91177a34a3b9daaa8046f38)
|
|
128
|
+
|
|
129
|
+
### Tests
|
|
130
|
+
|
|
131
|
+
* **compiler:** add tests for declarationDir and types overrides (a5ba00a8ed1190ff531e1dbb0af4db8880bbb18f)
|
|
132
|
+
- Adds a test asserting declarationDir is overridden to undefined even when set in tsconfig
|
|
133
|
+
- Adds a test asserting types defaults to include 'node' when not specified in tsconfig
|
|
134
|
+
- Adds a test asserting user-specified types are merged with the 'node' default
|
|
135
|
+
- Adds a test asserting 'node' is not duplicated when the user already includes it
|
|
136
|
+
- Adds a @types/node stub in the memfs test environment to prevent TS2688 errors during test runs where node_modules is unavailable
|
|
137
|
+
- Fixes mock type casts to use 'as unknown as Diagnostic' for stricter TypeScript compatibility
|
|
138
|
+
- Changes private transpile() call in a test to use bracket access to avoid visibility errors
|
|
139
|
+
|
|
140
|
+
## [1.4.1](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.4.0...v1.4.1) (2026-03-08)
|
|
141
|
+
|
|
142
|
+
### Bug Fixes
|
|
143
|
+
|
|
144
|
+
* **ci:** drop node 20 and fix publish git checks (3ff1b239fcc1f7d2d0814bc59d3a61632671e043)
|
|
145
|
+
- Removes Node.js 20 from the CI test matrix, keeping only 22 and 24 as actively tested versions
|
|
146
|
+
- Adds --no-git-checks to the publish command to prevent pnpm from blocking the release due to git state checks in the semantic-release automation context
|
|
147
|
+
|
|
148
|
+
## [1.4.0](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.3.2...v1.4.0) (2026-03-08)
|
|
149
|
+
|
|
150
|
+
### Features
|
|
151
|
+
|
|
152
|
+
* **cache:** add isValid() to BuildCache interface (2987352e2391ccf62c032e68ee668468cd18ddf0)
|
|
153
|
+
- Adds isValid() method to IncrementalBuildCache returning !this.invalidated
|
|
154
|
+
- Adds isValid(): boolean to the BuildCache interface with JSDoc
|
|
155
|
+
- Adds missing JSDoc comments to other BuildCache interface methods
|
|
156
|
+
- Fixes incremental build header label to only show when cache is actually valid
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
### Documentation
|
|
160
|
+
|
|
161
|
+
* expand Quick Start section in README (c31223b8296100af4899fcdec468580b5fe72a4f)
|
|
162
|
+
- Adds minimal config example showing no tsbuild section is needed
|
|
163
|
+
- Adds noExternal usage example for bundling a specific package
|
|
164
|
+
- Adds preferred incremental tsconfig setup with annotated options
|
|
165
|
+
- Adds preferred non-incremental tsconfig setup for CI environments
|
|
166
|
+
- Clarifies entry point inference and external dependency defaults
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
### Build System
|
|
170
|
+
|
|
171
|
+
* update package metadata, deps, and release config (f203cf1611b337509e1f8c30d3b3ff9aebd28f1e)
|
|
172
|
+
- Reorganizes package.json field order, grouping author/license/homepage/repository/bugs/maintainers/engines/publishConfig near the top
|
|
173
|
+
- Adds maintainers field with name and email
|
|
174
|
+
- Adds README.md and LICENSE to published files list
|
|
175
|
+
- Moves keywords field to end of package.json
|
|
176
|
+
- Updates release commands in .releaserc.json to use pnpm with lint and build steps before pack
|
|
177
|
+
- Switches publishCmd to pnpm publish --provenance
|
|
178
|
+
- Reorders tsconfig.json compiler options for clarity, groups isolated/verbatim options, moves lib after noUncheckedIndexedAccess, removes moduleDetection: force
|
|
179
|
+
- Bumps @types/node, eslint, and memfs dev dependencies to latest minor versions
|
|
180
|
+
- Updates pnpm-lock.yaml to reflect all dependency version changes
|
|
181
|
+
|
|
182
|
+
## [1.3.2](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.3.1...v1.3.2) (2026-03-01)
|
|
183
|
+
|
|
184
|
+
### Bug Fixes
|
|
185
|
+
|
|
186
|
+
* updated the entry point inferrence handling message to be more helpful (eeddaaab6faf553098cbf0e85ecd9f0c05d22718)
|
|
187
|
+
|
|
188
|
+
### Tests
|
|
189
|
+
|
|
190
|
+
* remove test coverage (6f2ba17ce701d2b37232ab0f8fb64f4891557bee)
|
|
191
|
+
|
|
192
|
+
## [1.3.1](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.3.0...v1.3.1) (2026-03-01)
|
|
193
|
+
|
|
194
|
+
### Bug Fixes
|
|
195
|
+
|
|
196
|
+
* **entry-points:** Resolves conditional exports (65a5d4835ba51e906422982ad1e4d1ba83eeae94)
|
|
197
|
+
|
|
198
|
+
### Documentation
|
|
199
|
+
|
|
200
|
+
* updated readme to include tsdown in the tool comparison section (ad3f38a38d05314aabbcc10bba1e55856b50086d)
|
|
201
|
+
|
|
202
|
+
### Miscellaneous Chores
|
|
203
|
+
|
|
204
|
+
* **repo:** Updates ignore and README badges (9bdd6ce61a2f97b92ede9f118df7b20aaabb0074)
|
|
205
|
+
|
|
206
|
+
## [1.3.0](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.2.5...v1.3.0) (2026-02-28)
|
|
207
|
+
|
|
208
|
+
### Features
|
|
209
|
+
|
|
210
|
+
* **logger:** add sub-step tree logging to performance output (2a775ca35d4b3524d2862f6e3b5e15040c2efb55)
|
|
211
|
+
Introduces timed sub-step display beneath each build step in the
|
|
212
|
+
performance log, making it easy to see where time is spent within a
|
|
213
|
+
single decorated method.
|
|
214
|
+
|
|
215
|
+
- Adds PerformanceSubStep type and exports it from the public types index
|
|
216
|
+
- Extends PerformanceEntryDetail to carry an optional steps array
|
|
217
|
+
- Adds Logger.subSteps() with tree-style ├─/└─ formatting and aligned columns
|
|
218
|
+
- Adds module-level pendingSteps buffer to the performance decorator
|
|
219
|
+
- Exports addPerformanceStep() so callers can register sub-steps during a decorated call
|
|
220
|
+
- Flushes pending steps into the measurement detail inside the measure decorator
|
|
221
|
+
- Calls Logger.subSteps() from the observer when steps are present
|
|
222
|
+
- Adds unit tests for Logger.subSteps() alignment and single-item edge case
|
|
223
|
+
- Adds unit test verifying sub-step attachment and observer rendering
|
|
224
|
+
- Updates Logger mock in all affected test files to include subSteps
|
|
225
|
+
|
|
226
|
+
* **type-script-project:** add per-phase timing to type-check step (acaf8a0c432bb9d340f2441a59577153c7d67ade)
|
|
227
|
+
Instruments the three distinct phases of a type-check cycle with
|
|
228
|
+
sub-step performance marks so the log shows exactly where build
|
|
229
|
+
time is being spent.
|
|
230
|
+
|
|
231
|
+
- Imports addPerformanceStep and the perf_hooks performance API
|
|
232
|
+
- Wraps emit, diagnostics collection, and finalize with performance marks
|
|
233
|
+
- Adds a private static elapsed() helper to compute and format duration from a named mark
|
|
234
|
+
- Updates finalize() call-site to drop the now-unnecessary await
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
### Performance Improvements
|
|
238
|
+
|
|
239
|
+
* **file-manager:** defer emit work and make cache saves async (afe576b5969c7088ccfd77a22e6cd0b6555e1974)
|
|
240
|
+
Reduces time spent inside TypeScript's synchronous emit() call by
|
|
241
|
+
deferring declaration pre-processing and .tsbuildinfo I/O to a
|
|
242
|
+
separate step after emit() returns. Cache persistence becomes a
|
|
243
|
+
fire-and-forget promise, unblocking the current build's parallel
|
|
244
|
+
phases.
|
|
245
|
+
|
|
246
|
+
- Buffers raw declaration text and .tsbuildinfo content in fileWriter instead of processing synchronously
|
|
247
|
+
- Introduces processEmittedFiles() to run AST creation and pre-processing after emit
|
|
248
|
+
- Changes finalize() from async to sync; starts a background save promise
|
|
249
|
+
- Adds flush() to await any in-flight background I/O when needed
|
|
250
|
+
- Updates initialize() and close() to handle pending save state correctly
|
|
251
|
+
- Removes the unused synchronous sys import from typescript
|
|
252
|
+
- Updates JSDoc to reflect the deferred processing model
|
|
253
|
+
- Removes await from all finalize() call-sites in tests
|
|
254
|
+
- Adds explicit finalize() calls in tests that inspect declaration files directly
|
|
255
|
+
- Adds await flush() in tests that read cache state from a second instance
|
|
256
|
+
|
|
257
|
+
## [1.2.5](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.2.4...v1.2.5) (2026-02-28)
|
|
258
|
+
|
|
259
|
+
### Bug Fixes
|
|
260
|
+
|
|
261
|
+
* **decorator-metadata:** make @swc/core a true optional dep (69d35717e6f941cf9591097629b51858d3d282f0)
|
|
262
|
+
The static import of @swc/core was removed in an earlier commit that
|
|
263
|
+
made it an optional peer dependency, but the plugin still used a
|
|
264
|
+
static import at the top of the file, causing the now-working
|
|
265
|
+
type-checker to surface a TS2307 resolution error.
|
|
266
|
+
|
|
267
|
+
Converts the import to a dynamic import inside the onLoad callback so
|
|
268
|
+
it is only resolved when the plugin is actually used. Adds a minimal
|
|
269
|
+
ambient module declaration so TypeScript can resolve the shape of the
|
|
270
|
+
dynamic import without requiring @swc/core to be installed.
|
|
271
|
+
|
|
272
|
+
Changed files:
|
|
273
|
+
- src/@types/swc.d.ts
|
|
274
|
+
- src/plugins/decorator-metadata.ts
|
|
275
|
+
|
|
276
|
+
* **type-check:** include semantic diagnostics in type-check (2a3400a73aef2a6b6ac6c3e29ad56369c666ea6a)
|
|
277
|
+
Previously, only emit-phase diagnostics were checked, causing all
|
|
278
|
+
semantic errors (e.g. TS2307, TS2322) to be silently ignored.
|
|
279
|
+
|
|
280
|
+
Fixes this by explicitly calling getSemanticDiagnostics() and merging
|
|
281
|
+
the result with emit diagnostics before checking for errors.
|
|
282
|
+
|
|
283
|
+
Changed files:
|
|
284
|
+
- src/type-script-project.ts
|
|
285
|
+
- tests/type-script-project.test.ts
|
|
286
|
+
|
|
287
|
+
## [1.2.4](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.2.3...v1.2.4) (2026-02-28)
|
|
288
|
+
|
|
289
|
+
### Code Refactoring
|
|
290
|
+
|
|
291
|
+
* **deps:** remove @swc/core optional dependency (6eeff9af10e8e0ca469699cccd580127c5160df5)
|
|
292
|
+
- Removes @swc/core and @swc/types as optional dependencies from package.json
|
|
293
|
+
- Updates pnpm-lock.yaml to drop all @swc/* package entries and snapshots
|
|
294
|
+
- Bumps pnpm packageManager version to 10.30.3
|
|
295
|
+
- Rewrites README introduction to clarify the tool's purpose and tone
|
|
296
|
+
- Adds TC39 standard decorators as a first-class supported feature with no extra dependencies
|
|
297
|
+
- Splits legacy decorator metadata into its own feature bullet, noting @swc/core must be installed manually
|
|
298
|
+
- Replaces the three-phase build description with a clearer two-phase explanation
|
|
299
|
+
- Adds a Quick Start section showing the minimal tsconfig.json setup and how to run a build
|
|
300
|
+
- Simplifies installation instructions by removing the --no-optional flag example
|
|
301
|
+
- Adds an explicit note that @swc/core will never be installed automatically
|
|
302
|
+
- Expands the Configuration section with an explanation of how tsconfig.json compilerOptions are honoured automatically
|
|
303
|
+
- Adds a comment to the entryPoints example clarifying that entry points can be inferred from package.json
|
|
304
|
+
- Adds a CLI usage note clarifying global vs local install invocation
|
|
305
|
+
- Adds a dedicated Incremental Builds section documenting both caches, the .tsbuild/ directory, and the --force and --clearCache flags
|
|
306
|
+
- Rewrites the Decorator Metadata section to lead with TC39 standard decorators and move legacy decorator metadata to a secondary subsection
|
|
307
|
+
- Clarifies that the build fails with a helpful message if @swc/core is missing when emitDecoratorMetadata is set
|
|
308
|
+
- Corrects the parallel processing performance note to accurately describe declaration bundling and transpilation running in parallel after type checking
|
|
309
|
+
- Fixes the circular dependency warning description to say tsbuild continues rather than just emitting a warning
|
|
310
|
+
- Updates the Limitations section to remove the Experimental label and improve the plugins limitation description
|
|
311
|
+
- Updates the comparison table to split decorator support into TC39 and legacy rows
|
|
312
|
+
- Changes the license from ISC to MIT
|
|
313
|
+
- Removes the closing disclaimer recommending tsup for production use
|
|
314
|
+
|
|
315
|
+
## [1.2.3](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.2.2...v1.2.3) (2026-02-25)
|
|
316
|
+
|
|
317
|
+
### Bug Fixes
|
|
318
|
+
|
|
319
|
+
* **deps:** update minimatch (958d33ffed3a53997b260afe6e2dc40b9553681a)
|
|
320
|
+
|
|
321
|
+
## [1.2.2](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.2.1...v1.2.2) (2026-02-25)
|
|
322
|
+
|
|
323
|
+
### Bug Fixes
|
|
324
|
+
|
|
325
|
+
* **build:** log configuration errors before exiting (7a2497ae68be5924f19c61aab3936d0f0805453a)
|
|
326
|
+
ConfigurationError was being thrown but never logged, leaving the user
|
|
327
|
+
with no visible feedback about what went wrong during the build.
|
|
328
|
+
|
|
329
|
+
- Handles ConfigurationError separately from other BuildError subclasses
|
|
330
|
+
in the build error handler
|
|
331
|
+
- Logs the error message via the logger before setting the exit code
|
|
332
|
+
- Clarifies the comment for TypeCheckError and BundleError, which are
|
|
333
|
+
already logged at the point they are thrown
|
|
334
|
+
|
|
335
|
+
* **entry-points:** use file stem instead of package name for root export (f641c1f0f6e20d79ac9566297b204458d4c37699)
|
|
336
|
+
Previously, the root export ('.') used the unscoped package name as the
|
|
337
|
+
entry point key, which could conflict with bin entries and was
|
|
338
|
+
unpredictable when the source file name differed from the package name.
|
|
339
|
+
|
|
340
|
+
- Adds a `stemOf` helper to extract the filename stem from a path
|
|
341
|
+
- Uses the file stem of the resolved source path as the entry key for
|
|
342
|
+
the root export ('.') and for string exports
|
|
343
|
+
- Non-root subpath exports continue to use the subpath-derived name
|
|
344
|
+
- Fixes a bug where bin entries with different names were silently
|
|
345
|
+
dropped because they collided with the package-name-based export key
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
### Tests
|
|
349
|
+
|
|
350
|
+
* **entry-points:** update tests to reflect file-stem entry naming (38c296d1441ecfb435e6b7fd69493ab936be11fc)
|
|
351
|
+
Follows up on the change that uses file stems instead of package names
|
|
352
|
+
for root export entry point keys.
|
|
353
|
+
|
|
354
|
+
- Updates all test expectations that previously expected the unscoped
|
|
355
|
+
package name (e.g., 'my-pkg') as the root entry key to now expect the
|
|
356
|
+
file stem (e.g., 'index')
|
|
357
|
+
- Renames a test to better describe the new behaviour of combining
|
|
358
|
+
exports and bin when their names differ
|
|
359
|
+
- Adds a new test that mirrors the real-world tsbuild package layout,
|
|
360
|
+
where exports '.' resolves to index.ts and bin resolves to tsbuild.ts,
|
|
361
|
+
verifying both are included as separate entries
|
|
362
|
+
- Adds a missing `name` field to a test fixture that requires it
|
|
363
|
+
- Updates a test description to reflect that file stem is used for root
|
|
364
|
+
exports while subpath names are used for other exports
|
|
365
|
+
|
|
366
|
+
## [1.2.1](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.2.0...v1.2.1) (2026-02-25)
|
|
367
|
+
|
|
368
|
+
### Bug Fixes
|
|
369
|
+
|
|
370
|
+
* **paths:** return false for non-existent paths in type checks (393856cfff44dedffa1e63b3f5fa5a9b3863d023)
|
|
371
|
+
- Handle ENOENT in isDirectory and isFile instead of throwing
|
|
372
|
+
- Re-throw any unexpected errors to preserve error visibility
|
|
373
|
+
- Update JSDoc to document non-existence behavior
|
|
374
|
+
- Add unit tests covering existing directory, existing file, and non-existent path cases for both methods
|
|
375
|
+
- Mock node:fs and node:fs/promises with memfs for isolated in-memory testing
|
|
376
|
+
|
|
377
|
+
* **type-script-project:** validate entry points exist and suppress unhandled rejection (758be0311f505f9f0417036912a35a186dfa96fc)
|
|
378
|
+
- Throw a ConfigurationError when an entry point path does not exist as a file or directory
|
|
379
|
+
- Suppress the unhandled rejection warning on the entry points promise since the rejection is handled when awaited in build()
|
|
380
|
+
- Inline a single-use variable in dependency path parsing for clarity
|
|
381
|
+
- Remove stale commented-out entry points from tsconfig.json
|
|
382
|
+
- Add a test asserting that a missing entry point causes exit code 3 during build
|
|
383
|
+
|
|
384
|
+
## [1.2.0](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.1.3...v1.2.0) (2026-02-24)
|
|
385
|
+
|
|
386
|
+
### Features
|
|
387
|
+
|
|
388
|
+
* **entry-points:** add unscoped name support and drop .mjs mapping (d11c55e994b6ca780b52e67ad7c8c6dda26c8a9b)
|
|
389
|
+
- Removes .mjs and .d.mts from the output-to-source extension map since the project is ESM-only and only emits .js
|
|
390
|
+
- Adds an unscope() helper to strip npm scope prefixes (e.g. @scope/pkg → pkg) so scoped package names produce clean entry point keys
|
|
391
|
+
- Applies unscoping when deriving entry point names from the root export (.) and when using package.json name as a fallback key
|
|
392
|
+
- Enables tsconfig.json to rely on auto-inferred entry points by commenting out the explicit entryPoints config, exercising the zero-config path
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
### Code Refactoring
|
|
396
|
+
|
|
397
|
+
* **type-script-project:** remove unused packageJson field (96c5659ac9e9617feea3454414880b8ebb23f466)
|
|
398
|
+
- Drops the cached packageJson instance field that was read but never used outside of the dependency resolution method
|
|
399
|
+
- Simplifies the class by eliminating unnecessary state that was populated as a side-effect of reading dependencies
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
### Documentation
|
|
403
|
+
|
|
404
|
+
* update README with new features and revised benchmarks (2f3141830cca6d7dc3d2ecea5efae87a6cdd56a6)
|
|
405
|
+
- Documents the zero-config entry point auto-inference feature including resolution order and constraints
|
|
406
|
+
- Documents circular dependency detection behavior in the declaration bundler
|
|
407
|
+
- Adds the zero-config entry point feature to the feature highlights list
|
|
408
|
+
- Updates build time benchmarks to reflect current measured performance
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
### Miscellaneous Chores
|
|
412
|
+
|
|
413
|
+
* consolidate agent guidelines into copilot-instructions (0830c1c47b583fac5ce3d472f52694cc073b1f33)
|
|
414
|
+
- Removes the standalone AGENTS.md file to reduce documentation fragmentation
|
|
415
|
+
- Inlines the core principles, coding rules, testing rules, and workflow rules directly into .github/copilot-instructions.md
|
|
416
|
+
- Condenses verbose guidelines into concise bullet points while preserving all essential constraints
|
|
417
|
+
- Ensures Copilot and other agents read a single authoritative source of truth
|
|
418
|
+
|
|
419
|
+
* **release:** make all commit types visible in changelog (f884bcf888927bb9c273aa52962de1cd742b91c3)
|
|
420
|
+
- Removes the hidden:true flag from docs, style, chore, test, build, and ci commit types in .releaserc.json
|
|
421
|
+
- All commit types will now appear in generated changelogs regardless of semantic-release conventions
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
### Tests
|
|
425
|
+
|
|
426
|
+
* **entry-points:** update tests for .mjs removal and scoped names (1eba92d4ed914182bf0445684ec415c17b4dba7b)
|
|
427
|
+
- Removes test cases for .mjs and .d.mts extension mappings that no longer exist in the source
|
|
428
|
+
- Updates the module field fallback test to use .js instead of .mjs
|
|
429
|
+
- Corrects the expectation for .mjs exports to be undefined (unmappable) rather than resolving
|
|
430
|
+
- Adds a new test covering scoped package name stripping across exports, bin, and the root export key
|
|
431
|
+
|
|
432
|
+
## [1.1.3](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.1.2...v1.1.3) (2026-02-24)
|
|
433
|
+
|
|
434
|
+
### Bug Fixes
|
|
435
|
+
|
|
436
|
+
* **dts:** improve circular dependency detection with full cycle path (b5bbb2bf6028eca05cdf13d6d7eb24058917a0f6)
|
|
437
|
+
- Tracks the current visit stack so the exact cycle can be reconstructed
|
|
438
|
+
- Reports the full chain of modules involved in the cycle instead of just the entry point
|
|
439
|
+
- Properly cleans up visiting state and stack when a module is not found
|
|
440
|
+
- Updates the test assertion to verify the full cycle path is reported
|
|
441
|
+
|
|
442
|
+
## [1.1.2](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.1.1...v1.1.2) (2026-02-24)
|
|
443
|
+
|
|
444
|
+
### Bug Fixes
|
|
445
|
+
|
|
446
|
+
* **bundler:** flatten qualified names from bundled namespace imports (883c4a4e47df1d2de7e91e549e37cae0c09753e8)
|
|
447
|
+
- Adds tracking of namespace aliases created from bundled `import * as Alias` statements
|
|
448
|
+
- When a bundled module is inlined, its namespace import is stripped, so all `Alias.X` qualified references must be rewritten to plain `X` to avoid broken output
|
|
449
|
+
- Fixes identifier re-insertion bug where the rename visitor was walking import/export declarations that had already been removed via magic.remove(), causing overwrite() to reinsert removed text and produce corrupted output like `};Json$1JsonPrimitive$1`
|
|
450
|
+
- Restricts the rename visitor to declaration statements only, skipping import/export declarations
|
|
451
|
+
- Imports two new TypeScript AST helpers needed for the above fixes
|
|
452
|
+
|
|
453
|
+
## [1.1.1](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.1.0...v1.1.1) (2026-02-24)
|
|
454
|
+
|
|
455
|
+
### Bug Fixes
|
|
456
|
+
|
|
457
|
+
* **dts:** correct scoped package name in DTS output (9c40f48a896d5dab7d05c130eb624d288d0f6967)
|
|
458
|
+
Two bugs caused scoped npm package imports (e.g. `@d1g1tal/watchr`) to be
|
|
459
|
+
emitted as unscoped names (`watchr`) in the bundled declaration output.
|
|
460
|
+
|
|
461
|
+
- Race condition in `IncrementalBuildCache`: `loadCache()` starts reading
|
|
462
|
+
the cache file asynchronously in the constructor, but `invalidate()` is
|
|
463
|
+
called afterward; the I/O read could complete before `rmSync` deleted the
|
|
464
|
+
file, so stale cache data was returned by `restore()` even after
|
|
465
|
+
`--clearCache`; fixed by adding an `invalidated` flag that makes
|
|
466
|
+
`restore()` bail out immediately when set
|
|
467
|
+
- Ambiguous path matching in `sourceToDeclarationPath`: when both a stale
|
|
468
|
+
cache entry (`dist/src/@types/index.d.ts` from an old build) and the
|
|
469
|
+
correct current entry (`dist/@types/index.d.ts`) exist in
|
|
470
|
+
`declarationFiles`, the stale one (inserted earlier from `restore()`) was
|
|
471
|
+
returned first; fixed by selecting the match with the shortest relative
|
|
472
|
+
path since TypeScript strips `rootDir` from output paths
|
|
473
|
+
- Add test for the `invalidated` flag race-condition fix in
|
|
474
|
+
`tests/build-cache.test.ts`
|
|
475
|
+
- Add test for shortest-path preference in
|
|
476
|
+
`tests/declaration-bundler.test.ts`
|
|
477
|
+
|
|
478
|
+
## [1.1.0](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.0.3...v1.1.0) (2026-02-24)
|
|
479
|
+
|
|
480
|
+
### Features
|
|
481
|
+
|
|
482
|
+
* **entry-points:** infer entry points from package.json when none configured (a3c73da481e4e59416e2f6e4483e932c525d0968)
|
|
483
|
+
- add src/entry-points.ts with inferEntryPoints() that reverse-maps output paths
|
|
484
|
+
from exports, bin, main, and module fields back to source files
|
|
485
|
+
- add PackageJson type covering exports, bin, main, module, dependencies,
|
|
486
|
+
and peerDependencies fields
|
|
487
|
+
- integrate inferEntryPoints into TypeScriptProject.readConfiguration() so
|
|
488
|
+
projects with no explicit entryPoints config auto-infer from package.json
|
|
489
|
+
- update schema.json markdownDescription for entryPoints to document the
|
|
490
|
+
auto-inference behaviour
|
|
491
|
+
- replace ProjectDependencies with PackageJson in getProjectDependencyPaths()
|
|
492
|
+
and cache the parsed package.json on the instance for reuse
|
|
493
|
+
- add tests/entry-points.test.ts covering all inference paths
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
### Bug Fixes
|
|
497
|
+
|
|
498
|
+
* **dts:** fix modifier removal eating next token's leading character (7a0f90321ca00879557ec55e2464b72d97bfe528)
|
|
499
|
+
- replace hard-coded '+ 1' offset in fixModifiers with a call to the
|
|
500
|
+
existing getTrailingWhitespaceLength() helper so that only actual
|
|
501
|
+
whitespace after the modifier keyword is consumed, not the first
|
|
502
|
+
character of the following token
|
|
503
|
+
- add tests covering export modifier at end of line, export default, and
|
|
504
|
+
export with multiple trailing spaces
|
|
505
|
+
|
|
506
|
+
* **dts:** separate external declarations, fix rename collisions, warn on circular deps (5daeb0a227b502a6fda29f24d756dfc1f1fb7df6)
|
|
507
|
+
- introduce externalDeclarationFiles Map separate from declarationFiles so
|
|
508
|
+
externally-resolved node_modules .d.ts files never pollute the project map
|
|
509
|
+
- update moduleResolutionHost.fileExists and readFile to check both maps
|
|
510
|
+
- store disk-loaded external declarations in externalDeclarationFiles instead
|
|
511
|
+
of declarationFiles to prevent memory accumulation across entry points
|
|
512
|
+
- add clearExternalFiles() method and call it after all bundling completes to
|
|
513
|
+
free memory used by externally-resolved declarations
|
|
514
|
+
- expand buildDependencyGraph and topological-sort visit() to look up cached
|
|
515
|
+
declarations in both maps
|
|
516
|
+
- fix rename collision detection: iterate with an incrementing suffix and
|
|
517
|
+
skip candidates already present in declarationSources instead of always
|
|
518
|
+
using sequential indices
|
|
519
|
+
- emit a Logger.warn() message when a circular dependency is detected rather
|
|
520
|
+
than silently returning
|
|
521
|
+
- replace TODO comment on posix.normalize with an accurate explanation
|
|
522
|
+
- add tests for circular dependency warning, rename collision avoidance,
|
|
523
|
+
and external-file cleanup path
|
|
524
|
+
|
|
525
|
+
* **errors:** make UnsupportedSyntaxError extend BundleError with exit code 2 (ee239c97a05b0f2fb58e911ab83cd90519ffd3b8)
|
|
526
|
+
- change UnsupportedSyntaxError base class from Error to BundleError so
|
|
527
|
+
it carries exit code 2 and participates in the standard error hierarchy
|
|
528
|
+
- set this.name to 'UnsupportedSyntaxError' for correct identification
|
|
529
|
+
after instanceof checks across prototype chains
|
|
530
|
+
- update JSDoc to clarify it is thrown during DTS processing
|
|
531
|
+
- add test asserting instanceof BundleError, instanceof BuildError,
|
|
532
|
+
exit code 2, and correct name
|
|
533
|
+
|
|
534
|
+
## [1.0.3](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.0.2...v1.0.3) (2026-02-24)
|
|
535
|
+
|
|
536
|
+
### Bug Fixes
|
|
537
|
+
|
|
538
|
+
* **build:** fix --force flag, new-file watch handling, and minor correctness issues (c005d19c406aafd44c54836f4ca38026f72a2ba5)
|
|
539
|
+
- Fixes the `--force` flag being silently ignored when incremental
|
|
540
|
+
TypeScript reports no changed files; reorders the condition so `force`
|
|
541
|
+
independently bypasses the `filesWereEmitted` gate
|
|
542
|
+
- Fixes newly added source files being silently dropped during a watch
|
|
543
|
+
rebuild by adding a `FileEvent.add` handler that appends the path to
|
|
544
|
+
`rootNames` when not already present
|
|
545
|
+
- Passes `configFileParsingDiagnostics` when recreating the incremental
|
|
546
|
+
program so config-level errors are surfaced rather than swallowed
|
|
547
|
+
- Removes a stale `compilerOptionOverrides` spread that was clobbering
|
|
548
|
+
user-provided compiler options
|
|
549
|
+
- Caches the package.json dependency read as a lazy promise to avoid
|
|
550
|
+
repeated file reads across multiple calls
|
|
551
|
+
- Adds tests covering the --force bypass and the new-file rootNames
|
|
552
|
+
insertion, including a guard against duplicate entries
|
|
553
|
+
|
|
554
|
+
* **dts:** fix identifier rename whitespace bug and optimise directory lookups (1321f065be435d37cfd524e2bd11908e4c57c5db)
|
|
555
|
+
- Fixes a bug where renaming conflicting exported identifiers consumed
|
|
556
|
+
leading trivia (whitespace), turning `type Options` into `typeOptions$1`;
|
|
557
|
+
replaces `node.pos` with `node.getStart()` which excludes trivia
|
|
558
|
+
- Removes an erroneous `isModuleBlock` recursion in identifier collection
|
|
559
|
+
that could cause duplicate or mis-scoped renames, and drops its import
|
|
560
|
+
- Replaces the O(n) linear scan on every `directoryExists` call with an
|
|
561
|
+
O(1) pre-computed `Set` of all ancestor directory paths, built once
|
|
562
|
+
after declaration files are loaded
|
|
563
|
+
- Removes the fragile on-demand lazy loading of external declaration files
|
|
564
|
+
from within the import-resolution loop
|
|
565
|
+
- Replaces the manual collect-sort-apply transformation pattern in
|
|
566
|
+
`postProcess` with direct `MagicString` edits during the AST walk,
|
|
567
|
+
removing the `CodeTransformation` type and its reverse-order comparator
|
|
568
|
+
- Adds a regression test for the whitespace-preservation fix
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
### Code Refactoring
|
|
572
|
+
|
|
573
|
+
* clean up dead code and simplify type constraints (3ccfd81f146b968ed1e4af46971927261a9eea36)
|
|
574
|
+
- Relaxes overly strict self-referential generic constraints on
|
|
575
|
+
`TypedFunction` and `OptionalReturn` to use a simpler upper bound,
|
|
576
|
+
eliminating circular constraint errors
|
|
577
|
+
- Removes unused recursive JSON utility types (`JsonArray`, `JsonObject`,
|
|
578
|
+
`JsonValue`) that were never consumed outside the type file
|
|
579
|
+
- Removes the `NodeType` string-literal constant and its export, which
|
|
580
|
+
was dead code left over from an earlier ESTree-based AST walking approach
|
|
581
|
+
- Removes its corresponding test coverage
|
|
582
|
+
- Updates the debounce module to drop the now-unnecessary `TypedFunction`
|
|
583
|
+
import and inlines a more precise constraint directly on the method
|
|
584
|
+
|
|
585
|
+
## [1.0.2](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.0.1...v1.0.2) (2026-02-24)
|
|
586
|
+
|
|
587
|
+
### Bug Fixes
|
|
588
|
+
|
|
589
|
+
* **ci:** attach npm package tarball to github release (b0c0c49a868eabf7da9d86608c8d53f6056cb201)
|
|
590
|
+
|
|
591
|
+
## [1.0.1](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.0.0...v1.0.1) (2026-02-24)
|
|
592
|
+
|
|
593
|
+
### Bug Fixes
|
|
594
|
+
|
|
595
|
+
* **ci:** add registry-url to setup-node for trusted publisher OIDC (420d5200bf0685b57d2713fe59bebae49981fdfe)
|
|
596
|
+
* **ci:** use exec plugin for npm publish to support trusted publishers (89efe130d17d417962a3b27735990629343ee11c)
|
|
597
|
+
|
|
598
|
+
# Changelog
|
|
599
|
+
|
|
600
|
+
## 1.0.0 (2026-02-16)
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
### Features
|
|
604
|
+
|
|
605
|
+
* initial release ([8a49106](https://github.com/D1g1talEntr0py/tsbuild/commit/8a49106dcc03c911b1670ed07e86c29717007a26))
|
package/README.md
CHANGED
|
@@ -350,7 +350,7 @@ If a directory is provided, all files within will be used as entry points.
|
|
|
350
350
|
|
|
351
351
|
When `entryPoints` is omitted entirely, tsbuild automatically infers entry points from `package.json` by reverse-mapping output paths back to their source files. Resolution order:
|
|
352
352
|
|
|
353
|
-
1. **`exports`** - Subpath export map (wildcard patterns are skipped; `import
|
|
353
|
+
1. **`exports`** - Subpath export map (wildcard patterns are skipped; `import`, `node`, `module`, and `default` conditions are tried in order)
|
|
354
354
|
2. **`bin`** - Binary entry points
|
|
355
355
|
3. **`main`** / **`module`** - Legacy fallback (only used when `exports` and `bin` produce no results)
|
|
356
356
|
|
|
@@ -549,12 +549,12 @@ The TypeScript declaration bundling system was originally inspired by rollup-plu
|
|
|
549
549
|
- **[TypeScript](https://www.typescriptlang.org/)** - Type checking, declaration generation, and module resolution
|
|
550
550
|
- **[SWC](https://swc.rs/)** - Optional decorator metadata transformation
|
|
551
551
|
- **[magic-string](https://github.com/Rich-Harris/magic-string)** - Efficient source code transformation with sourcemap support
|
|
552
|
-
- **[watchr](https://github.com/
|
|
552
|
+
- **[watchr](https://github.com/D1g1talEntr0py/watchr)** - File watching for watch mode
|
|
553
553
|
|
|
554
554
|
## Limitations
|
|
555
555
|
|
|
556
556
|
- **ESM Only** - No CommonJS support by design
|
|
557
|
-
- **Node.js
|
|
557
|
+
- **Node.js 22+** - Requires a modern Node.js version
|
|
558
558
|
- **Personal project** - Works well for my use cases, but hasn't been tested across every environment or edge case
|
|
559
559
|
- **Plugins are programmatic only** - Custom esbuild plugins can't be declared in `tsconfig.json`; they require using the `TypeScriptProject` API directly
|
|
560
560
|
- **tsBuildInfoFile Path Changes** - When changing the `tsBuildInfoFile` path in `tsconfig.json`, the old `.tsbuildinfo` file at the previous location will not be automatically cleaned up and must be manually removed
|
|
@@ -61,8 +61,6 @@ var compilerOptionOverrides = {
|
|
|
61
61
|
checkJs: false,
|
|
62
62
|
// Skip declaration map generation. TODO - Would love to figure out how to combine them into a single file / entry point
|
|
63
63
|
declarationMap: false,
|
|
64
|
-
// Force .d.ts output to outDir so the bundler can reliably find declaration files
|
|
65
|
-
declarationDir: void 0,
|
|
66
64
|
// Skip type-checking all dependencies
|
|
67
65
|
skipLibCheck: true,
|
|
68
66
|
// Ensure TS2742 errors are visible when `true`. TODO - Figure out how to have this work with a value of `true`
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
toEsTarget,
|
|
30
30
|
toJsxRenderingMode,
|
|
31
31
|
typeMatcher
|
|
32
|
-
} from "./
|
|
32
|
+
} from "./7FPDHUPW.js";
|
|
33
33
|
|
|
34
34
|
// src/errors.ts
|
|
35
35
|
import { SyntaxKind } from "typescript";
|
|
@@ -318,10 +318,12 @@ var Logger = class _Logger {
|
|
|
318
318
|
}
|
|
319
319
|
/**
|
|
320
320
|
* Logs a header box with a message.
|
|
321
|
+
* The header is styled with a cyan border and the message is centered inside. ANSI escape codes are stripped from the message when calculating the width to ensure proper formatting.
|
|
322
|
+
* This ensures the header box is sized correctly even when the message contains color codes or other formatting.
|
|
321
323
|
* @param message The message to display in the header.
|
|
322
324
|
*/
|
|
323
325
|
static header(message) {
|
|
324
|
-
const innerWidth = message.length + 2;
|
|
326
|
+
const innerWidth = message.replace(new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*m`, "g"), "").length + 2;
|
|
325
327
|
console.log(TextFormat.cyan(`\u256D${"\u2500".repeat(innerWidth)}\u256E${newLine}\u2502 ${message} \u2502${newLine}\u2570${"\u2500".repeat(innerWidth)}\u256F`));
|
|
326
328
|
}
|
|
327
329
|
/**
|
|
@@ -345,10 +347,14 @@ var Logger = class _Logger {
|
|
|
345
347
|
* @param steps The sub-steps to log.
|
|
346
348
|
*/
|
|
347
349
|
static subSteps(steps) {
|
|
348
|
-
const
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
350
|
+
const visible = steps.filter(({ ms }) => ms >= 5);
|
|
351
|
+
if (visible.length === 0) {
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
const maxNameLength = visible.reduce((max, { name }) => Math.max(max, name.length), 0);
|
|
355
|
+
const maxDurationLength = visible.reduce((max, { duration }) => Math.max(max, duration.length), 0);
|
|
356
|
+
for (let i = 0, length = visible.length; i < length; i++) {
|
|
357
|
+
const { name, duration } = visible[i];
|
|
352
358
|
const prefix = i === length - 1 ? " \u2514\u2500" : " \u251C\u2500";
|
|
353
359
|
console.log(`${TextFormat.dim(prefix)} ${TextFormat.bold(name.padEnd(maxNameLength))} ${TextFormat.cyan(duration.padStart(maxDurationLength))}`);
|
|
354
360
|
}
|
|
@@ -1595,8 +1601,8 @@ _PerformanceLogger = __decorateElement(_init, 0, "PerformanceLogger", _Performan
|
|
|
1595
1601
|
__runInitializers(_init, 1, _PerformanceLogger);
|
|
1596
1602
|
var PerformanceLogger = _PerformanceLogger;
|
|
1597
1603
|
var measure = new PerformanceLogger().measure;
|
|
1598
|
-
function addPerformanceStep(name,
|
|
1599
|
-
pendingSteps.push({ name, duration });
|
|
1604
|
+
function addPerformanceStep(name, ms) {
|
|
1605
|
+
pendingSteps.push({ name, duration: `${ms}ms`, ms });
|
|
1600
1606
|
}
|
|
1601
1607
|
|
|
1602
1608
|
// src/decorators/debounce.ts
|
|
@@ -1831,9 +1837,9 @@ var FileManager = class {
|
|
|
1831
1837
|
this.pendingBuildInfo = { path: filePath, text };
|
|
1832
1838
|
} else {
|
|
1833
1839
|
this.pendingFiles.push({ path: filePath, text });
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1840
|
+
if (!this.hasEmittedFiles) {
|
|
1841
|
+
this.hasEmittedFiles = true;
|
|
1842
|
+
}
|
|
1837
1843
|
}
|
|
1838
1844
|
};
|
|
1839
1845
|
/**
|
|
@@ -2059,7 +2065,7 @@ var globCharacters = /[*?\\[\]!].*$/;
|
|
|
2059
2065
|
var domPredicate = (lib) => lib.toUpperCase() === "DOM";
|
|
2060
2066
|
var diagnosticsHost = { getNewLine: () => sys2.newLine, getCurrentDirectory: sys2.getCurrentDirectory, getCanonicalFileName: (fileName) => fileName };
|
|
2061
2067
|
var _triggerRebuild_dec, _processDeclarations_dec, _transpile_dec, _typeCheck_dec, _build_dec, _TypeScriptProject_decorators, _init3;
|
|
2062
|
-
_TypeScriptProject_decorators = [closeOnExit], _build_dec = [measure("Build")], _typeCheck_dec = [measure("Type-checking")], _transpile_dec = [measure("Transpile", true)], _processDeclarations_dec = [measure("
|
|
2068
|
+
_TypeScriptProject_decorators = [closeOnExit], _build_dec = [measure("Build")], _typeCheck_dec = [measure("Type-checking")], _transpile_dec = [measure("Transpile", true)], _processDeclarations_dec = [measure("Bundle Declarations", true)], _triggerRebuild_dec = [debounce(100)];
|
|
2063
2069
|
var _TypeScriptProject = class _TypeScriptProject {
|
|
2064
2070
|
/**
|
|
2065
2071
|
* Creates a TypeScript project and prepares it for building/bundling.
|
|
@@ -2098,7 +2104,8 @@ var _TypeScriptProject = class _TypeScriptProject {
|
|
|
2098
2104
|
return Files.empty(this.buildConfiguration.outDir);
|
|
2099
2105
|
}
|
|
2100
2106
|
async build() {
|
|
2101
|
-
|
|
2107
|
+
const tsLogo = TextFormat.bgBlue(TextFormat.bold(TextFormat.whiteBright(" TS ")));
|
|
2108
|
+
Logger.header(`${tsLogo} tsbuild v${"1.6.1"}${this.configuration.compilerOptions.incremental && this.configuration.buildCache?.isValid() ? " [incremental]" : ""}`);
|
|
2102
2109
|
try {
|
|
2103
2110
|
const processes = [];
|
|
2104
2111
|
const filesWereEmitted = await this.typeCheck();
|
|
@@ -2148,7 +2155,7 @@ var _TypeScriptProject = class _TypeScriptProject {
|
|
|
2148
2155
|
performance2.mark("finalize:start");
|
|
2149
2156
|
const result = this.fileManager.finalize();
|
|
2150
2157
|
addPerformanceStep("Finalize", _TypeScriptProject.elapsed("finalize:start"));
|
|
2151
|
-
return result;
|
|
2158
|
+
return result || !this.configuration.compilerOptions.declaration;
|
|
2152
2159
|
}
|
|
2153
2160
|
async transpile() {
|
|
2154
2161
|
const plugins = [outputPlugin()];
|
|
@@ -2157,7 +2164,7 @@ var _TypeScriptProject = class _TypeScriptProject {
|
|
|
2157
2164
|
}
|
|
2158
2165
|
if (this.configuration.compilerOptions.emitDecoratorMetadata) {
|
|
2159
2166
|
try {
|
|
2160
|
-
const { swcDecoratorMetadataPlugin } = await import("./
|
|
2167
|
+
const { swcDecoratorMetadataPlugin } = await import("./LEZQQWX3.js");
|
|
2161
2168
|
plugins.push(swcDecoratorMetadataPlugin);
|
|
2162
2169
|
} catch {
|
|
2163
2170
|
throw new ConfigurationError("emitDecoratorMetadata is enabled but @swc/core is not installed. Install it with: pnpm add -D @swc/core");
|
|
@@ -2484,14 +2491,14 @@ var _TypeScriptProject = class _TypeScriptProject {
|
|
|
2484
2491
|
/**
|
|
2485
2492
|
* Calculates elapsed time since a performance mark and clears the mark.
|
|
2486
2493
|
* @param markName - The name of the performance mark to measure from
|
|
2487
|
-
* @returns
|
|
2494
|
+
* @returns Elapsed time in milliseconds
|
|
2488
2495
|
*/
|
|
2489
2496
|
static elapsed(markName) {
|
|
2490
2497
|
const endMark = performance2.mark(`${markName}:end`);
|
|
2491
|
-
const
|
|
2498
|
+
const ms = ~~(endMark.startTime - performance2.getEntriesByName(markName, "mark")[0].startTime);
|
|
2492
2499
|
performance2.clearMarks(markName);
|
|
2493
2500
|
performance2.clearMarks(endMark.name);
|
|
2494
|
-
return
|
|
2501
|
+
return ms;
|
|
2495
2502
|
}
|
|
2496
2503
|
};
|
|
2497
2504
|
_init3 = __decoratorStart(null);
|
package/dist/index.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ type ClosableConstructor = Constructor<any[], Closable>;
|
|
|
44
44
|
type PerformanceSubStep = {
|
|
45
45
|
name: string;
|
|
46
46
|
duration: string;
|
|
47
|
+
ms: number;
|
|
47
48
|
};
|
|
48
49
|
type PerformanceEntryDetail<T = unknown[]> = {
|
|
49
50
|
message: string;
|
|
@@ -242,7 +243,6 @@ type CompilerOptionOverrides = Readonly<{
|
|
|
242
243
|
allowJs: false;
|
|
243
244
|
checkJs: false;
|
|
244
245
|
declarationMap: false;
|
|
245
|
-
declarationDir: undefined;
|
|
246
246
|
skipLibCheck: true;
|
|
247
247
|
preserveSymlinks: false;
|
|
248
248
|
target: ScriptTarget.ESNext;
|
|
@@ -352,7 +352,7 @@ declare class TypeScriptProject implements Closable {
|
|
|
352
352
|
/**
|
|
353
353
|
* Calculates elapsed time since a performance mark and clears the mark.
|
|
354
354
|
* @param markName - The name of the performance mark to measure from
|
|
355
|
-
* @returns
|
|
355
|
+
* @returns Elapsed time in milliseconds
|
|
356
356
|
*/
|
|
357
357
|
private static elapsed;
|
|
358
358
|
}
|
package/dist/index.js
CHANGED
package/dist/tsbuild.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
BuildError,
|
|
4
4
|
TypeScriptProject
|
|
5
|
-
} from "./
|
|
6
|
-
import "./
|
|
5
|
+
} from "./W52DJ7GZ.js";
|
|
6
|
+
import "./7FPDHUPW.js";
|
|
7
7
|
|
|
8
8
|
// src/tsbuild.ts
|
|
9
9
|
import { sys } from "typescript";
|
|
@@ -30,7 +30,7 @@ if (help) {
|
|
|
30
30
|
process.exit(0);
|
|
31
31
|
}
|
|
32
32
|
if (version) {
|
|
33
|
-
console.log("1.
|
|
33
|
+
console.log("1.6.1");
|
|
34
34
|
process.exit(0);
|
|
35
35
|
}
|
|
36
36
|
var typeScriptOptions = {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d1g1tal/tsbuild",
|
|
3
3
|
"author": "D1g1talEntr0py",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.6.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "A fast, ESM-only TypeScript build tool combining the TypeScript API for type checking and declaration generation, esbuild for bundling, and SWC for decorator metadata.",
|
|
7
7
|
"homepage": "https://github.com/D1g1talEntr0py/tsbuild#readme",
|
|
@@ -36,30 +36,33 @@
|
|
|
36
36
|
"./dist",
|
|
37
37
|
"./schema.json",
|
|
38
38
|
"README.md",
|
|
39
|
+
"CHANGELOG.md",
|
|
39
40
|
"LICENSE"
|
|
40
41
|
],
|
|
41
42
|
"bin": {
|
|
42
43
|
"tsbuild": "./dist/tsbuild.js"
|
|
43
44
|
},
|
|
44
45
|
"dependencies": {
|
|
45
|
-
"@d1g1tal/watchr": "1.0.
|
|
46
|
-
"esbuild": "^0.27.
|
|
46
|
+
"@d1g1tal/watchr": "^1.0.3",
|
|
47
|
+
"esbuild": "^0.27.4",
|
|
47
48
|
"magic-string": "^0.30.21"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|
|
51
|
+
"@babel/plugin-proposal-decorators": "^7.29.0",
|
|
50
52
|
"@eslint/js": "^10.0.1",
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
53
|
-
"@typescript-eslint/
|
|
54
|
-
"@
|
|
53
|
+
"@rolldown/plugin-babel": "^0.2.2",
|
|
54
|
+
"@types/node": "^25.5.0",
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "^8.57.1",
|
|
56
|
+
"@typescript-eslint/parser": "^8.57.1",
|
|
57
|
+
"@vitest/coverage-v8": "^4.1.0",
|
|
55
58
|
"eslint": "^10.0.3",
|
|
56
|
-
"eslint-plugin-jsdoc": "^62.
|
|
59
|
+
"eslint-plugin-jsdoc": "^62.8.0",
|
|
57
60
|
"fs-monkey": "^1.1.0",
|
|
58
61
|
"memfs": "^4.56.11",
|
|
59
62
|
"tsx": "^4.21.0",
|
|
60
|
-
"typescript": "5.9.3",
|
|
61
|
-
"typescript-eslint": "^8.
|
|
62
|
-
"vitest": "^4.0
|
|
63
|
+
"typescript": "^5.9.3",
|
|
64
|
+
"typescript-eslint": "^8.57.1",
|
|
65
|
+
"vitest": "^4.1.0"
|
|
63
66
|
},
|
|
64
67
|
"keywords": [
|
|
65
68
|
"typescript",
|
|
@@ -76,6 +79,7 @@
|
|
|
76
79
|
"type-check": "tsx ./src/tsbuild.ts --noEmit",
|
|
77
80
|
"lint": "eslint ./src",
|
|
78
81
|
"test": "vitest run",
|
|
79
|
-
"test:coverage": "vitest run --coverage"
|
|
82
|
+
"test:coverage": "vitest run --coverage",
|
|
83
|
+
"test:watch": "vitest"
|
|
80
84
|
}
|
|
81
85
|
}
|