@percepta/create 3.1.3 → 3.1.5
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 +8 -8
- package/dist/git-ops-C2CIjuce.js +51 -0
- package/dist/git-ops-C2CIjuce.js.map +1 -0
- package/dist/index.js +1073 -1067
- package/dist/index.js.map +1 -0
- package/dist/init-OeK4Yk6_.js +52 -0
- package/dist/init-OeK4Yk6_.js.map +1 -0
- package/dist/status-DC8mvHZj.js +48 -0
- package/dist/status-DC8mvHZj.js.map +1 -0
- package/dist/sync-C5Pd32VM.js +101 -0
- package/dist/sync-C5Pd32VM.js.map +1 -0
- package/dist/upstream-F6m8zRBQ.js +85 -0
- package/dist/upstream-F6m8zRBQ.js.map +1 -0
- package/package.json +23 -24
- package/templates/webapp/AGENTS.md +1 -1
- package/templates/webapp/README.md +1 -1
- package/templates/webapp/agent-skills/database.md +5 -1
- package/templates/webapp/agent-skills/deploy.md +5 -3
- package/templates/webapp/agent-skills/inngest.md +13 -8
- package/templates/webapp/agent-skills/oneshot.md +1 -1
- package/templates/webapp/deploy/README.md +2 -2
- package/templates/webapp/deploy/ryvn/environments/percepta-test/installations/__APP_NAME__.env.percepta-test.serviceinstallation.yaml +3 -3
- package/templates/webapp/package.json.template +2 -2
- package/templates/webapp/scripts/deploy-percepta-test.ts +311 -36
- package/templates/webapp/scripts/generate-migrations.ts +28 -0
- package/templates/webapp/src/drizzle/__tests__/migrationSql.test.ts +24 -0
- package/templates/webapp/src/drizzle/migrationSql.ts +8 -0
- package/templates/webapp/src/services/inngest/AppWorkflowService.ts +19 -0
- package/templates/webapp/src/services/inngest/__tests__/AppWorkflowService.test.ts +19 -0
- package/templates/webapp/src/services/inngest/events/AppEvents.ts +7 -13
- package/templates/webapp/src/services/inngest/events/payloads/ExampleEventPayload.ts +1 -3
- package/dist/chunk-CO3YWUD6.js +0 -139
- package/dist/chunk-DCM7JOSC.js +0 -49
- package/dist/chunk-V5EJIUBJ.js +0 -60
- package/dist/index.d.ts +0 -1
- package/dist/init-EQZ2TCSJ.js +0 -96
- package/dist/status-QW5TQDYY.js +0 -76
- package/dist/sync-RLBZDOFB.js +0 -136
- package/dist/upstream-TQFVPMEG.js +0 -144
package/README.md
CHANGED
|
@@ -14,14 +14,14 @@ That's it. The CLI prompts you for the package type, repo name, and package name
|
|
|
14
14
|
|
|
15
15
|
The bare command above is the canonical UX. The flags below exist for tests and other automation, not for routine use:
|
|
16
16
|
|
|
17
|
-
| Option
|
|
18
|
-
|
|
19
|
-
| `-t, --type <type>`
|
|
20
|
-
| `--name <name>`
|
|
21
|
-
| `--repo-name <name>` | Repo name when creating a new monorepo (skips the repo name prompt)
|
|
22
|
-
| `--cwd <dir>`
|
|
23
|
-
| `--skip-install`
|
|
24
|
-
| `-y, --yes`
|
|
17
|
+
| Option | Description |
|
|
18
|
+
| -------------------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
19
|
+
| `-t, --type <type>` | Package type: `monorepo`, `webapp`, or `library` (skips the type prompt) |
|
|
20
|
+
| `--name <name>` | Package/app name (skips the package name prompt) |
|
|
21
|
+
| `--repo-name <name>` | Repo name when creating a new monorepo (skips the repo name prompt) |
|
|
22
|
+
| `--cwd <dir>` | Run as if the CLI was started from `<dir>` |
|
|
23
|
+
| `--skip-install` | Skip dependency installation, which also skips the auto-run setup + dev + browser, leaving you with manual next-steps |
|
|
24
|
+
| `-y, --yes` | Skip all prompts; requires `--name` |
|
|
25
25
|
|
|
26
26
|
## Subcommands
|
|
27
27
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
//#region src/utils/git-ops.ts
|
|
3
|
+
function toGitPath(p) {
|
|
4
|
+
return p.replace(/\\/g, "/");
|
|
5
|
+
}
|
|
6
|
+
function getLatestTemplateTag(type, repoPath) {
|
|
7
|
+
try {
|
|
8
|
+
const tags = execFileSync("git", [
|
|
9
|
+
"tag",
|
|
10
|
+
"-l",
|
|
11
|
+
`template/${type}/*`,
|
|
12
|
+
"--sort=-v:refname"
|
|
13
|
+
], {
|
|
14
|
+
cwd: repoPath,
|
|
15
|
+
encoding: "utf-8"
|
|
16
|
+
}).trim();
|
|
17
|
+
if (!tags) return null;
|
|
18
|
+
return tags.split("\n")[0] ?? null;
|
|
19
|
+
} catch {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function getTemplateVersionFromTag(tag) {
|
|
24
|
+
const parts = tag.split("/");
|
|
25
|
+
return parts[parts.length - 1] ?? "";
|
|
26
|
+
}
|
|
27
|
+
function getTemplateDiff(repoPath, templatePath, fromTag, toTag) {
|
|
28
|
+
return execFileSync("git", [
|
|
29
|
+
"diff",
|
|
30
|
+
`${fromTag}..${toTag}`,
|
|
31
|
+
"--",
|
|
32
|
+
toGitPath(templatePath)
|
|
33
|
+
], {
|
|
34
|
+
cwd: repoPath,
|
|
35
|
+
encoding: "utf-8"
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function getFileAtTag(repoPath, tag, filePath) {
|
|
39
|
+
try {
|
|
40
|
+
return execFileSync("git", ["show", `${tag}:${toGitPath(filePath)}`], {
|
|
41
|
+
cwd: repoPath,
|
|
42
|
+
encoding: "utf-8"
|
|
43
|
+
});
|
|
44
|
+
} catch {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { getTemplateVersionFromTag as i, getLatestTemplateTag as n, getTemplateDiff as r, getFileAtTag as t };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=git-ops-C2CIjuce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-ops-C2CIjuce.js","names":[],"sources":["../src/utils/git-ops.ts"],"sourcesContent":["import { execFileSync } from \"node:child_process\";\n\n// Git requires forward slashes for in-repo paths regardless of OS\nfunction toGitPath(p: string): string {\n return p.replace(/\\\\/g, \"/\");\n}\n\nexport function getLatestTemplateTag(\n type: string,\n repoPath: string,\n): string | null {\n try {\n const tags = execFileSync(\n \"git\",\n [\"tag\", \"-l\", `template/${type}/*`, \"--sort=-v:refname\"],\n { cwd: repoPath, encoding: \"utf-8\" },\n ).trim();\n if (!tags) return null;\n return tags.split(\"\\n\")[0] ?? null;\n } catch {\n return null;\n }\n}\n\nexport function getTemplateVersionFromTag(tag: string): string {\n const parts = tag.split(\"/\");\n return parts[parts.length - 1] ?? \"\";\n}\n\nexport function getTemplateDiff(\n repoPath: string,\n templatePath: string,\n fromTag: string,\n toTag: string,\n): string {\n return execFileSync(\n \"git\",\n [\"diff\", `${fromTag}..${toTag}`, \"--\", toGitPath(templatePath)],\n {\n cwd: repoPath,\n encoding: \"utf-8\",\n },\n );\n}\n\nexport function getFileAtTag(\n repoPath: string,\n tag: string,\n filePath: string,\n): string | null {\n try {\n return execFileSync(\"git\", [\"show\", `${tag}:${toGitPath(filePath)}`], {\n cwd: repoPath,\n encoding: \"utf-8\",\n });\n } catch {\n return null;\n }\n}\n"],"mappings":";;AAGA,SAAS,UAAU,GAAmB;AACpC,QAAO,EAAE,QAAQ,OAAO,IAAI;;AAG9B,SAAgB,qBACd,MACA,UACe;AACf,KAAI;EACF,MAAM,OAAO,aACX,OACA;GAAC;GAAO;GAAM,YAAY,KAAK;GAAK;GAAoB,EACxD;GAAE,KAAK;GAAU,UAAU;GAAS,CACrC,CAAC,MAAM;AACR,MAAI,CAAC,KAAM,QAAO;AAClB,SAAO,KAAK,MAAM,KAAK,CAAC,MAAM;SACxB;AACN,SAAO;;;AAIX,SAAgB,0BAA0B,KAAqB;CAC7D,MAAM,QAAQ,IAAI,MAAM,IAAI;AAC5B,QAAO,MAAM,MAAM,SAAS,MAAM;;AAGpC,SAAgB,gBACd,UACA,cACA,SACA,OACQ;AACR,QAAO,aACL,OACA;EAAC;EAAQ,GAAG,QAAQ,IAAI;EAAS;EAAM,UAAU,aAAa;EAAC,EAC/D;EACE,KAAK;EACL,UAAU;EACX,CACF;;AAGH,SAAgB,aACd,UACA,KACA,UACe;AACf,KAAI;AACF,SAAO,aAAa,OAAO,CAAC,QAAQ,GAAG,IAAI,GAAG,UAAU,SAAS,GAAG,EAAE;GACpE,KAAK;GACL,UAAU;GACX,CAAC;SACI;AACN,SAAO"}
|