elit 3.5.9 → 3.6.1
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/Cargo.lock +1 -1
- package/Cargo.toml +1 -1
- package/README.md +1 -1
- package/dist/build.cjs +11 -4
- package/dist/build.d.ts +1 -1
- package/dist/build.js +11 -4
- package/dist/build.mjs +11 -4
- package/dist/cli.cjs +170 -93
- package/dist/cli.mjs +170 -93
- package/dist/config.cjs +7 -2
- package/dist/config.d.ts +1 -1
- package/dist/config.js +7 -2
- package/dist/config.mjs +7 -2
- package/dist/coverage.d.ts +1 -1
- package/dist/desktop-auto-render.d.ts +1 -1
- package/dist/render-context.d.ts +1 -1
- package/dist/{server-FCdUqabc.d.ts → server-CcBFc2F5.d.ts} +1 -1
- package/dist/server.cjs +147 -84
- package/dist/server.d.ts +1 -1
- package/dist/server.js +147 -84
- package/dist/server.mjs +147 -84
- package/package.json +66 -35
package/dist/server.mjs
CHANGED
|
@@ -56688,35 +56688,42 @@ var sendError = (res, code, msg) => {
|
|
|
56688
56688
|
var send404 = (res, msg = "Not Found") => sendError(res, 404, msg);
|
|
56689
56689
|
var send403 = (res, msg = "Forbidden") => sendError(res, 403, msg);
|
|
56690
56690
|
var send500 = (res, msg = "Internal Server Error") => sendError(res, 500, msg);
|
|
56691
|
-
async function resolveWorkspaceElitImportBasePath(rootDir, basePath,
|
|
56691
|
+
async function resolveWorkspaceElitImportBasePath(rootDir, basePath, _mode) {
|
|
56692
56692
|
const resolvedRootDir = await realpath(resolve(rootDir));
|
|
56693
56693
|
try {
|
|
56694
56694
|
const packageJsonBuffer = await readFile(join(resolvedRootDir, "package.json"));
|
|
56695
56695
|
const packageJson = JSON.parse(packageJsonBuffer.toString());
|
|
56696
56696
|
if (packageJson.name === "elit") {
|
|
56697
|
-
|
|
56698
|
-
return basePath ? `${basePath}/${workspaceDir}` : `/${workspaceDir}`;
|
|
56697
|
+
return basePath ? `${basePath}/dist` : "/dist";
|
|
56699
56698
|
}
|
|
56700
56699
|
} catch {
|
|
56701
56700
|
}
|
|
56702
56701
|
return void 0;
|
|
56703
56702
|
}
|
|
56703
|
+
var BROWSER_SAFE_ELIT_IMPORTS = {
|
|
56704
|
+
"elit": "index",
|
|
56705
|
+
"elit/dom": "dom",
|
|
56706
|
+
"elit/el": "el",
|
|
56707
|
+
"elit/native": "native",
|
|
56708
|
+
"elit/universal": "universal",
|
|
56709
|
+
"elit/router": "router",
|
|
56710
|
+
"elit/state": "state",
|
|
56711
|
+
"elit/style": "style",
|
|
56712
|
+
"elit/hmr": "hmr",
|
|
56713
|
+
"elit/types": "types"
|
|
56714
|
+
};
|
|
56715
|
+
function createBrowserSafeElitImports(basePath, fileExt) {
|
|
56716
|
+
return Object.fromEntries(
|
|
56717
|
+
Object.entries(BROWSER_SAFE_ELIT_IMPORTS).map(([specifier, outputName]) => [
|
|
56718
|
+
specifier,
|
|
56719
|
+
`${basePath}/${outputName}${fileExt}`
|
|
56720
|
+
])
|
|
56721
|
+
);
|
|
56722
|
+
}
|
|
56704
56723
|
var createElitImportMap = async (rootDir, basePath = "", mode = "dev") => {
|
|
56705
56724
|
const workspaceImportBasePath = await resolveWorkspaceElitImportBasePath(rootDir, basePath, mode);
|
|
56706
|
-
const fileExt =
|
|
56707
|
-
const elitImports = workspaceImportBasePath ? {
|
|
56708
|
-
"elit": `${workspaceImportBasePath}/index${fileExt}`,
|
|
56709
|
-
"elit/": `${workspaceImportBasePath}/`,
|
|
56710
|
-
"elit/dom": `${workspaceImportBasePath}/dom${fileExt}`,
|
|
56711
|
-
"elit/state": `${workspaceImportBasePath}/state${fileExt}`,
|
|
56712
|
-
"elit/style": `${workspaceImportBasePath}/style${fileExt}`,
|
|
56713
|
-
"elit/el": `${workspaceImportBasePath}/el${fileExt}`,
|
|
56714
|
-
"elit/universal": `${workspaceImportBasePath}/universal${fileExt}`,
|
|
56715
|
-
"elit/router": `${workspaceImportBasePath}/router${fileExt}`,
|
|
56716
|
-
"elit/hmr": `${workspaceImportBasePath}/hmr${fileExt}`,
|
|
56717
|
-
"elit/types": `${workspaceImportBasePath}/types${fileExt}`,
|
|
56718
|
-
"elit/native": `${workspaceImportBasePath}/native${fileExt}`
|
|
56719
|
-
} : {};
|
|
56725
|
+
const fileExt = ".mjs";
|
|
56726
|
+
const elitImports = workspaceImportBasePath ? createBrowserSafeElitImports(workspaceImportBasePath, fileExt) : {};
|
|
56720
56727
|
const externalImports = await generateExternalImportMaps(rootDir, basePath);
|
|
56721
56728
|
const allImports = { ...externalImports, ...elitImports };
|
|
56722
56729
|
return `<script type="importmap">${JSON.stringify({ imports: allImports }, null, 2)}</script>`;
|
|
@@ -56987,6 +56994,29 @@ async function processPackage(nodeModulesPath, pkgName, importMap, basePath) {
|
|
|
56987
56994
|
}
|
|
56988
56995
|
}
|
|
56989
56996
|
function processExportsField(pkgName, exports2, baseUrl, importMap) {
|
|
56997
|
+
if (pkgName === "elit") {
|
|
56998
|
+
if (typeof exports2 !== "object" || exports2 === null) {
|
|
56999
|
+
return;
|
|
57000
|
+
}
|
|
57001
|
+
const elitExports = exports2;
|
|
57002
|
+
const browserSafeImports = {};
|
|
57003
|
+
const rootResolved = "." in elitExports ? resolveExport(elitExports["."]) : "import" in elitExports ? resolveExport(elitExports) : null;
|
|
57004
|
+
if (rootResolved) {
|
|
57005
|
+
browserSafeImports.elit = `${baseUrl}/${rootResolved}`;
|
|
57006
|
+
}
|
|
57007
|
+
const allowedSubpaths = Object.keys(BROWSER_SAFE_ELIT_IMPORTS).filter((specifier) => specifier !== "elit").map((specifier) => ({
|
|
57008
|
+
exportKey: `./${specifier.slice("elit/".length)}`,
|
|
57009
|
+
importName: specifier
|
|
57010
|
+
}));
|
|
57011
|
+
for (const { exportKey, importName } of allowedSubpaths) {
|
|
57012
|
+
const resolved = resolveExport(elitExports[exportKey]);
|
|
57013
|
+
if (resolved) {
|
|
57014
|
+
browserSafeImports[importName] = `${baseUrl}/${resolved}`;
|
|
57015
|
+
}
|
|
57016
|
+
}
|
|
57017
|
+
Object.assign(importMap, browserSafeImports);
|
|
57018
|
+
return;
|
|
57019
|
+
}
|
|
56990
57020
|
if (typeof exports2 === "string") {
|
|
56991
57021
|
importMap[pkgName] = `${baseUrl}/${exports2}`;
|
|
56992
57022
|
importMap[`${pkgName}/`] = `${baseUrl}/`;
|
|
@@ -57348,6 +57378,85 @@ function shouldUseClientFallbackRoot(primaryRoot, fallbackRoot, indexPath) {
|
|
|
57348
57378
|
const primaryHasRuntimeSources = existsSync(join(resolvedPrimaryRoot, "src")) || existsSync(join(resolvedPrimaryRoot, "public")) || existsSync(join(resolvedPrimaryRoot, normalizedIndexPath));
|
|
57349
57379
|
return !primaryHasRuntimeSources;
|
|
57350
57380
|
}
|
|
57381
|
+
function isPathWithinRoot(filePath, rootDir) {
|
|
57382
|
+
return filePath === rootDir || filePath.startsWith(rootDir.endsWith(sep) ? rootDir : `${rootDir}${sep}`);
|
|
57383
|
+
}
|
|
57384
|
+
async function getAllowedClientRoots(client) {
|
|
57385
|
+
const allowedRoots = [];
|
|
57386
|
+
for (const candidateRoot of [client.root, client.fallbackRoot]) {
|
|
57387
|
+
if (!candidateRoot) {
|
|
57388
|
+
continue;
|
|
57389
|
+
}
|
|
57390
|
+
try {
|
|
57391
|
+
const resolvedRoot = await realpath(resolve(candidateRoot));
|
|
57392
|
+
if (!allowedRoots.includes(resolvedRoot)) {
|
|
57393
|
+
allowedRoots.push(resolvedRoot);
|
|
57394
|
+
}
|
|
57395
|
+
} catch {
|
|
57396
|
+
}
|
|
57397
|
+
}
|
|
57398
|
+
return allowedRoots;
|
|
57399
|
+
}
|
|
57400
|
+
async function getClientBaseDirs(client, isDistRequest, isNodeModulesRequest) {
|
|
57401
|
+
const baseDirs = [];
|
|
57402
|
+
for (const candidateRoot of [client.root, client.fallbackRoot]) {
|
|
57403
|
+
if (!candidateRoot) {
|
|
57404
|
+
continue;
|
|
57405
|
+
}
|
|
57406
|
+
try {
|
|
57407
|
+
const resolvedRoot = await realpath(resolve(candidateRoot));
|
|
57408
|
+
let baseDir = resolvedRoot;
|
|
57409
|
+
if (isDistRequest || isNodeModulesRequest) {
|
|
57410
|
+
const targetDir = isDistRequest ? "dist" : "node_modules";
|
|
57411
|
+
const foundDir = await findSpecialDir(candidateRoot, targetDir);
|
|
57412
|
+
baseDir = foundDir ? await realpath(foundDir) : resolvedRoot;
|
|
57413
|
+
}
|
|
57414
|
+
if (!baseDirs.includes(baseDir)) {
|
|
57415
|
+
baseDirs.push(baseDir);
|
|
57416
|
+
}
|
|
57417
|
+
} catch {
|
|
57418
|
+
}
|
|
57419
|
+
}
|
|
57420
|
+
return baseDirs;
|
|
57421
|
+
}
|
|
57422
|
+
async function resolveClientPathFromBaseDir(baseDir, normalizedPath) {
|
|
57423
|
+
const tryRealpathWithinBaseDir = async (relativePath2) => {
|
|
57424
|
+
const unresolvedPath = resolve(join(baseDir, relativePath2));
|
|
57425
|
+
if (!isPathWithinRoot(unresolvedPath, baseDir)) {
|
|
57426
|
+
return void 0;
|
|
57427
|
+
}
|
|
57428
|
+
try {
|
|
57429
|
+
return await realpath(unresolvedPath);
|
|
57430
|
+
} catch {
|
|
57431
|
+
return void 0;
|
|
57432
|
+
}
|
|
57433
|
+
};
|
|
57434
|
+
const exactPath = await tryRealpathWithinBaseDir(normalizedPath);
|
|
57435
|
+
if (exactPath) {
|
|
57436
|
+
return exactPath;
|
|
57437
|
+
}
|
|
57438
|
+
if (normalizedPath.endsWith(".js")) {
|
|
57439
|
+
const tsPath = await tryRealpathWithinBaseDir(normalizedPath.replace(/\.js$/, ".ts"));
|
|
57440
|
+
if (tsPath) {
|
|
57441
|
+
return tsPath;
|
|
57442
|
+
}
|
|
57443
|
+
}
|
|
57444
|
+
if (normalizedPath.includes(".")) {
|
|
57445
|
+
return void 0;
|
|
57446
|
+
}
|
|
57447
|
+
for (const candidatePath of [
|
|
57448
|
+
`${normalizedPath}.ts`,
|
|
57449
|
+
`${normalizedPath}.js`,
|
|
57450
|
+
join(normalizedPath, "index.ts"),
|
|
57451
|
+
join(normalizedPath, "index.js")
|
|
57452
|
+
]) {
|
|
57453
|
+
const resolvedPath = await tryRealpathWithinBaseDir(candidatePath);
|
|
57454
|
+
if (resolvedPath) {
|
|
57455
|
+
return resolvedPath;
|
|
57456
|
+
}
|
|
57457
|
+
}
|
|
57458
|
+
return void 0;
|
|
57459
|
+
}
|
|
57351
57460
|
function createDevServer(options) {
|
|
57352
57461
|
const config = { ...defaultOptions, ...options };
|
|
57353
57462
|
const wsClients = /* @__PURE__ */ new Set();
|
|
@@ -57377,6 +57486,7 @@ function createDevServer(options) {
|
|
|
57377
57486
|
const activeRoot = useFallbackRoot ? client.fallbackRoot || client.root : client.root;
|
|
57378
57487
|
return {
|
|
57379
57488
|
root: activeRoot,
|
|
57489
|
+
fallbackRoot: useFallbackRoot ? void 0 : client.fallbackRoot,
|
|
57380
57490
|
basePath,
|
|
57381
57491
|
index: useFallbackRoot ? void 0 : indexPath,
|
|
57382
57492
|
ssr: useFallbackRoot ? void 0 : client.ssr,
|
|
@@ -57478,75 +57588,26 @@ function createDevServer(options) {
|
|
|
57478
57588
|
return send403(res, "403 Forbidden");
|
|
57479
57589
|
}
|
|
57480
57590
|
normalizedPath = tempPath;
|
|
57481
|
-
const rootDir = await realpath(resolve(matchedClient.root));
|
|
57482
|
-
let baseDir = rootDir;
|
|
57483
|
-
if (isDistRequest || isNodeModulesRequest) {
|
|
57484
|
-
const targetDir = isDistRequest ? "dist" : "node_modules";
|
|
57485
|
-
const foundDir = await findSpecialDir(matchedClient.root, targetDir);
|
|
57486
|
-
baseDir = foundDir ? await realpath(foundDir) : rootDir;
|
|
57487
|
-
}
|
|
57488
57591
|
let fullPath;
|
|
57489
|
-
|
|
57490
|
-
|
|
57491
|
-
|
|
57492
|
-
|
|
57493
|
-
|
|
57494
|
-
|
|
57495
|
-
fullPath = await realpath(unresolvedPath);
|
|
57496
|
-
if (config.logging && filePath === "/src/pages") {
|
|
57497
|
-
console.log(`[DEBUG] Initial resolve succeeded: ${fullPath}`);
|
|
57498
|
-
}
|
|
57499
|
-
} catch (firstError) {
|
|
57500
|
-
let resolvedPath;
|
|
57501
|
-
if (config.logging && !normalizedPath.includes(".")) {
|
|
57502
|
-
console.log(`[DEBUG] File not found: ${normalizedPath}, trying extensions...`);
|
|
57503
|
-
}
|
|
57504
|
-
if (normalizedPath.endsWith(".js")) {
|
|
57505
|
-
const tsPath = normalizedPath.replace(/\.js$/, ".ts");
|
|
57506
|
-
try {
|
|
57507
|
-
const tsFullPath = await realpath(resolve(join(baseDir, tsPath)));
|
|
57508
|
-
if (!tsFullPath.startsWith(baseDir.endsWith(sep) ? baseDir : baseDir + sep)) {
|
|
57509
|
-
if (config.logging) console.log(`[403] Fallback TS path outside of root: ${tsFullPath}`);
|
|
57510
|
-
return send403(res, "403 Forbidden");
|
|
57511
|
-
}
|
|
57512
|
-
resolvedPath = tsFullPath;
|
|
57513
|
-
} catch {
|
|
57592
|
+
const baseDirs = await getClientBaseDirs(matchedClient, isDistRequest, isNodeModulesRequest);
|
|
57593
|
+
for (const baseDir of baseDirs) {
|
|
57594
|
+
fullPath = await resolveClientPathFromBaseDir(baseDir, normalizedPath);
|
|
57595
|
+
if (fullPath) {
|
|
57596
|
+
if (config.logging && filePath === "/src/pages") {
|
|
57597
|
+
console.log(`[DEBUG] Initial resolve succeeded: ${fullPath}`);
|
|
57514
57598
|
}
|
|
57599
|
+
break;
|
|
57515
57600
|
}
|
|
57516
|
-
|
|
57517
|
-
|
|
57518
|
-
|
|
57519
|
-
|
|
57520
|
-
|
|
57521
|
-
try {
|
|
57522
|
-
resolvedPath = await realpath(resolve(join(baseDir, normalizedPath + ".js")));
|
|
57523
|
-
if (config.logging) console.log(`[DEBUG] Found: ${normalizedPath}.js`);
|
|
57524
|
-
} catch {
|
|
57525
|
-
try {
|
|
57526
|
-
resolvedPath = await realpath(resolve(join(baseDir, normalizedPath, "index.ts")));
|
|
57527
|
-
if (config.logging) console.log(`[DEBUG] Found: ${normalizedPath}/index.ts`);
|
|
57528
|
-
} catch {
|
|
57529
|
-
try {
|
|
57530
|
-
resolvedPath = await realpath(resolve(join(baseDir, normalizedPath, "index.js")));
|
|
57531
|
-
if (config.logging) console.log(`[DEBUG] Found: ${normalizedPath}/index.js`);
|
|
57532
|
-
} catch {
|
|
57533
|
-
if (config.logging) console.log(`[DEBUG] Not found: all attempts failed for ${normalizedPath}`);
|
|
57534
|
-
}
|
|
57535
|
-
}
|
|
57536
|
-
}
|
|
57537
|
-
}
|
|
57538
|
-
}
|
|
57539
|
-
if (!resolvedPath) {
|
|
57540
|
-
if (!res.headersSent) {
|
|
57541
|
-
if (filePath === "/index.html" && matchedClient.ssr) {
|
|
57542
|
-
return await serveSSR(res, matchedClient);
|
|
57543
|
-
}
|
|
57544
|
-
if (config.logging) console.log(`[404] ${filePath}`);
|
|
57545
|
-
return send404(res, "404 Not Found");
|
|
57601
|
+
}
|
|
57602
|
+
if (!fullPath) {
|
|
57603
|
+
if (!res.headersSent) {
|
|
57604
|
+
if (filePath === "/index.html" && matchedClient.ssr) {
|
|
57605
|
+
return await serveSSR(res, matchedClient);
|
|
57546
57606
|
}
|
|
57547
|
-
|
|
57607
|
+
if (config.logging) console.log(`[404] ${filePath}`);
|
|
57608
|
+
return send404(res, "404 Not Found");
|
|
57548
57609
|
}
|
|
57549
|
-
|
|
57610
|
+
return;
|
|
57550
57611
|
}
|
|
57551
57612
|
try {
|
|
57552
57613
|
const stats = await stat(fullPath);
|
|
@@ -57575,11 +57636,12 @@ function createDevServer(options) {
|
|
|
57575
57636
|
return send404(res, "404 Not Found");
|
|
57576
57637
|
}
|
|
57577
57638
|
try {
|
|
57639
|
+
const allowedRoots = await getAllowedClientRoots(matchedClient);
|
|
57578
57640
|
const stats = await stat(fullPath);
|
|
57579
57641
|
if (stats.isDirectory()) {
|
|
57580
57642
|
try {
|
|
57581
57643
|
const indexPath = await realpath(resolve(join(fullPath, "index.html")));
|
|
57582
|
-
if (!indexPath.
|
|
57644
|
+
if (!isPathWithinRoot(indexPath, fullPath) && !allowedRoots.some((rootDir) => isPathWithinRoot(indexPath, rootDir))) {
|
|
57583
57645
|
return send403(res, "403 Forbidden");
|
|
57584
57646
|
}
|
|
57585
57647
|
await stat(indexPath);
|
|
@@ -57601,10 +57663,11 @@ function createDevServer(options) {
|
|
|
57601
57663
|
return input.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
|
|
57602
57664
|
}
|
|
57603
57665
|
try {
|
|
57604
|
-
const
|
|
57666
|
+
const allowedRoots = await getAllowedClientRoots(client);
|
|
57667
|
+
const rootDir = allowedRoots[0] || await realpath(resolve(client.root));
|
|
57605
57668
|
const unresolvedPath = resolve(filePath);
|
|
57606
57669
|
if (!isNodeModulesOrDist) {
|
|
57607
|
-
if (!
|
|
57670
|
+
if (!allowedRoots.some((allowedRoot) => isPathWithinRoot(unresolvedPath, allowedRoot))) {
|
|
57608
57671
|
if (config.logging) console.log(`[403] Attempted to serve file outside allowed directories: ${filePath}`);
|
|
57609
57672
|
return send403(res, "403 Forbidden");
|
|
57610
57673
|
}
|
package/package.json
CHANGED
|
@@ -1,173 +1,204 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "elit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.1",
|
|
4
4
|
"description": "Optimized lightweight library for creating DOM elements with reactive state",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
|
-
"browser": "dist/index.
|
|
7
|
+
"browser": "dist/index.js",
|
|
8
|
+
"require": "dist/index.cjs",
|
|
8
9
|
"types": "dist/index.d.ts",
|
|
9
10
|
"bin": {
|
|
10
|
-
"elit": "./dist/cli.
|
|
11
|
+
"elit": "./dist/cli.cjs"
|
|
11
12
|
},
|
|
12
13
|
"exports": {
|
|
13
14
|
".": {
|
|
14
15
|
"types": "./dist/index.d.ts",
|
|
15
|
-
"browser": "./dist/index.
|
|
16
|
+
"browser": "./dist/index.js",
|
|
16
17
|
"import": "./dist/index.mjs",
|
|
17
|
-
"require": "./dist/index.
|
|
18
|
+
"require": "./dist/index.cjs"
|
|
18
19
|
},
|
|
19
20
|
"./dom": {
|
|
20
21
|
"types": "./dist/dom.d.ts",
|
|
22
|
+
"browser": "./dist/dom.js",
|
|
21
23
|
"import": "./dist/dom.mjs",
|
|
22
|
-
"require": "./dist/dom.
|
|
24
|
+
"require": "./dist/dom.cjs"
|
|
23
25
|
},
|
|
24
26
|
"./desktop": {
|
|
25
27
|
"types": "./dist/desktop.d.ts",
|
|
28
|
+
"browser": "./dist/desktop.js",
|
|
26
29
|
"import": "./dist/desktop.mjs",
|
|
27
|
-
"require": "./dist/desktop.
|
|
30
|
+
"require": "./dist/desktop.cjs"
|
|
28
31
|
},
|
|
29
32
|
"./el": {
|
|
30
33
|
"types": "./dist/el.d.ts",
|
|
34
|
+
"browser": "./dist/el.js",
|
|
31
35
|
"import": "./dist/el.mjs",
|
|
32
|
-
"require": "./dist/el.
|
|
36
|
+
"require": "./dist/el.cjs"
|
|
33
37
|
},
|
|
34
38
|
"./native": {
|
|
35
39
|
"types": "./dist/native.d.ts",
|
|
40
|
+
"browser": "./dist/native.js",
|
|
36
41
|
"import": "./dist/native.mjs",
|
|
37
|
-
"require": "./dist/native.
|
|
42
|
+
"require": "./dist/native.cjs"
|
|
38
43
|
},
|
|
39
44
|
"./universal": {
|
|
40
45
|
"types": "./dist/universal.d.ts",
|
|
46
|
+
"browser": "./dist/universal.js",
|
|
41
47
|
"import": "./dist/universal.mjs",
|
|
42
|
-
"require": "./dist/universal.
|
|
48
|
+
"require": "./dist/universal.cjs"
|
|
43
49
|
},
|
|
44
50
|
"./router": {
|
|
45
51
|
"types": "./dist/router.d.ts",
|
|
52
|
+
"browser": "./dist/router.js",
|
|
46
53
|
"import": "./dist/router.mjs",
|
|
47
|
-
"require": "./dist/router.
|
|
54
|
+
"require": "./dist/router.cjs"
|
|
48
55
|
},
|
|
49
56
|
"./state": {
|
|
50
57
|
"types": "./dist/state.d.ts",
|
|
58
|
+
"browser": "./dist/state.js",
|
|
51
59
|
"import": "./dist/state.mjs",
|
|
52
|
-
"require": "./dist/state.
|
|
60
|
+
"require": "./dist/state.cjs"
|
|
53
61
|
},
|
|
54
62
|
"./style": {
|
|
55
63
|
"types": "./dist/style.d.ts",
|
|
64
|
+
"browser": "./dist/style.js",
|
|
56
65
|
"import": "./dist/style.mjs",
|
|
57
|
-
"require": "./dist/style.
|
|
66
|
+
"require": "./dist/style.cjs"
|
|
58
67
|
},
|
|
59
68
|
"./server": {
|
|
60
69
|
"types": "./dist/server.d.ts",
|
|
70
|
+
"browser": "./dist/server.js",
|
|
61
71
|
"import": "./dist/server.mjs",
|
|
62
|
-
"require": "./dist/server.
|
|
72
|
+
"require": "./dist/server.cjs"
|
|
63
73
|
},
|
|
64
74
|
"./hmr": {
|
|
65
75
|
"types": "./dist/hmr.d.ts",
|
|
76
|
+
"browser": "./dist/hmr.js",
|
|
66
77
|
"import": "./dist/hmr.mjs",
|
|
67
|
-
"require": "./dist/hmr.
|
|
78
|
+
"require": "./dist/hmr.cjs"
|
|
68
79
|
},
|
|
69
80
|
"./build": {
|
|
70
81
|
"types": "./dist/build.d.ts",
|
|
82
|
+
"browser": "./dist/build.js",
|
|
71
83
|
"import": "./dist/build.mjs",
|
|
72
|
-
"require": "./dist/build.
|
|
84
|
+
"require": "./dist/build.cjs"
|
|
73
85
|
},
|
|
74
86
|
"./http": {
|
|
75
87
|
"types": "./dist/http.d.ts",
|
|
88
|
+
"browser": "./dist/http.js",
|
|
76
89
|
"import": "./dist/http.mjs",
|
|
77
|
-
"require": "./dist/http.
|
|
90
|
+
"require": "./dist/http.cjs"
|
|
78
91
|
},
|
|
79
92
|
"./https": {
|
|
80
93
|
"types": "./dist/https.d.ts",
|
|
94
|
+
"browser": "./dist/https.js",
|
|
81
95
|
"import": "./dist/https.mjs",
|
|
82
|
-
"require": "./dist/https.
|
|
96
|
+
"require": "./dist/https.cjs"
|
|
83
97
|
},
|
|
84
98
|
"./ws": {
|
|
85
99
|
"types": "./dist/ws.d.ts",
|
|
100
|
+
"browser": "./dist/ws.js",
|
|
86
101
|
"import": "./dist/ws.mjs",
|
|
87
|
-
"require": "./dist/ws.
|
|
102
|
+
"require": "./dist/ws.cjs"
|
|
88
103
|
},
|
|
89
104
|
"./fs": {
|
|
90
105
|
"types": "./dist/fs.d.ts",
|
|
106
|
+
"browser": "./dist/fs.js",
|
|
91
107
|
"import": "./dist/fs.mjs",
|
|
92
|
-
"require": "./dist/fs.
|
|
108
|
+
"require": "./dist/fs.cjs"
|
|
93
109
|
},
|
|
94
110
|
"./mime-types": {
|
|
95
111
|
"types": "./dist/mime-types.d.ts",
|
|
112
|
+
"browser": "./dist/mime-types.js",
|
|
96
113
|
"import": "./dist/mime-types.mjs",
|
|
97
|
-
"require": "./dist/mime-types.
|
|
114
|
+
"require": "./dist/mime-types.cjs"
|
|
98
115
|
},
|
|
99
116
|
"./chokidar": {
|
|
100
117
|
"types": "./dist/chokidar.d.ts",
|
|
118
|
+
"browser": "./dist/chokidar.js",
|
|
101
119
|
"import": "./dist/chokidar.mjs",
|
|
102
|
-
"require": "./dist/chokidar.
|
|
120
|
+
"require": "./dist/chokidar.cjs"
|
|
103
121
|
},
|
|
104
122
|
"./path": {
|
|
105
123
|
"types": "./dist/path.d.ts",
|
|
124
|
+
"browser": "./dist/path.js",
|
|
106
125
|
"import": "./dist/path.mjs",
|
|
107
|
-
"require": "./dist/path.
|
|
126
|
+
"require": "./dist/path.cjs"
|
|
108
127
|
},
|
|
109
128
|
"./wss": {
|
|
110
129
|
"types": "./dist/wss.d.ts",
|
|
130
|
+
"browser": "./dist/wss.js",
|
|
111
131
|
"import": "./dist/wss.mjs",
|
|
112
|
-
"require": "./dist/wss.
|
|
132
|
+
"require": "./dist/wss.cjs"
|
|
113
133
|
},
|
|
114
134
|
"./runtime": {
|
|
115
135
|
"types": "./dist/runtime.d.ts",
|
|
136
|
+
"browser": "./dist/runtime.js",
|
|
116
137
|
"import": "./dist/runtime.mjs",
|
|
117
|
-
"require": "./dist/runtime.
|
|
138
|
+
"require": "./dist/runtime.cjs"
|
|
118
139
|
},
|
|
119
140
|
"./database": {
|
|
120
141
|
"types": "./dist/database.d.ts",
|
|
142
|
+
"browser": "./dist/database.js",
|
|
121
143
|
"import": "./dist/database.mjs",
|
|
122
|
-
"require": "./dist/database.
|
|
144
|
+
"require": "./dist/database.cjs"
|
|
123
145
|
},
|
|
124
146
|
"./test": {
|
|
125
147
|
"types": "./dist/test.d.ts",
|
|
148
|
+
"browser": "./dist/test.js",
|
|
126
149
|
"import": "./dist/test.mjs",
|
|
127
|
-
"require": "./dist/test.
|
|
150
|
+
"require": "./dist/test.cjs"
|
|
128
151
|
},
|
|
129
152
|
"./test-runtime": {
|
|
130
153
|
"types": "./dist/test-runtime.d.ts",
|
|
154
|
+
"browser": "./dist/test-runtime.js",
|
|
131
155
|
"import": "./dist/test-runtime.mjs",
|
|
132
|
-
"require": "./dist/test-runtime.
|
|
156
|
+
"require": "./dist/test-runtime.cjs"
|
|
133
157
|
},
|
|
134
158
|
"./test-reporter": {
|
|
135
159
|
"types": "./dist/test-reporter.d.ts",
|
|
160
|
+
"browser": "./dist/test-reporter.js",
|
|
136
161
|
"import": "./dist/test-reporter.mjs",
|
|
137
|
-
"require": "./dist/test-reporter.
|
|
162
|
+
"require": "./dist/test-reporter.cjs"
|
|
138
163
|
},
|
|
139
164
|
"./test-globals": {
|
|
140
165
|
"types": "./dist/test-globals.d.ts"
|
|
141
166
|
},
|
|
142
167
|
"./types": {
|
|
143
168
|
"types": "./dist/types.d.ts",
|
|
169
|
+
"browser": "./dist/types.js",
|
|
144
170
|
"import": "./dist/types.mjs",
|
|
145
|
-
"require": "./dist/types.
|
|
171
|
+
"require": "./dist/types.cjs"
|
|
146
172
|
},
|
|
147
173
|
"./cli": {
|
|
148
174
|
"types": "./dist/cli.d.ts",
|
|
175
|
+
"browser": "./dist/cli.js",
|
|
149
176
|
"import": "./dist/cli.mjs",
|
|
150
|
-
"require": "./dist/cli.
|
|
177
|
+
"require": "./dist/cli.cjs"
|
|
151
178
|
},
|
|
152
179
|
"./render-context": {
|
|
153
180
|
"types": "./dist/render-context.d.ts",
|
|
181
|
+
"browser": "./dist/render-context.js",
|
|
154
182
|
"import": "./dist/render-context.mjs",
|
|
155
|
-
"require": "./dist/render-context.
|
|
183
|
+
"require": "./dist/render-context.cjs"
|
|
156
184
|
},
|
|
157
185
|
"./preview-build": {
|
|
158
186
|
"types": "./dist/preview-build.d.ts",
|
|
187
|
+
"browser": "./dist/preview-build.js",
|
|
159
188
|
"import": "./dist/preview-build.mjs",
|
|
160
|
-
"require": "./dist/preview-build.
|
|
189
|
+
"require": "./dist/preview-build.cjs"
|
|
161
190
|
},
|
|
162
191
|
"./dev-build": {
|
|
163
192
|
"types": "./dist/dev-build.d.ts",
|
|
193
|
+
"browser": "./dist/dev-build.js",
|
|
164
194
|
"import": "./dist/dev-build.mjs",
|
|
165
|
-
"require": "./dist/dev-build.
|
|
195
|
+
"require": "./dist/dev-build.cjs"
|
|
166
196
|
},
|
|
167
197
|
"./desktop-auto-render": {
|
|
168
198
|
"types": "./dist/desktop-auto-render.d.ts",
|
|
199
|
+
"browser": "./dist/desktop-auto-render.js",
|
|
169
200
|
"import": "./dist/desktop-auto-render.mjs",
|
|
170
|
-
"require": "./dist/desktop-auto-render.
|
|
201
|
+
"require": "./dist/desktop-auto-render.cjs"
|
|
171
202
|
}
|
|
172
203
|
},
|
|
173
204
|
"scripts": {
|