mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
### What does this PR do? fixes #6409 This PR implements `bun install` automatic migration from yarn.lock files to bun.lock, preserving versions exactly. The migration happens automatically when: 1. A project has a `yarn.lock` file 2. No `bun.lock` or `bun.lockb` file exists 3. User runs `bun install` ### Current Status: ✅ Complete and Working The yarn.lock migration feature is **fully functional and comprehensively tested**. All dependency types are supported: - ✅ Regular npm dependencies (`package@^1.0.0`) - ✅ Git dependencies (`git+https://github.com/user/repo.git`, `github:user/repo`) - ✅ NPM alias dependencies (`alias@npm:package@version`) - ✅ File dependencies (`file:./path`) - ✅ Remote tarball URLs (`https://registry.npmjs.org/package.tgz`) - ✅ Local tarball files (`file:package.tgz`) ### Test Results ```bash $ bun bd test test/cli/install/migration/yarn-lock-migration.test.ts ✅ 4 pass, 0 fail - yarn-lock-mkdirp (basic npm dependency) - yarn-lock-mkdirp-no-resolved (npm dependency without resolved field) - yarn-lock-mkdirp-file-dep (file dependency) - yarn-stuff (all complex dependency types: git, npm aliases, file, remote tarballs) ``` ### How did you verify your code works? 1. **Comprehensive test suite**: Added 4 test cases covering all dependency types 2. **Version preservation**: Verified that package versions are preserved exactly during migration 3. **Real-world scenarios**: Tested with complex yarn.lock files containing git deps, npm aliases, file deps, and remote tarballs 4. **Migration logging**: Confirms migration with log message `[X.XXms] migrated lockfile from yarn.lock` ### Key Implementation Details - **Core parser**: `src/install/yarn.zig` handles all yarn.lock parsing and dependency type resolution - **Integration**: Migration is built into existing lockfile loading infrastructure - **Performance**: Migration typically completes in ~1ms for most projects - **Compatibility**: Preserves exact dependency versions and resolution behavior The implementation correctly handles edge cases like npm aliases, git dependencies with commits, file dependencies with transitive deps, and remote tarballs. --------- Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: Claude Bot <claude-bot@bun.sh> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: RiskyMH <git@riskymh.dev> Co-authored-by: RiskyMH <56214343+RiskyMH@users.noreply.github.com>
158 lines
4.9 KiB
JSON
158 lines
4.9 KiB
JSON
{
|
|
"name": "yarn",
|
|
"installationMethod": "unknown",
|
|
"version": "1.23.0-0",
|
|
"license": "BSD-2-Clause",
|
|
"preferGlobal": true,
|
|
"description": "📦🐈 Fast, reliable, and secure dependency management.",
|
|
"dependencies": {
|
|
"@zkochan/cmd-shim": "^3.1.0",
|
|
"babel-runtime": "^6.26.0",
|
|
"bytes": "^3.0.0",
|
|
"camelcase": "^4.0.0",
|
|
"chalk": "^2.1.0",
|
|
"cli-table3": "^0.4.0",
|
|
"commander": "^2.9.0",
|
|
"death": "^1.0.0",
|
|
"debug": "^3.0.0",
|
|
"deep-equal": "^1.0.1",
|
|
"detect-indent": "^5.0.0",
|
|
"dnscache": "^1.0.1",
|
|
"glob": "^7.1.1",
|
|
"gunzip-maybe": "^1.4.0",
|
|
"hash-for-dep": "^1.2.3",
|
|
"imports-loader": "^0.8.0",
|
|
"ini": "^1.3.4",
|
|
"inquirer": "^6.2.0",
|
|
"invariant": "^2.2.0",
|
|
"is-builtin-module": "^2.0.0",
|
|
"is-ci": "^1.0.10",
|
|
"is-webpack-bundle": "^1.0.0",
|
|
"js-yaml": "^3.13.1",
|
|
"leven": "^2.0.0",
|
|
"loud-rejection": "^1.2.0",
|
|
"micromatch": "^2.3.11",
|
|
"mkdirp": "^0.5.1",
|
|
"node-emoji": "^1.6.1",
|
|
"normalize-url": "^2.0.0",
|
|
"npm-logical-tree": "^1.2.1",
|
|
"object-path": "^0.11.2",
|
|
"proper-lockfile": "^2.0.0",
|
|
"puka": "^1.0.0",
|
|
"read": "^1.0.7",
|
|
"request": "^2.87.0",
|
|
"request-capture-har": "^1.2.2",
|
|
"rimraf": "^2.5.0",
|
|
"semver": "^5.1.0",
|
|
"ssri": "^5.3.0",
|
|
"strip-ansi": "^4.0.0",
|
|
"strip-bom": "^3.0.0",
|
|
"tar-fs": "^1.16.0",
|
|
"tar-stream": "^1.6.1",
|
|
"uuid": "^3.0.1",
|
|
"v8-compile-cache": "^2.0.0",
|
|
"validate-npm-package-license": "^3.0.4",
|
|
"yn": "^2.0.0"
|
|
},
|
|
"devDependencies": {
|
|
"babel-core": "^6.26.0",
|
|
"babel-eslint": "^7.2.3",
|
|
"babel-loader": "^6.2.5",
|
|
"babel-plugin-array-includes": "^2.0.3",
|
|
"babel-plugin-inline-import": "^3.0.0",
|
|
"babel-plugin-transform-builtin-extend": "^1.1.2",
|
|
"babel-plugin-transform-inline-imports-commonjs": "^1.0.0",
|
|
"babel-plugin-transform-runtime": "^6.4.3",
|
|
"babel-preset-env": "^1.6.0",
|
|
"babel-preset-flow": "^6.23.0",
|
|
"babel-preset-stage-0": "^6.0.0",
|
|
"babylon": "^6.5.0",
|
|
"commitizen": "^2.9.6",
|
|
"cz-conventional-changelog": "^2.0.0",
|
|
"eslint": "^4.3.0",
|
|
"eslint-config-fb-strict": "^22.0.0",
|
|
"eslint-plugin-babel": "^5.0.0",
|
|
"eslint-plugin-flowtype": "^2.35.0",
|
|
"eslint-plugin-jasmine": "^2.6.2",
|
|
"eslint-plugin-jest": "^21.0.0",
|
|
"eslint-plugin-jsx-a11y": "^6.0.2",
|
|
"eslint-plugin-prefer-object-spread": "^1.2.1",
|
|
"eslint-plugin-prettier": "^2.1.2",
|
|
"eslint-plugin-react": "^7.1.0",
|
|
"eslint-plugin-relay": "^0.0.28",
|
|
"eslint-plugin-yarn-internal": "file:scripts/eslint-rules",
|
|
"execa": "^0.11.0",
|
|
"fancy-log": "^1.3.2",
|
|
"flow-bin": "^0.66.0",
|
|
"git-release-notes": "^3.0.0",
|
|
"gulp": "^4.0.0",
|
|
"gulp-babel": "^7.0.0",
|
|
"gulp-if": "^2.0.1",
|
|
"gulp-newer": "^1.0.0",
|
|
"gulp-plumber": "^1.0.1",
|
|
"gulp-sourcemaps": "^2.2.0",
|
|
"jest": "^22.4.4",
|
|
"jsinspect": "^0.12.6",
|
|
"minimatch": "^3.0.4",
|
|
"mock-stdin": "^0.3.0",
|
|
"prettier": "^1.5.2",
|
|
"string-replace-loader": "^2.1.1",
|
|
"temp": "^0.8.3",
|
|
"webpack": "^2.1.0-beta.25",
|
|
"yargs": "^6.3.0"
|
|
},
|
|
"resolutions": {
|
|
"sshpk": "^1.14.2"
|
|
},
|
|
"engines": {
|
|
"node": ">=4.0.0"
|
|
},
|
|
"repository": "yarnpkg/yarn",
|
|
"bin": {
|
|
"yarn": "./bin/yarn.js",
|
|
"yarnpkg": "./bin/yarn.js"
|
|
},
|
|
"scripts": {
|
|
"build": "gulp build",
|
|
"build-bundle": "node ./scripts/build-webpack.js",
|
|
"build-chocolatey": "powershell ./scripts/build-chocolatey.ps1",
|
|
"build-deb": "./scripts/build-deb.sh",
|
|
"build-dist": "bash ./scripts/build-dist.sh",
|
|
"build-win-installer": "scripts\\build-windows-installer.bat",
|
|
"changelog": "git-release-notes $(git describe --tags --abbrev=0 $(git describe --tags --abbrev=0)^)..$(git describe --tags --abbrev=0) scripts/changelog.md",
|
|
"dupe-check": "yarn jsinspect ./src",
|
|
"lint": "eslint . && flow check",
|
|
"pkg-tests": "yarn --cwd packages/pkg-tests jest yarn.test.js",
|
|
"prettier": "eslint src __tests__ --fix",
|
|
"release-branch": "./scripts/release-branch.sh",
|
|
"test": "yarn lint && yarn test-only",
|
|
"test-only": "node --max_old_space_size=4096 node_modules/jest/bin/jest.js --verbose",
|
|
"test-only-debug": "node --inspect-brk --max_old_space_size=4096 node_modules/jest/bin/jest.js --runInBand --verbose",
|
|
"test-coverage": "node --max_old_space_size=4096 node_modules/jest/bin/jest.js --coverage --verbose",
|
|
"watch": "gulp watch",
|
|
"commit": "git-cz"
|
|
},
|
|
"jest": {
|
|
"collectCoverageFrom": [
|
|
"src/**/*.js"
|
|
],
|
|
"testEnvironment": "node",
|
|
"modulePathIgnorePatterns": [
|
|
"__tests__/fixtures/",
|
|
"packages/pkg-tests/pkg-tests-fixtures",
|
|
"dist/"
|
|
],
|
|
"testPathIgnorePatterns": [
|
|
"__tests__/(fixtures|__mocks__)/",
|
|
"updates/",
|
|
"_(temp|mock|install|init|helpers).js$",
|
|
"packages/pkg-tests"
|
|
]
|
|
},
|
|
"config": {
|
|
"commitizen": {
|
|
"path": "./node_modules/cz-conventional-changelog"
|
|
}
|
|
}
|
|
}
|