mokup 2.1.1 → 2.2.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/dist/bundle.cjs +9 -0
- package/dist/bundle.d.cts +24 -0
- package/dist/bundle.d.mts +24 -0
- package/dist/bundle.d.ts +24 -0
- package/dist/bundle.mjs +3 -0
- package/dist/index.d.cts +3 -2
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/shared/mokup.C7-7PDF7.cjs +252 -0
- package/dist/shared/{mokup.ghra3mzH.mjs → mokup.CtSctWaa.mjs} +31 -263
- package/dist/shared/{mokup.To7knvSq.cjs → mokup.DLUSS6KF.cjs} +58 -285
- package/dist/shared/{mokup.CWQ8woZc.d.cts → mokup.DeotZ0g8.d.cts} +69 -2
- package/dist/shared/{mokup.CWQ8woZc.d.mts → mokup.DeotZ0g8.d.mts} +69 -2
- package/dist/shared/{mokup.CWQ8woZc.d.ts → mokup.DeotZ0g8.d.ts} +69 -2
- package/dist/shared/mokup.JBCzv4xR.mjs +237 -0
- package/dist/shared/mokup.vAap-D_L.mjs +45 -0
- package/dist/shared/mokup.zkaN1ADs.cjs +47 -0
- package/dist/types/virtual.d.ts +2 -2
- package/dist/vite.cjs +223 -54
- package/dist/vite.d.cts +3 -2
- package/dist/vite.d.mts +3 -2
- package/dist/vite.d.ts +3 -2
- package/dist/vite.mjs +215 -46
- package/dist/webpack.cjs +11 -10
- package/dist/webpack.d.cts +3 -2
- package/dist/webpack.d.mts +3 -2
- package/dist/webpack.d.ts +3 -2
- package/dist/webpack.mjs +4 -3
- package/package.json +11 -6
package/dist/vite.mjs
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { cwd } from 'node:process';
|
|
2
|
-
import {
|
|
2
|
+
import { b as buildBundleModule } from './shared/mokup.vAap-D_L.mjs';
|
|
3
|
+
import { promises, existsSync } from 'node:fs';
|
|
4
|
+
import { join, normalize } from '@mokup/shared/pathe';
|
|
5
|
+
import { h as resolvePlaygroundDist, n as normalizePlaygroundPath, i as injectPlaygroundSw, j as resolveGroupRoot, k as resolveGroups, l as resolvePlaygroundRequestPath, t as toPlaygroundConfigFile, m as toPlaygroundIgnoredRoute, o as toPlaygroundDisabledRoute, p as toPlaygroundRoute, s as scanRoutes, a as sortRoutes, c as createHonoApp, b as buildSwScript, g as createMiddleware, r as resolvePlaygroundOptions, d as resolveSwConfig, e as resolveSwUnregisterConfig, f as createPlaygroundMiddleware } from './shared/mokup.CtSctWaa.mjs';
|
|
3
6
|
import { createLogger } from '@mokup/shared/logger';
|
|
7
|
+
import { r as resolveDirs, i as isInDirs, c as createDebouncer } from './shared/mokup.JBCzv4xR.mjs';
|
|
4
8
|
import pc from 'picocolors';
|
|
5
|
-
import { isAbsolute, resolve } from 'node:path';
|
|
9
|
+
import { isAbsolute, resolve, dirname } from 'node:path';
|
|
6
10
|
import chokidar from '@mokup/shared/chokidar';
|
|
7
|
-
import { existsSync } from 'node:fs';
|
|
8
11
|
import { fileURLToPath } from 'node:url';
|
|
9
|
-
import '@mokup/shared/pathe';
|
|
10
12
|
import 'node:module';
|
|
11
13
|
import 'node:buffer';
|
|
12
14
|
import '@mokup/shared/hono';
|
|
@@ -14,46 +16,77 @@ import '@mokup/shared/esbuild';
|
|
|
14
16
|
import '@mokup/shared/jsonc-parser';
|
|
15
17
|
import '@mokup/runtime';
|
|
16
18
|
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
let moduleIndex = 0;
|
|
26
|
-
for (const entry of modules) {
|
|
27
|
-
const name = `module${moduleIndex++}`;
|
|
28
|
-
imports.push(`import * as ${name} from '${entry.id}'`);
|
|
29
|
-
moduleEntries.push({ id: entry.id, name });
|
|
30
|
-
}
|
|
31
|
-
const lines = [];
|
|
32
|
-
if (imports.length > 0) {
|
|
33
|
-
lines.push(...imports, "");
|
|
34
|
-
}
|
|
35
|
-
lines.push(
|
|
36
|
-
`const manifest = ${JSON.stringify(manifest, null, 2)}`,
|
|
19
|
+
function resolvePlaygroundOutDir(outDir, playgroundPath) {
|
|
20
|
+
const normalized = normalizePlaygroundPath(playgroundPath);
|
|
21
|
+
const trimmed = normalized.replace(/^\/+/, "");
|
|
22
|
+
return trimmed ? join(outDir, normalize(trimmed)) : outDir;
|
|
23
|
+
}
|
|
24
|
+
function stripSwLifecycle(html) {
|
|
25
|
+
return html.replace(
|
|
26
|
+
/<script[^>]*mokup-sw-lifecycle\.js[^>]*><\/script>\s*/gi,
|
|
37
27
|
""
|
|
38
28
|
);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
29
|
+
}
|
|
30
|
+
async function writeRoutesPayload(params, targetDir) {
|
|
31
|
+
const baseRoot = resolveGroupRoot(params.dirs, params.root);
|
|
32
|
+
const groups = resolveGroups(params.dirs, baseRoot);
|
|
33
|
+
const basePath = resolvePlaygroundRequestPath(params.base, params.playgroundPath);
|
|
34
|
+
const payload = {
|
|
35
|
+
basePath,
|
|
36
|
+
root: baseRoot,
|
|
37
|
+
count: params.routes.length,
|
|
38
|
+
groups: groups.map((group) => ({ key: group.key, label: group.label })),
|
|
39
|
+
routes: params.routes.map((route) => toPlaygroundRoute(route, baseRoot, groups)),
|
|
40
|
+
disabled: params.disabledRoutes.map(
|
|
41
|
+
(route) => toPlaygroundDisabledRoute(route, baseRoot, groups)
|
|
42
|
+
),
|
|
43
|
+
ignored: params.ignoredRoutes.map(
|
|
44
|
+
(route) => toPlaygroundIgnoredRoute(route, baseRoot, groups)
|
|
45
|
+
),
|
|
46
|
+
configs: params.configFiles.map((entry) => toPlaygroundConfigFile(entry, baseRoot, groups)),
|
|
47
|
+
disabledConfigs: params.disabledConfigFiles.map(
|
|
48
|
+
(entry) => toPlaygroundConfigFile(entry, baseRoot, groups)
|
|
49
|
+
)
|
|
50
|
+
};
|
|
51
|
+
await promises.writeFile(
|
|
52
|
+
join(targetDir, "routes"),
|
|
53
|
+
JSON.stringify(payload, null, 2),
|
|
54
|
+
"utf8"
|
|
55
55
|
);
|
|
56
|
-
|
|
56
|
+
}
|
|
57
|
+
async function updateIndexHtml(targetDir, swScript) {
|
|
58
|
+
const indexPath = join(targetDir, "index.html");
|
|
59
|
+
const html = await promises.readFile(indexPath, "utf8");
|
|
60
|
+
const cleaned = stripSwLifecycle(html);
|
|
61
|
+
const output = swScript ? injectPlaygroundSw(cleaned, swScript) : cleaned;
|
|
62
|
+
await promises.writeFile(indexPath, output, "utf8");
|
|
63
|
+
}
|
|
64
|
+
async function removeLegacySwAsset(targetDir) {
|
|
65
|
+
const legacyFiles = [
|
|
66
|
+
join(targetDir, "assets", "mokup-sw-lifecycle.js"),
|
|
67
|
+
join(targetDir, "assets", "mokup-sw-lifecycle.js.map")
|
|
68
|
+
];
|
|
69
|
+
await Promise.all(legacyFiles.map((file) => promises.rm(file, { force: true })));
|
|
70
|
+
}
|
|
71
|
+
async function writePlaygroundBuild(params) {
|
|
72
|
+
const distDir = resolvePlaygroundDist();
|
|
73
|
+
const targetDir = resolvePlaygroundOutDir(params.outDir, params.playgroundPath);
|
|
74
|
+
if (targetDir === params.outDir) {
|
|
75
|
+
params.logger.error("Playground build path resolves to the Vite outDir. Aborting output.");
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
try {
|
|
79
|
+
await promises.stat(distDir);
|
|
80
|
+
} catch (error) {
|
|
81
|
+
params.logger.error("Failed to locate playground assets:", error);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
await promises.rm(targetDir, { recursive: true, force: true });
|
|
85
|
+
await promises.mkdir(params.outDir, { recursive: true });
|
|
86
|
+
await promises.cp(distDir, targetDir, { recursive: true });
|
|
87
|
+
await removeLegacySwAsset(targetDir);
|
|
88
|
+
await updateIndexHtml(targetDir, params.swScript);
|
|
89
|
+
await writeRoutesPayload(params, targetDir);
|
|
57
90
|
}
|
|
58
91
|
|
|
59
92
|
const legacyEntryKeys = [
|
|
@@ -606,17 +639,35 @@ async function configurePreviewServer(params) {
|
|
|
606
639
|
}
|
|
607
640
|
|
|
608
641
|
const swModuleCandidates = [
|
|
609
|
-
|
|
610
|
-
|
|
642
|
+
"dist/sw.mjs",
|
|
643
|
+
"dist/sw.js",
|
|
644
|
+
"src/sw.ts",
|
|
645
|
+
"src/sw.js"
|
|
611
646
|
];
|
|
647
|
+
function resolvePackageRoot() {
|
|
648
|
+
const moduleDir = dirname(fileURLToPath(import.meta.url));
|
|
649
|
+
let current = moduleDir;
|
|
650
|
+
for (let index = 0; index < 6; index += 1) {
|
|
651
|
+
if (existsSync(resolve(current, "package.json"))) {
|
|
652
|
+
return current;
|
|
653
|
+
}
|
|
654
|
+
const parent = dirname(current);
|
|
655
|
+
if (parent === current) {
|
|
656
|
+
break;
|
|
657
|
+
}
|
|
658
|
+
current = parent;
|
|
659
|
+
}
|
|
660
|
+
return moduleDir;
|
|
661
|
+
}
|
|
612
662
|
const localSwModulePath = (() => {
|
|
663
|
+
const packageRoot = resolvePackageRoot();
|
|
613
664
|
for (const candidate of swModuleCandidates) {
|
|
614
|
-
const filePath =
|
|
665
|
+
const filePath = resolve(packageRoot, candidate);
|
|
615
666
|
if (existsSync(filePath)) {
|
|
616
667
|
return filePath;
|
|
617
668
|
}
|
|
618
669
|
}
|
|
619
|
-
return
|
|
670
|
+
return resolve(packageRoot, "src/sw.ts");
|
|
620
671
|
})();
|
|
621
672
|
async function resolveSwModuleImport(context) {
|
|
622
673
|
const resolved = await context.resolve("mokup/sw");
|
|
@@ -670,12 +721,102 @@ function buildSwLifecycleScript(params) {
|
|
|
670
721
|
"})()"
|
|
671
722
|
].join("\n");
|
|
672
723
|
}
|
|
724
|
+
function buildSwLifecycleInlineScript(params) {
|
|
725
|
+
const {
|
|
726
|
+
swConfig,
|
|
727
|
+
unregisterConfig,
|
|
728
|
+
hasSwEntries,
|
|
729
|
+
hasSwRoutes,
|
|
730
|
+
resolveRequestPath,
|
|
731
|
+
resolveRegisterScope
|
|
732
|
+
} = params;
|
|
733
|
+
const shouldUnregister = unregisterConfig.unregister === true || !hasSwEntries;
|
|
734
|
+
if (shouldUnregister) {
|
|
735
|
+
const path2 = resolveRequestPath(unregisterConfig.path);
|
|
736
|
+
const scope2 = resolveRegisterScope(unregisterConfig.scope);
|
|
737
|
+
return [
|
|
738
|
+
"(async () => {",
|
|
739
|
+
" if (typeof window === 'undefined' || !('serviceWorker' in navigator)) {",
|
|
740
|
+
" return",
|
|
741
|
+
" }",
|
|
742
|
+
` const path = ${JSON.stringify(path2)}`,
|
|
743
|
+
` const scope = ${JSON.stringify(scope2)}`,
|
|
744
|
+
" const origin = window.location.origin",
|
|
745
|
+
" const normalizeScope = (value) => {",
|
|
746
|
+
" const url = new URL(value, origin)",
|
|
747
|
+
" if (!url.pathname.endsWith('/')) {",
|
|
748
|
+
" url.pathname = url.pathname + '/'",
|
|
749
|
+
" }",
|
|
750
|
+
" return url.href",
|
|
751
|
+
" }",
|
|
752
|
+
" const pathUrl = new URL(path, origin)",
|
|
753
|
+
" const scopeUrl = normalizeScope(scope)",
|
|
754
|
+
" const matchesScript = (scriptUrl) => {",
|
|
755
|
+
" if (!scriptUrl) {",
|
|
756
|
+
" return false",
|
|
757
|
+
" }",
|
|
758
|
+
" try {",
|
|
759
|
+
" const parsed = new URL(scriptUrl)",
|
|
760
|
+
" return parsed.origin === origin && parsed.pathname === pathUrl.pathname",
|
|
761
|
+
" }",
|
|
762
|
+
" catch {",
|
|
763
|
+
" return false",
|
|
764
|
+
" }",
|
|
765
|
+
" }",
|
|
766
|
+
" try {",
|
|
767
|
+
" const registrations = await navigator.serviceWorker.getRegistrations()",
|
|
768
|
+
" for (const registration of registrations) {",
|
|
769
|
+
" if (registration.scope !== scopeUrl) {",
|
|
770
|
+
" continue",
|
|
771
|
+
" }",
|
|
772
|
+
" const scriptUrls = [",
|
|
773
|
+
" registration.active?.scriptURL,",
|
|
774
|
+
" registration.waiting?.scriptURL,",
|
|
775
|
+
" registration.installing?.scriptURL,",
|
|
776
|
+
" ]",
|
|
777
|
+
" if (scriptUrls.some(matchesScript)) {",
|
|
778
|
+
" await registration.unregister()",
|
|
779
|
+
" }",
|
|
780
|
+
" }",
|
|
781
|
+
" }",
|
|
782
|
+
" catch (error) {",
|
|
783
|
+
" console.warn('Failed to unregister service worker:', error)",
|
|
784
|
+
" }",
|
|
785
|
+
"})()"
|
|
786
|
+
].join("\n");
|
|
787
|
+
}
|
|
788
|
+
if (!swConfig || swConfig.register === false) {
|
|
789
|
+
return null;
|
|
790
|
+
}
|
|
791
|
+
if (!hasSwRoutes) {
|
|
792
|
+
return null;
|
|
793
|
+
}
|
|
794
|
+
const path = resolveRequestPath(swConfig.path);
|
|
795
|
+
const scope = resolveRegisterScope(swConfig.scope);
|
|
796
|
+
return [
|
|
797
|
+
"(async () => {",
|
|
798
|
+
" if (typeof window === 'undefined' || !('serviceWorker' in navigator)) {",
|
|
799
|
+
" return",
|
|
800
|
+
" }",
|
|
801
|
+
` const path = ${JSON.stringify(path)}`,
|
|
802
|
+
` const scope = ${JSON.stringify(scope)}`,
|
|
803
|
+
" try {",
|
|
804
|
+
" await navigator.serviceWorker.register(path, { type: 'module', scope })",
|
|
805
|
+
" }",
|
|
806
|
+
" catch (error) {",
|
|
807
|
+
" console.warn('Failed to register service worker:', error)",
|
|
808
|
+
" }",
|
|
809
|
+
"})()"
|
|
810
|
+
].join("\n");
|
|
811
|
+
}
|
|
673
812
|
|
|
674
813
|
function createMokupPlugin(options = {}) {
|
|
675
814
|
let root = cwd();
|
|
676
815
|
let base = "/";
|
|
677
816
|
let command = "serve";
|
|
678
817
|
let assetsDir = "assets";
|
|
818
|
+
let outDir = "dist";
|
|
819
|
+
let isSsrBuild = false;
|
|
679
820
|
const state = {
|
|
680
821
|
routes: [],
|
|
681
822
|
serverRoutes: [],
|
|
@@ -894,6 +1035,8 @@ function createMokupPlugin(options = {}) {
|
|
|
894
1035
|
base = config.base ?? "/";
|
|
895
1036
|
command = config.command;
|
|
896
1037
|
assetsDir = config.build.assetsDir ?? "assets";
|
|
1038
|
+
outDir = config.build.outDir ?? "dist";
|
|
1039
|
+
isSsrBuild = !!config.build.ssr;
|
|
897
1040
|
},
|
|
898
1041
|
async configureServer(server) {
|
|
899
1042
|
currentServer = server;
|
|
@@ -933,9 +1076,35 @@ function createMokupPlugin(options = {}) {
|
|
|
933
1076
|
previewWatcher = null;
|
|
934
1077
|
});
|
|
935
1078
|
},
|
|
936
|
-
closeBundle() {
|
|
1079
|
+
async closeBundle() {
|
|
937
1080
|
previewWatcher?.close();
|
|
938
1081
|
previewWatcher = null;
|
|
1082
|
+
if (command !== "build" || isSsrBuild || !playgroundConfig.enabled || playgroundConfig.build !== true) {
|
|
1083
|
+
return;
|
|
1084
|
+
}
|
|
1085
|
+
await refreshRoutes();
|
|
1086
|
+
const swScript = buildSwLifecycleInlineScript({
|
|
1087
|
+
swConfig,
|
|
1088
|
+
unregisterConfig,
|
|
1089
|
+
hasSwEntries,
|
|
1090
|
+
hasSwRoutes: hasSwRoutes(),
|
|
1091
|
+
resolveRequestPath: resolveSwRequestPath,
|
|
1092
|
+
resolveRegisterScope: resolveSwRegisterScope
|
|
1093
|
+
});
|
|
1094
|
+
await writePlaygroundBuild({
|
|
1095
|
+
outDir,
|
|
1096
|
+
base,
|
|
1097
|
+
playgroundPath: playgroundConfig.path,
|
|
1098
|
+
root,
|
|
1099
|
+
routes: state.routes,
|
|
1100
|
+
disabledRoutes: state.disabledRoutes,
|
|
1101
|
+
ignoredRoutes: state.ignoredRoutes,
|
|
1102
|
+
configFiles: state.configFiles,
|
|
1103
|
+
disabledConfigFiles: state.disabledConfigFiles,
|
|
1104
|
+
dirs: resolveAllDirs(),
|
|
1105
|
+
swScript,
|
|
1106
|
+
logger
|
|
1107
|
+
});
|
|
939
1108
|
}
|
|
940
1109
|
};
|
|
941
1110
|
}
|
package/dist/webpack.cjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const process = require('node:process');
|
|
4
|
-
const scanner = require('./shared/mokup.
|
|
4
|
+
const scanner = require('./shared/mokup.DLUSS6KF.cjs');
|
|
5
|
+
require('node:fs');
|
|
6
|
+
const pathe = require('@mokup/shared/pathe');
|
|
5
7
|
const logger = require('@mokup/shared/logger');
|
|
8
|
+
const manifest = require('./shared/mokup.C7-7PDF7.cjs');
|
|
6
9
|
const esbuild = require('@mokup/shared/esbuild');
|
|
7
10
|
const node_module = require('node:module');
|
|
8
|
-
const pathe = require('@mokup/shared/pathe');
|
|
9
11
|
const chokidar = require('@mokup/shared/chokidar');
|
|
10
|
-
require('node:fs');
|
|
11
12
|
require('node:buffer');
|
|
12
13
|
require('@mokup/shared/hono');
|
|
13
14
|
require('node:url');
|
|
@@ -255,7 +256,7 @@ function joinPublicPath(publicPath, fileName) {
|
|
|
255
256
|
}
|
|
256
257
|
function resolveModuleFilePath(file, root) {
|
|
257
258
|
const absolute = pathe.isAbsolute(file) ? file : pathe.resolve(root, file);
|
|
258
|
-
const normalized =
|
|
259
|
+
const normalized = manifest.toPosix(absolute);
|
|
259
260
|
if (/^[a-z]:\//i.test(normalized)) {
|
|
260
261
|
return `file:///${normalized}`;
|
|
261
262
|
}
|
|
@@ -273,7 +274,7 @@ function createRouteRefresher(params) {
|
|
|
273
274
|
const collectedConfigs = [];
|
|
274
275
|
for (const entry of optionList) {
|
|
275
276
|
const scanParams = {
|
|
276
|
-
dirs:
|
|
277
|
+
dirs: manifest.resolveDirs(entry.dir, root()),
|
|
277
278
|
prefix: entry.prefix ?? "",
|
|
278
279
|
logger,
|
|
279
280
|
onSkip: (info) => collectedDisabled.push(info),
|
|
@@ -318,21 +319,21 @@ function createWebpackWatcher(params) {
|
|
|
318
319
|
return null;
|
|
319
320
|
}
|
|
320
321
|
const watcher = chokidar__default.watch(params.dirs, { ignoreInitial: true });
|
|
321
|
-
const scheduleRefresh =
|
|
322
|
+
const scheduleRefresh = manifest.createDebouncer(80, () => {
|
|
322
323
|
void params.onRefresh();
|
|
323
324
|
});
|
|
324
325
|
watcher.on("add", (file) => {
|
|
325
|
-
if (
|
|
326
|
+
if (manifest.isInDirs(file, params.dirs)) {
|
|
326
327
|
scheduleRefresh();
|
|
327
328
|
}
|
|
328
329
|
});
|
|
329
330
|
watcher.on("change", (file) => {
|
|
330
|
-
if (
|
|
331
|
+
if (manifest.isInDirs(file, params.dirs)) {
|
|
331
332
|
scheduleRefresh();
|
|
332
333
|
}
|
|
333
334
|
});
|
|
334
335
|
watcher.on("unlink", (file) => {
|
|
335
|
-
if (
|
|
336
|
+
if (manifest.isInDirs(file, params.dirs)) {
|
|
336
337
|
scheduleRefresh();
|
|
337
338
|
}
|
|
338
339
|
});
|
|
@@ -376,7 +377,7 @@ function createMokupWebpackPlugin(options = {}) {
|
|
|
376
377
|
const dirs = [];
|
|
377
378
|
const seen = /* @__PURE__ */ new Set();
|
|
378
379
|
for (const entry of optionList) {
|
|
379
|
-
for (const dir of
|
|
380
|
+
for (const dir of manifest.resolveDirs(entry.dir, root)) {
|
|
380
381
|
if (seen.has(dir)) {
|
|
381
382
|
continue;
|
|
382
383
|
}
|
package/dist/webpack.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { M as MokupPluginOptions } from './shared/mokup.
|
|
2
|
-
export { H as HttpMethod,
|
|
1
|
+
import { M as MokupPluginOptions } from './shared/mokup.DeotZ0g8.cjs';
|
|
2
|
+
export { H as HttpMethod, b as MiddlewarePosition, c as MiddlewareRegistry, d as RequestHandler, e as RouteDirectoryConfig, f as RouteResponse, g as RouteRule, h as RuntimeMode, S as ServiceWorkerOptions, V as VitePluginOptions, i as VitePluginOptionsInput } from './shared/mokup.DeotZ0g8.cjs';
|
|
3
3
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
4
4
|
export { Context, MiddlewareHandler } from '@mokup/shared/hono';
|
|
5
5
|
export { PlaygroundOptionsInput } from '@mokup/shared';
|
|
6
|
+
import '@mokup/runtime';
|
|
6
7
|
|
|
7
8
|
interface WebpackPluginInstance {
|
|
8
9
|
apply: (compiler: WebpackCompiler) => void;
|
package/dist/webpack.d.mts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { M as MokupPluginOptions } from './shared/mokup.
|
|
2
|
-
export { H as HttpMethod,
|
|
1
|
+
import { M as MokupPluginOptions } from './shared/mokup.DeotZ0g8.mjs';
|
|
2
|
+
export { H as HttpMethod, b as MiddlewarePosition, c as MiddlewareRegistry, d as RequestHandler, e as RouteDirectoryConfig, f as RouteResponse, g as RouteRule, h as RuntimeMode, S as ServiceWorkerOptions, V as VitePluginOptions, i as VitePluginOptionsInput } from './shared/mokup.DeotZ0g8.mjs';
|
|
3
3
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
4
4
|
export { Context, MiddlewareHandler } from '@mokup/shared/hono';
|
|
5
5
|
export { PlaygroundOptionsInput } from '@mokup/shared';
|
|
6
|
+
import '@mokup/runtime';
|
|
6
7
|
|
|
7
8
|
interface WebpackPluginInstance {
|
|
8
9
|
apply: (compiler: WebpackCompiler) => void;
|
package/dist/webpack.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { M as MokupPluginOptions } from './shared/mokup.
|
|
2
|
-
export { H as HttpMethod,
|
|
1
|
+
import { M as MokupPluginOptions } from './shared/mokup.DeotZ0g8.js';
|
|
2
|
+
export { H as HttpMethod, b as MiddlewarePosition, c as MiddlewareRegistry, d as RequestHandler, e as RouteDirectoryConfig, f as RouteResponse, g as RouteRule, h as RuntimeMode, S as ServiceWorkerOptions, V as VitePluginOptions, i as VitePluginOptionsInput } from './shared/mokup.DeotZ0g8.js';
|
|
3
3
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
4
4
|
export { Context, MiddlewareHandler } from '@mokup/shared/hono';
|
|
5
5
|
export { PlaygroundOptionsInput } from '@mokup/shared';
|
|
6
|
+
import '@mokup/runtime';
|
|
6
7
|
|
|
7
8
|
interface WebpackPluginInstance {
|
|
8
9
|
apply: (compiler: WebpackCompiler) => void;
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { cwd } from 'node:process';
|
|
2
|
-
import { b as buildSwScript,
|
|
2
|
+
import { b as buildSwScript, s as scanRoutes, a as sortRoutes, c as createHonoApp, r as resolvePlaygroundOptions, d as resolveSwConfig, e as resolveSwUnregisterConfig, f as createPlaygroundMiddleware, g as createMiddleware } from './shared/mokup.CtSctWaa.mjs';
|
|
3
|
+
import 'node:fs';
|
|
4
|
+
import { isAbsolute, resolve } from '@mokup/shared/pathe';
|
|
3
5
|
import { createLogger } from '@mokup/shared/logger';
|
|
6
|
+
import { t as toPosix, r as resolveDirs, i as isInDirs, c as createDebouncer } from './shared/mokup.JBCzv4xR.mjs';
|
|
4
7
|
import { build } from '@mokup/shared/esbuild';
|
|
5
8
|
import { createRequire } from 'node:module';
|
|
6
|
-
import { isAbsolute, resolve } from '@mokup/shared/pathe';
|
|
7
9
|
import chokidar from '@mokup/shared/chokidar';
|
|
8
|
-
import 'node:fs';
|
|
9
10
|
import 'node:buffer';
|
|
10
11
|
import '@mokup/shared/hono';
|
|
11
12
|
import 'node:url';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mokup",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.1",
|
|
5
5
|
"description": "Mock utilities and Vite plugin for mokup.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://mokup.icebreaker.top",
|
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
"import": "./dist/cli.mjs",
|
|
22
22
|
"require": "./dist/cli.cjs"
|
|
23
23
|
},
|
|
24
|
+
"./bundle": {
|
|
25
|
+
"types": "./dist/bundle.d.ts",
|
|
26
|
+
"import": "./dist/bundle.mjs",
|
|
27
|
+
"require": "./dist/bundle.cjs"
|
|
28
|
+
},
|
|
24
29
|
"./server": {
|
|
25
30
|
"types": "./dist/server.d.ts",
|
|
26
31
|
"import": "./dist/server.mjs",
|
|
@@ -92,11 +97,11 @@
|
|
|
92
97
|
},
|
|
93
98
|
"dependencies": {
|
|
94
99
|
"picocolors": "^1.1.1",
|
|
95
|
-
"@mokup/cli": "1.0.
|
|
96
|
-
"@mokup/playground": "0.0.
|
|
97
|
-
"@mokup/runtime": "1.0.
|
|
98
|
-
"@mokup/server": "1.1.
|
|
99
|
-
"@mokup/shared": "1.0
|
|
100
|
+
"@mokup/cli": "1.0.9",
|
|
101
|
+
"@mokup/playground": "0.0.13",
|
|
102
|
+
"@mokup/runtime": "1.0.5",
|
|
103
|
+
"@mokup/server": "1.1.6",
|
|
104
|
+
"@mokup/shared": "1.1.0"
|
|
100
105
|
},
|
|
101
106
|
"devDependencies": {
|
|
102
107
|
"@types/node": "^25.0.10",
|