ryansonshine/semantic-release-codeartifact

Add support for namespace option

jamesrusso opened this issue · 3 comments

Feature Request

Is your feature request related to a problem? Please describe.

Our code artifact is only configured for certain prefixes. (ie: @foo/package). AWS Codeartifact calls them namespaces.

When running the aws configuration command from the cli, it does handle this with the --namespace option.

Describe the solution you'd like
Add another option called namespace (to match the codeartifact name), which will setup the .npmrc with the correct prefix. The entry in the .npmrc will just need to be prefixed with the namespace. @namespace:.

Describe alternatives you've considered
Just not using the plugin and manually running the aws codeartifact manually in the pipeline.

Are you willing to resolve this issue by submitting a Pull Request?

Sure, I'll throw something together.

Hi @jamesrusso.

I think this would be a great addition for projects without an existing .npmrc configuration present. A PR is welcome and if you'd like any assistance I should be able to make time this week.

I have a PR in progress, but I'm now not sure it's actually needed.

Since it'll always be published to the scope. The scope on the registry is really only needed when pulling down files.

My use case is that I only have my private packages up in code artifact, so I need the prefix to prevent downloading all the packages from code artifact. So, I certainly need it when I do an npm install. but I don't think I need it when I do a publish?

Happy to discuss more though.

Ah yeah good point.

I agree it shouldn't be required during an npm publish cycle. Assuming your building the package prior to running the release, this feature may not be needed.

Closing for now but happy to reopen if we can think of a use case where the publishing would come before the build.