From 82d24e6460cf1625bd65780919e66ab3a2620d10 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Mon, 1 Jul 2024 16:48:26 +0200 Subject: [PATCH 1/4] Add support for Bun Closes #25 --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index 9235d1f..d5be29f 100644 --- a/index.js +++ b/index.js @@ -42,9 +42,12 @@ function detectLockfile() { let lockfileShrinkwrap = join(packageDir, 'npm-shrinkwrap.json') let lockfileYarn = join(packageDir, 'yarn.lock') let lockfilePnpm = join(packageDir, 'pnpm-lock.yaml') + let lockfileBun = join(packageDir, 'bun.lockb') if (existsSync(lockfilePnpm)) { return { file: lockfilePnpm, mode: 'pnpm' } + } else if (existsSync(lockfileBun)) { + return { file: lockfileBun, mode: 'bun' } } else if (existsSync(lockfileNpm)) { return { file: lockfileNpm, mode: 'npm' } } else if (existsSync(lockfileYarn)) { @@ -287,6 +290,8 @@ module.exports = function updateDB(print = defaultPrint) { updateWith(print, yarnCommand + ' up -R caniuse-lite') } else if (lock.mode === 'pnpm') { updateWith(print, 'pnpm up caniuse-lite') + } else if (lock.mode === 'bun') { + updateWith(print, 'bun update caniuse-lite') } else { updatePackageManually(print, lock, latest) } From 8018dc6f2f9d02df772bd4f7b35933fd61af7240 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Mon, 1 Jul 2024 17:07:02 +0200 Subject: [PATCH 2/4] Add tests --- test/fixtures/update-bun/bun.lockb | Bin 0 -> 31060 bytes test/fixtures/update-bun/package.json | 7 +++++++ test/index.test.js | 14 ++++++++++++++ 3 files changed, 21 insertions(+) create mode 100755 test/fixtures/update-bun/bun.lockb create mode 100644 test/fixtures/update-bun/package.json diff --git a/test/fixtures/update-bun/bun.lockb b/test/fixtures/update-bun/bun.lockb new file mode 100755 index 0000000000000000000000000000000000000000..4c8d81dd10354e960066a833863ec296616fbef0 GIT binary patch literal 31060 zcmeHw2{@G9`@a~Z1x3c3Yuc zv{Fe6X?@#E{`Z-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q72Q4vrW_2|JVyR>E<9?T5aA~dQoBEupsj^)K?vY8Sul@+ZF$o9 z?RB$tMSyOd(K2JA|5rzNL~lo8VFf@D{-6pjOFB14k$Q!$8+DBkn?Gz^1V+W($`@>u1nUsmD+U2R$Ge@bp&KKBLZnkGSPLj{wIn*lOWbGyBk@bX z)zPL3YfCu!{AQjYX`;ep}v^XQ9>H-aK29TKMg33Qs>=fuhGo zc==9+?+bK0(Vd?r5mGZhl~4tD`W-yZKTiRIJG>5fuws9+evqX3O{rjZ?Pybl(VJJ7 z=5>n%{%fJYBs$vQVeDU5OA_|4g#u&ftlYwWlheIY(K~y5N_mJwkA~Jn~6?BH=8K2;~^pcTqH0S zfyf^4A9Arh8D7F|Qac@JT@kQbX9(t}j?NRkwjX|)xZ{7lv#cf?8&_ZWt|JK`W5@_p!E88EA0+!hC_`V8}^$bal|ok9M5s+==drwDon21XmwQsrG;~BM<(|>H6t<51=Ua57wpyywe^rj&_SO34x=5#kgEYQIY~8w zNlY+}wG6$smJu8MC%Y{8beYPfvwaxs06!gXE?scRkJmuKX|#)nTB170@H-S_haK)k x$)X^AlOzM}5LeUf=;EiIA&Ay}6-;~`4LeK|ULL?JpddG~hZeqd`tSSq{{d4>aRdMW literal 0 HcmV?d00001 diff --git a/test/fixtures/update-bun/package.json b/test/fixtures/update-bun/package.json new file mode 100644 index 0000000..98611fd --- /dev/null +++ b/test/fixtures/update-bun/package.json @@ -0,0 +1,7 @@ +{ + "devDependencies": { + "autoprefixer": "^9.7.4", + "postcss-preset-env": "^6.7.0", + "qs": "^6.6.0" + } +} diff --git a/test/index.test.js b/test/index.test.js index 667b8c1..953a7fb 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -264,4 +264,18 @@ test('updates caniuse-lite for pnpm', async () => { ) }) +test('updates caniuse-lite for bun', async () => { + await chdir('update-bun', 'package.json', 'bun.lockb') + match( + runUpdate(), + `Latest version: ${caniuse.version}\n` + + 'Updating caniuse-lite version\n' + + '$ bun update caniuse-lite\n' + + 'caniuse-lite has been successfully updated\n' + ) + + let pmls = execSync('bun pm ls --all', { env: { ...process.env, NO_COLOR: "1", FORCE_COLOR: "0" } }).toString() + ok(pmls.includes(`caniuse-lite@${caniuse.version}`)) +}) + test.run() From c64cb8d58338c4faa91a3191863f668cd60688ab Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Mon, 1 Jul 2024 17:10:50 +0200 Subject: [PATCH 3/4] Add Bun to GitHub actions --- .github/workflows/test.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e6e2394..5522687 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,6 +17,8 @@ jobs: uses: pnpm/action-setup@v3 with: version: 9 + - name: Install Bun + uses: oven-sh/setup-bun@v1 - name: Install Node.js uses: actions/setup-node@v4 with: @@ -43,6 +45,8 @@ jobs: uses: pnpm/action-setup@v3 with: version: 9 + - name: Install Bun + uses: oven-sh/setup-bun@v1 - name: Install Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: @@ -67,6 +71,8 @@ jobs: uses: pnpm/action-setup@v3 with: version: 7 + - name: Install Bun + uses: oven-sh/setup-bun@v1 - name: Install Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: From d1517c5737fba28aaba756f8c66e13f6c4daa211 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Mon, 1 Jul 2024 17:44:50 +0200 Subject: [PATCH 4/4] Fix property ordering --- test/index.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/index.test.js b/test/index.test.js index 953a7fb..77746ef 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -274,7 +274,7 @@ test('updates caniuse-lite for bun', async () => { 'caniuse-lite has been successfully updated\n' ) - let pmls = execSync('bun pm ls --all', { env: { ...process.env, NO_COLOR: "1", FORCE_COLOR: "0" } }).toString() + let pmls = execSync('bun pm ls --all', { env: { ...process.env, FORCE_COLOR: "0", NO_COLOR: "1" } }).toString() ok(pmls.includes(`caniuse-lite@${caniuse.version}`)) })