Migrate to ESM and Typescript support
I was looking for a JS framework to build CLI apps alternatively from gluegun because gluegun cannot be compiled into single-file executable. I've tried Seeli using Bun, and it works fine for the Single-file Executable compilation. Except, seeli is not using ESM and doesn't have typescript support.
I will open bounties using Algora for this issue. Hopefully the maintainer or anyone else can pick up this
💎 cloudgakkai is offering a $50 bounty for this issue
👉 Got a pull request resolving this? Claim the bounty by adding @algora-pbc /claim #135 in the PR body and joining algora.io
is this still relevant?
/attempt #135
I don't have much interest in direct bun support. If type script means adding some type definitions, I don't mind that
I've tried Seeli using Bun, and it works fine for the Single-file Executable compilation. Except, seeli is not using ESM and doesn't have typescript support.
@DeVoresyah If it works, can you help me to understand why it is necessary to rewrite the project?
if you wish to add support backward compability for cjs user, typescript rewrite is necessary. otherwise we can just refactor the entire codebase to esm and add typings.
with typescript we can support both esm and cjs
with typescript we can support both esm and cjs
migrating to esm will accomplish that as require supports both esm and cjs. I don't think there is a need for typescript here
My concern with backward / forward compatibility is largely constrained to the previous LTS, and the next LTS of node core.
currently that is Node.JS 20 (previous LTS), 22 (current LTS) and the 24 (next LTS).
all of those versions to my knowledge support what we are talking about here without introducing 3rd party packages, or a complex build / compile phase
with typescript we can support both esm and cjs
migrating to esm will accomplish that as
requiresupports both esm and cjs. I don't think there is a need for typescript here
esm doesnt support require, but esm does support importing cjs package. cjs doesnt support esm package (technically you can but it must be async).
for example if you wanted to support cjs only or esm only we dont have refactor entire codebase. we just change the build options.
rewriting to typescript is easier to write the type definition than adding type definition to exising code base.
backward compability here are meant for previous node-seeli version not nodejs version.
anyway, i will contribute if the bounty are stil relevant.
esm doesnt support require, but esm does support importing cjs package. cjs doesnt support esm package (technically you can but it must be async).
correct, it is the lowest common denominator. If its written in ESM, you can use this package in either a CJS project via require() or await import() or you can use it in an ESM project via import. That is acceptable.
rewriting to typescript is easier to write the type definition than adding type definition to exising code base.
Maybe. But the change I'll accept is adding type definitions, or a conversion to ESM. or both
sure thats fine, ill wait for the author response.