@akanjs/cli 0.0.46 → 0.0.48

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 (77) hide show
  1. package/index.js +88 -105
  2. package/package.json +1 -1
  3. package/pkgs/@akanjs/common/Logger.d.ts +28 -0
  4. package/pkgs/@akanjs/common/applyMixins.d.ts +3 -0
  5. package/pkgs/@akanjs/common/capitalize.d.ts +1 -0
  6. package/pkgs/@akanjs/common/deepObjectify.d.ts +4 -0
  7. package/pkgs/@akanjs/common/index.d.ts +18 -0
  8. package/pkgs/@akanjs/common/isDayjs.d.ts +2 -0
  9. package/pkgs/@akanjs/common/isQueryEqual.d.ts +1 -0
  10. package/pkgs/@akanjs/common/isValidDate.d.ts +2 -0
  11. package/pkgs/@akanjs/common/lowerlize.d.ts +1 -0
  12. package/pkgs/@akanjs/common/mergeVersion.d.ts +10 -0
  13. package/pkgs/@akanjs/common/objectify.d.ts +1 -0
  14. package/pkgs/@akanjs/common/pathGet.d.ts +1 -0
  15. package/pkgs/@akanjs/common/pathSet.d.ts +1 -0
  16. package/pkgs/@akanjs/common/pluralize.d.ts +2 -0
  17. package/pkgs/@akanjs/common/randomPick.d.ts +1 -0
  18. package/pkgs/@akanjs/common/randomPicks.d.ts +1 -0
  19. package/pkgs/@akanjs/common/sleep.d.ts +1 -0
  20. package/pkgs/@akanjs/common/splitVersion.d.ts +11 -0
  21. package/pkgs/@akanjs/common/types.d.ts +15 -0
  22. package/pkgs/@akanjs/config/index.d.ts +132 -0
  23. package/pkgs/@akanjs/config/src/akanConfig.d.ts +7 -0
  24. package/pkgs/@akanjs/config/src/baseConfigEnv.d.ts +8 -0
  25. package/pkgs/@akanjs/config/src/nextConfig.d.ts +17 -0
  26. package/pkgs/@akanjs/devkit/index.d.ts +1 -0
  27. package/pkgs/@akanjs/devkit/src/auth.d.ts +9 -0
  28. package/pkgs/@akanjs/devkit/src/baseDevEnv.d.ts +10 -0
  29. package/pkgs/@akanjs/devkit/src/capacitorApp.d.ts +21 -0
  30. package/pkgs/@akanjs/devkit/src/commandDecorators/argMeta.d.ts +55 -0
  31. package/pkgs/@akanjs/devkit/src/commandDecorators/command.d.ts +2 -0
  32. package/pkgs/@akanjs/devkit/src/commandDecorators/commandMeta.d.ts +2 -0
  33. package/pkgs/@akanjs/devkit/src/commandDecorators/index.d.ts +5 -0
  34. package/pkgs/@akanjs/devkit/src/commandDecorators/targetMeta.d.ts +18 -0
  35. package/pkgs/@akanjs/devkit/src/commandDecorators/types.d.ts +1 -0
  36. package/pkgs/@akanjs/devkit/src/constants.d.ts +19 -0
  37. package/pkgs/@akanjs/devkit/src/createTunnel.d.ts +7 -0
  38. package/pkgs/@akanjs/devkit/src/dependencyScanner.d.ts +9 -0
  39. package/pkgs/@akanjs/devkit/src/executors.d.ts +136 -0
  40. package/pkgs/@akanjs/devkit/src/extractDeps.d.ts +6 -0
  41. package/pkgs/@akanjs/devkit/src/getCredentials.d.ts +12 -0
  42. package/pkgs/@akanjs/devkit/src/getDependencies.d.ts +4 -0
  43. package/pkgs/@akanjs/devkit/src/getModelFileData.d.ts +16 -0
  44. package/pkgs/@akanjs/devkit/src/getRelatedCnsts.d.ts +9 -0
  45. package/pkgs/@akanjs/devkit/src/index.d.ts +18 -0
  46. package/pkgs/@akanjs/devkit/src/installExternalLib.d.ts +2 -0
  47. package/pkgs/@akanjs/devkit/src/selectModel.d.ts +1 -0
  48. package/pkgs/@akanjs/devkit/src/streamAi.d.ts +6 -0
  49. package/pkgs/@akanjs/devkit/src/types.d.ts +18 -0
  50. package/pkgs/@akanjs/devkit/src/uploadRelease.d.ts +9 -0
  51. package/src/templates/libRoot/tsconfig.json.template +3 -1
  52. package/src/templates/pkgRoot/tsconfig.json.template +8 -5
  53. package/src/templates/workplaceRoot/tsconfig.json.template +1 -1
  54. /package/{index.d.ts → pkgs/@akanjs/cli/index.d.ts} +0 -0
  55. /package/{src → pkgs/@akanjs/cli/src}/application/application.command.d.ts +0 -0
  56. /package/{src → pkgs/@akanjs/cli/src}/application/application.prompt.d.ts +0 -0
  57. /package/{src → pkgs/@akanjs/cli/src}/application/application.runner.d.ts +0 -0
  58. /package/{src → pkgs/@akanjs/cli/src}/application/application.script.d.ts +0 -0
  59. /package/{src → pkgs/@akanjs/cli/src}/cloud/cloud.command.d.ts +0 -0
  60. /package/{src → pkgs/@akanjs/cli/src}/cloud/cloud.runner.d.ts +0 -0
  61. /package/{src → pkgs/@akanjs/cli/src}/cloud/cloud.script.d.ts +0 -0
  62. /package/{src → pkgs/@akanjs/cli/src}/library/library.command.d.ts +0 -0
  63. /package/{src → pkgs/@akanjs/cli/src}/library/library.runner.d.ts +0 -0
  64. /package/{src → pkgs/@akanjs/cli/src}/library/library.script.d.ts +0 -0
  65. /package/{src → pkgs/@akanjs/cli/src}/module/module.command.d.ts +0 -0
  66. /package/{src → pkgs/@akanjs/cli/src}/module/module.prompt.d.ts +0 -0
  67. /package/{src → pkgs/@akanjs/cli/src}/module/module.runner.d.ts +0 -0
  68. /package/{src → pkgs/@akanjs/cli/src}/module/module.script.d.ts +0 -0
  69. /package/{src → pkgs/@akanjs/cli/src}/package/package.command.d.ts +0 -0
  70. /package/{src → pkgs/@akanjs/cli/src}/package/package.runner.d.ts +0 -0
  71. /package/{src → pkgs/@akanjs/cli/src}/package/package.script.d.ts +0 -0
  72. /package/{src → pkgs/@akanjs/cli/src}/package/page/page.command.d.ts +0 -0
  73. /package/{src → pkgs/@akanjs/cli/src}/package/page/page.runner.d.ts +0 -0
  74. /package/{src → pkgs/@akanjs/cli/src}/package/page/page.script.d.ts +0 -0
  75. /package/{src → pkgs/@akanjs/cli/src}/workspace/workspace.command.d.ts +0 -0
  76. /package/{src → pkgs/@akanjs/cli/src}/workspace/workspace.runner.d.ts +0 -0
  77. /package/{src → pkgs/@akanjs/cli/src}/workspace/workspace.script.d.ts +0 -0
