question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Specifying 'publishConfig' in package.json

See original GitHub issue

Use case: Building AWS CDK JSII construct and publishing to company internal Artifactory repository.

It would be good to have a possibility to specify this in package.json:

  "publishConfig": {
    "registry": "https://company.com/api/npm/company-local/"
  },

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
kcwinnercommented, Jan 14, 2021

Wanted to leave a note (based on convo in cdk.dev Slack). This is achievable (though not “native”) currently. You can do something like:

...
project.addFields({
  'publishConfig': { "registry": "https://<ARTIFACT_DOMAIN_NAME>-<ACCOUNT_ID>.d.codeartifact.<REGION>.amazonaws.com/npm/<ARTIFACT_EPOSITORY_NAME>/" }
})

project.synth();

You’ll have to also add an environment variable for the NPM registry. It’s easy in codebuild. For GitHub you’ll have to do something with the actions

I use this for working with AWS CodeCommit. Also tested (but I don’t have an example) with GitHub. Sources / examples:

1reaction
markuslcommented, Nov 2, 2020

In our environments, the developers are instructed to configure their .npmrc with something like this registry = https://companyartifactory.com/api/npm/company-npm-general.

The build environment we are using has a set of NPM credentials that would allow publishing to the internal repository as long as the publishConfig property would be in place.

Read more comments on GitHub >

github_iconTop Results From Across the Web

package.json - npm Docs
Description. This document is all you need to know about what's required in your package.json file. It must be actual JSON, not just...
Read more >
NPM: how to specify registry to publish in the command line?
configure your package.json with a publish config: { ... "publishConfig": { "registry": "http://nexus.dsv.myhost/nexus/repository/npmjs" }, ...
Read more >
Using Github Package Registry : Publish NPM Packages
Using publishConfig in package.json. Edit the package.json file for your package and include a publishConfig entry. "publishConfig": { "registry ...
Read more >
Creating NPM Packages - BJ Anderson
So, I'll start by setting up a private npm repo on my computer, and then, ... I recommend adding the publishConfig setting to...
Read more >
npm packages in the Package Registry - GitLab Docs
npmrc file and by using the publishConfig option in the package.json . The value used for the @scope is the root of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found