create-spacefn 0.1.0 → 0.1.1

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 ADDED
@@ -0,0 +1,59 @@
1
+ # create-spacefn
2
+
3
+ Scaffold a new SpaceFn project.
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ npx create-space-app my-project
9
+ ```
10
+
11
+ ## What It Does
12
+
13
+ Interactive CLI that:
14
+
15
+ 1. Prompts for project name
16
+ 2. Selects package manager (npm, pnpm, yarn, bun)
17
+ 3. Chooses a template
18
+ 4. Copies the template with project name substitution
19
+ 5. Optionally installs dependencies
20
+
21
+ ## Templates
22
+
23
+ | Template | Description |
24
+ | --------- | ------------------------------------------------------ |
25
+ | `minimal` | Basic setup with routes, pages, and Cloudflare Workers |
26
+
27
+ ## What's Included
28
+
29
+ The minimal template sets up:
30
+
31
+ - `@spacefn/server` — Meta framework
32
+ - `@spacefn/html` — Server-side HTML
33
+ - `@spacefn/datastar` — Client-side reactivity
34
+ - Vite + Cloudflare Workers
35
+ - TypeScript + oxlint + oxfmt
36
+
37
+ ## After Scaffolding
38
+
39
+ ```bash
40
+ cd my-project
41
+ pnpm dev
42
+ ```
43
+
44
+ Open `http://localhost:5173` to see your app.
45
+
46
+ ## Project Structure
47
+
48
+ ```
49
+ my-project/
50
+ src/
51
+ routes/
52
+ index.ts # Home page
53
+ middlewares/ # (empty, add your own)
54
+ pages/ # (empty, add your own)
55
+ main.ts # Entry point
56
+ vite.config.ts
57
+ wrangler.toml
58
+ package.json
59
+ ```
package/dist/index.js CHANGED
@@ -116,7 +116,7 @@ var main = defineCommand({
116
116
  install(
117
117
  targetDir,
118
118
  pm,
119
- ["@spacefn/html", "@spacefn/server", "@spacefn/datastar"],
119
+ ["@spacefn/html", "@spacefn/server", "@spacefn/datastar", "@spacefn/css", "@spacefn/db"],
120
120
  ["wrangler", "oxlint", "oxfmt", "vite", "vitest"]
121
121
  );
122
122
  s2.stop("Dependencies installed");
@@ -10,9 +10,5 @@
10
10
  "fmt:check": "oxfmt -c configs/oxfmt.ts --check",
11
11
  "lint": "oxlint -c configs/oxlint.ts",
12
12
  "lint:fix": "oxlint -c configs/oxlint.ts --fix"
13
- },
14
- "devDependencies": {
15
- "@spacefn/server": "latest",
16
- "vitest": "^3.0.0"
17
13
  }
18
14
  }
@@ -1,8 +1,8 @@
1
1
  import { defineComponent, h } from "@spacefn/html";
2
+ import type { LoaderReturnType } from "@spacefn/server"
3
+ import type { loader } from "./index.server"
2
4
 
3
- type Props = {
4
- msg: string;
5
- };
5
+ type Props = LoaderReturnType<typeof loader>;
6
6
 
7
7
  export default defineComponent<Props>((props) => {
8
8
  return h.main({}, h.h1({}, props.msg), h.p({}, "Welcome to your Space app"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-spacefn",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "bin": {
5
5
  "create-spacefn": "./bin/create-space-app.js"
6
6
  },
package/src/index.ts CHANGED
@@ -154,7 +154,7 @@ const main = defineCommand({
154
154
  install(
155
155
  targetDir,
156
156
  pm as PackageManager,
157
- ["@spacefn/html", "@spacefn/server", "@spacefn/datastar"],
157
+ ["@spacefn/html", "@spacefn/server", "@spacefn/datastar", "@spacefn/css", "@spacefn/db"],
158
158
  ["wrangler", "oxlint", "oxfmt", "vite", "vitest"],
159
159
  );
160
160
  s2.stop("Dependencies installed");
@@ -10,9 +10,5 @@
10
10
  "fmt:check": "oxfmt -c configs/oxfmt.ts --check",
11
11
  "lint": "oxlint -c configs/oxlint.ts",
12
12
  "lint:fix": "oxlint -c configs/oxlint.ts --fix"
13
- },
14
- "devDependencies": {
15
- "@spacefn/server": "latest",
16
- "vitest": "^3.0.0"
17
13
  }
18
14
  }
@@ -1,8 +1,8 @@
1
1
  import { defineComponent, h } from "@spacefn/html";
2
+ import type { LoaderReturnType } from "@spacefn/server"
3
+ import type { loader } from "./index.server"
2
4
 
3
- type Props = {
4
- msg: string;
5
- };
5
+ type Props = LoaderReturnType<typeof loader>;
6
6
 
7
7
  export default defineComponent<Props>((props) => {
8
8
  return h.main({}, h.h1({}, props.msg), h.p({}, "Welcome to your Space app"));