@solidjs/vite-plugin 3.0.0-next.37 → 3.0.0-next.39
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/README.md +47 -8
- package/dist/cjs/index.cjs +440 -87
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs +442 -89
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/src/diagnostics/index.d.ts +14 -1
- package/dist/types/src/index.d.ts +17 -9
- package/dist/types/src/server-functions/compile.d.ts +2 -0
- package/dist/types/src/server-functions/index.d.ts +28 -10
- package/dist/types/src/ssr/index.d.ts +6 -5
- package/dist/types/src/tsrx.d.ts +11 -0
- package/package.json +3 -3
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
2
|
export declare const DIAGNOSTICS_PACKAGE = "@solidjs/diagnostics";
|
|
3
3
|
export declare const DIAGNOSTICS_CLIENT_ID = "virtual:solid-diagnostics/client";
|
|
4
|
+
/**
|
|
5
|
+
* Whether the app *declares* `@solidjs/diagnostics` — the auto-enable
|
|
6
|
+
* signal. Declaration in the nearest package.json (walking up from the
|
|
7
|
+
* Vite root, so a `client/` root still finds the app manifest) rather
|
|
8
|
+
* than node_modules presence: presence-based detection escapes the app
|
|
9
|
+
* into ancestor installs, which surprise-enables the surface for every
|
|
10
|
+
* fixture app inside a monorepo that happens to have the package
|
|
11
|
+
* somewhere above it (this broke the plugin's own example suites). A
|
|
12
|
+
* declared dependency is unambiguous intent, and resolution then works
|
|
13
|
+
* regardless of hoisting. `diagnostics: true` remains the override for
|
|
14
|
+
* setups the heuristic can't see.
|
|
15
|
+
*/
|
|
16
|
+
export declare function detectDiagnosticsPackage(root: string): boolean;
|
|
4
17
|
export declare function diagnosticsClientModuleCode(): string;
|
|
5
|
-
export declare function solidDiagnostics(): Plugin;
|
|
18
|
+
export declare function solidDiagnostics(mode?: true | 'auto'): Plugin;
|
|
@@ -5,7 +5,7 @@ import { type StartOptions } from './ssr/index.js';
|
|
|
5
5
|
export { devStylePatch } from './dev-manifest.js';
|
|
6
6
|
export { serverFunctions };
|
|
7
7
|
export type { ServerFunctionsOptions };
|
|
8
|
-
export type { ServerFunctionsFilter } from './server-functions/index.js';
|
|
8
|
+
export type { PersistedServerFunctionManifest, ServerFunctionsFilter, } from './server-functions/index.js';
|
|
9
9
|
export type { StartOptions };
|
|
10
10
|
import type { FilterPattern, Plugin } from 'vite';
|
|
11
11
|
/** Possible options for the extensions property */
|
|
@@ -40,12 +40,18 @@ export interface Options {
|
|
|
40
40
|
* Dev-serve only: expose Solid's diagnostic and attribution channels to
|
|
41
41
|
* out-of-process consumers (agents, tests, curl). Injects a client module
|
|
42
42
|
* that installs the in-page bridge from the app's own
|
|
43
|
-
* `@solidjs/diagnostics
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
43
|
+
* `@solidjs/diagnostics`, and serves a `/__solid/diagnostics` endpoint on
|
|
44
|
+
* the dev server that forwards capture control (`begin`/`end`),
|
|
45
|
+
* `whyDidRun`, and cost queries to the page over the Vite WebSocket. No
|
|
46
|
+
* effect on builds or preview.
|
|
47
|
+
*
|
|
48
|
+
* Omitted (the default), the surface auto-enables when the app declares
|
|
49
|
+
* `@solidjs/diagnostics` in its package.json — adding the dev dependency
|
|
50
|
+
* is the whole setup. `true` forces it on (erroring if the package is
|
|
51
|
+
* missing); `false` opts out entirely. Never active in test mode
|
|
52
|
+
* (vitest) or on builds/preview.
|
|
53
|
+
*
|
|
54
|
+
* @default undefined (auto-detect)
|
|
49
55
|
*/
|
|
50
56
|
diagnostics?: boolean;
|
|
51
57
|
/**
|
|
@@ -140,7 +146,8 @@ export interface Options {
|
|
|
140
146
|
hot?: boolean;
|
|
141
147
|
/**
|
|
142
148
|
* This registers additional extensions that should be processed by
|
|
143
|
-
* @solidjs/vite-plugin.
|
|
149
|
+
* @solidjs/vite-plugin. Experimental `.tsrx` is always registered as
|
|
150
|
+
* TypeScript TSRX and does not need to be listed here.
|
|
144
151
|
*
|
|
145
152
|
* @default undefined
|
|
146
153
|
*/
|
|
@@ -152,7 +159,8 @@ export interface Options {
|
|
|
152
159
|
* Note: with `compiler: "native"` the plugin is normally fully Babel-free
|
|
153
160
|
* (native lazy/refresh/JSX passes). Supplying custom babel options
|
|
154
161
|
* reintroduces a Babel support pass ahead of the native JSX transform to
|
|
155
|
-
* host them.
|
|
162
|
+
* host them. For `.tsrx` only, native TSRX lowering runs first and the
|
|
163
|
+
* support pass receives the generated ordinary JavaScript.
|
|
156
164
|
*
|
|
157
165
|
* @default {}
|
|
158
166
|
*/
|
|
@@ -15,6 +15,8 @@ export interface CompileOptions {
|
|
|
15
15
|
directive: string;
|
|
16
16
|
/** Project root; function IDs hash the root-relative path. */
|
|
17
17
|
root: string;
|
|
18
|
+
/** Whether to emit a map for this pass. Defaults to true. */
|
|
19
|
+
sourceMap?: boolean;
|
|
18
20
|
definitions: {
|
|
19
21
|
register: ImportDefinition;
|
|
20
22
|
create: ImportDefinition;
|
|
@@ -5,7 +5,7 @@ import { type FilterPattern, type Plugin } from 'vite';
|
|
|
5
5
|
* root — not the invocation directory — so running `vite` from outside the
|
|
6
6
|
* project keeps compiling the same files. Absolute patterns are used as-is.
|
|
7
7
|
*
|
|
8
|
-
* @default include "src/**\/*.{jsx,tsx,ts,js,mjs,cjs}", exclude "node_modules/**\/*.{jsx,tsx,ts,js,mjs,cjs}"
|
|
8
|
+
* @default include "src/**\/*.{jsx,tsx,tsrx,ts,js,mjs,cjs}", exclude "node_modules/**\/*.{jsx,tsx,tsrx,ts,js,mjs,cjs}"
|
|
9
9
|
*/
|
|
10
10
|
export interface ServerFunctionsFilter {
|
|
11
11
|
include?: FilterPattern;
|
|
@@ -114,21 +114,37 @@ export interface ServerFunctionsOptions {
|
|
|
114
114
|
* per-request wiring or server code.
|
|
115
115
|
*
|
|
116
116
|
* Document SSR of server components (rendered inline at t=0 and adopted
|
|
117
|
-
* at boot with zero endpoint requests) needs
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
* README).
|
|
117
|
+
* at boot with zero endpoint requests) needs two more pieces: the render
|
|
118
|
+
* must run with the server-component render plugin (plus the direct-call
|
|
119
|
+
* transform), and the client must call `installServerComponents()` before
|
|
120
|
+
* hydrating (the serialized references self-bootstrap the registry, so no
|
|
121
|
+
* separate bootstrap script is involved). With SSR start mode (the main
|
|
122
|
+
* plugin's `start` option with `ssr: true`) and generated entries the
|
|
123
|
+
* plugin emits both. With authored entries those pieces live in your
|
|
124
|
+
* entry files — import them from `@solidjs/web/frames` (see the README).
|
|
125
|
+
*
|
|
126
|
+
* `'external'` behaves exactly like `true`, and additionally declares
|
|
127
|
+
* that a composing host (e.g. a meta-framework adapter such as Astro's or
|
|
128
|
+
* TanStack Start's) owns that document wiring itself, so the plugin skips
|
|
129
|
+
* the without-SSR-start-mode warning.
|
|
125
130
|
*
|
|
126
131
|
* All of this is pure codegen: when the option is off, no reference to
|
|
127
132
|
* the server-component runtime is emitted anywhere.
|
|
128
133
|
*
|
|
129
134
|
* @default false
|
|
130
135
|
*/
|
|
131
|
-
components?: boolean;
|
|
136
|
+
components?: boolean | 'external';
|
|
137
|
+
}
|
|
138
|
+
/** The persisted manifest's on-disk shape (the array form is the pre-`functions` legacy). */
|
|
139
|
+
export interface PersistedServerFunctionManifest {
|
|
140
|
+
/** Modules containing server functions, root-relative. */
|
|
141
|
+
modules: string[];
|
|
142
|
+
/** Every server function the client build emitted a reference to. */
|
|
143
|
+
functions: Array<{
|
|
144
|
+
id: string;
|
|
145
|
+
name: string;
|
|
146
|
+
module: string;
|
|
147
|
+
}>;
|
|
132
148
|
}
|
|
133
149
|
/**
|
|
134
150
|
* The second parameter is internal wiring for the main plugin's
|
|
@@ -142,4 +158,6 @@ export declare function serverFunctions(options?: ServerFunctionsOptions, intern
|
|
|
142
158
|
devMiddleware?: boolean;
|
|
143
159
|
externalDevServer?: boolean;
|
|
144
160
|
ssrHandler?: string;
|
|
161
|
+
tsrxAfterSolid?: boolean;
|
|
162
|
+
tsrxSourceMap?: boolean;
|
|
145
163
|
}): Plugin[];
|
|
@@ -14,7 +14,7 @@ export interface StartOptions {
|
|
|
14
14
|
* Root component module for generated entries (the zero-config path).
|
|
15
15
|
* Resolved relative to the Vite root.
|
|
16
16
|
*
|
|
17
|
-
* @default "src/App.{tsx,jsx,ts,js}" (also probes lowercase "src/app.*")
|
|
17
|
+
* @default "src/App.{tsx,jsx,ts,js,tsrx}" (also probes lowercase "src/app.*")
|
|
18
18
|
*/
|
|
19
19
|
app?: string;
|
|
20
20
|
/** Options for development CSS crawling. */
|
|
@@ -50,7 +50,7 @@ export interface StartOptions {
|
|
|
50
50
|
* dev serving and the build-time prerender). Conventional
|
|
51
51
|
* `src/entry-server.*` files are likewise ignored there.
|
|
52
52
|
*
|
|
53
|
-
* @default "src/entry-server.{tsx,jsx,ts,js,mjs}" when present, else a
|
|
53
|
+
* @default "src/entry-server.{tsx,jsx,ts,js,mjs,tsrx}" when present, else a
|
|
54
54
|
* generated entry rendering `<Document><App /></Document>`
|
|
55
55
|
*/
|
|
56
56
|
entryServer?: string;
|
|
@@ -59,7 +59,7 @@ export interface StartOptions {
|
|
|
59
59
|
* (a generated one calls `render()`), and it stands alone — no pairing
|
|
60
60
|
* rule with a server entry.
|
|
61
61
|
*
|
|
62
|
-
* @default "src/entry-client.{tsx,jsx,ts,js,mjs}" when present, else a
|
|
62
|
+
* @default "src/entry-client.{tsx,jsx,ts,js,mjs,tsrx}" when present, else a
|
|
63
63
|
* generated entry
|
|
64
64
|
*/
|
|
65
65
|
entryClient?: string;
|
|
@@ -71,7 +71,7 @@ export interface StartOptions {
|
|
|
71
71
|
* Document costs nothing across the flip; the built-in shell omits it per
|
|
72
72
|
* mode). Only used when the server entry is generated.
|
|
73
73
|
*
|
|
74
|
-
* @default "src/Document.{tsx,jsx}" when present, else a built-in shell
|
|
74
|
+
* @default "src/Document.{tsx,jsx,tsrx}" when present, else a built-in shell
|
|
75
75
|
*/
|
|
76
76
|
document?: string;
|
|
77
77
|
/**
|
|
@@ -205,7 +205,8 @@ export declare function startServe(options: StartOptions, internal?: {
|
|
|
205
205
|
serverComponents?: boolean;
|
|
206
206
|
ssr?: boolean;
|
|
207
207
|
styleFilter?: DevStyleFilter;
|
|
208
|
-
diagnostics
|
|
208
|
+
/** `'auto'` = enable when the app has `@solidjs/diagnostics` installed. */
|
|
209
|
+
diagnostics?: boolean | 'auto';
|
|
209
210
|
/**
|
|
210
211
|
* Reports the resolved document shell path (absolute, or null when the
|
|
211
212
|
* built-in virtual document is used) back to the main plugin, which
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const TSRX_CSS_QUERY = "?solid-tsrx-css&lang.css";
|
|
2
|
+
export declare function cleanModuleId(id: string): string;
|
|
3
|
+
export declare function isTsrxModule(id: string): boolean;
|
|
4
|
+
export declare function isTsrxCssModule(id: string): boolean;
|
|
5
|
+
export declare function resolveTsrxCssModule(id: string): string | null;
|
|
6
|
+
export declare function tsrxCssModuleId(id: string): string;
|
|
7
|
+
export declare function resolvedTsrxCssModuleId(id: string): string;
|
|
8
|
+
export declare function tsrxCssSourceId(id: string): string | null;
|
|
9
|
+
export declare function updateTsrxCss(cache: Map<string, string>, id: string, css: string | null | undefined): void;
|
|
10
|
+
export declare function prependTsrxCssImport(code: string, id: string): string;
|
|
11
|
+
export declare function offsetSourceMapLine<T>(map: T): T;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidjs/vite-plugin",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.39",
|
|
4
4
|
"description": "solid-js integration plugin for Vite",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@ampproject/remapping": "^2.3.0",
|
|
55
55
|
"@babel/core": "^7.23.3",
|
|
56
|
-
"@solidjs/babel-plugin": "^2.0.0-rc.
|
|
57
|
-
"@solidjs/compiler": "^2.0.0-rc.
|
|
56
|
+
"@solidjs/babel-plugin": "^2.0.0-rc.6",
|
|
57
|
+
"@solidjs/compiler": "^2.0.0-rc.6",
|
|
58
58
|
"@types/babel__core": "^7.20.4",
|
|
59
59
|
"merge-anything": "^5.1.7",
|
|
60
60
|
"vitefu": "^1.0.4"
|