@react-router/node 0.0.0-experimental-c0856287f

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/CHANGELOG.md ADDED
@@ -0,0 +1,581 @@
1
+ # `@remix-run/node`
2
+
3
+ ## 2.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Use undici as our fetch polyfill going forward ([#9106](https://github.com/remix-run/remix/pull/9106), [#9111](https://github.com/remix-run/remix/pull/9111))
8
+ - Put `undici` fetch polyfill behind a new `installGlobals({ nativeFetch: true })` parameter ([#9198](https://github.com/remix-run/remix/pull/9198))
9
+ - `remix-serve` will default to using `undici` for the fetch polyfill if `future._unstable_singleFetch` is enabled because the single fetch implementation relies on the `undici` polyfill
10
+ - Any users opting into Single Fetch and managing their own polfill will need to pass the flag to `installGlobals` on their own to avoid runtime errors with Single Fetch
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies:
15
+ - `@remix-run/server-runtime@2.9.0`
16
+
17
+ ## 2.8.1
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies:
22
+ - `@remix-run/server-runtime@2.8.1`
23
+
24
+ ## 2.8.0
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies:
29
+ - `@remix-run/server-runtime@2.8.0`
30
+
31
+ ## 2.7.2
32
+
33
+ ### Patch Changes
34
+
35
+ - Updated dependencies:
36
+ - `@remix-run/server-runtime@2.7.2`
37
+
38
+ ## 2.7.1
39
+
40
+ ### Patch Changes
41
+
42
+ - Updated dependencies:
43
+ - `@remix-run/server-runtime@2.7.1`
44
+
45
+ ## 2.7.0
46
+
47
+ ### Patch Changes
48
+
49
+ - Updated dependencies:
50
+ - `@remix-run/server-runtime@2.7.0`
51
+
52
+ ## 2.6.0
53
+
54
+ ### Patch Changes
55
+
56
+ - Updated dependencies:
57
+ - `@remix-run/server-runtime@2.6.0`
58
+
59
+ ## 2.5.1
60
+
61
+ ### Patch Changes
62
+
63
+ - Updated dependencies:
64
+ - `@remix-run/server-runtime@2.5.1`
65
+
66
+ ## 2.5.0
67
+
68
+ ### Patch Changes
69
+
70
+ - Updated dependencies:
71
+ - `@remix-run/server-runtime@2.5.0`
72
+
73
+ ## 2.4.1
74
+
75
+ ### Patch Changes
76
+
77
+ - Updated dependencies:
78
+ - `@remix-run/server-runtime@2.4.1`
79
+
80
+ ## 2.4.0
81
+
82
+ ### Minor Changes
83
+
84
+ - Deprecate `DataFunctionArgs` in favor of `LoaderFunctionArgs`/`ActionFunctionArgs`. This is aimed at keeping the types aligned across server/client loaders/actions now that `clientLoader`/`clientActon` functions have `serverLoader`/`serverAction` parameters which differentiate `ClientLoaderFunctionArgs`/`ClientActionFunctionArgs`. ([#8173](https://github.com/remix-run/remix/pull/8173))
85
+
86
+ ### Patch Changes
87
+
88
+ - Update to `@remix-run/web-fetch@4.4.2` ([#8231](https://github.com/remix-run/remix/pull/8231))
89
+ - Updated dependencies:
90
+ - `@remix-run/server-runtime@2.4.0`
91
+
92
+ ## 2.3.1
93
+
94
+ ### Patch Changes
95
+
96
+ - Updated dependencies:
97
+ - `@remix-run/server-runtime@2.3.1`
98
+
99
+ ## 2.3.0
100
+
101
+ ### Patch Changes
102
+
103
+ - Updated dependencies:
104
+ - `@remix-run/server-runtime@2.3.0`
105
+
106
+ ## 2.2.0
107
+
108
+ ### Patch Changes
109
+
110
+ - Updated dependencies:
111
+ - `@remix-run/server-runtime@2.2.0`
112
+
113
+ ## 2.1.0
114
+
115
+ ### Patch Changes
116
+
117
+ - Updated dependencies:
118
+ - `@remix-run/server-runtime@2.1.0`
119
+
120
+ ## 2.0.1
121
+
122
+ ### Patch Changes
123
+
124
+ - Switch from `crypto.randomBytes` to `crypto.webcrypto.getRandomValues` for file session storage ID generation ([#7203](https://github.com/remix-run/remix/pull/7203))
125
+ - Use native `Blob` class instead of polyfill ([#7217](https://github.com/remix-run/remix/pull/7217))
126
+ - Updated dependencies:
127
+ - `@remix-run/server-runtime@2.0.1`
128
+ - [`@remix-run/web-fetch@4.4.1`](https://github.com/remix-run/web-std-io/releases/tag/%40remix-run%2Fweb-fetch%404.4.1)
129
+
130
+ ## 2.0.0
131
+
132
+ ### Major Changes
133
+
134
+ - Require Node >=18.0.0 ([#6939](https://github.com/remix-run/remix/pull/6939))
135
+
136
+ - Stop exporting the `fetch` API in favor of using the version in the global scope - which can be polyfilled via `installGlobals` ([#7293](https://github.com/remix-run/remix/pull/7293))
137
+
138
+ - Removed/adjusted types to prefer `unknown` over `any` and to align with underlying React Router types ([#7319](https://github.com/remix-run/remix/pull/7319), [#7354](https://github.com/remix-run/remix/pull/7354)):
139
+
140
+ - Renamed the `useMatches()` return type from `RouteMatch` to `UIMatch`
141
+ - Renamed `LoaderArgs`/`ActionArgs` to `LoaderFunctionArgs`/`ActionFunctionArgs`
142
+ - `AppData` changed from `any` to `unknown`
143
+ - `Location["state"]` (`useLocation.state`) changed from `any` to `unknown`
144
+ - `UIMatch["data"]` (`useMatches()[i].data`) changed from `any` to `unknown`
145
+ - `UIMatch["handle"]` (`useMatches()[i].handle`) changed from `{ [k: string]: any }` to `unknown`
146
+ - `Fetcher["data"]` (`useFetcher().data`) changed from `any` to `unknown`
147
+ - `MetaMatch.handle` (used in `meta()`) changed from `any` to `unknown`
148
+ - `AppData`/`RouteHandle` are no longer exported as they are just aliases for `unknown`
149
+
150
+ - The route `meta` API now defaults to the new "V2 Meta" API ([#6958](https://github.com/remix-run/remix/pull/6958))
151
+
152
+ - Please refer to the ([docs](https://remix.run/docs/en/2.0.0/route/meta) and [Preparing for V2](https://remix.run/docs/en/2.0.0/start/v2#route-meta) guide for more information.
153
+
154
+ - For preparation of using Node's built in fetch implementation, installing the fetch globals is now a responsibility of the app server ([#7009](https://github.com/remix-run/remix/pull/7009))
155
+
156
+ - If you are using `remix-serve`, nothing is required
157
+ - If you are using your own app server, you will need to install the globals yourself
158
+
159
+ ```js filename=server.js
160
+ import { installGlobals } from "@remix-run/node";
161
+
162
+ installGlobals();
163
+ ```
164
+
165
+ - `source-map-support` is now a responsibility of the app server ([#7009](https://github.com/remix-run/remix/pull/7009))
166
+
167
+ - If you are using `remix-serve`, nothing is required
168
+ - If you are using your own app server, you will need to install [`source-map-support`](https://www.npmjs.com/package/source-map-support) yourself.
169
+
170
+ ```sh
171
+ npm i source-map-support
172
+ ```
173
+
174
+ ```js filename=server.js
175
+ import sourceMapSupport from "source-map-support";
176
+ sourceMapSupport.install();
177
+ ```
178
+
179
+ - Removed support for "magic exports" from the `remix` package. This package can be removed from your `package.json` and you should update all imports to use the source `@remix-run/*` packages: ([#6895](https://github.com/remix-run/remix/pull/6895))
180
+
181
+ ```diff
182
+ - import type { ActionArgs } from "remix";
183
+ - import { json, useLoaderData } from "remix";
184
+ + import type { ActionArgs } from "@remix-run/node";
185
+ + import { json } from "@remix-run/node";
186
+ + import { useLoaderData } from "@remix-run/react";
187
+ ```
188
+
189
+ ### Minor Changes
190
+
191
+ - Re-export the new `redirectDocument` method from React Router ([#7040](https://github.com/remix-run/remix/pull/7040), [#6842](https://github.com/remix-run/remix/pull/6842)) ([#7040](https://github.com/remix-run/remix/pull/7040))
192
+
193
+ ### Patch Changes
194
+
195
+ - Remove `atob`/`btoa` polyfills in favor of built-in versions ([#7206](https://github.com/remix-run/remix/pull/7206))
196
+ - Export proper `ErrorResponse` type for usage alongside `isRouteErrorResponse` ([#7244](https://github.com/remix-run/remix/pull/7244))
197
+ - Add the rest of the Web Streams API to `installGlobals` ([#7321](https://github.com/remix-run/remix/pull/7321))
198
+ - Ensures `fetch()` return is `instanceof global Response` by removing extended classes for `NodeRequest` and `NodeResponse` in favor of custom interface type cast ([#7109](https://github.com/remix-run/remix/pull/7109))
199
+ - Remove recursion from stream utilities ([#7245](https://github.com/remix-run/remix/pull/7245))
200
+ - Updated dependencies:
201
+ - `@remix-run/server-runtime@2.0.0`
202
+ - `@remix-run/web-fetch@4.4.0`
203
+ - `@remix-run/web-file@3.1.0`
204
+ - `@remix-run/web-stream@1.1.0`
205
+
206
+ ## 1.19.3
207
+
208
+ ### Patch Changes
209
+
210
+ - Updated dependencies:
211
+ - `@remix-run/server-runtime@1.19.3`
212
+
213
+ ## 1.19.2
214
+
215
+ ### Patch Changes
216
+
217
+ - Update to latest `@remix-run/web-*` packages ([#7026](https://github.com/remix-run/remix/pull/7026))
218
+ - Updated dependencies:
219
+ - `@remix-run/server-runtime@1.19.2`
220
+
221
+ ## 1.19.1
222
+
223
+ ### Patch Changes
224
+
225
+ - Updated dependencies:
226
+ - `@remix-run/server-runtime@1.19.1`
227
+
228
+ ## 1.19.0
229
+
230
+ ### Patch Changes
231
+
232
+ - Upgrade to [`@remix-run/web-fetch@4.3.5`](https://github.com/remix-run/web-std-io/releases/tag/%40remix-run%2Fweb-fetch%404.3.5). Submitted empty file inputs are now correctly parsed out as empty `File` instances instead of being surfaced as an empty string via `request.formData()` ([#6816](https://github.com/remix-run/remix/pull/6816))
233
+ - Updated dependencies:
234
+ - `@remix-run/server-runtime@1.19.0`
235
+
236
+ ## 1.18.1
237
+
238
+ ### Patch Changes
239
+
240
+ - Updated dependencies:
241
+ - `@remix-run/server-runtime@1.18.1`
242
+
243
+ ## 1.18.0
244
+
245
+ ### Patch Changes
246
+
247
+ - Updated dependencies:
248
+ - `@remix-run/server-runtime@1.18.0`
249
+
250
+ ## 1.17.1
251
+
252
+ ### Patch Changes
253
+
254
+ - Updated dependencies:
255
+ - `@remix-run/server-runtime@1.17.1`
256
+
257
+ ## 1.17.0
258
+
259
+ ### Patch Changes
260
+
261
+ - Add `HeadersArgs` type to be consistent with loaders/actions/meta and allows for using a `function` declaration in addition to an arrow function expression ([#6247](https://github.com/remix-run/remix/pull/6247))
262
+
263
+ ```tsx
264
+ import type { HeadersArgs } from "@remix-run/node"; // or cloudflare/deno
265
+
266
+ export function headers({ loaderHeaders }: HeadersArgs) {
267
+ return {
268
+ "x-my-custom-thing": loaderHeaders.get("x-my-custom-thing") || "fallback",
269
+ };
270
+ }
271
+ ```
272
+
273
+ - Fix `request.clone() instanceof Request` returning false. ([#6512](https://github.com/remix-run/remix/pull/6512))
274
+
275
+ - Updated dependencies:
276
+ - `@remix-run/server-runtime@1.17.0`
277
+
278
+ ## 1.16.1
279
+
280
+ ### Patch Changes
281
+
282
+ - Updated dependencies:
283
+ - `@remix-run/server-runtime@1.16.1`
284
+
285
+ ## 1.16.0
286
+
287
+ ### Patch Changes
288
+
289
+ - add `@remix-run/node/install` side-effect to allow `node --require @remix-run/node/install` ([#6132](https://github.com/remix-run/remix/pull/6132))
290
+ - add `logDevReady` as replacement for platforms that can't initialize async I/O outside of the request response lifecycle. ([#6204](https://github.com/remix-run/remix/pull/6204))
291
+ - add missing files to published package ([#6179](https://github.com/remix-run/remix/pull/6179))
292
+ - Updated dependencies:
293
+ - `@remix-run/server-runtime@1.16.0`
294
+
295
+ ## 1.15.0
296
+
297
+ ### Minor Changes
298
+
299
+ - We have made a few changes to the API for route module `meta` functions when using the `future.v2_meta` flag. **These changes are _only_ breaking for users who have opted in.** ([#5746](https://github.com/remix-run/remix/pull/5746))
300
+
301
+ - `V2_HtmlMetaDescriptor` has been renamed to `V2_MetaDescriptor`
302
+ - The `meta` function's arguments have been simplified
303
+ - `parentsData` has been removed, as each route's loader data is available on the `data` property of its respective `match` object
304
+ ```tsx
305
+ // before
306
+ export function meta({ parentsData }) {
307
+ return [{ title: parentsData["routes/some-route"].title }];
308
+ }
309
+ // after
310
+ export function meta({ matches }) {
311
+ return [
312
+ {
313
+ title: matches.find((match) => match.id === "routes/some-route")
314
+ .data.title,
315
+ },
316
+ ];
317
+ }
318
+ ```
319
+ - The `route` property on route matches has been removed, as relevant match data is attached directly to the match object
320
+ ```tsx
321
+ // before
322
+ export function meta({ matches }) {
323
+ const rootModule = matches.find((match) => match.route.id === "root");
324
+ }
325
+ // after
326
+ export function meta({ matches }) {
327
+ const rootModule = matches.find((match) => match.id === "root");
328
+ }
329
+ ```
330
+ - Added support for generating `<script type='application/ld+json' />` and meta-related `<link />` tags to document head via the route `meta` function when using the `v2_meta` future flag
331
+
332
+ ### Patch Changes
333
+
334
+ - Updated dependencies:
335
+ - `@remix-run/server-runtime@1.15.0`
336
+
337
+ ## 1.14.3
338
+
339
+ ### Patch Changes
340
+
341
+ - Updated dependencies:
342
+ - `@remix-run/server-runtime@1.14.3`
343
+
344
+ ## 1.14.2
345
+
346
+ ### Patch Changes
347
+
348
+ - Updated dependencies:
349
+ - `@remix-run/server-runtime@1.14.2`
350
+
351
+ ## 1.14.1
352
+
353
+ ### Patch Changes
354
+
355
+ - Updated dependencies:
356
+ - `@remix-run/server-runtime@1.14.1`
357
+
358
+ ## 1.14.0
359
+
360
+ ### Patch Changes
361
+
362
+ - Updated dependencies:
363
+ - `@remix-run/server-runtime@1.14.0`
364
+
365
+ ## 1.13.0
366
+
367
+ ### Patch Changes
368
+
369
+ - Updated dependencies:
370
+ - `@remix-run/server-runtime@1.13.0`
371
+
372
+ ## 1.12.0
373
+
374
+ ### Patch Changes
375
+
376
+ - Updated dependencies:
377
+ - `@remix-run/server-runtime@1.12.0`
378
+
379
+ ## 1.11.1
380
+
381
+ ### Patch Changes
382
+
383
+ - Updated dependencies:
384
+ - `@remix-run/server-runtime@1.11.1`
385
+
386
+ ## 1.11.0
387
+
388
+ ### Patch Changes
389
+
390
+ - Introduces the `defer()` API from `@remix-run/router` with support for server-rendering and HTTP streaming. This utility allows you to defer values returned from `loader` functions by returning promises instead of resolved values. This has been refered to as _"sending a promise over the wire"_. ([#4920](https://github.com/remix-run/remix/pull/4920))
391
+
392
+ Informational Resources:
393
+
394
+ - <https://gist.github.com/jacob-ebey/9bde9546c1aafaa6bc8c242054b1be26>
395
+ - <https://github.com/remix-run/remix/blob/main/decisions/0004-streaming-apis.md>
396
+
397
+ Documentation Resources (better docs specific to Remix are in the works):
398
+
399
+ - <https://reactrouter.com/en/main/utils/defer>
400
+ - <https://reactrouter.com/en/main/components/await>
401
+ - <https://reactrouter.com/en/main/hooks/use-async-value>
402
+ - <https://reactrouter.com/en/main/hooks/use-async-error>
403
+
404
+ - Updated dependencies:
405
+ - `@remix-run/server-runtime@1.11.0`
406
+
407
+ ## 1.10.1
408
+
409
+ ### Patch Changes
410
+
411
+ - Updated dependencies:
412
+ - `@remix-run/server-runtime@1.10.1`
413
+
414
+ ## 1.10.0
415
+
416
+ ### Patch Changes
417
+
418
+ - Export `V2_HtmlMetaDescriptor` and `V2_MetaFunction` types from runtime packages ([#4943](https://github.com/remix-run/remix/pull/4943))
419
+ - Updated dependencies:
420
+ - `@remix-run/server-runtime@1.10.0`
421
+
422
+ ## 1.9.0
423
+
424
+ ### Patch Changes
425
+
426
+ - Updated dependencies:
427
+ - `@remix-run/server-runtime@1.9.0`
428
+
429
+ ## 1.8.2
430
+
431
+ ### Patch Changes
432
+
433
+ - Updated dependencies:
434
+ - `@remix-run/server-runtime@1.8.2`
435
+
436
+ ## 1.8.1
437
+
438
+ ### Patch Changes
439
+
440
+ - Updated dependencies:
441
+ - `@remix-run/server-runtime@1.8.1`
442
+
443
+ ## 1.8.0
444
+
445
+ ### Minor Changes
446
+
447
+ - Importing functions and types from the `remix` package is deprecated, and all ([#3284](https://github.com/remix-run/remix/pull/3284))
448
+ exported modules will be removed in the next major release. For more details,
449
+ [see the release notes for 1.4.0](https://github.com/remix-run/remix/releases/tag/v1.4.0)
450
+ where these changes were first announced.
451
+
452
+ ### Patch Changes
453
+
454
+ - Update `@remix-run/web-fetch`. This addresses two bugs: ([#4644](https://github.com/remix-run/remix/pull/4644))
455
+ - It fixes a memory leak caused by unregistered listeners
456
+ - It adds support for custom `"credentials"` values (Remix does nothing with these at the moment, but they pass through for the consumer of the request to access if needed)
457
+ - Updated dependencies:
458
+ - `@remix-run/server-runtime@1.8.0`
459
+
460
+ ## 1.7.6
461
+
462
+ ### Patch Changes
463
+
464
+ - Updated dependencies:
465
+ - `@remix-run/server-runtime@1.7.6`
466
+
467
+ ## 1.7.5
468
+
469
+ ### Patch Changes
470
+
471
+ - Updated dependencies:
472
+ - `@remix-run/server-runtime@1.7.5`
473
+
474
+ ## 1.7.4
475
+
476
+ ### Patch Changes
477
+
478
+ - Updated dependencies:
479
+ - `@remix-run/server-runtime@1.7.4`
480
+
481
+ ## 1.7.3
482
+
483
+ ### Patch Changes
484
+
485
+ - Updated dependencies:
486
+ - `@remix-run/server-runtime@1.7.3`
487
+ - `@remix-run/web-fetch@4.3.1`
488
+
489
+ ## 1.7.2
490
+
491
+ ### Patch Changes
492
+
493
+ - Flush Node streams to address issues with libraries like `compression` that rely on chunk flushing ([#4235](https://github.com/remix-run/remix/pull/4235))
494
+ - Updated dependencies:
495
+ - `@remix-run/server-runtime@1.7.2`
496
+
497
+ ## 1.7.1
498
+
499
+ ### Patch Changes
500
+
501
+ - Updated dependencies:
502
+ - `@remix-run/server-runtime@1.7.1`
503
+
504
+ ## 1.7.0
505
+
506
+ ### Minor Changes
507
+
508
+ - We've added a new type: `SerializeFrom`. This is used to infer the ([#4013](https://github.com/remix-run/remix/pull/4013))
509
+ JSON-serialized return type of loaders and actions.
510
+
511
+ ### Patch Changes
512
+
513
+ - Fixed a bug when destroying `fileStorage` sessions to prevent deleting entire session directories
514
+ - Updated dependencies:
515
+ - `@remix-run/server-runtime@1.7.0`
516
+
517
+ ## 1.6.8
518
+
519
+ ### Patch Changes
520
+
521
+ - Updated dependencies:
522
+ - `@remix-run/server-runtime@1.6.8`
523
+
524
+ ## 1.6.7
525
+
526
+ ### Patch Changes
527
+
528
+ - Updated dependencies:
529
+ - `@remix-run/server-runtime@1.6.7`
530
+
531
+ ## 1.6.6
532
+
533
+ ### Patch Changes
534
+
535
+ - Updated dependencies:
536
+ - `@remix-run/server-runtime@1.6.6`
537
+
538
+ ## 1.6.5
539
+
540
+ ### Patch Changes
541
+
542
+ - We enhanced the type signatures of `loader`/`action` and
543
+ `useLoaderData`/`useActionData` to make it possible to infer the data type
544
+ from return type of its related server function.
545
+
546
+ To enable this feature, you will need to use the `LoaderArgs` type from
547
+ `@remix-run/node` instead of typing the function directly:
548
+
549
+ ```diff
550
+ - import type { LoaderFunction } from "@remix-run/node";
551
+ + import type { LoaderArgs } from "@remix-run/node";
552
+
553
+ - export const loader: LoaderFunction = async (args) => {
554
+ - return json<LoaderData>(data);
555
+ - }
556
+ + export async function loader(args: LoaderArgs) {
557
+ + return json(data);
558
+ + }
559
+ ```
560
+
561
+ Then you can infer the loader data by using `typeof loader` as the type
562
+ variable in `useLoaderData`:
563
+
564
+ ```diff
565
+ - let data = useLoaderData() as LoaderData;
566
+ + let data = useLoaderData<typeof loader>();
567
+ ```
568
+
569
+ The API above is exactly the same for your route `action` and `useActionData`
570
+ via the `ActionArgs` type.
571
+
572
+ With this change you no longer need to manually define a `LoaderData` type
573
+ (huge time and typo saver!), and we serialize all values so that
574
+ `useLoaderData` can't return types that are impossible over the network, such
575
+ as `Date` objects or functions.
576
+
577
+ See the discussions in [#1254](https://github.com/remix-run/remix/pull/1254)
578
+ and [#3276](https://github.com/remix-run/remix/pull/3276) for more context.
579
+
580
+ - Updated dependencies
581
+ - `@remix-run/server-runtime`
package/LICENSE.md ADDED
@@ -0,0 +1,23 @@
1
+ MIT License
2
+
3
+ Copyright (c) React Training LLC 2015-2019
4
+ Copyright (c) Remix Software Inc. 2020-2021
5
+ Copyright (c) Shopify Inc. 2022-2023
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,13 @@
1
+ # Welcome to Remix!
2
+
3
+ [Remix](https://remix.run) is a web framework that helps you build better websites with React.
4
+
5
+ To get started, open a new shell and run:
6
+
7
+ ```sh
8
+ npx create-remix@latest
9
+ ```
10
+
11
+ Then follow the prompts you see in your terminal.
12
+
13
+ For more information about Remix, [visit remix.run](https://remix.run)!
@@ -0,0 +1,3 @@
1
+ import type { SignFunction, UnsignFunction } from "@react-router/server-runtime";
2
+ export declare const sign: SignFunction;
3
+ export declare const unsign: UnsignFunction;
package/dist/crypto.js ADDED
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @react-router/node v0.0.0-experimental-c0856287f
3
+ *
4
+ * Copyright (c) Remix Software Inc.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE.md file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */
11
+ 'use strict';
12
+
13
+ Object.defineProperty(exports, '__esModule', { value: true });
14
+
15
+ var cookieSignature = require('cookie-signature');
16
+
17
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
18
+
19
+ var cookieSignature__default = /*#__PURE__*/_interopDefaultLegacy(cookieSignature);
20
+
21
+ const sign = async (value, secret) => {
22
+ return cookieSignature__default["default"].sign(value, secret);
23
+ };
24
+ const unsign = async (signed, secret) => {
25
+ return cookieSignature__default["default"].unsign(signed, secret);
26
+ };
27
+
28
+ exports.sign = sign;
29
+ exports.unsign = unsign;
@@ -0,0 +1,21 @@
1
+ declare global {
2
+ namespace NodeJS {
3
+ interface ProcessEnv {
4
+ NODE_ENV: "development" | "production" | "test";
5
+ }
6
+ interface Global {
7
+ File: typeof File;
8
+ Headers: typeof Headers;
9
+ Request: typeof Request;
10
+ Response: typeof Response;
11
+ fetch: typeof fetch;
12
+ FormData: typeof FormData;
13
+ ReadableStream: typeof ReadableStream;
14
+ WritableStream: typeof WritableStream;
15
+ }
16
+ }
17
+ interface RequestInit {
18
+ duplex?: "half";
19
+ }
20
+ }
21
+ export declare function installGlobals(): void;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @react-router/node v0.0.0-experimental-c0856287f
3
+ *
4
+ * Copyright (c) Remix Software Inc.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE.md file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */
11
+ 'use strict';
12
+
13
+ Object.defineProperty(exports, '__esModule', { value: true });
14
+
15
+ var undici = require('undici');
16
+
17
+ function installGlobals() {
18
+ global.File = undici.File;
19
+ // @ts-expect-error - overriding globals
20
+ global.Headers = undici.Headers;
21
+ // @ts-expect-error - overriding globals
22
+ global.Request = undici.Request;
23
+ // @ts-expect-error - overriding globals
24
+ global.Response = undici.Response;
25
+ // @ts-expect-error - overriding globals
26
+ global.fetch = undici.fetch;
27
+ // @ts-expect-error - overriding globals
28
+ global.FormData = undici.FormData;
29
+ }
30
+
31
+ exports.installGlobals = installGlobals;