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

feat: add `ignore` option to ignore files from build #68

Closed Mikescops closed 2 months ago

Mikescops commented 3 months ago

Fixes #67

This is an attempt to solve the issue #67 by adding a new option in pkg called ignore, it let's define regex paths that will avoid files matching them to be included in the final bundle.

Feel free to add comments and suggestions on how to improve the logic, I have included a simple test as a demo.

Mikescops commented 3 months ago

Please also update README.md to document the new setting

Done and I made changes requested.

robertsLando commented 3 months ago

@Mikescops Tests are failing: https://github.com/yao-pkg/pkg/actions/runs/9320724918/job/25736985706?pr=68#step:8:25

I think the problem is that pnpm has dropped support for nodej 16 and we don't specify a specific pnpm version so it installs latest and so that error. Could you fix please?

Mikescops commented 3 months ago

@robertsLando done

Mikescops commented 2 months ago

There is a last error unrelated to this PR, still concerning pnpm, on windows that fails. If you have ideas.

https://github.com/yao-pkg/pkg/actions/runs/9353352423/job/25743740134

robertsLando commented 2 months ago

@Mikescops EINVAL suggests there is a wrong argument passed to the command, I'm not a windows guy so I cannot help much here but I maybe for some reason npx on widows doesn't correctly parse the @8?

Mikescops commented 2 months ago

So (18.x, windows-latest) is still breaking on this thing, it's hitting my nerves.

But the (16.x, windows-latest) is failing on my new tests, probably due to paths with \

Mikescops commented 2 months ago

Found this: https://github.com/nexe/nexe/issues/1091

will try

Mikescops commented 2 months ago

We got there 😅 thanks

robertsLando commented 2 months ago

Thanks to you 🙏🏼

Mikescops commented 2 months ago

@robertsLando can you tag a new release with the change? thanks 🙏

robertsLando commented 2 months ago

Sure, 5.12.0 it's coming now