@akanjs/devkit 3.0.0-beta.22 → 3.0.0-beta.23

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.
@@ -13,7 +13,7 @@ import { HmrChangeClassifier } from "./hmrChangeClassifier";
13
13
  import { PagesBundleBuilder } from "./pagesBundleBuilder";
14
14
  import { PagesEntrySourceGenerator } from "./pagesEntrySourceGenerator";
15
15
  import { RoutesManifestArtifactSerializer } from "./routesManifestArtifactSerializer";
16
- import { prepareCssAsset } from "./ssrBaseArtifactBuilder";
16
+ import { prepareCssAsset, SsrBaseArtifactBuilder } from "./ssrBaseArtifactBuilder";
17
17
 
18
18
  const makeTempRoot = tempDirs("akan-devkit-frontend-");
19
19
 
@@ -252,6 +252,16 @@ describe("CsrArtifactBuilder", () => {
252
252
  });
253
253
 
254
254
  describe("SsrBaseArtifactBuilder", () => {
255
+ test("a dev artifact serves every web surface, and a build the one akan.config.ts keeps", () => {
256
+ for (const web of [
257
+ { ssr: true, csr: false },
258
+ { ssr: false, csr: false },
259
+ ]) {
260
+ expect(SsrBaseArtifactBuilder.servedWeb("start", web)).toEqual({ ssr: true, csr: true });
261
+ expect(SsrBaseArtifactBuilder.servedWeb("build", web)).toEqual(web);
262
+ }
263
+ });
264
+
255
265
  test("minifies CSS assets only for production builds", async () => {
256
266
  const css = [
257
267
  ".card {",
@@ -1,5 +1,6 @@
1
1
  import path from "node:path";
2
2
  import { optimize } from "@tailwindcss/node";
3
+ import type { AkanWebConfig } from "akanjs";
3
4
  import type { BaseBuildArtifact } from "akanjs/server";
4
5
  import { resolveSsrPageEntriesForApp } from "../artifact/implicitRootLayout";
5
6
  import { computeRouteSeedIndex, type RouteSeedIndex, saveRouteSeedIndex } from "../artifact/routeSeedIndex";
@@ -36,6 +37,12 @@ export class SsrBaseArtifactBuilder {
36
37
  this.#absArtifactDir = path.resolve(this.#artifactDir);
37
38
  }
38
39
 
40
+ //? The web router reads this, so `akan start` writes the whole surface: a native shell asks the dev server for the
41
+ //? CSR page even when the app ships none, and a narrowed dev artifact hands it the SSR page, which cannot run there.
42
+ static servedWeb(command: "build" | "start", web: AkanWebConfig): AkanWebConfig {
43
+ return command === "start" ? { ssr: true, csr: true } : web;
44
+ }
45
+
39
46
  async build(): Promise<BuildSsrBaseArtifactResult> {
40
47
  const akanConfig = await this.#app.getConfig();
41
48
  const { rscClientUrl, rscRuntimeClientManifest, rscRuntimeSsrManifest, vendorMap } =
@@ -77,7 +84,7 @@ export class SsrBaseArtifactBuilder {
77
84
  branches: [...akanConfig.branches],
78
85
  i18n: akanConfig.i18n,
79
86
  imageConfig: akanConfig.images,
80
- web: akanConfig.web,
87
+ web: SsrBaseArtifactBuilder.servedWeb(this.#command, akanConfig.web),
81
88
  deepLinkAssociations: Object.values(akanConfig.mobile.targets)
82
89
  .filter((target) => (target.deepLinks?.domains?.length ?? 0) > 0)
83
90
  .map((target) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/devkit",
3
- "version": "3.0.0-beta.22",
3
+ "version": "3.0.0-beta.23",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -47,7 +47,7 @@
47
47
  "@earendil-works/pi-tui": "0.86.1",
48
48
  "@inquirer/prompts": "^8.4.3",
49
49
  "@tailwindcss/node": "^4.3.0",
50
- "akanjs": "3.0.0-beta.22",
50
+ "akanjs": "3.0.0-beta.23",
51
51
  "chalk": "^5.6.2",
52
52
  "commander": "^14.0.3",
53
53
  "dayjs": "^1.11.20",