create-lithia 1.0.0-canary.10

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/CHANGELOG.md ADDED
@@ -0,0 +1,47 @@
1
+ # create-lithia
2
+
3
+ ## 1.0.0-canary.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 9eed826: Added better-auth support
8
+
9
+ ## 1.0.0-canary.9
10
+
11
+ ### Patch Changes
12
+
13
+ - a0f6630: New templates and build fixes
14
+
15
+ ## 1.0.0-canary.8
16
+
17
+ ### Patch Changes
18
+
19
+ - 15de957: Changed the entire framework to use ESM modules
20
+
21
+ ## 1.0.0-canary.7
22
+
23
+ ### Patch Changes
24
+
25
+ - c5e06fb: Fixed exception when trying to build a JS file that haves an import wildcard
26
+
27
+ ## 1.0.0-canary.6
28
+
29
+ ### Patch Changes
30
+
31
+ - bb4cb1d: Added new template
32
+
33
+ ## 1.0.0-canary.5
34
+
35
+ ### Patch Changes
36
+
37
+ - e64696c: Remove unused imports from @lithia-js/utils and fixed `create-lithia` CLI
38
+
39
+ ## 1.0.0-canary.4
40
+
41
+ ### Patch Changes
42
+
43
+ - fb9cee1: Enhanced production build support, fixed import module bug on production environment, fixed stdio inherit bug on `create-lithia`
44
+ - 00d8f11: fixed available events after connection
45
+ - Updated dependencies [fb9cee1]
46
+ - Updated dependencies [00d8f11]
47
+ - @lithia-js/utils@1.0.0-canary.4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 lithiajs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.mjs ADDED
@@ -0,0 +1,262 @@
1
+ #! /usr/bin/env node
2
+ import { execSync } from "node:child_process";
3
+ import fs from "node:fs/promises";
4
+ import os from "node:os";
5
+ import path from "node:path";
6
+ import { defineCommand, runMain } from "citty";
7
+ import prompts from "prompts";
8
+ import { version } from "./meta.mjs";
9
+ import { green } from "./picocolors.mjs";
10
+ // ANSI colors for better logging (consistent with green from utils)
11
+ const red = (str) => `\x1b[31m${str}\x1b[0m`;
12
+ const yellow = (str) => `\x1b[33m${str}\x1b[0m`;
13
+ const blue = (str) => `\x1b[34m${str}\x1b[0m`;
14
+ // Pretty log helpers
15
+ const success = (msg) => console.log(green(`✔ ${msg}`));
16
+ const info = (msg) => console.log(blue(`ℹ ${msg}`));
17
+ const warnLog = (msg) => console.log(yellow(`⚠ ${msg}`));
18
+ const errorLog = (msg) => console.error(red(`✖ ${msg}`));
19
+ function isCommandAvailable(cmd) {
20
+ try {
21
+ execSync(`${cmd} --version`, { stdio: "ignore" });
22
+ return true;
23
+ }
24
+ catch {
25
+ return false;
26
+ }
27
+ }
28
+ async function withTmpDir(fn) {
29
+ const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "lithia-"));
30
+ try {
31
+ await fn(tmpDir);
32
+ }
33
+ finally {
34
+ await fs.rm(tmpDir, { recursive: true, force: true });
35
+ }
36
+ }
37
+ const main = defineCommand({
38
+ meta: {
39
+ name: "create-lithia",
40
+ description: "Create Lithia App CLI",
41
+ version,
42
+ },
43
+ async run(ctx) {
44
+ const repo = "https://github.com/lithia-framework/lithia.git";
45
+ const templates = [
46
+ "starter",
47
+ "with-docker",
48
+ "with-drizzle",
49
+ "with-better-auth",
50
+ ];
51
+ let projectName = ctx.rawArgs[0];
52
+ let template;
53
+ let installDependencies;
54
+ let packageManager;
55
+ let initializeGit;
56
+ if (!isCommandAvailable("git")) {
57
+ errorLog("git is required to run this CLI. Please install git and try again.");
58
+ process.exit(1);
59
+ }
60
+ if (!projectName) {
61
+ const response = await prompts({
62
+ type: "text",
63
+ name: "projectName",
64
+ message: `What is the ${green("name")} of your project?`,
65
+ initial: "my-lithia-app",
66
+ }, { onCancel: () => process.exit(1) });
67
+ projectName = response.projectName;
68
+ }
69
+ const templateResponse = await prompts({
70
+ type: "select",
71
+ name: "template",
72
+ message: `Select a ${green("template")}:`,
73
+ choices: templates.map((t) => ({ title: t, value: t })),
74
+ initial: 0,
75
+ }, { onCancel: () => process.exit(1) });
76
+ template = templateResponse.template;
77
+ const installResponse = await prompts({
78
+ type: "confirm",
79
+ name: "installDependencies",
80
+ message: `Do you want to ${green("install dependencies")}?`,
81
+ initial: true,
82
+ }, { onCancel: () => process.exit(1) });
83
+ installDependencies = installResponse.installDependencies;
84
+ if (installDependencies) {
85
+ const pmResponse = await prompts({
86
+ type: "select",
87
+ name: "packageManager",
88
+ message: `Select a ${green("package manager")}:`,
89
+ choices: [
90
+ {
91
+ title: "pnpm",
92
+ value: "pnpm",
93
+ disabled: !isCommandAvailable("pnpm"),
94
+ },
95
+ {
96
+ title: "npm",
97
+ value: "npm",
98
+ disabled: !isCommandAvailable("npm"),
99
+ },
100
+ {
101
+ title: "bun",
102
+ value: "bun",
103
+ disabled: !isCommandAvailable("bun"),
104
+ },
105
+ {
106
+ title: "yarn",
107
+ value: "yarn",
108
+ disabled: !isCommandAvailable("yarn"),
109
+ },
110
+ ],
111
+ }, { onCancel: () => process.exit(1) });
112
+ packageManager = pmResponse.packageManager;
113
+ }
114
+ const gitResponse = await prompts({
115
+ type: "confirm",
116
+ name: "initializeGit",
117
+ message: `Do you want to ${green("initialize a git repository")}?`,
118
+ initial: true,
119
+ }, { onCancel: () => process.exit(1) });
120
+ initializeGit = gitResponse.initializeGit;
121
+ const targetDir = path.join(process.cwd(), projectName);
122
+ const pmToUse = installDependencies && packageManager ? packageManager : "npm";
123
+ info(`Creating a new Lithia project in ${projectName}...`);
124
+ await withTmpDir(async (tmpDir) => {
125
+ if (!isCommandAvailable("git")) {
126
+ errorLog("git is required to clone the template repository. Please install git and try again.");
127
+ process.exit(1);
128
+ }
129
+ const repoDir = path.join(tmpDir, "repo");
130
+ info("Cloning template repository...");
131
+ try {
132
+ execSync(`git clone --depth 1 --branch canary ${repo} "${repoDir}"`, {
133
+ stdio: "ignore",
134
+ });
135
+ success("Template repository cloned.");
136
+ }
137
+ catch (err) {
138
+ errorLog(`Failed to clone repository: ${err}`);
139
+ process.exit(1);
140
+ }
141
+ const templateSrc = path.join(repoDir, "templates", template);
142
+ // ensure template exists
143
+ try {
144
+ await fs.access(templateSrc);
145
+ }
146
+ catch (_) {
147
+ errorLog(`Template ${template} not found in repository.`);
148
+ process.exit(1);
149
+ }
150
+ // if target exists, ask for confirmation
151
+ let targetExists = false;
152
+ try {
153
+ await fs.access(targetDir);
154
+ targetExists = true;
155
+ }
156
+ catch (_) {
157
+ // does not exist
158
+ }
159
+ if (targetExists) {
160
+ const confirmResponse = await prompts({
161
+ type: "confirm",
162
+ name: "overwrite",
163
+ message: `Target ${green(targetDir)} already exists. Overwrite?`,
164
+ initial: false,
165
+ }, { onCancel: () => process.exit(1) });
166
+ if (!confirmResponse.overwrite) {
167
+ throw new Error("Cannot create project: target directory already exists.");
168
+ }
169
+ }
170
+ // ensure target exists
171
+ await fs.mkdir(targetDir, { recursive: true });
172
+ // copy contents of the template directory into the target directory
173
+ info("Copying template files...");
174
+ const entries = await fs.readdir(templateSrc);
175
+ for (const name of entries) {
176
+ const srcPath = path.join(templateSrc, name);
177
+ const destPath = path.join(targetDir, name);
178
+ await fs.cp(srcPath, destPath, { recursive: true, force: true });
179
+ }
180
+ success("Template files copied.");
181
+ // Update package.json: set name and pin internal lithia packages to current meta version
182
+ const pkgJsonPath = path.join(targetDir, "package.json");
183
+ try {
184
+ const raw = await fs.readFile(pkgJsonPath, "utf-8");
185
+ const pkg = JSON.parse(raw);
186
+ pkg.name = projectName;
187
+ const pinDeps = (deps) => {
188
+ if (!deps)
189
+ return;
190
+ Object.keys(deps).forEach((dep) => {
191
+ if (dep.startsWith("@lithia-js/")) {
192
+ deps[dep] = `^${version}`;
193
+ }
194
+ });
195
+ };
196
+ pinDeps(pkg.dependencies);
197
+ pinDeps(pkg.devDependencies);
198
+ await fs.writeFile(pkgJsonPath, JSON.stringify(pkg, null, 2), "utf-8");
199
+ success(`package.json updated (name set + internal packages pinned to v${version}).`);
200
+ // initialize git if requested (git availability was validated earlier)
201
+ if (initializeGit) {
202
+ info("Initializing Git repository...");
203
+ try {
204
+ execSync("git init", { cwd: targetDir, stdio: "ignore" });
205
+ execSync("git add -A", { cwd: targetDir, stdio: "ignore" });
206
+ execSync('git commit -m "chore: initial commit"', {
207
+ cwd: targetDir,
208
+ stdio: "ignore",
209
+ });
210
+ success("Git repository initialized.");
211
+ }
212
+ catch (err) {
213
+ warnLog(`Failed to initialize git repository: ${err}`);
214
+ }
215
+ }
216
+ // install dependencies if requested
217
+ if (installDependencies) {
218
+ let cmd;
219
+ switch (pmToUse) {
220
+ case "pnpm":
221
+ cmd = "pnpm install";
222
+ break;
223
+ case "yarn":
224
+ cmd = "yarn install";
225
+ break;
226
+ case "bun":
227
+ cmd = "bun install";
228
+ break;
229
+ default:
230
+ cmd = "npm install";
231
+ }
232
+ info(`Installing dependencies with ${pmToUse}...`);
233
+ try {
234
+ execSync(cmd, { cwd: targetDir, stdio: "ignore" });
235
+ success("Dependencies installed.");
236
+ }
237
+ catch (err) {
238
+ warnLog(`Failed to install dependencies: ${err}`);
239
+ }
240
+ }
241
+ }
242
+ catch {
243
+ // package.json might not exist in template — that's fine
244
+ warnLog("No package.json found in template, skipping updates.");
245
+ }
246
+ success(`Project created at ${targetDir}!`);
247
+ // Next steps
248
+ console.log(green("\nNext steps:"));
249
+ console.log(` cd ${projectName}`);
250
+ if (installDependencies) {
251
+ console.log(` ${pmToUse} run dev`);
252
+ }
253
+ else {
254
+ console.log(` ${pmToUse} install`);
255
+ console.log(` ${pmToUse} run dev`);
256
+ }
257
+ console.log(green("\nHappy coding! 🚀"));
258
+ });
259
+ },
260
+ });
261
+ runMain(main).then();
262
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.mts"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,oEAAoE;AACpE,MAAM,GAAG,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,WAAW,GAAG,SAAS,CAAC;AACrD,MAAM,MAAM,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,WAAW,GAAG,SAAS,CAAC;AACxD,MAAM,IAAI,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,WAAW,GAAG,SAAS,CAAC;AAEtD,qBAAqB;AACrB,MAAM,OAAO,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,K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CAAC;gBACF,CAAC;YACF,CAAC;YAAC,MAAM,CAAC;gBACR,yDAAyD;gBACzD,OAAO,CAAC,sDAAsD,CAAC,CAAC;YACjE,CAAC;YAED,OAAO,CAAC,sBAAsB,SAAS,GAAG,CAAC,CAAC;YAE5C,aAAa;YACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;YACpC,OAAO,CAAC,GAAG,CAAC,QAAQ,WAAW,EAAE,CAAC,CAAC;YACnC,IAAI,mBAAmB,EAAE,CAAC;gBACzB,OAAO,CAAC,GAAG,CAAC,KAAK,OAAO,UAAU,CAAC,CAAC;YACrC,CAAC;iBAAM,CAAC;gBACP,OAAO,CAAC,GAAG,CAAC,KAAK,OAAO,UAAU,CAAC,CAAC;gBACpC,OAAO,CAAC,GAAG,CAAC,KAAK,OAAO,UAAU,CAAC,CAAC;YACrC,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;IACJ,CAAC;CACD,CAAC,CAAC;AAEH,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC"}
package/dist/meta.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import pJson from "../package.json" with { type: "json" };
2
+ export const version = pJson.version;
3
+ //# sourceMappingURL=meta.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.mjs","sourceRoot":"","sources":["../src/meta.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1D,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC"}
@@ -0,0 +1,64 @@
1
+ // ISC License
2
+ // Copyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov
3
+ // Permission to use, copy, modify, and/or distribute this software for any
4
+ // purpose with or without fee is hereby granted, provided that the above
5
+ // copyright notice and this permission notice appear in all copies.
6
+ // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
7
+ // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
8
+ // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
9
+ // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
10
+ // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
11
+ // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
12
+ // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
13
+ //
14
+ // https://github.com/alexeyraspopov/picocolors/blob/b6261487e7b81aaab2440e397a356732cad9e342/picocolors.js#L1
15
+ const { env, stdout } = globalThis?.process ?? {};
16
+ const enabled = env &&
17
+ !env.NO_COLOR &&
18
+ (env.FORCE_COLOR || (stdout?.isTTY && !env.CI && env.TERM !== "dumb"));
19
+ const replaceClose = (str, close, replace, index) => {
20
+ const start = str.substring(0, index) + replace;
21
+ const end = str.substring(index + close.length);
22
+ const nextIndex = end.indexOf(close);
23
+ return ~nextIndex
24
+ ? start + replaceClose(end, close, replace, nextIndex)
25
+ : start + end;
26
+ };
27
+ const formatter = (open, close, replace = open) => {
28
+ if (!enabled)
29
+ return String;
30
+ return (input) => {
31
+ const string = `${input}`;
32
+ const index = string.indexOf(close, open.length);
33
+ return ~index
34
+ ? open + replaceClose(string, close, replace, index) + close
35
+ : open + string + close;
36
+ };
37
+ };
38
+ export const reset = enabled ? (s) => `\x1b[0m${s}\x1b[0m` : String;
39
+ export const bold = formatter("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m");
40
+ export const dim = formatter("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m");
41
+ export const italic = formatter("\x1b[3m", "\x1b[23m");
42
+ export const underline = formatter("\x1b[4m", "\x1b[24m");
43
+ export const inverse = formatter("\x1b[7m", "\x1b[27m");
44
+ export const hidden = formatter("\x1b[8m", "\x1b[28m");
45
+ export const strikethrough = formatter("\x1b[9m", "\x1b[29m");
46
+ export const black = formatter("\x1b[30m", "\x1b[39m");
47
+ export const red = formatter("\x1b[31m", "\x1b[39m");
48
+ export const green = formatter("\x1b[32m", "\x1b[39m");
49
+ export const yellow = formatter("\x1b[33m", "\x1b[39m");
50
+ export const blue = formatter("\x1b[34m", "\x1b[39m");
51
+ export const magenta = formatter("\x1b[35m", "\x1b[39m");
52
+ export const purple = formatter("\x1b[38;2;173;127;168m", "\x1b[39m");
53
+ export const cyan = formatter("\x1b[36m", "\x1b[39m");
54
+ export const white = formatter("\x1b[37m", "\x1b[39m");
55
+ export const gray = formatter("\x1b[90m", "\x1b[39m");
56
+ export const bgBlack = formatter("\x1b[40m", "\x1b[49m");
57
+ export const bgRed = formatter("\x1b[41m", "\x1b[49m");
58
+ export const bgGreen = formatter("\x1b[42m", "\x1b[49m");
59
+ export const bgYellow = formatter("\x1b[43m", "\x1b[49m");
60
+ export const bgBlue = formatter("\x1b[44m", "\x1b[49m");
61
+ export const bgMagenta = formatter("\x1b[45m", "\x1b[49m");
62
+ export const bgCyan = formatter("\x1b[46m", "\x1b[49m");
63
+ export const bgWhite = formatter("\x1b[47m", "\x1b[49m");
64
+ //# sourceMappingURL=picocolors.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"picocolors.mjs","sourceRoot":"","sources":["../src/picocolors.mts"],"names":[],"mappings":"AAAA,cAAc;AAEd,wEAAwE;AAExE,2EAA2E;AAC3E,yEAAyE;AACzE,oEAAoE;AAEpE,2EAA2E;AAC3E,mEAAmE;AACnE,0EAA0E;AAC1E,yEAAyE;AACzE,wEAAwE;AACxE,0EAA0E;AAC1E,iEAAiE;AACjE,EAAE;AACF,8GAA8G;AAE9G,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,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M,MAAM,GAAG,SAAS,CAAC,wBAAwB,EAAE,UAAU,CAAC,CAAC;AACtE,MAAM,CAAC,MAAM,IAAI,GAAG,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AACtD,MAAM,CAAC,MAAM,KAAK,GAAG,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AACvD,MAAM,CAAC,MAAM,IAAI,GAAG,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AACtD,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AACzD,MAAM,CAAC,MAAM,KAAK,GAAG,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AACvD,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AACzD,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AAC1D,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AACxD,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AAC3D,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AACxD,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "create-lithia",
3
+ "version": "1.0.0-canary.10",
4
+ "private": false,
5
+ "type": "module",
6
+ "bin": {
7
+ "create-lithia": "dist/index.mts"
8
+ },
9
+ "author": "Lucas Arch <luketsx@icloud.com>",
10
+ "homepage": "https://lithiajs.com",
11
+ "license": "MIT",
12
+ "dependencies": {
13
+ "citty": "^0.2.0",
14
+ "prompts": "^2.4.2"
15
+ },
16
+ "engines": {
17
+ "node": ">=20"
18
+ },
19
+ "publishConfig": {
20
+ "registry": "https://registry.npmjs.org/",
21
+ "access": "public",
22
+ "provenance": true
23
+ },
24
+ "devDependencies": {
25
+ "@types/prompts": "^2.4.9"
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/lithia-framework/lithia.git"
30
+ },
31
+ "bugs": {
32
+ "url": "https://github.com/lithia-framework/lithia/issues"
33
+ },
34
+ "scripts": {
35
+ "build": "tsc -p tsconfig.build.json",
36
+ "cli": "tsx ./src/index.mts"
37
+ }
38
+ }