Skip to content

Commit 3ccd39d

Browse files
committed
use pnpm exec for tool commands in scripts
1 parent e4e2db0 commit 3ccd39d

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

scripts/build.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async function main() {
3232
logger.log('Building TypeScript declarations only...')
3333
const exitCode = await runSequence([
3434
{ args: ['run', 'clean:dist:types'], command: 'pnpm' },
35-
{ args: ['--project', 'tsconfig.dts.json'], command: 'tsgo' },
35+
{ args: ['exec', 'tsgo', '--project', 'tsconfig.dts.json'], command: 'pnpm' },
3636
])
3737
process.exitCode = exitCode
3838
return
@@ -43,8 +43,8 @@ async function main() {
4343
const exitCode = await runSequence([
4444
{ args: ['run', 'clean:dist'], command: 'pnpm' },
4545
{
46-
args: ['-c', '.config/rollup.dist.config.mjs'],
47-
command: 'rollup',
46+
args: ['exec', 'rollup', '-c', '.config/rollup.dist.config.mjs'],
47+
command: 'pnpm',
4848
},
4949
])
5050
process.exitCode = exitCode
@@ -58,8 +58,8 @@ async function main() {
5858
const srcExitCode = await runSequence([
5959
{ args: ['run', 'clean:dist'], command: 'pnpm' },
6060
{
61-
args: ['-c', '.config/rollup.dist.config.mjs'],
62-
command: 'rollup',
61+
args: ['exec', 'rollup', '-c', '.config/rollup.dist.config.mjs'],
62+
command: 'pnpm',
6363
},
6464
])
6565

@@ -71,7 +71,7 @@ async function main() {
7171
// Build types
7272
const typesExitCode = await runSequence([
7373
{ args: ['run', 'clean:dist:types'], command: 'pnpm' },
74-
{ args: ['--project', 'tsconfig.dts.json'], command: 'tsgo' },
74+
{ args: ['exec', 'tsgo', '--project', 'tsconfig.dts.json'], command: 'pnpm' },
7575
])
7676

7777
process.exitCode = typesExitCode

scripts/coverage.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async function main() {
3535
if (values['type-only']) {
3636
logger.log('Collecting type coverage...')
3737
const exitCode = await runSequence([
38-
{ args: [], command: 'type-coverage' },
38+
{ args: ['exec', 'type-coverage'], command: 'pnpm' },
3939
])
4040
process.exitCode = exitCode
4141
return
@@ -71,7 +71,7 @@ async function main() {
7171
}
7272

7373
const typeExitCode = await runSequence([
74-
{ args: [], command: 'type-coverage' },
74+
{ args: ['exec', 'type-coverage'], command: 'pnpm' },
7575
])
7676

7777
process.exitCode = typeExitCode

scripts/lint-fix.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ async function main() {
2020
const linters = [
2121
{
2222
args: [
23+
'exec',
2324
'oxlint',
2425
'-c=.config/.oxlintrc.json',
2526
'--ignore-path=.oxlintignore',
@@ -31,11 +32,12 @@ async function main() {
3132
name: 'oxlint',
3233
},
3334
{
34-
args: ['biome', 'format', '--log-level=none', '--fix', '.'],
35+
args: ['exec', 'biome', 'format', '--log-level=none', '--fix', '.'],
3536
name: 'biome',
3637
},
3738
{
3839
args: [
40+
'exec',
3941
'eslint',
4042
'--config',
4143
'.config/eslint.config.mjs',
@@ -52,7 +54,7 @@ async function main() {
5254
for (const { args, name } of linters) {
5355
logger.log(` - Running ${name}...`)
5456
// eslint-disable-next-line no-await-in-loop
55-
const result = await runCommandQuiet(args[0], args.slice(1))
57+
const result = await runCommandQuiet('pnpm', args)
5658

5759
// These linters can exit with non-zero when they make fixes
5860
// So we don't treat that as an error

0 commit comments

Comments
 (0)