@akanjs/cli 3.1.0-rc.1 → 3.1.0-rc.3

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 (74) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-kyprmy06.js → CodeAgent-ctk4fh2b.js} +2 -2
  3. package/{CodeTui-21mtze3j.js → CodeTui-mrxtrdzw.js} +1 -1
  4. package/TunnelShare-rj74jd6x.js +13 -0
  5. package/{agent.command-f3gsc1gd.js → agent.command-ncre6kwz.js} +5 -5
  6. package/akanCode.js +2 -2
  7. package/{application.command-5s780vnz.js → application.command-54mawreg.js} +52 -41
  8. package/{applicationBuildRunner-1yaqsrdq.js → applicationBuildRunner-8573zr2w.js} +16 -30
  9. package/buildBatch.proc.js +22 -13
  10. package/{cloud.command-yj6xb2a7.js → cloud.command-nyemv0m3.js} +57 -65
  11. package/cloud.script-ht6yb203.js +23 -0
  12. package/{code.command-3wkn4ja5.js → code.command-spsrzg63.js} +6 -6
  13. package/{context.command-9jjn3gcw.js → context.command-768zv7z4.js} +16 -13
  14. package/context.runner-tf1b53qq.js +24 -0
  15. package/{guideline.command-dtczrqpf.js → guideline.command-4ycwc51q.js} +2 -2
  16. package/guidelines/conventions/conventions.instruction.md +28 -15
  17. package/guidelines/cssRule/cssRule.instruction.md +12 -6
  18. package/guidelines/mcpRule/mcpRule.instruction.md +27 -11
  19. package/guidelines/runtimeRule/runtimeRule.instruction.md +24 -15
  20. package/guidelines/transportRule/transportRule.instruction.md +28 -5
  21. package/incrementalBuilder.proc.js +9 -6
  22. package/{index-2etcv0sc.js → index-00seamy5.js} +1 -1
  23. package/{index-jx4bzvwg.js → index-1a7nhq56.js} +92 -52
  24. package/{index-e0cvze1s.js → index-1nyxvz8j.js} +4 -4
  25. package/index-2z3kykvd.js +248 -0
  26. package/{index-rtct7d43.js → index-3675mvjw.js} +1 -1
  27. package/{index-56d2g8ms.js → index-3ddt3qjg.js} +1 -1
  28. package/{index-6jjtnhkw.js → index-3x7yeecy.js} +51 -9
  29. package/{index-ww9bhp67.js → index-4pf8g7ff.js} +1 -1
  30. package/index-8935h3n1.js +33 -0
  31. package/{index-v29746vb.js → index-8eqkxwsx.js} +3 -3
  32. package/{index-c2yrsxdh.js → index-91rt5bye.js} +96 -320
  33. package/{index-55mynnqs.js → index-bv210r6t.js} +459 -210
  34. package/{index-c76k723e.js → index-c4h5b5nq.js} +2 -2
  35. package/{index-qt22xstj.js → index-c9zjb3tw.js} +5 -3
  36. package/{index-c1x0be5j.js → index-dmsvd2rv.js} +2 -2
  37. package/index-ec080x99.js +1124 -0
  38. package/{index-ctanya41.js → index-fjqvd5mx.js} +4 -4
  39. package/{index-aprt7pkz.js → index-fvn6f5wx.js} +229 -1327
  40. package/{index-rc5rwyps.js → index-jj7yapwq.js} +71 -60
  41. package/index-kmamh5bv.js +241 -0
  42. package/{index-fm46xrf1.js → index-q5abh0jq.js} +3 -3
  43. package/{index-1w2qaee2.js → index-qf8g88j9.js} +361 -291
  44. package/{index-gnyf1fqy.js → index-qvghfv6v.js} +2 -2
  45. package/{index-ae5pwhgs.js → index-r5d6rq19.js} +10 -8
  46. package/{index-2mx692qq.js → index-vhfjzda3.js} +2 -2
  47. package/{index-8r4d7cmt.js → index-w9b71b6y.js} +4 -4
  48. package/{index-8ggztp8k.js → index-wanhh011.js} +42 -177
  49. package/{index-05g3jayg.js → index-wdze51wz.js} +1 -1
  50. package/index-wjqbc7sf.js +668 -0
  51. package/{index-rwq3ekqc.js → index-xf40a295.js} +7 -7
  52. package/{index-krq7btbt.js → index-xm5tmpv0.js} +3 -3
  53. package/index.js +22 -22
  54. package/{library.command-gaga5bmq.js → library.command-88ahgych.js} +3 -3
  55. package/{localRegistry.command-vsreyy42.js → localRegistry.command-ykea1m7b.js} +12 -9
  56. package/{module.command-7vpf6db4.js → module.command-zky4b7m9.js} +5 -5
  57. package/{package.command-twmvvf69.js → package.command-vh8pcedh.js} +3 -3
  58. package/package.json +2 -2
  59. package/{page.command-5asq7fdf.js → page.command-fyqeqxc3.js} +3 -3
  60. package/{pipeline.command-d0v38572.js → pipeline.command-r5t30py6.js} +220 -219
  61. package/{primitive.command-dyrs2fm8.js → primitive.command-a0516zfk.js} +6 -6
  62. package/{projectTypecheck-cvtkrzp2.js → projectTypecheck-7djd4z50.js} +1 -1
  63. package/{quality.command-6emsqpbg.js → quality.command-k7jcnfn0.js} +2 -2
  64. package/{repair.command-8t6aegv5.js → repair.command-85zg2an3.js} +5 -5
  65. package/{scalar.command-bnggy1x7.js → scalar.command-g5vmqwca.js} +4 -4
  66. package/{subspace.command-md2teygq.js → subspace.command-mp4evgsj.js} +421 -362
  67. package/{tunnel.command-jx3tdm2d.js → tunnel.command-kbnr99sj.js} +7 -4
  68. package/{workflow.command-jx0wag5r.js → workflow.command-9y9p1n8y.js} +10 -10
  69. package/{workspace.command-yxd7rr7g.js → workspace.command-jmec2kjg.js} +33 -30
  70. package/TunnelShare-q4jq08qg.js +0 -9
  71. package/cloud.script-h6pvcpa2.js +0 -20
  72. package/context.runner-atcrzz5b.js +0 -21
  73. package/index-6w0rbr9d.js +0 -68
  74. package/index-pgj2rt78.js +0 -404
