create-macostack 0.6.0 → 0.6.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/LICENSE +21 -0
- package/README.md +75 -29
- package/bin/create-macostack.ts +3 -3
- package/package.json +17 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 macobits
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,53 +1,99 @@
|
|
|
1
1
|
# create-macostack
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Scaffold a production-ready full-stack app from the macostack templates — a Bun + Hono + Postgres backend and a TanStack (React) web app — with a single command.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
|
|
7
|
-
bun create macostack mi-tienda
|
|
6
|
+
bun create macostack my-app
|
|
8
7
|
```
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
An interactive wizard walks you through the rest:
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
1. **Pick the parts** your app needs — backend API, web app, or both.
|
|
12
|
+
2. **Choose a deploy target and feature modules.** Each template declares its own questions; the CLI merges them so every feature is asked exactly once for the whole app.
|
|
13
|
+
3. **Optionally prefill environment values** — your primary domain (CORS, cookie scope, and the web app's API URL) and a Resend API key for transactional email.
|
|
14
|
+
|
|
15
|
+
The CLI then downloads each template without its git history, installs dependencies, runs each template's own setup (app name, fresh secrets, module wiring), and leaves every part as its own independent git repository, ready to push.
|
|
16
|
+
|
|
17
|
+
## Requirements
|
|
18
|
+
|
|
19
|
+
- [Bun](https://bun.sh) 1.x
|
|
20
|
+
- GitHub access to the template repositories (they are private by default):
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
gh auth login
|
|
24
|
+
# or
|
|
25
|
+
export GITHUB_TOKEN=github_pat_… # fine-grained token, Contents: Read-only
|
|
16
26
|
```
|
|
17
27
|
|
|
18
|
-
|
|
19
|
-
`bun install`, delega `bun run setup` cuando existe, y asegura un repo git por
|
|
20
|
-
mitad si el setup no lo creó.
|
|
28
|
+
Access is verified before anything is written to disk — a typo'd repo or missing permission fails cleanly, with no half-created folders.
|
|
21
29
|
|
|
22
|
-
##
|
|
30
|
+
## Usage
|
|
23
31
|
|
|
24
32
|
```bash
|
|
25
|
-
bun
|
|
26
|
-
bun
|
|
33
|
+
bun create macostack my-app # scaffold into ./my-app
|
|
34
|
+
bun create macostack . # scaffold into the current (empty) directory
|
|
27
35
|
```
|
|
28
36
|
|
|
29
|
-
|
|
37
|
+
Result:
|
|
30
38
|
|
|
31
|
-
|
|
39
|
+
```txt
|
|
40
|
+
my-app/
|
|
41
|
+
├── server/ # Bun + Hono + Postgres API — its own git repo
|
|
42
|
+
└── client/ # TanStack web app — its own git repo
|
|
43
|
+
```
|
|
32
44
|
|
|
33
|
-
|
|
34
|
-
- server repo: `macostack-server`
|
|
35
|
-
- client repo: `macostack-client`
|
|
36
|
-
- ref: `main`
|
|
45
|
+
The root folder is intentionally **not** a git repository: server and client are designed to live and deploy as separate repos.
|
|
37
46
|
|
|
38
|
-
|
|
47
|
+
### Managing an existing app
|
|
48
|
+
|
|
49
|
+
Run the CLI again inside an app it created to add the missing part or toggle feature modules on and off — it detects the existing setup and switches to manage mode:
|
|
39
50
|
|
|
40
51
|
```bash
|
|
41
|
-
|
|
42
|
-
bun
|
|
43
|
-
bun run dev mi-web --client --skip-install
|
|
52
|
+
cd my-app
|
|
53
|
+
bun create macostack .
|
|
44
54
|
```
|
|
45
55
|
|
|
46
|
-
|
|
56
|
+
### Flags
|
|
57
|
+
|
|
58
|
+
| Flag | Description |
|
|
59
|
+
| --- | --- |
|
|
60
|
+
| `--server` / `--client` | Scaffold only that part (default: interactive) |
|
|
61
|
+
| `--yes` | Non-interactive: both parts, template defaults |
|
|
62
|
+
| `--owner <org>` | GitHub owner of the template repos (default: `macobits`) |
|
|
63
|
+
| `--ref <ref>` | Branch or tag to download (default: `main`) |
|
|
64
|
+
| `--server-repo <name>` | Server template repo (default: `macostack-server`) |
|
|
65
|
+
| `--client-repo <name>` | Client template repo (default: `macostack-client`) |
|
|
66
|
+
| `--skip-install` | Skip `bun install` |
|
|
67
|
+
| `--skip-setup` | Skip each template's setup wizard |
|
|
68
|
+
| `--help` | Print usage |
|
|
69
|
+
|
|
70
|
+
### Environment variables
|
|
71
|
+
|
|
72
|
+
| Variable | Description |
|
|
73
|
+
| --- | --- |
|
|
74
|
+
| `GITHUB_TOKEN` / `GH_TOKEN` | Token used to download the templates (falls back to `gh auth token`) |
|
|
75
|
+
| `MACOSTACK_GITHUB_OWNER` | Default template owner |
|
|
76
|
+
| `MACOSTACK_SERVER_REPO` | Default server template repo |
|
|
77
|
+
| `MACOSTACK_CLIENT_REPO` | Default client template repo |
|
|
78
|
+
| `MACOSTACK_REF` | Default branch or tag |
|
|
79
|
+
|
|
80
|
+
## Bring your own templates
|
|
81
|
+
|
|
82
|
+
The orchestrator is deliberately template-agnostic: it never hardcodes which features exist. Point `--owner`, `--server-repo`, and `--client-repo` at your own repositories, and expose a `setup` script in each template's `package.json`:
|
|
83
|
+
|
|
84
|
+
- `bun run setup --questions` prints a JSON spec of the questions the template supports (feature modules, optional deploy target).
|
|
85
|
+
- `bun run setup --yes --name <app> [--modules a,b] [--runtime x] [--domain d]` applies the answers.
|
|
86
|
+
|
|
87
|
+
Anything the template declares, the CLI renders — nothing more.
|
|
88
|
+
|
|
89
|
+
## Development
|
|
47
90
|
|
|
48
91
|
```bash
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
GITHUB_TOKEN=github_pat_...
|
|
92
|
+
bun install
|
|
93
|
+
bun run dev my-app --skip-install # run the CLI from source
|
|
94
|
+
bun run typecheck
|
|
53
95
|
```
|
|
96
|
+
|
|
97
|
+
## License
|
|
98
|
+
|
|
99
|
+
[MIT](./LICENSE) © macobits
|
package/bin/create-macostack.ts
CHANGED
|
@@ -187,7 +187,7 @@ if (scaffoldHere) {
|
|
|
187
187
|
}
|
|
188
188
|
} else if (positional) {
|
|
189
189
|
if (!validName(positional)) {
|
|
190
|
-
bail("App names use lowercase letters, digits and dashes — e.g.
|
|
190
|
+
bail("App names use lowercase letters, digits and dashes — e.g. my-app");
|
|
191
191
|
}
|
|
192
192
|
appName = positional;
|
|
193
193
|
} else if (flags.yes) {
|
|
@@ -197,9 +197,9 @@ if (scaffoldHere) {
|
|
|
197
197
|
appName = answered(
|
|
198
198
|
await text({
|
|
199
199
|
message: "What should we call your app?",
|
|
200
|
-
placeholder: "
|
|
200
|
+
placeholder: "my-app",
|
|
201
201
|
validate: (v) =>
|
|
202
|
-
validName(v ?? "") ? undefined : "lowercase letters, digits and dashes — e.g.
|
|
202
|
+
validName(v ?? "") ? undefined : "lowercase letters, digits and dashes — e.g. my-app",
|
|
203
203
|
}),
|
|
204
204
|
);
|
|
205
205
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-macostack",
|
|
3
|
-
"version": "0.6.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.6.1",
|
|
4
|
+
"description": "Scaffold a production-ready full-stack app from the macostack templates: Bun + Hono + Postgres backend and TanStack web app, each as its own git repo.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/macobits/create-macostack.git"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"create",
|
|
12
|
+
"scaffold",
|
|
13
|
+
"template",
|
|
14
|
+
"bun",
|
|
15
|
+
"hono",
|
|
16
|
+
"tanstack",
|
|
17
|
+
"fullstack",
|
|
18
|
+
"macostack"
|
|
19
|
+
],
|
|
5
20
|
"type": "module",
|
|
6
21
|
"bin": {
|
|
7
22
|
"create-macostack": "./bin/create-macostack.ts"
|