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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A GitHub action that reports changes in compressed file sizes on your PRs.

- Automatically uses `yarn`, `pnpm`, `bun`, or `npm ci` when lockfiles are present
- Automatically uses `yarn`, `pnpm`, `bun`, `deno`, or `npm ci` when lockfiles are present
- Builds your PR, then builds the target and compares between the two
- Doesn't upload anything or rely on centralized storage
- Supports [custom build scripts](#customizing-the-build) and [file patterns](#customizing-the-list-of-files)
Expand Down
6 changes: 5 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import prettyBytes from 'pretty-bytes';
* @returns {Promise<{ packageManager: string, installScript: string }>}
*/
export async function getPackageManagerAndInstallScript(cwd) {
const [yarnLockExists, pnpmLockExists, bunLockBinaryExists, bunLockExists, packageLockExists] = await Promise.all([
const [yarnLockExists, pnpmLockExists, bunLockBinaryExists, bunLockExists, packageLockExists, denoLockExists] = await Promise.all([
fileExists(path.resolve(cwd, 'yarn.lock')),
fileExists(path.resolve(cwd, 'pnpm-lock.yaml')),
fileExists(path.resolve(cwd, 'bun.lockb')),
fileExists(path.resolve(cwd, 'bun.lock')),
fileExists(path.resolve(cwd, 'package-lock.json')),
fileExists(path.resolve(cwd, 'deno.lock')),
]);

let packageManager = 'npm';
Expand All @@ -26,6 +27,9 @@ export async function getPackageManagerAndInstallScript(cwd) {
} else if (bunLockBinaryExists || bunLockExists) {
installScript = 'bun install --frozen-lockfile';
packageManager = 'bun';
} else if (denoLockExists) {
installScript = 'deno install --frozen';
packageManager = 'deno';
} else if (packageLockExists) {
installScript = 'npm ci';
}
Expand Down