package/.build-stamp CHANGED
@@ -1 +1 @@
1
- ee31653f86d9a17de2cf6fbfbfb3f585db1d135b4d2fa1dceaa1e6faee5fa437
1
+ f6be05c6146350a182c921b0d0fe46efe9d3f1d211b8ec3c2978f83a3d11567e
@@ -1,8 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  CodeAgent2
4
- } from "./index-krq7btbt.js";
5
- import"./index-rtct7d43.js";
4
+ } from "./index-xm5tmpv0.js";
5
+ import"./index-3675mvjw.js";
6
6
  import"./index-7md2g9vw.js";
7
7
  export {
8
8
  CodeAgent2 as CodeAgent
@@ -4,7 +4,7 @@ import {
4
4
  McpServerConfig,
5
5
  McpTokenStore,
6
6
  McpSignIn
7
- } from "./index-rtct7d43.js";
7
+ } from "./index-3675mvjw.js";
8
8
  import {
9
9
  CodeTuiLines2,
10
10
  CodeTuiAgents2,
@@ -0,0 +1,13 @@
1
+ // @bun
2
+ import {
3
+ TunnelShare2
4
+ } from "./index-3ddt3qjg.js";
5
+ import"./index-wjqbc7sf.js";
6
+ import"./index-qf8g88j9.js";
7
+ import"./index-2z3kykvd.js";
8
+ import"./index-ec080x99.js";
9
+ import"./index-bv210r6t.js";
10
+ import"./index-52w0fvh8.js";
11
+ export {
12
+ TunnelShare2 as TunnelShare
13
+ };
@@ -2,16 +2,16 @@
2
2
  import {
3
3
  Workspace,
4
4
  command
5
- } from "./index-6jjtnhkw.js";
5
+ } from "./index-3x7yeecy.js";
6
6
  import"./index-52w0fvh8.js";
7
- import"./index-55mynnqs.js";
7
+ import"./index-bv210r6t.js";
8
8
  import"./index-hj6w4ka1.js";
9
- import"./index-05g3jayg.js";
10
- import"./index-2mx692qq.js";
9
+ import"./index-wdze51wz.js";
10
+ import"./index-vhfjzda3.js";
11
11
  import"./index-zzvvc845.js";
12
12
  import {
13
13
  AgentScript
14
- } from "./index-v29746vb.js";
14
+ } from "./index-8eqkxwsx.js";
15
15
 
16
16
  // pkgs/@akanjs/cli/agent/agent.command.ts
