create-tilcayo-app 0.0.3 → 0.0.4

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/options.d.ts CHANGED
@@ -7,7 +7,7 @@ export interface StarterOptions {
7
7
  tenancy?: boolean;
8
8
  install: boolean;
9
9
  }
10
- export declare const help = "Usage: create-tilcayo-app [project-name] [options]\n\n --package-manager npm|pnpm|yarn\n --type api|minimal|react|fullstack\n --api / --fullstack Shortcuts for application type\n --auth / --no-auth Include backend auth or React auth pages and route guards\n --admin Add an admin shell (requires --auth and React/fullstack)\n --tenancy Subdomain workspaces (requires --fullstack --auth --admin)\n --no-install Generate files without installing dependencies\n --yes Use defaults for unanswered choices\n --help Show this help\n\nDefaults: my-api, npm, api, no authentication, install dependencies.\nInteractive terminals prompt for missing choices. Automation uses defaults.\nExisting directories are never overwritten.";
10
+ export declare const help = "Usage: create-tilcayo-app [project-name] [options]\n\n --package-manager npm|pnpm|yarn\n --type api|minimal|react|fullstack\n --api / --fullstack Shortcuts for application type\n --full-app Full stack, auth, admin and tenancy; no prompts, npm by default\n --auth / --no-auth Include backend auth or React auth pages and route guards\n --admin Add an admin shell (requires --auth and React/fullstack)\n --tenancy Subdomain workspaces (requires --fullstack --auth --admin)\n --no-install Generate files without installing dependencies\n --yes Use defaults for unanswered choices\n --help Show this help\n\nDefaults: my-api, npm, api, no authentication, install dependencies.\nInteractive terminals prompt for missing choices. Automation uses defaults.\nExisting directories are never overwritten.";
11
11
  export declare function validateOptions(options: StarterOptions): void;
12
12
  export declare function parseOptions(args: string[]): {
13
13
  options: StarterOptions;
package/dist/options.js CHANGED
@@ -3,6 +3,7 @@ export const help = `Usage: create-tilcayo-app [project-name] [options]
3
3
  --package-manager npm|pnpm|yarn
4
4
  --type api|minimal|react|fullstack
5
5
  --api / --fullstack Shortcuts for application type
6
+ --full-app Full stack, auth, admin and tenancy; no prompts, npm by default
6
7
  --auth / --no-auth Include backend auth or React auth pages and route guards
7
8
  --admin Add an admin shell (requires --auth and React/fullstack)
8
9
  --tenancy Subdomain workspaces (requires --fullstack --auth --admin)
@@ -37,6 +38,7 @@ export function parseOptions(args) {
37
38
  const missing = new Set(["name", "packageManager", "type", "auth"]);
38
39
  const seen = new Set();
39
40
  let yes = false;
41
+ let fullApp = false;
40
42
  for (let i = 0; i < args.length; i++) {
41
43
  const arg = args[i];
42
44
  if (!arg.startsWith("-")) {
@@ -50,6 +52,11 @@ export function parseOptions(args) {
50
52
  if (seen.has(key))
51
53
  throw new Error(`Duplicate or conflicting option: ${arg}`);
52
54
  seen.add(key);
55
+ if (arg === "--full-app") {
56
+ fullApp = true;
57
+ yes = true;
58
+ continue;
59
+ }
53
60
  if (arg === "--yes" || arg === "-y") {
54
61
  yes = true;
55
62
  continue;
@@ -92,6 +99,19 @@ export function parseOptions(args) {
92
99
  }
93
100
  throw new Error(`Unknown option: ${arg}. Run create-tilcayo-app --help.`);
94
101
  }
102
+ if (fullApp) {
103
+ if (seen.has("--type") && options.type !== "fullstack")
104
+ throw new Error("--full-app conflicts with the selected application type.");
105
+ if (seen.has("--auth") && !options.auth)
106
+ throw new Error("--full-app conflicts with --no-auth.");
107
+ options.type = "fullstack";
108
+ options.auth = true;
109
+ options.admin = true;
110
+ options.tenancy = true;
111
+ missing.delete("type");
112
+ missing.delete("auth");
113
+ missing.delete("packageManager");
114
+ }
95
115
  validateOptions(options);
96
116
  return { options, missing, yes };
97
117
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-tilcayo-app",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Create a complete Tilcayo API application",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",