Closed tmg0 closed 8 months ago
In a way I kinda did not pick TypeScript (or actually any deps) on purpose to keep the workflow simple and predictable - as this library works quite well, and is rather small that doesn't really need much maintenance, I don't see the benefit of introducing TS would justify the risk of breaking stuff, I tend to keep it as-is. Thank you for your effort but I am sorry I don't think we will take it.
Linked Issue
Resolves #255
Description
Refactor with typescript and used
tsup
as the project bundler. Do not need to manually ensure consistency in the logic of different types of JavaScript files likecjs
ormjs
.Remove the
updateVue2API
of postinstall script, and do the ESM replace/**VCA-EXPORTS**/
by a bundler plugin. But I am not quite sure about If do the replacement during bundle instead of postinstall script is a good way.I have tried to run the test script under
.github/test.js
, It seems passed under following environment:OS: windows Node.js: v18.19.1 Package manager: npm (10.2.4) / pnpm (8.15.3)
Test commands:
node .github/test.js "npm" 2.6 commonjs
node .github/test.js "npm" 2.7 commonjs
node .github/test.js "npm" 3 commonjs
node .github/test.js "npm" 2.6 module
node .github/test.js "npm" 2.7 module
node .github/test.js "npm" 3 module
node .github/test.js "pnpm" 2.6 commonjs
node .github/test.js "pnpm" 2.7 commonjs
node .github/test.js "pnpm" 3 commonjs
node .github/test.js "pnpm" 2.6 module
node .github/test.js "pnpm" 2.7 module
node .github/test.js "pnpm" 3 module
And there is a
iife
file under root output dir forjsdelivr
andunpkg
, to minimize the impact of refactoring, I have temporarily disabled TypeScript checking width// @ts-nocheck
and largely copied the code fromindex.iife.js
.But I'm still not quite sure because I haven't found how to test it.
This is a relatively significant change, and I hope it won't affect the original logic. If there are any problems that need to be edited, please let me know.