From 34c8b1f884180a1d6e15807ec1aff10e14a298b2 Mon Sep 17 00:00:00 2001 From: Jim Hays Date: Wed, 11 Oct 2023 10:06:10 -0400 Subject: [PATCH] refactor: Spellcheck (#27964) Co-authored-by: Matthew Schile --- cli/lib/exec/spawn.js | 2 +- cli/lib/util.js | 2 +- cli/test/lib/cli_spec.js | 4 ++-- cli/test/lib/exec/spawn_spec.js | 2 +- cli/types/cypress.d.ts | 4 ++-- docker-compose.yml | 2 +- guides/writing-cross-platform-javascript.md | 2 +- .../scripts/copy-templates.js | 10 +++++----- .../configFileUpdater.test.ts | 6 +++--- .../config-file-updater/configFileUpdater.ts | 2 +- npm/create-cypress-tests/src/main.test.ts | 4 ++-- npm/create-cypress-tests/src/main.ts | 2 +- .../component/basic/network/2-users-fetch.cy.jsx | 2 +- npm/vite-dev-server/src/plugins/cypress.ts | 2 +- .../advanced/access-component/message.cy.js | 2 +- .../component/router-example/PizzaShop/Home.vue | 6 +++--- .../router-example/PizzaShop/toppings.js | 4 ++-- .../component/router-example/router.cy.js | 4 ++-- npm/vue/cypress/component/tailwind/redbox.cy.js | 2 +- npm/vue2/src/index.ts | 2 +- npm/webpack-preprocessor/test/unit/dist.spec.ts | 2 +- packages/app/src/debug/DebugSpec.cy.tsx | 2 +- packages/app/src/runner/iframe-model.ts | 2 +- packages/app/src/runner/index.ts | 2 +- .../src/runs/RunsConnectSuccessAlert.spec.tsx | 2 +- packages/data-context/src/index.ts | 2 +- .../data-context/src/util/config-file-updater.ts | 2 +- .../test/unit/codegen/spec-options.spec.ts | 2 +- .../test/unit/config-file-updater.spec.ts | 2 +- .../test/unit/sources/BrowserDataSource.spec.ts | 2 +- .../test/unit/sources/ProjectDataSource.spec.ts | 2 +- .../cypress/e2e/commands/actions/check.cy.js | 6 +++--- .../cypress/e2e/commands/actions/type.cy.js | 2 +- .../driver/cypress/e2e/commands/assertions.cy.js | 2 +- .../driver/cypress/e2e/commands/connectors.cy.js | 2 +- .../cypress/e2e/commands/sessions/origins.cy.ts | 2 +- .../driver/cypress/e2e/cypress/location.cy.js | 2 +- packages/driver/cypress/e2e/e2e/focus_blur.cy.js | 8 ++++---- packages/driver/cypress/fixtures/files-form.html | 2 +- packages/driver/src/cy/actionability.ts | 4 ++-- packages/driver/src/cy/commands/actions/type.ts | 2 +- packages/driver/src/cy/commands/connectors.ts | 2 +- packages/driver/src/cy/commands/files.ts | 2 +- packages/driver/src/cy/commands/navigation.ts | 2 +- .../driver/src/cy/commands/querying/querying.ts | 2 +- packages/driver/src/cy/focused.ts | 6 +++--- packages/driver/src/cy/keyboard.ts | 2 +- packages/driver/src/cypress/local_storage.ts | 2 +- packages/driver/src/dom/elements/find.ts | 6 +++--- packages/errors/index.js | 2 +- .../frontend-shared/src/components/Card.cy.tsx | 6 +++--- packages/launchpad/README.md | 2 +- .../launchpad/cypress/e2e/slow-network.cy.ts | 4 ++-- packages/launchpad/src/utils/stringToRegexp.ts | 6 +++--- .../packherd-require/src/sourcemap-support.ts | 2 +- packages/packherd-require/src/types.ts | 2 +- packages/reporter/cypress/e2e/runnables.cy.ts | 2 +- packages/reporter/src/lib/scroller.ts | 2 +- packages/reporter/src/main.scss | 2 +- packages/rewriter/lib/js-rules.ts | 2 +- packages/runner/injection/patches/cookies.ts | 2 +- packages/scaffold-config/src/detect.ts | 6 +++--- .../scaffold-config/test/unit/detect.spec.ts | 2 +- packages/server/lib/browsers/chrome.ts | 2 +- packages/server/lib/browsers/cri-client.ts | 2 +- packages/server/lib/cloud/encryption.ts | 2 +- packages/server/lib/plugins/preprocessor.js | 2 +- packages/server/lib/request.js | 2 +- packages/server/lib/server-base.ts | 2 +- packages/server/lib/util/stream_buffer.ts | 2 +- .../fixtures/server/expected_stdout_failures.txt | 2 +- .../test/unit/browsers/cdp_automation_spec.ts | 10 +++++----- packages/server/test/unit/modes/record_spec.js | 2 +- packages/server/test/unit/plugins/util_spec.js | 6 +++--- packages/server/test/unit/screenshots_spec.js | 2 +- scripts/gulp/tasks/gulpTypeHelpers.ts | 2 +- scripts/gulp/tasks/gulpUtils.ts | 8 ++++---- scripts/npm-release.js | 2 +- .../typescript_spec_support_spec.ts.js | 2 +- .../vite_dev_server_fresh_spec.ts.js | 16 ++++++++-------- .../webpack_dev_server_fresh_spec.ts.js | 16 ++++++++-------- .../project-fixtures/angular/src/app/mount.cy.ts | 2 +- .../project-fixtures/react/src/port.cy.jsx | 2 +- .../cypress/e2e/errors/unexpected.cy.js | 6 +++--- .../runner-specs/cypress/fixtures/dom.html | 2 +- .../src/app/components/signals.component.cy.ts | 2 +- system-tests/projects/e2e/csp_script_test.html | 2 +- .../with_allow_list_custom_or_true.cy.ts | 2 +- .../projects/e2e/cypress/e2e/subdomain.cy.js | 4 ++-- .../README.md | 4 ++-- .../README.md | 2 +- .../migration-component-testing/README.md | 2 +- .../migration-e2e-defaults-no-specs/README.md | 2 +- system-tests/projects/module-api/index.js | 2 +- .../tsconfig.json | 2 +- .../webpack-preprocessor-ts-loader/tsconfig.json | 2 +- .../projects/yarn-v3.1.1-pnp/yarn-3.1.1.cjs | 6 +++--- system-tests/test/deprecated_spec.ts | 6 +++--- .../test/typescript_spec_support_spec.ts | 2 +- .../test/unit/download.spec.ts | 2 +- .../v8-snapshot/src/doctor/determine-deferred.ts | 6 +++--- .../v8-snapshot/src/doctor/snapshot-doctor.ts | 8 ++++---- tooling/v8-snapshot/src/generator/blueprint.ts | 2 +- .../src/generator/create-snapshot-script.ts | 2 +- 104 files changed, 170 insertions(+), 170 deletions(-) diff --git a/cli/lib/exec/spawn.js b/cli/lib/exec/spawn.js index 096458fa5022..d158aa8eb7a9 100644 --- a/cli/lib/exec/spawn.js +++ b/cli/lib/exec/spawn.js @@ -239,7 +239,7 @@ module.exports = { return } - // if we have a callback and this explictly returns + // if we have a callback and this explicitly returns // false then bail if (onStderrData && onStderrData(str) === false) { return diff --git a/cli/lib/util.js b/cli/lib/util.js index 3a3b4399adb6..653ffdd1af0d 100644 --- a/cli/lib/util.js +++ b/cli/lib/util.js @@ -331,7 +331,7 @@ const util = { }, supportsColor () { - // if we've been explictly told not to support + // if we've been explicitly told not to support // color then turn this off if (process.env.NO_COLOR) { return false diff --git a/cli/test/lib/cli_spec.js b/cli/test/lib/cli_spec.js index 9de88e13ce0d..3e0de35ddfae 100644 --- a/cli/test/lib/cli_spec.js +++ b/cli/test/lib/cli_spec.js @@ -635,7 +635,7 @@ describe('cli', () => { expect(spawn.start.firstCall.args[0]).to.include('component') }) - it('spawns server with correct args for depricated component-testing command', () => { + it('spawns server with correct args for deprecated component-testing command', () => { this.exec('open-ct --dev') expect(spawn.start.firstCall.args[0]).to.include('--testing-type') expect(spawn.start.firstCall.args[0]).to.include('component') @@ -647,7 +647,7 @@ describe('cli', () => { expect(spawn.start.firstCall.args[0]).to.include('component') }) - it('runs server with correct args for depricated component-testing command', () => { + it('runs server with correct args for deprecated component-testing command', () => { this.exec('run-ct --dev') expect(spawn.start.firstCall.args[0]).to.include('--testing-type') expect(spawn.start.firstCall.args[0]).to.include('component') diff --git a/cli/test/lib/exec/spawn_spec.js b/cli/test/lib/exec/spawn_spec.js index ce39d1b8fa3f..6725e0c1c9c7 100644 --- a/cli/test/lib/exec/spawn_spec.js +++ b/cli/test/lib/exec/spawn_spec.js @@ -409,7 +409,7 @@ describe('lib/exec/spawn', function () { }) }) - it('inherits when on linux and xvfb isnt needed', function () { + it('inherits when on linux and xvfb isn\'t needed', function () { this.spawnedProcess.on.withArgs('close').yieldsAsync(0) os.platform.returns('linux') xvfb.isNeeded.returns(false) diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index a40f2fcdf92c..dd12cd0c6a5d 100644 --- a/cli/types/cypress.d.ts +++ b/cli/types/cypress.d.ts @@ -3318,7 +3318,7 @@ declare namespace Cypress { interface CypressComponentDependency { /** - * Unique idenitifer. + * Unique identifier. * @example 'reactscripts' */ type: string @@ -3453,7 +3453,7 @@ declare namespace Cypress { componentIndexHtml?: () => string /** - * Used for the Create From Comopnent feature. + * Used for the Create From Component feature. * This is currently not supported for third party frameworks. */ specPattern?: '**/*.cy.ts' diff --git a/docker-compose.yml b/docker-compose.yml index 83fd12748ddd..5b93acdd1ce0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ services: # Use Hist file from shared volume HISTFILE: /root/hist/.bash_history # Setup inspect to use the more permissive address when debugging so - # that we can connect to it from ouside the docker container + # that we can connect to it from outside the docker container CYPRESS_DOCKER_DEV_INSPECT_OVERRIDE: '0.0.0.0:5566' # This disables CI mode which causes cypress to build differently CI: '' diff --git a/guides/writing-cross-platform-javascript.md b/guides/writing-cross-platform-javascript.md index a10580903444..b2c4dbd9534e 100644 --- a/guides/writing-cross-platform-javascript.md +++ b/guides/writing-cross-platform-javascript.md @@ -40,7 +40,7 @@ path.resolve('../', '/../', '../') // 'C:\\Users' on Windows ``` -In general, you want to avoid writing file system code using `/` and `\`, and use Node.js APIs where possible - those are cross platform and guarenteed to work. +In general, you want to avoid writing file system code using `/` and `\`, and use Node.js APIs where possible - those are cross platform and guaranteed to work. ## Use Node.js Scripts diff --git a/npm/create-cypress-tests/scripts/copy-templates.js b/npm/create-cypress-tests/scripts/copy-templates.js index 89349cfe67a4..583538450087 100644 --- a/npm/create-cypress-tests/scripts/copy-templates.js +++ b/npm/create-cypress-tests/scripts/copy-templates.js @@ -17,15 +17,15 @@ program unique: true, }) - const srcOuput = './src/' - let destinationOuput = destination.replace('/\\/g', '/') + const srcOutput = './src/' + let destinationOutput = destination.replace('/\\/g', '/') - if (!destinationOuput.endsWith('/')) { - destinationOuput += '/' + if (!destinationOutput.endsWith('/')) { + destinationOutput += '/' } const relOutput = (template, forSource) => { - return `${forSource ? srcOuput : destinationOuput}${template}` + return `${forSource ? srcOutput : destinationOutput}${template}` } const result = await Promise.all(templates.map(async (template) => { diff --git a/npm/create-cypress-tests/src/component-testing/config-file-updater/configFileUpdater.test.ts b/npm/create-cypress-tests/src/component-testing/config-file-updater/configFileUpdater.test.ts index 42cfb0a72fc8..8a2dee76b5ff 100644 --- a/npm/create-cypress-tests/src/component-testing/config-file-updater/configFileUpdater.test.ts +++ b/npm/create-cypress-tests/src/component-testing/config-file-updater/configFileUpdater.test.ts @@ -43,7 +43,7 @@ describe('lib/util/config-file-updater', () => { context('with js files', () => { describe('#insertValueInJSString', () => { describe('es6 vs es5', () => { - it('finds the object litteral and adds the values to it es6', async () => { + it('finds the object literal and adds the values to it es6', async () => { const src = stripIndent`\ export default { foo: 42, @@ -63,7 +63,7 @@ describe('lib/util/config-file-updater', () => { expect(output).to.equal(expectedOutput) }) - it('finds the object litteral and adds the values to it es5', async () => { + it('finds the object literal and adds the values to it es5', async () => { const src = stripIndent`\ module.exports = { foo: 42, @@ -333,7 +333,7 @@ describe('lib/util/config-file-updater', () => { }) describe('failures', () => { - it('fails if not an object litteral', () => { + it('fails if not an object literal', () => { const src = [ 'const foo = {}', 'export default foo', diff --git a/npm/create-cypress-tests/src/component-testing/config-file-updater/configFileUpdater.ts b/npm/create-cypress-tests/src/component-testing/config-file-updater/configFileUpdater.ts index 0dcf07d6eaa1..b2e587f9ee3c 100644 --- a/npm/create-cypress-tests/src/component-testing/config-file-updater/configFileUpdater.ts +++ b/npm/create-cypress-tests/src/component-testing/config-file-updater/configFileUpdater.ts @@ -71,7 +71,7 @@ export async function insertValueInJSString (fileContents: string, obj: Record { expect(someOfSpyCallsIncludes(logSpy, 'yarn cypress open')).to.be.true }) - it('Fails if git repository have untracked or uncommited files', async () => { + it('Fails if git repository have untracked or uncommitted files', async () => { mockFsWithInitialTemplate({ '/package.json': JSON.stringify({ }), }) @@ -121,7 +121,7 @@ describe('create-cypress-tests', () => { await main({ useNpm: true, ignoreTs: false, ignoreExamples: false, setupComponentTesting: false }) expect( - someOfSpyCallsIncludes(errorSpy, 'This repository has untracked files or uncommmited changes.'), + someOfSpyCallsIncludes(errorSpy, 'This repository has untracked files or uncommitted changes.'), ).to.equal(true) expect(processExitStub).to.be.called diff --git a/npm/create-cypress-tests/src/main.ts b/npm/create-cypress-tests/src/main.ts index 818a58b94329..fc28840559e6 100644 --- a/npm/create-cypress-tests/src/main.ts +++ b/npm/create-cypress-tests/src/main.ts @@ -86,7 +86,7 @@ export async function main ({ useNpm, ignoreTs, setupComponentTesting, ignoreExa const gitStatus = await getGitStatus() if (gitStatus) { - console.error(`\n${chalk.bold.red('This repository has untracked files or uncommmited changes.')}\nThis command will ${chalk.cyan('make changes in the codebase')}, so please remove untracked files, stash or commit any changes, and try again.`) + console.error(`\n${chalk.bold.red('This repository has untracked files or uncommitted changes.')}\nThis command will ${chalk.cyan('make changes in the codebase')}, so please remove untracked files, stash or commit any changes, and try again.`) process.exit(1) } diff --git a/npm/react/cypress/component/basic/network/2-users-fetch.cy.jsx b/npm/react/cypress/component/basic/network/2-users-fetch.cy.jsx index 86dc0541282b..4737dae39598 100644 --- a/npm/react/cypress/component/basic/network/2-users-fetch.cy.jsx +++ b/npm/react/cypress/component/basic/network/2-users-fetch.cy.jsx @@ -36,7 +36,7 @@ describe('Users with Fetch', () => { .contains('foo') }) - it('can inspect mocked network reaponse', () => { + it('can inspect mocked network response', () => { const users = [{ id: 1, name: 'foo' }] cy.intercept('GET', '/users?_limit=3', users).as('users') diff --git a/npm/vite-dev-server/src/plugins/cypress.ts b/npm/vite-dev-server/src/plugins/cypress.ts index 5583cfd816ea..e0fbdd4fa1e5 100644 --- a/npm/vite-dev-server/src/plugins/cypress.ts +++ b/npm/vite-dev-server/src/plugins/cypress.ts @@ -53,7 +53,7 @@ export const Cypress = ( base = config.base }, async transformIndexHtml (html) { - // it's possibe other plugins have modified the HTML + // it's possible other plugins have modified the HTML // before we get to. For example vitejs/plugin-react will // add a preamble. We do our best to look at the HTML we // receive and inject it. diff --git a/npm/vue/cypress/component/advanced/access-component/message.cy.js b/npm/vue/cypress/component/advanced/access-component/message.cy.js index 41e969305b70..1ab4f4b1ad81 100644 --- a/npm/vue/cypress/component/advanced/access-component/message.cy.js +++ b/npm/vue/cypress/component/advanced/access-component/message.cy.js @@ -47,7 +47,7 @@ describe('Message', () => { describe('Events', () => { it('calls handleClick when click on message', () => { // need to spy on the _original_ method before it gets - // passed to the Vue.extend and gets into private closuer + // passed to the Vue.extend and gets into private closure const spy = cy.spy(Message.methods, 'handleClick') createCmp({ message: 'Cat' }) diff --git a/npm/vue/cypress/component/router-example/PizzaShop/Home.vue b/npm/vue/cypress/component/router-example/PizzaShop/Home.vue index b39c6d583f92..0d8a8b118d98 100644 --- a/npm/vue/cypress/component/router-example/PizzaShop/Home.vue +++ b/npm/vue/cypress/component/router-example/PizzaShop/Home.vue @@ -33,10 +33,10 @@ 🍖 Meatlover
- 🍍 Hawain + 🍍 Hawaiian
{ cy.get('.order-overview > ul > li').contains('cheese') }) - it('order hawaian + peppers pizza without using UI', () => { + it('order hawaiian + peppers pizza without using UI', () => { cy.wrap(Cypress.vue.$router) .then(($router) => $router.push({ name: 'home' })) .then(($router) => { return $router.push({ name: 'order', - params: { preset: 'hawaian' }, + params: { preset: 'hawaiian' }, query: { peppers: true }, }) }) diff --git a/npm/vue/cypress/component/tailwind/redbox.cy.js b/npm/vue/cypress/component/tailwind/redbox.cy.js index a4db3c614d15..01a5041a0dde 100644 --- a/npm/vue/cypress/component/tailwind/redbox.cy.js +++ b/npm/vue/cypress/component/tailwind/redbox.cy.js @@ -24,7 +24,7 @@ describe('RedBox 1', () => { it('displays red Hello RedBox', () => { mount({ template }, options) - // shoud have injected the inline styling. + // should have injected the inline styling. cy.get('style').should('contain.text', inlineStyle) cy.contains('Hello RedBox') diff --git a/npm/vue2/src/index.ts b/npm/vue2/src/index.ts index f73be7d74400..7b8c33364aea 100644 --- a/npm/vue2/src/index.ts +++ b/npm/vue2/src/index.ts @@ -320,7 +320,7 @@ function failTestOnVueError (err, vm, info) { /** * Extract the component name from the object passed to mount - * @param componentOptions the compoennt passed to mount + * @param componentOptions the component passed to mount * @returns name of the component */ function getComponentDisplayName (componentOptions: any): string { diff --git a/npm/webpack-preprocessor/test/unit/dist.spec.ts b/npm/webpack-preprocessor/test/unit/dist.spec.ts index c2271c5f3403..8fafef7a6763 100644 --- a/npm/webpack-preprocessor/test/unit/dist.spec.ts +++ b/npm/webpack-preprocessor/test/unit/dist.spec.ts @@ -1,7 +1,7 @@ const { expect } = require('chai') const preprocessor = require('../../dist/index') -describe('tyepscript ./dist output', () => { +describe('typescript ./dist output', () => { it('builds dist correctly', () => { expect(preprocessor).to.be.a('function') expect(preprocessor).to.have.property('defaultOptions') diff --git a/packages/app/src/debug/DebugSpec.cy.tsx b/packages/app/src/debug/DebugSpec.cy.tsx index 60656d8fc868..7da637e662d2 100644 --- a/packages/app/src/debug/DebugSpec.cy.tsx +++ b/packages/app/src/debug/DebugSpec.cy.tsx @@ -270,7 +270,7 @@ describe(' responsive UI', () => { }, } - const testResult: {[thumprint: string]: TestResults[]} = { + const testResult: {[thumbprint: string]: TestResults[]} = { 'abcd': [ { id: '676df87878', diff --git a/packages/app/src/runner/iframe-model.ts b/packages/app/src/runner/iframe-model.ts index bba35665919f..d249ddd7d70e 100644 --- a/packages/app/src/runner/iframe-model.ts +++ b/packages/app/src/runner/iframe-model.ts @@ -21,7 +21,7 @@ export interface AutSnapshot { viewportWidth: number url: string body: { - get: () => unknown // TOOD: find out what this is, some sort of JQuery API. + get: () => unknown // TODO: find out what this is, some sort of JQuery API. } } diff --git a/packages/app/src/runner/index.ts b/packages/app/src/runner/index.ts index 69972208c2ca..b52678be6b9d 100644 --- a/packages/app/src/runner/index.ts +++ b/packages/app/src/runner/index.ts @@ -350,7 +350,7 @@ export function getRunnerConfigFromWindow () { /** * Inject the global `UnifiedRunner` via a - + diff --git a/system-tests/projects/e2e/cypress/e2e/experimental_csp_allow_list_spec/with_allow_list_custom_or_true.cy.ts b/system-tests/projects/e2e/cypress/e2e/experimental_csp_allow_list_spec/with_allow_list_custom_or_true.cy.ts index b55415c514e3..4c326f8cdc84 100644 --- a/system-tests/projects/e2e/cypress/e2e/experimental_csp_allow_list_spec/with_allow_list_custom_or_true.cy.ts +++ b/system-tests/projects/e2e/cypress/e2e/experimental_csp_allow_list_spec/with_allow_list_custom_or_true.cy.ts @@ -70,7 +70,7 @@ describe('experimentalCspAllowList is custom or true', () => { }) it('sample: upgrade-insecure-requests is not stripped', () => { - // fake the https automatic upgrade by fulfilling the http request to the express server. verify the requests are actually upraded + // fake the https automatic upgrade by fulfilling the http request to the express server. verify the requests are actually upgraded const requestsFulfilled = { www_foobar_com_script: false, app_foobar_com_script: false, diff --git a/system-tests/projects/e2e/cypress/e2e/subdomain.cy.js b/system-tests/projects/e2e/cypress/e2e/subdomain.cy.js index 3e34565bd4f7..ade2dacfb6d4 100644 --- a/system-tests/projects/e2e/cypress/e2e/subdomain.cy.js +++ b/system-tests/projects/e2e/cypress/e2e/subdomain.cy.js @@ -45,9 +45,9 @@ describe('subdomains', () => { }).then((cookie) => { // there should have been only a single secret-session // request cookie sent on this XHR request - const occurences = Cypress._.compact(cookie.split('secret-session')) + const occurrences = Cypress._.compact(cookie.split('secret-session')) - expect(occurences).to.have.length(1) + expect(occurrences).to.have.length(1) }) }) diff --git a/system-tests/projects/migration-component-testing-customized/README.md b/system-tests/projects/migration-component-testing-customized/README.md index 41029bbf9c2d..060e22623516 100644 --- a/system-tests/projects/migration-component-testing-customized/README.md +++ b/system-tests/projects/migration-component-testing-customized/README.md @@ -1,6 +1,6 @@ # Migration Component Testing Customized -A component tesing project without e2e. We ask the users to migrate their specs manually. +A component testing project without e2e. We ask the users to migrate their specs manually. The following migration steps will be used during this migration: @@ -22,7 +22,7 @@ Since the user has a custom componentFolder and testFiles pattern, we won't ask ## Rename supportFile -Not used. `supportFile: false` is set. We woudl normally put this in your `e2e.supportFile` key. We assume a top level `supportFile` is used for E2E testing. Since this project does not have E2E configured, we just skip this step. +Not used. `supportFile: false` is set. We would normally put this in your `e2e.supportFile` key. We assume a top level `supportFile` is used for E2E testing. Since this project does not have E2E configured, we just skip this step. ## Update Config diff --git a/system-tests/projects/migration-component-testing-defaults/README.md b/system-tests/projects/migration-component-testing-defaults/README.md index 965fb84cabf2..85059abc5404 100644 --- a/system-tests/projects/migration-component-testing-defaults/README.md +++ b/system-tests/projects/migration-component-testing-defaults/README.md @@ -1,6 +1,6 @@ ## Migration Component Testing Defaults -A component tesing project without e2e, and all defaults for CT. We rename their specs for them in step 1, then we ask them to move them in step 2. +A component testing project without e2e, and all defaults for CT. We rename their specs for them in step 1, then we ask them to move them in step 2. The following migration steps will be used during this migration: diff --git a/system-tests/projects/migration-component-testing/README.md b/system-tests/projects/migration-component-testing/README.md index a2ffad210c5e..03f004f9fdf9 100644 --- a/system-tests/projects/migration-component-testing/README.md +++ b/system-tests/projects/migration-component-testing/README.md @@ -22,7 +22,7 @@ We will not require manual migration, because the user is not using the default ## Rename supportFile -Not used. `supportFile: false` is set. We woudl normally put this in your `e2e.supportFile` key. We assume a top level `supportFile` is used for E2E testing. Since this project does not have E2E configured, we just skip this step. +Not used. `supportFile: false` is set. We would normally put this in your `e2e.supportFile` key. We assume a top level `supportFile` is used for E2E testing. Since this project does not have E2E configured, we just skip this step. ## Update Config diff --git a/system-tests/projects/migration-e2e-defaults-no-specs/README.md b/system-tests/projects/migration-e2e-defaults-no-specs/README.md index 566c5b73716e..d604388ef540 100644 --- a/system-tests/projects/migration-e2e-defaults-no-specs/README.md +++ b/system-tests/projects/migration-e2e-defaults-no-specs/README.md @@ -12,7 +12,7 @@ The following migration steps will be used during this migration: ## Automatic Migration -This step is not used, since there are no spec files to rename. For this reason it's highly unlikely `cypress/integration` exists either - this is created only when the initial integration specs are scaffolded (pre 10.x behavior - we no longer scaffold thes automatically). +This step is not used, since there are no spec files to rename. For this reason it's highly unlikely `cypress/integration` exists either - this is created only when the initial integration specs are scaffolded (pre 10.x behavior - we no longer scaffold these automatically). ## Manual Files diff --git a/system-tests/projects/module-api/index.js b/system-tests/projects/module-api/index.js index f48c1923dd77..3a79bdd4e1d2 100644 --- a/system-tests/projects/module-api/index.js +++ b/system-tests/projects/module-api/index.js @@ -5,7 +5,7 @@ const cypress = require('cypress') console.log('cypress is', cypress) const onSuccess = (runResult) => { - banner('Cypresss results') + banner('Cypress results') console.log('%o', runResult) banner('Results paths') // TODO find a better way to show all available properties in the runResult object diff --git a/system-tests/projects/webpack-preprocessor-awesome-typescript-loader/tsconfig.json b/system-tests/projects/webpack-preprocessor-awesome-typescript-loader/tsconfig.json index a502e11358ec..d1004fab48cc 100644 --- a/system-tests/projects/webpack-preprocessor-awesome-typescript-loader/tsconfig.json +++ b/system-tests/projects/webpack-preprocessor-awesome-typescript-loader/tsconfig.json @@ -1,7 +1,7 @@ { // act as if we're attempting to disable source maps // and enable inline source maps. these properties - // should be overriden by our typescript monkey patching + // should be overridden by our typescript monkey patching "compilerOptions": { "sourceMap": false, "inlineSourceMap": true, diff --git a/system-tests/projects/webpack-preprocessor-ts-loader/tsconfig.json b/system-tests/projects/webpack-preprocessor-ts-loader/tsconfig.json index 5be03e5cfc92..188a0b51d73d 100644 --- a/system-tests/projects/webpack-preprocessor-ts-loader/tsconfig.json +++ b/system-tests/projects/webpack-preprocessor-ts-loader/tsconfig.json @@ -1,7 +1,7 @@ { // act as if we're attempting to disable source maps // and enable inline source maps. these properties - // should be overriden by our typescript monkey patching + // should be overridden by our typescript monkey patching "compilerOptions": { "sourceMap": false, "inlineSourceMap": true, diff --git a/system-tests/projects/yarn-v3.1.1-pnp/yarn-3.1.1.cjs b/system-tests/projects/yarn-v3.1.1-pnp/yarn-3.1.1.cjs index f5f2adca83b2..b53b7da368ef 100755 --- a/system-tests/projects/yarn-v3.1.1-pnp/yarn-3.1.1.cjs +++ b/system-tests/projects/yarn-v3.1.1-pnp/yarn-3.1.1.cjs @@ -446,7 +446,7 @@ $2`).replace(/^│\n/,"");if(n>=3)throw new Error("Only the first two levels are `].join("")} `+Qa(r)}async persistLockfile(){let e=v.join(this.cwd,this.configuration.get("lockfileFilename")),r="";try{r=await T.readFilePromise(e,"utf8")}catch(s){}let i=this.generateLockfile(),n=ul(r,i);n!==r&&(await T.writeFilePromise(e,n),this.lockFileChecksum=D$(n),this.lockfileNeedsRefresh=!1)}async persistInstallStateFile(){let e=[];for(let o of Object.values(gF))e.push(...o);let r=(0,r0.default)(this,e),i=cF.default.serialize(r),n=zi(i);if(this.installStateChecksum===n)return;let s=this.configuration.get("installStatePath");await T.mkdirPromise(v.dirname(s),{recursive:!0}),await T.writeFilePromise(s,await aUe(i)),this.installStateChecksum=n}async restoreInstallState({restoreInstallersCustomData:e=!0,restoreResolutions:r=!0,restoreBuildState:i=!0}={}){let n=this.configuration.get("installStatePath");if(!T.existsSync(n)){r&&await this.applyLightResolution();return}let s=await AUe(await T.readFilePromise(n));this.installStateChecksum=zi(s);let o=cF.default.deserialize(s);e&&typeof o.installersCustomData!="undefined"&&(this.installersCustomData=o.installersCustomData),i&&Object.assign(this,(0,r0.default)(o,gF.restoreBuildState)),r&&(o.lockFileChecksum===this.lockFileChecksum?(Object.assign(this,(0,r0.default)(o,gF.restoreResolutions)),this.refreshWorkspaceDependencies()):await this.applyLightResolution())}async applyLightResolution(){await this.resolveEverything({lockfileOnly:!0,report:new ei}),await this.persistInstallStateFile()}async persist(){await this.persistLockfile();for(let e of this.workspacesByCwd.values())await e.persistManifest()}async cacheCleanup({cache:e,report:r}){let i=new Set([".gitignore"]);if(!Fb(e.cwd,this.cwd)||!await T.existsPromise(e.cwd))return;let n=this.configuration.get("preferAggregateCacheInfo"),s=0,o=null;for(let a of await T.readdirPromise(e.cwd)){if(i.has(a))continue;let l=v.resolve(e.cwd,a);e.markedFiles.has(l)||(o=a,e.immutable?r.reportError(z.IMMUTABLE_CACHE,`${Ve(this.configuration,v.basename(l),"magenta")} appears to be unused and would be marked for deletion, but the cache is immutable`):(n?s+=1:r.reportInfo(z.UNUSED_CACHE_ENTRY,`${Ve(this.configuration,v.basename(l),"magenta")} appears to be unused - removing`),await T.removePromise(l)))}n&&s!==0&&r.reportInfo(z.UNUSED_CACHE_ENTRY,s>1?`${s} packages appeared to be unused and were removed`:`${o} appeared to be unused and was removed`),e.markedFiles.clear()}};function lUe({project:t,allDescriptors:e,allResolutions:r,allPackages:i,accessibleLocators:n=new Set,optionalBuilds:s=new Set,volatileDescriptors:o=new Set,peerRequirements:a=new Map,report:l,tolerateMissingPackages:c=!1}){var ne;let u=new Map,g=[],f=new Map,h=new Map,p=new Map,d=new Map,m=new Map,I=new Map(t.workspaces.map(q=>{let A=q.anchoredLocator.locatorHash,V=i.get(A);if(typeof V=="undefined"){if(c)return[A,null];throw new Error("Assertion failed: The workspace should have an associated package")}return[A,ap(V)]})),B=()=>{let q=T.mktempSync(),A=v.join(q,"stacktrace.log"),V=String(g.length+1).length,W=g.map((X,F)=>`${`${F+1}.`.padStart(V," ")} ${is(X)} `).join("");throw T.writeFileSync(A,W),T.detachTemp(q),new nt(z.STACK_OVERFLOW_RESOLUTION,`Encountered a stack overflow when resolving peer dependencies; cf ${M.fromPortablePath(A)}`)},b=q=>{let A=r.get(q.descriptorHash);if(typeof A=="undefined")throw new Error("Assertion failed: The resolution should have been registered");let V=i.get(A);if(!V)throw new Error("Assertion failed: The package could not be found");return V},R=(q,A,V,{top:W,optional:X})=>{g.length>1e3&&B(),g.push(A);let F=H(q,A,V,{top:W,optional:X});return g.pop(),F},H=(q,A,V,{top:W,optional:X})=>{if(n.has(A.locatorHash))return;n.add(A.locatorHash),X||s.delete(A.locatorHash);let F=i.get(A.locatorHash);if(!F){if(c)return;throw new Error(`Assertion failed: The package (${lt(t.configuration,A)}) should have been registered`)}let D=[],he=[],pe=[],Ne=[],Pe=[];for(let re of Array.from(F.dependencies.values())){if(F.peerDependencies.has(re.identHash)&&F.locatorHash!==W)continue;if(hA(re))throw new Error("Assertion failed: Virtual packages shouldn't be encountered when virtualizing a branch");o.delete(re.descriptorHash);let se=X;if(!se){let ee=F.dependenciesMeta.get(St(re));if(typeof ee!="undefined"){let Ue=ee.get(null);typeof Ue!="undefined"&&Ue.optional&&(se=!0)}}let be=r.get(re.descriptorHash);if(!be){if(c)continue;throw new Error(`Assertion failed: The resolution (${Xt(t.configuration,re)}) should have been registered`)}let ae=I.get(be)||i.get(be);if(!ae)throw new Error(`Assertion failed: The package (${be}, resolved from ${Xt(t.configuration,re)}) should have been registered`);if(ae.peerDependencies.size===0){R(re,ae,new Map,{top:W,optional:se});continue}let Ae=u.get(ae.locatorHash);typeof Ae=="number"&&Ae>=2&&B();let De,$,G=new Set,Ce;he.push(()=>{De=kx(re,A.locatorHash),$=Px(ae,A.locatorHash),F.dependencies.delete(re.identHash),F.dependencies.set(De.identHash,De),r.set(De.descriptorHash,$.locatorHash),e.set(De.descriptorHash,De),i.set($.locatorHash,$),D.push([ae,De,$])}),pe.push(()=>{var ee;Ce=new Map;for(let Ue of $.peerDependencies.values()){let Oe=F.dependencies.get(Ue.identHash);if(!Oe&&cp(A,Ue)&&(Oe=q),(!Oe||Oe.range==="missing:")&&$.dependencies.has(Ue.identHash)){$.peerDependencies.delete(Ue.identHash);continue}Oe||(Oe=Yt(Ue,"missing:")),$.dependencies.set(Oe.identHash,Oe),hA(Oe)&&Pl(p,Oe.descriptorHash).add($.locatorHash),f.set(Oe.identHash,Oe),Oe.range==="missing:"&&G.add(Oe.identHash),Ce.set(Ue.identHash,(ee=V.get(Ue.identHash))!=null?ee:$.locatorHash)}$.dependencies=new Map(gn($.dependencies,([Ue,Oe])=>St(Oe)))}),Ne.push(()=>{if(!i.has($.locatorHash))return;let ee=u.get(ae.locatorHash),Ue=typeof ee!="undefined"?ee+1:1;u.set(ae.locatorHash,Ue),R(De,$,Ce,{top:W,optional:se}),u.set(ae.locatorHash,Ue-1)}),Pe.push(()=>{let ee=F.dependencies.get(re.identHash);if(typeof ee=="undefined")throw new Error("Assertion failed: Expected the peer dependency to have been turned into a dependency");let Ue=r.get(ee.descriptorHash);if(typeof Ue=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");if(Pl(m,Ue).add(A.locatorHash),!!i.has($.locatorHash)){for(let Oe of $.peerDependencies.values()){let vt=Ce.get(Oe.identHash);if(typeof vt=="undefined")throw new Error("Assertion failed: Expected the peer dependency ident to be registered");hu(pu(d,vt),St(Oe)).push($.locatorHash)}for(let Oe of G)$.dependencies.delete(Oe)}})}for(let re of[...he,...pe])re();let qe;do{qe=!0;for(let[re,se,be]of D){if(!i.has(be.locatorHash))continue;let ae=pu(h,re.locatorHash),Ae=zi(...[...be.dependencies.values()].map(Ce=>{let ee=Ce.range!=="missing:"?r.get(Ce.descriptorHash):"missing:";if(typeof ee=="undefined")throw new Error(`Assertion failed: Expected the resolution for ${Xt(t.configuration,Ce)} to have been registered`);return ee===W?`${ee} (top)`:ee}),se.identHash),De=ae.get(Ae);if(typeof De=="undefined"){ae.set(Ae,se);continue}if(De===se)continue;qe=!1,i.delete(be.locatorHash),e.delete(se.descriptorHash),r.delete(se.descriptorHash),n.delete(be.locatorHash);let $=p.get(se.descriptorHash)||[],G=[F.locatorHash,...$];p.delete(se.descriptorHash);for(let Ce of G){let ee=i.get(Ce);typeof ee!="undefined"&&ee.dependencies.set(se.identHash,De)}}}while(!qe);for(let re of[...Ne,...Pe])re()};for(let q of t.workspaces){let A=q.anchoredLocator;o.delete(q.anchoredDescriptor.descriptorHash),R(q.anchoredDescriptor,A,new Map,{top:A.locatorHash,optional:!1})}var L;(function(V){V[V.NotProvided=0]="NotProvided",V[V.NotCompatible=1]="NotCompatible"})(L||(L={}));let K=[];for(let[q,A]of m){let V=i.get(q);if(typeof V=="undefined")throw new Error("Assertion failed: Expected the root to be registered");let W=d.get(q);if(typeof W!="undefined")for(let X of A){let F=i.get(X);if(typeof F!="undefined")for(let[D,he]of W){let pe=En(D);if(F.peerDependencies.has(pe.identHash))continue;let Ne=`p${zi(X,D,q).slice(0,5)}`;a.set(Ne,{subject:X,requested:pe,rootRequester:q,allRequesters:he});let Pe=V.dependencies.get(pe.identHash);if(typeof Pe!="undefined"){let qe=b(Pe),re=(ne=qe.version)!=null?ne:"0.0.0",se=new Set;for(let ae of he){let Ae=i.get(ae);if(typeof Ae=="undefined")throw new Error("Assertion failed: Expected the link to be registered");let De=Ae.peerDependencies.get(pe.identHash);if(typeof De=="undefined")throw new Error("Assertion failed: Expected the ident to be registered");se.add(De.range)}[...se].every(ae=>{if(ae.startsWith(Yr.protocol)){if(!t.tryWorkspaceByLocator(qe))return!1;ae=ae.slice(Yr.protocol.length),(ae==="^"||ae==="~")&&(ae="*")}return lc(re,ae)})||K.push({type:1,subject:F,requested:pe,requester:V,version:re,hash:Ne,requirementCount:he.length})}else{let qe=V.peerDependenciesMeta.get(D);(qe==null?void 0:qe.optional)||K.push({type:0,subject:F,requested:pe,requester:V,hash:Ne})}}}}let J=[q=>Rx(q.subject),q=>St(q.requested),q=>`${q.type}`];for(let q of gn(K,J))switch(q.type){case 0:l==null||l.reportWarning(z.MISSING_PEER_DEPENDENCY,`${lt(t.configuration,q.subject)} doesn't provide ${Vr(t.configuration,q.requested)} (${Ve(t.configuration,q.hash,Le.CODE)}), requested by ${Vr(t.configuration,q.requester)}`);break;case 1:{let A=q.requirementCount>1?"and some of its descendants request":"requests";l==null||l.reportWarning(z.INCOMPATIBLE_PEER_DEPENDENCY,`${lt(t.configuration,q.subject)} provides ${Vr(t.configuration,q.requested)} (${Ve(t.configuration,q.hash,Le.CODE)}) with version ${fp(t.configuration,q.version)}, which doesn't satisfy what ${Vr(t.configuration,q.requester)} ${A}`)}break}K.length>0&&(l==null||l.reportWarning(z.UNNAMED,`Some peer dependencies are incorrectly met; run ${Ve(t.configuration,"yarn explain peer-requirements ",Le.CODE)} for details, where ${Ve(t.configuration,"",Le.CODE)} is the six-letter p-prefixed code`))}var Po;(function(l){l.VERSION="version",l.COMMAND_NAME="commandName",l.PLUGIN_NAME="pluginName",l.INSTALL_COUNT="installCount",l.PROJECT_COUNT="projectCount",l.WORKSPACE_COUNT="workspaceCount",l.DEPENDENCY_COUNT="dependencyCount",l.EXTENSION="packageExtension"})(Po||(Po={}));var Rd=class{constructor(e,r){this.values=new Map;this.hits=new Map;this.enumerators=new Map;this.configuration=e;let i=this.getRegistryPath();this.isNew=!T.existsSync(i),this.sendReport(r),this.startBuffer()}reportVersion(e){this.reportValue(Po.VERSION,e.replace(/-git\..*/,"-git"))}reportCommandName(e){this.reportValue(Po.COMMAND_NAME,e||"")}reportPluginName(e){this.reportValue(Po.PLUGIN_NAME,e)}reportProject(e){this.reportEnumerator(Po.PROJECT_COUNT,e)}reportInstall(e){this.reportHit(Po.INSTALL_COUNT,e)}reportPackageExtension(e){this.reportValue(Po.EXTENSION,e)}reportWorkspaceCount(e){this.reportValue(Po.WORKSPACE_COUNT,String(e))}reportDependencyCount(e){this.reportValue(Po.DEPENDENCY_COUNT,String(e))}reportValue(e,r){Pl(this.values,e).add(r)}reportEnumerator(e,r){Pl(this.enumerators,e).add(zi(r))}reportHit(e,r="*"){let i=pu(this.hits,e),n=na(i,r,()=>0);i.set(r,n+1)}getRegistryPath(){let e=this.configuration.get("globalFolder");return v.join(e,"telemetry.json")}sendReport(e){var u,g,f;let r=this.getRegistryPath(),i;try{i=T.readJsonSync(r)}catch{i={}}let n=Date.now(),s=this.configuration.get("telemetryInterval")*24*60*60*1e3,a=((u=i.lastUpdate)!=null?u:n+s+Math.floor(s*Math.random()))+s;if(a>n&&i.lastUpdate!=null)return;try{T.mkdirSync(v.dirname(r),{recursive:!0}),T.writeJsonSync(r,{lastUpdate:n})}catch{return}if(a>n||!i.blocks)return;let l=`https://browser-http-intake.logs.datadoghq.eu/v1/input/${e}?ddsource=yarn`,c=h=>iP(l,h,{configuration:this.configuration}).catch(()=>{});for(let[h,p]of Object.entries((g=i.blocks)!=null?g:{})){if(Object.keys(p).length===0)continue;let d=p;d.userId=h,d.reportType="primary";for(let B of Object.keys((f=d.enumerators)!=null?f:{}))d.enumerators[B]=d.enumerators[B].length;c(d);let m=new Map,I=20;for(let[B,b]of Object.entries(d.values))b.length>0&&m.set(B,b.slice(0,I));for(;m.size>0;){let B={};B.userId=h,B.reportType="secondary",B.metrics={};for(let[b,R]of m)B.metrics[b]=R.shift(),R.length===0&&m.delete(b);c(B)}}}applyChanges(){var o,a,l,c,u,g,f,h,p;let e=this.getRegistryPath(),r;try{r=T.readJsonSync(e)}catch{r={}}let i=(o=this.configuration.get("telemetryUserId"))!=null?o:"*",n=r.blocks=(a=r.blocks)!=null?a:{},s=n[i]=(l=n[i])!=null?l:{};for(let d of this.hits.keys()){let m=s.hits=(c=s.hits)!=null?c:{},I=m[d]=(u=m[d])!=null?u:{};for(let[B,b]of this.hits.get(d))I[B]=((g=I[B])!=null?g:0)+b}for(let d of["values","enumerators"])for(let m of this[d].keys()){let I=s[d]=(f=s[d])!=null?f:{};I[m]=[...new Set([...(h=I[m])!=null?h:[],...(p=this[d].get(m))!=null?p:[]])]}T.mkdirSync(v.dirname(e),{recursive:!0}),T.writeJsonSync(e,r)}startBuffer(){process.on("exit",()=>{try{this.applyChanges()}catch{}})}};var fF=ie(require("child_process")),R$=ie(ml());var hF=ie(require("fs"));var Yg=new Map([["constraints",[["constraints","query"],["constraints","source"],["constraints"]]],["exec",[]],["interactive-tools",[["search"],["upgrade-interactive"]]],["stage",[["stage"]]],["typescript",[]],["version",[["version","apply"],["version","check"],["version"]]],["workspace-tools",[["workspaces","focus"],["workspaces","foreach"]]]]);function cUe(t){let e=M.fromPortablePath(t);process.on("SIGINT",()=>{}),e?(0,fF.execFileSync)(process.execPath,[e,...process.argv.slice(2)],{stdio:"inherit",env:_(P({},process.env),{YARN_IGNORE_PATH:"1",YARN_IGNORE_CWD:"1"})}):(0,fF.execFileSync)(e,process.argv.slice(2),{stdio:"inherit",env:_(P({},process.env),{YARN_IGNORE_PATH:"1",YARN_IGNORE_CWD:"1"})})}async function i0({binaryVersion:t,pluginConfiguration:e}){async function r(){let n=new oo({binaryLabel:"Yarn Package Manager",binaryName:"yarn",binaryVersion:t});try{await i(n)}catch(s){process.stdout.write(n.error(s)),process.exitCode=1}}async function i(n){var p,d,m,I,B;let s=process.versions.node,o=">=12 <14 || 14.2 - 14.9 || >14.10.0";if(process.env.YARN_IGNORE_NODE!=="1"&&!qt.satisfiesWithPrereleases(s,o))throw new me(`This tool requires a Node version compatible with ${o} (got ${s}). Upgrade Node, or set \`YARN_IGNORE_NODE=1\` in your environment.`);let a=await fe.find(M.toPortablePath(process.cwd()),e,{usePath:!0,strict:!1}),l=a.get("yarnPath"),c=a.get("ignorePath"),u=a.get("ignoreCwd"),g=M.toPortablePath(M.resolve(process.argv[1])),f=b=>T.readFilePromise(b).catch(()=>Buffer.of());if(!c&&!u&&await(async()=>l===g||Buffer.compare(...await Promise.all([f(l),f(g)]))===0)()){process.env.YARN_IGNORE_PATH="1",process.env.YARN_IGNORE_CWD="1",await i(n);return}else if(l!==null&&!c)if(!T.existsSync(l))process.stdout.write(n.error(new Error(`The "yarn-path" option has been set (in ${a.sources.get("yarnPath")}), but the specified location doesn't exist (${l}).`))),process.exitCode=1;else try{cUe(l)}catch(b){process.exitCode=b.code||1}else{c&&delete process.env.YARN_IGNORE_PATH,a.get("enableTelemetry")&&!R$.isCI&&process.stdout.isTTY&&(fe.telemetry=new Rd(a,"puba9cdc10ec5790a2cf4969dd413a47270")),(p=fe.telemetry)==null||p.reportVersion(t);for(let[L,K]of a.plugins.entries()){Yg.has((m=(d=L.match(/^@yarnpkg\/plugin-(.*)$/))==null?void 0:d[1])!=null?m:"")&&((I=fe.telemetry)==null||I.reportPluginName(L));for(let J of K.commands||[])n.register(J)}let R=n.process(process.argv.slice(2));R.help||(B=fe.telemetry)==null||B.reportCommandName(R.path.join(" "));let H=R.cwd;if(typeof H!="undefined"&&!u){let L=(0,hF.realpathSync)(process.cwd()),K=(0,hF.realpathSync)(H);if(L!==K){process.chdir(H),await r();return}}await n.runExit(R,{cwd:M.toPortablePath(process.cwd()),plugins:e,quiet:!1,stdin:process.stdin,stdout:process.stdout,stderr:process.stderr})}}return r().catch(n=>{process.stdout.write(n.stack||n.message),process.exitCode=1}).finally(()=>T.rmtempPromise())}function F$(t){t.Command.Path=(...e)=>r=>{r.paths=r.paths||[],r.paths.push(e)};for(let e of["Array","Boolean","String","Proxy","Rest","Counter"])t.Command[e]=(...r)=>(i,n)=>{let s=t.Option[e](...r);Object.defineProperty(i,`__${n}`,{configurable:!1,enumerable:!0,get(){return s},set(o){this[n]=o}})};return t}var iC={};it(iC,{BaseCommand:()=>Be,WorkspaceRequiredError:()=>rt,getDynamicLibs:()=>Wie,getPluginConfiguration:()=>F0,main:()=>i0,openWorkspace:()=>rf,pluginCommands:()=>Yg});var Be=class extends ye{constructor(){super(...arguments);this.cwd=Y.String("--cwd",{hidden:!0})}};var rt=class extends me{constructor(e,r){let i=v.relative(e,r),n=v.join(e,Ze.fileName);super(`This command can only be run from within a workspace of your project (${i} isn't a workspace of ${n}).`)}};var dJe=ie(Or());Ss();var CJe=ie(gN()),Wie=()=>new Map([["@yarnpkg/cli",iC],["@yarnpkg/core",Fd],["@yarnpkg/fslib",ch],["@yarnpkg/libzip",Fp],["@yarnpkg/parsers",Hp],["@yarnpkg/shell",jp],["clipanion",vh],["semver",dJe],["typanion",lu],["yup",CJe]]);async function rf(t,e){let{project:r,workspace:i}=await Ke.find(t,e);if(!i)throw new rt(r.cwd,e);return i}var x_e=ie(Or());Ss();var k_e=ie(gN());var hL={};it(hL,{dedupeUtils:()=>zN,default:()=>Qze,suggestUtils:()=>LN});var WAe=ie(ml());var roe=ie(aC());Ss();var LN={};it(LN,{Modifier:()=>Lo,Strategy:()=>Fr,Target:()=>vr,WorkspaceModifier:()=>af,applyModifier:()=>Zse,extractDescriptorFromPath:()=>ON,extractRangeModifier:()=>Xse,fetchDescriptorFrom:()=>MN,findProjectDescriptors:()=>toe,getModifier:()=>AC,getSuggestedDescriptors:()=>lC,makeWorkspaceDescriptor:()=>eoe,toWorkspaceModifier:()=>$se});var TN=ie(Or()),L3e="workspace:",vr;(function(i){i.REGULAR="dependencies",i.DEVELOPMENT="devDependencies",i.PEER="peerDependencies"})(vr||(vr={}));var Lo;(function(i){i.CARET="^",i.TILDE="~",i.EXACT=""})(Lo||(Lo={}));var af;(function(i){i.CARET="^",i.TILDE="~",i.EXACT="*"})(af||(af={}));var Fr;(function(s){s.KEEP="keep",s.REUSE="reuse",s.PROJECT="project",s.LATEST="latest",s.CACHE="cache"})(Fr||(Fr={}));function AC(t,e){return t.exact?Lo.EXACT:t.caret?Lo.CARET:t.tilde?Lo.TILDE:e.configuration.get("defaultSemverRangePrefix")}var T3e=/^([\^~]?)[0-9]+(?:\.[0-9]+){0,2}(?:-\S+)?$/;function Xse(t,{project:e}){let r=t.match(T3e);return r?r[1]:e.configuration.get("defaultSemverRangePrefix")}function Zse(t,e){let{protocol:r,source:i,params:n,selector:s}=S.parseRange(t.range);return TN.default.valid(s)&&(s=`${e}${t.range}`),S.makeDescriptor(t,S.makeRange({protocol:r,source:i,params:n,selector:s}))}function $se(t){switch(t){case Lo.CARET:return af.CARET;case Lo.TILDE:return af.TILDE;case Lo.EXACT:return af.EXACT;default:throw new Error(`Assertion failed: Unknown modifier: "${t}"`)}}function eoe(t,e){return S.makeDescriptor(t.anchoredDescriptor,`${L3e}${$se(e)}`)}async function toe(t,{project:e,target:r}){let i=new Map,n=s=>{let o=i.get(s.descriptorHash);return o||i.set(s.descriptorHash,o={descriptor:s,locators:[]}),o};for(let s of e.workspaces)if(r===vr.PEER){let o=s.manifest.peerDependencies.get(t.identHash);o!==void 0&&n(o).locators.push(s.locator)}else{let o=s.manifest.dependencies.get(t.identHash),a=s.manifest.devDependencies.get(t.identHash);r===vr.DEVELOPMENT?a!==void 0?n(a).locators.push(s.locator):o!==void 0&&n(o).locators.push(s.locator):o!==void 0?n(o).locators.push(s.locator):a!==void 0&&n(a).locators.push(s.locator)}return i}async function ON(t,{cwd:e,workspace:r}){return await M3e(async i=>{v.isAbsolute(t)||(t=v.relative(r.cwd,v.resolve(e,t)),t.match(/^\.{0,2}\//)||(t=`./${t}`));let{project:n}=r,s=await MN(S.makeIdent(null,"archive"),t,{project:r.project,cache:i,workspace:r});if(!s)throw new Error("Assertion failed: The descriptor should have been found");let o=new ei,a=n.configuration.makeResolver(),l=n.configuration.makeFetcher(),c={checksums:n.storedChecksums,project:n,cache:i,fetcher:l,report:o,resolver:a},u=a.bindDescriptor(s,r.anchoredLocator,c),g=S.convertDescriptorToLocator(u),f=await l.fetch(g,c),h=await Ze.find(f.prefixPath,{baseFs:f.packageFs});if(!h.name)throw new Error("Target path doesn't have a name");return S.makeDescriptor(h.name,t)})}async function lC(t,{project:e,workspace:r,cache:i,target:n,modifier:s,strategies:o,maxResults:a=Infinity}){if(!(a>=0))throw new Error(`Invalid maxResults (${a})`);if(t.range!=="unknown")return{suggestions:[{descriptor:t,name:`Use ${S.prettyDescriptor(e.configuration,t)}`,reason:"(unambiguous explicit request)"}],rejections:[]};let l=typeof r!="undefined"&&r!==null&&r.manifest[n].get(t.identHash)||null,c=[],u=[],g=async f=>{try{await f()}catch(h){u.push(h)}};for(let f of o){if(c.length>=a)break;switch(f){case Fr.KEEP:await g(async()=>{l&&c.push({descriptor:l,name:`Keep ${S.prettyDescriptor(e.configuration,l)}`,reason:"(no changes)"})});break;case Fr.REUSE:await g(async()=>{for(let{descriptor:h,locators:p}of(await toe(t,{project:e,target:n})).values()){if(p.length===1&&p[0].locatorHash===r.anchoredLocator.locatorHash&&o.includes(Fr.KEEP))continue;let d=`(originally used by ${S.prettyLocator(e.configuration,p[0])}`;d+=p.length>1?` and ${p.length-1} other${p.length>2?"s":""})`:")",c.push({descriptor:h,name:`Reuse ${S.prettyDescriptor(e.configuration,h)}`,reason:d})}});break;case Fr.CACHE:await g(async()=>{for(let h of e.storedDescriptors.values())h.identHash===t.identHash&&c.push({descriptor:h,name:`Reuse ${S.prettyDescriptor(e.configuration,h)}`,reason:"(already used somewhere in the lockfile)"})});break;case Fr.PROJECT:await g(async()=>{if(r.manifest.name!==null&&t.identHash===r.manifest.name.identHash)return;let h=e.tryWorkspaceByIdent(t);if(h===null)return;let p=eoe(h,s);c.push({descriptor:p,name:`Attach ${S.prettyDescriptor(e.configuration,p)}`,reason:`(local workspace at ${ue.pretty(e.configuration,h.relativeCwd,ue.Type.PATH)})`})});break;case Fr.LATEST:await g(async()=>{if(t.range!=="unknown")c.push({descriptor:t,name:`Use ${S.prettyRange(e.configuration,t.range)}`,reason:"(explicit range requested)"});else if(n===vr.PEER)c.push({descriptor:S.makeDescriptor(t,"*"),name:"Use *",reason:"(catch-all peer dependency pattern)"});else if(!e.configuration.get("enableNetwork"))c.push({descriptor:null,name:"Resolve from latest",reason:ue.pretty(e.configuration,"(unavailable because enableNetwork is toggled off)","grey")});else{let h=await MN(t,"latest",{project:e,cache:i,workspace:r,preserveModifier:!1});h&&(h=Zse(h,s),c.push({descriptor:h,name:`Use ${S.prettyDescriptor(e.configuration,h)}`,reason:"(resolved from latest)"}))}});break}}return{suggestions:c.slice(0,a),rejections:u.slice(0,a)}}async function MN(t,e,{project:r,cache:i,workspace:n,preserveModifier:s=!0}){let o=S.makeDescriptor(t,e),a=new ei,l=r.configuration.makeFetcher(),c=r.configuration.makeResolver(),u={project:r,fetcher:l,cache:i,checksums:r.storedChecksums,report:a,cacheOptions:{skipIntegrityCheck:!0},skipIntegrityCheck:!0},g=_(P({},u),{resolver:c,fetchOptions:u}),f=c.bindDescriptor(o,n.anchoredLocator,g),h=await c.getCandidates(f,new Map,g);if(h.length===0)return null;let p=h[0],{protocol:d,source:m,params:I,selector:B}=S.parseRange(S.convertToManifestRange(p.reference));if(d===r.configuration.get("defaultProtocol")&&(d=null),TN.default.valid(B)&&s!==!1){let b=typeof s=="string"?s:o.range;B=Xse(b,{project:r})+B}return S.makeDescriptor(p,S.makeRange({protocol:d,source:m,params:I,selector:B}))}async function M3e(t){return await T.mktempPromise(async e=>{let r=fe.create(e);return r.useWithSource(e,{enableMirror:!1,compressionLevel:0},e,{overwrite:!0}),await t(new Qt(e,{configuration:r,check:!1,immutable:!1}))})}var cC=class extends Be{constructor(){super(...arguments);this.json=Y.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.exact=Y.Boolean("-E,--exact",!1,{description:"Don't use any semver modifier on the resolved range"});this.tilde=Y.Boolean("-T,--tilde",!1,{description:"Use the `~` semver modifier on the resolved range"});this.caret=Y.Boolean("-C,--caret",!1,{description:"Use the `^` semver modifier on the resolved range"});this.dev=Y.Boolean("-D,--dev",!1,{description:"Add a package as a dev dependency"});this.peer=Y.Boolean("-P,--peer",!1,{description:"Add a package as a peer dependency"});this.optional=Y.Boolean("-O,--optional",!1,{description:"Add / upgrade a package to an optional regular / peer dependency"});this.preferDev=Y.Boolean("--prefer-dev",!1,{description:"Add / upgrade a package to a dev dependency"});this.interactive=Y.Boolean("-i,--interactive",{description:"Reuse the specified package from other workspaces in the project"});this.cached=Y.Boolean("--cached",!1,{description:"Reuse the highest version already used somewhere within the project"});this.mode=Y.String("--mode",{description:"Change what artifacts installs generate",validator:Yi(li)});this.silent=Y.Boolean("--silent",{hidden:!0});this.packages=Y.Rest()}async execute(){var d;let e=await fe.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Ke.find(e,this.context.cwd),n=await Qt.find(e);if(!i)throw new rt(r.cwd,this.context.cwd);await r.restoreInstallState({restoreResolutions:!1});let s=(d=this.interactive)!=null?d:e.get("preferInteractive"),o=AC(this,r),a=[...s?[Fr.REUSE]:[],Fr.PROJECT,...this.cached?[Fr.CACHE]:[],Fr.LATEST],l=s?Infinity:1,c=await Promise.all(this.packages.map(async m=>{let I=m.match(/^\.{0,2}\//)?await ON(m,{cwd:this.context.cwd,workspace:i}):S.parseDescriptor(m),B=O3e(i,I,{dev:this.dev,peer:this.peer,preferDev:this.preferDev,optional:this.optional}),b=await lC(I,{project:r,workspace:i,cache:n,target:B,modifier:o,strategies:a,maxResults:l});return[I,b,B]})),u=await Fa.start({configuration:e,stdout:this.context.stdout,suggestInstall:!1},async m=>{for(let[I,{suggestions:B,rejections:b}]of c)if(B.filter(H=>H.descriptor!==null).length===0){let[H]=b;if(typeof H=="undefined")throw new Error("Assertion failed: Expected an error to have been set");r.configuration.get("enableNetwork")?m.reportError(z.CANT_SUGGEST_RESOLUTIONS,`${S.prettyDescriptor(e,I)} can't be resolved to a satisfying range`):m.reportError(z.CANT_SUGGEST_RESOLUTIONS,`${S.prettyDescriptor(e,I)} can't be resolved to a satisfying range (note: network resolution has been disabled)`),m.reportSeparator(),m.reportExceptionOnce(H)}});if(u.hasErrors())return u.exitCode();let g=!1,f=[],h=[];for(let[,{suggestions:m},I]of c){let B,b=m.filter(K=>K.descriptor!==null),R=b[0].descriptor,H=b.every(K=>S.areDescriptorsEqual(K.descriptor,R));b.length===1||H?B=R:(g=!0,{answer:B}=await(0,roe.prompt)({type:"select",name:"answer",message:"Which range do you want to use?",choices:m.map(({descriptor:K,name:J,reason:ne})=>K?{name:J,hint:ne,descriptor:K}:{name:J,hint:ne,disabled:!0}),onCancel:()=>process.exit(130),result(K){return this.find(K,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let L=i.manifest[I].get(B.identHash);(typeof L=="undefined"||L.descriptorHash!==B.descriptorHash)&&(i.manifest[I].set(B.identHash,B),this.optional&&(I==="dependencies"?i.manifest.ensureDependencyMeta(_(P({},B),{range:"unknown"})).optional=!0:I==="peerDependencies"&&(i.manifest.ensurePeerDependencyMeta(_(P({},B),{range:"unknown"})).optional=!0)),typeof L=="undefined"?f.push([i,I,B,a]):h.push([i,I,L,B]))}return await e.triggerMultipleHooks(m=>m.afterWorkspaceDependencyAddition,f),await e.triggerMultipleHooks(m=>m.afterWorkspaceDependencyReplacement,h),g&&this.context.stdout.write(` -`),(await Fe.start({configuration:e,json:this.json,stdout:this.context.stdout,includeLogs:!this.context.quiet},async m=>{await r.install({cache:n,report:m,mode:this.mode})})).exitCode()}};cC.paths=[["add"]],cC.usage=ye.Usage({description:"add dependencies to the project",details:"\n This command adds a package to the package.json for the nearest workspace.\n\n - If it didn't exist before, the package will by default be added to the regular `dependencies` field, but this behavior can be overriden thanks to the `-D,--dev` flag (which will cause the dependency to be added to the `devDependencies` field instead) and the `-P,--peer` flag (which will do the same but for `peerDependencies`).\n\n - If the package was already listed in your dependencies, it will by default be upgraded whether it's part of your `dependencies` or `devDependencies` (it won't ever update `peerDependencies`, though).\n\n - If set, the `--prefer-dev` flag will operate as a more flexible `-D,--dev` in that it will add the package to your `devDependencies` if it isn't already listed in either `dependencies` or `devDependencies`, but it will also happily upgrade your `dependencies` if that's what you already use (whereas `-D,--dev` would throw an exception).\n\n - If set, the `-O,--optional` flag will add the package to the `optionalDependencies` field and, in combination with the `-P,--peer` flag, it will add the package as an optional peer dependency. If the package was already listed in your `dependencies`, it will be upgraded to `optionalDependencies`. If the package was already listed in your `peerDependencies`, in combination with the `-P,--peer` flag, it will be upgraded to an optional peer dependency: `\"peerDependenciesMeta\": { \"\": { \"optional\": true } }`\n\n - If the added package doesn't specify a range at all its `latest` tag will be resolved and the returned version will be used to generate a new semver range (using the `^` modifier by default unless otherwise configured via the `defaultSemverRangePrefix` configuration, or the `~` modifier if `-T,--tilde` is specified, or no modifier at all if `-E,--exact` is specified). Two exceptions to this rule: the first one is that if the package is a workspace then its local version will be used, and the second one is that if you use `-P,--peer` the default range will be `*` and won't be resolved at all.\n\n - If the added package specifies a range (such as `^1.0.0`, `latest`, or `rc`), Yarn will add this range as-is in the resulting package.json entry (in particular, tags such as `rc` will be encoded as-is rather than being converted into a semver range).\n\n If the `--cached` option is used, Yarn will preferably reuse the highest version already used somewhere within the project, even if through a transitive dependency.\n\n If the `-i,--interactive` option is used (or if the `preferInteractive` settings is toggled on) the command will first try to check whether other workspaces in the project use the specified package and, if so, will offer to reuse them.\n\n If the `--mode=` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n For a compilation of all the supported protocols, please consult the dedicated page from our website: https://yarnpkg.com/features/protocols.\n ",examples:[["Add a regular package to the current workspace","$0 add lodash"],["Add a specific version for a package to the current workspace","$0 add lodash@1.2.3"],["Add a package from a GitHub repository (the master branch) to the current workspace using a URL","$0 add lodash@https://github.com/lodash/lodash"],["Add a package from a GitHub repository (the master branch) to the current workspace using the GitHub protocol","$0 add lodash@github:lodash/lodash"],["Add a package from a GitHub repository (the master branch) to the current workspace using the GitHub protocol (shorthand)","$0 add lodash@lodash/lodash"],["Add a package from a specific branch of a GitHub repository to the current workspace using the GitHub protocol (shorthand)","$0 add lodash-es@lodash/lodash#es"]]});var ioe=cC;function O3e(t,e,{dev:r,peer:i,preferDev:n,optional:s}){let o=t.manifest[vr.REGULAR].has(e.identHash),a=t.manifest[vr.DEVELOPMENT].has(e.identHash),l=t.manifest[vr.PEER].has(e.identHash);if((r||i)&&o)throw new me(`Package "${S.prettyIdent(t.project.configuration,e)}" is already listed as a regular dependency - remove the -D,-P flags or remove it from your dependencies first`);if(!r&&!i&&l)throw new me(`Package "${S.prettyIdent(t.project.configuration,e)}" is already listed as a peer dependency - use either of -D or -P, or remove it from your peer dependencies first`);if(s&&a)throw new me(`Package "${S.prettyIdent(t.project.configuration,e)}" is already listed as a dev dependency - remove the -O flag or remove it from your dev dependencies first`);if(s&&!i&&l)throw new me(`Package "${S.prettyIdent(t.project.configuration,e)}" is already listed as a peer dependency - remove the -O flag or add the -P flag or remove it from your peer dependencies first`);if((r||n)&&s)throw new me(`Package "${S.prettyIdent(t.project.configuration,e)}" cannot simultaneously be a dev dependency and an optional dependency`);return i?vr.PEER:r||n?vr.DEVELOPMENT:o?vr.REGULAR:a?vr.DEVELOPMENT:vr.REGULAR}var uC=class extends Be{constructor(){super(...arguments);this.verbose=Y.Boolean("-v,--verbose",!1,{description:"Print both the binary name and the locator of the package that provides the binary"});this.json=Y.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.name=Y.String({required:!1})}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),{project:r,locator:i}=await Ke.find(e,this.context.cwd);if(await r.restoreInstallState(),this.name){let o=(await Kt.getPackageAccessibleBinaries(i,{project:r})).get(this.name);if(!o)throw new me(`Couldn't find a binary named "${this.name}" for package "${S.prettyLocator(e,i)}"`);let[,a]=o;return this.context.stdout.write(`${a} +`),(await Fe.start({configuration:e,json:this.json,stdout:this.context.stdout,includeLogs:!this.context.quiet},async m=>{await r.install({cache:n,report:m,mode:this.mode})})).exitCode()}};cC.paths=[["add"]],cC.usage=ye.Usage({description:"add dependencies to the project",details:"\n This command adds a package to the package.json for the nearest workspace.\n\n - If it didn't exist before, the package will by default be added to the regular `dependencies` field, but this behavior can be overridden thanks to the `-D,--dev` flag (which will cause the dependency to be added to the `devDependencies` field instead) and the `-P,--peer` flag (which will do the same but for `peerDependencies`).\n\n - If the package was already listed in your dependencies, it will by default be upgraded whether it's part of your `dependencies` or `devDependencies` (it won't ever update `peerDependencies`, though).\n\n - If set, the `--prefer-dev` flag will operate as a more flexible `-D,--dev` in that it will add the package to your `devDependencies` if it isn't already listed in either `dependencies` or `devDependencies`, but it will also happily upgrade your `dependencies` if that's what you already use (whereas `-D,--dev` would throw an exception).\n\n - If set, the `-O,--optional` flag will add the package to the `optionalDependencies` field and, in combination with the `-P,--peer` flag, it will add the package as an optional peer dependency. If the package was already listed in your `dependencies`, it will be upgraded to `optionalDependencies`. If the package was already listed in your `peerDependencies`, in combination with the `-P,--peer` flag, it will be upgraded to an optional peer dependency: `\"peerDependenciesMeta\": { \"\": { \"optional\": true } }`\n\n - If the added package doesn't specify a range at all its `latest` tag will be resolved and the returned version will be used to generate a new semver range (using the `^` modifier by default unless otherwise configured via the `defaultSemverRangePrefix` configuration, or the `~` modifier if `-T,--tilde` is specified, or no modifier at all if `-E,--exact` is specified). Two exceptions to this rule: the first one is that if the package is a workspace then its local version will be used, and the second one is that if you use `-P,--peer` the default range will be `*` and won't be resolved at all.\n\n - If the added package specifies a range (such as `^1.0.0`, `latest`, or `rc`), Yarn will add this range as-is in the resulting package.json entry (in particular, tags such as `rc` will be encoded as-is rather than being converted into a semver range).\n\n If the `--cached` option is used, Yarn will preferably reuse the highest version already used somewhere within the project, even if through a transitive dependency.\n\n If the `-i,--interactive` option is used (or if the `preferInteractive` settings is toggled on) the command will first try to check whether other workspaces in the project use the specified package and, if so, will offer to reuse them.\n\n If the `--mode=` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n For a compilation of all the supported protocols, please consult the dedicated page from our website: https://yarnpkg.com/features/protocols.\n ",examples:[["Add a regular package to the current workspace","$0 add lodash"],["Add a specific version for a package to the current workspace","$0 add lodash@1.2.3"],["Add a package from a GitHub repository (the master branch) to the current workspace using a URL","$0 add lodash@https://github.com/lodash/lodash"],["Add a package from a GitHub repository (the master branch) to the current workspace using the GitHub protocol","$0 add lodash@github:lodash/lodash"],["Add a package from a GitHub repository (the master branch) to the current workspace using the GitHub protocol (shorthand)","$0 add lodash@lodash/lodash"],["Add a package from a specific branch of a GitHub repository to the current workspace using the GitHub protocol (shorthand)","$0 add lodash-es@lodash/lodash#es"]]});var ioe=cC;function O3e(t,e,{dev:r,peer:i,preferDev:n,optional:s}){let o=t.manifest[vr.REGULAR].has(e.identHash),a=t.manifest[vr.DEVELOPMENT].has(e.identHash),l=t.manifest[vr.PEER].has(e.identHash);if((r||i)&&o)throw new me(`Package "${S.prettyIdent(t.project.configuration,e)}" is already listed as a regular dependency - remove the -D,-P flags or remove it from your dependencies first`);if(!r&&!i&&l)throw new me(`Package "${S.prettyIdent(t.project.configuration,e)}" is already listed as a peer dependency - use either of -D or -P, or remove it from your peer dependencies first`);if(s&&a)throw new me(`Package "${S.prettyIdent(t.project.configuration,e)}" is already listed as a dev dependency - remove the -O flag or remove it from your dev dependencies first`);if(s&&!i&&l)throw new me(`Package "${S.prettyIdent(t.project.configuration,e)}" is already listed as a peer dependency - remove the -O flag or add the -P flag or remove it from your peer dependencies first`);if((r||n)&&s)throw new me(`Package "${S.prettyIdent(t.project.configuration,e)}" cannot simultaneously be a dev dependency and an optional dependency`);return i?vr.PEER:r||n?vr.DEVELOPMENT:o?vr.REGULAR:a?vr.DEVELOPMENT:vr.REGULAR}var uC=class extends Be{constructor(){super(...arguments);this.verbose=Y.Boolean("-v,--verbose",!1,{description:"Print both the binary name and the locator of the package that provides the binary"});this.json=Y.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.name=Y.String({required:!1})}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),{project:r,locator:i}=await Ke.find(e,this.context.cwd);if(await r.restoreInstallState(),this.name){let o=(await Kt.getPackageAccessibleBinaries(i,{project:r})).get(this.name);if(!o)throw new me(`Couldn't find a binary named "${this.name}" for package "${S.prettyLocator(e,i)}"`);let[,a]=o;return this.context.stdout.write(`${a} `),0}return(await Fe.start({configuration:e,json:this.json,stdout:this.context.stdout},async s=>{let o=await Kt.getPackageAccessibleBinaries(i,{project:r}),l=Array.from(o.keys()).reduce((c,u)=>Math.max(c,u.length),0);for(let[c,[u,g]]of o)s.reportJson({name:c,source:S.stringifyIdent(u),path:g});if(this.verbose)for(let[c,[u]]of o)s.reportInfo(null,`${c.padEnd(l," ")} ${S.prettyLocator(e,u)}`);else for(let c of o.keys())s.reportInfo(null,c)})).exitCode()}};uC.paths=[["bin"]],uC.usage=ye.Usage({description:"get the path to a binary script",details:` When used without arguments, this command will print the list of all the binaries available in the current workspace. Adding the \`-v,--verbose\` flag will cause the output to contain both the binary name and the locator of the package that provides the binary. @@ -704,7 +704,7 @@ ${be.map($=>`Not found: ${YA($)} To understand the dependency tree requiring vulnerable packages, check the raw report with the \`--json\` flag or use \`yarn why \` to get more information as to who depends on them. `,examples:[["Checks for known security issues with the installed packages. The output is a list of known issues.","yarn npm audit"],["Audit dependencies in all workspaces","yarn npm audit --all"],["Limit auditing to `dependencies` (excludes `devDependencies`)","yarn npm audit --environment production"],["Show audit report as valid JSON","yarn npm audit --json"],["Audit all direct and transitive dependencies","yarn npm audit --recursive"],["Output moderate (or more severe) vulnerabilities","yarn npm audit --severity moderate"]]});var Rge=dm;var BM=ie(Or()),QM=ie(require("util")),Cm=class extends Be{constructor(){super(...arguments);this.fields=Y.String("-f,--fields",{description:"A comma-separated list of manifest fields that should be displayed"});this.json=Y.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.packages=Y.Rest()}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),{project:r}=await Ke.find(e,this.context.cwd),i=typeof this.fields!="undefined"?new Set(["name",...this.fields.split(/\s*,\s*/)]):null,n=[],s=!1,o=await Fe.start({configuration:e,includeFooter:!1,json:this.json,stdout:this.context.stdout},async a=>{for(let l of this.packages){let c;if(l==="."){let b=r.topLevelWorkspace;if(!b.manifest.name)throw new me(`Missing 'name' field in ${M.fromPortablePath(v.join(b.cwd,wt.manifest))}`);c=S.makeDescriptor(b.manifest.name,"unknown")}else c=S.parseDescriptor(l);let u=Lt.getIdentUrl(c),g=bM(await Lt.get(u,{configuration:e,ident:c,jsonResponse:!0,customErrorMessage:Lt.customPackageError})),f=Object.keys(g.versions).sort(BM.default.compareLoose),p=g["dist-tags"].latest||f[f.length-1],d=qt.validRange(c.range);if(d){let b=BM.default.maxSatisfying(f,d);b!==null?p=b:(a.reportWarning(z.UNNAMED,`Unmet range ${S.prettyRange(e,c.range)}; falling back to the latest version`),s=!0)}else c.range!=="unknown"&&(a.reportWarning(z.UNNAMED,`Invalid range ${S.prettyRange(e,c.range)}; falling back to the latest version`),s=!0);let m=g.versions[p],I=_(P(P({},g),m),{version:p,versions:f}),B;if(i!==null){B={};for(let b of i){let R=I[b];if(typeof R!="undefined")B[b]=R;else{a.reportWarning(z.EXCEPTION,`The '${b}' field doesn't exist inside ${S.prettyIdent(e,c)}'s informations`),s=!0;continue}}}else this.json||(delete I.dist,delete I.readme,delete I.users),B=I;a.reportJson(B),this.json||n.push(B)}});QM.inspect.styles.name="cyan";for(let a of n)(a!==n[0]||s)&&this.context.stdout.write(` `),this.context.stdout.write(`${(0,QM.inspect)(a,{depth:Infinity,colors:!0,compact:!1})} -`);return o.exitCode()}};Cm.paths=[["npm","info"]],Cm.usage=ye.Usage({category:"Npm-related commands",description:"show information about a package",details:"\n This command will fetch information about a package from the npm registry, and prints it in a tree format.\n\n The package does not have to be installed locally, but needs to have been published (in particular, local changes will be ignored even for workspaces).\n\n Append `@` to the package argument to provide information specific to the latest version that satisfies the range. If the range is invalid or if there is no version satisfying the range, the command will print a warning and fall back to the latest version.\n\n If the `-f,--fields` option is set, it's a comma-separated list of fields which will be used to only display part of the package informations.\n\n By default, this command won't return the `dist`, `readme`, and `users` fields, since they are often very long. To explicitly request those fields, explicitly list them with the `--fields` flag or request the output in JSON mode.\n ",examples:[["Show all available information about react (except the `dist`, `readme`, and `users` fields)","yarn npm info react"],["Show all available information about react as valid JSON (including the `dist`, `readme`, and `users` fields)","yarn npm info react --json"],["Show all available information about react 16.12.0","yarn npm info react@16.12.0"],["Show the description of react","yarn npm info react --fields description"],["Show all available versions of react","yarn npm info react --fields versions"],["Show the readme of react","yarn npm info react --fields readme"],["Show a few fields of react","yarn npm info react --fields homepage,repository"]]});var Fge=Cm;function bM(t){if(Array.isArray(t)){let e=[];for(let r of t)r=bM(r),r&&e.push(r);return e}else if(typeof t=="object"&&t!==null){let e={};for(let r of Object.keys(t)){if(r.startsWith("_"))continue;let i=bM(t[r]);i&&(e[r]=i)}return e}else return t||null}var Nge=ie(aC()),mm=class extends Be{constructor(){super(...arguments);this.scope=Y.String("-s,--scope",{description:"Login to the registry configured for a given scope"});this.publish=Y.Boolean("--publish",!1,{description:"Login to the publish registry"})}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),r=await SQ({configuration:e,cwd:this.context.cwd,publish:this.publish,scope:this.scope});return(await Fe.start({configuration:e,stdout:this.context.stdout},async n=>{let s=await i_e({registry:r,report:n,stdin:this.context.stdin,stdout:this.context.stdout}),o=`/-/user/org.couchdb.user:${encodeURIComponent(s.name)}`,a=await Lt.put(o,s,{attemptedAs:s.name,configuration:e,registry:r,jsonResponse:!0,authType:Lt.AuthType.NO_AUTH});return await r_e(r,a.token,{configuration:e,scope:this.scope}),n.reportInfo(z.UNNAMED,"Successfully logged in")})).exitCode()}};mm.paths=[["npm","login"]],mm.usage=ye.Usage({category:"Npm-related commands",description:"store new login info to access the npm registry",details:"\n This command will ask you for your username, password, and 2FA One-Time-Password (when it applies). It will then modify your local configuration (in your home folder, never in the project itself) to reference the new tokens thus generated.\n\n Adding the `-s,--scope` flag will cause the authentication to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\n\n Adding the `--publish` flag will cause the authentication to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\n ",examples:[["Login to the default registry","yarn npm login"],["Login to the registry linked to the @my-scope registry","yarn npm login --scope my-scope"],["Login to the publish registry for the current package","yarn npm login --publish"]]});var Lge=mm;async function SQ({scope:t,publish:e,configuration:r,cwd:i}){return t&&e?gr.getScopeRegistry(t,{configuration:r,type:gr.RegistryType.PUBLISH_REGISTRY}):t?gr.getScopeRegistry(t,{configuration:r}):e?gr.getPublishRegistry((await rf(r,i)).manifest,{configuration:r}):gr.getDefaultRegistry({configuration:r})}async function r_e(t,e,{configuration:r,scope:i}){let n=o=>a=>{let l=de.isIndexableObject(a)?a:{},c=l[o],u=de.isIndexableObject(c)?c:{};return _(P({},l),{[o]:_(P({},u),{npmAuthToken:e})})},s=i?{npmScopes:n(i)}:{npmRegistries:n(t)};return await fe.updateHomeConfiguration(s)}async function i_e({registry:t,report:e,stdin:r,stdout:i}){if(process.env.TEST_ENV)return{name:process.env.TEST_NPM_USER||"",password:process.env.TEST_NPM_PASSWORD||""};e.reportInfo(z.UNNAMED,`Logging in to ${t}`);let n=!1;t.match(/^https:\/\/npm\.pkg\.github\.com(\/|$)/)&&(e.reportInfo(z.UNNAMED,"You seem to be using the GitHub Package Registry. Tokens must be generated with the 'repo', 'write:packages', and 'read:packages' permissions."),n=!0),e.reportSeparator();let{username:s,password:o}=await(0,Nge.prompt)([{type:"input",name:"username",message:"Username:",required:!0,onCancel:()=>process.exit(130),stdin:r,stdout:i},{type:"password",name:"password",message:n?"Token:":"Password:",required:!0,onCancel:()=>process.exit(130),stdin:r,stdout:i}]);return e.reportSeparator(),{name:s,password:o}}var Ff=new Set(["npmAuthIdent","npmAuthToken"]),Em=class extends Be{constructor(){super(...arguments);this.scope=Y.String("-s,--scope",{description:"Logout of the registry configured for a given scope"});this.publish=Y.Boolean("--publish",!1,{description:"Logout of the publish registry"});this.all=Y.Boolean("-A,--all",!1,{description:"Logout of all registries"})}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),r=async()=>{var l;let n=await SQ({configuration:e,cwd:this.context.cwd,publish:this.publish,scope:this.scope}),s=await fe.find(this.context.cwd,this.context.plugins),o=S.makeIdent((l=this.scope)!=null?l:null,"pkg");return!gr.getAuthConfiguration(n,{configuration:s,ident:o}).get("npmAuthToken")};return(await Fe.start({configuration:e,stdout:this.context.stdout},async n=>{if(this.all&&(await n_e(),n.reportInfo(z.UNNAMED,"Successfully logged out from everything")),this.scope){await Tge("npmScopes",this.scope),await r()?n.reportInfo(z.UNNAMED,`Successfully logged out from ${this.scope}`):n.reportWarning(z.UNNAMED,"Scope authentication settings removed, but some other ones settings still apply to it");return}let s=await SQ({configuration:e,cwd:this.context.cwd,publish:this.publish});await Tge("npmRegistries",s),await r()?n.reportInfo(z.UNNAMED,`Successfully logged out from ${s}`):n.reportWarning(z.UNNAMED,"Registry authentication settings removed, but some other ones settings still apply to it")})).exitCode()}};Em.paths=[["npm","logout"]],Em.usage=ye.Usage({category:"Npm-related commands",description:"logout of the npm registry",details:"\n This command will log you out by modifying your local configuration (in your home folder, never in the project itself) to delete all credentials linked to a registry.\n\n Adding the `-s,--scope` flag will cause the deletion to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\n\n Adding the `--publish` flag will cause the deletion to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\n\n Adding the `-A,--all` flag will cause the deletion to be done against all registries and scopes.\n ",examples:[["Logout of the default registry","yarn npm logout"],["Logout of the @my-scope scope","yarn npm logout --scope my-scope"],["Logout of the publish registry for the current package","yarn npm logout --publish"],["Logout of all registries","yarn npm logout --all"]]});var Mge=Em;function s_e(t,e){let r=t[e];if(!de.isIndexableObject(r))return!1;let i=new Set(Object.keys(r));if([...Ff].every(s=>!i.has(s)))return!1;for(let s of Ff)i.delete(s);if(i.size===0)return t[e]=void 0,!0;let n=P({},r);for(let s of Ff)delete n[s];return t[e]=n,!0}async function n_e(){let t=e=>{let r=!1,i=de.isIndexableObject(e)?P({},e):{};i.npmAuthToken&&(delete i.npmAuthToken,r=!0);for(let n of Object.keys(i))s_e(i,n)&&(r=!0);if(Object.keys(i).length!==0)return r?i:e};return await fe.updateHomeConfiguration({npmRegistries:t,npmScopes:t})}async function Tge(t,e){return await fe.updateHomeConfiguration({[t]:r=>{let i=de.isIndexableObject(r)?r:{};if(!Object.prototype.hasOwnProperty.call(i,e))return r;let n=i[e],s=de.isIndexableObject(n)?n:{},o=new Set(Object.keys(s));if([...Ff].every(l=>!o.has(l)))return r;for(let l of Ff)o.delete(l);if(o.size===0)return Object.keys(i).length===1?void 0:_(P({},i),{[e]:void 0});let a={};for(let l of Ff)a[l]=void 0;return _(P({},i),{[e]:P(P({},s),a)})}})}var Im=class extends Be{constructor(){super(...arguments);this.access=Y.String("--access",{description:"The access for the published package (public or restricted)"});this.tag=Y.String("--tag","latest",{description:"The tag on the registry that the package should be attached to"});this.tolerateRepublish=Y.Boolean("--tolerate-republish",!1,{description:"Warn and exit when republishing an already existing version of a package"})}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Ke.find(e,this.context.cwd);if(!i)throw new rt(r.cwd,this.context.cwd);if(i.manifest.private)throw new me("Private workspaces cannot be published");if(i.manifest.name===null||i.manifest.version===null)throw new me("Workspaces must have valid names and versions to be published on an external registry");await r.restoreInstallState();let n=i.manifest.name,s=i.manifest.version,o=gr.getPublishRegistry(i.manifest,{configuration:e});return(await Fe.start({configuration:e,stdout:this.context.stdout},async l=>{var c,u;if(this.tolerateRepublish)try{let g=await Lt.get(Lt.getIdentUrl(n),{configuration:e,registry:o,ident:n,jsonResponse:!0});if(!Object.prototype.hasOwnProperty.call(g,"versions"))throw new nt(z.REMOTE_INVALID,'Registry returned invalid data for - missing "versions" field');if(Object.prototype.hasOwnProperty.call(g.versions,s)){l.reportWarning(z.UNNAMED,`Registry already knows about version ${s}; skipping.`);return}}catch(g){if(((u=(c=g.originalError)==null?void 0:c.response)==null?void 0:u.statusCode)!==404)throw g}await Kt.maybeExecuteWorkspaceLifecycleScript(i,"prepublish",{report:l}),await za.prepareForPack(i,{report:l},async()=>{let g=await za.genPackList(i);for(let m of g)l.reportInfo(null,m);let f=await za.genPackStream(i,g),h=await de.bufferStream(f),p=await Rf.getGitHead(i.cwd),d=await Rf.makePublishBody(i,h,{access:this.access,tag:this.tag,registry:o,gitHead:p});await Lt.put(Lt.getIdentUrl(n),d,{configuration:e,registry:o,ident:n,jsonResponse:!0})}),l.reportInfo(z.UNNAMED,"Package archive published")})).exitCode()}};Im.paths=[["npm","publish"]],Im.usage=ye.Usage({category:"Npm-related commands",description:"publish the active workspace to the npm registry",details:'\n This command will pack the active workspace into a fresh archive and upload it to the npm registry.\n\n The package will by default be attached to the `latest` tag on the registry, but this behavior can be overriden by using the `--tag` option.\n\n Note that for legacy reasons scoped packages are by default published with an access set to `restricted` (aka "private packages"). This requires you to register for a paid npm plan. In case you simply wish to publish a public scoped package to the registry (for free), just add the `--access public` flag. This behavior can be enabled by default through the `npmPublishAccess` settings.\n ',examples:[["Publish the active workspace","yarn npm publish"]]});var Oge=Im;var Uge=ie(Or());var ym=class extends Be{constructor(){super(...arguments);this.json=Y.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.package=Y.String({required:!1})}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Ke.find(e,this.context.cwd),n;if(typeof this.package!="undefined")n=S.parseIdent(this.package);else{if(!i)throw new rt(r.cwd,this.context.cwd);if(!i.manifest.name)throw new me(`Missing 'name' field in ${M.fromPortablePath(v.join(i.cwd,wt.manifest))}`);n=i.manifest.name}let s=await wm(n,e),a={children:de.sortMap(Object.entries(s),([l])=>l).map(([l,c])=>({value:ue.tuple(ue.Type.RESOLUTION,{descriptor:S.makeDescriptor(n,l),locator:S.makeLocator(n,c)})}))};return Hs.emitTree(a,{configuration:e,json:this.json,stdout:this.context.stdout})}};ym.paths=[["npm","tag","list"]],ym.usage=ye.Usage({category:"Npm-related commands",description:"list all dist-tags of a package",details:` +`);return o.exitCode()}};Cm.paths=[["npm","info"]],Cm.usage=ye.Usage({category:"Npm-related commands",description:"show information about a package",details:"\n This command will fetch information about a package from the npm registry, and prints it in a tree format.\n\n The package does not have to be installed locally, but needs to have been published (in particular, local changes will be ignored even for workspaces).\n\n Append `@` to the package argument to provide information specific to the latest version that satisfies the range. If the range is invalid or if there is no version satisfying the range, the command will print a warning and fall back to the latest version.\n\n If the `-f,--fields` option is set, it's a comma-separated list of fields which will be used to only display part of the package informations.\n\n By default, this command won't return the `dist`, `readme`, and `users` fields, since they are often very long. To explicitly request those fields, explicitly list them with the `--fields` flag or request the output in JSON mode.\n ",examples:[["Show all available information about react (except the `dist`, `readme`, and `users` fields)","yarn npm info react"],["Show all available information about react as valid JSON (including the `dist`, `readme`, and `users` fields)","yarn npm info react --json"],["Show all available information about react 16.12.0","yarn npm info react@16.12.0"],["Show the description of react","yarn npm info react --fields description"],["Show all available versions of react","yarn npm info react --fields versions"],["Show the readme of react","yarn npm info react --fields readme"],["Show a few fields of react","yarn npm info react --fields homepage,repository"]]});var Fge=Cm;function bM(t){if(Array.isArray(t)){let e=[];for(let r of t)r=bM(r),r&&e.push(r);return e}else if(typeof t=="object"&&t!==null){let e={};for(let r of Object.keys(t)){if(r.startsWith("_"))continue;let i=bM(t[r]);i&&(e[r]=i)}return e}else return t||null}var Nge=ie(aC()),mm=class extends Be{constructor(){super(...arguments);this.scope=Y.String("-s,--scope",{description:"Login to the registry configured for a given scope"});this.publish=Y.Boolean("--publish",!1,{description:"Login to the publish registry"})}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),r=await SQ({configuration:e,cwd:this.context.cwd,publish:this.publish,scope:this.scope});return(await Fe.start({configuration:e,stdout:this.context.stdout},async n=>{let s=await i_e({registry:r,report:n,stdin:this.context.stdin,stdout:this.context.stdout}),o=`/-/user/org.couchdb.user:${encodeURIComponent(s.name)}`,a=await Lt.put(o,s,{attemptedAs:s.name,configuration:e,registry:r,jsonResponse:!0,authType:Lt.AuthType.NO_AUTH});return await r_e(r,a.token,{configuration:e,scope:this.scope}),n.reportInfo(z.UNNAMED,"Successfully logged in")})).exitCode()}};mm.paths=[["npm","login"]],mm.usage=ye.Usage({category:"Npm-related commands",description:"store new login info to access the npm registry",details:"\n This command will ask you for your username, password, and 2FA One-Time-Password (when it applies). It will then modify your local configuration (in your home folder, never in the project itself) to reference the new tokens thus generated.\n\n Adding the `-s,--scope` flag will cause the authentication to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\n\n Adding the `--publish` flag will cause the authentication to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\n ",examples:[["Login to the default registry","yarn npm login"],["Login to the registry linked to the @my-scope registry","yarn npm login --scope my-scope"],["Login to the publish registry for the current package","yarn npm login --publish"]]});var Lge=mm;async function SQ({scope:t,publish:e,configuration:r,cwd:i}){return t&&e?gr.getScopeRegistry(t,{configuration:r,type:gr.RegistryType.PUBLISH_REGISTRY}):t?gr.getScopeRegistry(t,{configuration:r}):e?gr.getPublishRegistry((await rf(r,i)).manifest,{configuration:r}):gr.getDefaultRegistry({configuration:r})}async function r_e(t,e,{configuration:r,scope:i}){let n=o=>a=>{let l=de.isIndexableObject(a)?a:{},c=l[o],u=de.isIndexableObject(c)?c:{};return _(P({},l),{[o]:_(P({},u),{npmAuthToken:e})})},s=i?{npmScopes:n(i)}:{npmRegistries:n(t)};return await fe.updateHomeConfiguration(s)}async function i_e({registry:t,report:e,stdin:r,stdout:i}){if(process.env.TEST_ENV)return{name:process.env.TEST_NPM_USER||"",password:process.env.TEST_NPM_PASSWORD||""};e.reportInfo(z.UNNAMED,`Logging in to ${t}`);let n=!1;t.match(/^https:\/\/npm\.pkg\.github\.com(\/|$)/)&&(e.reportInfo(z.UNNAMED,"You seem to be using the GitHub Package Registry. Tokens must be generated with the 'repo', 'write:packages', and 'read:packages' permissions."),n=!0),e.reportSeparator();let{username:s,password:o}=await(0,Nge.prompt)([{type:"input",name:"username",message:"Username:",required:!0,onCancel:()=>process.exit(130),stdin:r,stdout:i},{type:"password",name:"password",message:n?"Token:":"Password:",required:!0,onCancel:()=>process.exit(130),stdin:r,stdout:i}]);return e.reportSeparator(),{name:s,password:o}}var Ff=new Set(["npmAuthIdent","npmAuthToken"]),Em=class extends Be{constructor(){super(...arguments);this.scope=Y.String("-s,--scope",{description:"Logout of the registry configured for a given scope"});this.publish=Y.Boolean("--publish",!1,{description:"Logout of the publish registry"});this.all=Y.Boolean("-A,--all",!1,{description:"Logout of all registries"})}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),r=async()=>{var l;let n=await SQ({configuration:e,cwd:this.context.cwd,publish:this.publish,scope:this.scope}),s=await fe.find(this.context.cwd,this.context.plugins),o=S.makeIdent((l=this.scope)!=null?l:null,"pkg");return!gr.getAuthConfiguration(n,{configuration:s,ident:o}).get("npmAuthToken")};return(await Fe.start({configuration:e,stdout:this.context.stdout},async n=>{if(this.all&&(await n_e(),n.reportInfo(z.UNNAMED,"Successfully logged out from everything")),this.scope){await Tge("npmScopes",this.scope),await r()?n.reportInfo(z.UNNAMED,`Successfully logged out from ${this.scope}`):n.reportWarning(z.UNNAMED,"Scope authentication settings removed, but some other ones settings still apply to it");return}let s=await SQ({configuration:e,cwd:this.context.cwd,publish:this.publish});await Tge("npmRegistries",s),await r()?n.reportInfo(z.UNNAMED,`Successfully logged out from ${s}`):n.reportWarning(z.UNNAMED,"Registry authentication settings removed, but some other ones settings still apply to it")})).exitCode()}};Em.paths=[["npm","logout"]],Em.usage=ye.Usage({category:"Npm-related commands",description:"logout of the npm registry",details:"\n This command will log you out by modifying your local configuration (in your home folder, never in the project itself) to delete all credentials linked to a registry.\n\n Adding the `-s,--scope` flag will cause the deletion to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\n\n Adding the `--publish` flag will cause the deletion to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\n\n Adding the `-A,--all` flag will cause the deletion to be done against all registries and scopes.\n ",examples:[["Logout of the default registry","yarn npm logout"],["Logout of the @my-scope scope","yarn npm logout --scope my-scope"],["Logout of the publish registry for the current package","yarn npm logout --publish"],["Logout of all registries","yarn npm logout --all"]]});var Mge=Em;function s_e(t,e){let r=t[e];if(!de.isIndexableObject(r))return!1;let i=new Set(Object.keys(r));if([...Ff].every(s=>!i.has(s)))return!1;for(let s of Ff)i.delete(s);if(i.size===0)return t[e]=void 0,!0;let n=P({},r);for(let s of Ff)delete n[s];return t[e]=n,!0}async function n_e(){let t=e=>{let r=!1,i=de.isIndexableObject(e)?P({},e):{};i.npmAuthToken&&(delete i.npmAuthToken,r=!0);for(let n of Object.keys(i))s_e(i,n)&&(r=!0);if(Object.keys(i).length!==0)return r?i:e};return await fe.updateHomeConfiguration({npmRegistries:t,npmScopes:t})}async function Tge(t,e){return await fe.updateHomeConfiguration({[t]:r=>{let i=de.isIndexableObject(r)?r:{};if(!Object.prototype.hasOwnProperty.call(i,e))return r;let n=i[e],s=de.isIndexableObject(n)?n:{},o=new Set(Object.keys(s));if([...Ff].every(l=>!o.has(l)))return r;for(let l of Ff)o.delete(l);if(o.size===0)return Object.keys(i).length===1?void 0:_(P({},i),{[e]:void 0});let a={};for(let l of Ff)a[l]=void 0;return _(P({},i),{[e]:P(P({},s),a)})}})}var Im=class extends Be{constructor(){super(...arguments);this.access=Y.String("--access",{description:"The access for the published package (public or restricted)"});this.tag=Y.String("--tag","latest",{description:"The tag on the registry that the package should be attached to"});this.tolerateRepublish=Y.Boolean("--tolerate-republish",!1,{description:"Warn and exit when republishing an already existing version of a package"})}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Ke.find(e,this.context.cwd);if(!i)throw new rt(r.cwd,this.context.cwd);if(i.manifest.private)throw new me("Private workspaces cannot be published");if(i.manifest.name===null||i.manifest.version===null)throw new me("Workspaces must have valid names and versions to be published on an external registry");await r.restoreInstallState();let n=i.manifest.name,s=i.manifest.version,o=gr.getPublishRegistry(i.manifest,{configuration:e});return(await Fe.start({configuration:e,stdout:this.context.stdout},async l=>{var c,u;if(this.tolerateRepublish)try{let g=await Lt.get(Lt.getIdentUrl(n),{configuration:e,registry:o,ident:n,jsonResponse:!0});if(!Object.prototype.hasOwnProperty.call(g,"versions"))throw new nt(z.REMOTE_INVALID,'Registry returned invalid data for - missing "versions" field');if(Object.prototype.hasOwnProperty.call(g.versions,s)){l.reportWarning(z.UNNAMED,`Registry already knows about version ${s}; skipping.`);return}}catch(g){if(((u=(c=g.originalError)==null?void 0:c.response)==null?void 0:u.statusCode)!==404)throw g}await Kt.maybeExecuteWorkspaceLifecycleScript(i,"prepublish",{report:l}),await za.prepareForPack(i,{report:l},async()=>{let g=await za.genPackList(i);for(let m of g)l.reportInfo(null,m);let f=await za.genPackStream(i,g),h=await de.bufferStream(f),p=await Rf.getGitHead(i.cwd),d=await Rf.makePublishBody(i,h,{access:this.access,tag:this.tag,registry:o,gitHead:p});await Lt.put(Lt.getIdentUrl(n),d,{configuration:e,registry:o,ident:n,jsonResponse:!0})}),l.reportInfo(z.UNNAMED,"Package archive published")})).exitCode()}};Im.paths=[["npm","publish"]],Im.usage=ye.Usage({category:"Npm-related commands",description:"publish the active workspace to the npm registry",details:'\n This command will pack the active workspace into a fresh archive and upload it to the npm registry.\n\n The package will by default be attached to the `latest` tag on the registry, but this behavior can be overridden by using the `--tag` option.\n\n Note that for legacy reasons scoped packages are by default published with an access set to `restricted` (aka "private packages"). This requires you to register for a paid npm plan. In case you simply wish to publish a public scoped package to the registry (for free), just add the `--access public` flag. This behavior can be enabled by default through the `npmPublishAccess` settings.\n ',examples:[["Publish the active workspace","yarn npm publish"]]});var Oge=Im;var Uge=ie(Or());var ym=class extends Be{constructor(){super(...arguments);this.json=Y.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.package=Y.String({required:!1})}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Ke.find(e,this.context.cwd),n;if(typeof this.package!="undefined")n=S.parseIdent(this.package);else{if(!i)throw new rt(r.cwd,this.context.cwd);if(!i.manifest.name)throw new me(`Missing 'name' field in ${M.fromPortablePath(v.join(i.cwd,wt.manifest))}`);n=i.manifest.name}let s=await wm(n,e),a={children:de.sortMap(Object.entries(s),([l])=>l).map(([l,c])=>({value:ue.tuple(ue.Type.RESOLUTION,{descriptor:S.makeDescriptor(n,l),locator:S.makeLocator(n,c)})}))};return Hs.emitTree(a,{configuration:e,json:this.json,stdout:this.context.stdout})}};ym.paths=[["npm","tag","list"]],ym.usage=ye.Usage({category:"Npm-related commands",description:"list all dist-tags of a package",details:` This command will list all tags of a package from the npm registry. If the package is not specified, Yarn will default to the current workspace. @@ -712,7 +712,7 @@ ${be.map($=>`Not found: ${YA($)} This command will add a tag to the npm registry for a specific version of a package. If the tag already exists, it will be overwritten. `,examples:[["Add a `beta` tag for version `2.3.4-beta.4` of package `my-pkg`","yarn npm tag add my-pkg@2.3.4-beta.4 beta"]]});var Hge=Bm;var Qm=class extends Be{constructor(){super(...arguments);this.package=Y.String();this.tag=Y.String()}async execute(){if(this.tag==="latest")throw new me("The 'latest' tag cannot be removed.");let e=await fe.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Ke.find(e,this.context.cwd);if(!i)throw new rt(r.cwd,this.context.cwd);let n=S.parseIdent(this.package),s=gr.getPublishRegistry(i.manifest,{configuration:e}),o=ue.pretty(e,this.tag,ue.Type.CODE),a=ue.pretty(e,n,ue.Type.IDENT),l=await wm(n,e);if(!Object.prototype.hasOwnProperty.call(l,this.tag))throw new me(`${o} is not a tag of package ${a}`);return(await Fe.start({configuration:e,stdout:this.context.stdout},async u=>{let g=`/-/package${Lt.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await Lt.del(g,{configuration:e,registry:s,ident:n,jsonResponse:!0}),u.reportInfo(z.UNNAMED,`Tag ${o} removed from package ${a}`)})).exitCode()}};Qm.paths=[["npm","tag","remove"]],Qm.usage=ye.Usage({category:"Npm-related commands",description:"remove a tag from a package",details:` This command will remove a tag from a package from the npm registry. - `,examples:[["Remove the `beta` tag from package `my-pkg`","yarn npm tag remove my-pkg beta"]]});var Gge=Qm;var bm=class extends Be{constructor(){super(...arguments);this.scope=Y.String("-s,--scope",{description:"Print username for the registry configured for a given scope"});this.publish=Y.Boolean("--publish",!1,{description:"Print username for the publish registry"})}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),r;return this.scope&&this.publish?r=gr.getScopeRegistry(this.scope,{configuration:e,type:gr.RegistryType.PUBLISH_REGISTRY}):this.scope?r=gr.getScopeRegistry(this.scope,{configuration:e}):this.publish?r=gr.getPublishRegistry((await rf(e,this.context.cwd)).manifest,{configuration:e}):r=gr.getDefaultRegistry({configuration:e}),(await Fe.start({configuration:e,stdout:this.context.stdout},async n=>{var o,a;let s;try{s=await Lt.get("/-/whoami",{configuration:e,registry:r,authType:Lt.AuthType.ALWAYS_AUTH,jsonResponse:!0,ident:this.scope?S.makeIdent(this.scope,""):void 0})}catch(l){if(((o=l.response)==null?void 0:o.statusCode)===401||((a=l.response)==null?void 0:a.statusCode)===403){n.reportError(z.AUTHENTICATION_INVALID,"Authentication failed - your credentials may have expired");return}else throw l}n.reportInfo(z.UNNAMED,s.username)})).exitCode()}};bm.paths=[["npm","whoami"]],bm.usage=ye.Usage({category:"Npm-related commands",description:"display the name of the authenticated user",details:"\n Print the username associated with the current authentication settings to the standard output.\n\n When using `-s,--scope`, the username printed will be the one that matches the authentication settings of the registry associated with the given scope (those settings can be overriden using the `npmRegistries` map, and the registry associated with the scope is configured via the `npmScopes` map).\n\n When using `--publish`, the registry we'll select will by default be the one used when publishing packages (`publishConfig.registry` or `npmPublishRegistry` if available, otherwise we'll fallback to the regular `npmRegistryServer`).\n ",examples:[["Print username for the default registry","yarn npm whoami"],["Print username for the registry on a given scope","yarn npm whoami --scope company"]]});var jge=bm;var o_e={configuration:{npmPublishAccess:{description:"Default access of the published packages",type:ge.STRING,default:null}},commands:[Rge,Fge,Lge,Mge,Oge,Hge,Kge,Gge,jge]},a_e=o_e;var NM={};it(NM,{default:()=>B_e,patchUtils:()=>SM});var SM={};it(SM,{applyPatchFile:()=>PQ,diffFolders:()=>DM,extractPackageToDisk:()=>PM,extractPatchFlags:()=>Xge,isParentRequired:()=>kM,loadPatchFiles:()=>km,makeDescriptor:()=>I_e,makeLocator:()=>xM,parseDescriptor:()=>Sm,parseLocator:()=>xm,parsePatchFile:()=>kQ});var vm=class extends Error{constructor(e,r){super(`Cannot apply hunk #${e+1}`);this.hunk=r}};var A_e=/^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*/;function Nf(t){return v.relative(Se.root,v.resolve(Se.root,M.toPortablePath(t)))}function l_e(t){let e=t.trim().match(A_e);if(!e)throw new Error(`Bad header line: '${t}'`);return{original:{start:Math.max(Number(e[1]),1),length:Number(e[3]||1)},patched:{start:Math.max(Number(e[4]),1),length:Number(e[6]||1)}}}var c_e=420,u_e=493,Lr;(function(i){i.Context="context",i.Insertion="insertion",i.Deletion="deletion"})(Lr||(Lr={}));var Yge=()=>({semverExclusivity:null,diffLineFromPath:null,diffLineToPath:null,oldMode:null,newMode:null,deletedFileMode:null,newFileMode:null,renameFrom:null,renameTo:null,beforeHash:null,afterHash:null,fromPath:null,toPath:null,hunks:null}),g_e=t=>({header:l_e(t),parts:[]}),f_e={["@"]:"header",["-"]:Lr.Deletion,["+"]:Lr.Insertion,[" "]:Lr.Context,["\\"]:"pragma",undefined:Lr.Context};function p_e(t){let e=[],r=Yge(),i="parsing header",n=null,s=null;function o(){n&&(s&&(n.parts.push(s),s=null),r.hunks.push(n),n=null)}function a(){o(),e.push(r),r=Yge()}for(let l=0;l0?"patch":"mode change",B=null;switch(I){case"rename":{if(!u||!g)throw new Error("Bad parser state: rename from & to not given");e.push({type:"rename",semverExclusivity:i,fromPath:Nf(u),toPath:Nf(g)}),B=g}break;case"file deletion":{let b=n||p;if(!b)throw new Error("Bad parse state: no path given for file deletion");e.push({type:"file deletion",semverExclusivity:i,hunk:m&&m[0]||null,path:Nf(b),mode:xQ(l),hash:f})}break;case"file creation":{let b=s||d;if(!b)throw new Error("Bad parse state: no path given for file creation");e.push({type:"file creation",semverExclusivity:i,hunk:m&&m[0]||null,path:Nf(b),mode:xQ(c),hash:h})}break;case"patch":case"mode change":B=d||s;break;default:de.assertNever(I);break}B&&o&&a&&o!==a&&e.push({type:"mode change",semverExclusivity:i,path:Nf(B),oldMode:xQ(o),newMode:xQ(a)}),B&&m&&m.length&&e.push({type:"patch",semverExclusivity:i,path:Nf(B),hunks:m,beforeHash:f,afterHash:h})}if(e.length===0)throw new Error("Unable to parse patch file: No changes found. Make sure the patch is a valid UTF8 encoded string");return e}function xQ(t){let e=parseInt(t,8)&511;if(e!==c_e&&e!==u_e)throw new Error(`Unexpected file mode string: ${t}`);return e}function kQ(t){let e=t.split(/\n/g);return e[e.length-1]===""&&e.pop(),d_e(p_e(e))}function h_e(t){let e=0,r=0;for(let{type:i,lines:n}of t.parts)switch(i){case Lr.Context:r+=n.length,e+=n.length;break;case Lr.Deletion:e+=n.length;break;case Lr.Insertion:r+=n.length;break;default:de.assertNever(i);break}if(e!==t.header.original.length||r!==t.header.patched.length){let i=n=>n<0?n:`+${n}`;throw new Error(`hunk header integrity check failed (expected @@ ${i(t.header.original.length)} ${i(t.header.patched.length)} @@, got @@ ${i(e)} ${i(r)} @@)`)}}async function Lf(t,e,r){let i=await t.lstatPromise(e),n=await r();if(typeof n!="undefined"&&(e=n),t.lutimesPromise)await t.lutimesPromise(e,i.atime,i.mtime);else if(!i.isSymbolicLink())await t.utimesPromise(e,i.atime,i.mtime);else throw new Error("Cannot preserve the time values of a symlink")}async function PQ(t,{baseFs:e=new Wt,dryRun:r=!1,version:i=null}={}){for(let n of t)if(!(n.semverExclusivity!==null&&i!==null&&!qt.satisfiesWithPrereleases(i,n.semverExclusivity)))switch(n.type){case"file deletion":if(r){if(!e.existsSync(n.path))throw new Error(`Trying to delete a file that doesn't exist: ${n.path}`)}else await Lf(e,v.dirname(n.path),async()=>{await e.unlinkPromise(n.path)});break;case"rename":if(r){if(!e.existsSync(n.fromPath))throw new Error(`Trying to move a file that doesn't exist: ${n.fromPath}`)}else await Lf(e,v.dirname(n.fromPath),async()=>{await Lf(e,v.dirname(n.toPath),async()=>{await Lf(e,n.fromPath,async()=>(await e.movePromise(n.fromPath,n.toPath),n.toPath))})});break;case"file creation":if(r){if(e.existsSync(n.path))throw new Error(`Trying to create a file that already exists: ${n.path}`)}else{let s=n.hunk?n.hunk.parts[0].lines.join(` + `,examples:[["Remove the `beta` tag from package `my-pkg`","yarn npm tag remove my-pkg beta"]]});var Gge=Qm;var bm=class extends Be{constructor(){super(...arguments);this.scope=Y.String("-s,--scope",{description:"Print username for the registry configured for a given scope"});this.publish=Y.Boolean("--publish",!1,{description:"Print username for the publish registry"})}async execute(){let e=await fe.find(this.context.cwd,this.context.plugins),r;return this.scope&&this.publish?r=gr.getScopeRegistry(this.scope,{configuration:e,type:gr.RegistryType.PUBLISH_REGISTRY}):this.scope?r=gr.getScopeRegistry(this.scope,{configuration:e}):this.publish?r=gr.getPublishRegistry((await rf(e,this.context.cwd)).manifest,{configuration:e}):r=gr.getDefaultRegistry({configuration:e}),(await Fe.start({configuration:e,stdout:this.context.stdout},async n=>{var o,a;let s;try{s=await Lt.get("/-/whoami",{configuration:e,registry:r,authType:Lt.AuthType.ALWAYS_AUTH,jsonResponse:!0,ident:this.scope?S.makeIdent(this.scope,""):void 0})}catch(l){if(((o=l.response)==null?void 0:o.statusCode)===401||((a=l.response)==null?void 0:a.statusCode)===403){n.reportError(z.AUTHENTICATION_INVALID,"Authentication failed - your credentials may have expired");return}else throw l}n.reportInfo(z.UNNAMED,s.username)})).exitCode()}};bm.paths=[["npm","whoami"]],bm.usage=ye.Usage({category:"Npm-related commands",description:"display the name of the authenticated user",details:"\n Print the username associated with the current authentication settings to the standard output.\n\n When using `-s,--scope`, the username printed will be the one that matches the authentication settings of the registry associated with the given scope (those settings can be overridden using the `npmRegistries` map, and the registry associated with the scope is configured via the `npmScopes` map).\n\n When using `--publish`, the registry we'll select will by default be the one used when publishing packages (`publishConfig.registry` or `npmPublishRegistry` if available, otherwise we'll fallback to the regular `npmRegistryServer`).\n ",examples:[["Print username for the default registry","yarn npm whoami"],["Print username for the registry on a given scope","yarn npm whoami --scope company"]]});var jge=bm;var o_e={configuration:{npmPublishAccess:{description:"Default access of the published packages",type:ge.STRING,default:null}},commands:[Rge,Fge,Lge,Mge,Oge,Hge,Kge,Gge,jge]},a_e=o_e;var NM={};it(NM,{default:()=>B_e,patchUtils:()=>SM});var SM={};it(SM,{applyPatchFile:()=>PQ,diffFolders:()=>DM,extractPackageToDisk:()=>PM,extractPatchFlags:()=>Xge,isParentRequired:()=>kM,loadPatchFiles:()=>km,makeDescriptor:()=>I_e,makeLocator:()=>xM,parseDescriptor:()=>Sm,parseLocator:()=>xm,parsePatchFile:()=>kQ});var vm=class extends Error{constructor(e,r){super(`Cannot apply hunk #${e+1}`);this.hunk=r}};var A_e=/^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*/;function Nf(t){return v.relative(Se.root,v.resolve(Se.root,M.toPortablePath(t)))}function l_e(t){let e=t.trim().match(A_e);if(!e)throw new Error(`Bad header line: '${t}'`);return{original:{start:Math.max(Number(e[1]),1),length:Number(e[3]||1)},patched:{start:Math.max(Number(e[4]),1),length:Number(e[6]||1)}}}var c_e=420,u_e=493,Lr;(function(i){i.Context="context",i.Insertion="insertion",i.Deletion="deletion"})(Lr||(Lr={}));var Yge=()=>({semverExclusivity:null,diffLineFromPath:null,diffLineToPath:null,oldMode:null,newMode:null,deletedFileMode:null,newFileMode:null,renameFrom:null,renameTo:null,beforeHash:null,afterHash:null,fromPath:null,toPath:null,hunks:null}),g_e=t=>({header:l_e(t),parts:[]}),f_e={["@"]:"header",["-"]:Lr.Deletion,["+"]:Lr.Insertion,[" "]:Lr.Context,["\\"]:"pragma",undefined:Lr.Context};function p_e(t){let e=[],r=Yge(),i="parsing header",n=null,s=null;function o(){n&&(s&&(n.parts.push(s),s=null),r.hunks.push(n),n=null)}function a(){o(),e.push(r),r=Yge()}for(let l=0;l0?"patch":"mode change",B=null;switch(I){case"rename":{if(!u||!g)throw new Error("Bad parser state: rename from & to not given");e.push({type:"rename",semverExclusivity:i,fromPath:Nf(u),toPath:Nf(g)}),B=g}break;case"file deletion":{let b=n||p;if(!b)throw new Error("Bad parse state: no path given for file deletion");e.push({type:"file deletion",semverExclusivity:i,hunk:m&&m[0]||null,path:Nf(b),mode:xQ(l),hash:f})}break;case"file creation":{let b=s||d;if(!b)throw new Error("Bad parse state: no path given for file creation");e.push({type:"file creation",semverExclusivity:i,hunk:m&&m[0]||null,path:Nf(b),mode:xQ(c),hash:h})}break;case"patch":case"mode change":B=d||s;break;default:de.assertNever(I);break}B&&o&&a&&o!==a&&e.push({type:"mode change",semverExclusivity:i,path:Nf(B),oldMode:xQ(o),newMode:xQ(a)}),B&&m&&m.length&&e.push({type:"patch",semverExclusivity:i,path:Nf(B),hunks:m,beforeHash:f,afterHash:h})}if(e.length===0)throw new Error("Unable to parse patch file: No changes found. Make sure the patch is a valid UTF8 encoded string");return e}function xQ(t){let e=parseInt(t,8)&511;if(e!==c_e&&e!==u_e)throw new Error(`Unexpected file mode string: ${t}`);return e}function kQ(t){let e=t.split(/\n/g);return e[e.length-1]===""&&e.pop(),d_e(p_e(e))}function h_e(t){let e=0,r=0;for(let{type:i,lines:n}of t.parts)switch(i){case Lr.Context:r+=n.length,e+=n.length;break;case Lr.Deletion:e+=n.length;break;case Lr.Insertion:r+=n.length;break;default:de.assertNever(i);break}if(e!==t.header.original.length||r!==t.header.patched.length){let i=n=>n<0?n:`+${n}`;throw new Error(`hunk header integrity check failed (expected @@ ${i(t.header.original.length)} ${i(t.header.patched.length)} @@, got @@ ${i(e)} ${i(r)} @@)`)}}async function Lf(t,e,r){let i=await t.lstatPromise(e),n=await r();if(typeof n!="undefined"&&(e=n),t.lutimesPromise)await t.lutimesPromise(e,i.atime,i.mtime);else if(!i.isSymbolicLink())await t.utimesPromise(e,i.atime,i.mtime);else throw new Error("Cannot preserve the time values of a symlink")}async function PQ(t,{baseFs:e=new Wt,dryRun:r=!1,version:i=null}={}){for(let n of t)if(!(n.semverExclusivity!==null&&i!==null&&!qt.satisfiesWithPrereleases(i,n.semverExclusivity)))switch(n.type){case"file deletion":if(r){if(!e.existsSync(n.path))throw new Error(`Trying to delete a file that doesn't exist: ${n.path}`)}else await Lf(e,v.dirname(n.path),async()=>{await e.unlinkPromise(n.path)});break;case"rename":if(r){if(!e.existsSync(n.fromPath))throw new Error(`Trying to move a file that doesn't exist: ${n.fromPath}`)}else await Lf(e,v.dirname(n.fromPath),async()=>{await Lf(e,v.dirname(n.toPath),async()=>{await Lf(e,n.fromPath,async()=>(await e.movePromise(n.fromPath,n.toPath),n.toPath))})});break;case"file creation":if(r){if(e.existsSync(n.path))throw new Error(`Trying to create a file that already exists: ${n.path}`)}else{let s=n.hunk?n.hunk.parts[0].lines.join(` `)+(n.hunk.parts[0].noNewlineAtEndOfFile?"":` `):"";await e.mkdirpPromise(v.dirname(n.path),{chmod:493,utimes:[mr.SAFE_TIME,mr.SAFE_TIME]}),await e.writeFilePromise(n.path,s,{mode:n.mode}),await e.utimesPromise(n.path,mr.SAFE_TIME,mr.SAFE_TIME)}break;case"patch":await Lf(e,n.path,async()=>{await C_e(n,{baseFs:e,dryRun:r})});break;case"mode change":{let o=(await e.statPromise(n.path)).mode;if(qge(n.newMode)!==qge(o))continue;await Lf(e,n.path,async()=>{await e.chmodPromise(n.path,n.newMode)})}break;default:de.assertNever(n);break}}function qge(t){return(t&64)>0}function Jge(t){return t.replace(/\s+$/,"")}function m_e(t,e){return Jge(t)===Jge(e)}async function C_e({hunks:t,path:e},{baseFs:r,dryRun:i=!1}){let n=await r.statSync(e).mode,o=(await r.readFileSync(e,"utf8")).split(/\n/),a=[],l=0,c=0;for(let g of t){let f=Math.max(c,g.header.patched.start+l),h=Math.max(0,f-c),p=Math.max(0,o.length-f-g.header.original.length),d=Math.max(h,p),m=0,I=0,B=null;for(;m<=d;){if(m<=h&&(I=f-m,B=Wge(g,o,I),B!==null)){m=-m;break}if(m<=p&&(I=f+m,B=Wge(g,o,I),B!==null))break;m+=1}if(B===null)throw new vm(t.indexOf(g),g);a.push(B),l+=m,c=I+g.header.original.length}if(i)return;let u=0;for(let g of a)for(let f of g)switch(f.type){case"splice":{let h=f.index+u;o.splice(h,f.numToDelete,...f.linesToInsert),u+=f.linesToInsert.length-f.numToDelete}break;case"pop":o.pop();break;case"push":o.push(f.line);break;default:de.assertNever(f);break}await r.writeFilePromise(e,o.join(` `),{mode:n})}function Wge(t,e,r){let i=[];for(let n of t.parts)switch(n.type){case Lr.Context:case Lr.Deletion:{for(let s of n.lines){let o=e[r];if(o==null||!m_e(o,s))return null;r+=1}n.type===Lr.Deletion&&(i.push({type:"splice",index:r-n.lines.length,numToDelete:n.lines.length,linesToInsert:[]}),n.noNewlineAtEndOfFile&&i.push({type:"push",line:""}))}break;case Lr.Insertion:i.push({type:"splice",index:r,numToDelete:0,linesToInsert:n.lines}),n.noNewlineAtEndOfFile&&i.push({type:"pop"});break;default:de.assertNever(n.type);break}return i}var E_e=/^builtin<([^>]+)>$/;function zge(t,e){let{source:r,selector:i,params:n}=S.parseRange(t);if(r===null)throw new Error("Patch locators must explicitly define their source");let s=i?i.split(/&/).map(c=>M.toPortablePath(c)):[],o=n&&typeof n.locator=="string"?S.parseLocator(n.locator):null,a=n&&typeof n.version=="string"?n.version:null,l=e(r);return{parentLocator:o,sourceItem:l,patchPaths:s,sourceVersion:a}}function Sm(t){let i=zge(t.range,S.parseDescriptor),{sourceItem:e}=i,r=qr(i,["sourceItem"]);return _(P({},r),{sourceDescriptor:e})}function xm(t){let i=zge(t.reference,S.parseLocator),{sourceItem:e}=i,r=qr(i,["sourceItem"]);return _(P({},r),{sourceLocator:e})}function Vge({parentLocator:t,sourceItem:e,patchPaths:r,sourceVersion:i,patchHash:n},s){let o=t!==null?{locator:S.stringifyLocator(t)}:{},a=typeof i!="undefined"?{version:i}:{},l=typeof n!="undefined"?{hash:n}:{};return S.makeRange({protocol:"patch:",source:s(e),selector:r.join("&"),params:P(P(P({},a),l),o)})}function I_e(t,{parentLocator:e,sourceDescriptor:r,patchPaths:i}){return S.makeLocator(t,Vge({parentLocator:e,sourceItem:r,patchPaths:i},S.stringifyDescriptor))}function xM(t,{parentLocator:e,sourcePackage:r,patchPaths:i,patchHash:n}){return S.makeLocator(t,Vge({parentLocator:e,sourceItem:r,sourceVersion:r.version,patchPaths:i,patchHash:n},S.stringifyLocator))}function _ge({onAbsolute:t,onRelative:e,onBuiltin:r},i){i.startsWith("~")&&(i=i.slice(1));let s=i.match(E_e);return s!==null?r(s[1]):v.isAbsolute(i)?t(i):e(i)}function Xge(t){let e=t.startsWith("~");return e&&(t=t.slice(1)),{optional:e}}function kM(t){return _ge({onAbsolute:()=>!1,onRelative:()=>!0,onBuiltin:()=>!1},t)}async function km(t,e,r){let i=t!==null?await r.fetcher.fetch(t,r):null,n=i&&i.localPath?{packageFs:new Ft(Se.root),prefixPath:v.relative(Se.root,i.localPath)}:i;i&&i!==n&&i.releaseFs&&i.releaseFs();let s=await de.releaseAfterUseAsync(async()=>await Promise.all(e.map(async o=>{let a=Xge(o),l=await _ge({onAbsolute:async()=>await T.readFilePromise(o,"utf8"),onRelative:async()=>{if(n===null)throw new Error("Assertion failed: The parent locator should have been fetched");return await n.packageFs.readFilePromise(v.join(n.prefixPath,o),"utf8")},onBuiltin:async c=>await r.project.configuration.firstHook(u=>u.getBuiltinPatch,r.project,c)},o);return _(P({},a),{source:l})})));for(let o of s)typeof o.source=="string"&&(o.source=o.source.replace(/\r\n?/g,` diff --git a/system-tests/test/deprecated_spec.ts b/system-tests/test/deprecated_spec.ts index fc59fb25190b..94b7549e4af2 100644 --- a/system-tests/test/deprecated_spec.ts +++ b/system-tests/test/deprecated_spec.ts @@ -45,7 +45,7 @@ describe('deprecated before:browser:launch args', () => { systemTests.it('using non-deprecated API - no warning', { // TODO: implement webPreferences.additionalArgs here - // once we decide if/what we're going to make the implemenation + // once we decide if/what we're going to make the implementation // SUGGESTION: add this to Cypress.browser.args which will capture // whatever args we use to launch the browser browser: '!webkit', // throws in WebKit since it rejects unsupported arguments @@ -69,7 +69,7 @@ describe('deprecated before:browser:launch args', () => { systemTests.it('concat return returns once', { // TODO: implement webPreferences.additionalArgs here - // once we decide if/what we're going to make the implemenation + // once we decide if/what we're going to make the implementation // SUGGESTION: add this to Cypress.browser.args which will capture // whatever args we use to launch the browser browser: '!webkit', // throws in WebKit since it rejects unsupported arguments @@ -95,7 +95,7 @@ describe('deprecated before:browser:launch args', () => { // https://github.com/cypress-io/cypress/issues/20436 systemTests.it.skip('no mutate return', { // TODO: implement webPreferences.additionalArgs here - // once we decide if/what we're going to make the implemenation + // once we decide if/what we're going to make the implementation // SUGGESTION: add this to Cypress.browser.args which will capture // whatever args we use to launch the browser config: { diff --git a/system-tests/test/typescript_spec_support_spec.ts b/system-tests/test/typescript_spec_support_spec.ts index 67dea370a346..e6308d13d502 100644 --- a/system-tests/test/typescript_spec_support_spec.ts +++ b/system-tests/test/typescript_spec_support_spec.ts @@ -31,7 +31,7 @@ describe('e2e typescript in spec and support file', function () { }) }) - it('project wtih custom supportFile passes', function () { + it('project with custom supportFile passes', function () { return systemTests.exec(this, { project: 'ts-proj-custom-names', snapshot: true, diff --git a/tooling/electron-mksnapshot/test/unit/download.spec.ts b/tooling/electron-mksnapshot/test/unit/download.spec.ts index 342f8494c258..069aeeecc7a9 100644 --- a/tooling/electron-mksnapshot/test/unit/download.spec.ts +++ b/tooling/electron-mksnapshot/test/unit/download.spec.ts @@ -34,7 +34,7 @@ describe('download', () => { const file = await attemptDownload(version, false) - expect(file.startsWith(`mksnapshot-v${version}`), `downloads correcly versioned ${file}`).to.be.true + expect(file.startsWith(`mksnapshot-v${version}`), `downloads correctly versioned ${file}`).to.be.true }) }) }) diff --git a/tooling/v8-snapshot/src/doctor/determine-deferred.ts b/tooling/v8-snapshot/src/doctor/determine-deferred.ts index ff8929a69a81..26dacd4ff0f6 100644 --- a/tooling/v8-snapshot/src/doctor/determine-deferred.ts +++ b/tooling/v8-snapshot/src/doctor/determine-deferred.ts @@ -95,14 +95,14 @@ export async function determineDeferred ( const { deferred: updatedDeferred, norewrite: updatedNorewrite, - healthy: updatedHealty, + healthy: updatedHealthy, } = await doctor.heal() const deferredHashFile = path.relative(projectBaseDir, hashFilePath) const updatedMeta = { norewrite: opts.nodeModulesOnly ? [...updatedNorewrite, ...projectNoRewrite] : updatedNorewrite, deferred: opts.nodeModulesOnly ? [...updatedDeferred, ...projectDeferred] : updatedDeferred, - healthy: opts.nodeModulesOnly ? [...updatedHealty, ...projectHealthy] : updatedHealty, + healthy: opts.nodeModulesOnly ? [...updatedHealthy, ...projectHealthy] : updatedHealthy, deferredHashFile, deferredHash: currentHash, } @@ -122,7 +122,7 @@ export async function determineDeferred ( return { norewrite: updatedNorewrite, deferred: updatedDeferred, - healthy: updatedHealty, + healthy: updatedHealthy, } } diff --git a/tooling/v8-snapshot/src/doctor/snapshot-doctor.ts b/tooling/v8-snapshot/src/doctor/snapshot-doctor.ts index 03f620c447dd..5a1e903d5e65 100644 --- a/tooling/v8-snapshot/src/doctor/snapshot-doctor.ts +++ b/tooling/v8-snapshot/src/doctor/snapshot-doctor.ts @@ -88,7 +88,7 @@ class HealState { * 3. Repeat 2. with updated `handled` Set until no all `entries` have ben * added * - * @param meta module metatdata which contains information about which other + * @param meta module metadata which contains information about which other * modules a module imports * * @param entries all modules that we need to handle @@ -143,7 +143,7 @@ function sortModulesByLeafness ( * Sorts all modules by leafness and filters out any module that is not part of * `deferred` modules. * - * @param meta module metatdata which contains information about which other + * @param meta module metadata which contains information about which other * modules a module imports * * @param entries all modules that we need to handle @@ -221,13 +221,13 @@ function unpathify (keys: Set) { * - `norewrite`: modules that should not be rewritten when generating the * snapshot script as * - `deferred`: modules that need to be deferred, that is they can not be - * initialized during snapshot inialization + * initialized during snapshot initialization * - `healthy`: modules that can be fully initialized during snapshot * initialization * - `deferredHashFile`: the file use to derive at the current project state * hash, usually the local `yarn.lock` * - `deferredHash`: the hash of the `deferredHashFile` at the time that this - * metatdata was generated + * metadata was generated * * The `hash` related properties tell the snapshot doctor for future runs if * the metadata can be used as is since the project state didn't change, i.e. diff --git a/tooling/v8-snapshot/src/generator/blueprint.ts b/tooling/v8-snapshot/src/generator/blueprint.ts index 6d82f5bfc954..c3dd10122092 100644 --- a/tooling/v8-snapshot/src/generator/blueprint.ts +++ b/tooling/v8-snapshot/src/generator/blueprint.ts @@ -64,7 +64,7 @@ const pathSep = path.sep === '\\' ? '\\\\' : path.sep * When rendering the snapshot script we take care of the following * (in order of occurrence in the rendered script): * - * 1. We embedd the path separator so that we have it available inside the + * 1. We embed the path separator so that we have it available inside the * snapshot without having to refer to the `path` module * * 2. We also include helper methods like `cannotAccess` which are invoked diff --git a/tooling/v8-snapshot/src/generator/create-snapshot-script.ts b/tooling/v8-snapshot/src/generator/create-snapshot-script.ts index d16180667ceb..348e45c46171 100644 --- a/tooling/v8-snapshot/src/generator/create-snapshot-script.ts +++ b/tooling/v8-snapshot/src/generator/create-snapshot-script.ts @@ -153,7 +153,7 @@ export function assembleScript ( const auxiliaryDataString = JSON.stringify(auxiliaryData) // 2. Determine the path of the main module which needs to be required in - // order to trigger initialization o the modules we want to embedd during + // order to trigger initialization of the modules we want to embed during // snapshot creation const mainModuleRequirePath = opts.entryPoint ?? getMainModuleRequirePath(basedir, entryFilePath)