diff --git a/README.md b/README.md index 5604bb8..4042f11 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/src/utils.js b/src/utils.js index 15f289a..fc4b8b7 100644 --- a/src/utils.js +++ b/src/utils.js @@ -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'; @@ -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'; }