@kosmojs/lib 0.4.3 → 0.5.0
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/package.json +6 -6
- package/pkg/generators.d.ts +2 -2
- package/pkg/generic.d.ts +1 -0
- package/pkg/index.js +1506 -18
- package/pkg/index.js.map +1 -1
- package/pkg/render.d.ts +3 -1
- package/pkg/routes/base.d.ts +18 -0
- package/pkg/routes/paths.d.ts +1 -0
- package/pkg/vite.d.ts +20 -1
package/pkg/vite.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Plugin } from "vite";
|
|
2
|
-
import { type SourceFolder } from "@kosmojs/core";
|
|
2
|
+
import { type ProjectSettings, type SourceFolder } from "@kosmojs/core";
|
|
3
3
|
/**
|
|
4
4
|
* Resolves Kosmo's generated import prefixes to absolute file paths.
|
|
5
5
|
*
|
|
@@ -54,8 +54,27 @@ import { type SourceFolder } from "@kosmojs/core";
|
|
|
54
54
|
* */
|
|
55
55
|
export declare const tsconfigPaths: (sourceFolder: SourceFolder) => Plugin;
|
|
56
56
|
declare const nodePrefix: () => Plugin;
|
|
57
|
+
/**
|
|
58
|
+
* Resolves the CSR/SSR variant of env-sensitive modules.
|
|
59
|
+
*
|
|
60
|
+
* WHY THIS EXISTS
|
|
61
|
+
* ---------------
|
|
62
|
+
* A handful of generated modules must differ between the client graph and the SSR bundle -
|
|
63
|
+
* the fetch transport (a no-op in the browser, an in-process dispatch on the server)
|
|
64
|
+
* and the TanStack Query client (a singleton in the browser, per-request on the server).
|
|
65
|
+
*
|
|
66
|
+
* Every build installs this plugin; but only the SSR bundle installs it with `kind: "ssr"`.
|
|
67
|
+
* Nothing is written, so concurrent processes cannot disturb each other.
|
|
68
|
+
*
|
|
69
|
+
* Generators declare their modules via `factory.virtualModules()`.
|
|
70
|
+
* */
|
|
71
|
+
export declare const virtualModules: (sourceFolder: SourceFolder, { kind, command, }: {
|
|
72
|
+
kind: "csr" | "ssr";
|
|
73
|
+
command: ProjectSettings["command"];
|
|
74
|
+
}) => Plugin;
|
|
57
75
|
export declare const vitePlugins: {
|
|
58
76
|
tsconfigPaths: typeof tsconfigPaths;
|
|
59
77
|
nodePrefix: typeof nodePrefix;
|
|
78
|
+
virtualModules: typeof virtualModules;
|
|
60
79
|
};
|
|
61
80
|
export {};
|