@getpara/create-para-app
Advanced tools
| { | ||
| "name": "@getpara/create-para-app", | ||
| "version": "0.4.0", | ||
| "version": "0.5.0", | ||
| "main": "dist/src/index.js", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -12,2 +12,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
| import fs from 'fs-extra'; | ||
| import ora from 'ora'; | ||
| import { execa } from 'execa'; | ||
| import { promptInteractive } from '../prompts/interactive.js'; | ||
@@ -49,3 +51,2 @@ import { scaffoldNextjs } from '../templates/nextjs.js'; | ||
| const { projectName: cliProjectName, template: cliTemplate, useLatest, noPrompt, noGit, packageManager, skipDeps, typescript = true, eslint = true, tailwind = true, srcDir = true, app = true, networks, evmSigner, externalWallet, apiKey, } = options || {}; | ||
| // For rollback reference | ||
| const finalProjectName = cliProjectName || positionalProjectName; | ||
@@ -69,3 +70,2 @@ let config = { | ||
| }; | ||
| // Populate networks if provided | ||
| if (networks) { | ||
@@ -77,3 +77,2 @@ config.networks = networks.split(',').map(n => n.trim()); | ||
| } | ||
| // We'll decide if we must prompt | ||
| const needTemplate = !config.template; | ||
@@ -133,2 +132,23 @@ const needProjectName = !config.projectName; | ||
| yield runSDKSetup(config); | ||
| if (!config.skipDeps) { | ||
| const spinner = ora('Installing updated dependencies...').start(); | ||
| try { | ||
| if (config.packageManager === 'yarn') { | ||
| yield execa('yarn', { cwd: config.projectName, stdio: 'pipe' }); | ||
| } | ||
| else if (config.packageManager === 'pnpm') { | ||
| yield execa('pnpm', ['install'], { cwd: config.projectName, stdio: 'pipe' }); | ||
| } | ||
| else if (config.packageManager === 'bun') { | ||
| yield execa('bun', ['install'], { cwd: config.projectName, stdio: 'pipe' }); | ||
| } | ||
| else { | ||
| yield execa('npm', ['install'], { cwd: config.projectName, stdio: 'pipe' }); | ||
| } | ||
| spinner.succeed('Dependencies re-installed successfully.'); | ||
| } | ||
| catch (err) { | ||
| spinner.fail('Failed to re-install dependencies. You might try manually running the install command.'); | ||
| } | ||
| } | ||
| logInfo(chalk.green('✅ Scaffolding complete!')); | ||
@@ -135,0 +155,0 @@ } |
@@ -12,2 +12,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
| import { logInfo } from '../utils/logger.js'; | ||
| import ora from 'ora'; | ||
| export function scaffoldNextjs(config) { | ||
@@ -17,5 +18,3 @@ return __awaiter(this, void 0, void 0, function* () { | ||
| const versionTag = config.useLatest ? 'latest' : 'latest'; | ||
| // Start with these flags for a default Next.js TS, ESLint, Tailwind, src, app setup | ||
| const baseFlags = new Set(['--typescript', '--eslint', '--tailwind', '--src-dir', '--app', '--no-turbopack', '--yes']); | ||
| // If user wants no typescript => remove --typescript, add --javascript | ||
| if (!config.typescript) { | ||
@@ -41,2 +40,15 @@ baseFlags.delete('--typescript'); | ||
| } | ||
| if (config.packageManager === 'yarn') { | ||
| cmd += ' --use-yarn'; | ||
| } | ||
| else if (config.packageManager === 'npm') { | ||
| cmd += ' --use-npm'; | ||
| } | ||
| else if (config.packageManager === 'pnpm') { | ||
| cmd += ' --use-pnpm'; | ||
| } | ||
| else if (config.packageManager === 'bun') { | ||
| logInfo('Warning: create-next-app does not officially support "--use-bun". Using npm instead.'); | ||
| cmd += ' --use-npm'; | ||
| } | ||
| if (config.noGit) { | ||
@@ -48,18 +60,13 @@ cmd += ' --no-git'; | ||
| } | ||
| if (config.packageManager && config.packageManager !== 'yarn') { | ||
| if (config.packageManager === 'npm') { | ||
| cmd += ' --use-npm'; | ||
| } | ||
| else if (config.packageManager === 'pnpm') { | ||
| cmd += ' --use-pnpm'; | ||
| } | ||
| else if (config.packageManager === 'bun') { | ||
| // create-next-app doesn't have a built-in --use-bun, we might skip or log a warning | ||
| logInfo('Warning: create-next-app does not officially support "--use-bun". Using npm instead.'); | ||
| cmd += ' --use-npm'; | ||
| } | ||
| const spinner = ora('Scaffolding your Next.js project...').start(); | ||
| logInfo(`💻 Executing command: ${cmd}`); | ||
| try { | ||
| yield execCommand(cmd, true); | ||
| spinner.succeed('Next.js scaffold complete.'); | ||
| } | ||
| logInfo(`💻 Executing command: ${cmd}`); | ||
| yield execCommand(cmd); | ||
| catch (error) { | ||
| spinner.fail('Failed to scaffold Next.js app.'); | ||
| throw error; | ||
| } | ||
| }); | ||
| } |
@@ -12,2 +12,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
| import { logInfo } from '../utils/logger.js'; | ||
| import ora from 'ora'; | ||
| export function scaffoldViteReact(config) { | ||
@@ -41,5 +42,13 @@ return __awaiter(this, void 0, void 0, function* () { | ||
| } | ||
| const spinner = ora('Scaffolding your Vite project...').start(); | ||
| logInfo(`💻 Executing command: ${cmd}`); | ||
| yield execCommand(cmd); | ||
| try { | ||
| yield execCommand(cmd, true); | ||
| spinner.succeed('Vite scaffold complete.'); | ||
| } | ||
| catch (error) { | ||
| spinner.fail('Failed to scaffold Vite app.'); | ||
| throw error; | ||
| } | ||
| }); | ||
| } |
@@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
| import { execa } from 'execa'; | ||
| export function execCommand(command) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| export function execCommand(command_1) { | ||
| return __awaiter(this, arguments, void 0, function* (command, silent = false) { | ||
| const [cmd, ...args] = command.split(' '); | ||
| yield execa(cmd, args, { stdio: 'inherit' }); | ||
| yield execa(cmd, args, { stdio: silent ? 'pipe' : 'inherit' }); | ||
| }); | ||
| } |
+1
-1
| { | ||
| "name": "@getpara/create-para-app", | ||
| "version": "0.4.0", | ||
| "version": "0.5.0", | ||
| "main": "dist/src/index.js", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
128846
1.1%2774
1.31%