Skip to content

Enables all official plugins by default #4253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8,713 changes: 6,908 additions & 1,805 deletions .pnp.cjs

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions .yarn/versions/bbd4868b.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
releases:
"@yarnpkg/cli": major
"@yarnpkg/libui": major
"@yarnpkg/plugin-constraints": major
"@yarnpkg/plugin-interactive-tools": major
"@yarnpkg/plugin-version": major

declined:
- "@yarnpkg/plugin-compat"
- "@yarnpkg/plugin-dlx"
- "@yarnpkg/plugin-essentials"
- "@yarnpkg/plugin-init"
- "@yarnpkg/plugin-nm"
- "@yarnpkg/plugin-npm-cli"
- "@yarnpkg/plugin-pack"
- "@yarnpkg/plugin-patch"
- "@yarnpkg/plugin-pnp"
- "@yarnpkg/plugin-pnpm"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-workspace-tools"
- "@yarnpkg/builder"
- "@yarnpkg/core"
- "@yarnpkg/doctor"
4 changes: 3 additions & 1 deletion packages/plugin-constraints/sources/commands/constraints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import getPath from 'lo
import setPath from 'lodash/set';
import unsetPath from 'lodash/unset';

import {Constraints, EnforcedDependency, EnforcedField} from '../Constraints';
import type {EnforcedDependency, EnforcedField} from '../Constraints';

// eslint-disable-next-line arca/no-default-export
export default class ConstraintsCheckCommand extends BaseCommand {
Expand Down Expand Up @@ -39,6 +39,8 @@ export default class ConstraintsCheckCommand extends BaseCommand {
});