package/index.js CHANGED
@@ -375,46 +375,46 @@
375
375
  }
376
376
  });
377
377
 
378
- // pkgs/@akanjs/common/src/splitVersion.ts
378
+ // pkgs/@akanjs/common/splitVersion.ts
379
379
  var init_splitVersion = __esm({
380
- "pkgs/@akanjs/common/src/splitVersion.ts"() {
380
+ "pkgs/@akanjs/common/splitVersion.ts"() {
381
381
  }
382
382
  });
383
383
 
384
- // pkgs/@akanjs/common/src/isDayjs.ts
384
+ // pkgs/@akanjs/common/isDayjs.ts
385
385
  var import_dayjs;
386
386
  var init_isDayjs = __esm({
387
- "pkgs/@akanjs/common/src/isDayjs.ts"() {
387
+ "pkgs/@akanjs/common/isDayjs.ts"() {
388
388
  import_dayjs = __require("dayjs");
389
389
  }
390
390
  });
391
391
 
392
- // pkgs/@akanjs/common/src/deepObjectify.ts
392
+ // pkgs/@akanjs/common/deepObjectify.ts
393
393
  var init_deepObjectify = __esm({
394
- "pkgs/@akanjs/common/src/deepObjectify.ts"() {
394
+ "pkgs/@akanjs/common/deepObjectify.ts"() {
395
395
  init_isDayjs();
396
396
  }
397
397
  });
398
398
 
399
- // pkgs/@akanjs/common/src/pathGet.ts
399
+ // pkgs/@akanjs/common/pathGet.ts
400
400
  var init_pathGet = __esm({
401
- "pkgs/@akanjs/common/src/pathGet.ts"() {
401
+ "pkgs/@akanjs/common/pathGet.ts"() {
402
402
  }
403
403
  });
404
404
 
405
- // pkgs/@akanjs/common/src/isQueryEqual.ts
405
+ // pkgs/@akanjs/common/isQueryEqual.ts
406
406
  var import_dayjs2;
407
407
  var init_isQueryEqual = __esm({
408
- "pkgs/@akanjs/common/src/isQueryEqual.ts"() {
408
+ "pkgs/@akanjs/common/isQueryEqual.ts"() {
409
409
  import_dayjs2 = __toESM(__require("dayjs"));
410
410
  init_isDayjs();
411
411
  }
412
412
  });
413
413
 
414
- // pkgs/@akanjs/common/src/isValidDate.ts
414
+ // pkgs/@akanjs/common/isValidDate.ts
415
415
  var import_dayjs3, import_customParseFormat;
416
416
  var init_isValidDate = __esm({
417
- "pkgs/@akanjs/common/src/isValidDate.ts"() {
417
+ "pkgs/@akanjs/common/isValidDate.ts"() {
418
418
  import_dayjs3 = __toESM(__require("dayjs"));
419
419
  import_customParseFormat = __toESM(__require("dayjs/plugin/customParseFormat"));
420
420
  init_isDayjs();
@@ -422,22 +422,22 @@
422
422
  }
423
423
  });
424
424
 
425
- // pkgs/@akanjs/common/src/objectify.ts
425
+ // pkgs/@akanjs/common/objectify.ts
426
426
  var init_objectify = __esm({
427
- "pkgs/@akanjs/common/src/objectify.ts"() {
427
+ "pkgs/@akanjs/common/objectify.ts"() {
428
428
  }
429
429
  });
430
430
 
431
- // pkgs/@akanjs/common/src/randomPick.ts
431
+ // pkgs/@akanjs/common/randomPick.ts
432
432
  var init_randomPick = __esm({
433
- "pkgs/@akanjs/common/src/randomPick.ts"() {
433
+ "pkgs/@akanjs/common/randomPick.ts"() {
434
434
  }
435
435
  });
436
436
 
437
- // pkgs/@akanjs/common/src/randomPicks.ts
437
+ // pkgs/@akanjs/common/randomPicks.ts
438
438
  var randomPicks;
439
439
  var init_randomPicks = __esm({
440
- "pkgs/@akanjs/common/src/randomPicks.ts"() {
440
+ "pkgs/@akanjs/common/randomPicks.ts"() {
441
441
  randomPicks = (arr, count = 1, allowDuplicate = false) => {
442
442
  if (!allowDuplicate && arr.length <= count)
443
443
  return arr;
@@ -454,46 +454,46 @@
454
454
  }
455
455
  });
456
456
 
457
- // pkgs/@akanjs/common/src/pathSet.ts
457
+ // pkgs/@akanjs/common/pathSet.ts
458
458
  var init_pathSet = __esm({
459
- "pkgs/@akanjs/common/src/pathSet.ts"() {
459
+ "pkgs/@akanjs/common/pathSet.ts"() {
460
460
  }
461
461
  });
462
462
 
463
- // pkgs/@akanjs/common/src/mergeVersion.ts
463
+ // pkgs/@akanjs/common/mergeVersion.ts
464
464
  var init_mergeVersion = __esm({
465
- "pkgs/@akanjs/common/src/mergeVersion.ts"() {
465
+ "pkgs/@akanjs/common/mergeVersion.ts"() {
466
466
  }
467
467
  });
468
468
 
469
- // pkgs/@akanjs/common/src/pluralize.ts
469
+ // pkgs/@akanjs/common/pluralize.ts
470
470
  var import_pluralize;
471
471
  var init_pluralize = __esm({
472
- "pkgs/@akanjs/common/src/pluralize.ts"() {
472
+ "pkgs/@akanjs/common/pluralize.ts"() {
473
473
  import_pluralize = __toESM(__require("pluralize"));
474
474
  }
475
475
  });
476
476
 
477
- // pkgs/@akanjs/common/src/applyMixins.ts
477
+ // pkgs/@akanjs/common/applyMixins.ts
478
478
  var init_applyMixins = __esm({
479
- "pkgs/@akanjs/common/src/applyMixins.ts"() {
479
+ "pkgs/@akanjs/common/applyMixins.ts"() {
480
480
  }
481
481
  });
482
482
 
483
- // pkgs/@akanjs/common/src/capitalize.ts
483
+ // pkgs/@akanjs/common/capitalize.ts
484
484
  var capitalize;
485
485
  var init_capitalize = __esm({
486
- "pkgs/@akanjs/common/src/capitalize.ts"() {
486
+ "pkgs/@akanjs/common/capitalize.ts"() {
487
487
  capitalize = (str) => {
488
488
  return str.charAt(0).toUpperCase() + str.slice(1);
489
489
  };
490
490
  }
491
491
  });
492
492
 
493
- // pkgs/@akanjs/common/src/Logger.ts
493
+ // pkgs/@akanjs/common/Logger.ts
494
494
  var import_dayjs4, logLevels, clc, colorizeMap, Logger;
495
495
  var init_Logger = __esm({
496
- "pkgs/@akanjs/common/src/Logger.ts"() {
496
+ "pkgs/@akanjs/common/Logger.ts"() {
497
497
  import_dayjs4 = __toESM(__require("dayjs"));
498
498
  logLevels = ["trace", "verbose", "debug", "log", "info", "warn", "error"];
499
499
  clc = {
@@ -635,16 +635,16 @@
635
635
  }
636
636
  });
637
637
 
638
- // pkgs/@akanjs/common/src/lowerlize.ts
638
+ // pkgs/@akanjs/common/lowerlize.ts
639
639
  var init_lowerlize = __esm({
640
- "pkgs/@akanjs/common/src/lowerlize.ts"() {
640
+ "pkgs/@akanjs/common/lowerlize.ts"() {
641
641
  }
642
642
  });
643
643
 
644
- // pkgs/@akanjs/common/src/sleep.ts
644
+ // pkgs/@akanjs/common/sleep.ts
645
645
  var sleep;
646
646
  var init_sleep = __esm({
647
- "pkgs/@akanjs/common/src/sleep.ts"() {
647
+ "pkgs/@akanjs/common/sleep.ts"() {
648
648
  sleep = async (ms) => {
649
649
  return new Promise((resolve) => {
650
650
  setTimeout(() => {
@@ -655,9 +655,9 @@
655
655
  }
656
656
  });
657
657
 
658
- // pkgs/@akanjs/common/src/index.ts
659
- var init_src = __esm({
660
- "pkgs/@akanjs/common/src/index.ts"() {
658
+ // pkgs/@akanjs/common/index.ts
659
+ var init_common = __esm({
660
+ "pkgs/@akanjs/common/index.ts"() {
661
661
  init_splitVersion();
662
662
  init_deepObjectify();
663
663
  init_pathGet();
@@ -744,25 +744,7 @@
744
744
  ...config.env,
745
745
  basePaths: routes.map(({ basePath: basePath2 }) => basePath2).join(",")
746
746
  },
747
- transpilePackages: [
748
- "swiper",
749
- "ssr-window",
750
- "dom7",
751
- ...libs.map((lib) => `@${lib}`),
752
- "@akanjs/base",
753
- "@akanjs/common",
754
- "@akanjs/next",
755
- "@akanjs/ui",
756
- "@akanjs/client",
757
- "@akanjs/server",
758
- "@akanjs/service",
759
- "@akanjs/signal",
760
- "@akanjs/store",
761
- "@akanjs/dictionary",
762
- "@akanjs/constant",
763
- "@akanjs/config",
764
- "@akanjs/document"
765
- ],
747
+ transpilePackages: ["swiper", "ssr-window", "dom7"],
766
748
  reactStrictMode: commandType === "serve" ? false : true,
767
749
  experimental: {
768
750
  ...config.experimental ?? {},
@@ -1150,7 +1132,7 @@ CMD ["npm", "start"]`,
1150
1132
  var import_child_process, import_fs7, import_promises, import_path3, Executor, WorkspaceExecutor, SysExecutor, AppExecutor, DistAppExecutor, LibExecutor, PkgExecutor, DistPkgExecutor;
1151
1133
  var init_executors = __esm({
1152
1134
  "pkgs/@akanjs/devkit/src/executors.ts"() {
1153
- init_src();
1135
+ init_common();
1154
1136
  init_config();
1155
1137
  import_child_process = __require("child_process");
1156
1138
  import_fs7 = __toESM(__require("fs"));
@@ -1753,7 +1735,7 @@ CMD ["npm", "start"]`,
1753
1735
  var import_project, import_fs9, CapacitorApp;
1754
1736
  var init_capacitorApp = __esm({
1755
1737
  "pkgs/@akanjs/devkit/src/capacitorApp.ts"() {
1756
- init_src();
1738
+ init_common();
1757
1739
  import_project = __require("@trapezedev/project");
1758
1740
  import_fs9 = __toESM(__require("fs"));
1759
1741
  CapacitorApp = class {
@@ -1878,10 +1860,9 @@ CMD ["npm", "start"]`,
1878
1860
  });
1879
1861
 
1880
1862
  // pkgs/@akanjs/devkit/src/extractDeps.ts
1881
- var fs11, NODE_NATIVE_MODULE_SET, extractDependencies;
1863
+ var NODE_NATIVE_MODULE_SET, extractDependencies;
1882
1864
  var init_extractDeps = __esm({
1883
1865
  "pkgs/@akanjs/devkit/src/extractDeps.ts"() {
1884
- fs11 = __toESM(__require("fs"));
1885
1866
  NODE_NATIVE_MODULE_SET = /* @__PURE__ */ new Set([
1886
1867
  "assert",
1887
1868
  "async_hooks",
@@ -1924,10 +1905,9 @@ CMD ["npm", "start"]`,
1924
1905
  "worker_threads",
1925
1906
  "zlib"
1926
1907
  ]);
1927
- extractDependencies = (bundlePath, pacakgeJson, defaultDependencies = []) => {
1908
+ extractDependencies = (filepaths, pacakgeJson, defaultDependencies = []) => {
1928
1909
  if (!pacakgeJson.dependencies)
1929
1910
  throw new Error("No dependencies found in package.json");
1930
- const code = fs11.readFileSync(bundlePath, "utf8");
1931
1911
  const dependencies = new Set(defaultDependencies);
1932
1912
  const existingDependencies = /* @__PURE__ */ new Set([
1933
1913
  ...Object.keys(pacakgeJson.dependencies ?? {}),
@@ -1938,15 +1918,17 @@ CMD ["npm", "start"]`,
1938
1918
  ...pacakgeJson.devDependencies ?? {}
1939
1919
  };
1940
1920
  const requireRegex = /require\s*\(\s*['"`]([^'"`]+)['"`]\s*\)/g;
1941
- let requireMatch;
1942
- while ((requireMatch = requireRegex.exec(code)) !== null) {
1943
- const moduleName = requireMatch[1];
1944
- const moduleNameParts = moduleName.split("/");
1945
- const subModuleLength = moduleNameParts.length;
1946
- for (let i = 0; i < subModuleLength; i++) {
1947
- const libName = moduleNameParts.slice(0, i + 1).join("/");
1948
- if (!NODE_NATIVE_MODULE_SET.has(libName) && existingDependencies.has(libName))
1949
- dependencies.add(libName);
1921
+ for (const { text } of filepaths) {
1922
+ let requireMatch;
1923
+ while ((requireMatch = requireRegex.exec(text)) !== null) {
1924
+ const moduleName = requireMatch[1];
1925
+ const moduleNameParts = moduleName.split("/");
1926
+ const subModuleLength = moduleNameParts.length;
1927
+ for (let i = 0; i < subModuleLength; i++) {
1928
+ const libName = moduleNameParts.slice(0, i + 1).join("/");
1929
+ if (!NODE_NATIVE_MODULE_SET.has(libName) && existingDependencies.has(libName))
1930
+ dependencies.add(libName);
1931
+ }
1950
1932
  }
1951
1933
  }
1952
1934
  return Object.fromEntries(
@@ -2057,12 +2039,11 @@ CMD ["npm", "start"]`,
2057
2039
  });
2058
2040
 
2059
2041
  // pkgs/@akanjs/devkit/src/commandDecorators/command.ts
2060
- var import_prompts3, import_commander, import_dotenv, camelToKebabCase, handleOption, convertOptionValue, getOptionValue, getArgumentValue, runCommands;
2042
+ var import_prompts3, import_commander, camelToKebabCase, handleOption, convertOptionValue, getOptionValue, getArgumentValue, runCommands;
2061
2043
  var init_command = __esm({
2062
2044
  "pkgs/@akanjs/devkit/src/commandDecorators/command.ts"() {
2063
2045
  import_prompts3 = __require("@inquirer/prompts");
2064
2046
  import_commander = __require("commander");
2065
- import_dotenv = __toESM(__require("dotenv"));
2066
2047
  init_executors();
2067
2048
  init_argMeta();
2068
2049
  init_targetMeta();
@@ -2155,7 +2136,6 @@ CMD ["npm", "start"]`,
2155
2136
  throw new Error(`Invalid system type: ${argMeta.type}`);
2156
2137
  };
2157
2138
  runCommands = async (...commands) => {
2158
- import_dotenv.default.config();
2159
2139
  import_commander.program.version("0.0.1").description("An example CLI for managing a directory");
2160
2140
  for (const command of commands) {
2161
2141
  const targetMetas = getTargetMetas(command);
@@ -2227,7 +2207,7 @@ CMD ["npm", "start"]`,
2227
2207
  });
2228
2208
 
2229
2209
  // pkgs/@akanjs/devkit/src/index.ts
2230
- var init_src2 = __esm({
2210
+ var init_src = __esm({
2231
2211
  "pkgs/@akanjs/devkit/src/index.ts"() {
2232
2212
  init_baseDevEnv();
2233
2213
  init_createTunnel();
@@ -2253,7 +2233,7 @@ CMD ["npm", "start"]`,
2253
2233
  // pkgs/@akanjs/devkit/index.ts
2254
2234
  var init_devkit = __esm({
2255
2235
  "pkgs/@akanjs/devkit/index.ts"() {
2256
- init_src2();
2236
+ init_src();
2257
2237
  }
2258
2238
  });
2259
2239
 
@@ -3402,10 +3382,10 @@ page.tsx_end
3402
3382
  });
3403
3383
 
3404
3384
  // pkgs/@akanjs/cli/src/application/application.runner.ts
3405
- var import_prompts4, import_output_parsers, import_prompts5, import_runnables2, import_openai2, import_plugin_react, import_dotenv2, esbuild, import_fs10, import_promises2, import_js_yaml2, import_ora2, import_path4, vite, import_vite_plugin_node_polyfills, import_vite_tsconfig_paths, ApplicationRunner;
3385
+ var import_prompts4, import_output_parsers, import_prompts5, import_runnables2, import_openai2, import_plugin_react, import_dotenv, esbuild, import_fs10, import_promises2, import_js_yaml2, import_ora2, import_path4, vite, import_vite_plugin_node_polyfills, import_vite_tsconfig_paths, ApplicationRunner;
3406
3386
  var init_application_runner = __esm({
3407
3387
  "pkgs/@akanjs/cli/src/application/application.runner.ts"() {
3408
- init_src();
3388
+ init_common();
3409
3389
  init_config();
3410
3390
  init_devkit();
3411
3391
  import_prompts4 = __require("@inquirer/prompts");
@@ -3414,7 +3394,7 @@ page.tsx_end
3414
3394
  import_runnables2 = __require("@langchain/core/runnables");
3415
3395
  import_openai2 = __require("@langchain/openai");
3416
3396
  import_plugin_react = __toESM(__require("@vitejs/plugin-react"));
3417
- import_dotenv2 = __toESM(__require("dotenv"));
3397
+ import_dotenv = __toESM(__require("dotenv"));
3418
3398
  esbuild = __toESM(__require("esbuild"));
3419
3399
  import_fs10 = __toESM(__require("fs"));
3420
3400
  import_promises2 = __toESM(__require("fs/promises"));
@@ -3434,7 +3414,7 @@ page.tsx_end
3434
3414
  }
3435
3415
  async #prepareCommand(app, distApp, type, target) {
3436
3416
  await distApp.exec(`rm -rf ${target}`);
3437
- const env = import_dotenv2.default.parse(app.workspace.readFile(".env"));
3417
+ const env = import_dotenv.default.parse(app.workspace.readFile(".env"));
3438
3418
  if (target === "frontend")
3439
3419
  app.writeFile("next.config.ts", defaultNextConfigFile);
3440
3420
  return {
@@ -3450,8 +3430,8 @@ page.tsx_end
3450
3430
  async buildBackend(app, distApp) {
3451
3431
  await this.#prepareCommand(app, distApp, "serve", "backend");
3452
3432
  const akanConfig = await app.getConfig("build");
3453
- await esbuild.build({
3454
- write: true,
3433
+ const buildResult = await esbuild.build({
3434
+ write: false,
3455
3435
  entryPoints: [`${app.cwdPath}/main.ts`],
3456
3436
  bundle: true,
3457
3437
  packages: "external",
@@ -3460,7 +3440,8 @@ page.tsx_end
3460
3440
  logLevel: "warning"
3461
3441
  });
3462
3442
  const rootPackageJson = app.workspace.readJson("package.json");
3463
- const dependencies = extractDependencies(import_path4.default.join(distApp.cwdPath, "backend", "main.js"), rootPackageJson);
3443
+ const dependencies = extractDependencies(buildResult.outputFiles, rootPackageJson);
3444
+ buildResult.outputFiles.map((file) => distApp.writeFile(file.path, file.text));
3464
3445
  const appPackageJson = {
3465
3446
  name: `${app.name}/backend`,
3466
3447
  description: `${app.name} backend`,
@@ -3491,7 +3472,7 @@ page.tsx_end
3491
3472
  const { env } = await this.#prepareCommand(app, distApp, "build", "frontend");
3492
3473
  const akanConfig = await app.getConfig("build");
3493
3474
  await app.spawn("npx", ["next", "build", "--no-lint"], { env });
3494
- await esbuild.build({
3475
+ const buildResult = await esbuild.build({
3495
3476
  entryPoints: [`${app.cwdPath}/next.config.ts`],
3496
3477
  outdir: `${distApp.cwdPath}/frontend`,
3497
3478
  bundle: true,
@@ -3503,11 +3484,9 @@ page.tsx_end
3503
3484
  footer: { js: "module.exports = module.exports.default;" }
3504
3485
  });
3505
3486
  const rootPackageJson = app.workspace.readJson("package.json");
3506
- const dependencies = extractDependencies(
3507
- import_path4.default.join(distApp.cwdPath, "frontend", "next.config.js"),
3508
- rootPackageJson,
3509
- ["next", "react", "react-dom"]
3510
- );
3487
+ const dependencies = buildResult.outputFiles ? extractDependencies(buildResult.outputFiles, rootPackageJson, ["next", "react", "react-dom"]) : {};
3488
+ if (buildResult.outputFiles)
3489
+ buildResult.outputFiles.map((file) => distApp.writeFile(file.path, file.text));
3511
3490
  const appPackageJson = {
3512
3491
  name: `${app.name}/frontend`,
3513
3492
  description: `${app.name} frontend`,
@@ -4187,26 +4166,27 @@ page.tsx_end
4187
4166
  const rootPackageJson = pkg.workspace.readJson("package.json");
4188
4167
  await pkg.workspace.exec(`rm -rf dist/${pkg.name}`);
4189
4168
  await import_promises3.default.rm(`dist/pkgs/${pkg.name}`, { force: true, recursive: true });
4169
+ let buildResult;
4190
4170
  if (pkg.name === "@akanjs/config") {
4191
- await esbuild2.build({
4192
- write: true,
4171
+ buildResult = await esbuild2.build({
4172
+ write: false,
4193
4173
  entryPoints: [`${pkg.cwdPath}/index.ts`],
4194
4174
  bundle: true,
4195
4175
  packages: "external",
4196
4176
  format: "cjs",
4197
4177
  outdir: distPkg.cwdPath,
4198
- logLevel: "warning",
4178
+ logLevel: "error",
4199
4179
  plugins: [(0, import_esbuild_plugin_d.dtsPlugin)({ tsconfig: `${pkg.cwdPath}/tsconfig.json` })]
4200
4180
  });
4201
4181
  await pkg.workspace.exec(`rsync -aq ${pkg.cwdPath}/src/ ${distPkg.cwdPath}/src/`);
4202
4182
  } else if (pkg.name === "@akanjs/cli") {
4203
- await esbuild2.build({
4204
- write: true,
4183
+ buildResult = await esbuild2.build({
4184
+ write: false,
4205
4185
  entryPoints: [`${pkg.cwdPath}/index.ts`],
4206
4186
  bundle: true,
4207
4187
  packages: "external",
4208
4188
  outdir: distPkg.cwdPath,
4209
- logLevel: "warning",
4189
+ logLevel: "error",
4210
4190
  plugins: [(0, import_esbuild_plugin_d.dtsPlugin)({ tsconfig: `${pkg.cwdPath}/tsconfig.json` })]
4211
4191
  });
4212
4192
  await esbuild2.build({
@@ -4223,21 +4203,23 @@ page.tsx_end
4223
4203
  `rsync -aq --exclude="*.ts" --exclude="*.tsx" ${pkg.cwdPath}/src/templates/ ${distPkg.cwdPath}/src/templates/`
4224
4204
  );
4225
4205
  } else {
4226
- await esbuild2.build({
4227
- write: true,
4228
- entryPoints: [`${pkg.cwdPath}/index.ts`],
4229
- bundle: true,
4206
+ buildResult = await esbuild2.build({
4207
+ write: false,
4208
+ entryPoints: [`${pkg.cwdPath}/**/*.ts`, `${pkg.cwdPath}/**/*.tsx`],
4209
+ bundle: false,
4230
4210
  packages: "external",
4231
4211
  format: "cjs",
4232
- external: ["@akanjs/*"],
4212
+ // external: ["@akanjs/*"],
4233
4213
  outdir: distPkg.cwdPath,
4234
- logLevel: "warning",
4214
+ logLevel: "error",
4235
4215
  plugins: [(0, import_esbuild_plugin_d.dtsPlugin)({ tsconfig: `${pkg.cwdPath}/tsconfig.json` })]
4236
4216
  });
4237
4217
  }
4238
4218
  const pkgJson = pkg.readJson("package.json");
4239
- const dependencies = extractDependencies(`${distPkg.cwdPath}/index.js`, rootPackageJson);
4219
+ const dependencies = buildResult.outputFiles ? extractDependencies(buildResult.outputFiles, rootPackageJson) : {};
4240
4220
  const pkgPackageJson = { ...pkgJson, main: "./index.js", engines: { node: ">=22" }, dependencies };
4221
+ if (buildResult.outputFiles)
4222
+ buildResult.outputFiles.map((file) => distPkg.writeFile(file.path, file.text));
4241
4223
  distPkg.writeJson("package.json", pkgPackageJson);
4242
4224
  }
4243
4225
  };
@@ -4270,7 +4252,7 @@ page.tsx_end
4270
4252
  var import_prompts6, import_chalk, import_latest_version, import_open, QRcode, import_uuid, CloudRunner;
4271
4253
  var init_cloud_runner = __esm({
4272
4254
  "pkgs/@akanjs/cli/src/cloud/cloud.runner.ts"() {
4273
- init_src();
4255
+ init_common();
4274
4256
  init_devkit();
4275
4257
  import_prompts6 = __require("@inquirer/prompts");
4276
4258
  import_chalk = __toESM(__require("chalk"));
@@ -4650,7 +4632,7 @@ ${names.Model}.Unit.Card\uC758 \uB9AC\uC561\uD2B8 \uCEF4\uD3EC\uB10C\uD2B8\uB97C
4650
4632
  var import_prompts8, ModuleScript;
4651
4633
  var init_module_script = __esm({
4652
4634
  "pkgs/@akanjs/cli/src/module/module.script.ts"() {
4653
- init_src();
4635
+ init_common();
4654
4636
  init_devkit();
4655
4637
  import_prompts8 = __require("@inquirer/prompts");
4656
4638
  init_module_prompt();
@@ -4945,7 +4927,7 @@ ${names.Model}.Unit.Card\uC758 \uB9AC\uC561\uD2B8 \uCEF4\uD3EC\uB10C\uD2B8\uB97C
4945
4927
  var import_latest_version2, import_path5, WorkspaceScript;
4946
4928
  var init_workspace_script = __esm({
4947
4929
  "pkgs/@akanjs/cli/src/workspace/workspace.script.ts"() {
4948
- init_src();
4930
+ init_common();
4949
4931
  init_devkit();
4950
4932
  import_latest_version2 = __toESM(__require("latest-version"));
4951
4933
  import_path5 = __toESM(__require("path"));
@@ -5060,6 +5042,7 @@ ${names.Model}.Unit.Card\uC758 \uB9AC\uC561\uD2B8 \uCEF4\uD3EC\uB10C\uD2B8\uB97C
5060
5042
  init_package_command();
5061
5043
  init_page_command();
5062
5044
  init_workspace_command();
5045
+ __require("dotenv").config();
5063
5046
  void runCommands(
5064
5047
  WorkspaceCommand,
5065
5048
  ApplicationCommand,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "commonjs",
3
3
  "name": "@akanjs/cli",
4
- "version": "0.0.46",
4
+ "version": "0.0.48",
5
5
  "bin": {
6
6
  "akan": "index.js"
7
7
  },
@@ -0,0 +1,28 @@
1
+ declare const logLevels: readonly ["trace", "verbose", "debug", "log", "info", "warn", "error"];
2
+ type LogLevel = (typeof logLevels)[number];
3
+ export declare class Logger {
4
+ #private;
5
+ static level: LogLevel;
6
+ static setLevel(level: LogLevel): void;
7
+ name?: string;
8
+ constructor(name?: string);
9
+ trace(msg: string, context?: string): void;
10
+ verbose(msg: string, context?: string): void;
11
+ debug(msg: string, context?: string): void;
12
+ log(msg: string, context?: string): void;
13
+ info(msg: string, context?: string): void;
14
+ warn(msg: string, context?: string): void;
15
+ error(msg: string, context?: string): void;
16
+ raw(msg: string, method?: "console" | "process"): void;
17
+ rawLog(msg: string, method?: "console" | "process"): void;
18
+ static trace(msg: string, context?: string): void;
19
+ static verbose(msg: string, context?: string): void;
20
+ static debug(msg: string, context?: string): void;
21
+ static log(msg: string, context?: string): void;
22
+ static info(msg: string, context?: string): void;
23
+ static warn(msg: string, context?: string): void;
24
+ static error(msg: string, context?: string): void;
25
+ static rawLog(msg: string, method?: "console" | "process"): void;
26
+ static raw(msg: string, method?: "console" | "process"): void;
27
+ }
28
+ export {};
@@ -0,0 +1,3 @@
1
+ type Type<T = any> = new (...args: any[]) => T;
2
+ export declare const applyMixins: (derivedCtor: Type, constructors: (Type | undefined)[], avoidKeys?: Set<string>) => void;
3
+ export {};
@@ -0,0 +1 @@
1
+ export declare const capitalize: (str: string) => string;
@@ -0,0 +1,4 @@
1
+ export declare const deepObjectify: <T = any>(obj: T | null | undefined, option?: {
2
+ serializable?: boolean;
3
+ convertDate?: "string" | "number";
4
+ }) => T;
@@ -0,0 +1,18 @@
1
+ export type * from "./types";
2
+ export { splitVersion } from "./splitVersion";
3
+ export { deepObjectify } from "./deepObjectify";
4
+ export { pathGet } from "./pathGet";
5
+ export { isQueryEqual } from "./isQueryEqual";
6
+ export { isValidDate } from "./isValidDate";
7
+ export { objectify } from "./objectify";
8
+ export { randomPick } from "./randomPick";
9
+ export { randomPicks } from "./randomPicks";
10
+ export { pathSet } from "./pathSet";
11
+ export { isDayjs } from "./isDayjs";
12
+ export { mergeVersion } from "./mergeVersion";
13
+ export { pluralize } from "./pluralize";
14
+ export { applyMixins } from "./applyMixins";
15
+ export { capitalize } from "./capitalize";
16
+ export { Logger } from "./Logger";
17
+ export { lowerlize } from "./lowerlize";
18
+ export { sleep } from "./sleep";
@@ -0,0 +1,2 @@
1
+ import { isDayjs } from "dayjs";
2
+ export { isDayjs };
@@ -0,0 +1 @@
1
+ export declare const isQueryEqual: (value1: object | null, value2: object | null) => boolean;
@@ -0,0 +1,2 @@
1
+ import { Dayjs } from "dayjs";
2
+ export declare const isValidDate: (d: string | Date | Dayjs) => boolean;
@@ -0,0 +1 @@
1
+ export declare const lowerlize: (str: string) => string;
@@ -0,0 +1,10 @@
1
+ /**
2
+ *
3
+ * semantic version 규격에 맞게 조합하는 함수
4
+ * https://semver.org/
5
+ * @param major 릴리즈(플랫폼(google,apple,etc...)에 올라가 있는) 버전
6
+ * @param minor 릴리즈(플랫폼(google,apple,etc...)에 올라가 있는) 버전
7
+ * @param patch 코드푸시 (Framework 자체 버전)
8
+ * @returns `major.minor.patch` 형식으로 조합된 버전
9
+ */
10
+ export declare const mergeVersion: (major: number, minor: number, patch: number) => string;
@@ -0,0 +1 @@
1
+ export declare const objectify: (obj: any, keys?: string[]) => any;
@@ -0,0 +1 @@
1
+ export declare const pathGet: (path: string | (string | number)[], obj: any, separator?: string) => unknown;
@@ -0,0 +1 @@
1
+ export declare const pathSet: (obj: any, path: any, value: any) => any;
@@ -0,0 +1,2 @@
1
+ import pluralize from "pluralize";
2
+ export { pluralize };
@@ -0,0 +1 @@
1
+ export declare const randomPick: <T = any>(arr: T[] | readonly T[]) => T;
@@ -0,0 +1 @@
1
+ export declare const randomPicks: <T>(arr: T[] | readonly T[], count?: number, allowDuplicate?: boolean) => T[];
@@ -0,0 +1 @@
1
+ export declare const sleep: (ms: number) => Promise<unknown>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ *
3
+ * semantic version 규격에 맞게 major, minor, patch로 나누는 함수
4
+ * https://semver.org/
5
+ * @params version `major.minor.patch` 형식으로 조합된 버전
6
+ */
7
+ export declare const splitVersion: (version: string) => {
8
+ major: string;
9
+ minor: string;
10
+ patch: string;
11
+ };
@@ -0,0 +1,15 @@
1
+ import type { RequestPolicy } from "@urql/core";
2
+ export interface FetchPolicy<Returns = any> {
3
+ cache?: boolean | number | RequestPolicy;
4
+ crystalize?: boolean;
5
+ url?: string;
6
+ onError?: (error: string) => void;
7
+ token?: string;
8
+ partial?: string[];
9
+ transport?: "udp" | "websocket" | "graphql" | "restapi";
10
+ }
11
+ export type SnakeCase<S extends string> = S extends `${infer T}_${infer U}` ? `${Lowercase<T>}_${SnakeCase<U>}` : S;
12
+ export type SnakeCaseObj<T> = {
13
+ [K in keyof T as SnakeCase<K & string>]: T[K] extends object ? SnakeCaseObj<T[K]> : T[K];
14
+ };
15
+ export type SnakeMsg<Msg> = SnakeCaseObj<Msg>;