create-meridian-app 0.1.23 → 0.1.25

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.
Files changed (2) hide show
  1. package/dist/cli.js +8 -1
  2. package/package.json +6 -5
package/dist/cli.js CHANGED
@@ -25,6 +25,7 @@ import path2 from "path";
25
25
  import { existsSync as existsSync2 } from "fs";
26
26
  import chalk2 from "chalk";
27
27
  import { execa } from "execa";
28
+ import dotenv2 from "dotenv";
28
29
 
29
30
  // src/commands/serve-dashboard.ts
30
31
  import path from "path";
@@ -34,6 +35,7 @@ import os from "os";
34
35
  import { existsSync } from "fs";
35
36
  import * as esbuild from "esbuild";
36
37
  import chalk from "chalk";
38
+ import dotenv from "dotenv";
37
39
  var MIME_TYPES = {
38
40
  ".html": "text/html; charset=utf-8",
39
41
  ".js": "application/javascript",
@@ -174,6 +176,9 @@ function startDashboardServer(distDir, port, apiPort, apiHost = "localhost", adm
174
176
  }
175
177
  async function runServeDashboard(portOverride) {
176
178
  const rootDir = findProjectRoot();
179
+ if (rootDir) {
180
+ dotenv.config({ path: path.join(rootDir, ".env") });
181
+ }
177
182
  if (!rootDir) {
178
183
  console.error(chalk.red(" \u2716 Could not find meridian.config.ts. Are you inside a Meridian project?"));
179
184
  process.exit(1);
@@ -222,6 +227,7 @@ async function runDev() {
222
227
  console.error(chalk2.red(" \u2716 Could not find meridian.config.ts. Are you inside a Meridian project?"));
223
228
  process.exit(1);
224
229
  }
230
+ dotenv2.config({ path: path2.join(rootDir, ".env") });
225
231
  const mainTs = path2.join(rootDir, "src", "main.ts");
226
232
  if (!existsSync2(mainTs)) {
227
233
  console.error(chalk2.red(` \u2716 Entry point not found: ${mainTs}`));
@@ -230,9 +236,10 @@ async function runDev() {
230
236
  const dashboardDist = path2.join(rootDir, "node_modules", "@meridianjs", "admin-dashboard", "dist");
231
237
  const hasDashboard = existsSync2(dashboardDist);
232
238
  const { apiPort, dashboardPort } = await readProjectPorts(rootDir);
239
+ const apiUrl = process.env.API_URL ?? `http://localhost:${apiPort}`;
233
240
  let dashServer = null;
234
241
  if (hasDashboard) {
235
- dashServer = await startDashboardServer(dashboardDist, dashboardPort, apiPort);
242
+ dashServer = await startDashboardServer(dashboardDist, dashboardPort, apiPort, "localhost", null, apiUrl);
236
243
  console.log(
237
244
  chalk2.dim(" \u2192 API: ") + chalk2.cyan(`http://localhost:${apiPort}`) + chalk2.dim(" dashboard: ") + chalk2.cyan(`http://localhost:${dashboardPort}`)
238
245
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-meridian-app",
3
- "version": "0.1.23",
3
+ "version": "0.1.25",
4
4
  "description": "Create a new Meridian project or manage an existing one",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",
@@ -19,12 +19,13 @@
19
19
  "prepublishOnly": "npm run build"
20
20
  },
21
21
  "dependencies": {
22
- "commander": "^12.1.0",
23
- "ora": "^8.1.1",
24
22
  "chalk": "^5.3.0",
25
- "prompts": "^2.4.2",
23
+ "commander": "^12.1.0",
24
+ "dotenv": "17.3.1",
25
+ "esbuild": "^0.25.0",
26
26
  "execa": "^9.5.2",
27
- "esbuild": "^0.25.0"
27
+ "ora": "^8.1.1",
28
+ "prompts": "^2.4.2"
28
29
  },
29
30
  "devDependencies": {
30
31
  "@types/prompts": "^2.4.9",