@sb-codex/create-sb-app 0.0.2 → 0.0.3

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.
Files changed (3) hide show
  1. package/README.md +26 -14
  2. package/dist/index.js +8 -8
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,40 +1,52 @@
1
1
  # @sb-codex/create-sb-app
2
2
 
3
- Scaffold a new multi-tenant SaaS project from the [sb-codex starter](https://github.com/SB-SLIM/react-app-starter). Downloads the full monorepo (apps + packages in `workspace:^`, self-contained) and replaces project-specific values for you.
3
+ Scaffold a new multi-tenant SaaS project from the [sb-codex starter](https://github.com/SB-SLIM/react-app-starter).
4
+
5
+ It generates an **apps-only** project: you get `apps/` (admin, server, web, e2e) and the `@sb-codex/*` plugins are pulled from **npm** at their published versions — there is **no `packages/` folder** to maintain. The CLI also injects each plugin's peer dependencies into the consuming apps so the project installs cleanly.
4
6
 
5
7
  ## Usage
6
8
 
7
9
  ```bash
8
- pnpm create @sb-codex/sb-app my-saas
9
- # or: npm create @sb-codex/sb-app my-saas
10
+ pnpm create @sb-codex/sb-app@latest my-saas
11
+ # or: npm create @sb-codex/sb-app@latest my-saas
10
12
  ```
11
13
 
14
+ > The `@latest` tag forces the newest version and avoids npx serving a cached older release.
15
+
12
16
  Prompts:
13
17
 
14
18
  - **Project directory** — where to create the project
15
19
  - **Project name** — root `package.json` name
16
- - **Production domain** — replaces the reference domain across docs, compose and Traefik config
20
+ - **Production domain** — replaces the reference domain. **Defaults to `localhost`** for local dev (e.g. `hub.localhost`)
17
21
  - **git init** — start with fresh git history
18
22
 
19
23
  Then:
20
24
 
21
25
  ```bash
22
26
  cd my-saas
23
- pnpm install
27
+ pnpm install # plugins resolved from npm — no local build
24
28
  pnpm dev
25
29
  ```
26
30
 
27
- ## What it replaces
31
+ ## What it does
32
+
33
+ - Pulls `apps/` from the starter; rewrites each `@sb-codex/*` dependency from `workspace:^` to the **published npm version** and injects that plugin's peer dependencies
34
+ - Removes the `packages/` source, trims `pnpm-workspace.yaml` to `apps/*`, strips `@sb-codex/*` from `pnpm.overrides`, drops the changeset config
35
+ - Copies `.env.example` → `.env`
36
+ - Replaces project-specific tokens:
28
37
 
29
- | Token | Replaced with |
30
- | ----------------------------------- | ---------------------------- |
31
- | `slimbouchoucha.tn` | your domain |
32
- | `ghcr.io/sb-slim/react-app-starter` | `ghcr.io/your-gh-org/<name>` |
33
- | `SB-SLIM/react-app-starter` | `your-gh-org/<name>` |
34
- | `152.53.187.54` | `YOUR_VPS_IP` |
35
- | Notion page id | `YOUR_NOTION_PAGE_ID` |
38
+ | Token | Replaced with |
39
+ | ----------------------------------- | --------------------------------- |
40
+ | `slimbouchoucha.tn` | your domain (default `localhost`) |
41
+ | `ghcr.io/sb-slim/react-app-starter` | `ghcr.io/your-gh-org/<name>` |
42
+ | `SB-SLIM/react-app-starter` | `your-gh-org/<name>` |
43
+ | Notion page id | `YOUR_NOTION_PAGE_ID` |
36
44
 
37
- It also drops its own `packages/create-sb-app` from the generated project and copies `.env.example` → `.env`.
45
+ ## Non-interactive flags
46
+
47
+ ```bash
48
+ npx @sb-codex/create-sb-app my-saas --name my-saas --domain localhost --no-git
49
+ ```
38
50
 
39
51
  ## Local usage (from the monorepo)
40
52
 
package/dist/index.js CHANGED
@@ -44,8 +44,6 @@ function buildReplacements(answers) {
44
44
  },
45
45
  // Remaining bare repo name (URLs, image names)
46
46
  { find: /react-app-starter/g, replace: name },
47
- // VPS IP
48
- { find: /152\.53\.187\.54/g, replace: "YOUR_VPS_IP" },
49
47
  // Notion page id (mirror of architecture docs — project specific)
50
48
  { find: NOTION_PAGE_ID_DASHED, replace: "YOUR_NOTION_PAGE_ID" },
51
49
  { find: NOTION_PAGE_ID_COMPACT, replace: "YOUR_NOTION_PAGE_ID" }
@@ -134,7 +132,8 @@ function applyAppsOnly(targetDir) {
134
132
  }
135
133
  }
136
134
  }
137
- if (existsSync(packagesDir)) rmSync(packagesDir, { recursive: true, force: true });
135
+ if (existsSync(packagesDir))
136
+ rmSync(packagesDir, { recursive: true, force: true });
138
137
  const wsPath = join(targetDir, "pnpm-workspace.yaml");
139
138
  if (existsSync(wsPath)) {
140
139
  const kept = readFileSync(wsPath, "utf8").split(/\r?\n/).filter((line) => !/['"]packages\/\*['"]/.test(line)).join("\n");
@@ -152,7 +151,8 @@ function applyAppsOnly(targetDir) {
152
151
  writeJson(rootPj, pkg);
153
152
  }
154
153
  const changesetDir = join(targetDir, ".changeset");
155
- if (existsSync(changesetDir)) rmSync(changesetDir, { recursive: true, force: true });
154
+ if (existsSync(changesetDir))
155
+ rmSync(changesetDir, { recursive: true, force: true });
156
156
  }
157
157
 
158
158
  // src/index.ts
@@ -235,12 +235,12 @@ async function main() {
235
235
  domain = flags.domain;
236
236
  } else {
237
237
  const domainAnswer = await text({
238
- message: "Production domain?",
239
- placeholder: "myapp.com",
240
- defaultValue: "example.com"
238
+ message: "Production domain? (defaults to localhost for local dev)",
239
+ placeholder: "localhost",
240
+ defaultValue: "localhost"
241
241
  });
242
242
  if (isCancel(domainAnswer)) bail("Cancelled.");
243
- domain = domainAnswer || "example.com";
243
+ domain = domainAnswer || "localhost";
244
244
  }
245
245
  let doGit;
246
246
  if (flags.git === true || flags["no-git"] === true) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@sb-codex/create-sb-app",
4
- "version": "0.0.2",
4
+ "version": "0.0.3",
5
5
  "description": "Scaffold a new multi-tenant SaaS project from the sb-codex starter.",
6
6
  "type": "module",
7
7
  "license": "MIT",