@lithia-js/cli 1.0.0-canary.18 → 1.0.0-canary.20

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
@@ -2,76 +2,32 @@
2
2
  <a href="https://github.com/lithia-framework/lithia">
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
- <h1>Lithia</h1>
6
- <p><strong>The high-performance Node.js framework powered by Rust.</strong></p>
5
+ <h1>@lithia-js/cli</h1>
6
+ <p><strong>The `lithia` command-line interface.</strong></p>
7
7
 
8
- <p>Build APIs with magic, speed, and Type Safety by default.</p>
8
+ <p>Development server, production build flow, and host orchestration for Lithia apps.</p>
9
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
+ <a href="https://www.npmjs.com/package/@lithia-js/cli"><img alt="NPM version" src="https://img.shields.io/npm/v/@lithia-js/cli.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/cli.svg?style=for-the-badge&labelColor=000000"></a>
12
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>
13
13
 
14
14
  </div>
15
15
 
16
- ## 🚀 Quick Start
16
+ ## Commands
17
17
 
18
- Build your first Lithia app in seconds:
18
+ ### `lithia dev`
19
19
 
20
- ```bash
21
- npx create-lithia@latest my-app
22
- cd my-app
23
- npm run dev
24
- ```
20
+ Starts the development server, watches source/config/env changes, rebuilds the
21
+ app, and swaps the app worker when reloads succeed.
25
22
 
26
- ## 🪄 Magic in Action
23
+ ### `lithia build`
27
24
 
28
- Lithia uses a clean, file-based routing convention. No boilerplate, just focus on your logic.
25
+ Builds the application into the configured `outDir`, generates manifests, and
26
+ prints the discovered routes, events, and async tasks.
29
27
 
30
- ```typescript
31
- // routes/hello/route.get.ts
32
- import type { RouteHandler } from "@lithia-js/core";
28
+ ## Notes
33
29
 
34
- const Hello: RouteHandler = async (req, res) => {
35
- const name = req.query.name || "World";
36
- return res.json({ message: `Hello, ${name}!` });
37
- }
38
-
39
- export default Hello;
40
- // Available at: GET /hello
41
- ```
42
-
43
- ## ✨ Features
44
-
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
51
-
52
- Everything you need to know is at [lithiajs.com/docs](https://lithiajs.com/docs).
53
-
54
- ---
55
-
56
- ## 🤝 Community & Support
57
-
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)
61
-
62
- ---
63
-
64
- ## License
65
-
66
- Lithia is [MIT licensed](https://www.google.com/search?q=LICENSE). Built with ❤️ by Lucas Arch and the community.
67
-
68
- ---
69
-
70
- <div align="center">
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>
30
+ - The CLI is designed around the worker-based Lithia runtime.
31
+ - It uses `@lithia-js/core/_` internally for host orchestration.
32
+ - Templates are scaffolded by `create-lithia`, while repo-local examples live
33
+ under `examples/`.
@@ -1,50 +1,25 @@
1
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
- */
2
+ import { CFG_GLOBAL_KEY, HostSupervisor } from '@lithia-js/core/_';
3
+
18
4
  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();
5
+ globalThis[CFG_GLOBAL_KEY] = __CONFIG__;
6
+ const lithia = new HostSupervisor({ environment: "production" });
7
+ await lithia.setup();
8
+ try {
9
+ await lithia.start();
10
+ } catch {
11
+ }
12
+ const shutdown = async () => {
23
13
  try {
24
- await lithia.start();
14
+ await lithia.stop();
15
+ } catch {
16
+ } finally {
17
+ process.exit(0);
25
18
  }
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);
19
+ };
20
+ process.once("SIGINT", shutdown);
21
+ process.once("SIGTERM", shutdown);
47
22
  }
48
- // Execute the bootstrap sequence and handle unhandled rejections
49
23
  await bootstrap().catch(() => process.exit(1));
24
+ //# sourceMappingURL=_entrypoint.mjs.map
50
25
  //# sourceMappingURL=_entrypoint.mjs.map
