@percepta/create 3.0.0 → 3.1.0
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 +6 -5
- package/dist/{chunk-GEVZERMP.js → chunk-7NPWSTCY.js} +3 -1
- package/dist/{chunk-R4FWPE4A.js → chunk-DCM7JOSC.js} +2 -2
- package/dist/index.js +371 -210
- package/dist/{init-Z4VGBHAK.js → init-NP6GRXLL.js} +1 -1
- package/dist/{status-MITGDLTT.js → status-BTHGN6QH.js} +1 -1
- package/dist/{sync-J4SFZHDX.js → sync-3Q27L7XZ.js} +1 -1
- package/dist/{upstream-AQI7P4EU.js → upstream-C5KFAHVR.js} +1 -1
- package/package.json +1 -1
- package/templates/webapp/.github/workflows/__APP_NAME__-ryvn-release.yaml +3 -2
- package/templates/webapp/AGENTS.md +8 -2
- package/templates/webapp/Dockerfile +0 -1
- package/templates/webapp/README.md +1 -0
- package/templates/webapp/agent-skills/database.md +1 -0
- package/templates/webapp/agent-skills/deploy.md +24 -27
- package/templates/webapp/agent-skills/oneshot.md +3 -3
- package/templates/webapp/deploy/README.md +8 -6
- package/templates/webapp/deploy/ryvn/__APP_NAME__.service.yaml +0 -2
- package/templates/webapp/deploy/ryvn/environments/percepta-test/installations/__APP_NAME__.env.percepta-test.serviceinstallation.yaml +11 -27
- package/templates/webapp/drizzle.config.ts +15 -6
- package/templates/webapp/env.example.template +1 -0
- package/templates/webapp/eslint.config.mjs +7 -0
- package/templates/webapp/package.json.template +6 -6
- package/templates/webapp/scripts/open-ryvn-deploy-pr.ts +377 -0
- package/templates/webapp/scripts/seed.ts +1 -1
- package/templates/webapp/scripts/setup-database.ts +14 -0
- package/templates/webapp/src/app/global-error.tsx +2 -0
- package/templates/webapp/src/config/getEnvConfig.ts +1 -0
- package/templates/webapp/src/drizzle/db.ts +3 -0
- package/templates/webapp/src/drizzle/searchPath.test.ts +21 -0
- package/templates/webapp/src/drizzle/searchPath.ts +16 -0
- package/templates/webapp/src/styles/globals.css +0 -7
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Scaffold and manage Mosaic packages.
|
|
|
8
8
|
npx @percepta/create
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
That's it. The CLI prompts you for the
|
|
11
|
+
That's it. The CLI prompts you for the package type and project name. Defaults yield a running app — sign in as `admin@example.com` / `password`.
|
|
12
12
|
|
|
13
13
|
## Options (mostly for automation)
|
|
14
14
|
|
|
@@ -33,7 +33,7 @@ The bare command above is the canonical UX. The flags below exist for tests and
|
|
|
33
33
|
|
|
34
34
|
`create` auto-detects whether you're inside an existing pnpm monorepo (by walking up for `pnpm-workspace.yaml`) and changes its prompts accordingly:
|
|
35
35
|
|
|
36
|
-
- **Outside a monorepo** —
|
|
36
|
+
- **Outside a monorepo** — you're asked "Initialize with a webapp?" (Y/n, default Y) before the project name. Picking the webapp option scaffolds a monorepo with a webapp inside `packages/<name>/`. Declining gives you an empty monorepo.
|
|
37
37
|
- **Inside a monorepo** — pick `Webapp` (default) or `Library` to add a new package under the workspace pattern.
|
|
38
38
|
|
|
39
39
|
## Happy-path: zero-friction webapp
|
|
@@ -41,9 +41,10 @@ The bare command above is the canonical UX. The flags below exist for tests and
|
|
|
41
41
|
When you scaffold a webapp (the default flow), `create` automatically runs:
|
|
42
42
|
|
|
43
43
|
1. `pnpm install` (at the monorepo root)
|
|
44
|
-
2. `pnpm
|
|
45
|
-
3. `pnpm
|
|
46
|
-
4.
|
|
44
|
+
2. `pnpm install --ignore-workspace` (inside the webapp package, to create the Docker build lockfile)
|
|
45
|
+
3. `pnpm run setup` — Docker Compose Postgres + Drizzle migrations + seed user
|
|
46
|
+
4. `pnpm dev` — Next.js dev server
|
|
47
|
+
5. Opens the served URL in your default browser
|
|
47
48
|
|
|
48
49
|
Sign in as `admin@example.com` / `password` to start building.
|
|
49
50
|
|
|
@@ -81,10 +81,12 @@ async function promptProjectDetails(defaults) {
|
|
|
81
81
|
let finalName;
|
|
82
82
|
if (inMonorepo) {
|
|
83
83
|
projectType = defaults.projectType ?? await promptInsideMonorepoType();
|
|
84
|
+
await defaults.beforeNamePrompt?.(projectType);
|
|
84
85
|
finalName = defaults.name || await promptName("Package name?");
|
|
85
86
|
} else {
|
|
86
|
-
finalName = defaults.name || await promptName("Project name?");
|
|
87
87
|
projectType = defaults.projectType ?? await promptOutsideMonorepoType();
|
|
88
|
+
await defaults.beforeNamePrompt?.(projectType);
|
|
89
|
+
finalName = defaults.name || await promptName("Project name?");
|
|
88
90
|
}
|
|
89
91
|
const finalTitle = finalName ? toTitleCase(finalName) : "";
|
|
90
92
|
const finalDirectory = !inMonorepo && finalName ? path.resolve(process.cwd(), finalName) : "";
|
|
@@ -11,14 +11,14 @@ function getLatestTemplateTag(type, repoPath) {
|
|
|
11
11
|
{ cwd: repoPath, encoding: "utf-8" }
|
|
12
12
|
).trim();
|
|
13
13
|
if (!tags) return null;
|
|
14
|
-
return tags.split("\n")[0];
|
|
14
|
+
return tags.split("\n")[0] ?? null;
|
|
15
15
|
} catch {
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
function getTemplateVersionFromTag(tag) {
|
|
20
20
|
const parts = tag.split("/");
|
|
21
|
-
return parts[parts.length - 1];
|
|
21
|
+
return parts[parts.length - 1] ?? "";
|
|
22
22
|
}
|
|
23
23
|
function getTemplateDiff(repoPath, templatePath, fromTag, toTag) {
|
|
24
24
|
return execFileSync(
|