Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Lazy-loads packages
  • Loading branch information
arcanis committed Mar 22, 2022
commit f1325da376f7f6d152562c4468d2dbcded7a4267
6 changes: 3 additions & 3 deletions .yarn/versions/bbd4868b.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
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-constraints"
- "@yarnpkg/plugin-dlx"
- "@yarnpkg/plugin-essentials"
- "@yarnpkg/plugin-init"
- "@yarnpkg/plugin-interactive-tools"
- "@yarnpkg/plugin-nm"
- "@yarnpkg/plugin-npm-cli"
- "@yarnpkg/plugin-pack"
Expand All @@ -17,7 +18,6 @@ declined:
- "@yarnpkg/plugin-pnpm"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-version"
- "@yarnpkg/plugin-workspace-tools"
- "@yarnpkg/builder"
- "@yarnpkg/core"
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-constraints/sources/Constraints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import pl from 'tau-prolog';

import {linkProjectToSession} from './tauModule';

console.log(`constraints loaded`)
plLists(pl);

export type EnforcedDependency = {
Expand Down
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
19 changes: 11 additions & 8 deletions packages/plugin-interactive-tools/sources/commands/search.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
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 type {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';

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
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 {Command, Option, Usage, UsageError} from 'clipanion';
import {Box, Text} from 'ink';
import React, {useCallback, useState} from 'react';
import type {FocusRequest} from '@yarnpkg/libui/sources/hooks/useFocusRequest';
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