@vitejs/plugin-rsc 0.5.16 → 0.5.17

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.
Files changed (54) hide show
  1. package/dist/browser.d.ts +2 -2
  2. package/dist/{cjs-DH9Oa3zy.js → cjs-gAnoDF_x.js} +2 -2
  3. package/dist/core/browser.d.ts +1 -1
  4. package/dist/core/browser.js +2 -2
  5. package/dist/core/plugin.js +1 -1
  6. package/dist/core/rsc.d.ts +1 -1
  7. package/dist/core/rsc.js +1 -1
  8. package/dist/core/ssr.d.ts +1 -1
  9. package/dist/core/ssr.js +2 -2
  10. package/dist/{dist-DZUJDIM2.js → dist-yW9-EeG1.js} +1 -1
  11. package/dist/index-CLmWsR1c.d.ts +584 -0
  12. package/dist/index.d.ts +2 -2
  13. package/dist/index.js +4 -4
  14. package/dist/{picocolors-kt7Y18A3.js → picocolors-BRyoHAlU.js} +1 -1
  15. package/dist/{plugin-V6VFxi_0.d.ts → plugin-K7i9F4Fd.d.ts} +6 -12
  16. package/dist/{plugin-DBWiu_Dx.js → plugin-cXbi5HUa.js} +41 -41
  17. package/dist/plugin.d.ts +2 -2
  18. package/dist/plugin.js +4 -4
  19. package/dist/plugins/cjs.js +1 -1
  20. package/dist/react/browser.d.ts +2 -2
  21. package/dist/react/rsc.js +1 -1
  22. package/dist/{rsc-BCFg12vs.js → rsc-Bhp6O2qz.js} +3 -3
  23. package/dist/rsc.d.ts +2 -2
  24. package/dist/rsc.js +2 -2
  25. package/dist/ssr.d.ts +2 -3
  26. package/dist/ssr.js +1 -1
  27. package/dist/transforms/index.d.ts +1 -1
  28. package/dist/transforms/index.js +1 -1
  29. package/dist/{transforms-D4jDIHgD.js → transforms-B2EJTNXG.js} +2 -2
  30. package/dist/utils/encryption-runtime.js +3 -3
  31. package/dist/utils/rpc.js +1 -1
  32. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.browser.development.js +129 -110
  33. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.browser.production.js +67 -55
  34. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.edge.development.js +127 -108
  35. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.edge.production.js +67 -55
  36. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.development.js +127 -108
  37. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.production.js +67 -55
  38. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.browser.development.js +625 -351
  39. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.browser.production.js +598 -314
  40. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.edge.development.js +628 -352
  41. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.edge.production.js +601 -315
  42. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.development.js +634 -356
  43. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.production.js +607 -319
  44. package/dist/vendor/react-server-dom/package.json +3 -3
  45. package/package.json +8 -8
  46. package/dist/index-DJ0AhQ9B.d.ts +0 -90
  47. /package/dist/{browser-BmyjVnfA.d.ts → browser-s-WcB8A7.d.ts} +0 -0
  48. /package/dist/{chunk-BFhhoFQb.js → chunk-Dj_d7TT4.js} +0 -0
  49. /package/dist/{encryption-utils-BPYvebX4.js → encryption-utils-DdqSKS_O.js} +0 -0
  50. /package/dist/{index-DqoQPvhP.d.ts → index-now_lP2V.d.ts} +0 -0
  51. /package/dist/{plugin-B1AJWrMi.js → plugin-9NQn9bDA.js} +0 -0
  52. /package/dist/{rpc-DbBe389F.js → rpc-EIuXyQpO.js} +0 -0
  53. /package/dist/{shared-Chot7h9j.js → shared-CGK4coF3.js} +0 -0
  54. /package/dist/{shared-DEpnONZf.js → shared-rtJPs0Yj.js} +0 -0
package/dist/browser.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as CallServerCallback } from "./index-DqoQPvhP.js";
2
- import { t as setRequireModule } from "./browser-BmyjVnfA.js";
1
+ import { n as CallServerCallback } from "./index-now_lP2V.js";
2
+ import { t as setRequireModule } from "./browser-s-WcB8A7.js";
3
3
  import { callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setServerCallback } from "./react/browser.js";
