Skip to content

Commit

Permalink
BREAKING: Upgrade to Yarn 3
Browse files Browse the repository at this point in the history
  • Loading branch information
mhassan1 committed Aug 4, 2021
1 parent 10bdc94 commit b902999
Show file tree
Hide file tree
Showing 16 changed files with 2,519 additions and 1,050 deletions.
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ bundles/**

# Ignore yarn artifacts
.yarn/
.pnp.js
.pnp.*
356 changes: 321 additions & 35 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions .yarn/plugins/@yarnpkg/plugin-typescript.cjs

Large diffs are not rendered by default.

631 changes: 631 additions & 0 deletions .yarn/releases/yarn-3.0.0.cjs

Large diffs are not rendered by default.

55 changes: 0 additions & 55 deletions .yarn/releases/yarn-sources.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: "@yarnpkg/plugin-typescript"

yarnPath: .yarn/releases/yarn-sources.cjs
yarnPath: .yarn/releases/yarn-3.0.0.cjs
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [0.8.0] - 2021-08-03
[0.8.0]: https://github.com/mhassan1/yarn-plugin-aws-codeartifact/compare/v0.7.6...v0.8.0

- BREAKING: Upgrade to Yarn 3

## [0.7.6] - 2021-04-20
[0.7.6]: https://github.com/mhassan1/yarn-plugin-aws-codeartifact/compare/v0.7.5...v0.7.6

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# `yarn-plugin-aws-codeartifact`

This is a Yarn v2 plugin that resolves authentication for AWS CodeArtifact NPM registries.
This is a Yarn v3 plugin that resolves authentication for AWS CodeArtifact NPM registries.

For Yarn v2 support, install [v0.7.6](https://github.com/mhassan1/yarn-plugin-aws-codeartifact/tree/v0.7.6) or earlier.

## Install

Expand Down
30 changes: 13 additions & 17 deletions bundles/@yarnpkg/plugin-aws-codeartifact.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yarn-plugin-aws-codeartifact",
"version": "0.7.6",
"version": "0.8.0",
"description": "Yarn v2 plugin that resolves authentication for AWS CodeArtifact NPM registries",
"main": "src/index.ts",
"repository": {
Expand Down Expand Up @@ -40,12 +40,12 @@
"@aws-sdk/credential-provider-env": "^3.1.0",
"@aws-sdk/credential-provider-node": "^3.1.0",
"@aws-sdk/property-provider": "^3.1.0",
"@yarnpkg/builder": "^2.1.3",
"@yarnpkg/core": "^2.4.0",
"@yarnpkg/fslib": "^2.4.0",
"@yarnpkg/parsers": "^2.3.0",
"@yarnpkg/plugin-npm": "^2.4.0",
"clipanion": "^2.6.2",
"@yarnpkg/builder": "^3.0.1",
"@yarnpkg/core": "^3.0.0",
"@yarnpkg/fslib": "^2.5.0",
"@yarnpkg/parsers": "^2.4.0",
"@yarnpkg/plugin-npm": "^2.5.0",
"clipanion": "^3.0.1",
"lodash.defaultsdeep": "^4.6.1",
"lodash.get": "^4.4.2",
"yargs-parser": "^20.2.4"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
__metadata:
version: 4
cacheKey: 7
cacheKey: 8

"@types/emscripten@npm:^1.38.0":
version: 1.39.4
resolution: "@types/emscripten@npm:1.39.4::__archiveUrl=https%3A%2F%2Fdomain-test-111111111111.d.codeartifact.us-east-1.amazonaws.com%3A443%2Fnpm%2Frepo-test%2F%40types%2Femscripten%2F-%2Femscripten-1.39.4.tgz"
checksum: b848421e2597a0ce56b74c6427f843cfd8f26dec8eaaa1929317e9417bc06eaa934057c317cbb561ade2f5462b6906e37868608211e09f9f507dca62066795a8
checksum: 7a51e08b2230b9b8f29db095703499c0c7a8e8195d5de288fc8583f4599f07172d700df89931e26eaab4f54ccc114d266373da6d15a711ef7a41b2dd6d450ccf
languageName: node
linkType: hard

"is-promise@npm:^4.0.0":
version: 4.0.0
resolution: "is-promise@npm:4.0.0::__archiveUrl=https%3A%2F%2Fdomain-test-000000000000.d.codeartifact.us-east-1.amazonaws.com%3A443%2Fnpm%2Frepo-test%2Fis-promise%2F-%2Fis-promise-4.0.0.tgz"
checksum: 7085bdc4eaff389c5730a1d54f014880e90ca1e4b7f0a49de9f3c5f5d2fb9e0c3a878ac226d3aa9190bfe4a78400e66d911427ef4812455756293cdb02fb05cf
checksum: 0b46517ad47b00b6358fd6553c83ec1f6ba9acd7ffb3d30a0bf519c5c69e7147c132430452351b8a9fc198f8dd6c4f76f8e6f5a7f100f8c77d57d9e0f4261a8a
languageName: node
linkType: hard

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
__metadata:
version: 4
cacheKey: 7
cacheKey: 8

"@types/emscripten@npm:^1.38.0":
version: 1.39.4
resolution: "@types/emscripten@npm:1.39.4::__archiveUrl=https%3A%2F%2Fdomain-test-111111111111.d.codeartifact.us-east-1.amazonaws.com%3A443%2Fnpm%2Frepo-test%2F%40types%2Femscripten%2F-%2Femscripten-1.39.4.tgz"
checksum: b848421e2597a0ce56b74c6427f843cfd8f26dec8eaaa1929317e9417bc06eaa934057c317cbb561ade2f5462b6906e37868608211e09f9f507dca62066795a8
checksum: 7a51e08b2230b9b8f29db095703499c0c7a8e8195d5de288fc8583f4599f07172d700df89931e26eaab4f54ccc114d266373da6d15a711ef7a41b2dd6d450ccf
languageName: node
linkType: hard

"is-promise@npm:^4.0.0":
version: 4.0.0
resolution: "is-promise@npm:4.0.0::__archiveUrl=https%3A%2F%2Fdomain-test-000000000000.d.codeartifact.us-east-1.amazonaws.com%3A443%2Fnpm%2Frepo-test%2Fis-promise%2F-%2Fis-promise-4.0.0.tgz"
checksum: 7085bdc4eaff389c5730a1d54f014880e90ca1e4b7f0a49de9f3c5f5d2fb9e0c3a878ac226d3aa9190bfe4a78400e66d911427ef4812455756293cdb02fb05cf
checksum: 0b46517ad47b00b6358fd6553c83ec1f6ba9acd7ffb3d30a0bf519c5c69e7147c132430452351b8a9fc198f8dd6c4f76f8e6f5a7f100f8c77d57d9e0f4261a8a
languageName: node
linkType: hard

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@

__metadata:
version: 4
cacheKey: 7
cacheKey: 8

"@types/emscripten@npm:^1.38.0":
version: 1.39.4
resolution: "@types/emscripten@npm:1.39.4"
checksum: b848421e2597a0ce56b74c6427f843cfd8f26dec8eaaa1929317e9417bc06eaa934057c317cbb561ade2f5462b6906e37868608211e09f9f507dca62066795a8
checksum: 7a51e08b2230b9b8f29db095703499c0c7a8e8195d5de288fc8583f4599f07172d700df89931e26eaab4f54ccc114d266373da6d15a711ef7a41b2dd6d450ccf
languageName: node
linkType: hard

"is-promise@npm:^4.0.0":
version: 4.0.0
resolution: "is-promise@npm:4.0.0"
checksum: 7085bdc4eaff389c5730a1d54f014880e90ca1e4b7f0a49de9f3c5f5d2fb9e0c3a878ac226d3aa9190bfe4a78400e66d911427ef4812455756293cdb02fb05cf
checksum: 0b46517ad47b00b6358fd6553c83ec1f6ba9acd7ffb3d30a0bf519c5c69e7147c132430452351b8a9fc198f8dd6c4f76f8e6f5a7f100f8c77d57d9e0f4261a8a
languageName: node
linkType: hard

Expand Down
14 changes: 13 additions & 1 deletion src/authHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,21 @@ type TokenGenerator = (
* TODO Use an appropriate plugin hook when one becomes available (https://github.com/yarnpkg/berry/issues/2067)
*/
const _originalConfigurationFind = Configuration.find
/* istanbul ignore next */
Configuration.find = async function find(...args) {
const configuration = await _originalConfigurationFind(...args)
await maybeSetAuthToken({ configuration })

// do not attempt to set the auth token in non-strict mode
// default configuration values are not available in non-strict mode
// it is used for getting just what is in `.yarnrc.yml`
// for example, https://github.com/yarnpkg/berry/blob/9f9fca071ad1c08ede5e0a2aa3a045fe782b8899/packages/plugin-dlx/sources/commands/dlx.ts#L57
// it will always be followed by a strict request
// for example, https://github.com/yarnpkg/berry/blob/9f9fca071ad1c08ede5e0a2aa3a045fe782b8899/packages/plugin-dlx/sources/commands/dlx.ts#L108
const strict = args[2]?.strict !== false
if (strict) {
await maybeSetAuthToken({ configuration })
}

return configuration
}

Expand Down
3 changes: 2 additions & 1 deletion src/commands/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import URL from 'url'
* Command to migrate a `yarn.lock` file to use AWS CodeArtifact repositories for relevant packages
*/
export class MigrateCommand extends Command<CommandContext> {
@Command.Path('plugin-aws-codeartifact', 'migrate')
static paths = [['plugin-aws-codeartifact', 'migrate']]

async execute(): Promise<0 | 1> {
const configuration = await Configuration.find(this.context.cwd, this.context.plugins)
const streamReport = await StreamReport.start(
Expand Down
Loading

0 comments on commit b902999

Please sign in to comment.