@@ -1 +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
+ {"version":3,"sources":["../src/_entrypoint.ts"],"names":[],"mappings":";;;AA8BA,eAAe,SAAA,GAA2B;AAEzC,EAAA,UAAA,CAAW,cAAc,CAAA,GAAI,UAAA;AAE7B,EAAA,MAAM,SAAS,IAAI,cAAA,CAAe,EAAE,WAAA,EAAa,cAAc,CAAA;AAE/D,EAAA,MAAM,OAAO,KAAA,EAAM;AAEnB,EAAA,IAAI;AACH,IAAA,MAAM,OAAO,KAAA,EAAM;AAAA,EACpB,CAAA,CAAA,MAAQ;AAAA,EAER;AAMA,EAAA,MAAM,WAAW,YAA2B;AAC3C,IAAA,IAAI;AACH,MAAA,MAAM,OAAO,IAAA,EAAK;AAAA,IACnB,CAAA,CAAA,MAAQ;AAAA,IAER,CAAA,SAAE;AACD,MAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,IACf;AAAA,EACD,CAAA;AAGA,EAAA,OAAA,CAAQ,IAAA,CAAK,UAAU,QAAQ,CAAA;AAC/B,EAAA,OAAA,CAAQ,IAAA,CAAK,WAAW,QAAQ,CAAA;AACjC;AAGA,MAAM,WAAU,CAAE,KAAA,CAAM,MAAM,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAC,CAAA","file":"_entrypoint.mjs","sourcesContent":["#! /usr/bin/env node\n/**\n * -----------------------------------------------------------------------------\n * LITHIA FRAMEWORK - PRODUCTION ENTRY POINT\n * -----------------------------------------------------------------------------\n * * WARNING: THIS IS A GENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n * * This file is automatically generated by the Lithia CLI during the build\n * process. Any manual modifications will be lost when the project is rebuilt.\n * * For configuration changes, please modify your 'lithia.config' file or\n * environment variables.\n * * @generated\n * -----------------------------------------------------------------------------\n */\n\nimport type { LithiaConfig } from \"@lithia-js/core\";\nimport { CFG_GLOBAL_KEY, HostSupervisor } from \"@lithia-js/core/_\";\n\ndeclare global {\n\tvar __lithia_host_config_v1: LithiaConfig;\n}\n\n/**\n * The __CONFIG__ constant is a placeholder injected during the build step.\n * It contains the resolved application configuration for production.\n */\ndeclare const __CONFIG__: LithiaConfig;\n\n/**\n * Bootstraps the production environment and manages the host lifecycle.\n */\nasync function bootstrap(): Promise<void> {\n\t// Initialize the global configuration context\n\tglobalThis[CFG_GLOBAL_KEY] = __CONFIG__;\n\n\tconst lithia = new HostSupervisor({ environment: \"production\" });\n\n\tawait lithia.setup();\n\n\ttry {\n\t\tawait lithia.start();\n\t} catch {\n\t\t// Initialization failure handled by the host internally\n\t}\n\n\t/**\n\t * Orchestrates a graceful shutdown by stopping the host\n\t * and releasing process resources.\n\t */\n\tconst shutdown = async (): Promise<void> => {\n\t\ttry {\n\t\t\tawait lithia.stop();\n\t\t} catch {\n\t\t\t// Ensure the process exits even if the stop sequence encounters an error\n\t\t} finally {\n\t\t\tprocess.exit(0);\n\t\t}\n\t};\n\n\t// Register process signal listeners for clean termination\n\tprocess.once(\"SIGINT\", shutdown);\n\tprocess.once(\"SIGTERM\", shutdown);\n}\n\n// Execute the bootstrap sequence and handle unhandled rejections\nawait bootstrap().catch(() => process.exit(1));\n"]}
package/dist/index.mjs CHANGED
@@ -1,18 +1,263 @@
1
1
  #! /usr/bin/env node