4
4
  export { CallServerCallback, callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setRequireModule, setServerCallback };
@@ -1,5 +1,5 @@
1
- import { t as createDebug } from "./dist-DZUJDIM2.js";
2
- import { n as parseIdQuery } from "./shared-Chot7h9j.js";
1
+ import { t as createDebug } from "./dist-yW9-EeG1.js";
2
+ import { n as parseIdQuery } from "./shared-CGK4coF3.js";
3
3
  import fs from "node:fs";
4
4
  import path from "node:path";
5
5
  import { fileURLToPath, pathToFileURL } from "node:url";
@@ -1,2 +1,2 @@
1
- import { t as setRequireModule } from "../browser-BmyjVnfA.js";
1
+ import { t as setRequireModule } from "../browser-s-WcB8A7.js";
2
2
  export { setRequireModule };
@@ -1,5 +1,5 @@
1
- import { n as memoize } from "../dist-DZUJDIM2.js";
2
- import { a as setInternalRequire, i as removeReferenceCacheTag } from "../shared-DEpnONZf.js";
1
+ import { n as memoize } from "../dist-yW9-EeG1.js";
2
+ import { a as setInternalRequire, i as removeReferenceCacheTag } from "../shared-rtJPs0Yj.js";
3
3
 
4
4
  //#region src/core/browser.ts
5
5
  let init = false;
@@ -1,3 +1,3 @@
1
- import { t as vitePluginRscCore } from "../plugin-B1AJWrMi.js";
1
+ import { t as vitePluginRscCore } from "../plugin-9NQn9bDA.js";
2
2
 
3
3
  export { vitePluginRscCore as default };
@@ -1,4 +1,4 @@
1
- import { r as ModuleMap, t as BundlerConfig } from "../index-DqoQPvhP.js";
1
+ import { r as ModuleMap, t as BundlerConfig } from "../index-now_lP2V.js";
2
2
 
3
3
  //#region src/core/rsc.d.ts
