Skip to content

Commit fd00215

Browse files
committed
use pnpm exec for tool commands in scripts
1 parent cc20963 commit fd00215

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

scripts/build.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async function main() {
3333
logger.log('Building TypeScript declarations only...')
3434
const exitCode = await runSequence([
3535
{ args: ['run', 'clean:dist:types'], command: 'pnpm' },
36-
{ args: ['--project', 'tsconfig.dts.json'], command: 'tsgo' },
36+
{ args: ['exec', 'tsgo', '--project', 'tsconfig.dts.json'], command: 'pnpm' },
3737
])
3838
process.exitCode = exitCode
3939
return
@@ -44,8 +44,8 @@ async function main() {
4444
const exitCode = await runSequence([
4545
{ args: ['run', 'clean:dist'], command: 'pnpm' },
4646
{
47-
args: ['-c', '.config/rollup.dist.config.mjs'],
48-
command: 'rollup',
47+
args: ['exec', 'rollup', '-c', '.config/rollup.dist.config.mjs'],
48+
command: 'pnpm',
4949
},
5050
])
5151
process.exitCode = exitCode
@@ -59,8 +59,8 @@ async function main() {
5959
const srcExitCode = await runSequence([
6060
{ args: ['run', 'clean:dist'], command: 'pnpm' },
6161
{
62-
args: ['-c', '.config/rollup.dist.config.mjs'],
63-
command: 'rollup',
62+
args: ['exec', 'rollup', '-c', '.config/rollup.dist.config.mjs'],
63+
command: 'pnpm',
6464
},
6565
])
6666

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

7878
process.exitCode = typesExitCode

scripts/check.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@ async function main() {
2121
{ args: ['run', 'fix'], command: 'pnpm' },
2222
{
2323
args: [
24+
'exec',
25+
'eslint',
2426
'--config',
2527
'.config/eslint.config.mjs',
2628
'--report-unused-disable-directives',
2729
'.',
2830
],
29-
command: 'eslint',
31+
command: 'pnpm',
3032
},
31-
{ args: ['--noEmit'], command: 'tsgo' },
33+
{ args: ['exec', 'tsgo', '--noEmit'], command: 'pnpm' },
3234
])
3335

3436
if (exitCode !== 0) {

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
@@ -45,6 +45,7 @@ async function main() {
4545
const linters = [
4646
{
4747
args: [
48+
'exec',
4849
'oxlint',
4950
'-c=.config/oxlintrc.json',
5051
'--ignore-path=.oxlintignore',
@@ -56,7 +57,7 @@ async function main() {
5657
name: 'oxlint',
5758
},
5859
{
59-
args: ['biome', 'format', '--log-level=none', '--fix', targetDir],
60+
args: ['exec', 'biome', 'format', '--log-level=none', '--fix', targetDir],
6061
name: 'biome',
6162
},
6263
]
@@ -65,6 +66,7 @@ async function main() {
6566
if (!values.dist && !values.external) {
6667
linters.push({
6768
args: [
69+
'exec',
6870
'eslint',
6971
'--config',
7072
'.config/eslint.config.mjs',
@@ -81,7 +83,7 @@ async function main() {
8183
for (const { args, name } of linters) {
8284
logger.log(` - Running ${name}...`)
8385
// eslint-disable-next-line no-await-in-loop
84-
const result = await runCommandQuiet(args[0], args.slice(1))
86+
const result = await runCommandQuiet('pnpm', args)
8587

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

0 commit comments

Comments
 (0)