create-proofkit
Advanced tools
| /** @typedef {"npm" | "pnpm" | "yarn" | "bun"} PackageManager */ | ||
| /** @returns {PackageManager} */ | ||
| export const getUserPkgManager = () => { | ||
| // This environment variable is set by npm and yarn but pnpm seems less consistent | ||
| const userAgent = process.env.npm_config_user_agent; | ||
| if (userAgent) { | ||
| if (userAgent.startsWith("yarn")) { | ||
| return "yarn"; | ||
| } else if (userAgent.startsWith("pnpm")) { | ||
| return "pnpm"; | ||
| } else if (userAgent.startsWith("bun")) { | ||
| return "bun"; | ||
| } else { | ||
| return "npm"; | ||
| } | ||
| } else { | ||
| // If no user agent is set, assume pnpm | ||
| return "pnpm"; | ||
| } | ||
| }; |
+36
| #!/usr/bin/env node | ||
| import { execa } from "execa"; | ||
| import { getUserPkgManager } from "./getUserPkgManager.js"; | ||
| async function main() { | ||
| const args = process.argv.slice(2); | ||
| const pkgManager = getUserPkgManager(); | ||
| const pkgManagerCmd = | ||
| pkgManager === "pnpm" | ||
| ? "pnpx" | ||
| : pkgManager === "bun" | ||
| ? "bunx" | ||
| : pkgManager === "npm" | ||
| ? "npx" | ||
| : pkgManager; | ||
| try { | ||
| await execa(pkgManagerCmd, ["@proofgeist/kit@latest", "init", ...args], { | ||
| stdio: "inherit", | ||
| env: { | ||
| ...process.env, | ||
| FORCE_COLOR: "1", // Preserve colors in output | ||
| }, | ||
| }); | ||
| } catch (error) { | ||
| console.error("Failed to create project:", error); | ||
| process.exit(1); | ||
| } | ||
| } | ||
| main().catch((error) => { | ||
| console.error("Failed to create project:", error); | ||
| process.exit(1); | ||
| }); |
+3
-3
| { | ||
| "name": "create-proofkit", | ||
| "version": "0.0.5-beta.1", | ||
| "version": "0.0.5-beta.2", | ||
| "description": "Create a new ProofKit project", | ||
| "type": "module", | ||
| "bin": "./dist/index.js", | ||
| "bin": "./src/index.js", | ||
| "repository": { | ||
@@ -13,3 +13,3 @@ "type": "git", | ||
| "files": [ | ||
| "dist" | ||
| "src" | ||
| ], | ||
@@ -16,0 +16,0 @@ "scripts": { |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
2248
178.22%4
100%51
Infinity%0
-100%2
Infinity%