startx 1.0.92 → 1.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 +212 -0
- package/apps/startx-cli/dist/index.mjs +69 -61
- package/apps/startx-cli/src/commands/init.ts +33 -7
- package/apps/startx-cli/src/commands/package.ts +133 -12
- package/apps/startx-cli/src/configs/files.ts +3 -0
- package/apps/startx-cli/src/configs/scripts.ts +27 -17
- package/apps/startx-cli/src/index.ts +2 -1
- package/apps/startx-cli/src/utils/file-handler.ts +2 -2
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
# startx
|
|
2
|
+
|
|
3
|
+
> Scaffold a production-ready TypeScript monorepo in minutes.
|
|
4
|
+
|
|
5
|
+
**Requirements:** Node.js ≥ 22 · pnpm · Turborepo (installed automatically)
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Quick Start
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx startx init
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Or install globally and reuse:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install -g startx
|
|
19
|
+
startx init
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Commands
|
|
25
|
+
|
|
26
|
+
| Command | What it does |
|
|
27
|
+
|---------|--------------|
|
|
28
|
+
| `startx init [name]` | Create a new monorepo from scratch |
|
|
29
|
+
| `startx package list` | Browse all available template apps, packages, and configs |
|
|
30
|
+
| `startx package add [name]` | Copy a template app or package into the current monorepo |
|
|
31
|
+
| `startx package new [name]` | Create a blank workspace package from scratch |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## `startx init`
|
|
36
|
+
|
|
37
|
+
Creates a complete monorepo workspace interactively.
|
|
38
|
+
|
|
39
|
+
**Options**
|
|
40
|
+
|
|
41
|
+
| Flag | Description |
|
|
42
|
+
|------|-------------|
|
|
43
|
+
| `-d, --dir <path>` | Output directory (defaults to `./<projectName>`) |
|
|
44
|
+
|
|
45
|
+
**Interactive prompts**
|
|
46
|
+
|
|
47
|
+
1. **Project name** — npm package name for the workspace root.
|
|
48
|
+
2. **Select apps** — One or more apps to include (checkbox list).
|
|
49
|
+
3. **Select configs** — Optional shared config packages (ESLint, TypeScript, Vitest, tsdown).
|
|
50
|
+
4. **Select packages** — Shared libraries compatible with your selected apps.
|
|
51
|
+
5. **Formatter** — `prettier + biome` (both) or `prettier` only.
|
|
52
|
+
|
|
53
|
+
After answering all prompts, the CLI writes the full workspace. No install is run automatically — finish setup with:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
cd <projectName>
|
|
57
|
+
pnpm install
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## `startx package list`
|
|
63
|
+
|
|
64
|
+
Prints all apps, packages, and configs available in the template, grouped by type.
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
startx package list
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## `startx package add`
|
|
73
|
+
|
|
74
|
+
Copies a template app or package into the current monorepo.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
startx package add [packageName] [options]
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Options**
|
|
81
|
+
|
|
82
|
+
| Flag | Description |
|
|
83
|
+
|------|-------------|
|
|
84
|
+
| `-n, --name <name>` | Override the destination name (e.g. copy `core-server` as `api-v2`) |
|
|
85
|
+
| `--eslint / --no-eslint` | Force ESLint on or off for this package |
|
|
86
|
+
| `--no-install` | Skip running the package manager after adding missing root dependencies |
|
|
87
|
+
|
|
88
|
+
**What happens**
|
|
89
|
+
|
|
90
|
+
1. Prompts to select the template source if not passed as an argument.
|
|
91
|
+
2. Asks for a new name — defaults to the template name, so you can clone `core-server` as `api-v2` or `@db/drizzle` as `@db/analytics`.
|
|
92
|
+
3. Detects what is installed in the workspace root (biome, prettier, eslint, vitest, tsdown) and applies matching config files and scripts automatically.
|
|
93
|
+
4. Checks for any workspace-root dependencies the package needs that are missing — offers to add and install them.
|
|
94
|
+
5. Prompts before overwriting if the destination path already exists.
|
|
95
|
+
|
|
96
|
+
**Example**
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# Add core-server under a new name
|
|
100
|
+
startx package add core-server --name api-v2
|
|
101
|
+
|
|
102
|
+
# Add @db/drizzle as a new analytics DB package
|
|
103
|
+
startx package add @db/drizzle -n @db/analytics
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## `startx package new`
|
|
109
|
+
|
|
110
|
+
Creates a blank package from scratch, auto-configured for the current workspace.
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
startx package new [packageName] [options]
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Options**
|
|
117
|
+
|
|
118
|
+
| Flag | Description |
|
|
119
|
+
|------|-------------|
|
|
120
|
+
| `-d, --dir <path>` | Custom destination path relative to workspace root |
|
|
121
|
+
| `--eslint / --no-eslint` | Force ESLint on or off |
|
|
122
|
+
| `--no-install` | Skip running the package manager |
|
|
123
|
+
|
|
124
|
+
**What gets created**
|
|
125
|
+
|
|
126
|
+
| File | Condition |
|
|
127
|
+
|------|-----------|
|
|
128
|
+
| `package.json` | Always — includes `typecheck` and `clean` scripts |
|
|
129
|
+
| `src/index.ts` | Always — empty export |
|
|
130
|
+
| `tsconfig.json` | Always — extends `typescript-config/tsconfig.node.json` |
|
|
131
|
+
| `eslint.config.ts` | If ESLint is detected in workspace root |
|
|
132
|
+
| `vitest.config.ts` | If vitest is detected in workspace root |
|
|
133
|
+
|
|
134
|
+
Scripts added to `package.json`:
|
|
135
|
+
|
|
136
|
+
- `lint` / `lint:fix` — if ESLint detected
|
|
137
|
+
- `test` — if vitest detected
|
|
138
|
+
|
|
139
|
+
**Example**
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
# Create @repo/analytics package
|
|
143
|
+
startx package new @repo/analytics
|
|
144
|
+
|
|
145
|
+
# Create in a custom path
|
|
146
|
+
startx package new my-utils --dir packages/internal/my-utils
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Available Templates
|
|
152
|
+
|
|
153
|
+
### Apps
|
|
154
|
+
|
|
155
|
+
| Name | Description |
|
|
156
|
+
|------|-------------|
|
|
157
|
+
| `core-server` | Express.js REST API server |
|
|
158
|
+
| `web-client` | React Router v7 single-page app |
|
|
159
|
+
| `cli` | Commander.js CLI application |
|
|
160
|
+
| `queue-worker` | Background job processor |
|
|
161
|
+
|
|
162
|
+
### Packages
|
|
163
|
+
|
|
164
|
+
| Name | Requires | Description |
|
|
165
|
+
|------|----------|-------------|
|
|
166
|
+
| `@repo/env` | backend | Environment variable validation with Zod |
|
|
167
|
+
| `@repo/lib` | backend | Auth, file system, hashing, sessions, events, and more |
|
|
168
|
+
| `@repo/logger` | backend | Structured logging |
|
|
169
|
+
| `@repo/mail` | backend | Email sending via Nodemailer |
|
|
170
|
+
| `@repo/redis` | backend | Redis client and session support |
|
|
171
|
+
| `@repo/model` | node | Shared Drizzle model definitions |
|
|
172
|
+
| `@repo/common` | node | Common shared utilities |
|
|
173
|
+
| `@db/drizzle` | backend | Drizzle ORM with PostgreSQL |
|
|
174
|
+
| `@db/sqlite` | backend | Drizzle ORM with SQLite |
|
|
175
|
+
| `ui` | frontend | React component library |
|
|
176
|
+
| `queue` | node | Job queue |
|
|
177
|
+
| `aix` | node | AI/ML utilities |
|
|
178
|
+
|
|
179
|
+
### Configs
|
|
180
|
+
|
|
181
|
+
| Name | Description |
|
|
182
|
+
|------|-------------|
|
|
183
|
+
| `typescript-config` | Shared `tsconfig` base files |
|
|
184
|
+
| `eslint-config` | Shared ESLint flat-config rules (TypeScript, imports, unicorn) |
|
|
185
|
+
| `vitest-config` | Shared Vitest configuration |
|
|
186
|
+
| `tsdown-config` | Shared tsdown build configuration |
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## What Gets Generated
|
|
191
|
+
|
|
192
|
+
### By `startx init`
|
|
193
|
+
|
|
194
|
+
| Path | Description |
|
|
195
|
+
|------|-------------|
|
|
196
|
+
| `package.json` | Workspace root — name, scripts, and deps filtered to your selections |
|
|
197
|
+
| `pnpm-workspace.yaml` | Declares workspace package globs |
|
|
198
|
+
| `turbo.json` | Turborepo pipeline definition |
|
|
199
|
+
| `.vscode/settings.json` | Format on save + lint-fix on save, set to your chosen formatter |
|
|
200
|
+
| `.vscode/extensions.json` | Recommends ESLint + Biome or Prettier extension |
|
|
201
|
+
| `biome.json` | Biome configuration (only when Biome selected) |
|
|
202
|
+
| `.prettierrc.cjs` | Prettier configuration |
|
|
203
|
+
| `eslint.config.ts` | Root-level ESLint ignore list |
|
|
204
|
+
| `<app>/eslint.config.ts` | Per-package ESLint config extending shared rules |
|
|
205
|
+
| `<app>/vitest.config.ts` | Per-package Vitest config (if vitest selected) |
|
|
206
|
+
| `_gitignore` → `.gitignore` | Standard Node/TypeScript ignores |
|
|
207
|
+
|
|
208
|
+
The `.vscode/` files are committed so anyone who clones the generated repo gets format-on-save and lint-fix-on-save in VS Code without any manual setup.
|
|
209
|
+
|
|
210
|
+
### By `startx package add` / `startx package new`
|
|
211
|
+
|
|
212
|
+
Same file set as the source template for `add`. For `new`: `package.json`, `src/index.ts`, `tsconfig.json`, and conditionally `eslint.config.ts` / `vitest.config.ts` based on what is installed in the workspace.
|