2
- import { defineCommand, runMain } from "citty";
3
- import build from "./cmd/build.mjs";
4
- import dev from "./cmd/dev.mjs";
5
- import { version } from "./meta.mjs";
6
- const main = defineCommand({
7
- meta: {
8
- name: "lithia",
9
- description: "Lithia CLI",
10
- version,
11
- },
12
- subCommands: {
13
- dev,
14
- build,
15
- },
2
+ import { defineCommand, runMain } from 'citty';
3
+ import { readFile, writeFile, chmod } from 'fs/promises';
4
+ import { join, resolve } from 'path';
5
+ import { HostSupervisor } from '@lithia-js/core/_';
6
+ import { logger } from '@lithia-js/utils';
7
+ import chokidar from 'chokidar';
8
+
9
+ var build = defineCommand({
10
+ meta: {
11
+ name: "build",
12
+ description: "Compile the project for production deployment"
13
+ },
14
+ /**
15
+ * Primary execution logic for the build command.
16
+ * @throws {Error} If build processes or file operations fail.
17
+ */
18
+ async run() {
19
+ const lithia = new HostSupervisor({ environment: "build" });
20
+ await lithia.setup();
21
+ logger.info("Initializing production build sequence...");
22
+ try {
23
+ await lithia.build();
24
+ } catch {
25
+ process.exit(1);
26
+ }
27
+ const { config } = lithia;
28
+ const workingDirectory = process.cwd();
29
+ const entryPath = join(workingDirectory, config.outDir, "server.js");
30
+ const templatePath = resolve(import.meta.dirname, "_entrypoint.mjs");
31
+ try {
32
+ const rawTemplate = await readFile(templatePath, "utf-8");
33
+ const processedContent = rawTemplate.replace(
34
+ "__CONFIG__",
35
+ JSON.stringify(config)
36
+ );
37
+ await writeFile(entryPath, processedContent, "utf-8");
38
+ await lithia.loadRoutes();
39
+ await lithia.loadEvents();
40
+ await lithia.loadTasks();
41
+ await chmod(entryPath, 493);
42
+ logger.success("Production build completed successfully.");
43
+ } catch (error) {
44
+ logger.error("Failed to finalize the build entry point.");
45
+ logger.debug(error);
46
+ }
47
+ lithia.printRouteTree();
48
+ lithia.printEventTree();
49
+ lithia.printTaskTree();
50
+ }
51
+ });
52
+ var build_default = build;
53
+
54
+ // src/cmd/dev-scheduler.ts
55
+ var DevLifecycleScheduler = class {
56
+ constructor(onBatch, debounceMs = 180, onError = () => {
57
+ }) {
58
+ this.onBatch = onBatch;
59
+ this.debounceMs = debounceMs;
60
+ this.onError = onError;
61
+ }
62
+ pending = {
63
+ source: false,
64
+ config: false,
65
+ env: false
66
+ };
67
+ timer = null;
68
+ running = false;
69
+ enqueue(kind) {
70
+ this.pending[kind] = true;
71
+ if (this.running) return;
72
+ if (this.timer) clearTimeout(this.timer);
73
+ this.timer = setTimeout(() => {
74
+ this.timer = null;
75
+ void this.flush();
76
+ }, this.debounceMs);
77
+ }
78
+ async flush() {
79
+ if (this.running) return;
80
+ this.running = true;
81
+ try {
82
+ while (this.hasPendingChanges()) {
83
+ await this.onBatch(this.consumePending());
84
+ }
85
+ } catch (error) {
86
+ this.onError(error);
87
+ } finally {
88
+ this.running = false;
89
+ if (this.hasPendingChanges() && !this.timer) {
90
+ this.timer = setTimeout(() => {
91
+ this.timer = null;
92
+ void this.flush();
93
+ }, this.debounceMs);
94
+ }
95
+ }
96
+ }
97
+ hasPendingChanges() {
98
+ return this.pending.source || this.pending.config || this.pending.env;
99
+ }
100
+ consumePending() {
101
+ const batch = { ...this.pending };
102
+ this.pending.source = false;
103
+ this.pending.config = false;
104
+ this.pending.env = false;
105
+ return batch;
106
+ }
107
+ };
108
+
109
+ // src/cmd/dev.ts
110
+ var dev = defineCommand({
111
+ meta: {
112
+ name: "dev",
113
+ description: "Start the development server with hot-reload capabilities"
114
+ },
115
+ async run() {
116
+ const cwd = process.cwd();
117
+ const lithia = new HostSupervisor({ environment: "development" });
118
+ await lithia.setup();
119
+ const initialBuildSucceeded = await lithia.build();
120
+ const lifecycleState = {
121
+ hasReloadableArtifacts: initialBuildSucceeded
122
+ };
123
+ if (initialBuildSucceeded) {
124
+ try {
125
+ await lithia.start();
126
+ } catch {
127
+ logger.error("Failed to start the development server.");
128
+ }
129
+ } else {
130
+ logger.warn(
131
+ "Initial build failed. Waiting for file changes while continuing to serve nothing."
132
+ );
133
+ }
134
+ const scheduler = new DevLifecycleScheduler(
135
+ async (batch) => {
136
+ await processDevBatch(lithia, batch, lifecycleState);
137
+ },
138
+ 180,
139
+ (error) => {
140
+ logger.error("Dev lifecycle failed:", error);
141
+ }
142
+ );
143
+ const srcWatcher = chokidar.watch(join(cwd, "src"), {
144
+ ignored: [/(^|[/\\])\../, "**/node_modules/**"],
145
+ persistent: true,
146
+ ignoreInitial: true
147
+ });
148
+ srcWatcher.on("all", (event) => {
149
+ if (["add", "change", "unlink"].includes(event)) {
150
+ scheduler.enqueue("source");
151
+ }
152
+ });
153
+ const extensions = [".js", ".mjs", ".ts", ".mts", ".json"];
154
+ const configFiles = [
155
+ ...lithia.config.envFiles,
156
+ ...extensions.map((ext) => join(cwd, `lithia.config${ext}`))
157
+ ];
158
+ const configWatcher = chokidar.watch(configFiles, {
159
+ cwd,
160
+ ignoreInitial: true
161
+ });
162
+ configWatcher.on("all", (event, filePath) => {
163
+ if (["change", "add"].includes(event)) {
164
+ if (filePath.includes("lithia.config")) {
165
+ scheduler.enqueue("config");
166
+ } else {
167
+ scheduler.enqueue("env");
168
+ }
169
+ }
170
+ });
171
+ const shutdown = async () => {
172
+ logger.info("Shutting down development server...");
173
+ await Promise.allSettled([
174
+ srcWatcher.close(),
175
+ configWatcher.close(),
176
+ lithia.stop()
177
+ ]);
178
+ process.exit(0);
179
+ };
180
+ process.once("SIGINT", shutdown);
181
+ process.once("SIGTERM", shutdown);
182
+ }
183
+ });
184
+ var dev_default = dev;
185
+ async function processDevBatch(lithia, batch, state) {
186
+ if (batch.config) {
187
+ logger.info("Configuration updated. Rebuilding and reloading host...");
188
+ const previousConfig = structuredClone(lithia.config);
189
+ const previousEnv = lithia.getEnvSnapshot();
190
+ try {
191
+ await lithia.loadConfig();
192
+ await lithia.loadEnv();
193
+ const buildSucceeded = await lithia.build();
194
+ if (!buildSucceeded) {
195
+ state.hasReloadableArtifacts = state.hasReloadableArtifacts || lithia.isAppReady;
196
+ lithia.replaceConfig(previousConfig);
197
+ lithia.replaceEnv(previousEnv);
198
+ logger.warn(
199
+ "Reload skipped due to build failure. Rolled back config/env and kept serving the previous app."
200
+ );
201
+ return;
202
+ }
203
+ await lithia.reload();
204
+ state.hasReloadableArtifacts = true;
205
+ logger.success("Reload complete.");
206
+ return;
207
+ } catch (error) {
208
+ lithia.replaceConfig(previousConfig);
209
+ lithia.replaceEnv(previousEnv);
210
+ throw error;
211
+ }
212
+ }
213
+ if (batch.source) {
214
+ logger.info("Source updated. Building host...");
215
+ const buildSucceeded = await lithia.build();
216
+ if (!buildSucceeded) {
217
+ state.hasReloadableArtifacts = state.hasReloadableArtifacts || lithia.isAppReady;
218
+ logger.warn(
219
+ "Reload skipped due to build failure. Continuing to serve previous app."
220
+ );
221
+ return;
222
+ }
223
+ state.hasReloadableArtifacts = true;
224
+ }
225
+ if (batch.env) {
226
+ if (!state.hasReloadableArtifacts) {
227
+ logger.warn(
228
+ "Reload skipped because the latest build artifacts are unavailable. Fix the build and save again."
229
+ );
230
+ return;
231
+ }
232
+ logger.info("Environment updated. Reloading host...");
233
+ await lithia.loadEnv();
234
+ }
235
+ if (batch.source || batch.env) {
236
+ await lithia.reload();
237
+ state.hasReloadableArtifacts = true;
238
+ logger.success("Reload complete.");
239
+ }
240
+ }
241
+
242
+ // package.json
243
+ var package_default = {
244
+ version: "1.0.0-canary.20"};
245
+
246
+ // src/meta.ts
247
+ var version = package_default.version;
248
+
249
+ // src/index.ts
250
+ var main = defineCommand({
251
+ meta: {
252
+ name: "lithia",
253
+ description: "Lithia CLI",
254
+ version
255
+ },
256
+ subCommands: {
257
+ dev: dev_default,
258
+ build: build_default
259
+ }
16
260
  });
17
261
  runMain(main).then();
262
+ //# sourceMappingURL=index.mjs.map
18
263
  //# sourceMappingURL=index.mjs.map
@@ -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,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"}
1
+ {"version":3,"sources":["../src/cmd/build.ts","../src/cmd/dev-scheduler.ts","../src/cmd/dev.ts","../package.json","../src/meta.ts","../src/index.ts"],"names":["defineCommand","HostSupervisor","logger","join"],"mappings":";;;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ACL,KAAA,CAAM,sBAAA,IAA0B,MAAA,CAAO,UAAA;AACxC,MAAAA,MAAAA,CAAO,IAAA;AAAA,QACN;AAAA,OACD;AACA,MAAA;AAAA,IACD;AAEA,IAAA,KAAA,CAAM,sBAAA,GAAyB,IAAA;AAAA,EAChC;AAEA,EAAA,IAAI,MAAM,GAAA,EAAK;AACd,IAAA,IAAI,CAAC,MAAM,sBAAA,EAAwB;AAClC,MAAAA,MAAAA,CAAO,IAAA;AAAA,QACN;AAAA,OACD;AACA,MAAA;AAAA,IACD;AACA,IAAAA,MAAAA,CAAO,KAAK,wCAAwC,CAAA;AACpD,IAAA,MAAM,OAAO,OAAA,EAAQ;AAAA,EACtB;AAEA,EAAA,IAAI,KAAA,CAAM,MAAA,IAAU,KAAA,CAAM,GAAA,EAAK;AAC9B,IAAA,MAAM,OAAO,MAAA,EAAO;AACpB,IAAA,KAAA,CAAM,sBAAA,GAAyB,IAAA;AAC/B,IAAAA,MAAAA,CAAO,QAAQ,kBAAkB,CAAA;AAAA,EAClC;AACD;;;ACjLA,IAAA,eAAA,GAAA;AAAA,EAEC,OAAA,EAAW,iBAkDZ,CAAA;;;ACnDO,IAAM,UAAU,eAAA,CAAM,OAAA;;;ACM7B,IAAM,OAAOF,aAAAA,CAAc;AAAA,EAC1B,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,QAAA;AAAA,IACN,WAAA,EAAa,YAAA;AAAA,IACb;AAAA,GACD;AAAA,EACA,WAAA,EAAa;AAAA,IACZ,GAAA,EAAA,WAAA;AAAA,IACA,KAAA,EAAA;AAAA;AAEF,CAAC,CAAA;AAED,OAAA,CAAQ,IAAI,EAAE,IAAA,EAAK","file":"index.mjs","sourcesContent":["/**\n * @fileoverview Build command implementation for the Lithia CLI.\n * Handles project compilation, entry point generation, and environment preparation.\n */\n\nimport { chmod, readFile, writeFile } from \"node:fs/promises\";\nimport { join, resolve } from \"node:path\";\nimport { HostSupervisor } from \"@lithia-js/core/_\";\nimport { logger } from \"@lithia-js/utils\";\nimport { defineCommand } from \"citty\";\n\n/**\n * The 'build' command compiles the application for production environments.\n * It initializes the Lithia host, generates the server entry point,\n * and configures file permissions.\n */\nconst build = defineCommand({\n\tmeta: {\n\t\tname: \"build\",\n\t\tdescription: \"Compile the project for production deployment\",\n\t},\n\n\t/**\n\t * Primary execution logic for the build command.\n\t * @throws {Error} If build processes or file operations fail.\n\t */\n\tasync run() {\n\t\tconst lithia = new HostSupervisor({ environment: \"build\" });\n\n\t\t// Initialize the host environment\n\t\tawait lithia.setup();\n\n\t\tlogger.info(\"Initializing production build sequence...\");\n\n\t\t// Trigger the core build process\n\t\ttry {\n\t\t\tawait lithia.build();\n\t\t} catch {\n\t\t\tprocess.exit(1);\n\t\t}\n\n\t\tconst { config } = lithia;\n\t\tconst workingDirectory = process.cwd();\n\n\t\t// Path resolution for entry point generation\n\t\tconst entryPath = join(workingDirectory, config.outDir, \"server.js\");\n\t\tconst templatePath = resolve(import.meta.dirname, \"_entrypoint.mjs\");\n\n\t\t// Generate production entry point by injecting runtime configuration\n\t\ttry {\n\t\t\tconst rawTemplate = await readFile(templatePath, \"utf-8\");\n\t\t\tconst processedContent = rawTemplate.replace(\n\t\t\t\t\"__CONFIG__\",\n\t\t\t\tJSON.stringify(config),\n\t\t\t);\n\n\t\t\tawait writeFile(entryPath, processedContent, \"utf-8\");\n\n\t\t\t// Post-write operations: Loading metadata and setting permissions\n\t\t\tawait lithia.loadRoutes();\n\t\t\tawait lithia.loadEvents();\n\t\t\tawait lithia.loadTasks();\n\n\t\t\t// Ensure the entry point is executable (0o755: rwxr-xr-x)\n\t\t\tawait chmod(entryPath, 0o755);\n\n\t\t\tlogger.success(\"Production build completed successfully.\");\n\t\t} catch (error) {\n\t\t\tlogger.error(\"Failed to finalize the build entry point.\");\n\t\t\tlogger.debug(error);\n\t\t\t// Silent catch maintained as per original implementation,\n\t\t\t// but logged for visibility.\n\t\t}\n\n\t\t// Output visual representation of the application structure\n\t\tlithia.printRouteTree();\n\t\tlithia.printEventTree();\n\t\tlithia.printTaskTree();\n\t},\n});\n\nexport default build;\n","export type DevChangeKind = \"source\" | \"config\" | \"env\";\n\nexport interface DevChangeBatch {\n\tsource: boolean;\n\tconfig: boolean;\n\tenv: boolean;\n}\n\nexport class DevLifecycleScheduler {\n\tprivate readonly pending: DevChangeBatch = {\n\t\tsource: false,\n\t\tconfig: false,\n\t\tenv: false,\n\t};\n\n\tprivate timer: NodeJS.Timeout | null = null;\n\tprivate running = false;\n\n\tconstructor(\n\t\tprivate readonly onBatch: (batch: DevChangeBatch) => Promise<void>,\n\t\tprivate readonly debounceMs: number = 180,\n\t\tprivate readonly onError: (error: unknown) => void = () => {},\n\t) {}\n\n\tpublic enqueue(kind: DevChangeKind): void {\n\t\tthis.pending[kind] = true;\n\t\tif (this.running) return;\n\n\t\tif (this.timer) clearTimeout(this.timer);\n\t\tthis.timer = setTimeout(() => {\n\t\t\tthis.timer = null;\n\t\t\tvoid this.flush();\n\t\t}, this.debounceMs);\n\t}\n\n\tprivate async flush(): Promise<void> {\n\t\tif (this.running) return;\n\t\tthis.running = true;\n\n\t\ttry {\n\t\t\twhile (this.hasPendingChanges()) {\n\t\t\t\tawait this.onBatch(this.consumePending());\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthis.onError(error);\n\t\t} finally {\n\t\t\tthis.running = false;\n\t\t\tif (this.hasPendingChanges() && !this.timer) {\n\t\t\t\tthis.timer = setTimeout(() => {\n\t\t\t\t\tthis.timer = null;\n\t\t\t\t\tvoid this.flush();\n\t\t\t\t}, this.debounceMs);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate hasPendingChanges(): boolean {\n\t\treturn this.pending.source || this.pending.config || this.pending.env;\n\t}\n\n\tprivate consumePending(): DevChangeBatch {\n\t\tconst batch = { ...this.pending };\n\t\tthis.pending.source = false;\n\t\tthis.pending.config = false;\n\t\tthis.pending.env = false;\n\t\treturn batch;\n\t}\n}\n","/**\n * @fileoverview Development command for the Lithia CLI.\n * Provides Hot Module Replacement (HMR) capabilities via file system watchers,\n * automatic configuration reloading, and environment synchronization.\n */\n\nimport { join } from \"node:path\";\nimport { HostSupervisor } from \"@lithia-js/core/_\";\nimport { logger } from \"@lithia-js/utils\";\nimport chokidar from \"chokidar\";\nimport { defineCommand } from \"citty\";\nimport { type DevChangeBatch, DevLifecycleScheduler } from \"./dev-scheduler\";\n\nconst dev = defineCommand({\n\tmeta: {\n\t\tname: \"dev\",\n\t\tdescription: \"Start the development server with hot-reload capabilities\",\n\t},\n\n\tasync run() {\n\t\tconst cwd = process.cwd();\n\t\tconst lithia = new HostSupervisor({ environment: \"development\" });\n\n\t\t// 1. Initial Host Setup\n\t\tawait lithia.setup();\n\t\tconst initialBuildSucceeded = await lithia.build();\n\t\tconst lifecycleState = {\n\t\t\thasReloadableArtifacts: initialBuildSucceeded,\n\t\t};\n\n\t\tif (initialBuildSucceeded) {\n\t\t\ttry {\n\t\t\t\tawait lithia.start();\n\t\t\t} catch {\n\t\t\t\tlogger.error(\"Failed to start the development server.\");\n\t\t\t}\n\t\t} else {\n\t\t\tlogger.warn(\n\t\t\t\t\"Initial build failed. Waiting for file changes while continuing to serve nothing.\",\n\t\t\t);\n\t\t}\n\n\t\t// 2. Define the serialized dev lifecycle\n\t\tconst scheduler = new DevLifecycleScheduler(\n\t\t\tasync (batch) => {\n\t\t\t\tawait processDevBatch(lithia, batch, lifecycleState);\n\t\t\t},\n\t\t\t180,\n\t\t\t(error) => {\n\t\t\t\tlogger.error(\"Dev lifecycle failed:\", error);\n\t\t\t},\n\t\t);\n\n\t\t// 3. Source Code Watcher\n\t\tconst srcWatcher = chokidar.watch(join(cwd, \"src\"), {\n\t\t\tignored: [/(^|[/\\\\])\\../, \"**/node_modules/**\"],\n\t\t\tpersistent: true,\n\t\t\tignoreInitial: true,\n\t\t});\n\n\t\tsrcWatcher.on(\"all\", (event) => {\n\t\t\tif ([\"add\", \"change\", \"unlink\"].includes(event)) {\n\t\t\t\tscheduler.enqueue(\"source\");\n\t\t\t}\n\t\t});\n\n\t\t// 4. Configuration and Environment Watcher\n\t\tconst extensions = [\".js\", \".mjs\", \".ts\", \".mts\", \".json\"];\n\t\tconst configFiles = [\n\t\t\t...lithia.config.envFiles,\n\t\t\t...extensions.map((ext) => join(cwd, `lithia.config${ext}`)),\n\t\t];\n\n\t\tconst configWatcher = chokidar.watch(configFiles, {\n\t\t\tcwd,\n\t\t\tignoreInitial: true,\n\t\t});\n\n\t\tconfigWatcher.on(\"all\", (event, filePath) => {\n\t\t\tif ([\"change\", \"add\"].includes(event)) {\n\t\t\t\tif (filePath.includes(\"lithia.config\")) {\n\t\t\t\t\tscheduler.enqueue(\"config\");\n\t\t\t\t} else {\n\t\t\t\t\tscheduler.enqueue(\"env\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// 5. Graceful Shutdown Orchestration\n\t\tconst shutdown = async () => {\n\t\t\tlogger.info(\"Shutting down development server...\");\n\t\t\tawait Promise.allSettled([\n\t\t\t\tsrcWatcher.close(),\n\t\t\t\tconfigWatcher.close(),\n\t\t\t\tlithia.stop(),\n\t\t\t]);\n\t\t\tprocess.exit(0);\n\t\t};\n\n\t\t// Correctly bind signal handlers to the shutdown sequence\n\t\tprocess.once(\"SIGINT\", shutdown);\n\t\tprocess.once(\"SIGTERM\", shutdown);\n\t},\n});\n\nexport default dev;\n\nexport async function processDevBatch(\n\tlithia: HostSupervisor,\n\tbatch: DevChangeBatch,\n\tstate: { hasReloadableArtifacts: boolean },\n): Promise<void> {\n\tif (batch.config) {\n\t\tlogger.info(\"Configuration updated. Rebuilding and reloading host...\");\n\n\t\tconst previousConfig = structuredClone(lithia.config);\n\t\tconst previousEnv = lithia.getEnvSnapshot();\n\n\t\ttry {\n\t\t\tawait lithia.loadConfig();\n\t\t\tawait lithia.loadEnv();\n\n\t\t\tconst buildSucceeded = await lithia.build();\n\t\t\tif (!buildSucceeded) {\n\t\t\t\tstate.hasReloadableArtifacts =\n\t\t\t\t\tstate.hasReloadableArtifacts || lithia.isAppReady;\n\t\t\t\tlithia.replaceConfig(previousConfig);\n\t\t\t\tlithia.replaceEnv(previousEnv);\n\t\t\t\tlogger.warn(\n\t\t\t\t\t\"Reload skipped due to build failure. Rolled back config/env and kept serving the previous app.\",\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tawait lithia.reload();\n\t\t\tstate.hasReloadableArtifacts = true;\n\t\t\tlogger.success(\"Reload complete.\");\n\t\t\treturn;\n\t\t} catch (error) {\n\t\t\tlithia.replaceConfig(previousConfig);\n\t\t\tlithia.replaceEnv(previousEnv);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tif (batch.source) {\n\t\tlogger.info(\"Source updated. Building host...\");\n\t\tconst buildSucceeded = await lithia.build();\n\n\t\tif (!buildSucceeded) {\n\t\t\tstate.hasReloadableArtifacts =\n\t\t\t\tstate.hasReloadableArtifacts || lithia.isAppReady;\n\t\t\tlogger.warn(\n\t\t\t\t\"Reload skipped due to build failure. Continuing to serve previous app.\",\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tstate.hasReloadableArtifacts = true;\n\t}\n\n\tif (batch.env) {\n\t\tif (!state.hasReloadableArtifacts) {\n\t\t\tlogger.warn(\n\t\t\t\t\"Reload skipped because the latest build artifacts are unavailable. Fix the build and save again.\",\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tlogger.info(\"Environment updated. Reloading host...\");\n\t\tawait lithia.loadEnv();\n\t}\n\n\tif (batch.source || batch.env) {\n\t\tawait lithia.reload();\n\t\tstate.hasReloadableArtifacts = true;\n\t\tlogger.success(\"Reload complete.\");\n\t}\n}\n","{\n\t\"name\": \"@lithia-js/cli\",\n\t\"version\": \"1.0.0-canary.20\",\n\t\"description\": \"Command-line interface for developing and building Lithia.js applications.\",\n\t\"keywords\": [\n\t\t\"lithia\",\n\t\t\"lithia-js\",\n\t\t\"cli\",\n\t\t\"framework\",\n\t\t\"backend\",\n\t\t\"create-app\",\n\t\t\"build-tool\",\n\t\t\"dev-server\"\n\t],\n\t\"author\": \"Lucas Arch <luketsx@icloud.com>\",\n\t\"license\": \"MIT\",\n\t\"homepage\": \"https://lithiajs.org\",\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"git+https://github.com/lithia-framework/lithia.git\",\n\t\t\"directory\": \"packages/cli\"\n\t},\n\t\"bugs\": {\n\t\t\"url\": \"https://github.com/lithia-framework/lithia/issues\"\n\t},\n\t\"type\": \"module\",\n\t\"bin\": {\n\t\t\"lithia\": \"./dist/index.mjs\"\n\t},\n\t\"main\": \"./dist/index.mjs\",\n\t\"files\": [\n\t\t\"dist\",\n\t\t\"templates\"\n\t],\n\t\"engines\": {\n\t\t\"node\": \">=20\"\n\t},\n\t\"scripts\": {\n\t\t\"build\": \"tsup --config tsup.config.ts\",\n\t\t\"test\": \"vitest --run\"\n\t},\n\t\"dependencies\": {\n\t\t\"@lithia-js/core\": \"workspace:1.0.0-canary.20\",\n\t\t\"@lithia-js/utils\": \"workspace:1.0.0-canary.20\",\n\t\t\"citty\": \"^0.2.0\",\n\t\t\"chokidar\": \"^5.0.0\"\n\t},\n\t\"publishConfig\": {\n\t\t\"registry\": \"https://registry.npmjs.org/\",\n\t\t\"access\": \"public\",\n\t\t\"provenance\": true\n\t}\n}\n","import pJson from \"../package.json\" with { type: \"json\" };\nexport const version = pJson.version;\n","#! /usr/bin/env node\n\nimport { defineCommand, runMain } from \"citty\";\nimport build from \"./cmd/build\";\nimport dev from \"./cmd/dev\";\nimport { version } from \"./meta\";\n\nconst main = defineCommand({\n\tmeta: {\n\t\tname: \"lithia\",\n\t\tdescription: \"Lithia CLI\",\n\t\tversion,\n\t},\n\tsubCommands: {\n\t\tdev,\n\t\tbuild,\n\t},\n});\n\nrunMain(main).then();\n"]}
package/package.json CHANGED
@@ -1,19 +1,20 @@
1
1
  {
2
2
  "name": "@lithia-js/cli",
3
- "version": "1.0.0-canary.18",
4
- "description": "Command line interface for the Lithia.js framework - The fast, native-powered backend engine.",
3
+ "version": "1.0.0-canary.20",
4
+ "description": "Command-line interface for developing and building Lithia.js applications.",
5
5
  "keywords": [
6
6
  "lithia",
7
7
  "lithia-js",
8
8
  "cli",
9
9
  "framework",
10
10
  "backend",
11
- "generator",
12
- "build-tool"
11
+ "create-app",
12
+ "build-tool",
13
+ "dev-server"
13
14
  ],
14
15
  "author": "Lucas Arch <luketsx@icloud.com>",
15
16
  "license": "MIT",
16
- "homepage": "https://lithiajs.com",
17
+ "homepage": "https://lithiajs.org",
17
18
  "repository": {
18
19
  "type": "git",
19
20
  "url": "git+https://github.com/lithia-framework/lithia.git",
@@ -35,10 +36,10 @@
35
36
  "node": ">=20"
36
37
  },
37
38
  "dependencies": {
39
+ "@lithia-js/core": "1.0.0-canary.20",
40
+ "@lithia-js/utils": "1.0.0-canary.20",
38
41
  "citty": "^0.2.0",
39
- "chokidar": "^5.0.0",
40
- "@lithia-js/core": "1.0.0-canary.18",
41
- "@lithia-js/utils": "1.0.0-canary.18"
42
+ "chokidar": "^5.0.0"
42
43
  },
43
44
  "publishConfig": {
44
45
  "registry": "https://registry.npmjs.org/",
@@ -46,6 +47,7 @@
46
47
  "provenance": true
47
48
  },
48
49
  "scripts": {
49
- "build": "tsc -p tsconfig.build.json"
50
+ "build": "tsup --config tsup.config.ts",
51
+ "test": "vitest --run"
50
52
  }
51
53
  }
@@ -1,66 +0,0 @@
1
- /**
2
- * @fileoverview Build command implementation for the Lithia CLI.
3
- * Handles project compilation, entry point generation, and environment preparation.
4
- */
5
- import { chmod, readFile, writeFile } from "node:fs/promises";
6
- import { join, resolve } from "node:path";
7
- import { LithiaHost } from "@lithia-js/core/_";
8
- import { logger } from "@lithia-js/utils";
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
- */
15
- const build = defineCommand({
16
- meta: {
17
- name: "build",
18
- description: "Compile the project for production deployment",
19
- },
20
- /**
21
- * Primary execution logic for the build command.
22
- * @throws {Error} If build processes or file operations fail.
23
- */
24
- async run() {
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
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)
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.
58
- }
59
- // Output visual representation of the application structure
60
- lithia.printRouteTree();
61
- lithia.printEventTree();
62
- lithia.printFunctionTree();
63
- },
64
- });
65
- export default build;
66
- //# sourceMappingURL=build.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build.mjs","sourceRoot":"","sources":["../../src/cmd/build.mts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAA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M,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 DELETED
@@ -1,111 +0,0 @@
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";
9
- import chokidar from "chokidar";
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
- };
32
- const dev = defineCommand({
33
- meta: {
34
- name: "dev",
35
- description: "Start the development server with hot-reload capabilities",
36
- },
37
- async run() {
38
- const cwd = process.cwd();
39
- const lithia = new LithiaHost({ environment: "development" });
40
- // 1. Initial Host Setup
41
- await lithia.setup();
42
- await lithia.build();
43
- try {
44
- await lithia.start();
45
- }
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/**"],
67
- persistent: true,
68
- ignoreInitial: true,
69
- });
70
- srcWatcher.on("all", (event) => {
71
- if (["add", "change", "unlink"].includes(event)) {
72
- performRebuild();
73
- }
74
- });
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,
83
- ignoreInitial: true,
84
- });
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
- }
93
- }
94
- });
95
- // 5. Graceful Shutdown Orchestration
96
- const shutdown = async () => {
97
- logger.info("Shutting down development server...");
98
- await Promise.allSettled([
99
- srcWatcher.close(),
100
- configWatcher.close(),
101
- lithia.stop(),
102
- ]);
103
- process.exit(0);
104
- };
105
- // Correctly bind signal handlers to the shutdown sequence
106
- process.once("SIGINT", shutdown);
107
- process.once("SIGTERM", shutdown);
108
- },
109
- });
110
- export default dev;
111
- //# sourceMappingURL=dev.mjs.map
@@ -1 +0,0 @@
1
- {"version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GAAG,CAAC"}
package/dist/meta.mjs DELETED
@@ -1,3 +0,0 @@
1
- import pJson from "../package.json" with { type: "json" };
2
- export const version = pJson.version;
3
- //# sourceMappingURL=meta.mjs.map
package/dist/meta.mjs.map DELETED
@@ -1 +0,0 @@
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"}