@jskit-ai/kernel 0.1.157 → 0.1.159
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.
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
|
|
16
16
|
const CLIENT_BOOTSTRAP_VIRTUAL_ID = "virtual:jskit-client-bootstrap";
|
|
17
17
|
const CLIENT_BOOTSTRAP_RESOLVED_ID = `\0${CLIENT_BOOTSTRAP_VIRTUAL_ID}`;
|
|
18
|
+
const CLIENT_BOOTSTRAP_MODULE_SPECIFIER = "@jskit-ai/kernel/client/moduleBootstrap";
|
|
18
19
|
const CLIENT_RUNTIME_DEDUPE_SPECIFIERS = Object.freeze([
|
|
19
20
|
"@tanstack/vue-query",
|
|
20
21
|
"pinia",
|
|
@@ -223,15 +224,15 @@ function resolveInstalledViteProxyEntries(installedPackages = [], { proxyTarget
|
|
|
223
224
|
}
|
|
224
225
|
|
|
225
226
|
ownerByPath.set(routePath, packageId);
|
|
226
|
-
proxyEntries[routePath] =
|
|
227
|
+
proxyEntries[routePath] = {
|
|
227
228
|
target,
|
|
228
229
|
...(Object.hasOwn(config, "changeOrigin") ? { changeOrigin: config.changeOrigin === true } : {}),
|
|
229
230
|
...(Object.hasOwn(config, "ws") ? { ws: config.ws === true } : {})
|
|
230
|
-
}
|
|
231
|
+
};
|
|
231
232
|
}
|
|
232
233
|
}
|
|
233
234
|
|
|
234
|
-
return
|
|
235
|
+
return proxyEntries;
|
|
235
236
|
}
|
|
236
237
|
|
|
237
238
|
async function resolveInstalledClientPackageIds(options) {
|
|
@@ -292,7 +293,7 @@ function createVirtualModuleSource(clientModules = []) {
|
|
|
292
293
|
|
|
293
294
|
const entriesSource = moduleEntries.length > 0 ? moduleEntries.join(",\n") : "";
|
|
294
295
|
|
|
295
|
-
return `${importLines.join("\n")}${importLines.length > 0 ? "\n\n" : ""}import { bootClientModules } from
|
|
296
|
+
return `${importLines.join("\n")}${importLines.length > 0 ? "\n\n" : ""}import { bootClientModules } from ${JSON.stringify(CLIENT_BOOTSTRAP_MODULE_SPECIFIER)};
|
|
296
297
|
|
|
297
298
|
const installedClientModules = Object.freeze([
|
|
298
299
|
${entriesSource}
|
|
@@ -375,9 +376,17 @@ function createJskitClientBootstrapPlugin({ proxyTarget = "" } = {}) {
|
|
|
375
376
|
const userOptimizeDeps = normalizeObject(userConfig.optimizeDeps);
|
|
376
377
|
const userExclude = sortStrings(userOptimizeDeps.exclude);
|
|
377
378
|
const userInclude = sortStrings(userOptimizeDeps.include);
|
|
378
|
-
const exclude = sortStrings([
|
|
379
|
+
const exclude = sortStrings([
|
|
380
|
+
...userExclude,
|
|
381
|
+
...clientExcludeSpecifiers,
|
|
382
|
+
...localScopeExcludeSpecifiers
|
|
383
|
+
]);
|
|
379
384
|
const clientIncludeSpecifiers = resolveClientOptimizeIncludeSpecifiers(clientModules, exclude);
|
|
380
|
-
const include = sortStrings([
|
|
385
|
+
const include = sortStrings([
|
|
386
|
+
...userInclude,
|
|
387
|
+
...clientIncludeSpecifiers,
|
|
388
|
+
CLIENT_BOOTSTRAP_MODULE_SPECIFIER
|
|
389
|
+
].filter((specifier) => !exclude.includes(specifier)));
|
|
381
390
|
const dedupe = resolveClientRuntimeDedupeSpecifiers(userResolve);
|
|
382
391
|
const userServer = normalizeObject(userConfig.server);
|
|
383
392
|
const userProxyEntries = normalizeObject(userServer.proxy);
|
|
@@ -470,6 +470,8 @@ test("resolveInstalledViteProxyEntries derives proxy config directly from packag
|
|
|
470
470
|
ws: true
|
|
471
471
|
}
|
|
472
472
|
});
|
|
473
|
+
proxy["/socket.io"].prependPath = false;
|
|
474
|
+
assert.equal(proxy["/socket.io"].prependPath, false);
|
|
473
475
|
});
|
|
474
476
|
|
|
475
477
|
test("resolveInstalledViteProxyEntries rejects ambiguous package proxy paths", () => {
|
|
@@ -750,7 +752,11 @@ test("createJskitClientBootstrapPlugin config excludes installed client package
|
|
|
750
752
|
|
|
751
753
|
assert.equal(Array.isArray(result?.optimizeDeps?.exclude), true);
|
|
752
754
|
assert.deepEqual(result.optimizeDeps.exclude, ["already/excluded"]);
|
|
753
|
-
assert.deepEqual(result.optimizeDeps.include, [
|
|
755
|
+
assert.deepEqual(result.optimizeDeps.include, [
|
|
756
|
+
"@example/has-client/client",
|
|
757
|
+
"@jskit-ai/kernel/client/moduleBootstrap",
|
|
758
|
+
"a"
|
|
759
|
+
]);
|
|
754
760
|
assert.deepEqual(result.resolve.dedupe, ["@tanstack/vue-query", "pinia", "vue", "vue-router", "vuetify"]);
|
|
755
761
|
} finally {
|
|
756
762
|
process.chdir(previousCwd);
|
|
@@ -796,7 +802,11 @@ test("createJskitClientBootstrapPlugin config lets packageMetadata excludes over
|
|
|
796
802
|
});
|
|
797
803
|
|
|
798
804
|
assert.deepEqual(result.optimizeDeps.exclude, ["@example/app-bound-client/client", "user-excluded"]);
|
|
799
|
-
assert.deepEqual(result.optimizeDeps.include, [
|
|
805
|
+
assert.deepEqual(result.optimizeDeps.include, [
|
|
806
|
+
"@jskit-ai/kernel/client/moduleBootstrap",
|
|
807
|
+
"safe-helper",
|
|
808
|
+
"user-helper"
|
|
809
|
+
]);
|
|
800
810
|
} finally {
|
|
801
811
|
process.chdir(previousCwd);
|
|
802
812
|
}
|
|
@@ -853,7 +863,11 @@ test("createJskitClientBootstrapPlugin config excludes local package roots and c
|
|
|
853
863
|
"@example/local-client/client",
|
|
854
864
|
"@example/local-client/shared"
|
|
855
865
|
]);
|
|
856
|
-
assert.deepEqual(result.optimizeDeps.include, [
|
|
866
|
+
assert.deepEqual(result.optimizeDeps.include, [
|
|
867
|
+
"@example/remote-client/client",
|
|
868
|
+
"@jskit-ai/kernel/client/moduleBootstrap",
|
|
869
|
+
"mime-match"
|
|
870
|
+
]);
|
|
857
871
|
assert.deepEqual(result.resolve.dedupe, ["@tanstack/vue-query", "pinia", "vue", "vue-router", "vuetify"]);
|
|
858
872
|
} finally {
|
|
859
873
|
process.chdir(previousCwd);
|
|
@@ -933,7 +947,10 @@ test("createJskitClientBootstrapPlugin config excludes all @local scoped package
|
|
|
933
947
|
"@local/main/client",
|
|
934
948
|
"@local/main/shared"
|
|
935
949
|
]);
|
|
936
|
-
assert.deepEqual(result.optimizeDeps.include, [
|
|
950
|
+
assert.deepEqual(result.optimizeDeps.include, [
|
|
951
|
+
"@example/remote-client/client",
|
|
952
|
+
"@jskit-ai/kernel/client/moduleBootstrap"
|
|
953
|
+
]);
|
|
937
954
|
} finally {
|
|
938
955
|
process.chdir(previousCwd);
|
|
939
956
|
}
|