@webtypen/webframez-react 0.0.2 → 0.0.4
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 +238 -110
- package/bin/webframez-react.mjs +179 -7
- package/defaults/tsconfig.server.example.json +46 -0
- package/defaults/tsconfig.server.json +13 -0
- package/defaults/webpack.client.cjs +4 -1
- package/defaults/webpack.server.cjs +8 -1
- package/dist/client.cjs +1 -1
- package/dist/client.js +1 -1
- package/dist/http.cjs +55 -19
- package/dist/http.d.ts +18 -7
- package/dist/http.js +55 -19
- package/dist/index.cjs +55 -19
- package/dist/index.d.ts +2 -5
- package/dist/index.js +55 -19
- package/dist/router.cjs +30 -10
- package/dist/router.js +30 -10
- package/dist/types.d.ts +25 -8
- package/dist/webframez-core.cjs +55 -19
- package/dist/webframez-core.d.ts +32 -8
- package/dist/webframez-core.js +55 -19
- package/package.json +5 -2
- package/register.cjs +1 -0
package/dist/types.d.ts
CHANGED
|
@@ -9,17 +9,24 @@ export type AbortRouteOptions = {
|
|
|
9
9
|
payload?: unknown;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
export type RouteContext = {
|
|
12
|
+
export type RouteContext<TData = unknown> = {
|
|
13
13
|
pathname: string;
|
|
14
14
|
params: RouteParams;
|
|
15
15
|
searchParams: RouteSearchParams;
|
|
16
16
|
cookies: Record<string, string>;
|
|
17
|
+
data?: TData;
|
|
17
18
|
abort: (options?: AbortRouteOptions) => never;
|
|
18
19
|
};
|
|
19
20
|
|
|
20
|
-
export type
|
|
21
|
+
export type InferPageData<TDataResolver> =
|
|
22
|
+
TDataResolver extends (...args: any[]) => any
|
|
23
|
+
? Awaited<ReturnType<TDataResolver>>
|
|
24
|
+
: TDataResolver;
|
|
25
|
+
export type PageProps<TData = unknown> = RouteContext<InferPageData<TData>>;
|
|
26
|
+
export type PagePropsFromData<TDataResolver extends (...args: any[]) => any> =
|
|
27
|
+
PageProps<InferPageData<TDataResolver>>;
|
|
21
28
|
|
|
22
|
-
export type ErrorPageProps = RouteContext & {
|
|
29
|
+
export type ErrorPageProps<TData = unknown> = RouteContext<TData> & {
|
|
23
30
|
statusCode: number;
|
|
24
31
|
message: string;
|
|
25
32
|
payload?: unknown;
|
|
@@ -49,22 +56,32 @@ export type HeadConfig = {
|
|
|
49
56
|
links?: HeadLinkTag[];
|
|
50
57
|
};
|
|
51
58
|
|
|
59
|
+
export type ClientNavigationPayload = {
|
|
60
|
+
model: ReactNode;
|
|
61
|
+
head: HeadConfig;
|
|
62
|
+
};
|
|
63
|
+
|
|
52
64
|
export type HeadResolver<TContext = RouteContext> = (
|
|
53
65
|
context: TContext
|
|
54
66
|
) => HeadConfig | Promise<HeadConfig>;
|
|
55
67
|
|
|
56
|
-
export type
|
|
57
|
-
|
|
58
|
-
|
|
68
|
+
export type PageDataResolver<TData = unknown> = (
|
|
69
|
+
context: RouteContext
|
|
70
|
+
) => TData | Promise<TData>;
|
|
71
|
+
|
|
72
|
+
export type PageModule<TData = unknown> = {
|
|
73
|
+
default: (props: PageProps<TData>) => ReactNode | Promise<ReactNode>;
|
|
74
|
+
Head?: HeadResolver<PageProps<TData>>;
|
|
75
|
+
Data?: PageDataResolver<TData>;
|
|
59
76
|
};
|
|
60
77
|
|
|
61
78
|
export type LayoutModule = {
|
|
62
|
-
default: (props: RouteContext) => ReactNode
|
|
79
|
+
default: (props: RouteContext) => ReactNode | Promise<ReactNode>;
|
|
63
80
|
Head?: HeadResolver<RouteContext>;
|
|
64
81
|
};
|
|
65
82
|
|
|
66
83
|
export type ErrorModule = {
|
|
67
|
-
default: (props: ErrorPageProps) => ReactNode
|
|
84
|
+
default: (props: ErrorPageProps) => ReactNode | Promise<ReactNode>;
|
|
68
85
|
Head?: HeadResolver<ErrorPageProps>;
|
|
69
86
|
};
|
|
70
87
|
|
package/dist/webframez-core.cjs
CHANGED
|
@@ -226,6 +226,10 @@ function readSearchParams(urlSearchParams) {
|
|
|
226
226
|
function escapeHtml(value) {
|
|
227
227
|
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/\"/g, """).replace(/'/g, "'");
|
|
228
228
|
}
|
|
229
|
+
var MANAGED_HEAD_ATTR = "data-webframez-head";
|
|
230
|
+
function createManagedAttributes() {
|
|
231
|
+
return `${MANAGED_HEAD_ATTR}="true"`;
|
|
232
|
+
}
|
|
229
233
|
function toRouteEntry(pagesDir, filePath) {
|
|
230
234
|
const normalized = filePath.replace(/\\/g, "/");
|
|
231
235
|
if (!normalized.endsWith("/index.js")) {
|
|
@@ -294,19 +298,21 @@ function renderHeadToString(head) {
|
|
|
294
298
|
const tags = [];
|
|
295
299
|
if (head.description) {
|
|
296
300
|
tags.push(
|
|
297
|
-
`<meta name="description" content="${escapeHtml(head.description)}" />`
|
|
301
|
+
`<meta ${createManagedAttributes()} name="description" content="${escapeHtml(head.description)}" />`
|
|
298
302
|
);
|
|
299
303
|
}
|
|
300
304
|
if (head.favicon) {
|
|
301
|
-
tags.push(
|
|
305
|
+
tags.push(
|
|
306
|
+
`<link ${createManagedAttributes()} rel="icon" href="${escapeHtml(head.favicon)}" />`
|
|
307
|
+
);
|
|
302
308
|
}
|
|
303
309
|
for (const meta of head.meta ?? []) {
|
|
304
310
|
const attrs = Object.entries(meta).filter(([, value]) => Boolean(value)).map(([key, value]) => `${key}="${escapeHtml(String(value))}"`).join(" ");
|
|
305
|
-
tags.push(`<meta ${attrs} />`);
|
|
311
|
+
tags.push(`<meta ${createManagedAttributes()} ${attrs} />`);
|
|
306
312
|
}
|
|
307
313
|
for (const link of head.links ?? []) {
|
|
308
314
|
const attrs = Object.entries(link).filter(([, value]) => Boolean(value)).map(([key, value]) => `${key}="${escapeHtml(String(value))}"`).join(" ");
|
|
309
|
-
tags.push(`<link ${attrs} />`);
|
|
315
|
+
tags.push(`<link ${createManagedAttributes()} ${attrs} />`);
|
|
310
316
|
}
|
|
311
317
|
return tags.join("\n");
|
|
312
318
|
}
|
|
@@ -320,6 +326,12 @@ async function resolveHead(candidate, context) {
|
|
|
320
326
|
}
|
|
321
327
|
return candidate.Head(context);
|
|
322
328
|
}
|
|
329
|
+
async function resolvePageData(candidate, context) {
|
|
330
|
+
if (!candidate.Data) {
|
|
331
|
+
return void 0;
|
|
332
|
+
}
|
|
333
|
+
return candidate.Data(context);
|
|
334
|
+
}
|
|
323
335
|
function findBestMatch(entries, pathname) {
|
|
324
336
|
const matches = [];
|
|
325
337
|
for (const entry of entries) {
|
|
@@ -399,10 +411,11 @@ function createFileRouter(options) {
|
|
|
399
411
|
};
|
|
400
412
|
}
|
|
401
413
|
const errorModule = resolveModule(errorPath);
|
|
402
|
-
const errorNode = errorModule.default(errorProps);
|
|
414
|
+
const errorNode = await errorModule.default(errorProps);
|
|
403
415
|
const layoutHead = layoutModule ? await resolveHead(layoutModule, context) : void 0;
|
|
404
416
|
const errorHead = await resolveHead(errorModule, errorProps);
|
|
405
|
-
const
|
|
417
|
+
const layoutNode = layoutModule ? await layoutModule.default(context) : null;
|
|
418
|
+
const model = layoutNode ? injectRouteChildren(layoutNode, errorNode) : errorNode;
|
|
406
419
|
return {
|
|
407
420
|
statusCode,
|
|
408
421
|
model,
|
|
@@ -434,10 +447,17 @@ function createFileRouter(options) {
|
|
|
434
447
|
activeContext = context;
|
|
435
448
|
const pageModule = resolveModule(match.entry.filePath);
|
|
436
449
|
const layoutModule = import_node_fs.default.existsSync(layoutPath) ? resolveModule(layoutPath) : null;
|
|
437
|
-
const
|
|
438
|
-
const
|
|
439
|
-
|
|
440
|
-
|
|
450
|
+
const pageData = await resolvePageData(pageModule, context);
|
|
451
|
+
const pageContext = {
|
|
452
|
+
...context,
|
|
453
|
+
data: pageData
|
|
454
|
+
};
|
|
455
|
+
activeContext = pageContext;
|
|
456
|
+
const pageNode = await pageModule.default(pageContext);
|
|
457
|
+
const layoutHead = layoutModule ? await resolveHead(layoutModule, pageContext) : void 0;
|
|
458
|
+
const pageHead = await resolveHead(pageModule, pageContext);
|
|
459
|
+
const layoutNode = layoutModule ? await layoutModule.default(pageContext) : null;
|
|
460
|
+
const model = layoutNode ? injectRouteChildren(layoutNode, pageNode) : pageNode;
|
|
441
461
|
return {
|
|
442
462
|
statusCode: 200,
|
|
443
463
|
model,
|
|
@@ -482,14 +502,26 @@ function stripBasePath(pathname, basePath) {
|
|
|
482
502
|
}
|
|
483
503
|
function runNodeCommand(args) {
|
|
484
504
|
return new Promise((resolve, reject) => {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
505
|
+
const execArgs = [
|
|
506
|
+
"--conditions",
|
|
507
|
+
"react-server",
|
|
508
|
+
"-r",
|
|
509
|
+
"@webtypen/webframez-react/register",
|
|
510
|
+
...args
|
|
511
|
+
];
|
|
512
|
+
(0, import_node_child_process.execFile)(
|
|
513
|
+
process.execPath,
|
|
514
|
+
execArgs,
|
|
515
|
+
{ timeout: 1e4, maxBuffer: 1024 * 1024 * 5 },
|
|
516
|
+
(error, stdout, stderr) => {
|
|
517
|
+
if (error) {
|
|
518
|
+
const out = stderr && stderr.trim() !== "" ? stderr : stdout;
|
|
519
|
+
reject(new Error(out || error.message));
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
resolve({ stdout, stderr });
|
|
490
523
|
}
|
|
491
|
-
|
|
492
|
-
});
|
|
524
|
+
);
|
|
493
525
|
});
|
|
494
526
|
}
|
|
495
527
|
async function renderInitialHtmlInWorker(options) {
|
|
@@ -513,7 +545,7 @@ Module._resolveFilename = function(request, parent, isMain, options) {
|
|
|
513
545
|
}
|
|
514
546
|
return originalResolveFilename.call(this, request, parent, isMain, options);
|
|
515
547
|
};
|
|
516
|
-
const { createFileRouter } = require("webframez-react/router");
|
|
548
|
+
const { createFileRouter } = require("@webtypen/webframez-react/router");
|
|
517
549
|
const reactDomPkg = require.resolve("react-dom/package.json", {
|
|
518
550
|
paths: [process.cwd(), input.pagesDir]
|
|
519
551
|
});
|
|
@@ -652,7 +684,11 @@ function createNodeRequestHandler(options) {
|
|
|
652
684
|
cookies: requestCookies
|
|
653
685
|
})
|
|
654
686
|
);
|
|
655
|
-
|
|
687
|
+
const payload = {
|
|
688
|
+
model: resolved2.model,
|
|
689
|
+
head: resolved2.head
|
|
690
|
+
};
|
|
691
|
+
sendRSC(res, payload, {
|
|
656
692
|
moduleMap,
|
|
657
693
|
statusCode: resolved2.statusCode
|
|
658
694
|
});
|
package/dist/webframez-core.d.ts
CHANGED
|
@@ -2,18 +2,42 @@ import type { RouteFacade } from "@webtypen/webframez-core";
|
|
|
2
2
|
import type { CreateNodeHandlerOptions } from "./http";
|
|
3
3
|
|
|
4
4
|
export type WebframezCoreRouteMethod = "GET" | "POST" | "PUT" | "DELETE";
|
|
5
|
+
export type WebframezCoreRouteMiddleware = string | string[];
|
|
5
6
|
|
|
6
|
-
export
|
|
7
|
+
export interface WebframezCoreRouteRegistrationOptions {
|
|
8
|
+
middleware?: WebframezCoreRouteMiddleware;
|
|
9
|
+
domains?: string | string[];
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface WebframezCoreReactRenderRouteOptions
|
|
14
|
+
extends CreateNodeHandlerOptions {
|
|
7
15
|
method?: WebframezCoreRouteMethod | WebframezCoreRouteMethod[];
|
|
8
|
-
routeOptions?:
|
|
9
|
-
}
|
|
16
|
+
routeOptions?: WebframezCoreRouteRegistrationOptions;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface WebframezCoreRouteFacadeExtensions {
|
|
20
|
+
renderReact(path: string, options: WebframezCoreReactRenderRouteOptions): void;
|
|
21
|
+
reactRender(path: string, options: WebframezCoreReactRenderRouteOptions): void;
|
|
22
|
+
}
|
|
10
23
|
|
|
11
24
|
declare module "@webtypen/webframez-core" {
|
|
12
|
-
interface RouteFacade {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
25
|
+
interface RouteFacade extends WebframezCoreRouteFacadeExtensions {}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
declare module "webframez-core" {
|
|
29
|
+
interface RouteFacade extends WebframezCoreRouteFacadeExtensions {}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare module "@webtypen/webframez-core/dist/Router/Route" {
|
|
33
|
+
interface RouteFacade extends WebframezCoreRouteFacadeExtensions {}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare module "webframez-core/dist/Router/Route" {
|
|
37
|
+
interface RouteFacade extends WebframezCoreRouteFacadeExtensions {}
|
|
16
38
|
}
|
|
17
39
|
|
|
18
|
-
export function initWebframezReact
|
|
40
|
+
export function initWebframezReact<T extends RouteFacade>(
|
|
41
|
+
route: T,
|
|
42
|
+
): T & WebframezCoreRouteFacadeExtensions;
|
|
19
43
|
export const setupWebframezCoreReactRoute: typeof initWebframezReact;
|
package/dist/webframez-core.js
CHANGED
|
@@ -198,6 +198,10 @@ function readSearchParams(urlSearchParams) {
|
|
|
198
198
|
function escapeHtml(value) {
|
|
199
199
|
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/\"/g, """).replace(/'/g, "'");
|
|
200
200
|
}
|
|
201
|
+
var MANAGED_HEAD_ATTR = "data-webframez-head";
|
|
202
|
+
function createManagedAttributes() {
|
|
203
|
+
return `${MANAGED_HEAD_ATTR}="true"`;
|
|
204
|
+
}
|
|
201
205
|
function toRouteEntry(pagesDir, filePath) {
|
|
202
206
|
const normalized = filePath.replace(/\\/g, "/");
|
|
203
207
|
if (!normalized.endsWith("/index.js")) {
|
|
@@ -266,19 +270,21 @@ function renderHeadToString(head) {
|
|
|
266
270
|
const tags = [];
|
|
267
271
|
if (head.description) {
|
|
268
272
|
tags.push(
|
|
269
|
-
`<meta name="description" content="${escapeHtml(head.description)}" />`
|
|
273
|
+
`<meta ${createManagedAttributes()} name="description" content="${escapeHtml(head.description)}" />`
|
|
270
274
|
);
|
|
271
275
|
}
|
|
272
276
|
if (head.favicon) {
|
|
273
|
-
tags.push(
|
|
277
|
+
tags.push(
|
|
278
|
+
`<link ${createManagedAttributes()} rel="icon" href="${escapeHtml(head.favicon)}" />`
|
|
279
|
+
);
|
|
274
280
|
}
|
|
275
281
|
for (const meta of head.meta ?? []) {
|
|
276
282
|
const attrs = Object.entries(meta).filter(([, value]) => Boolean(value)).map(([key, value]) => `${key}="${escapeHtml(String(value))}"`).join(" ");
|
|
277
|
-
tags.push(`<meta ${attrs} />`);
|
|
283
|
+
tags.push(`<meta ${createManagedAttributes()} ${attrs} />`);
|
|
278
284
|
}
|
|
279
285
|
for (const link of head.links ?? []) {
|
|
280
286
|
const attrs = Object.entries(link).filter(([, value]) => Boolean(value)).map(([key, value]) => `${key}="${escapeHtml(String(value))}"`).join(" ");
|
|
281
|
-
tags.push(`<link ${attrs} />`);
|
|
287
|
+
tags.push(`<link ${createManagedAttributes()} ${attrs} />`);
|
|
282
288
|
}
|
|
283
289
|
return tags.join("\n");
|
|
284
290
|
}
|
|
@@ -292,6 +298,12 @@ async function resolveHead(candidate, context) {
|
|
|
292
298
|
}
|
|
293
299
|
return candidate.Head(context);
|
|
294
300
|
}
|
|
301
|
+
async function resolvePageData(candidate, context) {
|
|
302
|
+
if (!candidate.Data) {
|
|
303
|
+
return void 0;
|
|
304
|
+
}
|
|
305
|
+
return candidate.Data(context);
|
|
306
|
+
}
|
|
295
307
|
function findBestMatch(entries, pathname) {
|
|
296
308
|
const matches = [];
|
|
297
309
|
for (const entry of entries) {
|
|
@@ -371,10 +383,11 @@ function createFileRouter(options) {
|
|
|
371
383
|
};
|
|
372
384
|
}
|
|
373
385
|
const errorModule = resolveModule(errorPath);
|
|
374
|
-
const errorNode = errorModule.default(errorProps);
|
|
386
|
+
const errorNode = await errorModule.default(errorProps);
|
|
375
387
|
const layoutHead = layoutModule ? await resolveHead(layoutModule, context) : void 0;
|
|
376
388
|
const errorHead = await resolveHead(errorModule, errorProps);
|
|
377
|
-
const
|
|
389
|
+
const layoutNode = layoutModule ? await layoutModule.default(context) : null;
|
|
390
|
+
const model = layoutNode ? injectRouteChildren(layoutNode, errorNode) : errorNode;
|
|
378
391
|
return {
|
|
379
392
|
statusCode,
|
|
380
393
|
model,
|
|
@@ -406,10 +419,17 @@ function createFileRouter(options) {
|
|
|
406
419
|
activeContext = context;
|
|
407
420
|
const pageModule = resolveModule(match.entry.filePath);
|
|
408
421
|
const layoutModule = fs.existsSync(layoutPath) ? resolveModule(layoutPath) : null;
|
|
409
|
-
const
|
|
410
|
-
const
|
|
411
|
-
|
|
412
|
-
|
|
422
|
+
const pageData = await resolvePageData(pageModule, context);
|
|
423
|
+
const pageContext = {
|
|
424
|
+
...context,
|
|
425
|
+
data: pageData
|
|
426
|
+
};
|
|
427
|
+
activeContext = pageContext;
|
|
428
|
+
const pageNode = await pageModule.default(pageContext);
|
|
429
|
+
const layoutHead = layoutModule ? await resolveHead(layoutModule, pageContext) : void 0;
|
|
430
|
+
const pageHead = await resolveHead(pageModule, pageContext);
|
|
431
|
+
const layoutNode = layoutModule ? await layoutModule.default(pageContext) : null;
|
|
432
|
+
const model = layoutNode ? injectRouteChildren(layoutNode, pageNode) : pageNode;
|
|
413
433
|
return {
|
|
414
434
|
statusCode: 200,
|
|
415
435
|
model,
|
|
@@ -454,14 +474,26 @@ function stripBasePath(pathname, basePath) {
|
|
|
454
474
|
}
|
|
455
475
|
function runNodeCommand(args) {
|
|
456
476
|
return new Promise((resolve, reject) => {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
477
|
+
const execArgs = [
|
|
478
|
+
"--conditions",
|
|
479
|
+
"react-server",
|
|
480
|
+
"-r",
|
|
481
|
+
"@webtypen/webframez-react/register",
|
|
482
|
+
...args
|
|
483
|
+
];
|
|
484
|
+
execFile(
|
|
485
|
+
process.execPath,
|
|
486
|
+
execArgs,
|
|
487
|
+
{ timeout: 1e4, maxBuffer: 1024 * 1024 * 5 },
|
|
488
|
+
(error, stdout, stderr) => {
|
|
489
|
+
if (error) {
|
|
490
|
+
const out = stderr && stderr.trim() !== "" ? stderr : stdout;
|
|
491
|
+
reject(new Error(out || error.message));
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
resolve({ stdout, stderr });
|
|
462
495
|
}
|
|
463
|
-
|
|
464
|
-
});
|
|
496
|
+
);
|
|
465
497
|
});
|
|
466
498
|
}
|
|
467
499
|
async function renderInitialHtmlInWorker(options) {
|
|
@@ -485,7 +517,7 @@ Module._resolveFilename = function(request, parent, isMain, options) {
|
|
|
485
517
|
}
|
|
486
518
|
return originalResolveFilename.call(this, request, parent, isMain, options);
|
|
487
519
|
};
|
|
488
|
-
const { createFileRouter } = require("webframez-react/router");
|
|
520
|
+
const { createFileRouter } = require("@webtypen/webframez-react/router");
|
|
489
521
|
const reactDomPkg = require.resolve("react-dom/package.json", {
|
|
490
522
|
paths: [process.cwd(), input.pagesDir]
|
|
491
523
|
});
|
|
@@ -624,7 +656,11 @@ function createNodeRequestHandler(options) {
|
|
|
624
656
|
cookies: requestCookies
|
|
625
657
|
})
|
|
626
658
|
);
|
|
627
|
-
|
|
659
|
+
const payload = {
|
|
660
|
+
model: resolved2.model,
|
|
661
|
+
head: resolved2.head
|
|
662
|
+
};
|
|
663
|
+
sendRSC(res, payload, {
|
|
628
664
|
moduleMap,
|
|
629
665
|
statusCode: resolved2.statusCode
|
|
630
666
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webtypen/webframez-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "TypeScript React RSC addition for @webtypen/webframez-core",
|
|
5
5
|
"homepage": "https://webtypen.de/",
|
|
6
6
|
"author": {
|
|
@@ -58,15 +58,18 @@
|
|
|
58
58
|
"import": "./dist/webframez-core.js",
|
|
59
59
|
"require": "./dist/webframez-core.cjs"
|
|
60
60
|
},
|
|
61
|
+
"./register": "./register.cjs",
|
|
61
62
|
"./defaults/webpack.client": "./defaults/webpack.client.cjs",
|
|
62
63
|
"./defaults/webpack.server": "./defaults/webpack.server.cjs",
|
|
63
64
|
"./defaults/tsconfig.server": "./defaults/tsconfig.server.json",
|
|
65
|
+
"./defaults/tsconfig.server.example": "./defaults/tsconfig.server.example.json",
|
|
64
66
|
"./cli": "./bin/webframez-react.mjs"
|
|
65
67
|
},
|
|
66
68
|
"files": [
|
|
67
69
|
"dist",
|
|
68
70
|
"defaults",
|
|
69
|
-
"bin"
|
|
71
|
+
"bin",
|
|
72
|
+
"register.cjs"
|
|
70
73
|
],
|
|
71
74
|
"scripts": {
|
|
72
75
|
"clean": "rm -rf dist",
|
package/register.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require("react-server-dom-webpack/node-register")();
|