new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

IBM Carbon · all subjects

build & frameworks

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Yarn commands for dependency management

To add a new dependency, use `yarn add my-package`. To add a new dev dependency, use `yarn add -D my-package`. To update dependencies interactively, use `yarn upgrade-interactive`. To update dependencies including breaking or non-semver versions, use `yarn upgrade-interactive --latest`. To remove a dependency, use `yarn remove my-package`. To resolve merge conflicts in yarn.lock, run `yarn`. To update a package in both yarn.lock and package.json, use `yarn add my-package-i-already-have`.

Never manually update yarn.lock file

The yarn.lock file should never be updated manually. All dependency management should be done through the yarn CLI commands to ensure consistency.

Difference between regular and dev dependencies

Regular dependencies are those required to build the site. Dev dependencies are those required to edit the code, such as linters, formatters, and commit checkers. When NODE_ENV is set to production, yarn will not install development dependencies, which helps decrease installation time.

Yarn uses yarn.lock for version resolution

Yarn derives the actual versions used to build a project from the yarn.lock file, not from the package.json file. The package.json file contains semantically versioned ranges for dependencies, while yarn.lock contains the exact locked versions.

Updating package.json after yarn upgrade-interactive

When running `yarn upgrade-interactive`, the package.json file may not change if the updated version still satisfies the semantic version range specified in package.json. To force an update to package.json with the latest version, re-add the package with `yarn add package-name`.

Resolving yarn.lock merge conflicts

To resolve merge conflicts in the yarn.lock file, run `yarn` which will automatically update the file to resolve the conflict. Then add and commit the resolved file.

Give your agent this brain