@geekmidas/cli 0.0.16 → 0.0.17

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.
@@ -1,5 +1,5 @@
1
- import { loadConfig } from "./config-DV1Lwdkx.mjs";
2
- import { loadEndpoints } from "./loadEndpoints-DKaw6Eqm.mjs";
1
+ import { loadConfig } from "./config-BciAdY6_.mjs";
2
+ import { loadEndpoints } from "./loadEndpoints-DAZ53Og2.mjs";
3
3
  import { mkdir, writeFile } from "node:fs/promises";
4
4
  import { dirname, join, relative } from "path";
5
5
 
@@ -1,6 +1,6 @@
1
1
  const require_chunk = require('./chunk-CUT6urMc.cjs');
2
- const require_config = require('./config-D8AyiwBU.cjs');
3
- const require_loadEndpoints = require('./loadEndpoints-Dh-dSqZX.cjs');
2
+ const require_config = require('./config-BNqUMsvc.cjs');
3
+ const require_loadEndpoints = require('./loadEndpoints-BBIavB9h.cjs');
4
4
  const node_fs_promises = require_chunk.__toESM(require("node:fs/promises"));
5
5
  const path = require_chunk.__toESM(require("path"));
6
6
 
package/dist/build.cjs CHANGED
@@ -1,5 +1,5 @@
1
- require('./config-D8AyiwBU.cjs');
2
- require('./loadEndpoints-Dh-dSqZX.cjs');
3
- const require_build = require('./build-CTKUZTHx.cjs');
1
+ require('./config-BNqUMsvc.cjs');
2
+ require('./loadEndpoints-BBIavB9h.cjs');
3
+ const require_build = require('./build-HWB991oI.cjs');
4
4
 
5
5
  exports.buildCommand = require_build.buildCommand;
package/dist/build.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import "./config-DV1Lwdkx.mjs";
2
- import "./loadEndpoints-DKaw6Eqm.mjs";
3
- import { buildCommand } from "./build-DgeiXkH-.mjs";
1
+ import "./config-BciAdY6_.mjs";
2
+ import "./loadEndpoints-DAZ53Og2.mjs";
3
+ import { buildCommand } from "./build-DqTE4qtW.mjs";
4
4
 
5
5
  export { buildCommand };
@@ -1,16 +1,17 @@
1
1
  const require_chunk = require('./chunk-CUT6urMc.cjs');
2
2
  const path = require_chunk.__toESM(require("path"));
3
3
  const fs = require_chunk.__toESM(require("fs"));
4
+ const fs_promises = require_chunk.__toESM(require("fs/promises"));
4
5
 
5
6
  //#region src/config.ts
6
7
  async function loadConfig() {
7
8
  const configPath = (0, path.join)(process.cwd(), "gkm.config.json");
8
9
  if (!(0, fs.existsSync)(configPath)) throw new Error("gkm.config.json not found. Please create a configuration file.");
9
10
  try {
10
- const config = await import(configPath);
11
- return config.default || config;
11
+ const config = await (0, fs_promises.readFile)(configPath, "utf-8");
12
+ return JSON.parse(config);
12
13
  } catch (error) {
13
- throw new Error(`Failed to load gkm.config.ts: ${error.message}`);
14
+ throw new Error(`Failed to load gkm.config.json: ${error.message}`);
14
15
  }
15
16
  }
16
17
 
@@ -1,15 +1,16 @@
1
1
  import { join } from "path";
2
2
  import { existsSync } from "fs";
3
+ import { readFile } from "fs/promises";
3
4
 
4
5
  //#region src/config.ts
5
6
  async function loadConfig() {
6
7
  const configPath = join(process.cwd(), "gkm.config.json");
7
8
  if (!existsSync(configPath)) throw new Error("gkm.config.json not found. Please create a configuration file.");
8
9
  try {
9
- const config = await import(configPath);
10
- return config.default || config;
10
+ const config = await readFile(configPath, "utf-8");
11
+ return JSON.parse(config);
11
12
  } catch (error) {
12
- throw new Error(`Failed to load gkm.config.ts: ${error.message}`);
13
+ throw new Error(`Failed to load gkm.config.json: ${error.message}`);
13
14
  }
14
15
  }
15
16
 
package/dist/config.cjs CHANGED
@@ -1,3 +1,3 @@
1
- const require_config = require('./config-D8AyiwBU.cjs');
1
+ const require_config = require('./config-BNqUMsvc.cjs');
2
2
 
3
3
  exports.loadConfig = require_config.loadConfig;
package/dist/config.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { loadConfig } from "./config-DV1Lwdkx.mjs";
1
+ import { loadConfig } from "./config-BciAdY6_.mjs";
2
2
 
3
3
  export { loadConfig };
package/dist/index.cjs CHANGED
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env -S npx tsx
2
2
  const require_chunk = require('./chunk-CUT6urMc.cjs');
3
- require('./config-D8AyiwBU.cjs');
4
- require('./loadEndpoints-Dh-dSqZX.cjs');
5
- const require_build = require('./build-CTKUZTHx.cjs');
3
+ require('./config-BNqUMsvc.cjs');
4
+ require('./loadEndpoints-BBIavB9h.cjs');
5
+ const require_build = require('./build-HWB991oI.cjs');
6
6
  const require_openapi_react_query = require('./openapi-react-query-C1JLYUOs.cjs');
7
- const require_openapi = require('./openapi-DrPYAlJ_.cjs');
7
+ const require_openapi = require('./openapi-D4QQJUPY.cjs');
8
8
  const commander = require_chunk.__toESM(require("commander"));
9
9
 
10
10
  //#region package.json
11
11
  var name = "@geekmidas/cli";
12
- var version = "0.0.15";
12
+ var version = "0.0.17";
13
13
  var private$1 = false;
14
14
  var type = "module";
15
15
  var bin = { "gkm": "./dist/index.cjs" };
package/dist/index.mjs CHANGED
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env -S npx tsx
2
- import "./config-DV1Lwdkx.mjs";
3
- import "./loadEndpoints-DKaw6Eqm.mjs";
4
- import { buildCommand } from "./build-DgeiXkH-.mjs";
2
+ import "./config-BciAdY6_.mjs";
3
+ import "./loadEndpoints-DAZ53Og2.mjs";
4
+ import { buildCommand } from "./build-DqTE4qtW.mjs";
5
5
  import { generateReactQueryCommand } from "./openapi-react-query-DpT3XHFC.mjs";
6
- import { openapiCommand } from "./openapi-DgLItZw-.mjs";
6
+ import { openapiCommand } from "./openapi-CksVdkh2.mjs";
7
7
  import { Command } from "commander";
8
8
 
9
9
  //#region package.json
10
10
  var name = "@geekmidas/cli";
11
- var version = "0.0.15";
11
+ var version = "0.0.17";
12
12
  var private$1 = false;
13
13
  var type = "module";
14
14
  var bin = { "gkm": "./dist/index.cjs" };
@@ -23,6 +23,7 @@ async function loadEndpoints(routes) {
23
23
  }
24
24
  } catch (error) {
25
25
  logger.warn(`Failed to load ${f}:`, error.message);
26
+ throw new Error("Failed to load endpoints. Please check the logs for details.");
26
27
  }
27
28
  return endpoints;
28
29
  }
@@ -22,6 +22,7 @@ async function loadEndpoints(routes) {
22
22
  }
23
23
  } catch (error) {
24
24
  logger.warn(`Failed to load ${f}:`, error.message);
25
+ throw new Error("Failed to load endpoints. Please check the logs for details.");
25
26
  }
26
27
  return endpoints;
27
28
  }
@@ -1,3 +1,3 @@
1
- const require_loadEndpoints = require('./loadEndpoints-Dh-dSqZX.cjs');
1
+ const require_loadEndpoints = require('./loadEndpoints-BBIavB9h.cjs');
2
2
 
3
3
  exports.loadEndpoints = require_loadEndpoints.loadEndpoints;
