@akanjs/cli 3.0.2-rc.0 → 3.0.2

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/.build-stamp CHANGED
@@ -1 +1 @@
1
- c31eecf11ee8f610ce7edf00cf821f2581e4c43607cc31c2abe56abce74a7066
1
+ ed6c6a9442699bc1b0b2b6ddbe72d0cdd440f78e0d21be5e06bc85a7790491eb
@@ -12,11 +12,11 @@ import"./index-50wb2a26.js";
12
12
  import {
13
13
  getMobileTargetChoices
14
14
  } from "./index-jk9xnck6.js";
15
- import"./index-senscydg.js";
15
+ import"./index-k9rrten6.js";
16
16
  import"./index-1bjkfvm9.js";
17
17
  import {
18
18
  ApplicationScript
19
- } from "./index-61mmsdjg.js";
19
+ } from "./index-nwd6qzvv.js";
20
20
  import"./index-7md2g9vw.js";
21
21
  import"./index-50jjwg8y.js";
22
22
 
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  Spinner
4
4
  } from "./index-50wb2a26.js";
5
- import"./index-krjcg4y6.js";
5
+ import"./index-gtjgnv36.js";
6
6
  import {
7
7
  AllRoutesBuilder,
8
8
  CsrArtifactBuilder,
9
9
  FontPruner,
10
10
  precompressArtifacts,
11
11
  SsrBaseArtifactBuilder
12
- } from "./index-d95tfg3n.js";
12
+ } from "./index-z750gk1j.js";
13
13
  import"./index-52w0fvh8.js";
14
14
  import"./index-n68jx79w.js";
15
15
 
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  ApplicationBuildReporter
4
- } from "./index-senscydg.js";
4
+ } from "./index-k9rrten6.js";
5
5
  import {
6
6
  resolveSsrPageEntriesForApp,
7
7
  WorkspaceExecutor,
@@ -14,14 +14,14 @@ import {
14
14
  PagesBundleBuilder,
15
15
  CsrDevBundler,
16
16
  SsrDevBundler
17
- } from "./index-krjcg4y6.js";
17
+ } from "./index-gtjgnv36.js";
18
18
  import"./index-52w0fvh8.js";
19
19
  import {
20
20
  CsrArtifactBuilder,
21
21
  CssCompiler,
22
22
  FontOptimizer,
23
23
  SsrBaseArtifactBuilder
24
- } from "./index-d95tfg3n.js";
24
+ } from "./index-z750gk1j.js";
25
25
  import"./index-n68jx79w.js";
26
26
 
27
27
  // pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts
@@ -11,16 +11,16 @@ import"./index-50wb2a26.js";
11
11
  import {
12
12
  PlatformTestRun
13
13
  } from "./index-hxnnfy57.js";
14
- import"./index-senscydg.js";
14
+ import"./index-k9rrten6.js";
15
15
  import"./index-jk9xnck6.js";
16
16
  import"./index-1bjkfvm9.js";
17
- import"./index-61mmsdjg.js";
17
+ import"./index-nwd6qzvv.js";
18
18
  import"./index-7md2g9vw.js";
19
19
  import"./index-2ahj896a.js";
20
20
  import"./index-3xmzr1p1.js";
21
21
  import {
22
22
  CloudScript2
23
- } from "./index-gvpvxdm1.js";
23
+ } from "./index-t91a7339.js";
24
24
  import"./index-50jjwg8y.js";
25
25
 
26
26
  // pkgs/@akanjs/cli/cloud/cloud.command.ts
@@ -1,17 +1,17 @@
1
1
  // @bun
2
2
  import {
3
3
  CloudScript2
4
- } from "./index-gvpvxdm1.js";
4
+ } from "./index-t91a7339.js";
5
5
  import"./index-hxnnfy57.js";
6
6
  import"./index-3xmzr1p1.js";
7
- import"./index-61mmsdjg.js";
7
+ import"./index-nwd6qzvv.js";
8
8
  import"./index-50jjwg8y.js";
9
9
  import"./index-1bjkfvm9.js";
10
10
  import"./index-jk9xnck6.js";
11
11
  import"./index-94s080qm.js";