17
17
  class AgentCommand extends command("agent", [AgentScript], ({ public: target }) => ({
package/akanCode.js CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  CodeMailbox2,
29
29
  CodeSessionFork2,
30
30
  CodeAgent2
31
- } from "./index-krq7btbt.js";
31
+ } from "./index-xm5tmpv0.js";
32
32
  import {
33
33
  akanCodeDefaultModel2,
34
34
  akanCodeModel2,
@@ -39,7 +39,7 @@ import {
39
39
  import {
40
40
  SubagentPool2,
41
41
  akanCodePaths2
42
- } from "./index-rtct7d43.js";
42
+ } from "./index-3675mvjw.js";
43
43
  import"./index-7md2g9vw.js";
44
44
  import {
45
45
  CodeAgentRpcHost2
@@ -3,30 +3,33 @@ import {
3
3
  App,
4
4
  Apps,
5
5
  Sys,
6
+ SysOrOnlyApp,
6
7
  Exec,
7
8
  Workspace,
8
9
  command
9
- } from "./index-6jjtnhkw.js";
10
+ } from "./index-3x7yeecy.js";
10
11
  import"./index-52w0fvh8.js";
11
- import"./index-55mynnqs.js";
12
- import"./index-1w2qaee2.js";
12
+ import"./index-bv210r6t.js";
13
13
  import"./index-k9rrten6.js";
14
- import"./index-c1x0be5j.js";
14
+ import"./index-kmamh5bv.js";
15
+ import"./index-qf8g88j9.js";
16
+ import"./index-ec080x99.js";
17
+ import"./index-dmsvd2rv.js";
15
18
  import {
16
19
  ApplicationScript
17
- } from "./index-jx4bzvwg.js";
20
+ } from "./index-1a7nhq56.js";
18
21
  import"./index-7md2g9vw.js";
19
- import"./index-qt22xstj.js";
20
22
  import {
21
- getMobileTargetChoices
22
- } from "./index-q958tqqg.js";
23
+ writeOption,
24
+ nativeTargetOption,
25
+ releaseEnvOption,
26
+ allowLocalOption,
27
+ publicEnvOption
28
+ } from "./index-8935h3n1.js";
29
+ import"./index-c9zjb3tw.js";
30
+ import"./index-2z3kykvd.js";
23
31
 
24
32
  // pkgs/@akanjs/cli/application/application.command.ts
