create-planet 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/README.md +58 -0
- package/package.json +1 -1
- package/template/.github/workflows/publish.yml +28 -0
- package/template/package.json +5 -2
package/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Create a Federated Planet
|
|
2
|
+
|
|
3
|
+
Scaffold a new planet for the [Federated Planets](https://github.com/Federated-Planets/federated-planets) universe — a decentralized space exploration game where every planet is a sovereign website.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm create planet
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The interactive setup will ask you for:
|
|
12
|
+
|
|
13
|
+
- **Output directory** — where to scaffold the project
|
|
14
|
+
- **Planet name** — displayed on your landing site and shared with neighboring planets
|
|
15
|
+
- **Planet description** — shown to visitors on your landing site
|
|
16
|
+
- **Warp links** — URLs of neighboring planets to link to (leave empty for defaults)
|
|
17
|
+
- **Cloudflare worker name** — the name of your Worker on Cloudflare
|
|
18
|
+
|
|
19
|
+
It will then automatically create the required Cloudflare resources (KV namespace and D1 database) and generate a ready-to-deploy `wrangler.jsonc`.
|
|
20
|
+
|
|
21
|
+
## Prerequisites
|
|
22
|
+
|
|
23
|
+
- [Node.js](https://nodejs.org/) 18+
|
|
24
|
+
- [Wrangler](https://developers.cloudflare.com/workers/wrangler/) authenticated with your Cloudflare account (`npx wrangler login`)
|
|
25
|
+
|
|
26
|
+
## After Scaffolding
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
cd my-planet
|
|
30
|
+
npm install
|
|
31
|
+
npm run dev # local development
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
To deploy, connect your project to [Cloudflare Workers CI](https://developers.cloudflare.com/workers/ci-cd/) and set:
|
|
35
|
+
|
|
36
|
+
- **Build command:** `npm run build`
|
|
37
|
+
- **Deploy command:** `npx wrangler deploy`
|
|
38
|
+
|
|
39
|
+
## What Gets Created
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
my-planet/
|
|
43
|
+
├── src/
|
|
44
|
+
│ ├── pages/ # Astro pages (landing site, space port, manifest)
|
|
45
|
+
│ └── lib/ # Protocol logic (consensus, crypto, travel)
|
|
46
|
+
├── public/ # CSS, 3D star map (Three.js), static assets
|
|
47
|
+
├── scripts/ # Dev utilities (simulate universe, inject DO exports)
|
|
48
|
+
├── schema.sql # D1 database schema
|
|
49
|
+
├── wrangler.jsonc # Generated with your worker name, KV ID, D1 ID
|
|
50
|
+
├── wrangler.dev.jsonc # Local development config
|
|
51
|
+
└── package.json
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Learn More
|
|
55
|
+
|
|
56
|
+
- [Federated Planets specification](https://github.com/Federated-Planets/federated-planets)
|
|
57
|
+
- [Space Travel Protocol](https://github.com/Federated-Planets/federated-planets/blob/main/TRAVEL.md)
|
|
58
|
+
- [Planet reference implementation](https://github.com/Federated-Planets/planet)
|
package/package.json
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
name: Publish create-planet to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
id-token: write
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- uses: actions/setup-node@v4
|
|
18
|
+
with:
|
|
19
|
+
node-version: "22"
|
|
20
|
+
registry-url: "https://registry.npmjs.org"
|
|
21
|
+
|
|
22
|
+
- name: Install create-planet dependencies
|
|
23
|
+
run: npm install
|
|
24
|
+
working-directory: create-planet
|
|
25
|
+
|
|
26
|
+
- name: Sync template and publish
|
|
27
|
+
run: npm publish --provenance --access public
|
|
28
|
+
working-directory: create-planet
|
package/template/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@federated-planets/planet",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A decentralized space exploration game where every planet is a sovereign website.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "npm run build && wrangler dev -c wrangler.dev.jsonc",
|
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
"simulate": "node scripts/simulate-universe.js",
|
|
14
14
|
"test": "npm run build && vitest run",
|
|
15
15
|
"test:protocol": "npm run build && vitest run src/tests/protocol.test.ts",
|
|
16
|
-
"test:warp-links": "npm run build && vitest run src/tests/warp-links.test.ts"
|
|
16
|
+
"test:warp-links": "npm run build && vitest run src/tests/warp-links.test.ts",
|
|
17
|
+
"release": "npm version patch -m \"Release v%s\"",
|
|
18
|
+
"version": "node -e \"const fs=require('fs'),p=JSON.parse(fs.readFileSync('create-planet/package.json'));p.version=process.env.npm_new_version;fs.writeFileSync('create-planet/package.json',JSON.stringify(p,null,2)+'\\n')\" && git add create-planet/package.json",
|
|
19
|
+
"postversion": "git push && git push --tags"
|
|
17
20
|
},
|
|
18
21
|
"dependencies": {
|
|
19
22
|
"@astrojs/cloudflare": "^13.1.4",
|