12
12
  import"./index-q6ft9fkc.js";
13
13
  import"./index-7md2g9vw.js";
14
- import"./index-senscydg.js";
14
+ import"./index-k9rrten6.js";
15
15
  import"./index-50wb2a26.js";
16
16
  import"./index-2ahj896a.js";
17
17
  import"./index-52w0fvh8.js";
@@ -3,7 +3,7 @@ import {
3
3
  ApplicationBuildReporter,
4
4
  HmrWatcher,
5
5
  WatchRootResolver
6
- } from "./index-senscydg.js";
6
+ } from "./index-k9rrten6.js";
7
7
  import {
8
8
  CodegenLock,
9
9
  WorkspaceExecutor,
@@ -20,7 +20,7 @@ import {
20
20
  DevChangePlanner,
21
21
  DevGeneratedIndexSync,
22
22
  SsrDevBundler
23
- } from "./index-krjcg4y6.js";
23
+ } from "./index-gtjgnv36.js";
24
24
  import {
25
25
  prepareDevWatchBatch
26
26
  } from "./index-a5vmm6x4.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  SOURCE_EXTS,
4
4
  WatchRootResolver
5
- } from "./index-senscydg.js";
5
+ } from "./index-k9rrten6.js";
6
6
  import {
7
7
  FileSys2
8
8
  } from "./index-52w0fvh8.js";
@@ -80,6 +80,11 @@ import path3 from "path";
80
80
 
81
81
  // pkgs/@akanjs/devkit/akanApp/devHostPolicy.ts
82
82
  import path2 from "path";
83
+ var UNAVAILABLE_REDIS_HOST = "redis-tunnel-unavailable.invalid";
84
+ var redisTunnelPolicy = ({
85
+ environment,
86
+ databaseMode
87
+ }) => environment === "local" ? "none" : databaseMode === "single" ? "optional" : "required";
83
88
  var BACKEND_RECOVERY_MAX_ATTEMPTS = 5;
84
89
  var HELD_BUILDER_REQUEST_LIMIT = 64;
85
90
  var BUILDER_MIN_RSS_RECYCLE_INTERVAL_MS = 30000;
@@ -833,4 +838,4 @@ class WatchRootResolver {
833
838
  }
834
839
  }
835
840
 
836
- export { ApplicationBuildReporter, BUILDER_MIN_RSS_RECYCLE_INTERVAL_MS, SOURCE_EXTS, shouldRestartBackendByDevPlan, shouldRestartBuilderByDevPlan, shouldAbandonBackendRecovery, normalizeBackendReportedGeneration, shouldRestartDevHostByDevPlan, devHostStateOf, isLegacyBackendFallbackFile, shouldMarkBuildPhaseRecovered, shouldKeepBuildFailure, createBackendBuildStatus, backendRestartReasonFromMessage, mergeBackendRestartReasons, shouldReplaceLastGoodMessage, shouldQueueBuildStatusReplay, hasBuildFailureForGeneration, decideBuilderRssRecycle, decideBuilderRssSettle, decideIdleSuspend, resolveIdleSuspendMs, hasAnyBuildFailure, shouldRefreshConfigOnIdleWake, shouldHoldForReturningBuilder, shouldWarnBuilderRssCeilingTight, isRssCeilingUnreachable, shouldRelayRecycledFrontendState, mergeInvalidateMessages, buildStatusReplaySequence, filesChangedSince, HmrWatcher, WatchRootResolver };
841
+ export { ApplicationBuildReporter, UNAVAILABLE_REDIS_HOST, redisTunnelPolicy, BUILDER_MIN_RSS_RECYCLE_INTERVAL_MS, SOURCE_EXTS, shouldRestartBackendByDevPlan, shouldRestartBuilderByDevPlan, shouldAbandonBackendRecovery, normalizeBackendReportedGeneration, shouldRestartDevHostByDevPlan, devHostStateOf, isLegacyBackendFallbackFile, shouldMarkBuildPhaseRecovered, shouldKeepBuildFailure, createBackendBuildStatus, backendRestartReasonFromMessage, mergeBackendRestartReasons, shouldReplaceLastGoodMessage, shouldQueueBuildStatusReplay, hasBuildFailureForGeneration, decideBuilderRssRecycle, decideBuilderRssSettle, decideIdleSuspend, resolveIdleSuspendMs, hasAnyBuildFailure, shouldRefreshConfigOnIdleWake, shouldHoldForReturningBuilder, shouldWarnBuilderRssCeilingTight, isRssCeilingUnreachable, shouldRelayRecycledFrontendState, mergeInvalidateMessages, buildStatusReplaySequence, filesChangedSince, HmrWatcher, WatchRootResolver };
@@ -1,6 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  ApplicationBuildReporter,
4
+ UNAVAILABLE_REDIS_HOST,
5
+ redisTunnelPolicy,
4
6
  BUILDER_MIN_RSS_RECYCLE_INTERVAL_MS,
