frontend-hamroun 1.2.1 → 1.2.2

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.
package/bin/cli.js ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env node
2
+
3
+ const path = require('path');
4
+ const fs = require('fs');
5
+
6
+ try {
7
+ // Try to load the ESM version
8
+ import('../dist/cli/index.js')
9
+ .catch(err => {
10
+ console.error('Failed to load CLI:', err);
11
+ process.exit(1);
12
+ });
13
+ } catch (error) {
14
+ console.error('Error loading CLI:', error);
15
+ process.exit(1);
16
+ }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/cli/index.js CHANGED
@@ -1 +1,215 @@
1
- "use strict";
1
+ #!/usr/bin/env node
2
+ import fs from 'fs';
3
+ import path from 'path';
4
+ import { fileURLToPath } from 'url';
5
+ import { execSync } from 'child_process';
6
+ import readline from 'readline';
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
9
+ // Get package.json to read version
10
+ const packageJsonPath = path.resolve(__dirname, '../../package.json');
11
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
12
+ // Available templates
13
+ const TEMPLATES = {
14
+ 'basic': 'Basic frontend only template',
15
+ 'full-stack': 'Complete frontend and backend template',
16
+ 'api-only': 'Backend API only template'
17
+ };
18
+ // CLI colors
19
+ const colors = {
20
+ reset: '\x1b[0m',
21
+ bright: '\x1b[1m',
22
+ green: '\x1b[32m',
23
+ blue: '\x1b[34m',
24
+ red: '\x1b[31m',
25
+ yellow: '\x1b[33m'
26
+ };
27
+ // Create readline interface
28
+ function createInterface() {
29
+ return readline.createInterface({
30
+ input: process.stdin,
31
+ output: process.stdout
32
+ });
33
+ }
34
+ // Print banner
35
+ function printBanner() {
36
+ console.log(`
37
+ ${colors.blue}${colors.bright}╔══════════════════════════════════════════════╗
38
+ ║ ║
39
+ ║ Frontend Hamroun v${packageJson.version.padEnd(25)}║
40
+ ║ A lightweight frontend & backend framework ║
41
+ ║ ║
42
+ ╚══════════════════════════════════════════════╝${colors.reset}
43
+ `);
44
+ }
45
+ // Print help
46
+ function printHelp() {
47
+ console.log(`
48
+ ${colors.bright}USAGE:${colors.reset}
49
+ ${colors.blue}npx frontend-hamroun${colors.reset} [command] [options]
50
+
51
+ ${colors.bright}COMMANDS:${colors.reset}
52
+ ${colors.blue}create${colors.reset} <project-name> [options] Create a new project
53
+ ${colors.blue}help${colors.reset} Display this help message
54
+ ${colors.blue}version${colors.reset} Display version information
55
+
56
+ ${colors.bright}OPTIONS:${colors.reset}
57
+ ${colors.blue}--template${colors.reset}, ${colors.blue}-t${colors.reset} <template> Specify template (default: basic)
58
+ ${colors.blue}--skip-install${colors.reset}, ${colors.blue}-s${colors.reset} Skip package installation
59
+
60
+ ${colors.bright}AVAILABLE TEMPLATES:${colors.reset}
61
+ ${Object.entries(TEMPLATES).map(([name, desc]) => ` ${colors.blue}${name.padEnd(12)}${colors.reset} ${desc}`).join('\n')}
62
+
63
+ ${colors.bright}EXAMPLES:${colors.reset}
64
+ ${colors.blue}npx frontend-hamroun create${colors.reset} my-app
65
+ ${colors.blue}npx frontend-hamroun create${colors.reset} my-app --template full-stack
66
+ ${colors.blue}npx frontend-hamroun create${colors.reset} my-api -t api-only --skip-install
67
+ `);
68
+ }
69
+ // Create project from template
70
+ async function createProject(projectName, options) {
71
+ const template = options.template || 'basic';
72
+ // Check if template exists
73
+ if (!Object.keys(TEMPLATES).includes(template)) {
74
+ console.error(`${colors.red}error:${colors.reset} Template "${template}" not found.`);
75
+ console.log(`Available templates: ${Object.keys(TEMPLATES).join(', ')}`);
76
+ process.exit(1);
77
+ }
78
+ // Check if project directory already exists
79
+ const projectPath = path.resolve(process.cwd(), projectName);
80
+ if (fs.existsSync(projectPath)) {
81
+ console.error(`${colors.red}error:${colors.reset} Directory ${projectName} already exists.`);
82
+ process.exit(1);
83
+ }
84
+ console.log(`
85
+ ${colors.bright}Creating a new project with Frontend Hamroun...${colors.reset}
86
+ ${colors.blue}• Project name:${colors.reset} ${projectName}
87
+ ${colors.blue}• Template:${colors.reset} ${template}
88
+ ${colors.blue}• Directory:${colors.reset} ${projectPath}
89
+ `);
90
+ try {
91
+ // Find templates directory
92
+ const templateDir = path.resolve(__dirname, '../../templates', template);
93
+ // Create project directory
94
+ fs.mkdirSync(projectPath, { recursive: true });
95
+ // Copy template files
96
+ copyTemplateFiles(templateDir, projectPath);
97
+ // Update package.json with project name
98
+ const projectPackageJsonPath = path.join(projectPath, 'package.json');
99
+ if (fs.existsSync(projectPackageJsonPath)) {
100
+ const projectPackageJson = JSON.parse(fs.readFileSync(projectPackageJsonPath, 'utf8'));
101
+ projectPackageJson.name = projectName;
102
+ fs.writeFileSync(projectPackageJsonPath, JSON.stringify(projectPackageJson, null, 2));
103
+ }
104
+ // Install dependencies
105
+ if (!options.skipInstall) {
106
+ console.log(`\n${colors.blue}Installing dependencies...${colors.reset}`);
107
+ const command = getPackageManager() === 'yarn'
108
+ ? 'yarn'
109
+ : 'npm install';
110
+ execSync(command, {
111
+ cwd: projectPath,
112
+ stdio: 'inherit'
113
+ });
114
+ }
115
+ // Success message
116
+ console.log(`
117
+ ${colors.green}${colors.bright}Success!${colors.reset} Created ${projectName} at ${projectPath}
118
+
119
+ ${colors.blue}Inside that directory, you can run several commands:${colors.reset}
120
+
121
+ ${colors.bright}npm run dev${colors.reset}
122
+ Starts the development server.
123
+
124
+ ${colors.bright}npm run build${colors.reset}
125
+ Builds the app for production.
126
+
127
+ ${colors.bright}npm start${colors.reset}
128
+ Runs the built app in production mode.
129
+
130
+ ${colors.blue}We suggest that you begin by typing:${colors.reset}
131
+
132
+ ${colors.bright}cd${colors.reset} ${projectName}
133
+ ${colors.bright}npm run dev${colors.reset}
134
+
135
+ ${colors.green}Happy coding!${colors.reset}
136
+ `);
137
+ }
138
+ catch (error) {
139
+ console.error(`${colors.red}Failed to create project:${colors.reset}`, error);
140
+ process.exit(1);
141
+ }
142
+ }
143
+ // Copy template files recursively
144
+ function copyTemplateFiles(source, destination) {
145
+ const files = fs.readdirSync(source);
146
+ for (const file of files) {
147
+ const sourcePath = path.join(source, file);
148
+ const destPath = path.join(destination, file);
149
+ const stats = fs.statSync(sourcePath);
150
+ if (stats.isDirectory()) {
151
+ fs.mkdirSync(destPath, { recursive: true });
152
+ copyTemplateFiles(sourcePath, destPath);
153
+ }
154
+ else {
155
+ fs.copyFileSync(sourcePath, destPath);
156
+ }
157
+ }
158
+ console.log(`${colors.green}•${colors.reset} Copied template files`);
159
+ }
160
+ // Detect package manager
161
+ function getPackageManager() {
162
+ try {
163
+ const userAgent = process.env.npm_config_user_agent;
164
+ if (userAgent && userAgent.startsWith('yarn')) {
165
+ return 'yarn';
166
+ }
167
+ return 'npm';
168
+ }
169
+ catch (error) {
170
+ return 'npm';
171
+ }
172
+ }
173
+ // Parse command line arguments
174
+ function parseArgs() {
175
+ const args = process.argv.slice(2);
176
+ const command = args[0];
177
+ if (!command || command === 'help') {
178
+ printBanner();
179
+ printHelp();
180
+ process.exit(0);
181
+ }
182
+ if (command === 'version') {
183
+ console.log(`frontend-hamroun v${packageJson.version}`);
184
+ process.exit(0);
185
+ }
186
+ if (command === 'create') {
187
+ const projectName = args[1];
188
+ if (!projectName) {
189
+ console.error(`${colors.red}error:${colors.reset} Project name is required.`);
190
+ console.log(`Run ${colors.blue}npx frontend-hamroun help${colors.reset} for usage information.`);
191
+ process.exit(1);
192
+ }
193
+ // Parse options
194
+ const options = {
195
+ template: 'basic',
196
+ skipInstall: false
197
+ };
198
+ for (let i = 2; i < args.length; i++) {
199
+ if (args[i] === '--template' || args[i] === '-t') {
200
+ options.template = args[++i];
201
+ }
202
+ else if (args[i] === '--skip-install' || args[i] === '-s') {
203
+ options.skipInstall = true;
204
+ }
205
+ }
206
+ printBanner();
207
+ createProject(projectName, options);
208
+ return;
209
+ }
210
+ console.error(`${colors.red}error:${colors.reset} Unknown command: ${command}`);
211
+ console.log(`Run ${colors.blue}npx frontend-hamroun help${colors.reset} for usage information.`);
212
+ process.exit(1);
213
+ }
214
+ // Run CLI
215
+ parseArgs();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frontend-hamroun",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "A lightweight frontend and backend framework for building modern web applications",
5
5
  "type": "module",