async execute() {
const {Constraints} = await import(`../Constraints`);

const configuration = await Configuration.find(this.context.cwd, this.context.plugins);
const {project} = await Project.find(configuration, this.context.cwd);
const constraints = await Constraints.find(project);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import {Configuration, Project} from '@yarnpkg/core';
import {StreamReport} from '@yarnpkg/core';
import {Command, Option, Usage} from 'clipanion';

import {Constraints} from '../../Constraints';

// eslint-disable-next-line arca/no-default-export
export default class ConstraintsQueryCommand extends BaseCommand {
static paths = [
Expand All @@ -30,6 +28,8 @@ export default class ConstraintsQueryCommand extends BaseCommand {
query = Option.String();

async execute() {
const {Constraints} = await import(`../../Constraints`);

const configuration = await Configuration.find(this.context.cwd, this.context.plugins);
const {project} = await Project.find(configuration, this.context.cwd);
const constraints = await Constraints.find(project);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import {BaseCommand} from '@yarnpkg/cli';
import {Configuration, Project} from '@yarnpkg/core';
import {Command, Option, Usage} from 'clipanion';

import {Constraints} from '../../Constraints';

// eslint-disable-next-line arca/no-default-export
export default class ConstraintsSourceCommand extends BaseCommand {
static paths = [
Expand All @@ -30,6 +28,8 @@ export default class ConstraintsSourceCommand extends BaseCommand {
});

async execute() {
const {Constraints} = await import(`../../Constraints`);

const configuration = await Configuration.find(this.context.cwd, this.context.plugins);
const {project} = await Project.find(configuration, this.context.cwd);
const constraints = await Constraints.find(project);
Expand Down
29 changes: 16 additions & 13 deletions packages/plugin-interactive-tools/sources/commands/search.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
import {BaseCommand} from '@yarnpkg/cli';
import {Configuration, structUtils} from '@yarnpkg/core';
import {Gem} from '@yarnpkg/libui/sources/components/Gem';
import {ScrollableItems} from '@yarnpkg/libui/sources/components/ScrollableItems';
import {useKeypress} from '@yarnpkg/libui/sources/hooks/useKeypress';
import {useMinistore} from '@yarnpkg/libui/sources/hooks/useMinistore';
import {renderForm, SubmitInjectedComponent} from '@yarnpkg/libui/sources/misc/renderForm';
import {Command, Usage} from 'clipanion';
import InkTextInput from 'ink-text-input';
import {Box, Text} from 'ink';
import React, {useEffect, useState} from 'react';

import {AlgoliaPackage, search} from '../algolia';
import {BaseCommand} from '@yarnpkg/cli';
import {Configuration, structUtils} from '@yarnpkg/core';
import type {SubmitInjectedComponent} from '@yarnpkg/libui/sources/misc/renderForm';
import {Command, Usage} from 'clipanion';

import {AlgoliaPackage, search} from '../algolia';

const TARGETS = [`regular`, `dev`, `peer`];

Expand All @@ -33,6 +26,16 @@ export default class SearchCommand extends BaseCommand {
});

async execute() {
const {Gem} = await import(`@yarnpkg/libui/sources/components/Gem`);
const {ScrollableItems} = await import(`@yarnpkg/libui/sources/components/ScrollableItems`);
const {useKeypress} = await import(`@yarnpkg/libui/sources/hooks/useKeypress`);
const {useMinistore} = await import(`@yarnpkg/libui/sources/hooks/useMinistore`);
const {renderForm} = await import(`@yarnpkg/libui/sources/misc/renderForm`);

const {default: InkTextInput} = await import(`ink-text-input`);
const {Box, Text} = await import(`ink`);
const {default: React, useEffect, useState} = await import(`react`);

const configuration = await Configuration.find(this.context.cwd, this.context.plugins);

const Prompt = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import {BaseCommand, WorkspaceRequiredError} from '@yarnpkg/cli';
import {Cache, Configuration, Project, HardDependencies, formatUtils, miscUtils, structUtils, Descriptor, DescriptorHash, StreamReport} from '@yarnpkg/core';
import {ItemOptions} from '@yarnpkg/libui/sources/components/ItemOptions';
import {Pad} from '@yarnpkg/libui/sources/components/Pad';
import {ScrollableItems} from '@yarnpkg/libui/sources/components/ScrollableItems';
import {useMinistore} from '@yarnpkg/libui/sources/hooks/useMinistore';
import {renderForm, SubmitInjectedComponent} from '@yarnpkg/libui/sources/misc/renderForm';
import type {SubmitInjectedComponent} from '@yarnpkg/libui/sources/misc/renderForm';
import {suggestUtils} from '@yarnpkg/plugin-essentials';
import {Command, Usage, UsageError} from 'clipanion';
import {diffWords} from 'diff';
import {Box, Text} from 'ink';
import React, {useEffect, useRef, useState} from 'react';
import semver from 'semver';
import {WriteStream} from 'tty';

Expand Down Expand Up @@ -44,6 +38,14 @@ export default class UpgradeInteractiveCommand extends BaseCommand {
});

async execute() {
const {ItemOptions} = await import(`@yarnpkg/libui/sources/components/ItemOptions`);
const {Pad} = await import(`@yarnpkg/libui/sources/components/Pad`);
const {ScrollableItems} = await import(`@yarnpkg/libui/sources/components/ScrollableItems`);
const {useMinistore} = await import(`@yarnpkg/libui/sources/hooks/useMinistore`);
const {renderForm} = await import(`@yarnpkg/libui/sources/misc/renderForm`);
const {Box, Text} = await import(`ink`);
const {default: React, useEffect, useRef, useState} = await import(`react`);

if (!(this.context.stdout as WriteStream).isTTY)
throw new UsageError(`This command can only be run in a TTY environment`);

Expand Down
1 change: 1 addition & 0 deletions packages/plugin-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"license": "BSD-2-Clause",
"main": "./sources/index.ts",
"dependencies": {
"@yarnpkg/fslib": "workspace:^",
"@yarnpkg/plugin-pack": "workspace:^",
"algoliasearch": "^4.2.0",
"semver": "^7.1.2",
Expand Down
4 changes: 4 additions & 0 deletions packages/plugin-typescript/sources/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Descriptor, Plugin, Workspace, ResolveOptions, Manifest, AllDependencies, DescriptorHash, Package} from '@yarnpkg/core';
import {structUtils, ThrowReport, miscUtils, semverUtils} from '@yarnpkg/core';
import {Filename, ppath, xfs} from '@yarnpkg/fslib';
import {Hooks as EssentialsHooks} from '@yarnpkg/plugin-essentials';
import {suggestUtils} from '@yarnpkg/plugin-essentials';
import {Hooks as PackHooks} from '@yarnpkg/plugin-pack';
Expand All @@ -25,6 +26,9 @@ const afterWorkspaceDependencyAddition = async (
const {project} = workspace;
const {configuration} = project;

if (!xfs.existsSync(ppath.join(project.cwd, `tsconfig.json` as Filename)))
return;

const resolver = configuration.makeResolver();
const resolveOptions: ResolveOptions = {
project,
Expand Down
16 changes: 9 additions & 7 deletions packages/plugin-version/sources/commands/version/check.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import {BaseCommand, WorkspaceRequiredError} from '@yarnpkg/cli';
import {Configuration, MessageName, Project, StreamReport, Workspace, formatUtils, structUtils} from '@yarnpkg/core';
import {npath} from '@yarnpkg/fslib';
import {Gem} from '@yarnpkg/libui/sources/components/Gem';
import {ScrollableItems} from '@yarnpkg/libui/sources/components/ScrollableItems';
import {FocusRequest} from '@yarnpkg/libui/sources/hooks/useFocusRequest';
import {useListInput} from '@yarnpkg/libui/sources/hooks/useListInput';
import {renderForm} from '@yarnpkg/libui/sources/misc/renderForm';
import type {FocusRequest} from '@yarnpkg/libui/sources/hooks/useFocusRequest';
import {Command, Option, Usage, UsageError} from 'clipanion';
import {Box, Text} from 'ink';
import React, {useCallback, useState} from 'react';
import semver from 'semver';

import * as versionUtils from '../../versionUtils';
Expand Down Expand Up @@ -50,6 +44,14 @@ export default class VersionCheckCommand extends BaseCommand {
}

async executeInteractive() {
const {Gem} = await import(`@yarnpkg/libui/sources/components/Gem`);
const {ScrollableItems} = await import(`@yarnpkg/libui/sources/components/ScrollableItems`);
const {FocusRequest} = await import(`@yarnpkg/libui/sources/hooks/useFocusRequest`);
const {useListInput} = await import(`@yarnpkg/libui/sources/hooks/useListInput`);
const {renderForm} = await import(`@yarnpkg/libui/sources/misc/renderForm`);
const {Box, Text} = await import(`ink`);
const {default: React, useCallback, useState} = await import(`react`);

const configuration = await Configuration.find(this.context.cwd, this.context.plugins);
const {project, workspace} = await Project.find(configuration, this.context.cwd);

Expand Down
16 changes: 15 additions & 1 deletion packages/yarnpkg-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@
"@yarnpkg/libzip": "workspace:^",
"@yarnpkg/parsers": "workspace:^",
"@yarnpkg/plugin-compat": "workspace:^",
"@yarnpkg/plugin-constraints": "workspace:^",
"@yarnpkg/plugin-dlx": "workspace:^",
"@yarnpkg/plugin-essentials": "workspace:^",
"@yarnpkg/plugin-exec": "workspace:^",
"@yarnpkg/plugin-file": "workspace:^",
"@yarnpkg/plugin-git": "workspace:^",
"@yarnpkg/plugin-github": "workspace:^",
"@yarnpkg/plugin-http": "workspace:^",
"@yarnpkg/plugin-init": "workspace:^",
"@yarnpkg/plugin-interactive-tools": "workspace:^",
"@yarnpkg/plugin-link": "workspace:^",
"@yarnpkg/plugin-nm": "workspace:^",
"@yarnpkg/plugin-npm": "workspace:^",
Expand All @@ -24,6 +27,10 @@
"@yarnpkg/plugin-patch": "workspace:^",
"@yarnpkg/plugin-pnp": "workspace:^",
"@yarnpkg/plugin-pnpm": "workspace:^",
"@yarnpkg/plugin-stage": "workspace:^",
"@yarnpkg/plugin-typescript": "workspace:^",
"@yarnpkg/plugin-version": "workspace:^",
"@yarnpkg/plugin-workspace-tools": "workspace:^",
"@yarnpkg/shell": "workspace:^",
"ci-info": "^3.2.0",
"clipanion": "^3.2.0-rc.4",
Expand Down Expand Up @@ -66,20 +73,27 @@
"standard": [
"@yarnpkg/plugin-essentials",
"@yarnpkg/plugin-compat",
"@yarnpkg/plugin-constraints",
"@yarnpkg/plugin-dlx",
"@yarnpkg/plugin-exec",
"@yarnpkg/plugin-file",
"@yarnpkg/plugin-git",
"@yarnpkg/plugin-github",
"@yarnpkg/plugin-http",
"@yarnpkg/plugin-init",
"@yarnpkg/plugin-interactive-tools",
"@yarnpkg/plugin-link",
"@yarnpkg/plugin-nm",
"@yarnpkg/plugin-npm",
"@yarnpkg/plugin-npm-cli",
"@yarnpkg/plugin-pack",
"@yarnpkg/plugin-patch",
"@yarnpkg/plugin-pnp",
"@yarnpkg/plugin-pnpm"
"@yarnpkg/plugin-pnpm",
"@yarnpkg/plugin-stage",
"@yarnpkg/plugin-typescript",
"@yarnpkg/plugin-version",
"@yarnpkg/plugin-workspace-tools"
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/yarnpkg-libui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "BSD-2-Clause",
"sideEffects": false,
"peerDependencies": {
"ink": "^2.3.0",
"ink": "^3.0.8",
"react": "^16.8.4"
},
"devDependencies": {
Expand Down
22 changes: 15 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5415,13 +5415,16 @@ __metadata:
"@yarnpkg/monorepo": "workspace:^"
"@yarnpkg/parsers": "workspace:^"
"@yarnpkg/plugin-compat": "workspace:^"
"@yarnpkg/plugin-constraints": "workspace:^"
"@yarnpkg/plugin-dlx": "workspace:^"
"@yarnpkg/plugin-essentials": "workspace:^"
"@yarnpkg/plugin-exec": "workspace:^"
"@yarnpkg/plugin-file": "workspace:^"
"@yarnpkg/plugin-git": "workspace:^"
"@yarnpkg/plugin-github": "workspace:^"
"@yarnpkg/plugin-http": "workspace:^"
"@yarnpkg/plugin-init": "workspace:^"
"@yarnpkg/plugin-interactive-tools": "workspace:^"
"@yarnpkg/plugin-link": "workspace:^"
"@yarnpkg/plugin-nm": "workspace:^"
"@yarnpkg/plugin-npm": "workspace:^"
Expand All @@ -5430,6 +5433,10 @@ __metadata:
"@yarnpkg/plugin-patch": "workspace:^"
"@yarnpkg/plugin-pnp": "workspace:^"
"@yarnpkg/plugin-pnpm": "workspace:^"
"@yarnpkg/plugin-stage": "workspace:^"
"@yarnpkg/plugin-typescript": "workspace:^"
"@yarnpkg/plugin-version": "workspace:^"
"@yarnpkg/plugin-workspace-tools": "workspace:^"
"@yarnpkg/pnpify": "workspace:^"
"@yarnpkg/shell": "workspace:^"
ci-info: ^3.2.0
Expand Down Expand Up @@ -5676,7 +5683,7 @@ __metadata:
react: ^16.13.1
tslib: ^1.13.0
peerDependencies:
ink: ^2.3.0
ink: ^3.0.8
react: ^16.8.4
languageName: unknown
linkType: soft
Expand Down Expand Up @@ -5790,7 +5797,7 @@ __metadata:
languageName: unknown
linkType: soft

"@yarnpkg/plugin-constraints@workspace:packages/plugin-constraints":
"@yarnpkg/plugin-constraints@workspace:^, @yarnpkg/plugin-constraints@workspace:packages/plugin-constraints":
version: 0.0.0-use.local
resolution: "@yarnpkg/plugin-constraints@workspace:packages/plugin-constraints"
dependencies:
Expand Down Expand Up @@ -5851,7 +5858,7 @@ __metadata:
languageName: unknown
linkType: soft

"@yarnpkg/plugin-exec@workspace:packages/plugin-exec":
"@yarnpkg/plugin-exec@workspace:^, @yarnpkg/plugin-exec@workspace:packages/plugin-exec":
version: 0.0.0-use.local
resolution: "@yarnpkg/plugin-exec@workspace:packages/plugin-exec"
dependencies:
Expand Down Expand Up @@ -5937,7 +5944,7 @@ __metadata:
languageName: unknown
linkType: soft

"@yarnpkg/plugin-interactive-tools@workspace:packages/plugin-interactive-tools":
"@yarnpkg/plugin-interactive-tools@workspace:^, @yarnpkg/plugin-interactive-tools@workspace:packages/plugin-interactive-tools":
version: 0.0.0-use.local
resolution: "@yarnpkg/plugin-interactive-tools@workspace:packages/plugin-interactive-tools"
dependencies:
Expand Down Expand Up @@ -6131,7 +6138,7 @@ __metadata:
languageName: unknown
linkType: soft

"@yarnpkg/plugin-typescript@workspace:packages/plugin-typescript":
"@yarnpkg/plugin-typescript@workspace:^, @yarnpkg/plugin-typescript@workspace:packages/plugin-typescript":
version: 0.0.0-use.local
resolution: "@yarnpkg/plugin-typescript@workspace:packages/plugin-typescript"
dependencies:
Expand All @@ -6140,6 +6147,7 @@ __metadata:
"@yarnpkg/builder": "workspace:^"
"@yarnpkg/cli": "workspace:^"
"@yarnpkg/core": "workspace:^"
"@yarnpkg/fslib": "workspace:^"
"@yarnpkg/plugin-essentials": "workspace:^"
"@yarnpkg/plugin-pack": "workspace:^"
algoliasearch: ^4.2.0
Expand All @@ -6152,7 +6160,7 @@ __metadata:
languageName: unknown
linkType: soft

"@yarnpkg/plugin-version@workspace:packages/plugin-version":
"@yarnpkg/plugin-version@workspace:^, @yarnpkg/plugin-version@workspace:packages/plugin-version":
version: 0.0.0-use.local
resolution: "@yarnpkg/plugin-version@workspace:packages/plugin-version"
dependencies:
Expand All @@ -6179,7 +6187,7 @@ __metadata:
languageName: unknown
linkType: soft

"@yarnpkg/plugin-workspace-tools@workspace:packages/plugin-workspace-tools":
"@yarnpkg/plugin-workspace-tools@workspace:^, @yarnpkg/plugin-workspace-tools@workspace:packages/plugin-workspace-tools":
version: 0.0.0-use.local
resolution: "@yarnpkg/plugin-workspace-tools@workspace:packages/plugin-workspace-tools"
dependencies:
Expand Down