4
4
  declare function setRequireModule(options: {
package/dist/core/rsc.js CHANGED
@@ -1,3 +1,3 @@
1
- import { a as setRequireModule, i as loadServerAction, n as createServerDecodeClientManifest, r as createServerManifest, t as createClientManifest } from "../rsc-BCFg12vs.js";
1
+ import { a as setRequireModule, i as loadServerAction, n as createServerDecodeClientManifest, r as createServerManifest, t as createClientManifest } from "../rsc-Bhp6O2qz.js";
2
2
 
3
3
  export { createClientManifest, createServerDecodeClientManifest, createServerManifest, loadServerAction, setRequireModule };
@@ -1,4 +1,4 @@
1
- import { i as ServerConsumerManifest } from "../index-DqoQPvhP.js";
1
+ import { i as ServerConsumerManifest } from "../index-now_lP2V.js";
2
2
 
3
3
  //#region src/core/ssr.d.ts
4
4
  declare function setRequireModule(options: {
package/dist/core/ssr.js CHANGED
@@ -1,5 +1,5 @@
1
- import { n as memoize } from "../dist-DZUJDIM2.js";
2
- import { a as setInternalRequire, i as removeReferenceCacheTag } from "../shared-DEpnONZf.js";
1
+ import { n as memoize } from "../dist-yW9-EeG1.js";
2
+ import { a as setInternalRequire, i as removeReferenceCacheTag } from "../shared-rtJPs0Yj.js";
3
3
 
4
4
  //#region src/core/ssr.ts
5
5
  let init = false;
@@ -58,7 +58,7 @@ function createDebugPattern(namespace) {
58
58
  const alts = [namespace];
59
59
  for (let i = 1; i < parts.length; i++) alts.push(parts.slice(0, i).join(":") + ":*");
60
60
  const pattern = alts.map((pattern2) => escapeRegExp(pattern2)).join("|");
61
- return /* @__PURE__ */ new RegExp(`(^|,)(${pattern})($|,)`);
61
+ return new RegExp(`(^|,)(${pattern})($|,)`);
62
62
  }
63
63
 
64
64
  //#endregion
@@ -0,0 +1,584 @@
1
+ import MagicString from "magic-string";
2
+
3
+ //#region ../../node_modules/.pnpm/@types+estree@1.0.8/node_modules/@types/estree/index.d.ts
4
+ // This definition file follows a somewhat unusual format. ESTree allows
5
+ // runtime type checks based on the `type` parameter. In order to explain this
6
+ // to typescript we want to use discriminated union types:
7
+ // https://github.com/Microsoft/TypeScript/pull/9163
8
+ //
9
+ // For ESTree this is a bit tricky because the high level interfaces like
10
+ // Node or Function are pulling double duty. We want to pass common fields down
11
+ // to the interfaces that extend them (like Identifier or
12
+ // ArrowFunctionExpression), but you can't extend a type union or enforce
13
+ // common fields on them. So we've split the high level interfaces into two
14
+ // types, a base type which passes down inherited fields, and a type union of
15
+ // all types which extend the base type. Only the type union is exported, and
16
+ // the union is how other types refer to the collection of inheriting types.
17
+ //
18
+ // This makes the definitions file here somewhat more difficult to maintain,
19
+ // but it has the notable advantage of making ESTree much easier to use as
20
+ // an end user.
21
+ interface BaseNodeWithoutComments {
22
+ // Every leaf interface that extends BaseNode must specify a type property.
23
+ // The type property should be a string literal. For example, Identifier
24
+ // has: `type: "Identifier"`
25
+ type: string;
26
+ loc?: SourceLocation | null | undefined;
27
+ range?: [number, number] | undefined;
28
+ }
29
+ interface BaseNode extends BaseNodeWithoutComments {
30
+ leadingComments?: Comment[] | undefined;
31
+ trailingComments?: Comment[] | undefined;
32
+ }
33
+ interface Comment extends BaseNodeWithoutComments {
34
+ type: "Line" | "Block";
35
+ value: string;
36
+ }
37
+ interface SourceLocation {
38
+ source?: string | null | undefined;
39
+ start: Position;
40
+ end: Position;
41
+ }
42
+ interface Position {
43
+ /** >= 1 */
44
+ line: number;
45
+ /** >= 0 */
46
+ column: number;
47
+ }
48
+ interface Program extends BaseNode {
49
+ type: "Program";
50
+ sourceType: "script" | "module";
51
+ body: Array<Directive | Statement | ModuleDeclaration>;
52
+ comments?: Comment[] | undefined;
53
+ }
54
+ interface Directive extends BaseNode {
55
+ type: "ExpressionStatement";
56
+ expression: Literal;
57
+ directive: string;
58
+ }
59
+ interface BaseFunction extends BaseNode {
60
+ params: Pattern[];
61
+ generator?: boolean | undefined;
62
+ async?: boolean | undefined; // The body is either BlockStatement or Expression because arrow functions
63
+ // can have a body that's either. FunctionDeclarations and
64
+ // FunctionExpressions have only BlockStatement bodies.
65
+ body: BlockStatement | Expression;
66
+ }
67
+ type Statement = ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | Declaration;
68
+ interface BaseStatement extends BaseNode {}
69
+ interface EmptyStatement extends BaseStatement {
70
+ type: "EmptyStatement";
71
+ }
72
+ interface BlockStatement extends BaseStatement {
73
+ type: "BlockStatement";
74
+ body: Statement[];
75
+ innerComments?: Comment[] | undefined;
76
+ }
77
+ interface StaticBlock extends Omit<BlockStatement, "type"> {
78
+ type: "StaticBlock";
79
+ }
80
+ interface ExpressionStatement extends BaseStatement {
81
+ type: "ExpressionStatement";
82
+ expression: Expression;
83
+ }
84
+ interface IfStatement extends BaseStatement {
85
+ type: "IfStatement";
86
+ test: Expression;
87
+ consequent: Statement;
88
+ alternate?: Statement | null | undefined;
89
+ }
90
+ interface LabeledStatement extends BaseStatement {
91
+ type: "LabeledStatement";
92
+ label: Identifier;
93
+ body: Statement;
94
+ }
95
+ interface BreakStatement extends BaseStatement {
96
+ type: "BreakStatement";
97
+ label?: Identifier | null | undefined;
98
+ }
99
+ interface ContinueStatement extends BaseStatement {
100
+ type: "ContinueStatement";
101
+ label?: Identifier | null | undefined;
102
+ }
103
+ interface WithStatement extends BaseStatement {
104
+ type: "WithStatement";
105
+ object: Expression;
106
+ body: Statement;
107
+ }
108
+ interface SwitchStatement extends BaseStatement {
109
+ type: "SwitchStatement";
110
+ discriminant: Expression;
111
+ cases: SwitchCase[];
112
+ }
113
+ interface ReturnStatement extends BaseStatement {
114
+ type: "ReturnStatement";
115
+ argument?: Expression | null | undefined;
116
+ }
117
+ interface ThrowStatement extends BaseStatement {
118
+ type: "ThrowStatement";
119
+ argument: Expression;
120
+ }
121
+ interface TryStatement extends BaseStatement {
122
+ type: "TryStatement";
123
+ block: BlockStatement;
124
+ handler?: CatchClause | null | undefined;
125
+ finalizer?: BlockStatement | null | undefined;
126
+ }
127
+ interface WhileStatement extends BaseStatement {
128
+ type: "WhileStatement";
129
+ test: Expression;
130
+ body: Statement;
131
+ }
132
+ interface DoWhileStatement extends BaseStatement {
133
+ type: "DoWhileStatement";
134
+ body: Statement;
135
+ test: Expression;
136
+ }
137
+ interface ForStatement extends BaseStatement {
138
+ type: "ForStatement";
139
+ init?: VariableDeclaration | Expression | null | undefined;
140
+ test?: Expression | null | undefined;
141
+ update?: Expression | null | undefined;
142
+ body: Statement;
143
+ }
144
+ interface BaseForXStatement extends BaseStatement {
145
+ left: VariableDeclaration | Pattern;
146
+ right: Expression;
147
+ body: Statement;
148
+ }
149
+ interface ForInStatement extends BaseForXStatement {
150
+ type: "ForInStatement";
151
+ }
152
+ interface DebuggerStatement extends BaseStatement {
153
+ type: "DebuggerStatement";
154
+ }
155
+ type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
156
+ interface BaseDeclaration extends BaseStatement {}
157
+ interface MaybeNamedFunctionDeclaration extends BaseFunction, BaseDeclaration {
158
+ type: "FunctionDeclaration";
159
+ /** It is null when a function declaration is a part of the `export default function` statement */
160
+ id: Identifier | null;
161
+ body: BlockStatement;
162
+ }
163
+ interface FunctionDeclaration extends MaybeNamedFunctionDeclaration {
164
+ id: Identifier;
165
+ }
166
+ interface VariableDeclaration extends BaseDeclaration {
167
+ type: "VariableDeclaration";
168
+ declarations: VariableDeclarator[];
169
+ kind: "var" | "let" | "const" | "using" | "await using";
170
+ }
171
+ interface VariableDeclarator extends BaseNode {
172
+ type: "VariableDeclarator";
173
+ id: Pattern;
174
+ init?: Expression | null | undefined;
175
+ }
176
+ interface ExpressionMap {
177
+ ArrayExpression: ArrayExpression;
178
+ ArrowFunctionExpression: ArrowFunctionExpression;
179
+ AssignmentExpression: AssignmentExpression;
180
+ AwaitExpression: AwaitExpression;
181
+ BinaryExpression: BinaryExpression;
182
+ CallExpression: CallExpression;
183
+ ChainExpression: ChainExpression;
184
+ ClassExpression: ClassExpression;
185
+ ConditionalExpression: ConditionalExpression;
186
+ FunctionExpression: FunctionExpression;
187
+ Identifier: Identifier;
188
+ ImportExpression: ImportExpression;
189
+ Literal: Literal;
190
+ LogicalExpression: LogicalExpression;
191
+ MemberExpression: MemberExpression;
192
+ MetaProperty: MetaProperty;
193
+ NewExpression: NewExpression;
194
+ ObjectExpression: ObjectExpression;
195
+ SequenceExpression: SequenceExpression;
196
+ TaggedTemplateExpression: TaggedTemplateExpression;
197
+ TemplateLiteral: TemplateLiteral;
198
+ ThisExpression: ThisExpression;
199
+ UnaryExpression: UnaryExpression;
200
+ UpdateExpression: UpdateExpression;
201
+ YieldExpression: YieldExpression;
202
+ }
203
+ type Expression = ExpressionMap[keyof ExpressionMap];
204
+ interface BaseExpression extends BaseNode {}
205
+ type ChainElement = SimpleCallExpression | MemberExpression;
206
+ interface ChainExpression extends BaseExpression {
207
+ type: "ChainExpression";
208
+ expression: ChainElement;
209
+ }
210
+ interface ThisExpression extends BaseExpression {
211
+ type: "ThisExpression";
212
+ }
213
+ interface ArrayExpression extends BaseExpression {
214
+ type: "ArrayExpression";
215
+ elements: Array<Expression | SpreadElement | null>;
216
+ }
217
+ interface ObjectExpression extends BaseExpression {
218
+ type: "ObjectExpression";
219
+ properties: Array<Property | SpreadElement>;
220
+ }
221
+ interface PrivateIdentifier extends BaseNode {
222
+ type: "PrivateIdentifier";
223
+ name: string;
224
+ }
225
+ interface Property extends BaseNode {
226
+ type: "Property";
227
+ key: Expression | PrivateIdentifier;
228
+ value: Expression | Pattern; // Could be an AssignmentProperty
229
+ kind: "init" | "get" | "set";
230
+ method: boolean;
231
+ shorthand: boolean;
232
+ computed: boolean;
233
+ }
234
+ interface PropertyDefinition extends BaseNode {
235
+ type: "PropertyDefinition";
236
+ key: Expression | PrivateIdentifier;
237
+ value?: Expression | null | undefined;
238
+ computed: boolean;
239
+ static: boolean;
240
+ }
241
+ interface FunctionExpression extends BaseFunction, BaseExpression {
242
+ id?: Identifier | null | undefined;
243
+ type: "FunctionExpression";
244
+ body: BlockStatement;
245
+ }
246
+ interface SequenceExpression extends BaseExpression {
247
+ type: "SequenceExpression";
248
+ expressions: Expression[];
249
+ }
250
+ interface UnaryExpression extends BaseExpression {
251
+ type: "UnaryExpression";
252
+ operator: UnaryOperator;
253
+ prefix: true;
254
+ argument: Expression;
255
+ }
256
+ interface BinaryExpression extends BaseExpression {
257
+ type: "BinaryExpression";
258
+ operator: BinaryOperator;
259
+ left: Expression | PrivateIdentifier;
260
+ right: Expression;
261
+ }
262
+ interface AssignmentExpression extends BaseExpression {
263
+ type: "AssignmentExpression";
264
+ operator: AssignmentOperator;
265
+ left: Pattern | MemberExpression;
266
+ right: Expression;
267
+ }
268
+ interface UpdateExpression extends BaseExpression {
269
+ type: "UpdateExpression";
270
+ operator: UpdateOperator;
271
+ argument: Expression;
272
+ prefix: boolean;
273
+ }
274
+ interface LogicalExpression extends BaseExpression {
275
+ type: "LogicalExpression";
276
+ operator: LogicalOperator;
277
+ left: Expression;
278
+ right: Expression;
279
+ }
280
+ interface ConditionalExpression extends BaseExpression {
281
+ type: "ConditionalExpression";
282
+ test: Expression;
283
+ alternate: Expression;
284
+ consequent: Expression;
285
+ }
286
+ interface BaseCallExpression extends BaseExpression {
287
+ callee: Expression | Super;
288
+ arguments: Array<Expression | SpreadElement>;
289
+ }
290
+ type CallExpression = SimpleCallExpression | NewExpression;
291
+ interface SimpleCallExpression extends BaseCallExpression {
292
+ type: "CallExpression";
293
+ optional: boolean;
294
+ }
295
+ interface NewExpression extends BaseCallExpression {
296
+ type: "NewExpression";
297
+ }
298
+ interface MemberExpression extends BaseExpression, BasePattern {
299
+ type: "MemberExpression";
300
+ object: Expression | Super;
301
+ property: Expression | PrivateIdentifier;
302
+ computed: boolean;
303
+ optional: boolean;
304
+ }
305
+ type Pattern = Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression;
306
+ interface BasePattern extends BaseNode {}
307
+ interface SwitchCase extends BaseNode {
308
+ type: "SwitchCase";
309
+ test?: Expression | null | undefined;
310
+ consequent: Statement[];
311
+ }
312
+ interface CatchClause extends BaseNode {
313
+ type: "CatchClause";
314
+ param: Pattern | null;
315
+ body: BlockStatement;
316
+ }
317
+ interface Identifier extends BaseNode, BaseExpression, BasePattern {
318
+ type: "Identifier";
319
+ name: string;
320
+ }
321
+ type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral;
322
+ interface SimpleLiteral extends BaseNode, BaseExpression {
323
+ type: "Literal";
324
+ value: string | boolean | number | null;
325
+ raw?: string | undefined;
326
+ }
327
+ interface RegExpLiteral extends BaseNode, BaseExpression {
328
+ type: "Literal";
329
+ value?: RegExp | null | undefined;
330
+ regex: {
331
+ pattern: string;
332
+ flags: string;
333
+ };
334
+ raw?: string | undefined;
335
+ }
336
+ interface BigIntLiteral extends BaseNode, BaseExpression {
337
+ type: "Literal";
338
+ value?: bigint | null | undefined;
339
+ bigint: string;
340
+ raw?: string | undefined;
341
+ }
342
+ type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
343
+ type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" | "instanceof";
344
+ type LogicalOperator = "||" | "&&" | "??";
345
+ type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "||=" | "&&=" | "??=";
346
+ type UpdateOperator = "++" | "--";
347
+ interface ForOfStatement extends BaseForXStatement {
348
+ type: "ForOfStatement";
349
+ await: boolean;
350
+ }
351
+ interface Super extends BaseNode {
352
+ type: "Super";
353
+ }
354
+ interface SpreadElement extends BaseNode {
355
+ type: "SpreadElement";
356
+ argument: Expression;
357
+ }
358
+ interface ArrowFunctionExpression extends BaseExpression, BaseFunction {
359
+ type: "ArrowFunctionExpression";
360
+ expression: boolean;
361
+ body: BlockStatement | Expression;
362
+ }
363
+ interface YieldExpression extends BaseExpression {
364
+ type: "YieldExpression";
365
+ argument?: Expression | null | undefined;
366
+ delegate: boolean;
367
+ }
368
+ interface TemplateLiteral extends BaseExpression {
369
+ type: "TemplateLiteral";
370
+ quasis: TemplateElement[];
371
+ expressions: Expression[];
372
+ }
373
+ interface TaggedTemplateExpression extends BaseExpression {
374
+ type: "TaggedTemplateExpression";
375
+ tag: Expression;
376
+ quasi: TemplateLiteral;
377
+ }
378
+ interface TemplateElement extends BaseNode {
379
+ type: "TemplateElement";
380
+ tail: boolean;
381
+ value: {
382
+ /** It is null when the template literal is tagged and the text has an invalid escape (e.g. - tag`\unicode and \u{55}`) */cooked?: string | null | undefined;
383
+ raw: string;
384
+ };
385
+ }
386
+ interface AssignmentProperty extends Property {
387
+ value: Pattern;
388
+ kind: "init";
389
+ method: boolean; // false
390
+ }
391
+ interface ObjectPattern extends BasePattern {
392
+ type: "ObjectPattern";
393
+ properties: Array<AssignmentProperty | RestElement>;
394
+ }
395
+ interface ArrayPattern extends BasePattern {
396
+ type: "ArrayPattern";
397
+ elements: Array<Pattern | null>;
398
+ }
399
+ interface RestElement extends BasePattern {
400
+ type: "RestElement";
401
+ argument: Pattern;
402
+ }
403
+ interface AssignmentPattern extends BasePattern {
404
+ type: "AssignmentPattern";
405
+ left: Pattern;
406
+ right: Expression;
407
+ }
408
+ interface BaseClass extends BaseNode {
409
+ superClass?: Expression | null | undefined;
410
+ body: ClassBody;
411
+ }
412
+ interface ClassBody extends BaseNode {
413
+ type: "ClassBody";
414
+ body: Array<MethodDefinition | PropertyDefinition | StaticBlock>;
415
+ }
416
+ interface MethodDefinition extends BaseNode {
417
+ type: "MethodDefinition";
418
+ key: Expression | PrivateIdentifier;
419
+ value: FunctionExpression;
420
+ kind: "constructor" | "method" | "get" | "set";
421
+ computed: boolean;
422
+ static: boolean;
423
+ }
424
+ interface MaybeNamedClassDeclaration extends BaseClass, BaseDeclaration {
425
+ type: "ClassDeclaration";
426
+ /** It is null when a class declaration is a part of the `export default class` statement */
427
+ id: Identifier | null;
428
+ }
429
+ interface ClassDeclaration extends MaybeNamedClassDeclaration {
430
+ id: Identifier;
431
+ }
432
+ interface ClassExpression extends BaseClass, BaseExpression {
433
+ type: "ClassExpression";
434
+ id?: Identifier | null | undefined;
435
+ }
436
+ interface MetaProperty extends BaseExpression {
437
+ type: "MetaProperty";
438
+ meta: Identifier;
439
+ property: Identifier;
440
+ }
441
+ type ModuleDeclaration = ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration;
442
+ interface BaseModuleDeclaration extends BaseNode {}
443
+ interface BaseModuleSpecifier extends BaseNode {
444
+ local: Identifier;
445
+ }
446
+ interface ImportDeclaration extends BaseModuleDeclaration {
447
+ type: "ImportDeclaration";
448
+ specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>;
449
+ attributes: ImportAttribute[];
450
+ source: Literal;
451
+ }
452
+ interface ImportSpecifier extends BaseModuleSpecifier {
453
+ type: "ImportSpecifier";
454
+ imported: Identifier | Literal;
455
+ }
456
+ interface ImportAttribute extends BaseNode {
457
+ type: "ImportAttribute";
458
+ key: Identifier | Literal;
459
+ value: Literal;
460
+ }
461
+ interface ImportExpression extends BaseExpression {
462
+ type: "ImportExpression";
463
+ source: Expression;
464
+ options?: Expression | null | undefined;
465
+ }
466
+ interface ImportDefaultSpecifier extends BaseModuleSpecifier {
467
+ type: "ImportDefaultSpecifier";
468
+ }
469
+ interface ImportNamespaceSpecifier extends BaseModuleSpecifier {
470
+ type: "ImportNamespaceSpecifier";
471
+ }
472
+ interface ExportNamedDeclaration extends BaseModuleDeclaration {
473
+ type: "ExportNamedDeclaration";
474
+ declaration?: Declaration | null | undefined;
475
+ specifiers: ExportSpecifier[];
476
+ attributes: ImportAttribute[];
477
+ source?: Literal | null | undefined;
478
+ }
479
+ interface ExportSpecifier extends Omit<BaseModuleSpecifier, "local"> {
480
+ type: "ExportSpecifier";
481
+ local: Identifier | Literal;
482
+ exported: Identifier | Literal;
483
+ }
484
+ interface ExportDefaultDeclaration extends BaseModuleDeclaration {
485
+ type: "ExportDefaultDeclaration";
486
+ declaration: MaybeNamedFunctionDeclaration | MaybeNamedClassDeclaration | Expression;
487
+ }
488
+ interface ExportAllDeclaration extends BaseModuleDeclaration {
489
+ type: "ExportAllDeclaration";
490
+ exported: Identifier | Literal | null;
491
+ attributes: ImportAttribute[];
492
+ source: Literal;
493
+ }
494
+ interface AwaitExpression extends BaseExpression {
495
+ type: "AwaitExpression";
496
+ argument: Expression;
497
+ }
498
+ //#endregion
499
+ //#region src/transforms/hoist.d.ts
500
+ declare function transformHoistInlineDirective(input: string, ast: Program, {
501
+ runtime,
502
+ rejectNonAsyncFunction,
503
+ ...options
504
+ }: {
505
+ runtime: (value: string, name: string, meta: {
506
+ directiveMatch: RegExpMatchArray;
507
+ }) => string;
508
+ directive: string | RegExp;
509
+ rejectNonAsyncFunction?: boolean;
510
+ encode?: (value: string) => string;
511
+ decode?: (value: string) => string;
512
+ noExport?: boolean;
513
+ }): {
514
+ output: MagicString;
515
+ names: string[];
516
+ };
517
+ declare function findDirectives(ast: Program, directive: string): Literal[];
518
+ //#endregion
519
+ //#region src/transforms/wrap-export.d.ts
520
+ type ExportMeta = {
521
+ declName?: string;
522
+ isFunction?: boolean;
523
+ defaultExportIdentifierName?: string;
524
+ };
525
+ type TransformWrapExportFilter = (name: string, meta: ExportMeta) => boolean;
526
+ type TransformWrapExportOptions = {
527
+ runtime: (value: string, name: string, meta: ExportMeta) => string;
528
+ ignoreExportAllDeclaration?: boolean;
529
+ rejectNonAsyncFunction?: boolean;
530
+ filter?: TransformWrapExportFilter;
531
+ };
532
+ declare function transformWrapExport(input: string, ast: Program, options: TransformWrapExportOptions): {
533
+ exportNames: string[];
534
+ output: MagicString;
535
+ };
536
+ //#endregion
537
+ //#region src/transforms/proxy-export.d.ts
538
+ type TransformProxyExportOptions = {
539
+ /** Required for source map and `keep` options */code?: string;
540
+ runtime: (name: string, meta?: {
541
+ value: string;
542
+ }) => string;
543
+ ignoreExportAllDeclaration?: boolean;
544
+ rejectNonAsyncFunction?: boolean;
545
+ /**
546
+ * escape hatch for Waku's `allowServer`
547
+ * @default false
548
+ */
549
+ keep?: boolean;
550
+ };
551
+ declare function transformDirectiveProxyExport(ast: Program, options: {
552
+ directive: string;
553
+ } & TransformProxyExportOptions): {
554
+ exportNames: string[];
555
+ output: MagicString;
556
+ } | undefined;
557
+ declare function transformProxyExport(ast: Program, options: TransformProxyExportOptions): {
558
+ exportNames: string[];
559
+ output: MagicString;
560
+ };
561
+ //#endregion
562
+ //#region src/transforms/utils.d.ts
563
+ declare function hasDirective(body: Program["body"], directive: string): boolean;
564
+ declare function getExportNames(ast: Program, options: {
565
+ ignoreExportAllDeclaration?: boolean;
566
+ }): {
567
+ exportNames: string[];
568
+ };
569
+ //#endregion
570
+ //#region src/transforms/server-action.d.ts
571
+ declare function transformServerActionServer(input: string, ast: Program, options: {
572
+ runtime: (value: string, name: string) => string;
573
+ rejectNonAsyncFunction?: boolean;
574
+ encode?: (value: string) => string;
575
+ decode?: (value: string) => string;
576
+ }): {
577
+ exportNames: string[];
578
+ output: MagicString;
579
+ } | {
580
+ output: MagicString;
581
+ names: string[];
582
+ };
583
+ //#endregion
584
+ export { transformDirectiveProxyExport as a, TransformWrapExportOptions as c, transformHoistInlineDirective as d, TransformProxyExportOptions as i, transformWrapExport as l, getExportNames as n, transformProxyExport as o, hasDirective as r, TransformWrapExportFilter as s, transformServerActionServer as t, findDirectives as u };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { c as getPluginApi, r as PluginApi, s as RscPluginOptions, u as vitePluginRsc } from "./plugin-V6VFxi_0.js";
2
- import "./index-DJ0AhQ9B.js";
1
+ import { c as getPluginApi, r as PluginApi, s as RscPluginOptions, u as vitePluginRsc } from "./plugin-K7i9F4Fd.js";
2
+ import "./index-CLmWsR1c.js";
3
3
  export { type PluginApi, type RscPluginOptions, vitePluginRsc as default, getPluginApi };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import "./cjs-DH9Oa3zy.js";
2
- import { r as vitePluginRsc, t as getPluginApi } from "./plugin-DBWiu_Dx.js";
3
- import "./transforms-D4jDIHgD.js";
4
- import "./rpc-DbBe389F.js";
1
+ import "./cjs-gAnoDF_x.js";
2
+ import { r as vitePluginRsc, t as getPluginApi } from "./plugin-cXbi5HUa.js";
3
+ import "./transforms-B2EJTNXG.js";
4
+ import "./rpc-EIuXyQpO.js";
5
5
 
6
6
  export { vitePluginRsc as default, getPluginApi };
@@ -1,4 +1,4 @@
1
- import { t as __commonJSMin } from "./chunk-BFhhoFQb.js";
1
+ import { t as __commonJSMin } from "./chunk-Dj_d7TT4.js";
2
2
 
3
3
  //#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
4
4
  var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {