@akanjs/config 0.9.36 → 0.9.38

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.
@@ -36,9 +36,12 @@ __export(akanConfig_exports, {
36
36
  });
37
37
  module.exports = __toCommonJS(akanConfig_exports);
38
38
  var import_fs = __toESM(require("fs"));
39
+ var import_jiti = require("jiti");
39
40
  var import_path = __toESM(require("path"));
40
41
  var import_nextConfig = require("./nextConfig");
41
42
  var import_types = require("./types");
43
+ const import_meta = {};
44
+ const jiti = (0, import_jiti.createJiti)(import_meta.url);
42
45
  const makeAppConfig = (config, props) => {
43
46
  const { name, repoName, serveDomain, env, command = "build" } = props;
44
47
  return {
@@ -71,7 +74,7 @@ const getAppConfig = async (appRoot, props) => {
71
74
  const akanConfigPath = import_path.default.join(appRoot, "akan.config.ts");
72
75
  if (!import_fs.default.existsSync(akanConfigPath))
73
76
  throw new Error(`application akan.config.ts is not found ${appRoot}`);
74
- const configImp = (await import(`${appRoot}/akan.config.ts`)).default;
77
+ const configImp = (await jiti.import(akanConfigPath)).default;
75
78
  const config = typeof configImp === "function" ? configImp(props) : configImp;
76
79
  return makeAppConfig(config, props);
77
80
  };
@@ -91,7 +94,7 @@ const getLibConfig = async (libRoot, props) => {
91
94
  const akanConfigPath = import_path.default.join(libRoot, "akan.config.ts");
92
95
  if (!import_fs.default.existsSync(akanConfigPath))
93
96
  throw new Error(`library akan.config.ts is not found ${libRoot}`);
94
- const configImp = (await import(`${libRoot}/akan.config.ts`)).default;
97
+ const configImp = (await jiti.import(akanConfigPath)).default;
95
98
  const config = typeof configImp === "function" ? configImp(props) : configImp;
96
99
  return makeLibConfig(config, props);
97
100
  };
@@ -1,9 +1,11 @@
1
1
  import fs from "fs";
2
+ import { createJiti } from "jiti";
2
3
  import path from "path";
3
4
  import { withBase } from "./nextConfig";
4
5
  import {
5
6
  archs
6
7
  } from "./types";
8
+ const jiti = createJiti(import.meta.url);
7
9
  const makeAppConfig = (config, props) => {
8
10
  const { name, repoName, serveDomain, env, command = "build" } = props;
9
11
  return {
@@ -36,7 +38,7 @@ const getAppConfig = async (appRoot, props) => {
36
38
  const akanConfigPath = path.join(appRoot, "akan.config.ts");
37
39
  if (!fs.existsSync(akanConfigPath))
38
40
  throw new Error(`application akan.config.ts is not found ${appRoot}`);
39
- const configImp = (await import(`${appRoot}/akan.config.ts`)).default;
41
+ const configImp = (await jiti.import(akanConfigPath)).default;
40
42
  const config = typeof configImp === "function" ? configImp(props) : configImp;
41
43
  return makeAppConfig(config, props);
42
44
  };
@@ -56,7 +58,7 @@ const getLibConfig = async (libRoot, props) => {
56
58
  const akanConfigPath = path.join(libRoot, "akan.config.ts");
57
59
  if (!fs.existsSync(akanConfigPath))
58
60
  throw new Error(`library akan.config.ts is not found ${libRoot}`);
59
- const configImp = (await import(`${libRoot}/akan.config.ts`)).default;
61
+ const configImp = (await jiti.import(akanConfigPath)).default;
60
62
  const config = typeof configImp === "function" ? configImp(props) : configImp;
61
63
  return makeLibConfig(config, props);
62
64
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/config",
3
- "version": "0.9.36",
3
+ "version": "0.9.38",
4
4
  "sourceType": "module",
5
5
  "module": {
6
6
  "access": "public"
@@ -19,6 +19,7 @@
19
19
  "@types/webpack-env": "^1.18.8",
20
20
  "daisyui": "^5.0.35",
21
21
  "jest": "^29.7.0",
22
+ "jiti": "^2.4.2",
22
23
  "kakao.maps.d.ts": "^0.1.40",
23
24
  "next-pwa": "5.6.0",
24
25
  "postcss": "8.5.3",
@@ -31,7 +32,7 @@
31
32
  },
32
33
  "main": "./index.js",
33
34
  "engines": {
34
- "node": ">=22"
35
+ "node": ">=20"
35
36
  },
36
37
  "exports": {
37
38
  ".": {