fix: also search lockfile in parent dirs (#1176)

This commit is contained in:
Fabian-Lars
2025-11-13 23:30:18 +01:00
committed by GitHub
parent eea189090a
commit ab628636a1
6 changed files with 36 additions and 25 deletions

View File

@@ -0,0 +1,5 @@
---
action: patch
---
The frontend lockfile detection will now move up the file tree to fix issues in workspaces.

View File

@@ -7,8 +7,5 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "MIT",
"devDependencies": {
"@tauri-apps/cli": "^2.9.4"
}
"license": "MIT"
}

4
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -27,6 +27,7 @@
"@actions/core": "1.11.1",
"@actions/github": "6.0.1",
"execa": "9.6.0",
"find-up-simple": "1.0.1",
"globby": "15.0.0",
"json5": "2.2.3",
"smol-toml": "1.4.2",

26
pnpm-lock.yaml generated
View File

@@ -17,6 +17,9 @@ importers:
execa:
specifier: 9.6.0
version: 9.6.0
find-up-simple:
specifier: 1.0.1
version: 1.0.1
globby:
specifier: 15.0.0
version: 15.0.0
@@ -618,6 +621,10 @@ packages:
resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==}
engines: {node: '>=8'}
find-up-simple@1.0.1:
resolution: {integrity: sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ==}
engines: {node: '>=18'}
find-up@5.0.0:
resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==}
engines: {node: '>=10'}
@@ -1308,18 +1315,17 @@ snapshots:
picocolors: 1.1.1
sisteransi: 1.0.5
'@covector/apply@0.10.0(mocha@10.4.0)':
'@covector/apply@0.10.0':
dependencies:
'@covector/files': 0.8.0
effection: 2.0.8(mocha@10.4.0)
semver: 7.7.2
transitivePeerDependencies:
- encoding
- mocha
'@covector/assemble@0.12.0':
'@covector/assemble@0.12.0(mocha@10.4.0)':
dependencies:
'@covector/command': 0.8.0
'@covector/command': 0.8.0(mocha@10.4.0)
'@covector/files': 0.8.0
effection: 2.0.8(mocha@10.4.0)
js-yaml: 4.1.0
@@ -1330,6 +1336,7 @@ snapshots:
unified: 9.2.2
transitivePeerDependencies:
- encoding
- mocha
- supports-color
'@covector/changelog@0.12.0':
@@ -1344,12 +1351,13 @@ snapshots:
- encoding
- supports-color
'@covector/command@0.8.0':
'@covector/command@0.8.0(mocha@10.4.0)':
dependencies:
'@effection/process': 2.1.4
effection: 2.0.8(mocha@10.4.0)
transitivePeerDependencies:
- encoding
- mocha
'@covector/files@0.8.0':
dependencies:
@@ -1775,10 +1783,10 @@ snapshots:
covector@0.12.4(mocha@10.4.0):
dependencies:
'@clack/prompts': 0.7.0
'@covector/apply': 0.10.0(mocha@10.4.0)
'@covector/assemble': 0.12.0
'@covector/apply': 0.10.0
'@covector/assemble': 0.12.0(mocha@10.4.0)
'@covector/changelog': 0.12.0
'@covector/command': 0.8.0
'@covector/command': 0.8.0(mocha@10.4.0)
'@covector/files': 0.8.0
effection: 2.0.8(mocha@10.4.0)
globby: 11.1.0
@@ -1973,6 +1981,8 @@ snapshots:
dependencies:
to-regex-range: 5.0.1
find-up-simple@1.0.1: {}
find-up@5.0.0:
dependencies:
locate-path: 6.0.0

View File

@@ -23,6 +23,7 @@ import type {
TargetPlatform,
} from './types';
import { GitHub } from '@actions/github/lib/utils';
import { findUpSync } from 'find-up-simple';
/*** constants ***/
export const extensions = [
@@ -355,8 +356,8 @@ export function hasTauriScript(root: string): boolean {
);
}
export function usesNpm(root: string): boolean {
if (existsSync(join(root, 'package-lock.json'))) {
export function usesNpm(cwd: string): boolean {
if (findUpSync('package-lock.json', { cwd })) {
if (isRunnerInstalled('npm')) {
return true;
} else {
@@ -368,8 +369,8 @@ export function usesNpm(root: string): boolean {
return false;
}
export function usesYarn(root: string): boolean {
if (existsSync(join(root, 'yarn.lock'))) {
export function usesYarn(cwd: string): boolean {
if (findUpSync('yarn.lock', { cwd })) {
if (isRunnerInstalled('yarn')) {
return true;
} else {
@@ -379,8 +380,8 @@ export function usesYarn(root: string): boolean {
return false;
}
export function usesPnpm(root: string): boolean {
if (existsSync(join(root, 'pnpm-lock.yaml'))) {
export function usesPnpm(cwd: string): boolean {
if (findUpSync('pnpm-lock.yaml', { cwd })) {
if (isRunnerInstalled('pnpm')) {
return true;
} else {
@@ -392,11 +393,8 @@ export function usesPnpm(root: string): boolean {
return false;
}
export function usesBun(root: string): boolean {
if (
existsSync(join(root, 'bun.lockb')) ||
existsSync(join(root, 'bun.lock'))
) {
export function usesBun(cwd: string): boolean {
if (findUpSync('bun.lockb', { cwd }) || findUpSync('bun.lock', { cwd })) {
if (isRunnerInstalled('bun')) {
return true;
} else {