@lithia-js/cli 1.0.0-canary.14 → 1.0.0-canary.16

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 CHANGED
@@ -3,58 +3,75 @@
3
3
  <img alt="Lithia logo" src="https://raw.githubusercontent.com/lithia-framework/lithia/canary/.github/assets/logo.svg" height="128">
4
4
  </a>
5
5
  <h1>Lithia</h1>
6
- <p><strong>The Node.js framework that makes API development feel like magic</strong></p>
6
+ <p><strong>The high-performance Node.js framework powered by Rust.</strong></p>
7
7
 
8
- <a href="https://www.npmjs.com/package/lithia"><img alt="NPM version" src="https://img.shields.io/npm/v/lithia.svg?style=for-the-badge&labelColor=000000"></a>
9
- <a href="https://github.com/lithia-framework/lithia/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/npm/l/lithia.svg?style=for-the-badge&labelColor=000000"></a>
8
+ <p>Build APIs with magic, speed, and Type Safety by default.</p>
9
+
10
+ <a href="https://www.npmjs.com/package/@lithia-js/core"><img alt="NPM version" src="https://img.shields.io/npm/v/@lithia-js/core.svg?style=for-the-badge&labelColor=000000"></a>
11
+ <a href="https://github.com/lithia-framework/lithia/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/npm/l/@lithia-js/core.svg?style=for-the-badge&labelColor=000000"></a>
10
12
  <a href="https://opencollective.com/lithiajs"><img alt="Support Lithia" src="https://img.shields.io/badge/Support%20Lithia-blueviolet.svg?style=for-the-badge&logo=OpenCollective&labelColor=000000&logoWidth=20"></a>
11
13
 
12
14
  </div>
13
15
 
14
- ## Getting Started
16
+ ## 🚀 Quick Start
15
17
 
16
- Lithia is a next-generation Node.js framework that enables you to build powerful APIs with file-based routing, built-in WebSocket support, and a beautiful development interface.
18
+ Build your first Lithia app in seconds:
17
19
 
