create-skateboard-app 1.0.0 → 1.0.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/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+
2
+ 1.0.2
3
+
4
+ Clarify prompt labels
5
+
6
+ 1.0.1
7
+
8
+ Improve download speed
9
+ Simplify setup flow
10
+ Fix folder duplication
11
+
12
+ 1.0.0
package/README.md CHANGED
@@ -7,7 +7,7 @@ The fastest way to create a new [Skateboard](https://github.com/stevederico/skat
7
7
  ```bash
8
8
  npx create-skateboard-app
9
9
  cd my-app
10
- npm run dev
10
+ npm run start
11
11
  ```
12
12
 
13
13
  ## Usage
package/bin/cli.js CHANGED
@@ -47,35 +47,41 @@ function checkCommand(command) {
47
47
  async function downloadTemplate(projectName) {
48
48
  // Try multiple methods in order of preference
49
49
  const methods = [
50
- {
51
- name: 'degit',
52
- check: () => checkCommand('npx'),
53
- execute: () => execSync(`npx degit stevederico/skateboard ${projectName}`, {
54
- stdio: 'pipe',
55
- timeout: 30000
56
- })
57
- },
58
50
  {
59
51
  name: 'git clone',
60
52
  check: () => checkCommand('git'),
61
53
  execute: () => {
62
- execSync(`git clone --depth 1 https://github.com/stevederico/skateboard.git ${projectName}`, {
54
+ execSync(`git clone --depth 1 --single-branch https://github.com/stevederico/skateboard.git ${projectName}`, {
63
55
  stdio: 'pipe',
64
- timeout: 30000
56
+ timeout: 15000
65
57
  });
66
58
  // Remove .git directory to avoid including git history
67
59
  execSync(`rm -rf ${projectName}/.git`, { stdio: 'pipe' });
68
60
  }
69
61
  },
62
+ {
63
+ name: 'curl + tar',
64
+ check: () => checkCommand('curl') && checkCommand('tar'),
65
+ execute: () => {
66
+ // Download and extract in one step, avoiding the skateboard-master folder issue
67
+ execSync(`curl -L https://github.com/stevederico/skateboard/archive/refs/heads/master.tar.gz | tar -xz`, {
68
+ stdio: 'pipe',
69
+ timeout: 15000
70
+ });
71
+ // Move contents from skateboard-master to the project directory
72
+ execSync(`mv skateboard-master ${projectName}`, { stdio: 'pipe' });
73
+ }
74
+ },
70
75
  {
71
76
  name: 'curl + unzip',
72
77
  check: () => checkCommand('curl') && checkCommand('unzip'),
73
78
  execute: () => {
74
79
  execSync(`curl -L https://github.com/stevederico/skateboard/archive/refs/heads/master.zip -o temp.zip`, {
75
80
  stdio: 'pipe',
76
- timeout: 30000
81
+ timeout: 15000
77
82
  });
78
83
  execSync(`unzip -q temp.zip`, { stdio: 'pipe' });
84
+ // Move the extracted skateboard-master folder to the project name
79
85
  execSync(`mv skateboard-master ${projectName}`, { stdio: 'pipe' });
80
86
  execSync(`rm temp.zip`, { stdio: 'pipe' });
81
87
  }
@@ -89,16 +95,16 @@ async function downloadTemplate(projectName) {
89
95
  }
90
96
 
91
97
  try {
92
- info(`Trying ${method.name}...`);
98
+ info(`Downloading template with ${method.name}...`);
93
99
  method.execute();
94
- success(`Template downloaded via ${method.name}`);
100
+ success(`Template downloaded successfully`);
95
101
  return;
96
102
  } catch (err) {
97
103
  log(`${method.name} failed, trying next method...`, 'yellow');
98
104
  }
99
105
  }
100
106
 
101
- throw new Error('All download methods failed. Please ensure you have git, curl, or npx available and check your internet connection.');
107
+ throw new Error('All download methods failed. Please ensure you have git or curl available and check your internet connection.');
102
108
  }
103
109
 
104
110
  // Interactive prompt functions
@@ -181,7 +187,7 @@ async function collectProjectConfig(projectName) {
181
187
  log(`\n${colors.bold}Let's configure your Skateboard app!${colors.reset}\n`);
182
188
 
183
189
  // App name
184
- const appName = await ask('App name', projectName.split('-').map(word =>
190
+ const appName = await ask('App display name', projectName.split('-').map(word =>
185
191
  word.charAt(0).toUpperCase() + word.slice(1)
186
192
  ).join(' '));
187
193
 
@@ -216,42 +222,14 @@ async function collectProjectConfig(projectName) {
216
222
 
217
223
  const selectedIcon = await askChoice('Choose an app icon:', iconChoices);
218
224
 
219
- // Backend URLs
220
- const backendURL = await ask('Production backend URL', 'https://api.example.com');
221
- const devBackendURL = await ask('Development backend URL', 'http://localhost:8000');
222
-
223
- // App pages configuration
224
- log(`\n${colors.cyan}Configure your app pages:${colors.reset}`);
225
- const pages = [];
226
-
227
- const addDefaultPages = await askYesNo('Add default pages (Home, Other)?', true);
228
- if (addDefaultPages) {
229
- pages.push(
230
- { title: 'Home', url: 'home', icon: 'house' },
231
- { title: 'Other', url: 'other', icon: 'inbox' }
232
- );
233
- }
234
-
235
- const addMorePages = await askYesNo('Add more custom pages?', false);
236
- if (addMorePages) {
237
- let addAnother = true;
238
- while (addAnother) {
239
- const pageTitle = await ask('Page title');
240
- const pageUrl = await ask('Page URL', pageTitle.toLowerCase().replace(/\s+/g, '-'));
241
- const pageIcon = await ask('Page icon (lucide icon name)', 'circle');
242
-
243
- pages.push({
244
- title: pageTitle,
245
- url: pageUrl,
246
- icon: pageIcon
247
- });
248
-
249
- addAnother = await askYesNo('Add another page?', false);
250
- }
251
- }
252
-
253
- // Company name (after pages configuration)
254
- const companyName = await ask('Company name', 'Your Company');
225
+ // Default values for removed questions
226
+ const backendURL = 'https://api.example.com';
227
+ const devBackendURL = 'http://localhost:8000';
228
+ const companyName = 'Your Company';
229
+ const pages = [
230
+ { title: 'Home', url: 'home', icon: 'house' },
231
+ { title: 'Other', url: 'other', icon: 'inbox' }
232
+ ];
255
233
 
256
234
  // Installation preferences
257
235
  const installDeps = await askYesNo('Install dependencies automatically?', true);
@@ -316,7 +294,7 @@ async function main() {
316
294
  // If no project name provided, ask for it
317
295
  if (!projectName) {
318
296
  log(`\n${colors.bold}🛹 Welcome to Skateboard App Creator!${colors.reset}\n`);
319
- projectName = await ask('What is the name of your project?', 'my-skateboard-app');
297
+ projectName = await ask('Project directory name', 'my-skateboard-app');
320
298
  }
321
299
 
322
300
  // Validate project name
@@ -397,25 +375,19 @@ async function main() {
397
375
  // Success message
398
376
  log(`\n${colors.bold}${colors.green}🎉 Success! Created ${config.appName}${colors.reset}\n`);
399
377
 
400
- // Change to the new project directory
401
- process.chdir(projectName);
402
- info(`Switched to ${projectName} directory`);
403
-
404
- log('Next steps:', 'yellow');
405
- if (!config.installDeps) {
406
- log(` npm install`);
407
- }
408
- log(` npm run dev`);
409
378
  log(`\n${colors.cyan}Your app is configured with:${colors.reset}`);
410
- log(` 🏢 Company: ${config.companyName}`);
411
379
  log(` 📱 App: ${config.appName}`);
412
380
  log(` 💬 Tagline: ${config.tagline}`);
413
381
  log(` 🎨 Color: ${config.appColor}`);
414
382
  log(` 🎯 Icon: ${config.appIcon}`);
415
- log(` 📄 Pages: ${config.pages.map(p => p.title).join(', ')}`);
416
- log(` 🌐 Backend: ${config.backendURL}`);
417
- log(`\n${colors.magenta}You're now in the ${projectName} directory!${colors.reset}`);
418
- log(`${colors.yellow}Run 'npm run dev' to begin development 🛹${colors.reset}\n`);
383
+
384
+ log(`\n${colors.bold}Get started with:${colors.reset}`, 'yellow');
385
+ log(`\n ${colors.cyan}cd ${projectName}${colors.reset}`);
386
+ if (!config.installDeps) {
387
+ log(` ${colors.cyan}npm install${colors.reset}`);
388
+ }
389
+ log(` ${colors.cyan}npm run start${colors.reset}`);
390
+ log(`\n${colors.yellow}Happy coding! 🛹${colors.reset}\n`);
419
391
 
420
392
  } catch (err) {
421
393
  error(`Failed to create project: ${err.message}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-skateboard-app",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Create a new Skateboard app with React, TailwindCSS, and more",
5
5
  "main": "index.js",
6
6
  "type": "module",