25
- var mobileTargetOption = {
26
- desc: "native target name (a key of native.targets) or all",
27
- ask: "Select native target",
28
- enum: async ({ app }) => await getMobileTargetChoices(app)
29
- };
30
33
  var deviceOption = {
31
34
  desc: "simulator, emulator or device to run on: its id or name (e.g. 'iPhone 17' or 'Pixel_10')",
32
35
  default: ""
@@ -41,11 +44,6 @@ var startEnvOption = {
41
44
  desc: "backend environment of a --release build; a dev build follows `akan start`, which keeps its own",
42
45
  default: "local"
43
46
  };
44
- var releaseEnvOption = {
45
- enum: ["debug", "develop", "main", "local"],
46
- desc: "backend environment",
47
- default: "main"
48
- };
49
47
 
50
48
  class ApplicationCommand extends command("application", [ApplicationScript], ({ public: target }) => ({
51
49
  createApplication: target({ desc: "Create a new application in the workspace" }).arg("appName", String, { desc: "name of application" }).option("start", Boolean, { desc: "start application", default: false }).with(Workspace).exec(async function(appName, start, workspace) {
@@ -96,32 +94,32 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
96
94
  runtimeDir
97
95
  });
98
96
  }),
99
- build: target({ short: true, desc: "Build the application for production (frontend + backend)" }).with(App).option("write", Boolean, { desc: "write code generation", default: true }).option("fast", Boolean, { desc: "fast build", default: false }).option("quiet", Boolean, { desc: "hide build progress output", default: false }).option("profile", String, {
97
+ build: target({ short: true, desc: "Build the application for production (frontend + backend)" }).with(App).option("write", Boolean, writeOption).option("fast", Boolean, { desc: "fast build", default: false }).option("quiet", Boolean, { desc: "hide build progress output", default: false }).option("profile", String, {
100
98
  desc: "server env profile: bundle env/env.server.<env>.<profile>.ts in place of the environment's own file",
101
99
  nullable: true
102
100
  }).exec(async function(app, write, fast, quiet, profile) {
103
101
  await this.applicationScript.build(app, { write, fast, quiet, profile: profile ?? undefined });
104
102
  }),
105
- typecheck: target({ short: true, desc: "Typecheck an app or a library, its tests and specs included" }).with(Exec).option("write", Boolean, { desc: "write code generation", default: true }).option("clean", Boolean, { desc: "clear typecheck cache before running", default: false }).option("incremental", Boolean, { desc: "reuse TypeScript incremental cache", default: true }).option("tests", Boolean, { desc: "check its *.test.ts / *.spec.ts too, which nothing imports", default: true }).exec(async function(exec, write, clean, incremental, tests) {
106
- await this.applicationScript.typecheck(exec, { write, clean, incremental, tests });
103
+ typecheck: target({ short: true, desc: "Typecheck an app or a library, its tests and specs included" }).with(SysOrOnlyApp).option("write", Boolean, writeOption).option("clean", Boolean, { desc: "clear typecheck cache before running", default: false }).option("incremental", Boolean, { desc: "reuse TypeScript incremental cache", default: true }).option("tests", Boolean, { desc: "check its *.test.ts / *.spec.ts too, which nothing imports", default: true }).exec(async function(sys, write, clean, incremental, tests) {
104
+ await this.applicationScript.typecheck(sys, { write, clean, incremental, tests });
107
105
  }),
108
- test: target({ desc: "Prepare and test an app, library, or package" }).with(Exec).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(exec, write) {
106
+ test: target({ desc: "Prepare and test an app, library, or package" }).with(Exec).option("write", Boolean, writeOption).exec(async function(exec, write) {
109
107
  await this.applicationScript.test(exec, { write });
110
108
  }),
111
- buildIos: target({ short: true, desc: "Build the iOS app on the native runtime" }).with(App).option("target", String, mobileTargetOption).option("env", String, buildEnvOption).option("debug", Boolean, { desc: "debug build instead of release", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(app, target, env, debug, write) {
109
+ buildIos: target({ short: true, desc: "Build the iOS app on the native runtime" }).with(App).option("target", String, nativeTargetOption).option("env", String, buildEnvOption).option("debug", Boolean, { desc: "debug build instead of release", default: false }).option("write", Boolean, writeOption).exec(async function(app, target, env, debug, write) {
112
110
  await this.applicationScript.buildIos(app, { target, env, profile: debug ? "debug" : "release", write });
113
111
  }),
114
- buildAndroid: target({ short: true, desc: "Build the Android app (apk) on the native runtime" }).with(App).option("target", String, mobileTargetOption).option("env", String, buildEnvOption).option("debug", Boolean, { desc: "debug build instead of release", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(app, target, env, debug, write) {
112
+ buildAndroid: target({ short: true, desc: "Build the Android app (apk) on the native runtime" }).with(App).option("target", String, nativeTargetOption).option("env", String, buildEnvOption).option("debug", Boolean, { desc: "debug build instead of release", default: false }).option("write", Boolean, writeOption).exec(async function(app, target, env, debug, write) {
115
113
  await this.applicationScript.buildAndroid(app, { target, env, profile: debug ? "debug" : "release", write });
116
114
  }),
117
- buildDesktop: target({ short: true, desc: "Build the desktop app for this computer (macOS, Windows or Linux)" }).with(App).option("target", String, mobileTargetOption).option("env", String, buildEnvOption).option("debug", Boolean, { desc: "debug build instead of release", default: false }).option("installer", Boolean, {
115
+ buildDesktop: target({ short: true, desc: "Build the desktop app for this computer (macOS, Windows or Linux)" }).with(App).option("target", String, nativeTargetOption).option("env", String, buildEnvOption).option("debug", Boolean, { desc: "debug build instead of release", default: false }).option("installer", Boolean, {
118
116
  desc: "also what a person downloads: a Windows setup program (NSIS, /S for silent), a macOS dmg, a Linux AppImage",
119
117
  default: false
120
118
  }).option("arch", String, {
121
119
  desc: "the CPU the app runs on, arm64 or x64 of this OS (default this computer's); a macOS app is arm64 only",
122
120
  enum: ["arm64", "x64"],
123
121
  nullable: true
124
- }).option("sign", Boolean, { desc: signDesc, default: false }).option("notarize", Boolean, { desc: notarizeDesc, default: false }).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(app, target, env, debug, installer, arch, sign, notarize, write) {
122
+ }).option("sign", Boolean, { desc: signDesc, default: false }).option("notarize", Boolean, { desc: notarizeDesc, default: false }).option("write", Boolean, writeOption).exec(async function(app, target, env, debug, installer, arch, sign, notarize, write) {
125
123
  await this.applicationScript.buildDesktop(app, {
126
124
  target,
127
125
  env,
@@ -136,10 +134,10 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
136
134
  start: target({ short: true, desc: "Start development server(s) (frontend SSR + backend)" }).with(Apps).option("plain", Boolean, { desc: "print prefixed lines instead of the full-screen view", default: false }).option("kill", Boolean, { flag: "k", desc: "free the dev ports first, whoever is holding them", default: false }).option("concurrency", Number, {
137
135
  desc: "apps to boot at a time (default: what this machine's memory and cores allow)",
138
136
  nullable: true
139
- }).option("dbup", Boolean, { desc: "start the local database first", default: true }).option("open", Boolean, { desc: "open web browser?", default: false }).option("share", Boolean, { desc: "also share each app on a public URL through an akan tunnel", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(apps, plain, kill, concurrency, dbup, open, share, write) {
137
+ }).option("dbup", Boolean, { desc: "start the local database first", default: true }).option("open", Boolean, { desc: "open web browser?", default: false }).option("share", Boolean, { desc: "also share each app on a public URL through an akan tunnel", default: false }).option("write", Boolean, writeOption).exec(async function(apps, plain, kill, concurrency, dbup, open, share, write) {
140
138
  await this.applicationScript.start(apps, { plain, kill, concurrency, dbup, open, share, write });
141
139
  }),
142
- startIos: target({ short: true, desc: "Run the iOS app in a simulator or on an iPhone, following `akan start`" }).with(App).option("target", String, mobileTargetOption).option("env", String, startEnvOption).option("release", Boolean, { desc: "run a release build of its own bundle instead", default: false }).option("device", String, deviceOption).option("team", String, teamOption).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(app, target, env, release, device, team, write) {
140
+ startIos: target({ short: true, desc: "Run the iOS app in a simulator or on an iPhone, following `akan start`" }).with(App).option("target", String, nativeTargetOption).option("env", String, startEnvOption).option("release", Boolean, { desc: "run a release build of its own bundle instead", default: false }).option("device", String, deviceOption).option("team", String, teamOption).option("write", Boolean, writeOption).exec(async function(app, target, env, release, device, team, write) {
143
141
  await this.applicationScript.startIos(app, {
144
142
  target,
145
143
  env,
@@ -152,7 +150,7 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
152
150
  startAndroid: target({
153
151
  short: true,
154
152
  desc: "Run the Android app in an emulator or on a device, following `akan start`"
155
- }).with(App).option("target", String, mobileTargetOption).option("env", String, startEnvOption).option("release", Boolean, { desc: "run a release build of its own bundle instead", default: false }).option("device", String, deviceOption).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(app, target, env, release, device, write) {
153
+ }).with(App).option("target", String, nativeTargetOption).option("env", String, startEnvOption).option("release", Boolean, { desc: "run a release build of its own bundle instead", default: false }).option("device", String, deviceOption).option("write", Boolean, writeOption).exec(async function(app, target, env, release, device, write) {
156
154
  await this.applicationScript.startAndroid(app, {
157
155
  target,
158
156
  env,
@@ -164,7 +162,7 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
164
162
  startDesktop: target({
165
163
  short: true,
166
164
  desc: "Run the desktop app on this computer (macOS, Windows or Linux), following `akan start`"
167
- }).with(App).option("target", String, mobileTargetOption).option("env", String, startEnvOption).option("release", Boolean, { desc: "run a release build of its own bundle instead", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(app, target, env, release, write) {
165
+ }).with(App).option("target", String, nativeTargetOption).option("env", String, startEnvOption).option("release", Boolean, { desc: "run a release build of its own bundle instead", default: false }).option("write", Boolean, writeOption).exec(async function(app, target, env, release, write) {
168
166
  await this.applicationScript.startDesktop(app, {
169
167
  target,
170
168
  env,
@@ -172,54 +170,57 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
172
170
  write
173
171
  });
174
172
  }),
175
- releaseIos: target({ desc: "Build and sign the iOS app for the App Store (.ipa)" }).with(App).option("target", String, mobileTargetOption).option("env", String, releaseEnvOption).option("team", String, teamOption).option("adHoc", Boolean, { desc: "sign with an ad-hoc profile instead of app-store", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).option("allowLocalRelease", Boolean, { flag: "l", desc: "allow release with --env local", default: false }).exec(async function(app, target, env, team, adHoc, write, allowLocalRelease) {
173
+ releaseIos: target({ desc: "Build and sign the iOS app for the App Store (.ipa)" }).with(App).option("target", String, nativeTargetOption).option("env", String, releaseEnvOption).option("team", String, teamOption).option("adHoc", Boolean, { desc: "sign with an ad-hoc profile instead of app-store", default: false }).option("write", Boolean, writeOption).option("allowLocalRelease", Boolean, allowLocalOption("release")).option("publicEnv", String, publicEnvOption("the release")).exec(async function(app, target, env, team, adHoc, write, allowLocalRelease, publicEnv) {
176
174
  await this.applicationScript.releaseIos(app, {
177
175
  target,
178
176
  env,
179
177
  teamId: team || undefined,
180
178
  adHoc,
181
179
  write,
182
- allowLocalRelease
180
+ allowLocalRelease,
181
+ publicEnv: publicEnv ?? undefined
183
182
  });
184
183
  }),
185
- releaseAndroid: target({ desc: "Build and sign the Android app for the Play Store (aab, or apk)" }).with(App).option("assembleType", String, { enum: ["aab", "apk"], default: "aab" }).option("target", String, mobileTargetOption).option("env", String, releaseEnvOption).option("write", Boolean, { desc: "write code generation", default: true }).option("allowLocalRelease", Boolean, { flag: "l", desc: "allow release with --env local", default: false }).exec(async function(app, assembleType, target, env, write, allowLocalRelease) {
184
+ releaseAndroid: target({ desc: "Build and sign the Android app for the Play Store (aab, or apk)" }).with(App).option("assembleType", String, { enum: ["aab", "apk"], default: "aab" }).option("target", String, nativeTargetOption).option("env", String, releaseEnvOption).option("write", Boolean, writeOption).option("allowLocalRelease", Boolean, allowLocalOption("release")).option("publicEnv", String, publicEnvOption("the release")).exec(async function(app, assembleType, target, env, write, allowLocalRelease, publicEnv) {
186
185
  await this.applicationScript.releaseAndroid(app, assembleType, {
187
186
  target,
188
187
  env,
189
188
  write,
190
- allowLocalRelease
189
+ allowLocalRelease,
190
+ publicEnv: publicEnv ?? undefined
191
191
  });
192
192
  }),
193
193
  packUpdate: target({
194
- desc: "Pack an unsigned over-the-air update of the mobile web bundle for a signer; records it in <out>/pack.json, exits 2 when --against needs a new store build"
195
- }).with(App).option("platform", String, { enum: ["ios", "android"], desc: "the app it updates" }).option("target", String, mobileTargetOption).option("env", String, releaseEnvOption).option("out", String, {
194
+ desc: "Pack an unsigned over-the-air update of the mobile web bundle for a signer; records it in <out>/pack.json. Exits 2 when --against needs a new store build, 1 on any other failure"
195
+ }).with(App).option("platform", String, { enum: ["ios", "android"], desc: "the app it updates" }).option("target", String, nativeTargetOption).option("env", String, releaseEnvOption).option("out", String, {
196
196
  desc: "output folder (default: dist/native/<app>/<target>/updates/<platform>)",
197
197
  nullable: true
198
198
  }).option("against", String, {
199
199
  desc: "bundle.json of the store build it must run in; fails when it needs a new one",
200
200
  nullable: true
201
- }).option("write", Boolean, { desc: "write code generation", default: true }).option("allowLocalRelease", Boolean, { flag: "l", desc: "allow packing with --env local", default: false }).exec(async function(app, platform, target, env, out, against, write, allowLocalRelease) {
201
+ }).option("write", Boolean, writeOption).option("allowLocalRelease", Boolean, allowLocalOption("packing")).option("publicEnv", String, publicEnvOption("the update (default: what --against recorded)")).exec(async function(app, platform, target, env, out, against, write, allowLocalRelease, publicEnv) {
202
202
  await this.applicationScript.packUpdate(app, platform, {
203
203
  target,
204
204
  env,
205
205
  out: out ?? undefined,
206
206
  against: against ?? undefined,
207
207
  write,
208
- allowLocalRelease
208
+ allowLocalRelease,
209
+ publicEnv: publicEnv ?? undefined
209
210
  });
210
211
  }),
211
212
  updateKeygen: target({ desc: "Make (once) the key an app's update releases are signed with; print its public key" }).with(App).option("platform", String, {
212
213
  enum: ["desktop", "android", "ios"],
213
214
  default: "desktop",
214
215
  desc: "the platform whose app id the key signs for (an appId may differ per platform)"
215
- }).option("target", String, mobileTargetOption).exec(async function(app, platform, target) {
216
+ }).option("target", String, nativeTargetOption).exec(async function(app, platform, target) {
216
217
  await this.applicationScript.updateKeygen(app, platform, { target });
217
218
  }),
218
219
  publishUpdate: target({ desc: "Build and sign an update release installed apps take (desktop, android or ios)" }).with(App).option("platform", String, {
219
220
  enum: ["desktop", "android", "ios"],
220
221
  default: "desktop",
221
222
  desc: "desktop is this computer's OS and CPU; android and ios publish the web bundle"
222
- }).option("target", String, mobileTargetOption).option("env", String, releaseEnvOption).option("channel", String, {
223
+ }).option("target", String, nativeTargetOption).option("env", String, releaseEnvOption).option("channel", String, {
223
224
  desc: "the manifest to publish to (default: the target's updates.channel, else --env)",
224
225
  nullable: true
225
226
  }).option("upload", String, {
@@ -232,7 +233,15 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
232
233
  }).option("sign", Boolean, {
233
234
  desc: `${signDesc}; a signed app takes only a release signed the same way`,
234
235
  default: false
235
- }).option("notarize", Boolean, { desc: notarizeDesc, default: false }).option("write", Boolean, { desc: "write code generation", default: true }).option("allowLocalRelease", Boolean, { flag: "l", desc: "allow release with --env local", default: false }).exec(async function(app, platform, target, env, channel, upload, arch, sign, notarize, write, allowLocalRelease) {
236
+ }).option("notarize", Boolean, { desc: notarizeDesc, default: false }).option("revoke", String, {
237
+ desc: "android, ios: keyIds of updates.publicKeys this release starts revoking, comma-separated (update-keygen prints a key's); it is signed with a key listed after them",
238
+ nullable: true
239
+ }).option("resetSequence", Boolean, {
240
+ flag: "R",
241
+ desc: "android, ios: with --revoke, phones compare the release with their own bundle instead of the running one",
242
+ default: false
243
+ }).option("write", Boolean, writeOption).option("allowLocalRelease", Boolean, allowLocalOption("release")).exec(async function(app, platform, target, env, channel, upload, arch, sign, notarize, revoke, resetSequence, write, allowLocalRelease) {
244
+ const revoked = revoke?.split(",").map((keyId) => keyId.trim()).filter(Boolean);
236
245
  await this.applicationScript.publishUpdate(app, platform, {
237
246
  target,
238
247
  env,
@@ -241,6 +250,8 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
241
250
  ...channel ? { channel } : {},
242
251
  ...upload ? { upload } : {},
243
252
  ...arch ? { arch } : {},
253
+ ...revoked?.length ? { revoke: revoked } : {},
254
+ ...resetSequence ? { resetSequence } : {},
244
255
  write,
245
256
  allowLocalRelease
246
257
  });
@@ -1,21 +1,22 @@
1
1
  // @bun
2
2
  import {
3
3
  ServerEnvProfile,
4
- Spinner
5
- } from "./index-55mynnqs.js";
6
- import"./index-aprt7pkz.js";
4
+ Spinner,
5
+ ProjectTypecheck2
6
+ } from "./index-bv210r6t.js";
7
+ import"./index-fvn6f5wx.js";
8
+ import"./index-ec080x99.js";
7
9
  import {
8
10
  AllRoutesBuilder,
9
- CsrArtifactBuilder,
10
11
  FontPruner,
11
12
  precompressArtifacts,
12
13
  SsrBaseArtifactBuilder
13
- } from "./index-c2yrsxdh.js";
14
+ } from "./index-91rt5bye.js";
14
15
  import"./index-52w0fvh8.js";
15
16
  import"./index-n68jx79w.js";
16
17
  import {
17
- ProjectTypecheck2
18
- } from "./index-6w0rbr9d.js";
18
+ CsrArtifactBuilder
19
+ } from "./index-2z3kykvd.js";
19
20
 
20
21
  // pkgs/@akanjs/devkit/applicationBuildRunner.ts
21
22
  import path2 from "path";
@@ -38,22 +39,9 @@ var createServerEnvPlugin = ({
38
39
  const own = new RegExp(`${folder}${escapeRegExp(environment)}\\.ts$`);
39
40
  const libEnvs = new Map;
40
41
  const libEnv = async (file) => {
41
- const profileFile = ServerEnvProfile.profileFileOf(file, profile ?? "");
42
- const libRoot = path.dirname(path.dirname(file));
43
- if (await Bun.file(profileFile).exists()) {
44
- const secrets = ServerEnvProfile.secretPaths(await ServerEnvProfile.evaluate(profileFile, libRoot));
45
- if (secrets.length)
46
- throw new Error(`${profileFile} holds secret-named values, which the "${profile}" bundle carries to every computer it runs on: ${secrets.join(", ")}.`);
47
- onLibEnv?.(file, { profileFile: true, stripped: [] });
48
- return { loader: "ts", contents: await Bun.file(profileFile).text() };
49
- }
50
- const { exports } = new Bun.Transpiler({ loader: "ts" }).scan(await Bun.file(file).text());
51
- if (exports.some((name) => name !== "env"))
52
- throw new Error(`${file} exports ${exports.join(", ")}: a "${profile}" build carries only a lib env's \`env\`, so give the lib ${path.basename(profileFile)}.`);
53
- const { value, stripped } = ServerEnvProfile.strip(await ServerEnvProfile.evaluate(file, libRoot));
54
- onLibEnv?.(file, { profileFile: false, stripped });
55
- return { loader: "js", contents: `export const env = ${JSON.stringify(value ?? {})};
56
- ` };
42
+ const { loader, contents, profileFile, stripped } = await ServerEnvProfile.libEnvSource(file, profile ?? "");
43
+ onLibEnv?.(file, { profileFile, stripped });
44
+ return { loader, contents };
57
45
  };
58
46
  return {
59
47
  name: "akan-server-env",
@@ -61,7 +49,7 @@ var createServerEnvPlugin = ({
61
49
  if (profile)
62
50
  build.onLoad({ filter: own }, async (args) => ({
63
51
  loader: "ts",
64
- contents: await Bun.file(path.join(path.dirname(args.path), `env.server.${environment}.${profile}.ts`)).text()
52
+ contents: await ServerEnvProfile.sourceInPlaceOf(path.join(path.dirname(args.path), ServerEnvProfile.fileName(environment, profile)), args.path, profile)
65
53
  }));
66
54
  if (others.length)
67
55
  build.onLoad({ filter }, async (args) => {
@@ -79,7 +67,7 @@ var createServerEnvPlugin = ({
79
67
  };
80
68
  });
81
69
  if (profile)
82
- build.onLoad({ filter: /[\\/]env[\\/]env\.server\.[A-Za-z0-9-]+\.ts$/ }, async (args) => {
70
+ build.onLoad({ filter: ServerEnvProfile.envFilePattern }, async (args) => {
83
71
  const name = path.basename(args.path, ".ts").slice("env.server.".length);
84
72
  if (dirs.has(path.dirname(args.path)) || name === "type" || name === "example")
85
73
  return { loader: "ts", contents: await Bun.file(args.path).text() };
@@ -138,12 +126,10 @@ class ApplicationBuildRunner {
138
126
  async build({ spinner = false } = {}) {
139
127
  this.#spinner = spinner;
140
128
  const { web, assets, baseDevEnv } = await this.#app.getConfig();
129
+ const environment = this.#environment ?? baseDevEnv.env;
130
+ process.env.AKAN_PUBLIC_ENV = environment;
141
131
  if (this.#profile)
142
- await ServerEnvProfile.assertShippable({
143
- envDir: this.#envDir,
144
- environment: this.#environment ?? baseDevEnv.env,
145
- profile: this.#profile
146
- });
132
+ await ServerEnvProfile.assertShippable({ envDir: this.#envDir, environment, profile: this.#profile });
147
133
  await this.#runPhase("prepare", "Preparing output directory", () => this.#app.prepareCommand("build"));
148
134
  if (!this.#fast)
149
135
  await this.#runPhase("typecheck", "Typechecking", () => this.typecheck());
@@ -6,23 +6,27 @@ import {
6
6
  resolveSsrPageEntriesForApp,
7
7
  WorkspaceExecutor,
8
8
  AppExecutor
9
- } from "./index-55mynnqs.js";
9
+ } from "./index-bv210r6t.js";
10
10
  import {
11
11
  computeRouteSeedIndex,
12
12
  saveRouteSeedIndex,
13
- ServerGraphFile,
14
- PagesBundleBuilder,
15
13
  CsrDevBundler,
16
14
  SsrDevBundler
17
- } from "./index-aprt7pkz.js";
15
+ } from "./index-fvn6f5wx.js";
18
16
  import"./index-52w0fvh8.js";
19
17
  import {
20
- CsrArtifactBuilder,
18
+ ServerGraphFile,
19
+ PagesBundleBuilder
20
+ } from "./index-ec080x99.js";
21
+ import {
21
22
  CssCompiler,
22
23
  FontOptimizer,
23
24
  SsrBaseArtifactBuilder
24
- } from "./index-c2yrsxdh.js";
25
+ } from "./index-91rt5bye.js";
25
26
  import"./index-n68jx79w.js";
27
+ import {
28
+ CsrArtifactBuilder
29
+ } from "./index-2z3kykvd.js";
26
30
 
27
31
  // pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts
28
32
  import path from "path";
@@ -40,17 +44,21 @@ class BuildBatch {
40
44
  this.#result = { generation: request.generation, errors: {} };
41
45
  }
42
46
  async run() {
43
- if (this.#request.needs.includes("base"))
47
+ const { needs } = this.#request;
48
+ const cssFirst = needs.includes("css") && needs.includes("csr") && resolveDevCsrMode() === "artifact";
49
+ if (needs.includes("base"))
44
50
  await this.#buildBase();
45
- if (this.#request.needs.includes("csr"))
51
+ if (cssFirst)
52
+ await this.#buildCss();
53
+ if (needs.includes("csr"))
46
54
  await this.#buildCsr();
47
- if (this.#request.needs.includes("shell"))
55
+ if (needs.includes("shell"))
48
56
  await this.#buildShell();
49
- if (this.#request.needs.includes("ssr"))
57
+ if (needs.includes("ssr"))
50
58
  await this.#buildSsrRegistry();
51
- if (this.#request.needs.includes("css"))
59
+ if (needs.includes("css") && !cssFirst)
52
60
  await this.#buildCss();
53
- if (this.#request.needs.includes("pages"))
61
+ if (needs.includes("pages"))
54
62
  await this.#buildPages();
55
63
  return this.#result;
56
64
  }
@@ -115,7 +123,8 @@ class BuildBatch {
115
123
  }
116
124
  }
117
125
  async#rebuildCsrArtifact(started) {
118
- await new CsrArtifactBuilder(this.#app, "start", "en", { cssAssets: this.#request.cssAssets }).build();
126
+ const cssAssets = this.#result.cssAssets ?? this.#request.cssAssets;
127
+ await new CsrArtifactBuilder(this.#app, "start", "en", { cssAssets }).build();
119
128
  this.#logger.verbose(`csr-rebundle ok (${Date.now() - started}ms)`);
120
129
  if (this.#request.changedFiles.length === 0)
121
130
  return;