Lines 1-26javascript
2import * as p from '@clack/prompts';
3import { writeFile, readFile, cp, unlink, rename, readdir, stat } from 'fs/promises';
4import { existsSync } from 'fs';
5import { join, dirname, sep } from 'path';
6import { fileURLToPath } from 'url';
7import { execSync, spawn } from 'child_process';
8const __dirname = dirname(fileURLToPath(import.meta.url));
9const TEMPLATES = ['react', 'vue', 'svelte', 'solid', 'preact', 'vanilla'];
HighSandbox Evasion Gated Capability
Source gates dangerous network, credential, or execution behavior behind CI, host, platform, time, or geo fingerprint checks.
dist/index.jsView on unpkg · L6 10const TEMPLATE_LABELS = {
11 react: 'React', vue: 'Vue', svelte: 'Svelte', solid: 'Solid', preact: 'Preact', vanilla: 'Vanilla',
13const PMS = ['pnpm', 'npm', 'yarn', 'bun'];
14const EXCLUDE_DIRS = new Set(['node_modules', 'dist', 'bin', 'obj', 'out']);
15async function main() {
16 const args = process.argv.slice(2);
17 const valueFlags = new Set(['--template', '--pm', '--lang']);
18 const getFlag = (name) => { const i = args.indexOf(name); return i >= 0 ? args[i + 1] : undefined; };
19 const noInstall = args.includes('--no-install');
20 const autoYes = args.includes('--yes') || args.includes('-y');
21 const interactive = Boolean(process.stdin.isTTY) && !autoYes;
22 let name = args.find((a, i) => !a.startsWith('-') && !valueFlags.has(args[i - 1]));
23 let template = getFlag('--template');
24 let lang = getFlag('--lang');
25 let pm = getFlag('--pm');
26 if (args.includes('--ts') || args.includes('--typescript'))