create-guren-app 1.17.1 → 1.17.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.
- package/dist/cli.js +27 -11
- package/package.json +1 -1
- package/templates/api-only/package.json +4 -4
- package/templates/default/package.json +4 -4
package/dist/cli.js
CHANGED
|
@@ -1365,6 +1365,10 @@ const TEMPLATES_ROOT = fileURLToPath(new URL("../templates", import.meta.url));
|
|
|
1365
1365
|
function templateDir(name) {
|
|
1366
1366
|
return join(TEMPLATES_ROOT, name);
|
|
1367
1367
|
}
|
|
1368
|
+
const DEFAULT_RESOURCE_EXAMPLE = {
|
|
1369
|
+
name: "posts",
|
|
1370
|
+
fields: "title:string,body:text"
|
|
1371
|
+
};
|
|
1368
1372
|
const DEFAULT_TRANSFORM_FILES = [
|
|
1369
1373
|
"README.md",
|
|
1370
1374
|
"package.json",
|
|
@@ -1396,7 +1400,8 @@ const blueprintRegistry = {
|
|
|
1396
1400
|
description: "API-only starter — no Inertia, no React, no frontend assets.",
|
|
1397
1401
|
baseTemplate: "api-only",
|
|
1398
1402
|
overlayTemplates: {},
|
|
1399
|
-
transformFiles: API_TRANSFORM_FILES
|
|
1403
|
+
transformFiles: API_TRANSFORM_FILES,
|
|
1404
|
+
apiOnly: true
|
|
1400
1405
|
},
|
|
1401
1406
|
blog: {
|
|
1402
1407
|
name: "blog",
|
|
@@ -1407,7 +1412,11 @@ const blueprintRegistry = {
|
|
|
1407
1412
|
ssr: ["default-ssr", "blog"]
|
|
1408
1413
|
},
|
|
1409
1414
|
transformFiles: BLOG_TRANSFORM_FILES,
|
|
1410
|
-
includesAuth: true
|
|
1415
|
+
includesAuth: true,
|
|
1416
|
+
resourceExample: {
|
|
1417
|
+
name: "tags",
|
|
1418
|
+
fields: "name:string"
|
|
1419
|
+
}
|
|
1411
1420
|
},
|
|
1412
1421
|
worker: {
|
|
1413
1422
|
name: "worker",
|
|
@@ -1981,7 +1990,7 @@ runMain(defineCommand({
|
|
|
1981
1990
|
if (!force && !targetWasEmpty) throw new Error(`Directory "${targetDir}" is not empty. Use --force to scaffold anyway.`);
|
|
1982
1991
|
} else await ensureTargetDirectory(targetDir, true);
|
|
1983
1992
|
const blueprint = getAppBlueprint(typeof args.blueprint === "string" ? args.blueprint : void 0);
|
|
1984
|
-
const renderingMode = blueprint.
|
|
1993
|
+
const renderingMode = blueprint.apiOnly ? "spa" : await resolveRenderingMode(args.mode);
|
|
1985
1994
|
const database = await resolveDatabase(args.db);
|
|
1986
1995
|
const agents = await resolveAgents(args.agents);
|
|
1987
1996
|
const shouldInitGit = await resolveGitInit(args.git, {
|
|
@@ -1995,12 +2004,16 @@ runMain(defineCommand({
|
|
|
1995
2004
|
database
|
|
1996
2005
|
});
|
|
1997
2006
|
if (renderingMode === "ssr") await updateSsrPackageJson(targetDir);
|
|
1998
|
-
|
|
1999
|
-
|
|
2007
|
+
let includeAuth = false;
|
|
2008
|
+
if (args.auth) {
|
|
2009
|
+
if (blueprint.includesAuth) consola.info(`The ${blueprint.name} blueprint already ships authentication — ignoring --auth.`);
|
|
2010
|
+
else if (blueprint.apiOnly) consola.info(`The ${blueprint.name} blueprint has no pages to sign in on — ignoring --auth. Guard routes/api.ts with createBearerTokenMiddleware from @guren/core instead: https://guren.dev/docs/guides/api-tokens`);
|
|
2011
|
+
else includeAuth = true;
|
|
2012
|
+
}
|
|
2000
2013
|
const shouldInstall = args.install !== false;
|
|
2001
2014
|
let installed = false;
|
|
2002
2015
|
if (shouldInstall) installed = await installDependencies(targetDir);
|
|
2003
|
-
if (args.prototype && blueprint.
|
|
2016
|
+
if (args.prototype && !blueprint.apiOnly) {
|
|
2004
2017
|
let prototypeInstalled = false;
|
|
2005
2018
|
if (installed) {
|
|
2006
2019
|
consola.start("Installing prototype mode...");
|
|
@@ -2008,7 +2021,7 @@ runMain(defineCommand({
|
|
|
2008
2021
|
if (prototypeInstalled) consola.success("Prototype mode installed: bun run dev:prototype / bun run build:prototype");
|
|
2009
2022
|
}
|
|
2010
2023
|
if (!prototypeInstalled) consola.warn("Prototype mode was not installed automatically. Run `bunx guren add prototype` inside the app after installing dependencies.");
|
|
2011
|
-
} else if (args.prototype) consola.info(
|
|
2024
|
+
} else if (args.prototype) consola.info(`The ${blueprint.name} blueprint has no pages to prototype — ignoring --prototype.`);
|
|
2012
2025
|
if (agents === null) consola.info("Skipping the AI agent harness. Add it later with `bunx guren agent:init --target <agents>`.");
|
|
2013
2026
|
else {
|
|
2014
2027
|
const targetList = agents.join(",");
|
|
@@ -2035,7 +2048,7 @@ runMain(defineCommand({
|
|
|
2035
2048
|
]);
|
|
2036
2049
|
if (authInstalled) consola.success("Authentication scaffolding added");
|
|
2037
2050
|
}
|
|
2038
|
-
if (!authInstalled) consola.warn("Authentication was not scaffolded automatically. Run `bunx guren add auth` inside the app after installing dependencies.");
|
|
2051
|
+
if (!authInstalled) consola.warn(installed ? "Authentication scaffolding failed (see the output above). Run `bunx guren add auth` inside the app once that is fixed." : "Authentication was not scaffolded automatically. Run `bunx guren add auth` inside the app after installing dependencies.");
|
|
2039
2052
|
}
|
|
2040
2053
|
if (shouldInitGit) reportGitInit(targetDir);
|
|
2041
2054
|
const relativeTarget = relative(g$1.cwd(), targetDir) || ".";
|
|
@@ -2046,8 +2059,12 @@ runMain(defineCommand({
|
|
|
2046
2059
|
if (usesDatabaseContainer(database)) consola.log(" bun run db:up");
|
|
2047
2060
|
consola.log("");
|
|
2048
2061
|
consola.info("Add features:");
|
|
2049
|
-
if (
|
|
2050
|
-
|
|
2062
|
+
if (blueprint.apiOnly) consola.log(" bunx guren make:controller Post # then register its actions in routes/api.ts");
|
|
2063
|
+
else {
|
|
2064
|
+
if (!blueprint.includesAuth && !authInstalled) consola.log(" bunx guren add auth");
|
|
2065
|
+
const example = blueprint.resourceExample ?? DEFAULT_RESOURCE_EXAMPLE;
|
|
2066
|
+
consola.log(` bunx guren add resource ${example.name} --fields "${example.fields}"`);
|
|
2067
|
+
}
|
|
2051
2068
|
consola.log("");
|
|
2052
2069
|
consola.info("Generate types and set up database:");
|
|
2053
2070
|
consola.log(" bun run codegen");
|
|
@@ -2062,7 +2079,6 @@ runMain(defineCommand({
|
|
|
2062
2079
|
if (authInstalled) {
|
|
2063
2080
|
consola.log("");
|
|
2064
2081
|
consola.info("Auth scaffolding was included automatically.");
|
|
2065
|
-
consola.info("Set up the users table with: bun run db:make && bun run db:migrate && bun run db:seed");
|
|
2066
2082
|
}
|
|
2067
2083
|
if (renderingMode === "ssr") {
|
|
2068
2084
|
consola.log("");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-guren-app",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.3",
|
|
4
4
|
"description": "Scaffold a Guren app: a Bun-first fullstack TypeScript framework with Laravel-style conventions, Inertia.js + React, Drizzle ORM, and an agent harness for Claude Code and other coding agents.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"guren",
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"test": "bun test"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@guren/cli": "^2.
|
|
24
|
-
"@guren/core": "^1.
|
|
25
|
-
"@guren/orm": "^2.
|
|
23
|
+
"@guren/cli": "^2.28.0",
|
|
24
|
+
"@guren/core": "^1.22.0",
|
|
25
|
+
"@guren/orm": "^2.13.0",
|
|
26
26
|
"drizzle-orm": "1.0.0-rc.4"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@guren/testing": "^1.
|
|
29
|
+
"@guren/testing": "^1.14.1",
|
|
30
30
|
"bun-types": "^1.3.1",
|
|
31
31
|
"drizzle-kit": "1.0.0-rc.4",
|
|
32
32
|
"oxlint": "~1.81.0",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"db:seed": "bunx guren db:seed"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@guren/cli": "^2.
|
|
25
|
-
"@guren/core": "^1.
|
|
24
|
+
"@guren/cli": "^2.28.0",
|
|
25
|
+
"@guren/core": "^1.22.0",
|
|
26
26
|
"@guren/inertia-client": "^1.2.2",
|
|
27
|
-
"@guren/orm": "^2.
|
|
27
|
+
"@guren/orm": "^2.13.0",
|
|
28
28
|
"@inertiajs/react": "^3.6.1",
|
|
29
29
|
"drizzle-orm": "1.0.0-rc.4",
|
|
30
30
|
"react": "^19.0.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"zod": "^4.5.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@guren/testing": "^1.
|
|
35
|
+
"@guren/testing": "^1.14.1",
|
|
36
36
|
"@tailwindcss/vite": "^4.2.2",
|
|
37
37
|
"@types/react": "^19.0.0",
|
|
38
38
|
"@types/react-dom": "^19.0.0",
|