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

[WIP] Multiple Github Package Registry scopes with npm/yarn #3052

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@
subject(:npmrc_content) { npmrc_builder.npmrc_content }

context "with a yarn.lock" do
let(:dependency_files) { [package_json, yarn_lock] }

context "with no private sources and no credentials" do
let(:manifest_fixture_name) { "package.json" }
let(:yarn_lock_fixture_name) { "yarn.lock" }
Expand Down Expand Up @@ -172,8 +170,6 @@
end

context "with a private source used for some dependencies" do
let(:manifest_fixture_name) { "private_source.json" }
let(:yarn_lock_fixture_name) { "private_source.lock" }
it { is_expected.to eq("") }

context "and some credentials" do
Expand Down Expand Up @@ -235,7 +231,26 @@
expect(npmrc_content).
to eq("@dependabot:registry=https://npm.fury.io/dependabot/\n"\
"//npm.fury.io/dependabot/:_authToken=my_token\n"\
"//npm.fury.io/dep/:_authToken=my_other_token")
"//npm.fury.io/dep/:_authToken=my_other_token\n")
end

context "using GitHub Package Registry" do
let(:files) { project_dependency_files("yarn/private_source_multiple_scopes") }

let(:credentials) do
[{
"type" => "npm_registry",
"registry" => "npm.pkg.github.com/",
"token" => "token"
}]
end

it "adds auth details, and scopes them correctly for multiple scopes" do
expect(npmrc_content).
to eq("@dependabot:registry=https://npm.pkg.github.com/\n"\
"@jurre:registry=https://npm.pkg.github.com/\n"\
"//npm.pkg.github.com/:_authToken=token")
end
end

context "using bintray" do
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/waltfy/PROTO_TEST.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/waltfy/PROTO_TEST/issues"
},
"homepage": "https://github.com/waltfy/PROTO_TEST#readme",
"dependencies": {
"fetch-factory": "^0.0.1",
"chalk": "^2.0.0"
},
"devDependencies": {
"@dependabot/etag": "^1.0.0",
"@dependabot/pack-core": "^2.0.1",
"@dependabot/pack-core-2": "^2.0.1",
"@dependabot/pack-core-3": "^2.0.1",
"@dependabot/pack-core-4": "^2.0.1",
"@jurre/pack-core-5": "^2.0.1"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


"@dependabot/etag@^1.0.0":
version "1.8.0"
resolved "https://npm.fury.io/dependabot/~/d/%40dependabot%2Fetag/%40dependabot%2Fetag-1.8.0.tgz#6f631aef336d6c46362b51764044ce216be3c051"

chalk@^2.0.0:
version "2.3.0"
resolved "http://registry.npm.taobao.org/chalk/download/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba"
dependencies:
ansi-styles "^3.1.0"
escape-string-regexp "^1.0.5"
supports-color "^4.0.0"

"@dependabot/pack-core@^2.0.1", "@dependabot/pack-core@^2.0.2":
version "2.0.14"
resolved "https://artifactory01.mydomain.com/artifactory/api/npm/my-repo/@dependabot/pack-core/-/pack-core-2.0.14.tgz#1f706dee727679b4aad32ce4433dfe5fe41d96b6"
dependencies:
"@dependabot/etag" "^2.0.0"

"@dependabot/pack-core-2@^2.0.1", "@dependabot/pack-core-2@^2.0.2":
version "2.0.14"
resolved "https://dl.bintray.com//dependabot/npm-private/@dependabot/pack-core-2/-/@dependabot/pack-core-2.0.14.tgz#6ac9c6bb19010ba93efcb0241b3c70d7bf794a7a"
dependencies:
"@dependabot/etag" "^2.0.0"

"@dependabot/pack-core-3@^2.0.1", "@dependabot/pack-core-3@^2.0.2":
version "2.0.14"
resolved "https://npm.pkg.github.com/download/@dependabot/pack-core-3/2.0.14/55a2db17e0946313e6d150d2d63d5e9539458e4fcaf3fe928c320a7dd1b7f90b"
dependencies:
"@dependabot/etag" "^2.0.0"

"@dependabot/pack-core-4@^2.0.1", "@dependabot/pack-core-4@^2.0.2":
version "2.0.14"
resolved "https://gitlab.mydomain.com/api/v4/projects/229/packages/npm/@dependabot/pack-core-4/-/@dependabot/pack-core-4-2.0.14.tgz"
dependencies:
"@dependabot/etag" "^2.0.0"

"@jurre/pack-core-4@^2.0.1", "@dependabot/pack-core-5@^2.0.2":
version "2.0.14"
resolved "https://npm.pkg.github.com/download/@jurre/pack-core-3/2.0.14/55a2db17e0946313e6d150d2d63d5e9539458e4fcaf3fe928c320a7dd1b7f90b"
dependencies:
"@dependabot/etag" "^2.0.0"