mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 11:29:02 +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>
173 lines
4.5 KiB
JSON
173 lines
4.5 KiB
JSON
{
|
|
// Editor
|
|
"editor.tabSize": 2,
|
|
"editor.insertSpaces": true,
|
|
"editor.formatOnSave": true,
|
|
"editor.formatOnSaveMode": "file",
|
|
|
|
// Search
|
|
"search.quickOpen.includeSymbols": false,
|
|
"search.seedWithNearestWord": true,
|
|
"search.smartCase": true,
|
|
"search.exclude": {
|
|
"node_modules": true,
|
|
".git": true,
|
|
"vendor/*/**": true,
|
|
"test/node.js/upstream": true,
|
|
// This will fill up your whole search history.
|
|
"test/js/node/test/fixtures": true,
|
|
"test/js/node/test/common": true,
|
|
},
|
|
"search.followSymlinks": false,
|
|
"search.useIgnoreFiles": true,
|
|
|
|
// Git
|
|
"git.autoRepositoryDetection": "openEditors",
|
|
"git.ignoreSubmodules": true,
|
|
"git.ignoreLimitWarning": true,
|
|
|
|
// Zig
|
|
"zig.initialSetupDone": true,
|
|
"zig.buildOption": "build",
|
|
"zig.zls.zigLibPath": "${workspaceFolder}/vendor/zig/lib",
|
|
"zig.buildArgs": ["-Dgenerated-code=./build/debug/codegen", "--watch", "-fincremental"],
|
|
"zig.zls.buildOnSaveStep": "check",
|
|
// "zig.zls.enableBuildOnSave": true,
|
|
// "zig.buildOnSave": true,
|
|
"zig.buildFilePath": "${workspaceFolder}/build.zig",
|
|
"zig.path": "${workspaceFolder}/vendor/zig/zig.exe",
|
|
"zig.zls.path": "${workspaceFolder}/vendor/zig/zls.exe",
|
|
"zig.formattingProvider": "zls",
|
|
"zig.zls.enableInlayHints": false,
|
|
"[zig]": {
|
|
"editor.tabSize": 4,
|
|
"editor.useTabStops": false,
|
|
"editor.defaultFormatter": "ziglang.vscode-zig",
|
|
"editor.codeActionsOnSave": {
|
|
"source.organizeImports": "never",
|
|
},
|
|
},
|
|
|
|
// lldb
|
|
"lldb.launch.initCommands": ["command source ${workspaceFolder}/.lldbinit"],
|
|
"lldb.verboseLogging": false,
|
|
|
|
// C++
|
|
"cmake.configureOnOpen": false,
|
|
"C_Cpp.errorSquiggles": "enabled",
|
|
"[cpp]": {
|
|
"editor.tabSize": 4,
|
|
"editor.defaultFormatter": "xaver.clang-format",
|
|
},
|
|
"[c]": {
|
|
"editor.tabSize": 4,
|
|
"editor.defaultFormatter": "xaver.clang-format",
|
|
},
|
|
"[h]": {
|
|
"editor.tabSize": 4,
|
|
"editor.defaultFormatter": "xaver.clang-format",
|
|
},
|
|
"clangd.arguments": ["--header-insertion=never"],
|
|
|
|
// JavaScript
|
|
"prettier.enable": true,
|
|
"prettier.configPath": ".prettierrc",
|
|
"eslint.workingDirectories": ["${workspaceFolder}/packages/bun-types"],
|
|
"[javascript]": {
|
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
},
|
|
"[javascriptreact]": {
|
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
},
|
|
"prettier.prettierPath": "./node_modules/prettier",
|
|
|
|
// TypeScript
|
|
"typescript.tsdk": "node_modules/typescript/lib",
|
|
"[typescript]": {
|
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
},
|
|
"[typescriptreact]": {
|
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
},
|
|
|
|
// JSON
|
|
"[json]": {
|
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
},
|
|
"[jsonc]": {
|
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
},
|
|
|
|
// Markdown
|
|
"[markdown]": {
|
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
"editor.unicodeHighlight.ambiguousCharacters": true,
|
|
"editor.unicodeHighlight.invisibleCharacters": true,
|
|
"diffEditor.ignoreTrimWhitespace": false,
|
|
"editor.wordWrap": "on",
|
|
"editor.quickSuggestions": {
|
|
"comments": "off",
|
|
"strings": "off",
|
|
"other": "off",
|
|
},
|
|
},
|
|
|
|
// TOML
|
|
"[toml]": {
|
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
},
|
|
|
|
// YAML
|
|
"[yaml]": {
|
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
},
|
|
|
|
// Docker
|
|
"[dockerfile]": {
|
|
"editor.formatOnSave": false,
|
|
},
|
|
|
|
// Files
|
|
"files.exclude": {
|
|
"**/.git": true,
|
|
"**/.svn": true,
|
|
"**/.hg": true,
|
|
"**/CVS": true,
|
|
"**/.DS_Store": true,
|
|
"**/Thumbs.db": true,
|
|
"**/*.xcworkspacedata": true,
|
|
"**/*.xcscheme": true,
|
|
"**/*.xcodeproj": true,
|
|
"**/*.i": true,
|
|
},
|
|
"files.associations": {
|
|
"*.css": "tailwindcss",
|
|
"*.idl": "cpp",
|
|
"*.mdc": "markdown",
|
|
"array": "cpp",
|
|
"ios": "cpp",
|
|
"oxlint.json": "jsonc",
|
|
"bun.lock": "jsonc",
|
|
},
|
|
"C_Cpp.files.exclude": {
|
|
"**/.vscode": true,
|
|
"WebKit/JSTests": true,
|
|
"WebKit/Tools": true,
|
|
"WebKit/WebDriverTests": true,
|
|
"WebKit/WebKit.xcworkspace": true,
|
|
"WebKit/WebKitLibraries": true,
|
|
"WebKit/Websites": true,
|
|
"WebKit/resources": true,
|
|
"WebKit/LayoutTests": true,
|
|
"WebKit/ManualTests": true,
|
|
"WebKit/PerformanceTests": true,
|
|
"WebKit/WebKitLegacy": true,
|
|
"WebKit/WebCore": true,
|
|
"WebKit/WebDriver": true,
|
|
"WebKit/WebKitBuild": true,
|
|
"WebKit/WebInspectorUI": true,
|
|
},
|
|
"git.detectSubmodules": false,
|
|
"bun.test.customScript": "./build/debug/bun-debug test"
|
|
}
|