mvdan / sh

A shell parser, formatter, and interpreter with bash support; includes shfmt
https://pkg.go.dev/mvdan.cc/sh/v3
BSD 3-Clause "New" or "Revised" License
6.98k stars 332 forks source link

_js: need a new version released again #1018

Closed alvis closed 6 months ago

alvis commented 11 months ago

Similar to #760, the current version is now long outdated again. I've hit an issue with Part become undefined when parsing an arg with quote e.g. command "some quoted arg"

It may be fixed with the go version, but without a new js npm release I'm not sure.

mvdan commented 6 months ago

I checked briefly, and I don't think the Go library has this bug. The bug might well be in the JS code I wrote to expose the interface without blocking calls.

GopherJS has gone mostly unmaintained again, unfortunately; their last release only supports Go 1.18, and at this point we've required Go 1.20 for some time, with 1.21 having been released months ago.

I think continuing to invest energy into a GopherJS-powered library is simply not worth it. It was a neat experiment and it proved useful to some extent to some people, and for that reason I'm inclined to leave it be for now. But I also am not able to continue updating it even if I have the time.

In the medium term I think providing a wasm library will be the more future-proof approach. I know that's not a satisfactory answer to those needing something that works today, but the reality is that GopherJS doesn't work today either.

mvdan commented 6 months ago

You might also want to try https://github.com/un-ts/sh-syntax in the meantime.

alvis commented 6 months ago

Thanks @mvdan Maintaining a lib is not easy and I understand completely. Thanks for the suggestion. Will have a try