When using NPM we can put in the package.json file various Git URLs and GitHub URLs as external dependencies. In Artifactory, under "External Dependency Rewrite" in NPM virtual repository we have an option to rewrite all the external dependencies from the package.json file. We fully support all the external dependencies from the NPM documentation except for the dependency in the following format git+ssh://git@github.com:npm/npm#semver:^5.0 - we don't handle all the semver expressions that are valid for NPM. For example, the dependency git+ssh://git@github.com:npm/npm#semver:4.x.0 is valid for NPM but not valid for Artifactory. We would like to support all semver expressions that are supported by NPM (we already support most of them).
see links attached: https://docs.npmjs.com/files/package.json#git-urls-as-dependencies
https://docs.npmjs.com/misc/semver
To Reproduce:
- create NPM local repository and upload an NPM package with an external dependency in the format mentioned above.
- create NPM virtual repository and in the Advanced tab under "External Dependency Rewrite" set the Enable Dependency Rewrite check box to true. (you also need to create NPM remote repository) and of course point it to your local and remote NPM repositories.
- curl -XGET -uadmin:password http://localhost:8081/artifactory/api/npm/npm-virtual-repo/package-name - this command returns the package.json with your exteranl dependencies rewritten.
- relates to
-
RTFACT-18626 NPM dependency rewrites does not account for "github:user/package" format
- Done