feat(yargs): update yargs to 18.0.0
New yargs version bundling is failing, because it is newly ESM-only module:
- It is not included in
esbuildandpkgdoes not patch ESM import paths. - If added into
esbuild, the transpiledimport.meta.urlis empty and execution fails.
Fix this by letting esbuild transpile also yargs to CJS, but provide a sensible value for import.meta.url as mentioned in the esbuild bug report.
While at it, also update @yao-pkg/pkg to support newer Node.js runtime.
Supercedes: #1577
Ha! The yargs locales are probably missing due to this.
Hm. I am able to get also locales working locally, but when packed with pkg, the --help option gets to segmentation fault... I have no solution for this.
I will leave it here in this state, feel free to close it if you do not want to continue on it.
Maybe try Node.js experimental Single Executable Applications?