Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions .yarn/versions/45fda3ad.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
releases:
"@yarnpkg/cli": patch
"@yarnpkg/plugin-essentials": patch

declined:
- "@yarnpkg/plugin-compat"
- "@yarnpkg/plugin-constraints"
- "@yarnpkg/plugin-dlx"
- "@yarnpkg/plugin-init"
- "@yarnpkg/plugin-interactive-tools"
- "@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-version"
- "@yarnpkg/plugin-workspace-tools"
- "@yarnpkg/builder"
- "@yarnpkg/core"
- "@yarnpkg/doctor"
Original file line number Diff line number Diff line change
@@ -1,8 +1,65 @@
import {Filename, xfs, ppath, npath} from '@yarnpkg/fslib';
import {tests} from 'pkg-tests-core';
import {tests, misc} from 'pkg-tests-core';

describe(`Commands`, () => {
describe(`install`, () => {
test(
`it should print regular messages as JSON items when using --json`,
makeTemporaryEnv({}, async ({path, run, source}) => {
const {stdout} = await run(`install`, `--json`);

expect(misc.parseJsonStream(stdout)).toEqual([{
data: `Yarn 0.0.0`,
displayName: `YN0000`,
indent: `· `,
name: 0,
type: `info`,
}, {
data: `┌ Resolution step`,
displayName: `YN0000`,
indent: ``,
name: null,
type: `info`,
}, {
data: `└ Completed`,
displayName: `YN0000`,
indent: ``,
name: null,
type: `info`,
}, {
data: `┌ Fetch step`,
displayName: `YN0000`,
indent: ``,
name: null,
type: `info`,
}, {
data: `└ Completed`,
displayName: `YN0000`,
indent: ``,
name: null,
type: `info`,
}, {
data: `┌ Link step`,
displayName: `YN0000`,
indent: ``,
name: null,
type: `info`,
}, {
data: `└ Completed`,
displayName: `YN0000`,
indent: ``,
name: null,
type: `info`,
}, {
data: `Done`,
displayName: `YN0000`,
indent: `· `,
name: 0,
type: `info`,
}]);
}),
);

test(
`it should print the logs to the standard output when using --inline-builds`,
makeTemporaryEnv({
Expand Down
15 changes: 9 additions & 6 deletions packages/plugin-essentials/sources/commands/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,15 +344,18 @@ export default class YarnCommand extends BaseCommand {
// the Configuration and Install classes). Feel free to open an issue
// in order to ask for design feedback before writing features.

return await project.installWithNewReport({
const report = await StreamReport.start({
configuration,
json: this.json,
stdout: this.context.stdout,
}, {
cache,
immutable,
checkResolutions,
mode: this.mode,
forceSectionAlignment: true,
includeLogs: true,
includeVersion: true,
}, async report => {
await project.install({cache, report, immutable, checkResolutions, mode: this.mode});
});

return report.exitCode();
}
}

Expand Down