5
7
  SOURCE_EXTS,
6
8
  shouldRestartBackendByDevPlan,
@@ -33,7 +35,7 @@ import {
33
35
  filesChangedSince,
34
36
  HmrWatcher,
35
37
  WatchRootResolver
36
- } from "./index-senscydg.js";
38
+ } from "./index-k9rrten6.js";
37
39
  import {
38
40
  runner,
39
41
  script
@@ -187,20 +189,29 @@ var closeBunSocket = (socket, error) => {
187
189
  // pkgs/@akanjs/devkit/createTunnel.ts
188
190
  var createTunnel = async (service, { app, environment, port = service === "postgres" ? 5432 : 6379 }) => {
189
191
  const { serveDomain, repoName } = WorkspaceExecutor.getBaseDevEnv();
190
- await createSshTunnel({
191
- localHost: "0.0.0.0",
192
- localPort: port,
193
- srcHost: "0.0.0.0",
194
- srcPort: port,
195
- dstHost: `${service}-0.${service}-svc.${app.name}-${environment}.svc.cluster.local`,
196
- dstPort: service === "postgres" ? 5432 : 6379,
197
- sshOptions: {
198
- host: `${app.name}-${environment}.${serveDomain}`,
199
- port: process.env.SSH_TUNNEL_PORT ? parseInt(process.env.SSH_TUNNEL_PORT) : 32767,
200
- username: process.env.SSH_TUNNEL_USERNAME ?? "root",
201
- password: process.env.SSH_TUNNEL_PASSWORD ?? repoName
202
- }
203
- });
192
+ const host = `${app.name}-${environment}.${serveDomain}`;
193
+ const sshPort = process.env.SSH_TUNNEL_PORT ? parseInt(process.env.SSH_TUNNEL_PORT) : 32767;
194
+ const dstHost = `${service}-0.${service}-svc.${app.name}-${environment}.svc.cluster.local`;
195
+ const dstPort = service === "postgres" ? 5432 : 6379;
196
+ try {
197
+ await createSshTunnel({
198
+ localHost: "0.0.0.0",
199
+ localPort: port,
200
+ srcHost: "0.0.0.0",
201
+ srcPort: port,
202
+ dstHost,
203
+ dstPort,
204
+ sshOptions: {
205
+ host: host.endsWith(".localhost") ? "localhost" : host,
206
+ port: sshPort,
207
+ username: process.env.SSH_TUNNEL_USERNAME ?? "root",
208
+ password: process.env.SSH_TUNNEL_PASSWORD ?? repoName
209
+ }
210
+ });
211
+ } catch (error) {
212
+ const reasons = error instanceof AggregateError ? error.errors.map((reason) => reason instanceof Error ? reason.message : String(reason)).join("; ") : error instanceof Error ? error.message : String(error);
213
+ throw new Error(`Could not open the ${service} tunnel for ${app.name}-${environment}: SSH ${host}:${sshPort} -> ${dstHost}:${dstPort} failed (${reasons})`, { cause: error });
214
+ }
204
215
  return `localhost:${port}`;
205
216
  };
206
217
  // pkgs/@akanjs/devkit/incrementalBuilder/incrementalBuilder.host.ts
@@ -818,9 +829,17 @@ class AkanAppHost {
818
829
  }
819
830
  async#prepareDatabase(type) {
820
831
  const environment = WorkspaceExecutor.getBaseDevEnv().env;
821
- if (environment === "local")
832
+ const policy = redisTunnelPolicy({ environment, databaseMode: this.env.AKAN_DATABASE_MODE });
833
+ if (policy === "none")
822
834
  return "localhost";
823
- return await createTunnel(type, { app: this.app, environment });
835
+ if (policy === "required")
836
+ return await createTunnel(type, { app: this.app, environment });
837
+ try {
838
+ return await createTunnel(type, { app: this.app, environment });
839
+ } catch (error) {
840
+ this.logger.warn(`${error instanceof Error ? error.message : String(error)} - continuing without Redis: the single database mode does not use it unless an app adaptor does`);
841
+ return UNAVAILABLE_REDIS_HOST;
842
+ }
824
843
  }
825
844
  #startBackend(startStatus = null) {
826
845
  if (this.#stopping)
@@ -1867,7 +1886,7 @@ ${uniqueCandidates.map((candidate) => ` - ${candidate}`).join(`
1867
1886
 
1868
1887
  // pkgs/@akanjs/cli/application/application.runner.ts
1869
1888
  import { Logger as Logger3 } from "akanjs/common";
1870
- var loadBuildRunner = async () => (await import("./applicationBuildRunner-etrzfwjj.js")).ApplicationBuildRunner;
1889
+ var loadBuildRunner = async () => (await import("./applicationBuildRunner-wx09n9g6.js")).ApplicationBuildRunner;
1871
1890
  var loadPrompts = async () => await import("@inquirer/prompts");
1872
1891
 
1873
1892
  class ApplicationRunner extends runner("application") {
@@ -11,7 +11,7 @@ import {
11
11
  } from "./index-50wb2a26.js";
12
12
  import {
13
13
  ApplicationScript
14
- } from "./index-61mmsdjg.js";
14
+ } from "./index-nwd6qzvv.js";
15
15
  import {
16
16
  PackageScript
17
17
  } from "./index-3xmzr1p1.js";
@@ -16,10 +16,10 @@ import {
16
16
  CsrEntryFiles,
17
17
  PagesEntrySourceGenerator,
18
18
  PagesBundleBuilder
19
- } from "./index-krjcg4y6.js";
19
+ } from "./index-gtjgnv36.js";
20
20
  import {
21
21
  SOURCE_EXTS
22
- } from "./index-senscydg.js";
22
+ } from "./index-k9rrten6.js";
23
23
  var __require = import.meta.require;
24
24
 
25
25
  // pkgs/@akanjs/devkit/frontendBuild/allRoutesBuilder.ts
package/index.js CHANGED
@@ -13,18 +13,18 @@ import path from "path";
13
13
 
14
14
  // pkgs/@akanjs/cli/commandModules.ts
15
15
  var commandModules = {
16
- workspace: async () => (await import("./workspace.command-17c46dbp.js")).WorkspaceCommand,
16
+ workspace: async () => (await import("./workspace.command-vp6vmx3z.js")).WorkspaceCommand,
17
17
  agent: async () => (await import("./agent.command-np1dffkb.js")).AgentCommand,
18
18
  code: async () => (await import("./code.command-hmtx14b2.js")).CodeCommand,
19
- application: async () => (await import("./application.command-fyjy9ryc.js")).ApplicationCommand,
19
+ application: async () => (await import("./application.command-gk69v1xs.js")).ApplicationCommand,
20
20
  library: async () => (await import("./library.command-9m2rdwwz.js")).LibraryCommand,
21
- localRegistry: async () => (await import("./localRegistry.command-vacc2njh.js")).LocalRegistryCommand,
21
+ localRegistry: async () => (await import("./localRegistry.command-kda81jyk.js")).LocalRegistryCommand,
22
22
  package: async () => (await import("./package.command-y2jh0m99.js")).PackageCommand,
23
23
  module: async () => (await import("./module.command-q63dffya.js")).ModuleCommand,
24
24
  page: async () => (await import("./page.command-f3e4cwhh.js")).PageCommand,
25
25
  context: async () => (await import("./context.command-6aqvdx43.js")).ContextCommand,
26
- cloud: async () => (await import("./cloud.command-c0rnwy65.js")).CloudCommand,
27
- subspace: async () => (await import("./subspace.command-j7ayp382.js")).SubspaceCommand,
26
+ cloud: async () => (await import("./cloud.command-tw06613r.js")).CloudCommand,
27
+ subspace: async () => (await import("./subspace.command-ft65qvc4.js")).SubspaceCommand,
28
28
  guideline: async () => (await import("./guideline.command-axvf68gc.js")).GuidelineCommand,
29
29
  scalar: async () => (await import("./scalar.command-kddn7av4.js")).ScalarCommand,
30
30
  primitive: async () => (await import("./primitive.command-r4kq75qj.js")).PrimitiveCommand,
@@ -9,12 +9,12 @@ import"./index-52w0fvh8.js";
9
9
  import {
10
10
  PkgExecutor
11
11
  } from "./index-50wb2a26.js";
12
- import"./index-senscydg.js";
12
+ import"./index-k9rrten6.js";
13
13
  import"./index-jk9xnck6.js";
14
14
  import"./index-1bjkfvm9.js";
15
15
  import {
16
16
  ApplicationScript
17
- } from "./index-61mmsdjg.js";
17
+ } from "./index-nwd6qzvv.js";
18
18
  import"./index-7md2g9vw.js";
19
19
  import"./index-94s080qm.js";
20
20
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/cli",
3
- "version": "3.0.2-rc.0",
3
+ "version": "3.0.2",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -39,7 +39,7 @@
39
39
  "@earendil-works/pi-tui": "0.86.1",
40
40
  "@inquirer/prompts": "^8.4.3",
41
41
  "@tailwindcss/node": "^4.3.0",
42
- "akanjs": "3.0.2-rc.0",
42
+ "akanjs": "3.0.2",
43
43
  "chalk": "^5.6.2",
44
44
  "commander": "^14.0.3",
45
45
  "dayjs": "^1.11.20",
@@ -714,7 +714,7 @@ class SubspaceRunner extends runner("subspace") {
714
714
  if (!asked)
715
715
  return { name: subspace.name, workspaceId, host, apps, libs: [], outcome: "cancelled", files: [] };
716
716
  const { libs } = await subspace.slice();
717
- const { CloudScript } = await import("./cloud.script-6ba8e9v8.js");
717
+ const { CloudScript } = await import("./cloud.script-64gzba8r.js");
718
718
  const { files } = await CommandContainer.get(CloudScript).uploadEnv(workspace, {
719
719
  host,
720
720
  workspaceId,
@@ -12,10 +12,5 @@
12
12
  }
13
13
  ]
14
14
  },
15
- "include": ["./**/*.ts", "./**/*.tsx", ".next/types/**/*.ts"],
16
- "references": [
17
- {
18
- "path": "./tsconfig.spec.json"
19
- }
20
- ]
15
+ "include": ["./**/*.ts", "./**/*.tsx", ".next/types/**/*.ts"]
21
16
  }
@@ -38,14 +38,14 @@ import"./index-zzvvc845.js";
38
38
  import {
39
39
  AgentScript
40
40
  } from "./index-1gs9g12n.js";
41
- import"./index-senscydg.js";
41
+ import"./index-k9rrten6.js";
42
42
  import"./index-jk9xnck6.js";
43
43
  import {
44
44
  LibraryScript
45
45
  } from "./index-1bjkfvm9.js";
46
46
  import {
47
47
  ApplicationScript
48
- } from "./index-61mmsdjg.js";
48
+ } from "./index-nwd6qzvv.js";
49
49
  import"./index-7md2g9vw.js";
50
50
  import"./index-2ahj896a.js";
51
51
  import {
@@ -57,7 +57,7 @@ import {
57
57
  } from "./index-hxnnfy57.js";
58
58
  import {
59
59
  CloudScript2
60
- } from "./index-gvpvxdm1.js";
60
+ } from "./index-t91a7339.js";
61
61
  import"./index-j38qkvkk.js";
62
62
  import"./index-hp3stk1m.js";
63
63
  import"./index-g38nhv87.js";