Skip to content

Commit 3f219db

Browse files
committed
chore: minor typescript improvements
1 parent 475e256 commit 3f219db

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/create-svelte/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"strict": true,
1111
"skipLibCheck": true
1212
},
13-
"include": ["./scripts/**/*", "./test/*.js", "./index.js", "./bin.js", "./utils.js"]
13+
"include": ["./scripts/**/*", "./test/*.js", "./*.js"]
1414
}

packages/create-svelte/utils.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,14 @@ export function dist(path) {
5050
return fileURLToPath(new URL(`./dist/${path}`, import.meta.url).href);
5151
}
5252

53+
/** @type {string} */
5354
export const package_manager = get_package_manager() || 'npm';
5455

55-
// Thanks to https://github.com/zkochan/packages/tree/main/which-pm-runs for this code!
56+
/**
57+
* Supports npm, pnpm, Yarn, cnpm, bun and any other package manager that sets the
58+
* npm_config_user_agent env variable.
59+
* Thanks to https://github.com/zkochan/packages/tree/main/which-pm-runs for this code!
60+
*/
5661
function get_package_manager() {
5762
if (!process.env.npm_config_user_agent) {
5863
return undefined;

0 commit comments

Comments
 (0)