Skip to content

Commit

Permalink
chore: minor typescript improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Oct 4, 2023
1 parent 475e256 commit 3f219db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/create-svelte/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"strict": true,
"skipLibCheck": true
},
"include": ["./scripts/**/*", "./test/*.js", "./index.js", "./bin.js", "./utils.js"]
"include": ["./scripts/**/*", "./test/*.js", "./*.js"]
}
7 changes: 6 additions & 1 deletion packages/create-svelte/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,14 @@ export function dist(path) {
return fileURLToPath(new URL(`./dist/${path}`, import.meta.url).href);
}

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

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

0 comments on commit 3f219db

Please sign in to comment.