6
6
  "main": "dist/frontend-hamroun.umd.js",
@@ -11,6 +11,7 @@
11
11
  "src",
12
12
  "templates",
13
13
  "scripts",
14
+ "bin",
14
15
  "LICENSE",
15
16
  "README.md"
16
17
  ],
@@ -22,17 +23,19 @@
22
23
  }
23
24
  },
24
25
  "bin": {
25
- "hamroun": "./dist/cli/index.js",
26
- "frontend-hamroun": "./dist/cli/index.js"
26
+ "hamroun": "./bin/cli.js",
27
+ "frontend-hamroun": "./bin/cli.js"
27
28
  },
28
29
  "scripts": {
29
30
  "dev": "vite",
30
- "build": "vite build && tsc && node scripts/build-cli.js",
31
+ "build": "vite build && tsc && npm run build:cli",
32
+ "build:cli": "node scripts/build-cli.js",
33
+ "prepublishOnly": "npm run build",
31
34
  "test": "jest",
32
- "clean": "rimraf dist",
35
+ "clean": "rimraf dist bin",
33
36
  "prebuild": "npm run clean",
34
- "prepublish": "npm run build",
35
- "generate": "node scripts/generate.js"
37
+ "generate": "node scripts/generate.js",
38
+ "publish:next": "npm publish --tag next"
36
39
  },
