@getpara/create-para-app 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,54 +0,0 @@
1
- import { execCommand } from '../utils/exec.js';
2
- import { logInfo } from '../utils/logger.js';
3
-
4
- export async function scaffoldNextjs(config) {
5
- logInfo(`🔧 Scaffolding Next.js app for project ${config.projectName}...`);
6
- const versionTag = config.useLatest ? 'latest' : 'latest';
7
-
8
- // Start with these flags for a default Next.js TS, ESLint, Tailwind, src, app setup
9
- const baseFlags = new Set(['--typescript', '--eslint', '--tailwind', '--src-dir', '--app', '--no-turbopack', '--yes']);
10
-
11
- // If user wants no typescript => remove --typescript, add --javascript
12
- if (!config.typescript) {
13
- baseFlags.delete('--typescript');
14
- baseFlags.add('--javascript');
15
- }
16
- if (!config.eslint) {
17
- baseFlags.delete('--eslint');
18
- }
19
- if (!config.tailwind) {
20
- baseFlags.delete('--tailwind');
21
- }
22
- if (!config.srcDir) {
23
- baseFlags.delete('--src-dir');
24
- }
25
- if (!config.app) {
26
- baseFlags.delete('--app');
27
- }
28
-
29
- let cmd = `npx create-next-app@${versionTag} ${config.projectName}`;
30
- for (const f of baseFlags) {
31
- cmd += ` ${f}`;
32
- }
33
-
34
- if (config.noGit) {
35
- cmd += ' --no-git';
36
- }
37
- if (config.skipDeps) {
38
- cmd += ' --skip-install';
39
- }
40
- if (config.packageManager && config.packageManager !== 'yarn') {
41
- if (config.packageManager === 'npm') {
42
- cmd += ' --use-npm';
43
- } else if (config.packageManager === 'pnpm') {
44
- cmd += ' --use-pnpm';
45
- } else if (config.packageManager === 'bun') {
46
- // create-next-app doesn't have a built-in --use-bun, we might skip or log a warning
47
- logInfo('Warning: create-next-app does not officially support "--use-bun". Using npm instead.');
48
- cmd += ' --use-npm';
49
- }
50
- }
51
-
52
- logInfo(`💻 Executing command: ${cmd}`);
53
- await execCommand(cmd);
54
- }
@@ -1,33 +0,0 @@
1
- import { execCommand } from '../utils/exec.js';
2
- import { logInfo } from '../utils/logger.js';
3
-
4
- export async function scaffoldViteReact(config) {
5
- logInfo(`🔧 Scaffolding Vite React app for project ${config.projectName}...`);
6
- const versionTag = config.useLatest ? 'latest' : 'latest';
7
-
8
- const templateName = config.typescript ? 'react-ts' : 'react';
9
-
10
- let cmd = '';
11
- if (config.packageManager === 'yarn') {
12
- cmd = `yarn create vite ${config.projectName} --template ${templateName}`;
13
- } else if (config.packageManager === 'npm') {
14
- cmd = `npm create vite@${versionTag} ${config.projectName} --template ${templateName}`;
15
- } else if (config.packageManager === 'pnpm') {
16
- cmd = `pnpm dlx create-vite@${versionTag} ${config.projectName} --template ${templateName}`;
17
- } else if (config.packageManager === 'bun') {
18
- logInfo('Warning: "bun create vite" not officially tested. Using npm create instead.');
19
- cmd = `npm create vite@${versionTag} ${config.projectName} --template ${templateName}`;
20
- } else {
21
- cmd = `npm create vite@${versionTag} ${config.projectName} --template ${templateName}`;
22
- }
23
-
24
- if (config.noGit) {
25
- cmd += ' --no-git';
26
- }
27
- if (config.skipDeps) {
28
- cmd += ' --skip-install';
29
- }
30
-
31
- logInfo(`💻 Executing command: ${cmd}`);
32
- await execCommand(cmd);
33
- }
package/src/utils/exec.ts DELETED
@@ -1,6 +0,0 @@
1
- import { execa } from 'execa';
2
-
3
- export async function execCommand(command: string) {
4
- const [cmd, ...args] = command.split(' ');
5
- await execa(cmd, args, { stdio: 'inherit' });
6
- }
@@ -1,18 +0,0 @@
1
- import prettier from 'prettier';
2
-
3
- export async function formatWithPrettier(code: string, filePath: string): Promise<string> {
4
- let parser = 'babel';
5
- if (filePath.endsWith('.ts')) {
6
- parser = 'typescript';
7
- } else if (filePath.endsWith('.tsx')) {
8
- parser = 'babel-ts';
9
- } else if (filePath.endsWith('.js')) {
10
- parser = 'babel';
11
- } else if (filePath.endsWith('.jsx')) {
12
- parser = 'babel';
13
- }
14
- return prettier.format(code, {
15
- parser,
16
- singleQuote: true,
17
- });
18
- }
@@ -1,25 +0,0 @@
1
- import chalk from 'chalk';
2
-
3
- export function logHeader(message: string) {
4
- console.log(chalk.bold.magentaBright(`\n${message}\n`));
5
- }
6
-
7
- export function logSection(message: string) {
8
- console.log(chalk.bold.cyanBright(`\n${message}`));
9
- }
10
-
11
- export function logSubsection(key: string, value: string) {
12
- console.log(chalk.green(`${key}: `) + chalk.white(`${value}`));
13
- }
14
-
15
- export function logStep(step: string) {
16
- console.log(chalk.yellow(step));
17
- }
18
-
19
- export function logInfo(message: string) {
20
- console.log(chalk.cyanBright(`- ${message}`));
21
- }
22
-
23
- export function logError(message: string) {
24
- console.error(chalk.redBright(`❌ ${message}`));
25
- }
package/tsconfig.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "module": "ESNext", // your override for ESM
5
- "resolveJsonModule": true,
6
- "declaration": false,
7
- "outDir": "./dist",
8
- "rootDir": "./src", // <--- Add this line
9
- "lib": ["dom"]
10
- },
11
- "include": ["src/**/*.ts"],
12
- "ts-node": {
13
- "esm": true,
14
- "compilerOptions": {
15
- "module": "ESNext"
16
- }
17
- }
18
- }