@arcane-engine/create 0.1.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.
- package/README.md +80 -0
- package/bin/create-arcane.js +54 -0
- package/package.json +38 -0
package/README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# @arcane/create
|
|
2
|
+
|
|
3
|
+
Scaffolding tool for creating new Arcane game projects.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm create @arcane/game my-game
|
|
9
|
+
cd my-game
|
|
10
|
+
npm install
|
|
11
|
+
arcane dev
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
This creates a new Arcane project with:
|
|
15
|
+
- `package.json` with @arcane/runtime dependency
|
|
16
|
+
- `tsconfig.json` for TypeScript
|
|
17
|
+
- `src/game.ts` for pure game logic
|
|
18
|
+
- `src/visual.ts` for rendering (entry point)
|
|
19
|
+
- `README.md` with usage instructions
|
|
20
|
+
|
|
21
|
+
## Prerequisites
|
|
22
|
+
|
|
23
|
+
The Arcane CLI must be installed:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
cargo install arcane-cli
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Or build from source:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
git clone https://github.com/anthropics/arcane.git
|
|
33
|
+
cd arcane
|
|
34
|
+
cargo build --release
|
|
35
|
+
export PATH="$PATH:$(pwd)/target/release"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## What This Does
|
|
39
|
+
|
|
40
|
+
`@arcane/create` is a thin wrapper around `arcane new <name>`. It's provided for npm ecosystem ergonomics:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# These are equivalent:
|
|
44
|
+
npm create @arcane/game my-game
|
|
45
|
+
arcane new my-game
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## After Creation
|
|
49
|
+
|
|
50
|
+
1. **Install dependencies:**
|
|
51
|
+
```bash
|
|
52
|
+
cd my-game
|
|
53
|
+
npm install
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
2. **Run with hot-reload:**
|
|
57
|
+
```bash
|
|
58
|
+
arcane dev
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
3. **Run tests:**
|
|
62
|
+
```bash
|
|
63
|
+
arcane test
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
4. **Add recipes:**
|
|
67
|
+
```bash
|
|
68
|
+
arcane add turn-based-combat
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Next Steps
|
|
72
|
+
|
|
73
|
+
- [Getting Started Guide](https://github.com/anthropics/arcane/blob/main/docs/getting-started.md)
|
|
74
|
+
- [Tutorials](https://github.com/anthropics/arcane/blob/main/docs/)
|
|
75
|
+
- [API Reference](https://github.com/anthropics/arcane/blob/main/docs/api-reference.md)
|
|
76
|
+
- [Examples](https://github.com/anthropics/arcane/tree/main/examples/)
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
Apache 2.0 — see [LICENSE](../../LICENSE)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @arcane/create — Project scaffolding tool
|
|
5
|
+
*
|
|
6
|
+
* Usage: npm create @arcane/game my-game
|
|
7
|
+
*
|
|
8
|
+
* This is a thin wrapper around `arcane new` command.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { spawn } from 'child_process';
|
|
12
|
+
import { fileURLToPath } from 'url';
|
|
13
|
+
import { dirname, join } from 'path';
|
|
14
|
+
|
|
15
|
+
const args = process.argv.slice(2);
|
|
16
|
+
const projectName = args[0];
|
|
17
|
+
|
|
18
|
+
if (!projectName) {
|
|
19
|
+
console.error('Usage: npm create @arcane-engine/game <project-name>');
|
|
20
|
+
console.error('Example: npm create @arcane-engine/game my-game');
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
console.log(`Creating Arcane project "${projectName}"...`);
|
|
25
|
+
|
|
26
|
+
// Check if arcane CLI is installed
|
|
27
|
+
const arcane = spawn('arcane', ['new', projectName], {
|
|
28
|
+
stdio: 'inherit',
|
|
29
|
+
shell: true,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
arcane.on('error', (err) => {
|
|
33
|
+
console.error('\n❌ Error: arcane CLI not found');
|
|
34
|
+
console.error('\nPlease install the Arcane CLI first:');
|
|
35
|
+
console.error(' cargo install arcane-cli');
|
|
36
|
+
console.error('\nOr build from source:');
|
|
37
|
+
console.error(' git clone https://github.com/anthropics/arcane.git');
|
|
38
|
+
console.error(' cd arcane');
|
|
39
|
+
console.error(' cargo build --release');
|
|
40
|
+
console.error(' export PATH="$PATH:$(pwd)/target/release"');
|
|
41
|
+
process.exit(1);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
arcane.on('close', (code) => {
|
|
45
|
+
if (code === 0) {
|
|
46
|
+
console.log(`\n✓ Created Arcane project "${projectName}"`);
|
|
47
|
+
console.log('\nNext steps:');
|
|
48
|
+
console.log(` cd ${projectName}`);
|
|
49
|
+
console.log(' npm install');
|
|
50
|
+
console.log(' arcane dev');
|
|
51
|
+
} else {
|
|
52
|
+
process.exit(code);
|
|
53
|
+
}
|
|
54
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@arcane-engine/create",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Create a new Arcane game project",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"create-arcane": "./bin/create-arcane.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"keywords": [
|
|
14
|
+
"arcane",
|
|
15
|
+
"game-engine",
|
|
16
|
+
"2d",
|
|
17
|
+
"gamedev",
|
|
18
|
+
"scaffolding",
|
|
19
|
+
"create"
|
|
20
|
+
],
|
|
21
|
+
"author": "Anthropic",
|
|
22
|
+
"license": "Apache-2.0",
|
|
23
|
+
"homepage": "https://github.com/anthropics/arcane",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://github.com/anthropics/arcane.git",
|
|
27
|
+
"directory": "packages/create"
|
|
28
|
+
},
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/anthropics/arcane/issues"
|
|
31
|
+
},
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=18.0.0"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"arcane-cli": "^0.1.0"
|
|
37
|
+
}
|
|
38
|
+
}
|