yao-pkg / pkg

Package your Node.js project into an executable
https://www.npmjs.com/package/@yao-pkg/pkg
MIT License
312 stars 11 forks source link

Roadmap #5

Open rightaway opened 10 months ago

rightaway commented 10 months ago

Is there a roadmap for the fork short term and long term?

Node 20 https://github.com/vercel/pkg-fetch/issues/302

ESM https://github.com/vercel/pkg/issues/1291 https://github.com/vercel/pkg/discussions/1388 https://github.com/vercel/pkg/issues/1655 https://github.com/vercel/pkg/pull/1323

Multiple entry points https://github.com/vercel/pkg/issues/481

XDG directory https://github.com/vercel/pkg/issues/1225

Sharp https://github.com/vercel/pkg/issues/1918

robertsLando commented 10 months ago

No roadmap here, I just started this to allow users contributing to the code and give the project a new life. Do you want to help?

CMCDragonkai commented 10 months ago

We'd definitely like to help. Right now we used to use pkg without a pre-existing bundler, but I think it would be better to simply get users to always use a bundler first like esbuild, then use pkg. It would simplify pkg.

robertsLando commented 10 months ago

Yeah I think that including the pre-bundling inside pkg makes no sense, I would instead write better docs about that process and maybe add examples too

rightaway commented 10 months ago

That will modify stack traces which makes hard to track errors in production. Stack traces with original file names and line numbers are critical and bundling shouldn't be expected by users.

Important thing is to see if someone has expertise to make native ESM support possible.

CMCDragonkai commented 10 months ago

The lack of bundling results in pkg packaging everything include README.md, LICENSE.md files into the executable.

robertsLando commented 10 months ago

Important thing is to see if someone has expertise to make native ESM support possible.

The only one that has the ability to do it (that I know) was @jesec but I didn't heard him from a long time, I know he also had something working with ESM but never finished the implementation.

The future of packaged nodejs apps is Node SEA, Deno and/or Bun IMO once one of this 3 "native" methods become more usable. My goal in the meanwhile is to keep pkg as much updated as possible and give the possibility to the ones that would like to contribute to see their PR merged and not to stay there for years without any response...

Pkg is so hard to maintain only due to the need of building nodejs patches, if in the future we could ever get rid of them that would be awesome but I don't think if it would be ever possible... Also the releases process is complicated and I took some time to write it down on docs: https://github.com/yao-pkg/pkg-fetch/blob/main/DEVELOPMENT.md

rightaway commented 10 months ago

The lack of bundling results in pkg packaging everything include README.md, LICENSE.md files into the executable.

pkg documentation says it can build the executable without sources.

The future of packaged nodejs apps is Node SEA, Deno and/or Bun IMO once one of this 3 "native" methods become more usable.

These methods will include sources.

robertsLando commented 10 months ago

@rightaway Node SEA compiles code in V8 bytecode like pkg does

rightaway commented 10 months ago

I read will be possible to see source in SEA bundle. Documentation don't mention bytecode do you know where you read it?

robertsLando commented 10 months ago

@rightaway https://nodejs.org/api/single-executable-applications.html#single_executable_applications_v8_code_cache_support

rightaway commented 8 months ago

pkg is deprecated and they said there were active forks does anyone know which are the most active?

Infern1 commented 8 months ago

seems this one is the most active for now

robertsLando commented 7 months ago

This one is the most active

jerrygreen commented 5 months ago

I wish Node v20 to be supported 😢

SEA is still early beta, with just basic features, pkg seemed like more production-ready approach.

robertsLando commented 5 months ago

Lol it is from at least 2 months now 🤣

dingiyan commented 4 months ago

Thank you for your branch contribution. I really like and need it. When I learned that the official pkg was no longer being maintained, I was saddened because SEA was not yet fully developed and convenient to use.