@akanjs/devkit 3.2.0-rc.12 → 3.2.0-rc.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/devkit",
3
- "version": "3.2.0-rc.12",
3
+ "version": "3.2.0-rc.14",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -41,7 +41,7 @@
41
41
  "./*": "./*.ts"
42
42
  },
43
43
  "dependencies": {
44
- "@akanjs/language": "3.2.0-rc.12",
44
+ "@akanjs/language": "3.2.0-rc.14",
45
45
  "@earendil-works/pi-agent-core": "1.3.0",
46
46
  "@earendil-works/pi-ai": "1.3.0",
47
47
  "@earendil-works/pi-codemode": "1.3.0",
@@ -50,7 +50,7 @@
50
50
  "@earendil-works/pi-tui": "1.3.0",
51
51
  "@inquirer/prompts": "^8.7.3",
52
52
  "@tailwindcss/node": "^4.3.3",
53
- "akanjs": "3.2.0-rc.12",
53
+ "akanjs": "3.2.0-rc.14",
54
54
  "chalk": "^6.0.1",
55
55
  "commander": "^15.0.0",
56
56
  "dayjs": "^1.11.23",
package/scanInfo.ts CHANGED
@@ -10,7 +10,8 @@ import type {
10
10
  ScanResult,
11
11
  } from "./akanConfig";
12
12
  import { AkanAppConfig } from "./akanConfig";
13
- import { AppExecutor, LibExecutor, PkgExecutor, WorkspaceExecutor } from "./executors";
13
+ import type { AppExecutor, LibExecutor, PkgExecutor } from "./executors";
14
+ import { WorkspaceExecutor } from "./executors/workspaceExecutor";
14
15
  import {
15
16
  barrelFacetDirs,
16
17
  facetIndexShadowOf,
@@ -23,6 +24,9 @@ import {
23
24
  rootEntryHintOf,
24
25
  } from "./workspaceLayout";
25
26
 
27
+ //? Imported on use: sysExecutor.ts imports this file, so a static import would load a SysExecutor subclass first.
28
+ const loadLibExecutor = () => import("./executors/libExecutor");
29
+
26
30
  const scalarFileTypes = ["constant", "dictionary", "document", "template", "unit", "util", "view", "zone"] as const;
27
31
  type ScalarFileType = (typeof scalarFileTypes)[number];
28
32
  const serviceFileTypes = [
@@ -315,11 +319,11 @@ export class AppInfo extends ScanInfo {
315
319
  const existingAppInfo = AppInfo.appInfos.get(exec.name);
316
320
  if (existingAppInfo && !options.refresh) return existingAppInfo;
317
321
  const scanResult = await ScanInfo.getScanResult(exec);
318
-
322
+ const libModule = await loadLibExecutor();
319
323
  await Promise.all(
320
324
  scanResult.libDeps.map(async (libName) => {
321
325
  LibInfo.loadedLibs.add(libName);
322
- const libExecutor = LibExecutor.from(exec, libName);
326
+ const libExecutor = libModule.LibExecutor.from(exec, libName);
323
327
  LibInfo.libInfos.set(libName, await LibInfo.fromExecutor(libExecutor));
324
328
  }),
325
329
  );
@@ -368,11 +372,12 @@ export class AppInfo extends ScanInfo {
368
372
  }
369
373
 
370
374
  static async #getAllLibDeps(exec: AppExecutor, libDeps: string[], libSet = new Set<string>()) {
375
+ const libModule = await loadLibExecutor();
371
376
  await Promise.all(
372
377
  libDeps.map(async (libName) => {
373
378
  if (libSet.has(libName)) return;
374
379
  libSet.add(libName);
375
- const libExecutor = LibExecutor.from(exec, libName);
380
+ const libExecutor = libModule.LibExecutor.from(exec, libName);
376
381
  const libInfo = await LibInfo.fromExecutor(libExecutor);
377
382
  const libScanResult = libInfo.getScanResult();
378
383
  if (libScanResult.libDeps.length > 0) await AppInfo.#getAllLibDeps(exec, libScanResult.libDeps, libSet);
@@ -412,12 +417,13 @@ export class LibInfo extends ScanInfo {
412
417
  if (existingLibInfo && !refresh) return existingLibInfo;
413
418
 
414
419
  const scanResult = await ScanInfo.getScanResult(exec);
420
+ const libModule = await loadLibExecutor();
415
421
  await Promise.all(
416
422
  scanResult.libDeps
417
423
  .filter((libName) => !LibInfo.loadedLibs.has(libName))
418
424
  .map(async (libName) => {
419
425
  LibInfo.loadedLibs.add(libName);
420
- const libExecutor = LibExecutor.from(exec, libName);
426
+ const libExecutor = libModule.LibExecutor.from(exec, libName);
421
427
  LibInfo.libInfos.set(libName, await LibInfo.fromExecutor(libExecutor));
422
428
  }),
423
429
  );
@@ -512,11 +518,16 @@ export class WorkspaceInfo {
512
518
  if (existingWorkspaceInfo && !options.refresh) return existingWorkspaceInfo;
513
519
 
514
520
  const [appNames, libNames, pkgNames] = await Promise.all([exec.getApps(), exec.getLibs(), exec.getPkgs()]);
521
+ const [appModule, libModule, pkgModule] = await Promise.all([
522
+ import("./executors/appExecutor"),
523
+ loadLibExecutor(),
524
+ import("./executors/pkgExecutor"),
525
+ ]);
515
526
  // TODO: prevent duplicate scan by resolving the dependency graph
516
527
  const [appInfos, libInfos, pkgInfos] = await Promise.all([
517
- Promise.all(appNames.map(async (appName) => await AppExecutor.from(exec, appName).scan())),
518
- Promise.all(libNames.map(async (libName) => await LibExecutor.from(exec, libName).scan())),
519
- Promise.all(pkgNames.map(async (pkgName) => await PkgExecutor.from(exec, pkgName).scan())),
528
+ Promise.all(appNames.map(async (appName) => await appModule.AppExecutor.from(exec, appName).scan())),
529
+ Promise.all(libNames.map(async (libName) => await libModule.LibExecutor.from(exec, libName).scan())),
530
+ Promise.all(pkgNames.map(async (pkgName) => await pkgModule.PkgExecutor.from(exec, pkgName).scan())),
520
531
  ]);
521
532
  const workspaceInfo = new WorkspaceInfo(
522
533
  new Map(appInfos.map((app) => [app.exec.name, app as AppInfo])),