create-gato-app 0.1.2 → 0.3.1

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.
@@ -0,0 +1,31 @@
1
+ import { connect, createServer } from "node:net";
2
+ const CONNECT_TIMEOUT_MS = 300;
3
+ function acceptsConnections(port) {
4
+ return new Promise((resolve) => {
5
+ const socket = connect({ port, host: "127.0.0.1" });
6
+ const finish = (busy) => {
7
+ socket.destroy();
8
+ resolve(busy);
9
+ };
10
+ socket.setTimeout(CONNECT_TIMEOUT_MS, () => finish(false));
11
+ socket.once("connect", () => finish(true));
12
+ socket.once("error", () => finish(false));
13
+ });
14
+ }
15
+ function refusesListening(port) {
16
+ return new Promise((resolve) => {
17
+ const server = createServer();
18
+ server.once("error", (error) => {
19
+ resolve(error.code === "EADDRINUSE");
20
+ });
21
+ server.once("listening", () => {
22
+ server.close(() => resolve(false));
23
+ });
24
+ server.listen(port, "0.0.0.0");
25
+ });
26
+ }
27
+ export async function isPortBusy(port) {
28
+ // WHY: Node listens with SO_REUSEADDR, so on macOS a wildcard bind can succeed next to a process
29
+ // already bound to 127.0.0.1; a connect probe catches that case, the listen probe catches the rest.
30
+ return (await acceptsConnections(port)) || (await refusesListening(port));
31
+ }
@@ -0,0 +1,286 @@
1
+ import { withRequired } from "./kit-modules.js";
2
+ import { adminEmailError, envValueError, parsePort, PORT_ERROR, titleError, } from "./validate.js";
3
+ export const LOCAL_MINIO_ENDPOINT = "http://localhost:9000";
4
+ export const LOCAL_MINIO_KEY = "minioadmin";
5
+ export const HTTP_URL_ERROR = "expected an http(s) URL";
6
+ export const LOCAL_MAILPIT_HOST = "127.0.0.1";
7
+ export const DEFAULT_SMTP_PORT = 587;
8
+ export class CancelledError extends Error {
9
+ name = "CancelledError";
10
+ }
11
+ const UPLOADS = "uploads";
12
+ const HTTP_URL = /^https?:\/\/\S+$/;
13
+ export function isHttpUrl(value) {
14
+ return HTTP_URL.test(value);
15
+ }
16
+ export function displayName(slug) {
17
+ return slug
18
+ .split("-")
19
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
20
+ .join(" ");
21
+ }
22
+ function orUndefined(message) {
23
+ return message ?? undefined;
24
+ }
25
+ async function askModules({ args, prompter, ask }, modules) {
26
+ if (args.modules !== null) {
27
+ return withRequired(args.modules, modules);
28
+ }
29
+ if (!ask || modules.length === 0) {
30
+ return [];
31
+ }
32
+ const chosen = await prompter.multiselect({
33
+ message: "Modules (space to toggle, enter to confirm)",
34
+ options: modules.map((module) => ({
35
+ value: module.name,
36
+ label: module.name,
37
+ hint: module.description,
38
+ })),
39
+ initialValues: [],
40
+ });
41
+ return withRequired(chosen, modules);
42
+ }
43
+ async function askLocales({ args, prompter, ask }) {
44
+ if (args.locales !== null) {
45
+ return args.locales;
46
+ }
47
+ if (!ask) {
48
+ return ["pl", "en"];
49
+ }
50
+ const english = await prompter.confirm({
51
+ message: "Add English? Polish is always included.",
52
+ initialValue: true,
53
+ });
54
+ return english ? ["pl", "en"] : ["pl"];
55
+ }
56
+ async function askTitle({ args, prompter, ask }, slug) {
57
+ if (args.title !== null) {
58
+ return args.title;
59
+ }
60
+ if (!ask) {
61
+ return displayName(slug);
62
+ }
63
+ const title = await prompter.text({
64
+ message: "Display name",
65
+ defaultValue: displayName(slug),
66
+ placeholder: displayName(slug),
67
+ validate: (value) => orUndefined(titleError(value)),
68
+ });
69
+ return title.trim() || displayName(slug);
70
+ }
71
+ async function askAdminEmail({ args, prompter, ask, }) {
72
+ if (args.adminEmail !== null) {
73
+ return args.adminEmail;
74
+ }
75
+ if (!ask) {
76
+ return null;
77
+ }
78
+ const email = (await prompter.text({
79
+ message: "First admin's email (empty to skip)",
80
+ defaultValue: "",
81
+ validate: (value) => value.trim() === ""
82
+ ? undefined
83
+ : orUndefined(adminEmailError(value.trim())),
84
+ })).trim();
85
+ return email === "" ? null : email;
86
+ }
87
+ async function askEndpoint({ args, prompter, ask }) {
88
+ if (args.s3Endpoint !== null) {
89
+ return args.s3Endpoint;
90
+ }
91
+ if (!ask) {
92
+ return LOCAL_MINIO_ENDPOINT;
93
+ }
94
+ const endpoint = await prompter.text({
95
+ message: `S3 endpoint (${LOCAL_MINIO_ENDPOINT} = local MinIO started with Docker)`,
96
+ defaultValue: LOCAL_MINIO_ENDPOINT,
97
+ placeholder: LOCAL_MINIO_ENDPOINT,
98
+ validate: (value) => value.trim() === "" || isHttpUrl(value.trim())
99
+ ? undefined
100
+ : `S3 endpoint: ${HTTP_URL_ERROR}`,
101
+ });
102
+ return endpoint.trim() || LOCAL_MINIO_ENDPOINT;
103
+ }
104
+ async function askS3(context) {
105
+ const { args, prompter } = context;
106
+ const endpoint = await askEndpoint(context);
107
+ const localMinio = endpoint === LOCAL_MINIO_ENDPOINT;
108
+ let accessKeyId = args.s3AccessKeyId;
109
+ let secretAccessKey = args.s3SecretAccessKey;
110
+ if (localMinio) {
111
+ accessKeyId ??= LOCAL_MINIO_KEY;
112
+ secretAccessKey ??= LOCAL_MINIO_KEY;
113
+ }
114
+ accessKeyId ??= await prompter.text({
115
+ message: "S3 access key id",
116
+ defaultValue: "",
117
+ validate: (value) => orUndefined(envValueError("S3 access key id", value)),
118
+ });
119
+ secretAccessKey ??= await prompter.password({
120
+ message: "S3 secret access key",
121
+ validate: (value) => orUndefined(envValueError("S3 secret access key", value)),
122
+ });
123
+ return { provider: "s3", endpoint, accessKeyId, secretAccessKey, localMinio };
124
+ }
125
+ async function askStorage(context, modules) {
126
+ if (!modules.includes(UPLOADS)) {
127
+ return null;
128
+ }
129
+ const { args, prompter, ask } = context;
130
+ let provider = args.storage;
131
+ if (provider === null) {
132
+ provider = ask
133
+ ? await prompter.select({
134
+ message: "File storage for uploads",
135
+ options: [
136
+ {
137
+ value: "local",
138
+ label: "local",
139
+ hint: "files on the server's disk",
140
+ },
141
+ {
142
+ value: "s3",
143
+ label: "s3",
144
+ hint: "S3-compatible storage: local MinIO, AWS, R2, …",
145
+ },
146
+ ],
147
+ initialValue: "local",
148
+ })
149
+ : "local";
150
+ }
151
+ return provider === "s3" ? askS3(context) : { provider: "local" };
152
+ }
153
+ function optionalEnvValue(label, value) {
154
+ return value.trim() === ""
155
+ ? undefined
156
+ : orUndefined(envValueError(label, value.trim()));
157
+ }
158
+ async function askMailProvider({ args, prompter, ask, }) {
159
+ if (args.mailProvider !== null) {
160
+ return args.mailProvider;
161
+ }
162
+ if (!ask) {
163
+ return "smtp";
164
+ }
165
+ return prompter.select({
166
+ message: "How should the app send mail?",
167
+ options: [
168
+ {
169
+ value: "smtp",
170
+ label: "smtp",
171
+ hint: "local mailpit in development, or your own relay",
172
+ },
173
+ { value: "resend", label: "resend", hint: "Resend API key" },
174
+ {
175
+ value: "console",
176
+ label: "console",
177
+ hint: "send nothing, log emails to the console",
178
+ },
179
+ ],
180
+ initialValue: "smtp",
181
+ });
182
+ }
183
+ async function askSmtpHost({ args, prompter, ask }) {
184
+ if (args.smtpHost !== null) {
185
+ return args.smtpHost;
186
+ }
187
+ if (!ask) {
188
+ return LOCAL_MAILPIT_HOST;
189
+ }
190
+ const host = await prompter.text({
191
+ message: `SMTP host (${LOCAL_MAILPIT_HOST} = local mailpit started with Docker)`,
192
+ defaultValue: LOCAL_MAILPIT_HOST,
193
+ placeholder: LOCAL_MAILPIT_HOST,
194
+ validate: (value) => optionalEnvValue("SMTP host", value),
195
+ });
196
+ return host.trim() || LOCAL_MAILPIT_HOST;
197
+ }
198
+ async function askSmtpPort({ args, prompter, ask }) {
199
+ if (args.smtpPort !== null) {
200
+ return args.smtpPort;
201
+ }
202
+ if (!ask) {
203
+ return DEFAULT_SMTP_PORT;
204
+ }
205
+ const port = await prompter.text({
206
+ message: "SMTP port",
207
+ defaultValue: String(DEFAULT_SMTP_PORT),
208
+ placeholder: String(DEFAULT_SMTP_PORT),
209
+ validate: (value) => value.trim() === "" || parsePort(value.trim()) !== null
210
+ ? undefined
211
+ : `SMTP port: ${PORT_ERROR}`,
212
+ });
213
+ return parsePort(port.trim()) ?? DEFAULT_SMTP_PORT;
214
+ }
215
+ async function askSmtpUser({ args, prompter, ask, }) {
216
+ if (args.smtpUser !== null) {
217
+ return args.smtpUser;
218
+ }
219
+ if (!ask) {
220
+ return null;
221
+ }
222
+ const user = (await prompter.text({
223
+ message: "SMTP user (empty = no authentication)",
224
+ defaultValue: "",
225
+ validate: (value) => optionalEnvValue("SMTP user", value),
226
+ })).trim();
227
+ return user === "" ? null : user;
228
+ }
229
+ async function askSmtp(context) {
230
+ const host = await askSmtpHost(context);
231
+ if (host === LOCAL_MAILPIT_HOST) {
232
+ return { provider: "smtp", localMailpit: true };
233
+ }
234
+ const port = await askSmtpPort(context);
235
+ const user = await askSmtpUser(context);
236
+ const pass = user === null
237
+ ? null
238
+ : (context.args.smtpPass ??
239
+ (await context.prompter.password({
240
+ message: "SMTP password",
241
+ validate: (value) => orUndefined(envValueError("SMTP password", value)),
242
+ })));
243
+ return { provider: "smtp", localMailpit: false, host, port, user, pass };
244
+ }
245
+ async function askMail(context) {
246
+ const provider = await askMailProvider(context);
247
+ if (provider === "console") {
248
+ return { provider: "console" };
249
+ }
250
+ if (provider === "smtp") {
251
+ return askSmtp(context);
252
+ }
253
+ const apiKey = context.args.resendApiKey ??
254
+ (await context.prompter.password({
255
+ message: "Resend API key",
256
+ validate: (value) => orUndefined(envValueError("Resend API key", value)),
257
+ }));
258
+ return { provider: "resend", apiKey };
259
+ }
260
+ async function askSetup({ args, prompter, ask }) {
261
+ if (!args.install || !args.docker) {
262
+ return false;
263
+ }
264
+ if (args.setup || !ask) {
265
+ return true;
266
+ }
267
+ return prompter.confirm({
268
+ message: "Start the database with Docker, run migrations and create the admin now?",
269
+ initialValue: true,
270
+ });
271
+ }
272
+ export async function collectAnswers(input) {
273
+ const context = {
274
+ args: input.args,
275
+ prompter: input.prompter,
276
+ ask: !input.args.yes,
277
+ };
278
+ const modules = await askModules(context, input.modules);
279
+ const locales = await askLocales(context);
280
+ const title = await askTitle(context, input.slug);
281
+ const adminEmail = await askAdminEmail(context);
282
+ const storage = await askStorage(context, modules);
283
+ const mail = await askMail(context);
284
+ const setup = await askSetup(context);
285
+ return { modules, locales, title, adminEmail, storage, mail, setup };
286
+ }
package/dist/ui.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,49 @@
1
+ export const TITLE_MAX_LENGTH = 60;
2
+ export const EMAIL_MAX_LENGTH = 254;
3
+ const TITLE_FORBIDDEN_CHARACTERS = new Set(['"', "\\", "<", ">", "$", "`"]);
4
+ const FIRST_PRINTABLE = 0x20;
5
+ const DELETE = 0x7f;
6
+ function hasForbiddenCharacter(title) {
7
+ return Array.from(title).some((character) => {
8
+ const code = character.charCodeAt(0);
9
+ return (code < FIRST_PRINTABLE ||
10
+ code === DELETE ||
11
+ TITLE_FORBIDDEN_CHARACTERS.has(character));
12
+ });
13
+ }
14
+ const EMAIL_PATTERN = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?(?:\.[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?)+$/;
15
+ const ENV_VALUE_FORBIDDEN = /[\s"'\\#$`]/;
16
+ export function titleError(title) {
17
+ const trimmed = title.trim();
18
+ if (trimmed.length === 0 ||
19
+ trimmed.length > TITLE_MAX_LENGTH ||
20
+ hasForbiddenCharacter(title)) {
21
+ return `Title: use 1-${TITLE_MAX_LENGTH} characters without quotes, backslashes, <, >, $, backticks or control characters`;
22
+ }
23
+ return null;
24
+ }
25
+ export function adminEmailError(email) {
26
+ if (email.length > EMAIL_MAX_LENGTH || !EMAIL_PATTERN.test(email)) {
27
+ return "Admin email: expected an address like admin@example.com";
28
+ }
29
+ return null;
30
+ }
31
+ export function envValueError(label, value) {
32
+ if (value === "") {
33
+ return `${label}: required`;
34
+ }
35
+ if (ENV_VALUE_FORBIDDEN.test(value)) {
36
+ return `${label}: no spaces, quotes, backslashes, #, $ or backticks`;
37
+ }
38
+ return null;
39
+ }
40
+ export const PORT_ERROR = "expected a port 1-65535";
41
+ const MAX_PORT = 65535;
42
+ const DIGITS = /^\d+$/;
43
+ export function parsePort(value) {
44
+ if (!DIGITS.test(value)) {
45
+ return null;
46
+ }
47
+ const port = Number(value);
48
+ return port >= 1 && port <= MAX_PORT ? port : null;
49
+ }
package/dist/wizard.js ADDED
@@ -0,0 +1,234 @@
1
+ import { chmod, readFile, writeFile } from "node:fs/promises";
2
+ import { basename, join } from "node:path";
3
+ import { busyPortsReport, portSettings, publishedPorts, suggestFreePort, } from "./compose-ports.js";
4
+ import { gatoCreateCommand } from "./delegate.js";
5
+ import { randomSuffix, setEnvValues, SUFFIX_LENGTH, wizardEnvValues, } from "./env-file.js";
6
+ import { readKitModules } from "./kit-modules.js";
7
+ import { displayDir, nextSteps } from "./next-steps.js";
8
+ import { collectAnswers } from "./questions.js";
9
+ const OUTPUT_TAIL_LINES = 40;
10
+ const ENV_LINE = /^([A-Za-z_][A-Za-z0-9_]*)=(.*)$/;
11
+ const S3_PROFILE = "s3";
12
+ function tail(result) {
13
+ const output = `${result.stderr}\n${result.stdout}`.trim();
14
+ return output.split("\n").slice(-OUTPUT_TAIL_LINES).join("\n");
15
+ }
16
+ async function runQuiet({ deps, projectDir }, command, args) {
17
+ try {
18
+ return await deps.spawn(command, args, { cwd: projectDir, stdio: "pipe" });
19
+ }
20
+ catch (error) {
21
+ const detail = error instanceof Error ? error.message : String(error);
22
+ return { code: 127, stdout: "", stderr: detail };
23
+ }
24
+ }
25
+ function envEntries(text) {
26
+ const entries = {};
27
+ for (const line of text.split(/\r?\n/)) {
28
+ const match = ENV_LINE.exec(line);
29
+ if (match) {
30
+ entries[match[1]] = match[2];
31
+ }
32
+ }
33
+ return entries;
34
+ }
35
+ async function assemble(context, args, kitDir, answers) {
36
+ const { deps, projectDir } = context;
37
+ const { command, args: commandArgs } = gatoCreateCommand({
38
+ nodePath: deps.nodePath,
39
+ gatoBin: deps.gatoBin,
40
+ kitDir,
41
+ projectDir,
42
+ answers,
43
+ cliSource: args.cliSource,
44
+ });
45
+ const result = await deps.ui.task("Assembling the project", () => deps.spawn(command, commandArgs, { cwd: deps.cwd, stdio: "pipe" }));
46
+ if (result.code !== 0) {
47
+ throw new Error(`Assembling the project failed (gato create exited with ${result.code}):\n${tail(result)}`);
48
+ }
49
+ }
50
+ async function writeWizardEnv(context, answers) {
51
+ const envPath = join(context.projectDir, ".env");
52
+ const existing = await readFile(envPath, "utf8");
53
+ const text = setEnvValues(existing, wizardEnvValues({
54
+ existing,
55
+ slug: basename(context.projectDir),
56
+ suffix: randomSuffix(context.deps.randomBytes(SUFFIX_LENGTH)),
57
+ storage: answers.storage,
58
+ mail: answers.mail,
59
+ }));
60
+ await writeFile(envPath, text, { mode: 0o600 });
61
+ await chmod(envPath, 0o600);
62
+ return text;
63
+ }
64
+ async function busyPorts(deps, ports) {
65
+ const busy = [];
66
+ for (const port of ports) {
67
+ if (await deps.isPortBusy(port.port)) {
68
+ busy.push(port);
69
+ }
70
+ }
71
+ return busy;
72
+ }
73
+ async function reportBusyPorts(deps, busy, ports, envText) {
74
+ const taken = ports.map((port) => port.port);
75
+ const free = new Map();
76
+ for (const { port } of busy) {
77
+ const suggestion = await suggestFreePort(port, deps.isPortBusy, taken);
78
+ free.set(port, suggestion);
79
+ if (suggestion !== null) {
80
+ taken.push(suggestion);
81
+ }
82
+ }
83
+ deps.error(busyPortsReport(busy, portSettings({ busy, free, envText })).join("\n"));
84
+ }
85
+ async function startDocker(context, envText, profiles) {
86
+ const { deps, projectDir } = context;
87
+ const compose = await readFile(join(projectDir, "docker-compose.yml"), "utf8");
88
+ const ports = publishedPorts(compose, {
89
+ profiles,
90
+ env: { ...envEntries(envText), ...deps.env },
91
+ });
92
+ const busy = await busyPorts(deps, ports);
93
+ if (busy.length > 0) {
94
+ await reportBusyPorts(deps, busy, ports, envText);
95
+ return false;
96
+ }
97
+ const info = await runQuiet(context, "docker", ["info"]);
98
+ if (info.code !== 0) {
99
+ deps.error("Docker is not available (docker info failed), so the database was not started. Start Docker and run the remaining steps below.");
100
+ return false;
101
+ }
102
+ const profileArgs = profiles.flatMap((profile) => ["--profile", profile]);
103
+ const up = await deps.ui.task("Starting Docker services", () => runQuiet(context, "docker", [
104
+ "compose",
105
+ ...profileArgs,
106
+ "up",
107
+ "-d",
108
+ "--wait",
109
+ ]));
110
+ if (up.code !== 0) {
111
+ deps.error(`docker compose up failed:\n${tail(up)}`);
112
+ return false;
113
+ }
114
+ return true;
115
+ }
116
+ async function install(context) {
117
+ const result = await context.deps.ui.task("Installing dependencies (npm install)", () => runQuiet(context, "npm", ["install"]));
118
+ if (result.code !== 0) {
119
+ context.deps.error(`npm install failed:\n${tail(result)}`);
120
+ return false;
121
+ }
122
+ return true;
123
+ }
124
+ async function migrate(context) {
125
+ const result = await context.deps.ui.task("Creating the database schema (prisma migrate dev)", () => runQuiet(context, "npx", ["prisma", "migrate", "dev", "--name", "init"]));
126
+ if (result.code !== 0) {
127
+ context.deps.error(`prisma migrate dev failed:\n${tail(result)}`);
128
+ return false;
129
+ }
130
+ return true;
131
+ }
132
+ async function createAdmin(context, email) {
133
+ const { deps, projectDir } = context;
134
+ deps.ui.step(`Creating the first admin (${email})`);
135
+ let code;
136
+ try {
137
+ code = (await deps.spawn("npm", ["run", "admin:create", "--", "--email", email], {
138
+ cwd: projectDir,
139
+ stdio: "inherit",
140
+ })).code;
141
+ }
142
+ catch (error) {
143
+ deps.error(`admin:create failed: ${error instanceof Error ? error.message : String(error)}`);
144
+ return false;
145
+ }
146
+ if (code !== 0) {
147
+ deps.error(`admin:create failed (exit ${code}).`);
148
+ return false;
149
+ }
150
+ return true;
151
+ }
152
+ async function commit(context, version) {
153
+ const add = await runQuiet(context, "git", ["add", "-A"]);
154
+ const result = add.code === 0
155
+ ? await runQuiet(context, "git", [
156
+ "commit",
157
+ "-q",
158
+ "--no-verify",
159
+ "-m",
160
+ `chore: initial commit from GatoJS v${version}`,
161
+ ])
162
+ : add;
163
+ if (result.code !== 0) {
164
+ context.deps.ui.warn(`Could not create the first commit (${tail(result) || `exit ${result.code}`}); configure git and commit by hand.`);
165
+ return false;
166
+ }
167
+ return true;
168
+ }
169
+ async function kitVersionOf(projectDir) {
170
+ const state = JSON.parse(await readFile(join(projectDir, ".wa/kit.json"), "utf8"));
171
+ return typeof state.kitVersion === "string" ? state.kitVersion : "unknown";
172
+ }
173
+ function profilesFor(answers) {
174
+ return answers.storage?.provider === "s3" && answers.storage.localMinio
175
+ ? [S3_PROFILE]
176
+ : [];
177
+ }
178
+ export async function runWizard(deps, args, kitDir, projectDir) {
179
+ const context = { deps, projectDir };
180
+ deps.ui.intro("create-gato-app");
181
+ const answers = await collectAnswers({
182
+ args,
183
+ slug: basename(projectDir),
184
+ modules: await readKitModules(kitDir),
185
+ prompter: deps.prompter,
186
+ });
187
+ await assemble(context, args, kitDir, answers);
188
+ const envText = await writeWizardEnv(context, answers);
189
+ const version = await kitVersionOf(projectDir);
190
+ const profiles = profilesFor(answers);
191
+ const outcome = {
192
+ dir: displayDir(deps.cwd, projectDir),
193
+ git: args.git,
194
+ installed: false,
195
+ committed: false,
196
+ dockerUp: false,
197
+ profiles,
198
+ migrated: false,
199
+ adminCreated: false,
200
+ adminEmail: answers.adminEmail,
201
+ };
202
+ let failed = false;
203
+ if (answers.setup) {
204
+ outcome.dockerUp = await startDocker(context, envText, profiles);
205
+ failed = !outcome.dockerUp;
206
+ }
207
+ if (args.git) {
208
+ const init = await runQuiet(context, "git", ["init", "-q"]);
209
+ if (init.code !== 0) {
210
+ deps.ui.warn(`git init failed (${tail(init)}); the project has no repository.`);
211
+ outcome.git = false;
212
+ }
213
+ }
214
+ if (args.install) {
215
+ outcome.installed = await install(context);
216
+ failed ||= !outcome.installed;
217
+ }
218
+ if (outcome.installed && outcome.dockerUp) {
219
+ outcome.migrated = await migrate(context);
220
+ failed ||= !outcome.migrated;
221
+ }
222
+ if (outcome.migrated && answers.adminEmail !== null) {
223
+ outcome.adminCreated = await createAdmin(context, answers.adminEmail);
224
+ failed ||= !outcome.adminCreated;
225
+ }
226
+ if (outcome.git && outcome.installed) {
227
+ outcome.committed = await commit(context, version);
228
+ }
229
+ deps.ui.note("Next steps", nextSteps(outcome));
230
+ deps.ui.outro(failed
231
+ ? `The project is in ${outcome.dir}, but some steps did not finish (see above).`
232
+ : `Done: ${answers.title} is ready in ${outcome.dir}.`);
233
+ return failed ? 1 : 0;
234
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-gato-app",
3
- "version": "0.1.2",
3
+ "version": "0.3.1",
4
4
  "description": "Create a GatoJS project (Next.js kit) with one command",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -48,20 +48,19 @@
48
48
  "test:smoke": "bash scripts/smoke-pack.sh"
49
49
  },
50
50
  "dependencies": {
51
- "gato-cli": "0.2.3"
51
+ "@clack/prompts": "^1.9.0",
52
+ "gato-cli": "0.4.0"
52
53
  },
53
54
  "devDependencies": {
54
- "@eslint/js": "^9.39.5",
55
55
  "@fast-check/vitest": "^0.5.0",
56
+ "@gatojs/eslint-config": "*",
56
57
  "@stryker-mutator/core": "^10.1.1",
57
58
  "@stryker-mutator/typescript-checker": "^10.1.1",
58
59
  "@stryker-mutator/vitest-runner": "^10.1.1",
59
60
  "@types/node": "^22",
60
61
  "eslint": "^9.39.5",
61
62
  "fast-check": "^4.10.3",
62
- "globals": "^17.14.0",
63
63
  "typescript": "^5",
64
- "typescript-eslint": "^8.73.0",
65
64
  "vitest": "^4.1.2"
66
65
  }
67
66
  }