mokup 2.2.1 → 2.3.0
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 +4 -2
- package/dist/bundle.d.cts +5 -2
- package/dist/bundle.d.mts +5 -2
- package/dist/bundle.d.ts +5 -2
- package/dist/bundle.mjs +4 -2
- package/dist/index.cjs +140 -11
- package/dist/index.d.cts +27 -18
- package/dist/index.d.mts +27 -18
- package/dist/index.d.ts +27 -18
- package/dist/index.mjs +139 -12
- package/dist/shared/{mokup.zkaN1ADs.cjs → mokup.BXPIIxtS.cjs} +1 -1
- package/dist/shared/{mokup.CtSctWaa.mjs → mokup.C-hwskJ_.mjs} +86 -121
- package/dist/shared/{mokup.vAap-D_L.mjs → mokup.CsBTglhs.mjs} +1 -1
- package/dist/shared/{mokup.DLUSS6KF.cjs → mokup.DXCs9518.cjs} +114 -150
- package/dist/shared/{mokup.DeotZ0g8.d.mts → mokup.Dkqu10Hk.d.cts} +11 -1
- package/dist/shared/{mokup.DeotZ0g8.d.ts → mokup.Dkqu10Hk.d.mts} +11 -1
- package/dist/shared/{mokup.DeotZ0g8.d.cts → mokup.Dkqu10Hk.d.ts} +11 -1
- package/dist/shared/{mokup.C7-7PDF7.cjs → mokup.Dy9VDphS.cjs} +5 -76
- package/dist/shared/{mokup.JBCzv4xR.mjs → mokup.Iqw32OxC.mjs} +4 -67
- package/dist/vite.cjs +37 -23
- package/dist/vite.d.cts +2 -2
- package/dist/vite.d.mts +2 -2
- package/dist/vite.d.ts +2 -2
- package/dist/vite.mjs +27 -13
- package/dist/webpack.cjs +44 -9
- package/dist/webpack.d.cts +25 -6
- package/dist/webpack.d.mts +25 -6
- package/dist/webpack.d.ts +25 -6
- package/dist/webpack.mjs +36 -3
- package/package.json +6 -6
package/dist/webpack.mjs
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { cwd } from 'node:process';
|
|
2
|
-
import { b as buildSwScript, s as scanRoutes, a as sortRoutes, c as createHonoApp,
|
|
2
|
+
import { b as buildSwScript, r as resolveDirs, s as scanRoutes, a as sortRoutes, c as createHonoApp, d as resolvePlaygroundOptions, e as resolveSwConfig, f as resolveSwUnregisterConfig, g as createPlaygroundMiddleware, h as createMiddleware } from './shared/mokup.C-hwskJ_.mjs';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import { isAbsolute, resolve } from '@mokup/shared/pathe';
|
|
5
|
+
import '@mokup/shared/playground-grouping';
|
|
5
6
|
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';
|
|
7
7
|
import { build } from '@mokup/shared/esbuild';
|
|
8
8
|
import { createRequire } from 'node:module';
|
|
9
|
+
import './shared/mokup.Iqw32OxC.mjs';
|
|
10
|
+
import { toPosix, isInDirs } from '@mokup/shared/path-utils';
|
|
11
|
+
import { createDebouncer } from '@mokup/shared/timing';
|
|
9
12
|
import chokidar from '@mokup/shared/chokidar';
|
|
10
13
|
import 'node:buffer';
|
|
11
14
|
import '@mokup/shared/hono';
|
|
@@ -564,4 +567,34 @@ function createMokupWebpackPlugin(options = {}) {
|
|
|
564
567
|
};
|
|
565
568
|
}
|
|
566
569
|
|
|
567
|
-
|
|
570
|
+
function mokupWebpack(options = {}) {
|
|
571
|
+
const plugin = createMokupWebpackPlugin(options);
|
|
572
|
+
const applyConfig = (config = {}) => {
|
|
573
|
+
const plugins = Array.isArray(config.plugins) ? config.plugins : [];
|
|
574
|
+
const devServer = config.devServer && typeof config.devServer === "object" ? { ...config.devServer } : {};
|
|
575
|
+
return {
|
|
576
|
+
...config,
|
|
577
|
+
plugins: [...plugins, plugin],
|
|
578
|
+
devServer
|
|
579
|
+
};
|
|
580
|
+
};
|
|
581
|
+
const applyInput = (input) => {
|
|
582
|
+
if (typeof input === "function") {
|
|
583
|
+
const wrapped = async (...args) => {
|
|
584
|
+
const resolved = await input(...args);
|
|
585
|
+
if (Array.isArray(resolved)) {
|
|
586
|
+
return resolved.map((item) => applyConfig(item));
|
|
587
|
+
}
|
|
588
|
+
return applyConfig(resolved ?? {});
|
|
589
|
+
};
|
|
590
|
+
return wrapped;
|
|
591
|
+
}
|
|
592
|
+
if (Array.isArray(input)) {
|
|
593
|
+
return input.map((item) => applyConfig(item));
|
|
594
|
+
}
|
|
595
|
+
return applyConfig(input ?? {});
|
|
596
|
+
};
|
|
597
|
+
return applyInput;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
export { createMokupWebpackPlugin, createMokupWebpackPlugin as createWebpackPlugin, mokupWebpack };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mokup",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.3.0",
|
|
5
5
|
"description": "Mock utilities and Vite plugin for mokup.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://mokup.icebreaker.top",
|
|
@@ -97,11 +97,11 @@
|
|
|
97
97
|
},
|
|
98
98
|
"dependencies": {
|
|
99
99
|
"picocolors": "^1.1.1",
|
|
100
|
-
"@mokup/cli": "1.0
|
|
101
|
-
"@mokup/playground": "0.0.
|
|
102
|
-
"@mokup/runtime": "1.0.
|
|
103
|
-
"@mokup/server": "1.
|
|
104
|
-
"@mokup/shared": "1.1.
|
|
100
|
+
"@mokup/cli": "1.1.0",
|
|
101
|
+
"@mokup/playground": "0.0.15",
|
|
102
|
+
"@mokup/runtime": "1.0.6",
|
|
103
|
+
"@mokup/server": "1.2.0",
|
|
104
|
+
"@mokup/shared": "1.1.1"
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
107
|
"@types/node": "^25.0.10",
|