@akanjs/cli 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.
package/cjs/index.js CHANGED
@@ -564,6 +564,7 @@ var import_openai = require("@langchain/openai");
564
564
 
565
565
  // pkgs/@akanjs/config/src/akanConfig.ts
566
566
  var import_fs3 = __toESM(require("fs"));
567
+ var import_jiti = require("jiti");
567
568
  var import_path = __toESM(require("path"));
568
569
 
569
570
  // pkgs/@akanjs/config/src/nextConfig.ts
@@ -756,6 +757,8 @@ var getDefaultFileScan = () => ({
756
757
  });
757
758
 
758
759
  // pkgs/@akanjs/config/src/akanConfig.ts
760
+ var import_meta = {};
761
+ var jiti = (0, import_jiti.createJiti)(import_meta.url);
759
762
  var makeAppConfig = (config, props) => {
760
763
  const { name, repoName, serveDomain, env, command = "build" } = props;
761
764
  return {
@@ -788,7 +791,7 @@ var getAppConfig = async (appRoot, props) => {
788
791
  const akanConfigPath = import_path.default.join(appRoot, "akan.config.ts");
789
792
  if (!import_fs3.default.existsSync(akanConfigPath))
790
793
  throw new Error(`application akan.config.ts is not found ${appRoot}`);
791
- const configImp = (await import(`${appRoot}/akan.config.ts`)).default;
794
+ const configImp = (await jiti.import(akanConfigPath)).default;
792
795
  const config = typeof configImp === "function" ? configImp(props) : configImp;
793
796
  return makeAppConfig(config, props);
794
797
  };
@@ -808,7 +811,7 @@ var getLibConfig = async (libRoot, props) => {
808
811
  const akanConfigPath = import_path.default.join(libRoot, "akan.config.ts");
809
812
  if (!import_fs3.default.existsSync(akanConfigPath))
810
813
  throw new Error(`library akan.config.ts is not found ${libRoot}`);
811
- const configImp = (await import(`${libRoot}/akan.config.ts`)).default;
814
+ const configImp = (await jiti.import(akanConfigPath)).default;
812
815
  const config = typeof configImp === "function" ? configImp(props) : configImp;
813
816
  return makeLibConfig(config, props);
814
817
  };
@@ -1432,7 +1435,7 @@ ${summary.join(", ")} found` + output.join("\n");
1432
1435
  };
1433
1436
 
1434
1437
  // pkgs/@akanjs/devkit/src/executors.ts
1435
- var import_meta = {};
1438
+ var import_meta2 = {};
1436
1439
  var execEmoji = {
1437
1440
  workspace: "\u{1F3E0}",
1438
1441
  app: "\u{1F680}",
@@ -1703,7 +1706,7 @@ var Executor = class _Executor {
1703
1706
  dict = {},
1704
1707
  overwrite = true
1705
1708
  }) {
1706
- const templatePath = `${getDirname(import_meta.url)}/src/templates${template ? `/${template}` : ""}`;
1709
+ const templatePath = `${getDirname(import_meta2.url)}/src/templates${template ? `/${template}` : ""}`;
1707
1710
  const prefixTemplatePath = templatePath.endsWith(".tsx") ? templatePath : templatePath.replace(".ts", ".js");
1708
1711
  if (import_fs4.default.statSync(prefixTemplatePath).isFile()) {
1709
1712
  const filename = import_path3.default.basename(prefixTemplatePath);
@@ -2737,7 +2740,7 @@ var import_prompts3 = require("@inquirer/prompts");
2737
2740
  var import_chalk4 = __toESM(require("chalk"));
2738
2741
  var import_commander = require("commander");
2739
2742
  var import_fs7 = __toESM(require("fs"));
2740
- var import_meta2 = {};
2743
+ var import_meta3 = {};
2741
2744
  var camelToKebabCase = (str) => str.replace(/([A-Z])/g, "-$1").toLowerCase();
2742
2745
  var handleOption = (programCommand, argMeta) => {
2743
2746
  const {
@@ -2913,7 +2916,7 @@ var runCommands = async (...commands) => {
2913
2916
  process.on("unhandledRejection", (error) => {
2914
2917
  process.exit(1);
2915
2918
  });
2916
- const __dirname = getDirname(import_meta2.url);
2919
+ const __dirname = getDirname(import_meta3.url);
2917
2920
  const hasPackageJson = import_fs7.default.existsSync(`${__dirname}/../package.json`);
2918
2921
  const version = hasPackageJson ? JSON.parse(import_fs7.default.readFileSync(`${__dirname}/../package.json`, "utf8")).version : "0.0.1";
2919
2922
  import_commander.program.version(version).description("Akan CLI");
@@ -3322,7 +3325,7 @@ var Builder = class {
3322
3325
  const pkgPackageJson = {
3323
3326
  ...this.#pkgJson,
3324
3327
  main: "./index.js",
3325
- engines: { node: ">=22" },
3328
+ engines: { node: ">=20" },
3326
3329
  dependencies,
3327
3330
  exports: {
3328
3331
  ...this.#pkgJson.exports ?? {},
@@ -3342,21 +3345,21 @@ var Builder = class {
3342
3345
  // pkgs/@akanjs/devkit/src/prompter.ts
3343
3346
  var import_prompts5 = require("@inquirer/prompts");
3344
3347
  var import_promises2 = __toESM(require("fs/promises"));
3345
- var import_meta3 = {};
3348
+ var import_meta4 = {};
3346
3349
  var Prompter = class {
3347
3350
  static async selectGuideline() {
3348
- const guideNames = (await import_promises2.default.readdir(`${getDirname(import_meta3.url)}/src/guidelines`)).filter(
3351
+ const guideNames = (await import_promises2.default.readdir(`${getDirname(import_meta4.url)}/src/guidelines`)).filter(
3349
3352
  (name) => !name.startsWith("_")
3350
3353
  );
3351
3354
  return await (0, import_prompts5.select)({ message: "Select a guideline", choices: guideNames.map((name) => ({ name, value: name })) });
3352
3355
  }
3353
3356
  static async getGuideJson(guideName) {
3354
- const filePath = `${getDirname(import_meta3.url)}/src/guidelines/${guideName}/${guideName}.generate.json`;
3357
+ const filePath = `${getDirname(import_meta4.url)}/src/guidelines/${guideName}/${guideName}.generate.json`;
3355
3358
  const guideJson = await import_promises2.default.readFile(filePath, "utf-8");
3356
3359
  return JSON.parse(guideJson);
3357
3360
  }
3358
3361
  static async getInstruction(guideName) {
3359
- const filePath = `${getDirname(import_meta3.url)}/src/guidelines/${guideName}/${guideName}.instruction.md`;
3362
+ const filePath = `${getDirname(import_meta4.url)}/src/guidelines/${guideName}/${guideName}.instruction.md`;
3360
3363
  const content = await import_promises2.default.readFile(filePath, "utf-8");
3361
3364
  return content;
3362
3365
  }
@@ -3380,7 +3383,7 @@ ${request}
3380
3383
  `;
3381
3384
  }
3382
3385
  async getDocumentation(guideName) {
3383
- const filePath = `${getDirname(import_meta3.url)}/src/guidelines/${guideName}/${guideName}.instruction.md`;
3386
+ const filePath = `${getDirname(import_meta4.url)}/src/guidelines/${guideName}/${guideName}.instruction.md`;
3384
3387
  const document = await import_promises2.default.readFile(filePath, "utf-8");
3385
3388
  return `\`\`\`markdown
3386
3389
  ${document}
@@ -3964,7 +3967,7 @@ var ApplicationRunner = class {
3964
3967
  version: "1.0.0",
3965
3968
  // type: "module",
3966
3969
  main: "./main.js",
3967
- engines: { node: ">=22" },
3970
+ engines: { node: ">=20" },
3968
3971
  dependencies
3969
3972
  };
3970
3973
  app.dist.writeJson("backend/package.json", appPackageJson);
@@ -4014,7 +4017,7 @@ var ApplicationRunner = class {
4014
4017
  name: `${app.name}/frontend`,
4015
4018
  description: `${app.name} frontend`,
4016
4019
  version: "1.0.0",
4017
- engines: { node: ">=22" },
4020
+ engines: { node: ">=20" },
4018
4021
  dependencies,
4019
4022
  scripts: { start: "next start" }
4020
4023
  };
@@ -6052,7 +6055,7 @@ WorkspaceCommand = __decorateClass([
6052
6055
  // pkgs/@akanjs/cli/src/guideline/guideline.prompt.ts
6053
6056
  var import_fs12 = __toESM(require("fs"), 1);
6054
6057
  var import_promises5 = __toESM(require("fs/promises"), 1);
6055
- var import_meta4 = {};
6058
+ var import_meta5 = {};
6056
6059
  var GuidelinePrompt = class extends Prompter {
6057
6060
  constructor(workspace, name) {
6058
6061
  super();
@@ -6083,7 +6086,7 @@ var GuidelinePrompt = class extends Prompter {
6083
6086
  const scanResult = targetFilePaths.map((filePath) => ({ ...scan, ...this.workspace.getLocalFile(filePath) }));
6084
6087
  scanFiles.push(...scanResult);
6085
6088
  }
6086
- const resultPath = `${getDirname(import_meta4.url)}/src/guidelines/${this.name}/${guideJson.update.filePath}`;
6089
+ const resultPath = `${getDirname(import_meta5.url)}/src/guidelines/${this.name}/${guideJson.update.filePath}`;
6087
6090
  const writePath = `${this.workspace.workspaceRoot}/pkgs/@akanjs/cli/src/guidelines/${this.name}/${guideJson.update.filePath}`;
6088
6091
  const isResultExists = this.workspace.exists(writePath);
6089
6092
  const existingResult = isResultExists ? this.workspace.readFile(resultPath) : null;
@@ -6125,7 +6128,7 @@ ${guideJson.update.rules.map((rule) => `- ${rule}`).join("\n")}
6125
6128
  }
6126
6129
  async requestUpdateInstruction(updateRequest) {
6127
6130
  const guideJson = await Prompter.getGuideJson(this.name);
6128
- const resultPath = `${getDirname(import_meta4.url)}/src/guidelines/${this.name}/${guideJson.update.filePath}`;
6131
+ const resultPath = `${getDirname(import_meta5.url)}/src/guidelines/${this.name}/${guideJson.update.filePath}`;
6129
6132
  const writePath = `${this.workspace.workspaceRoot}/pkgs/@akanjs/cli/src/guidelines/${this.name}/${guideJson.update.filePath}`;
6130
6133
  const isResultExists = this.workspace.exists(writePath);
6131
6134
  if (!isResultExists)
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "packageManager": "pnpm@10.11.0",
40
40
  "engines": {
41
- "node": ">=22",
41
+ "node": ">=20",
42
42
  "pnpm": ">=10"
43
43
  }
44
44
  }
package/esm/index.js CHANGED
@@ -544,6 +544,7 @@ import { ChatOpenAI } from "@langchain/openai";
544
544
 
545
545
  // pkgs/@akanjs/config/src/akanConfig.ts
546
546
  import fs4 from "fs";
547
+ import { createJiti } from "jiti";
547
548
  import path from "path";
548
549
 
549
550
  // pkgs/@akanjs/config/src/nextConfig.ts
@@ -736,6 +737,7 @@ var getDefaultFileScan = () => ({
736
737
  });
737
738
 
738
739
  // pkgs/@akanjs/config/src/akanConfig.ts
740
+ var jiti = createJiti(import.meta.url);
739
741
  var makeAppConfig = (config, props) => {
740
742
  const { name, repoName, serveDomain, env, command = "build" } = props;
741
743
  return {
@@ -768,7 +770,7 @@ var getAppConfig = async (appRoot, props) => {
768
770
  const akanConfigPath = path.join(appRoot, "akan.config.ts");
769
771
  if (!fs4.existsSync(akanConfigPath))
770
772
  throw new Error(`application akan.config.ts is not found ${appRoot}`);
771
- const configImp = (await import(`${appRoot}/akan.config.ts`)).default;
773
+ const configImp = (await jiti.import(akanConfigPath)).default;
772
774
  const config = typeof configImp === "function" ? configImp(props) : configImp;
773
775
  return makeAppConfig(config, props);
774
776
  };
@@ -788,7 +790,7 @@ var getLibConfig = async (libRoot, props) => {
788
790
  const akanConfigPath = path.join(libRoot, "akan.config.ts");
789
791
  if (!fs4.existsSync(akanConfigPath))
790
792
  throw new Error(`library akan.config.ts is not found ${libRoot}`);
791
- const configImp = (await import(`${libRoot}/akan.config.ts`)).default;
793
+ const configImp = (await jiti.import(akanConfigPath)).default;
792
794
  const config = typeof configImp === "function" ? configImp(props) : configImp;
793
795
  return makeLibConfig(config, props);
794
796
  };
@@ -3305,7 +3307,7 @@ var Builder = class {
3305
3307
  const pkgPackageJson = {
3306
3308
  ...this.#pkgJson,
3307
3309
  main: "./index.js",
3308
- engines: { node: ">=22" },
3310
+ engines: { node: ">=20" },
3309
3311
  dependencies,
3310
3312
  exports: {
3311
3313
  ...this.#pkgJson.exports ?? {},
@@ -3946,7 +3948,7 @@ var ApplicationRunner = class {
3946
3948
  version: "1.0.0",
3947
3949
  // type: "module",
3948
3950
  main: "./main.js",
3949
- engines: { node: ">=22" },
3951
+ engines: { node: ">=20" },
3950
3952
  dependencies
3951
3953
  };
3952
3954
  app.dist.writeJson("backend/package.json", appPackageJson);
@@ -3996,7 +3998,7 @@ var ApplicationRunner = class {
3996
3998
  name: `${app.name}/frontend`,
3997
3999
  description: `${app.name} frontend`,
3998
4000
  version: "1.0.0",
3999
- engines: { node: ">=22" },
4001
+ engines: { node: ">=20" },
4000
4002
  dependencies,
4001
4003
  scripts: { start: "next start" }
4002
4004
  };
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "packageManager": "pnpm@10.11.0",
40
40
  "engines": {
41
- "node": ">=22",
41
+ "node": ">=20",
42
42
  "pnpm": ">=10"
43
43
  }
44
44
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "type": "module",
3
3
  "sourceType": "module",
4
4
  "name": "@akanjs/cli",
5
- "version": "0.9.36",
5
+ "version": "0.9.38",
6
6
  "bin": {
7
7
  "akan": "esm/index.js"
8
8
  },
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "main": "./index.js",
18
18
  "engines": {
19
- "node": ">=22"
19
+ "node": ">=20"
20
20
  },
21
21
  "dependencies": {
22
22
  "@inquirer/prompts": "^7.2.1",
@@ -37,6 +37,7 @@
37
37
  "eslint": "^9.19.0",
38
38
  "form-data": "^4.0.1",
39
39
  "ink": "^6.1.0",
40
+ "jiti": "^2.4.2",
40
41
  "js-yaml": "^4.1.0",
41
42
  "latest-version": "^9.0.0",
42
43
  "lodash": "^4.17.21",