Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"prettier": "^3.9.6",
"shx": "^0.4.0",
"ts-node": "^10.9.2",
"typescript": "^5"
"typescript": "^6"
},
"engines": {
"node": ">=18.0.0"
Expand Down
10 changes: 5 additions & 5 deletions src/commands/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {Command, Flags, type Interfaces} from '@oclif/core'
import {Ansis} from 'ansis'
import {execFile} from 'node:child_process'
import {EOL} from 'node:os'
import {dirname, resolve} from 'node:path'
import path from 'node:path'
import which from 'which'

const ansis = new Ansis()
Expand All @@ -24,15 +24,15 @@ async function getNpmDetails(pkg: string): Promise<false | NpmDetails> {
return new Promise((resolve_) => {
// Resolve npm from PATH only, excluding CWD. On Windows, both execFile (CreateProcess)
// and the `which` module resolve executables from CWD before PATH.
const cwd = resolve(process.cwd())
const cwd = path.resolve(process.cwd())
const npmPath = which.sync('npm', {nothrow: true})
if (!npmPath || dirname(resolve(npmPath)) === cwd) {
if (!npmPath || path.dirname(path.resolve(npmPath)) === cwd) {
resolve_(false)
return
}

const useShell = /\.(cmd|bat)$/i.test(npmPath)
execFile(npmPath, ['view', pkg, '--json'], {shell: useShell}, (error, stdout) => {
const isUseShell = /\.(cmd|bat)$/iv.test(npmPath)
execFile(npmPath, ['view', pkg, '--json'], {shell: isUseShell}, (error, stdout) => {
if (error) {
resolve_(false)
} else {
Expand Down
5 changes: 4 additions & 1 deletion test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "../tsconfig",
"include": ["./**/*", "../src/**/*"]
"include": ["./**/*", "../src/**/*"],
"compilerOptions": {
"rootDir": "../"
}
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"noUnusedParameters": true,
"outDir": "./lib",
"pretty": true,
"rootDirs": ["./src"],
"rootDir": "./src",
"types": ["node", "mocha"],
"strict": true,
"target": "ES2024",
"moduleResolution": "Node16"
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5143,10 +5143,10 @@ typescript-eslint@^8.64.0, typescript-eslint@^8.66.0:
"@typescript-eslint/typescript-estree" "8.67.0"
"@typescript-eslint/utils" "8.67.0"

typescript@^5:
version "5.7.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.3.tgz#919b44a7dbb8583a9b856d162be24a54bf80073e"
integrity sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==
typescript@^6:
version "6.0.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-6.0.3.tgz#90251dc007916e972786cb94d74d15b185577d21"
integrity sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==

undici-types@~5.26.4:
version "5.26.5"
Expand Down
Loading