@akanjs/devkit 2.1.0-rc.4 → 2.1.0-rc.6
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.
|
@@ -72,14 +72,12 @@ describe("route client store bootstrap", () => {
|
|
|
72
72
|
expect(CLIENT_BUNDLE_NAMING.asset.includes("[name]")).toBe(false);
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
-
test("
|
|
75
|
+
test("keeps start SSR client React imports bare and rewrites resolved fetch imports", () => {
|
|
76
76
|
const aliases = RouteClientBuilder.resolveSsrClientRuntimeAliases();
|
|
77
77
|
|
|
78
|
-
expect(Object.keys(aliases)).toEqual(
|
|
78
|
+
expect(Object.keys(aliases)).not.toEqual(
|
|
79
79
|
expect.arrayContaining(["react", "react-dom", "react-dom/client", "react/jsx-runtime", "react/jsx-dev-runtime"]),
|
|
80
80
|
);
|
|
81
|
-
expect(aliases.react).toBe(Bun.resolveSync("react", RouteClientBuilder.resolveAkanServerEntry()));
|
|
82
|
-
expect(aliases.react).not.toBe("react");
|
|
83
81
|
expect(aliases[Bun.resolveSync("akanjs/fetch", RouteClientBuilder.resolveAkanServerEntry())]).toBe("akanjs/fetch");
|
|
84
82
|
});
|
|
85
83
|
|
|
@@ -224,11 +224,7 @@ export class RouteClientBuilder {
|
|
|
224
224
|
|
|
225
225
|
static resolveSsrClientRuntimeAliases(): Record<string, string> {
|
|
226
226
|
const serverEntry = RouteClientBuilder.resolveAkanServerEntry();
|
|
227
|
-
|
|
228
|
-
SSR_CLIENT_ALIAS_EXTERNALS.map((specifier) => [specifier, Bun.resolveSync(specifier, serverEntry)]),
|
|
229
|
-
) as Record<string, string>;
|
|
230
|
-
aliases[Bun.resolveSync("akanjs/fetch", serverEntry)] = "akanjs/fetch";
|
|
231
|
-
return aliases;
|
|
227
|
+
return { [Bun.resolveSync("akanjs/fetch", serverEntry)]: "akanjs/fetch" };
|
|
232
228
|
}
|
|
233
229
|
|
|
234
230
|
static resolveSsrClientExternalOptions(command: "build" | "start"): {
|
|
@@ -92,24 +92,27 @@ export class SsrBaseArtifactBuilder {
|
|
|
92
92
|
return { rscClientUrl, vendorMap };
|
|
93
93
|
}
|
|
94
94
|
async #resolveAkanServerPath() {
|
|
95
|
-
const candidates = [
|
|
96
|
-
path.join(this.#app.workspace.workspaceRoot, "pkgs/akanjs/server"),
|
|
97
|
-
path.join(this.#app.workspace.workspaceRoot, "node_modules/akanjs/server"),
|
|
98
|
-
path.join(path.dirname(Bun.main), "node_modules/akanjs/server"),
|
|
99
|
-
path.join(path.dirname(Bun.main), "../../akanjs/server"),
|
|
100
|
-
path.resolve(import.meta.dir, "../../server"),
|
|
101
|
-
path.resolve(import.meta.dir, "../server"),
|
|
102
|
-
];
|
|
95
|
+
const candidates: string[] = [];
|
|
103
96
|
try {
|
|
104
|
-
candidates.
|
|
97
|
+
candidates.push(path.dirname(Bun.resolveSync("akanjs/server", this.#app.workspace.workspaceRoot)));
|
|
105
98
|
} catch {
|
|
106
|
-
// Source workspaces and bundled CLI execution have different resolution roots; try
|
|
99
|
+
// Source workspaces and bundled CLI execution have different resolution roots; try explicit candidates below.
|
|
107
100
|
}
|
|
101
|
+
candidates.push(
|
|
102
|
+
path.join(this.#app.workspace.workspaceRoot, "pkgs/akanjs/server"),
|
|
103
|
+
path.join(this.#app.workspace.workspaceRoot, "node_modules/akanjs/server"),
|
|
104
|
+
);
|
|
108
105
|
try {
|
|
109
|
-
candidates.
|
|
106
|
+
candidates.push(path.dirname(Bun.resolveSync("akanjs/server", path.dirname(Bun.main))));
|
|
110
107
|
} catch {
|
|
111
108
|
// Published CLI installs may hoist dependencies differently; explicit Bun.main candidates cover that.
|
|
112
109
|
}
|
|
110
|
+
candidates.push(
|
|
111
|
+
path.join(path.dirname(Bun.main), "node_modules/akanjs/server"),
|
|
112
|
+
path.join(path.dirname(Bun.main), "../../akanjs/server"),
|
|
113
|
+
path.resolve(import.meta.dir, "../../server"),
|
|
114
|
+
path.resolve(import.meta.dir, "../server"),
|
|
115
|
+
);
|
|
113
116
|
for (const candidate of candidates) {
|
|
114
117
|
if (await Bun.file(path.join(candidate, "rscClient.tsx")).exists()) return candidate;
|
|
115
118
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/devkit",
|
|
3
|
-
"version": "2.1.0-rc.
|
|
3
|
+
"version": "2.1.0-rc.6",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@langchain/deepseek": "^1.0.26",
|
|
37
37
|
"@langchain/openai": "^1.4.6",
|
|
38
38
|
"@trapezedev/project": "^7.1.4",
|
|
39
|
-
"akanjs": "2.1.0-rc.
|
|
39
|
+
"akanjs": "2.1.0-rc.5",
|
|
40
40
|
"chalk": "^5.6.2",
|
|
41
41
|
"commander": "^14.0.3",
|
|
42
42
|
"daisyui": "^5.5.20",
|