Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async execute() {
const configuration = await Configuration.find(this.context.cwd, this.context.plugins);
const {project, workspace} = await Project.find(configuration, this.context.cwd);
const cache = await Cache.find(configuration);
if (!workspace)
throw new WorkspaceRequiredError(this.context.cwd);
// @ts-ignore
const prompt = inquirer.createPromptModule({
input: this.context.stdin,
output: this.context.stdout,
});
const modifier = this.exact
? suggestUtils.Modifier.EXACT
: this.tilde
? suggestUtils.Modifier.TILDE
: suggestUtils.Modifier.CARET;
async execute() {
const configuration = await Configuration.find(this.context.cwd, this.context.plugins);
const {project, workspace} = await Project.find(configuration, this.context.cwd);
const cache = await Cache.find(configuration);
if (!workspace)
throw new WorkspaceRequiredError(this.context.cwd);
// @ts-ignore
const prompt = inquirer.createPromptModule({
input: this.context.stdin,
output: this.context.stdout,
});
const modifier = this.exact
? suggestUtils.Modifier.EXACT
: this.tilde
? suggestUtils.Modifier.TILDE
: suggestUtils.Modifier.CARET;
async execute() {
const configuration = await Configuration.find(this.context.cwd, this.context.plugins);
const {workspace} = await Project.find(configuration, this.context.cwd);
if (!workspace)
throw new WorkspaceRequiredError(this.context.cwd);
const report = await StreamReport.start({
configuration,
stdout: this.context.stdout,
}, async report => {
const scripts = workspace!.manifest.scripts;
const keys = miscUtils.sortMap(scripts.keys(), key => key);
const inspectConfig = {
breakLength: Infinity,
colors: configuration.get(`enableColors`),
maxArrayLength: 2,
};
async execute() {
const configuration = await Configuration.find(this.context.cwd, this.context.plugins);
const {project} = await Project.find(configuration, this.context.cwd);
const report = await StreamReport.start({
configuration,
stdout: this.context.stdout,
}, async (report: StreamReport) => {
if (this.range === `latest`)
this.range = `*`;
let candidates: Array = [];
let bundleUrl: string;
let bundleVersion: string;
if (BERRY_RANGES.has(this.range)) {
bundleUrl = `https://github.com/yarnpkg/berry/raw/master/packages/yarnpkg-cli/bin/yarn.js`;
bundleVersion = `rc`;
async execute() {
const configuration = await Configuration.find(this.context.cwd, this.context.plugins);
const {project} = await Project.find(configuration, this.context.cwd);
const {code} = await execUtils.pipevp(`node`, this.args, {
cwd: this.context.cwd,
stdin: this.context.stdin,
stdout: this.context.stdout,
stderr: this.context.stderr,
env: await scriptUtils.makeScriptEnv(project),
});
return code;
}
}
async execute() {
const configuration = await Configuration.find(this.context.cwd, this.context.plugins);
const {project, workspace} = await Project.find(configuration, this.context.cwd);
if (!workspace)
throw new WorkspaceRequiredError(this.context.cwd);
const identHash = structUtils.parseIdent(this.package).identHash;
const whyTree = this.recursive
? whyRecursive(project, identHash, {configuration, peers: this.peers})
: whySimple(project, identHash, {configuration, peers: this.peers});
printTree(this.context.stdout, whyTree);
}
}
const pkgs = typeof this.pkg !== `undefined`
? [this.pkg]
: [this.command];
const command = structUtils.parseDescriptor(this.command).name;
const addExitCode = await this.cli.run([`add`, `--`, ...pkgs], {cwd: tmpDir, quiet: this.quiet});
if (addExitCode !== 0)
return addExitCode;
if (!this.quiet)
this.context.stdout.write(`\n`);
const configuration = await Configuration.find(tmpDir, this.context.plugins);
const {workspace} = await Project.find(configuration, tmpDir);
if (workspace === null)
throw new WorkspaceRequiredError(tmpDir);
return await scriptUtils.executeWorkspaceAccessibleBinary(workspace, command, this.args, {
cwd: this.context.cwd,
stdin: this.context.stdin,
stdout: this.context.stdout,
stderr: this.context.stderr,
});
} finally {
await xfs.removePromise(tmpDir);
}
}
}
async executeInteractive() {
const configuration = await Configuration.find(this.context.cwd, this.context.plugins);
const {project, workspace} = await Project.find(configuration, this.context.cwd);
if (!workspace)
throw new WorkspaceRequiredError(this.context.cwd);
await project.resolveEverything({
lockfileOnly: true,
report: new ThrowReport(),
});
const root = await fetchRoot(this.context.cwd);
const base = await fetchBase(root);
const files = await fetchChangedFiles(root, {base: base.hash});
const workspaces = [...new Set(files.map(file => project.getWorkspaceByFilePath(file)))];
if (workspaces.length === 0)
return;
}, async report => {
const {project} = await Project.find(configuration, this.context.cwd);
const name = this.name!;
const candidatePath = ppath.resolve(this.context.cwd, NodeFS.toPortablePath(name));
let pluginBuffer;
if (await xfs.existsPromise(candidatePath)) {
report.reportInfo(MessageName.UNNAMED, `Reading ${configuration.format(candidatePath, `green`)}`);
pluginBuffer = await xfs.readFilePromise(candidatePath);
} else {
const ident = structUtils.tryParseIdent(name);
let pluginUrl;
if (ident) {
const key = structUtils.stringifyIdent(ident);
const data = await getAvailablePlugins(configuration);
async execute() {
for (let t = 0; t < 10; ++t) {
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);
const toSave = new Set();
const report = await StreamReport.start({
configuration,
stdout: this.context.stdout,
}, async report => {
const result = await constraints.process();
await processDependencyConstraints(toSave, result.enforcedDependencies, {
fix: this.fix,
configuration,
report,
});