18
- - Visit our [Learn Lithia](https://lithiajs.com/docs) guide to get started.
19
- - Check out the [Examples](https://github.com/lithia-framework/lithia/tree/main/examples) to see Lithia in action.
20
+ ```bash
21
+ npx create-lithia@latest my-app
22
+ cd my-app
23
+ npm run dev
24
+ ```
20
25
 
21
- ## Documentation
26
+ ## 🪄 Magic in Action
22
27
 
23
- Visit [https://lithiajs.com/docs](https://lithiajs.com/docs) to view the full documentation.
28
+ Lithia uses a clean, file-based routing convention. No boilerplate, just focus on your logic.
24
29
 
25
- ## Community
30
+ ```typescript
31
+ // routes/hello/route.get.ts
32
+ import type { RouteHandler } from "@lithia-js/core";
26
33
 
27
- The Lithia community can be found on [GitHub Discussions](https://github.com/lithia-framework/lithia/discussions) where you can ask questions, voice ideas, and share your projects with other people.
34
+ const Hello: RouteHandler = async (req, res) => {
35
+ const name = req.query.name || "World";
36
+ return res.json({ message: `Hello, ${name}!` });
37
+ }
28
38
 
29
- ## Contributing
39
+ export default Hello;
40
+ // Available at: GET /hello
41
+ ```
30
42
 
31
- Contributions to Lithia are welcome and highly appreciated. However, before you jump right into it, we would like you to review our [Contribution Guidelines](CONTRIBUTING.md) to make sure you have a smooth experience contributing to Lithia.
43
+ ## Features
32
44
 
33
- ---
45
+ * **Intuitive Routing**: Method-based file naming (`.get.ts`, `.post.ts`) for automatic route registration.
46
+ * **Native Performance**: Core engine written in Rust for lightning-fast request handling.
47
+ * **Full-stack Ready**: Native support for WebSockets, Auth, and Drizzle ORM.
48
+ * **Modern Stack**: Ships with Biome and TypeScript pre-configured for the best DX.
49
+
50
+ ## 📖 Documentation
34
51
 
35
- ## Support the Project
52
+ Everything you need to know is at [lithiajs.com/docs](https://lithiajs.com/docs).
36
53
 
37
- If Lithia makes your life easier, consider supporting it:
54
+ ---
55
+
56
+ ## 🤝 Community & Support
38
57
 
39
- - **Star** this repository
40
- - **Share** on social media
41
- - **Sponsor** via [OpenCollective](https://opencollective.com/lithiajs)
42
- - **Report bugs** and suggest improvements
58
+ * **Discussions**: [GitHub Discussions](https://github.com/lithia-framework/lithia/discussions)
59
+ * **Contribution**: We love PRs! See [CONTRIBUTING.md](https://www.google.com/search?q=CONTRIBUTING.md)
60
+ * **Sponsor**: Support the magic on [OpenCollective](https://opencollective.com/lithiajs)
43
61
 
44
62
  ---
45
63
 
46
64
  ## License
47
65
 
48
- Lithia is [MIT licensed](LICENSE). Free for personal and commercial use.
66
+ Lithia is [MIT licensed](https://www.google.com/search?q=LICENSE). Built with ❤️ by Lucas Arch and the community.
49
67
 
50
68
  ---
51
69
 
52
70
  <div align="center">
53
- <p><strong>Built with ❤️ by the Lithia community</strong></p>
54
- <p>
55
- <a href="https://github.com/lithia-framework/lithia">GitHub</a> •
56
- <a href="https://lithiajs.com">Documentation</a> •
57
- <a href="https://opencollective.com/lithiajs">OpenCollective</a>
58
- <a href="https://github.com/lithia-framework/lithia/discussions">Discussions</a>
59
- </p>
60
- </div>
71
+ <p>
72
+ <a href="https://github.com/lithia-framework/lithia">GitHub</a> •
73
+ <a href="https://lithiajs.com">Documentation</a> •
74
+ <a href="https://opencollective.com/lithiajs">OpenCollective</a> •
75
+ <a href="https://github.com/lithia-framework/lithia/discussions">Discussions</a>
76
+ </p>
77
+ </div>
@@ -0,0 +1,50 @@
1
+ #! /usr/bin/env node
2
+ /**
3
+ * -----------------------------------------------------------------------------
4
+ * LITHIA FRAMEWORK - PRODUCTION ENTRY POINT
5
+ * -----------------------------------------------------------------------------
6
+ * * WARNING: THIS IS A GENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
7
+ * * This file is automatically generated by the Lithia CLI during the build
8
+ * process. Any manual modifications will be lost when the project is rebuilt.
9
+ * * For configuration changes, please modify your 'lithia.config' file or
10
+ * environment variables.
11
+ * * @generated
12
+ * -----------------------------------------------------------------------------
13
+ */
14
+ import { CFG_GLOBAL_KEY, LithiaHost } from "@lithia-js/core/_";
15
+ /**
16
+ * Bootstraps the production environment and manages the host lifecycle.
17
+ */
18
+ async function bootstrap() {
19
+ // Initialize the global configuration context
20
+ globalThis[CFG_GLOBAL_KEY] = __CONFIG__;
21
+ const lithia = new LithiaHost({ environment: "production" });
22
+ await lithia.setup();
23
+ try {
24
+ await lithia.start();
25
+ }
26
+ catch {
27
+ // Initialization failure handled by the host internally
28
+ }
29
+ /**
30
+ * Orchestrates a graceful shutdown by stopping the host
31
+ * and releasing process resources.
32
+ */
33
+ const shutdown = async () => {
34
+ try {
35
+ await lithia.stop();
36
+ }
37
+ catch {
38
+ // Ensure the process exits even if the stop sequence encounters an error
39
+ }
40
+ finally {
41
+ process.exit(0);
42
+ }
43
+ };
44
+ // Register process signal listeners for clean termination
45
+ process.once("SIGINT", shutdown);
46
+ process.once("SIGTERM", shutdown);
47
+ }
48
+ // Execute the bootstrap sequence and handle unhandled rejections
49
+ await bootstrap().catch(() => process.exit(1));
50
+ //# sourceMappingURL=_entrypoint.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_entrypoint.mjs","sourceRoot":"","sources":["../src/_entrypoint.mts"],"names":[],"mappings":";AACA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAY/D;;GAEG;AACH,KAAK,UAAU,SAAS;IACvB,8CAA8C;IAC9C,UAAU,CAAC,cAAc,CAAC,GAAG,UAAU,CAAC;IAExC,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC,CAAC;IAE7D,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IAErB,IAAI,CAAC;QACJ,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;IAAC,MAAM,CAAC;QACR,wDAAwD;IACzD,CAAC;IAED;;;OAGG;IACH,MAAM,QAAQ,GAAG,KAAK,IAAmB,EAAE;QAC1C,IAAI,CAAC;YACJ,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QACrB,CAAC;QAAC,MAAM,CAAC;YACR,yEAAyE;QAC1E,CAAC;gBAAS,CAAC;YACV,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;IACF,CAAC,CAAC;IAEF,0DAA0D;IAC1D,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACjC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AACnC,CAAC;AAED,iEAAiE;AACjE,MAAM,SAAS,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC"}
@@ -1,33 +1,65 @@
1
+ /**
2
+ * @fileoverview Build command implementation for the Lithia CLI.
3
+ * Handles project compilation, entry point generation, and environment preparation.
4
+ */
1
5
  import { chmod, readFile, writeFile } from "node:fs/promises";
2
- import path from "node:path";
3
- import { Lithia } from "@lithia-js/core";
4
- import { loadConfig } from "@lithia-js/core/config";
6
+ import { join, resolve } from "node:path";
7
+ import { LithiaHost } from "@lithia-js/core/_";
5
8
  import { logger } from "@lithia-js/utils";
6
9
  import { defineCommand } from "citty";
10
+ /**
11
+ * The 'build' command compiles the application for production environments.
12
+ * It initializes the Lithia host, generates the server entry point,
13
+ * and configures file permissions.
14
+ */
7
15
  const build = defineCommand({
8
16
  meta: {
9
17
  name: "build",
10
- description: "Start the build process",
18
+ description: "Compile the project for production deployment",
11
19
  },
20
+ /**
21
+ * Primary execution logic for the build command.
22
+ * @throws {Error} If build processes or file operations fail.
23
+ */
12
24
  async run() {
13
- const lithia = Lithia.create({ environment: "build" });
14
- lithia.build();
15
- const cfgPath = path.join(lithia.outDir, "lithia.config.json");
16
- const entryPath = path.join(lithia.outDir, "lithia.mjs");
17
- const cfg = await loadConfig({
18
- environment: lithia.environment,
19
- outDir: lithia.outDir,
20
- });
21
- logger.debug("Loaded configuration from lithia.config");
22
- logger.debug("Preparing entrypoint file and configuration for build output");
23
- const content = await readFile(path.resolve(import.meta.dirname, "../entrypoint.mjs"), "utf-8");
24
- await writeFile(entryPath, content, "utf-8");
25
- await writeFile(cfgPath, JSON.stringify(cfg, null, 2), "utf-8");
26
- logger.debug("Entrypoint and configuration files written to output directory");
25
+ const lithia = new LithiaHost({ environment: "build" });
26
+ // Initialize the host environment
27
+ await lithia.setup();
28
+ logger.info("Initializing production build sequence...");
29
+ // Trigger the core build process
27
30
  try {
31
+ await lithia.build();
32
+ }
33
+ catch {
34
+ process.exit(1);
35
+ }
36
+ const { config } = lithia;
37
+ const workingDirectory = process.cwd();
38
+ // Path resolution for entry point generation
39
+ const entryPath = join(workingDirectory, config.outDir, "server.js");
40
+ const templatePath = resolve(import.meta.dirname, "..", "_entrypoint.mjs");
41
+ // Generate production entry point by injecting runtime configuration
42
+ try {
43
+ const rawTemplate = await readFile(templatePath, "utf-8");
44
+ const processedContent = rawTemplate.replace("__CONFIG__", JSON.stringify(config));
45
+ await writeFile(entryPath, processedContent, "utf-8");
46
+ // Post-write operations: Loading metadata and setting permissions
47
+ await lithia.loadRoutes();
48
+ await lithia.loadEvents();
49
+ await lithia.loadFunctions();
50
+ // Ensure the entry point is executable (0o755: rwxr-xr-x)
28
51
  await chmod(entryPath, 0o755);
52
+ logger.success("Production build completed successfully.");
53
+ }
54
+ catch {
55
+ logger.error("Failed to finalize the build entry point.");
56
+ // Silent catch maintained as per original implementation,
57
+ // but logged for visibility.
29
58
  }
30
- catch { }
59
+ // Output visual representation of the application structure
60
+ lithia.printRouteTree();
61
+ lithia.printEventTree();
62
+ lithia.printFunctionTree();
31
63
  },
32
64
  });
33
65
  export default build;
@@ -1 +1 @@
1
- {"version":3,"file":"build.mjs","sourceRoot":"","sources":["../../src/cmd/build.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,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,qEAAqE;QACrE,IAAI,CAAC;YACJ,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;YAC1D,MAAM,gBAAgB,GAAG,WAAW,CAAC,OAAO,CAC3C,YAAY,EACZ,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CACtB,CAAC;YAEF,MAAM,SAAS,CAAC,SAAS,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC;YAEtD,kEAAkE;YAClE,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;YAC1B,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;YACvB,MAAM,MAAM,CAAC,aAAa,EAAE,CAAC;YAEhC,0DAA0D;YAC1D,MAAM,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;YAE9B,MAAM,CAAC,OAAO,CAAC,0CAA0C,CAAC,CAAC;QAC5D,CAAC;QAAC,MAAM,CAAC;YACR,MAAM,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;YAC1D,0DAA0D;YAC1D,6BAA6B;QAC9B,CAAC;QAED,4DAA4D;QAC5D,MAAM,CAAC,cAAc,EAAE,CAAC;QACxB,MAAM,CAAC,cAAc,EAAE,CAAC;QACtB,MAAM,CAAC,iBAAiB,EAAE,CAAC;IAC9B,CAAC;CACD,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC"}
package/dist/cmd/dev.mjs CHANGED
@@ -1,73 +1,110 @@
1
- import path from "node:path";
2
- import { Lithia } from "@lithia-js/core";
1
+ /**
2
+ * @fileoverview Development command for the Lithia CLI.
3
+ * Provides Hot Module Replacement (HMR) capabilities via file system watchers,
4
+ * automatic configuration reloading, and environment synchronization.
5
+ */
6
+ import { join } from "node:path";
7
+ import { LithiaHost } from "@lithia-js/core/_";
8
+ import { logger } from "@lithia-js/utils";
3
9
  import chokidar from "chokidar";
4
10
  import { defineCommand } from "citty";
11
+ /**
12
+ * Creates a debounced version of an asynchronous function.
13
+ * * @template T - A function returning void or a Promise of void.
14
+ * @param {T} fn - The function to debounce.
15
+ * @param {number} [delay=180] - Delay in milliseconds.
16
+ * @returns {() => void} A debounced wrapper function.
17
+ */
18
+ const debounce = (fn, delay = 180) => {
19
+ let timer = null;
20
+ return () => {
21
+ if (timer)
22
+ clearTimeout(timer);
23
+ timer = setTimeout(() => {
24
+ timer = null;
25
+ const result = fn();
26
+ if (result instanceof Promise) {
27
+ result.catch(logger.error);
28
+ }
29
+ }, delay);
30
+ };
31
+ };
5
32
  const dev = defineCommand({
6
33
  meta: {
7
34
  name: "dev",
8
- description: "Start the development server",
35
+ description: "Start the development server with hot-reload capabilities",
9
36
  },
10
37
  async run() {
11
38
  const cwd = process.cwd();
12
- const lithia = Lithia.create({ environment: "development" });
13
- lithia.build();
39
+ const lithia = new LithiaHost({ environment: "development" });
40
+ // 1. Initial Host Setup
41
+ await lithia.setup();
42
+ await lithia.build();
14
43
  try {
15
44
  await lithia.start();
16
45
  }
17
- catch { }
18
- let timer = null;
19
- const debounce = (fn, ms = 150) => {
20
- if (timer)
21
- clearTimeout(timer);
22
- timer = setTimeout(() => {
23
- timer = null;
24
- fn();
25
- }, ms);
26
- };
27
- const watchPath = path.join(cwd, "src");
28
- const sourceWatcher = chokidar.watch(watchPath, {
29
- ignored: /(^|[/\\])\../,
46
+ catch {
47
+ logger.error("Failed to start the development server.");
48
+ }
49
+ // 2. Define Hot-Reload Actions
50
+ const performRebuild = debounce(async () => {
51
+ await lithia.build();
52
+ await lithia.reload();
53
+ });
54
+ const performConfigReload = debounce(async () => {
55
+ logger.info("Configuration updated. Refreshing host...");
56
+ await lithia.loadConfig();
57
+ await lithia.reload();
58
+ });
59
+ const performEnvReload = debounce(async () => {
60
+ logger.info("Environment variables updated. Refreshing host...");
61
+ await lithia.loadEnv();
62
+ await lithia.reload();
63
+ });
64
+ // 3. Source Code Watcher
65
+ const srcWatcher = chokidar.watch(join(cwd, "src"), {
66
+ ignored: [/(^|[/\\])\../, "**/node_modules/**"],
30
67
  persistent: true,
31
68
  ignoreInitial: true,
32
69
  });
33
- sourceWatcher.on("all", (event) => {
34
- if (event === "add" || event === "change" || event === "unlink") {
35
- debounce(() => {
36
- lithia.build();
37
- });
70
+ srcWatcher.on("all", (event) => {
71
+ if (["add", "change", "unlink"].includes(event)) {
72
+ performRebuild();
38
73
  }
39
74
  });
40
- const cfgWatcher = chokidar.watch([
41
- ".env",
42
- ".env.local",
43
- "lithia.config.mts",
44
- "lithia.config.mjs",
45
- "lithia.config.ts",
46
- "lithia.config.js",
47
- "lithia.config.json",
48
- ], {
49
- cwd: cwd,
75
+ // 4. Configuration and Environment Watcher
76
+ const extensions = [".js", ".mjs", ".ts", ".mts", ".json"];
77
+ const configFiles = [
78
+ ...lithia.config.envFiles,
79
+ ...extensions.map((ext) => join(cwd, `lithia.config${ext}`)),
80
+ ];
81
+ const configWatcher = chokidar.watch(configFiles, {
82
+ cwd,
50
83
  ignoreInitial: true,
51
84
  });
52
- cfgWatcher.on("all", async (event) => {
53
- if (event === "change" || event === "add") {
54
- await lithia.swapRuntime();
85
+ configWatcher.on("all", (event, filePath) => {
86
+ if (["change", "add"].includes(event)) {
87
+ if (filePath.includes("lithia.config")) {
88
+ performConfigReload();
89
+ }
90
+ else {
91
+ performEnvReload();
92
+ }
55
93
  }
56
94
  });
95
+ // 5. Graceful Shutdown Orchestration
57
96
  const shutdown = async () => {
58
- try {
59
- await sourceWatcher.close();
60
- await cfgWatcher.close();
61
- }
62
- catch (_) { }
63
- try {
64
- await lithia.stop();
65
- }
66
- catch (_) { }
97
+ logger.info("Shutting down development server...");
98
+ await Promise.allSettled([
99
+ srcWatcher.close(),
100
+ configWatcher.close(),
101
+ lithia.stop(),
102
+ ]);
67
103
  process.exit(0);
68
104
  };
69
- process.on("SIGINT", shutdown);
70
- process.on("SIGTERM", shutdown);
105
+ // Correctly bind signal handlers to the shutdown sequence
106
+ process.once("SIGINT", shutdown);
107
+ process.once("SIGTERM", shutdown);
71
108
  },
72
109
  });
73
110
  export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AAE,QAAQ,CAAC,CAAC;IACnC,CAAC;CACD,CAAC,CAAC;AAEH,eAAe,GAAG,CAAC"}
package/dist/index.mjs CHANGED
@@ -2,7 +2,6 @@
2
2
  import { defineCommand, runMain } from "citty";
3
3
  import build from "./cmd/build.mjs";
4
4
  import dev from "./cmd/dev.mjs";
5
- import start from "./cmd/start.mjs";
6
5
  import { version } from "./meta.mjs";
7
6
  const main = defineCommand({
8
7
  meta: {
@@ -13,7 +12,6 @@ const main = defineCommand({
13
12
  subCommands: {
14
13
  dev,
15
14
  build,
16
- start,
17
15
  },
18
16
  });
19
17
  runMain(main).then();
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.mts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,MAAM,IAAI,GAAG,aAAa,CAAC;IAC1B,IAAI,EAAE;QACL,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,YAAY;QACzB,OAAO;KACP;IACD,WAAW,EAAE;QACZ,GAAG;QACH,KAAK;QACL,KAAK;KACL;CACD,CAAC,CAAC;AAEH,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.mts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,MAAM,IAAI,GAAG,aAAa,CAAC;IAC1B,IAAI,EAAE;QACL,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,YAAY;QACzB,OAAO;KACP;IACD,WAAW,EAAE;QACZ,GAAG;QACH,KAAK;KACL;CACD,CAAC,CAAC;AAEH,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,35 +1,50 @@
1
1
  {
2
2
  "name": "@lithia-js/cli",
3
- "version": "1.0.0-canary.14",
4
- "private": false,
3
+ "version": "1.0.0-canary.16",
4
+ "description": "Command line interface for the Lithia.js framework - The fast, native-powered backend engine.",
5
+ "keywords": [
6
+ "lithia",
7
+ "lithia-js",
8
+ "cli",
9
+ "framework",
10
+ "backend",
11
+ "generator",
12
+ "build-tool"
13
+ ],
14
+ "author": "Lucas Arch <luketsx@icloud.com>",
15
+ "license": "MIT",
16
+ "homepage": "https://lithiajs.com",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/lithia-framework/lithia.git",
20
+ "directory": "packages/cli"
21
+ },
22
+ "bugs": {
23
+ "url": "https://github.com/lithia-framework/lithia/issues"
24
+ },
5
25
  "type": "module",
6
26
  "bin": {
7
- "lithia": "dist/index.mjs"
27
+ "lithia": "./dist/index.mjs"
28
+ },
29
+ "main": "./dist/index.mjs",
30
+ "files": [
31
+ "dist",
32
+ "templates"
33
+ ],
34
+ "engines": {
35
+ "node": ">=20"
8
36
  },
9
- "author": "Lucas Arch <luketsx@icloud.com>",
10
- "homepage": "https://lithiajs.com",
11
- "license": "MIT",
12
37
  "dependencies": {
13
38
  "citty": "^0.2.0",
14
39
  "chokidar": "^5.0.0",
15
- "@lithia-js/core": "1.0.0-canary.14",
16
- "@lithia-js/utils": "1.0.0-canary.14"
17
- },
18
- "engines": {
19
- "node": ">=20"
40
+ "@lithia-js/core": "1.0.0-canary.16",
41
+ "@lithia-js/utils": "1.0.0-canary.16"
20
42
  },
21
43
  "publishConfig": {
22
44
  "registry": "https://registry.npmjs.org/",
23
45
  "access": "public",
24
46
  "provenance": true
25
47
  },
26
- "repository": {
27
- "type": "git",
28
- "url": "git+https://github.com/lithia-framework/lithia.git"
29
- },
30
- "bugs": {
31
- "url": "https://github.com/lithia-framework/lithia/issues"
32
- },
33
48
  "scripts": {
34
49
  "build": "tsc -p tsconfig.build.json"
35
50
  }
package/CHANGELOG.md DELETED
@@ -1,141 +0,0 @@
1
- # @lithia-js/cli
2
-
3
- ## 1.0.0-canary.14
4
-
5
- ### Patch Changes
6
-
7
- - cb28ad8: Fixed CORS error
8
- - Updated dependencies [cb28ad8]
9
- - @lithia-js/core@1.0.0-canary.14
10
- - @lithia-js/utils@1.0.0-canary.14
11
-
12
- ## 1.0.0-canary.13
13
-
14
- ### Patch Changes
15
-
16
- - 2a65f2a: Fixed missing await from authenticated middleware
17
- - Updated dependencies [2a65f2a]
18
- - @lithia-js/core@1.0.0-canary.13
19
- - @lithia-js/utils@1.0.0-canary.13
20
-
21
- ## 1.0.0-canary.12
22
-
23
- ### Patch Changes
24
-
25
- - 059a95a: Fixed middleware `next` function call
26
- - Updated dependencies [059a95a]
27
- - @lithia-js/core@1.0.0-canary.12
28
- - @lithia-js/utils@1.0.0-canary.12
29
-
30
- ## 1.0.0-canary.11
31
-
32
- ### Patch Changes
33
-
34
- - 01467e0: Fixed index from `create-lithia` CLI
35
- - Updated dependencies [01467e0]
36
- - @lithia-js/core@1.0.0-canary.11
37
- - @lithia-js/utils@1.0.0-canary.11
38
-
39
- ## 1.0.0-canary.10
40
-
41
- ### Patch Changes
42
-
43
- - 9eed826: Added better-auth support
44
- - Updated dependencies [9eed826]
45
- - @lithia-js/utils@1.0.0-canary.10
46
- - @lithia-js/core@1.0.0-canary.10
47
-
48
- ## 1.0.0-canary.9
49
-
50
- ### Patch Changes
51
-
52
- - a0f6630: New templates and build fixes
53
- - Updated dependencies [a0f6630]
54
- - @lithia-js/core@1.0.0-canary.9
55
- - @lithia-js/utils@1.0.0-canary.9
56
-
57
- ## 1.0.0-canary.8
58
-
59
- ### Patch Changes
60
-
61
- - 15de957: Changed the entire framework to use ESM modules
62
- - Updated dependencies [15de957]
63
- - @lithia-js/core@1.0.0-canary.8
64
- - @lithia-js/utils@1.0.0-canary.8
65
-
66
- ## 1.0.0-canary.7
67
-
68
- ### Patch Changes
69
-
70
- - c5e06fb: Fixed exception when trying to build a JS file that haves an import wildcard
71
- - Updated dependencies [c5e06fb]
72
- - @lithia-js/core@1.0.0-canary.7
73
- - @lithia-js/utils@1.0.0-canary.7
74
-
75
- ## 1.0.0-canary.6
76
-
77
- ### Patch Changes
78
-
79
- - bb4cb1d: Added new template
80
- - Updated dependencies [bb4cb1d]
81
- - @lithia-js/core@1.0.0-canary.6
82
- - @lithia-js/utils@1.0.0-canary.6
83
-
84
- ## 1.0.0-canary.5
85
-
86
- ### Patch Changes
87
-
88
- - e64696c: Remove unused imports from @lithia-js/utils and fixed `create-lithia` CLI
89
- - Updated dependencies [e64696c]
90
- - @lithia-js/utils@1.0.0-canary.5
91
- - @lithia-js/core@1.0.0-canary.5
92
-
93
- ## 1.0.0-canary.4
94
-
95
- ### Patch Changes
96
-
97
- - fb9cee1: Enhanced production build support, fixed import module bug on production environment, fixed stdio inherit bug on `create-lithia`
98
- - 00d8f11: fixed available events after connection
99
- - Updated dependencies [fb9cee1]
100
- - Updated dependencies [00d8f11]
101
- - @lithia-js/core@1.0.0-canary.4
102
- - @lithia-js/utils@1.0.0-canary.4
103
-
104
- ## 1.0.0-canary.3
105
-
106
- ### Patch Changes
107
-
108
- - d536a2f: Fixed exports from @lithia-js/native
109
- - Updated dependencies [d536a2f]
110
- - @lithia-js/core@1.0.0-canary.3
111
- - @lithia-js/utils@1.0.0-canary.3
112
-
113
- ## 1.0.0-canary.2
114
-
115
- ### Patch Changes
116
-
117
- - .npmignore update
118
- - Updated dependencies
119
- - @lithia-js/core@1.0.0-canary.2
120
- - @lithia-js/utils@1.0.0-canary.2
121
-
122
- ## 1.0.0-canary.1
123
-
124
- ### Patch Changes
125
-
126
- - 2992e91: Manifest update for workflow compatibility
127
- - Updated dependencies [2992e91]
128
- - @lithia-js/utils@1.0.0-canary.1
129
- - @lithia-js/core@1.0.0-canary.1
130
-
131
- ## 1.0.0-canary.0
132
-
133
- ### Major Changes
134
-
135
- - e9a0904: Lithia v1 canary release. Now with separated modules and napi bindings for build performance
136
-
137
- ### Patch Changes
138
-
139
- - Updated dependencies [e9a0904]
140
- - @lithia-js/core@1.0.0-canary.0
141
- - @lithia-js/utils@1.0.0-canary.0
@@ -1,30 +0,0 @@
1
- import { Lithia } from "@lithia-js/core";
2
- import { defineCommand } from "citty";
3
- const start = defineCommand({
4
- meta: {
5
- name: "start",
6
- description: "Start the production server",
7
- },
8
- async run() {
9
- const lithia = Lithia.create({
10
- environment: "production",
11
- });
12
- try {
13
- await lithia.start();
14
- }
15
- catch {
16
- // let Lithia's emitter handle the error
17
- }
18
- const shutdown = async () => {
19
- try {
20
- await lithia.stop();
21
- }
22
- catch { }
23
- process.exit(0);
24
- };
25
- process.on("SIGINT", shutdown);
26
- process.on("SIGTERM", shutdown);
27
- },
28
- });
29
- export default start;
30
- //# sourceMappingURL=start.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"start.mjs","sourceRoot":"","sources":["../../src/cmd/start.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,KAAK,GAAG,aAAa,CAAC;IAC3B,IAAI,EAAE;QACL,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,6BAA6B;KAC1C;IACD,KAAK,CAAC,GAAG;QACR,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;YAC5B,WAAW,EAAE,YAAY;SACzB,CAAC,CAAC;QAEH,IAAI,CAAC;YACJ,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACtB,CAAC;QAAC,MAAM,CAAC;YACR,wCAAwC;QACzC,CAAC;QAED,MAAM,QAAQ,GAAG,KAAK,IAAI,EAAE;YAC3B,IAAI,CAAC;gBACJ,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;YACV,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC,CAAC;QAEF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC/B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACjC,CAAC;CACD,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC"}
@@ -1,20 +0,0 @@
1
- #! /usr/bin/env node
2
- import { Lithia } from "@lithia-js/core";
3
- async function main() {
4
- const lithia = Lithia.create({ environment: "production" });
5
- try {
6
- await lithia.start();
7
- }
8
- catch { }
9
- const shutdown = async () => {
10
- try {
11
- await lithia.stop();
12
- }
13
- catch { }
14
- process.exit(0);
15
- };
16
- process.on("SIGINT", shutdown);
17
- process.on("SIGTERM", shutdown);
18
- }
19
- main().then();
20
- //# sourceMappingURL=entrypoint.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"entrypoint.mjs","sourceRoot":"","sources":["../src/entrypoint.mts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,KAAK,UAAU,IAAI;IAClB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC,CAAC;IAE5D,IAAI,CAAC;QACJ,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IAEV,MAAM,QAAQ,GAAG,KAAK,IAAI,EAAE;QAC3B,IAAI,CAAC;YACJ,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QACrB,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;QACV,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,CAAC;IAEF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AACjC,CAAC;AAED,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC"}