fastly/cli

[FEATURE REQUEST] `compute pack --manifest`

jmoney opened this issue ยท 4 comments

Is your feature request related to a problem? Please describe.
I'm working in a monorepo for fastly compute services. All the fastly compute commands expect the manifest file to be fastly.toml in the CWD. Further more, the package expects the same but also the binary to be named bin/main.wasm. I've worked around most of the issues but packing the package has some hoops that need to be done.

Describe the solution you'd like
It'd be great is fastly compute pack in addition to taking the require parameter wasm-binary if it also took an optional --manifest parameter that was the location of the manifest file instead of assuming fastly.toml

Describe alternatives you've considered
Currently my work around is when building the various packages in the monorepo we copy the manifest and the wasm binary to /tmp before building the compressed tar file.

I'll gladly make the necessary changes to pack if this proposal is accepted so making the issue first to discuss and a way for me not to forget :D

๐Ÿ‘‹๐Ÿป Hi @jmoney

Thanks for raising this issue.

I'll gladly make the necessary changes to pack if this proposal is accepted so making the issue first to discuss and a way for me not to forget :D

I'm always happy to see contributions ๐Ÿ™‚ so thank you for offering!

Yes, that's fine to add to the pack subcommand. If you're happy to go ahead and implement that feature I'd happily review ๐Ÿ‘๐Ÿป

Hi! ๐Ÿ‘‹
May I have this assigned to me? I'd like to work on this :)

๐Ÿ‘‹๐Ÿป Hi @andrebenedetti

I've assigned this issue to you now. Many thanks for offering to help implement ๐Ÿ™‚

The manifest file is loaded on cmd/fastly/main.go in alignment with the comment in that file

        // we parameterize all of the dependencies so we can
	// test it more easily. Here, we declare all of the dependencies, using
	// the "real" versions that pull e.g. actual commandline arguments, the
	// user's real environment, etc.

Would you rather accept a --manifest flag alongside with --verbose and --auto-yes to be parsed in the main file or is it preferred to have it as a flag inside the pack subcommand and load the manifest file somewhere around fastly compute is handled? I tend to prefer the latter approach ๐Ÿค”
Also, if you see any other options, let me know