37
40
  "keywords": [
38
41
  "frontend",
@@ -1,81 +1,205 @@
1
1
  import fs from 'fs';
2
2
  import path from 'path';
3
3
  import { fileURLToPath } from 'url';
4
- import { exec } from 'child_process';
4
+ import { execSync } from 'child_process';
5
5
 
6
6
  const __filename = fileURLToPath(import.meta.url);
7
7
  const __dirname = path.dirname(__filename);
8
8
  const rootDir = path.resolve(__dirname, '..');
9
- const cliDistDir = path.resolve(rootDir, 'dist/cli');
9
+ const binDir = path.resolve(rootDir, 'bin');
10
10
 
11
- // Ensure CLI dist directory exists
12
- if (!fs.existsSync(cliDistDir)) {
13
- fs.mkdirSync(cliDistDir, { recursive: true });
11
+ // Ensure bin directory exists
12
+ if (!fs.existsSync(binDir)) {
13
+ fs.mkdirSync(binDir, { recursive: true });
14
14
  }
15
15
 
16
- // Create CLI index.js in dist
17
- const cliIndexPath = path.resolve(cliDistDir, 'index.js');
18
- fs.writeFileSync(cliIndexPath, `#!/usr/bin/env node
16
+ // Create a simple CLI wrapper that doesn't rely on TypeScript
17
+ const cliContent = `#!/usr/bin/env node
19
18
 
20
- import { fileURLToPath } from 'url';
21
- import path from 'path';
22
- import { createRequire } from 'module';
23
-
24
- const __filename = fileURLToPath(import.meta.url);
25
- const __dirname = path.dirname(__filename);
26
- const require = createRequire(import.meta.url);
19
+ const path = require('path');
20
+ const fs = require('fs');
27
21
 
28
- // Re-export the CLI from the compiled TypeScript
29
- import('../cli/index.js').catch(err => {
30
- console.error('Failed to load CLI:', err);
22
+ try {
23
+ // Try to load the ESM version
24
+ import('../dist/cli/index.js')
25
+ .catch(err => {
26
+ console.error('Failed to load CLI:', err);
27
+ process.exit(1);
28
+ });
29
+ } catch (error) {
30
+ console.error('Error loading CLI:', error);
31
31
  process.exit(1);
32
- });
33
- `, 'utf8');
32
+ }
33
+ `;
34
34
 
35
- // Make the CLI executable
35
+ // Write CLI file
36
+ fs.writeFileSync(path.join(binDir, 'cli.js'), cliContent, 'utf8');
37
+
38
+ // Make CLI executable
36
39
  try {
37
- fs.chmodSync(cliIndexPath, '755');
38
- console.log('CLI built successfully: dist/cli/index.js');
40
+ fs.chmodSync(path.join(binDir, 'cli.js'), '755');
41
+ console.log('CLI wrapper built successfully: bin/cli.js');
39
42
  } catch (error) {
40
- console.warn('Could not make CLI executable:', error);
43
+ console.warn('⚠️ Could not make CLI executable:', error);
41
44
  }
42
45
 
43
- // Create template directories in dist if missing
44
- const templateSrcDir = path.resolve(rootDir, 'templates');
45
- const templateDistDir = path.resolve(rootDir, 'dist/templates');
46
+ // Copy the CLI code to dist directory and compile it
47
+ console.log('🔨 Compiling CLI TypeScript...');
48
+ try {
49
+ // Ensure dist/cli directory exists
50
+ const distCliDir = path.resolve(rootDir, 'dist/cli');
51
+ if (!fs.existsSync(distCliDir)) {
52
+ fs.mkdirSync(distCliDir, { recursive: true });
53
+ }
54
+
55
+ // Extract TypeScript files needed for CLI
56
+ const tscCommand = `npx tsc src/cli/index.ts --outDir dist/cli --esModuleInterop --target ES2020 --module NodeNext --moduleResolution NodeNext`;
57
+
58
+ // Execute TypeScript compilation
59
+ execSync(tscCommand, { stdio: 'inherit' });
60
+
61
+ console.log('✅ CLI TypeScript compiled successfully');
62
+ } catch (error) {
63
+ console.error('❌ Failed to compile CLI TypeScript:', error);
64
+
65
+ // Create a fallback CLI if TypeScript compilation fails
66
+ console.log('⚠️ Creating fallback CommonJS CLI...');
67
+
68
+ const fallbackCli = `
69
+ // This is a fallback CLI implementation when TypeScript compilation fails
70
+ const fs = require('fs');
71
+ const path = require('path');
72
+ const { execSync } = require('child_process');
46
73
 
47
- // Copy templates recursively
48
- function copyTemplates() {
49
- try {
50
- if (!fs.existsSync(templateDistDir)) {
51
- fs.mkdirSync(templateDistDir, { recursive: true });
74
+ const packageJsonPath = path.resolve(__dirname, '../../package.json');
75
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
76
+
77
+ // Available templates
78
+ const TEMPLATES = {
79
+ 'basic': 'Basic frontend only template',
80
+ 'full-stack': 'Complete frontend and backend template'
81
+ };
82
+
83
+ // Colors for console output
84
+ const colors = {
85
+ reset: '\\x1b[0m',
86
+ bright: '\\x1b[1m',
87
+ green: '\\x1b[32m',
88
+ blue: '\\x1b[34m',
89
+ red: '\\x1b[31m'
90
+ };
91
+
92
+ console.log(\`
93
+ \${colors.blue}\${colors.bright}╔══════════════════════════════════════════════╗
94
+ ║ ║
95
+ ║ Frontend Hamroun v\${packageJson.version.padEnd(25)}║
96
+ ║ A lightweight frontend & backend framework ║
97
+ ║ ║
98
+ ╚══════════════════════════════════════════════╝\${colors.reset}
99
+ \`);
100
+
101
+ const args = process.argv.slice(2);
102
+ const command = args[0];
103
+
104
+ if (!command || command === 'help') {
105
+ console.log(\`
106
+ \${colors.bright}USAGE:\${colors.reset}
107
+ \${colors.blue}npx frontend-hamroun\${colors.reset} create <project-name> [--template <template>]
108
+
109
+ \${colors.bright}AVAILABLE TEMPLATES:\${colors.reset}
110
+ \${colors.blue}basic\${colors.reset} Basic frontend only template
111
+ \${colors.blue}full-stack\${colors.reset} Complete frontend and backend template
112
+ \`);
113
+ process.exit(0);
114
+ }
115
+
116
+ if (command === 'create') {
117
+ const projectName = args[1];
118
+
119
+ if (!projectName) {
120
+ console.error(\`\${colors.red}Error:\${colors.reset} Project name is required\`);
121
+ process.exit(1);
122
+ }
123
+
124
+ let template = 'basic';
125
+ for (let i = 2; i < args.length; i++) {
126
+ if (args[i] === '--template' || args[i] === '-t') {
127
+ template = args[++i] || 'basic';
52
128
  }
129
+ }
130
+
131
+ if (!Object.keys(TEMPLATES).includes(template)) {
132
+ console.error(\`\${colors.red}Error:\${colors.reset} Template "\${template}" not found\`);
133
+ console.log(\`Available templates: \${Object.keys(TEMPLATES).join(', ')}\`);
134
+ process.exit(1);
135
+ }
136
+
137
+ console.log(\`Creating new \${template} project: \${projectName}...\`);
138
+
139
+ try {
140
+ // Create project directory
141
+ const projectPath = path.resolve(process.cwd(), projectName);
142
+ fs.mkdirSync(projectPath, { recursive: true });
53
143
 
54
- // Copy each template
55
- const templates = fs.readdirSync(templateSrcDir);
56
-
57
- for (const template of templates) {
58
- const srcTemplatePath = path.join(templateSrcDir, template);
59
- const distTemplatePath = path.join(templateDistDir, template);
60
-
61
- if (fs.statSync(srcTemplatePath).isDirectory()) {
62
- if (!fs.existsSync(distTemplatePath)) {
63
- fs.mkdirSync(distTemplatePath, { recursive: true });
64
- }
65
-
66
- // Use cp -r for recursively copying
67
- exec(`cp -r ${srcTemplatePath}/* ${distTemplatePath}`, (error) => {
68
- if (error) {
69
- console.error(`Error copying template ${template}:`, error);
70
- } else {
71
- console.log(`Copied template ${template} to dist`);
72
- }
73
- });
144
+ // Create minimal package.json
145
+ const pkgJson = {
146
+ "name": projectName,
147
+ "version": "0.1.0",
148
+ "private": true,
149
+ "dependencies": {
150
+ "frontend-hamroun": packageJson.version
151
+ },
152
+ "scripts": {
153
+ "dev": "vite",
154
+ "build": "vite build"
74
155
  }
75
- }
156
+ };
157
+
158
+ fs.writeFileSync(
159
+ path.join(projectPath, 'package.json'),
160
+ JSON.stringify(pkgJson, null, 2)
161
+ );
162
+
163
+ console.log(\`
164
+ \${colors.green}\${colors.bright}Success!\${colors.reset} Created project at \${projectPath}
165
+
166
+ \${colors.blue}Next steps:\${colors.reset}
167
+ cd \${projectName}
168
+ npm install
169
+ npm run dev
170
+ \`);
171
+
76
172
  } catch (error) {
77
- console.error('Error copying templates:', error);
173
+ console.error(\`\${colors.red}Failed to create project:\${colors.reset}\`, error);
174
+ process.exit(1);
175
+ }
176
+ } else {
177
+ console.error(\`\${colors.red}Unknown command:\${colors.reset} \${command}\`);
178
+ process.exit(1);
179
+ }
180
+ `;
181
+
182
+ const distCliDir = path.resolve(rootDir, 'dist/cli');
183
+ if (!fs.existsSync(distCliDir)) {
184
+ fs.mkdirSync(distCliDir, { recursive: true });
185
+ }
186
+
187
+ fs.writeFileSync(path.join(distCliDir, 'index.js'), fallbackCli, 'utf8');
188
+ console.log('✅ Fallback CLI created successfully');
189
+ }
190
+
191
+ // Let's make sure we also have template directories
192
+ const templatesDir = path.resolve(rootDir, 'templates');
193
+ const templateList = ['basic', 'full-stack'];
194
+
195
+ console.log('🔍 Checking template directories...');
196
+ for (const template of templateList) {
197
+ const templateDir = path.join(templatesDir, template);
198
+ if (!fs.existsSync(templateDir)) {
199
+ console.log(`⚠️ Template directory not found: ${templateDir}`);
200
+ } else {
201
+ console.log(`✅ Template found: ${template}`);
78
202
  }
79
203
  }
80
204
 
81
- copyTemplates();
205
+ console.log('✅ CLI build process completed');
package/src/cli/index.ts CHANGED
@@ -13,8 +13,14 @@ const __dirname = path.dirname(__filename);
13
13
  const packageJsonPath = path.resolve(__dirname, '../../package.json');
14
14
  const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
15
15
 
16
+ // Define interfaces for type safety
17
+ interface ProjectOptions {
18
+ template: string;
19
+ skipInstall: boolean;
20
+ }
21
+
16
22
  // Available templates
17
- const TEMPLATES = {
23
+ const TEMPLATES: Record<string, string> = {
18
24
  'basic': 'Basic frontend only template',
19
25
  'full-stack': 'Complete frontend and backend template',
20
26
  'api-only': 'Backend API only template'
@@ -31,7 +37,7 @@ const colors = {
31
37
  };
32
38
 
33
39
  // Create readline interface
34
- function createInterface() {
40
+ function createInterface(): readline.Interface {
35
41
  return readline.createInterface({
36
42
  input: process.stdin,
37
43
  output: process.stdout
@@ -39,7 +45,7 @@ function createInterface() {
39
45
  }
40
46
 
41
47
  // Print banner
42
- function printBanner() {
48
+ function printBanner(): void {
43
49
  console.log(`
44
50
  ${colors.blue}${colors.bright}╔══════════════════════════════════════════════╗
45
51
  ║ ║
@@ -51,7 +57,7 @@ ${colors.blue}${colors.bright}╔═══════════════
51
57
  }
52
58
 
53
59
  // Print help
54
- function printHelp() {
60
+ function printHelp(): void {
55
61
  console.log(`
56
62
  ${colors.bright}USAGE:${colors.reset}
57
63
  ${colors.blue}npx frontend-hamroun${colors.reset} [command] [options]
@@ -76,7 +82,7 @@ ${colors.bright}EXAMPLES:${colors.reset}
76
82
  }
77
83
 
78
84
  // Create project from template
79
- async function createProject(projectName, options) {
85
+ async function createProject(projectName: string, options: ProjectOptions): Promise<void> {
80
86
  const template = options.template || 'basic';
81
87
 
82
88
  // Check if template exists
@@ -165,7 +171,7 @@ ${colors.green}Happy coding!${colors.reset}
165
171
  }
166
172
 
167
173
  // Copy template files recursively
168
- function copyTemplateFiles(source, destination) {
174
+ function copyTemplateFiles(source: string, destination: string): void {
169
175
  const files = fs.readdirSync(source);
170
176
 
171
177
  for (const file of files) {
@@ -186,7 +192,7 @@ function copyTemplateFiles(source, destination) {
186
192
  }
187
193
 
188
194
  // Detect package manager
189
- function getPackageManager() {
195
+ function getPackageManager(): string {
190
196
  try {
191
197
  const userAgent = process.env.npm_config_user_agent;
192
198
  if (userAgent && userAgent.startsWith('yarn')) {
@@ -199,7 +205,7 @@ function getPackageManager() {
199
205
  }
200
206
 
201
207
  // Parse command line arguments
202
- function parseArgs() {
208
+ function parseArgs(): void {
203
209
  const args = process.argv.slice(2);
204
210
  const command = args[0];
205
211
 
@@ -224,7 +230,7 @@ function parseArgs() {
224
230
  }
225
231
 
226
232
  // Parse options
227
- const options = {
233
+ const options: ProjectOptions = {
228
234
  template: 'basic',
229
235
  skipInstall: false
230
236
  };