@@ -1,3 +1,3 @@
1
- import { loadEndpoints } from "./loadEndpoints-DKaw6Eqm.mjs";
1
+ import { loadEndpoints } from "./loadEndpoints-DAZ53Og2.mjs";
2
2
 
3
3
  export { loadEndpoints };
@@ -1,5 +1,5 @@
1
- import { loadConfig } from "./config-DV1Lwdkx.mjs";
2
- import { loadEndpoints } from "./loadEndpoints-DKaw6Eqm.mjs";
1
+ import { loadConfig } from "./config-BciAdY6_.mjs";
2
+ import { loadEndpoints } from "./loadEndpoints-DAZ53Og2.mjs";
3
3
  import { mkdir, writeFile } from "node:fs/promises";
4
4
  import { Endpoint } from "@geekmidas/api/server";
5
5
  import { join } from "node:path";
@@ -1,6 +1,6 @@
1
1
  const require_chunk = require('./chunk-CUT6urMc.cjs');
2
- const require_config = require('./config-D8AyiwBU.cjs');
3
- const require_loadEndpoints = require('./loadEndpoints-Dh-dSqZX.cjs');
2
+ const require_config = require('./config-BNqUMsvc.cjs');
3
+ const require_loadEndpoints = require('./loadEndpoints-BBIavB9h.cjs');
4
4
  const node_fs_promises = require_chunk.__toESM(require("node:fs/promises"));
5
5
  const __geekmidas_api_server = require_chunk.__toESM(require("@geekmidas/api/server"));
6
6
  const node_path = require_chunk.__toESM(require("node:path"));
package/dist/openapi.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env -S npx tsx
2
- require('./config-D8AyiwBU.cjs');
3
- require('./loadEndpoints-Dh-dSqZX.cjs');
4
- const require_openapi = require('./openapi-DrPYAlJ_.cjs');
2
+ require('./config-BNqUMsvc.cjs');
3
+ require('./loadEndpoints-BBIavB9h.cjs');
4
+ const require_openapi = require('./openapi-D4QQJUPY.cjs');
5
5
 
6
6
  exports.openapiCommand = require_openapi.openapiCommand;
package/dist/openapi.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env -S npx tsx
2
- import "./config-DV1Lwdkx.mjs";
3
- import "./loadEndpoints-DKaw6Eqm.mjs";
4
- import { openapiCommand } from "./openapi-DgLItZw-.mjs";
2
+ import "./config-BciAdY6_.mjs";
3
+ import "./loadEndpoints-DAZ53Og2.mjs";
4
+ import { openapiCommand } from "./openapi-CksVdkh2.mjs";
5
5
 
6
6
  export { openapiCommand };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekmidas/cli",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {
package/src/config.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { existsSync } from 'fs';
2
2
  import { join } from 'path';
3
- import type { GkmConfig } from './types.js';
3
+ import { readFile } from 'fs/promises';
4
+ import type { GkmConfig } from './types.ts';
4
5
 
5
6
  export async function loadConfig(): Promise<GkmConfig> {
6
7
  const configPath = join(process.cwd(), 'gkm.config.json');
@@ -12,11 +13,11 @@ export async function loadConfig(): Promise<GkmConfig> {
12
13
  }
13
14
 
14
15
  try {
15
- const config = await import(configPath);
16
- return config.default || config;
16
+ const config = await readFile(configPath, 'utf-8');
17
+ return JSON.parse(config);
17
18
  } catch (error) {
18
19
  throw new Error(
19
- `Failed to load gkm.config.ts: ${(error as Error).message}`,
20
+ `Failed to load gkm.config.json: ${(error as Error).message}`,
20
21
  );
21
22
  }
22
23
  }
@@ -38,6 +38,9 @@ export async function loadEndpoints(routes: Routes): Promise<LoadedEndpoint[]> {
38
38
  }
39
39
  } catch (error) {
40
40
  logger.warn(`Failed to load ${f}:`, (error as Error).message);
41
+ throw new Error(
42
+ 'Failed to load endpoints. Please check the logs for details.',
43
+ );
41
44
  }
42
45
  }
43
46