create-remix-game 1.1.0 → 1.1.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/dist/cli.js CHANGED
@@ -6,29 +6,51 @@ import { initGitRepo } from './git.js';
6
6
  import { installDependencies, installLatestPackages } from './install.js';
7
7
  import { scaffold } from './scaffold.js';
8
8
  async function main() {
9
- console.log(chalk.bold.blue('\nšŸŽ® Create Remix Game\n'));
9
+ console.log(chalk.greenBright(`
10
+
11
+
12
+
13
+ ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’
14
+ ā–’ā–’ ā–’ā–’ ā–’ā–’ ā–’ā–’
15
+ ā–’ā–’ ā–’ā–’ ā–’ā–’ ā–’ā–’
16
+ ā–’ā–’ ā–’ā–’ ā–’ā–’ ā–’ā–’
17
+ ā–’ā–’ ā–’ā–’ ā–’ā–’ ā–’ā–’
18
+ ā–’ā–’ ā–’ā–’ ā–’ā–’ ā–’ā–’
19
+ ā–’ā–’ ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ ā–’ā–’
20
+ ā–’ā–’ ā–’ā–’
21
+ ā–’ā–’ ā–’ā–’
22
+ ā–’ā–’ ā–’ā–’
23
+ ā–’ā–’ ā–’ā–’ā–’ā–’ ā–’ā–’ā–’ā–’ ā–’ā–’
24
+ ā–’ā–’ ā–’ā–’ā–’ā–’ ā–’ā–’ā–’ā–’ ā–’ā–’
25
+ ā–’ā–’ ā–’ā–’ā–’ā–’ ā–’ā–’ā–’ā–’ ā–’ā–’
26
+ ā–’ā–’ ā–’ā–’ā–’ā–’ ā–’ā–’ā–’ā–’ ā–’ā–’
27
+ ā–’ā–’ ā–’ā–’
28
+ ā–’ā–’ ā–’ā–’
29
+ ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’
30
+ ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’
31
+ ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’
32
+ ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’
33
+ ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’ā–’
34
+
35
+
36
+
37
+ `));
10
38
  const args = process.argv.slice(2);
11
- let targetDir = args[0];
39
+ const targetDir = args[0];
12
40
  // Get project configuration
13
41
  const config = await prompts([
14
42
  {
15
- type: targetDir ? null : 'text',
16
- name: 'projectName',
17
- message: 'Project name:',
18
- initial: 'my-remix-game',
43
+ type: 'text',
44
+ name: 'gameName',
45
+ message: 'Game name:',
46
+ initial: 'My Remix Game',
19
47
  validate: (name) => {
20
- if (!/^[a-z0-9-_]+$/i.test(name)) {
21
- return 'Project name can only contain letters, numbers, dashes, and underscores';
48
+ if (!name || name.trim().length === 0) {
49
+ return 'Game name is required';
22
50
  }
23
51
  return true;
24
52
  },
25
53
  },
26
- {
27
- type: 'text',
28
- name: 'gameName',
29
- message: 'Game display name:',
30
- initial: 'My Remix Game',
31
- },
32
54
  {
33
55
  type: 'confirm',
34
56
  name: 'multiplayer',
@@ -63,13 +85,21 @@ async function main() {
63
85
  console.log('Cancelled');
64
86
  process.exit(0);
65
87
  }
66
- targetDir = targetDir || config.projectName;
67
- const projectPath = path.resolve(process.cwd(), targetDir);
88
+ // Generate a safe package name from the game name
89
+ const projectName = targetDir ||
90
+ config.gameName
91
+ .toLowerCase()
92
+ .replace(/[^a-z0-9]+/g, '-')
93
+ .replace(/^-+|-+$/g, '');
94
+ const projectPath = path.resolve(process.cwd(), projectName);
68
95
  console.log(chalk.cyan(`\nāœ“ Creating project in ${projectPath}`));
69
96
  // Scaffold the project
70
- await scaffold(projectPath, config);
97
+ await scaffold(projectPath, {
98
+ ...config,
99
+ projectName,
100
+ });
71
101
  // Install dependencies
72
- console.log(chalk.cyan('\nāœ“ Installing dependencies...'));
102
+ console.log(chalk.cyan('āœ“ Installing dependencies...'));
73
103
  await installDependencies(projectPath, config.packageManager);
74
104
  // Install packages that need @latest (0.x versions, etc.)
75
105
  await installLatestPackages(projectPath, config.packageManager, ['@farcade/game-sdk@latest']);
@@ -77,10 +107,11 @@ async function main() {
77
107
  if (config.initGit) {
78
108
  await initGitRepo(projectPath);
79
109
  }
80
- console.log(chalk.bold.green('\nāœ… Done!\n'));
110
+ console.log(chalk.bold.green('\nšŸŽ‰ Done!\n'));
81
111
  console.log('Get started with:\n');
82
- console.log(chalk.cyan(` cd ${targetDir}`));
83
- console.log(chalk.cyan(` ${config.packageManager} dev\n`));
112
+ console.log(chalk.cyan(` cd ${projectName}`));
113
+ const devCommand = config.packageManager === 'npm' ? 'npm run dev' : `${config.packageManager} dev`;
114
+ console.log(chalk.cyan(` ${devCommand}\n`));
84
115
  }
85
116
  main().catch((error) => {
86
117
  console.error(chalk.red('Error creating project:'), error);
package/dist/scaffold.js CHANGED
@@ -28,7 +28,6 @@ function getRemixDevVersion() {
28
28
  // Fallback: Use CLI's own version (they're synced, so this works)
29
29
  const cliPackageJsonPath = path.join(__dirname, '../package.json');
30
30
  const cliPackageJson = JSON.parse(fs.readFileSync(cliPackageJsonPath, 'utf-8'));
31
- console.warn('Could not read remix-dev version, using CLI version as fallback:', cliPackageJson.version);
32
31
  return cliPackageJson.version;
33
32
  }
34
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-remix-game",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "CLI for scaffolding Remix games",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",