Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 4 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 @@ -28,6 +29,8 @@ export async function getPackageManagerAndInstallScript(cwd) {
packageManager = 'bun';
} else if (packageLockExists) {
installScript = 'npm ci';
} else if (denoLockExists) {
installScript = 'deno install --frozen'
Comment thread
Hajime-san marked this conversation as resolved.
Outdated
}

return { packageManager, installScript };
Expand Down