Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protoc-gen-ts_proto no longer points to the correct plugin location in version 2.0.0 #1090

Closed
harrychap opened this issue Aug 16, 2024 · 7 comments

Comments

@harrychap
Copy link

Noticed when using with gradle like this:

protobuf {
    plugins {
        ts {
            path = './node_modules/ts-proto/protoc-gen-ts_proto'
        }
    }
    generateProto.finalizedBy copyGeneratedProto
    protoc {
        artifact = "com.google.protobuf:protoc:${protobufVersion}"
    }
    generateProtoTasks {
        all().each { task ->
            task.plugins {
                js {
                    option "import_style=commonjs"
                    option "binary"
                }
                ts {
                }
            }
        }
    }
}

It fails with this path ./node_modules/ts-proto/protoc-gen-ts_proto

Error: Cannot find module './build/plugin'

because build is now './build/src/plugin'

@stephenh
Copy link
Owner

Shoot! Thanks for the report @harrychap , will take a look. I had tried to release 2.0 as an alpha, but it didn't work , and told npm to unpublish it, but that doesn't seem to have worked 😬

@stephenh
Copy link
Owner

Okay, I pushed out a fix -- @harrychap if you could confirm it works, that would be great! Thank you!

@harrychap
Copy link
Author

hmm might be more to it than that actually @stephenh
> protoc: stdout: . stderr: FAILED!Cannot find module '../package.json'
Which I think relates to this https://github.com/stephenh/ts-proto/blob/main/src/utils.ts#L334

@stephenh
Copy link
Owner

😬 sorry guys, as you can tell, I don't have a great project-in-the-wild to actually test these things, and our CI pipeline isn't picking them up.

I'll merge #1091 as soon as it passes CI and please do report back! 🙏 🤞

@wakingrufus
Copy link

It is working for me now

@wakingrufus
Copy link

Thanks for the quick fix!

@stephenh
Copy link
Owner

Whew! Thanks for confirming @wakingrufus ! Going to close this out, but happy to address any more issues/gotchas. 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants