create-playcanvas 0.0.2-beta.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 +75 -0
- package/index.js +3 -0
- package/package.json +34 -0
package/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Create a PlayCanvas project in seconds
|
|
2
|
+
|
|
3
|
+
`create playcanvas` spins up a ready-to-code PlayCanvas workspace in seconds, complete with modern tooling and opinionated defaults. Pick a template, answer a few prompts (or skip them with flags) and you're ready to `npm run dev`.
|
|
4
|
+
|
|
5
|
+
## 📦 Usage
|
|
6
|
+
|
|
7
|
+
You don't install anything globally – just run the CLI with your favourite package manager:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# npm (recommended)
|
|
11
|
+
npm create playcanvas@latest
|
|
12
|
+
|
|
13
|
+
# pnpm
|
|
14
|
+
pnpm create playcanvas
|
|
15
|
+
|
|
16
|
+
# yarn
|
|
17
|
+
yarn create playcanvas
|
|
18
|
+
|
|
19
|
+
# bun
|
|
20
|
+
bun create playcanvas
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The CLI will prompt you for:
|
|
24
|
+
|
|
25
|
+
1. **Project name** – folder to create (defaults to `playcanvas-project`).
|
|
26
|
+
2. **Overwrite behavior** if the folder exists.
|
|
27
|
+
3. **Package name** – used in `package.json`.
|
|
28
|
+
4. **Framework & variant** – pick from templates below.
|
|
29
|
+
5. **Scaffolding** – project files are copied and tweaked; a final cheat-sheet is printed.
|
|
30
|
+
|
|
31
|
+
### Non-interactive / flags
|
|
32
|
+
|
|
33
|
+
Skip the questions when scripting or if you know what you want:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm create playcanvas@latest my-game -t react-ts --overwrite
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Flags:
|
|
40
|
+
|
|
41
|
+
| Flag | Shorthand | Description |
|
|
42
|
+
| ---------------------------- | --------- | ---------------------------------------------------- |
|
|
43
|
+
| `--template <name>` | `-t` | Directly choose template variant (see list below). |
|
|
44
|
+
| `--overwrite` | | Remove existing files in target directory. |
|
|
45
|
+
| `--help` | `-h` | Show help/usage information. |
|
|
46
|
+
|
|
47
|
+
## 🎨 Templates
|
|
48
|
+
|
|
49
|
+
(TBD)
|
|
50
|
+
|
|
51
|
+
| Template | Description |
|
|
52
|
+
| ------------ | --------------------------- |
|
|
53
|
+
| `vanilla` | Plain JavaScript PlayCanvas |
|
|
54
|
+
| `react-ts` | React + TypeScript + Vite |
|
|
55
|
+
|
|
56
|
+
_To add your own template, drop a folder in `templates/<name>` and it will be auto-detected._
|
|
57
|
+
|
|
58
|
+
## 🛠 Development
|
|
59
|
+
|
|
60
|
+
Clone the repo, then:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npm install # or npm, yarn, bun
|
|
64
|
+
npm run dev # compile TypeScript → dist (if needed)
|
|
65
|
+
npm link # you can now run `npx create-playcanvas` to test
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## 🤝 Contributing
|
|
69
|
+
|
|
70
|
+
Bug reports, feature requests and PRs are welcome! Want to create a new template? Please file an issue first if you plan major changes.
|
|
71
|
+
|
|
72
|
+
1. Fork / clone.
|
|
73
|
+
2. Create a branch: `git checkout -b feat/my-awesome-idea`.
|
|
74
|
+
3. Commit with conventional-commit messages.
|
|
75
|
+
4. Push and open a PR.
|
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-playcanvas",
|
|
3
|
+
"author": "Mark Lundin",
|
|
4
|
+
"version": "0.0.2-beta.0",
|
|
5
|
+
"description": "Scaffold a PlayCanvas project",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"create-playcanvas": "index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"index.js"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"dev": "unbuild --stub",
|
|
15
|
+
"build": "unbuild",
|
|
16
|
+
"typecheck": "tsc --noEmit",
|
|
17
|
+
"prepublishOnly": "npm run build"
|
|
18
|
+
},
|
|
19
|
+
"license": "ISC",
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@clack/prompts": "^0.10.0",
|
|
22
|
+
"@types/node": "^22.13.10",
|
|
23
|
+
"cross-spawn": "^7.0.6",
|
|
24
|
+
"mri": "^1.2.0",
|
|
25
|
+
"picocolors": "^1.1.1",
|
|
26
|
+
"unbuild": "^3.5.0"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": "^18.0.0 || ^20.0.0 || >=22.0.0"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"node-fetch": "^3.3.2"
|
|
33
|
+
}
|
|
34
|
+
}
|