drop decorators and build with tsdown - #21
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #21 +/- ##
=========================================
+ Coverage 3.81% 3.93% +0.11%
=========================================
Files 11 9 -2
Lines 236 229 -7
Branches 35 35
=========================================
Hits 9 9
+ Misses 198 191 -7
Partials 29 29
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #20.
The decorators were the only thing keeping tvt on swc. oxc does not transform stage-3 decorators, so device.js came out of tsdown with
@auth get version()still in it and node refused to parse the file. Rather than wait for oxc, the two decorators are gone.@authguarded five members by throwing when userId is unset. That is now a#requireAuth()private method called as the first statement of version, getInfo, logout, triggerAlarm and saveSnapshot. Same error, same message, same ordering relative to the method body.@measurehad a single use, on login, so the timing is inlined there. One behaviour change worth noting: the decorator called performance.now() around the synchronous call and logged before the promise settled, so for an async method it was reporting time-to-promise, effectively nothing. It now measures the awaited login and logs on success only, which is what thetvt:perfline always claimed to report.With the decorators gone the build moves to tsdown, matching the template: .swcrc, tsconfig.build.json and the prebuild/postbuild/build:swc/build:types script chain are deleted, along with @swc/cli, @swc/core, rimraf and @2bad/tsfix (npm reports the last one as deprecated). publint and attw now run as part of every build and both pass. pnpm-workspace.yaml switches the release age exclusion to the template's
@2bad/*wildcard.Verified: check, build and the 13 unit tests pass, the emitted device.js has no decorator syntax left and all five #requireAuth call sites survive the transform, and importing the built entry works. The class still cannot be instantiated without the native SDK and a device, so the guard has no unit test, same as before.