@mokup/shared 1.1.3 → 2.0.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/README.md +58 -0
- package/dist/chokidar.d.mts +3 -8
- package/dist/chokidar.d.ts +3 -9
- package/dist/chokidar.mjs +2 -1
- package/dist/chunk-_iGcCiPk.mjs +28 -0
- package/dist/config-core-dqVMz7on.d.mts +5 -0
- package/dist/config-core-dqVMz7on.d.ts +5 -0
- package/dist/config-core.d.mts +2 -4
- package/dist/config-core.d.ts +2 -4
- package/dist/config-core.mjs +3 -2
- package/dist/config-utils-DFu0_9tl.d.mts +59 -0
- package/dist/config-utils-DFu0_9tl.d.ts +59 -0
- package/dist/config-utils.d.mts +3 -62
- package/dist/config-utils.d.ts +3 -62
- package/dist/config-utils.mjs +143 -159
- package/dist/define-config-CzB1-X1m.d.mts +20 -0
- package/dist/define-config-CzB1-X1m.d.ts +20 -0
- package/dist/define-config.d.mts +2 -20
- package/dist/define-config.d.ts +2 -20
- package/dist/define-config.mjs +146 -161
- package/dist/diagnostic-types-DqAzUbgn.d.mts +39 -0
- package/dist/diagnostic-types-DqAzUbgn.d.ts +39 -0
- package/dist/diagnostic-types.d.mts +2 -0
- package/dist/diagnostic-types.d.ts +2 -0
- package/dist/diagnostic-types.mjs +29 -0
- package/dist/diagnostics-C3QaEtqE.d.mts +101 -0
- package/dist/diagnostics-C3QaEtqE.d.ts +101 -0
- package/dist/diagnostics.d.mts +2 -0
- package/dist/diagnostics.d.ts +2 -0
- package/dist/diagnostics.mjs +129 -0
- package/dist/hono.d.mts +4 -3
- package/dist/hono.d.ts +4 -3
- package/dist/hono.mjs +4 -3
- package/dist/index-5prVUGOX.d.mts +113 -0
- package/dist/index-5prVUGOX.d.ts +113 -0
- package/dist/index.d.mts +13 -10
- package/dist/index.d.ts +13 -10
- package/dist/index.mjs +13 -18
- package/dist/jsonc-parser.d.mts +1 -1
- package/dist/jsonc-parser.d.ts +1 -1
- package/dist/jsonc-parser.mjs +8 -1
- package/dist/jsonc-utils-_Hs6a39T.d.mts +7 -0
- package/dist/jsonc-utils-_Hs6a39T.d.ts +7 -0
- package/dist/jsonc-utils.d.mts +2 -7
- package/dist/jsonc-utils.d.ts +2 -7
- package/dist/jsonc-utils.mjs +20 -20
- package/dist/load-rules-D_kCpu9I.d.mts +14 -0
- package/dist/load-rules-D_kCpu9I.d.ts +14 -0
- package/dist/load-rules.d.mts +2 -14
- package/dist/load-rules.d.ts +2 -14
- package/dist/load-rules.mjs +16 -34
- package/dist/logger-types-BbqYCr6j.d.mts +50 -0
- package/dist/logger-types-BbqYCr6j.d.ts +50 -0
- package/dist/logger.browser.d.mts +4 -3
- package/dist/logger.browser.d.ts +4 -3
- package/dist/logger.browser.mjs +49 -48
- package/dist/logger.d.mts +4 -3
- package/dist/logger.d.ts +4 -3
- package/dist/logger.mjs +49 -48
- package/dist/{mock-files.d.cts → mock-files-DfGigWmY.d.mts} +5 -5
- package/dist/mock-files-DfGigWmY.d.ts +10 -0
- package/dist/mock-files.d.mts +2 -10
- package/dist/mock-files.d.ts +2 -10
- package/dist/mock-files.mjs +38 -50
- package/dist/{module-loader.d.cts → module-loader-nAQlwo3D.d.mts} +7 -6
- package/dist/module-loader-nAQlwo3D.d.ts +14 -0
- package/dist/module-loader.d.mts +2 -13
- package/dist/module-loader.d.ts +2 -13
- package/dist/module-loader.mjs +60 -69
- package/dist/path-utils.d.mts +3 -2
- package/dist/path-utils.d.ts +3 -2
- package/dist/path-utils.mjs +25 -35
- package/dist/pathe.d.mts +1 -1
- package/dist/pathe.d.ts +1 -1
- package/dist/pathe.mjs +8 -1
- package/dist/playground-grouping.d.mts +6 -6
- package/dist/playground-grouping.d.ts +6 -6
- package/dist/playground-grouping.mjs +57 -77
- package/dist/rolldown.d.mts +37 -0
- package/dist/rolldown.d.ts +37 -0
- package/dist/rolldown.mjs +81 -0
- package/dist/{route-constants.d.cts → route-constants-BUi36iYR.d.mts} +3 -2
- package/dist/route-constants-BUi36iYR.d.ts +8 -0
- package/dist/route-constants.d.mts +2 -7
- package/dist/route-constants.d.ts +2 -7
- package/dist/route-constants.mjs +25 -21
- package/dist/route-utils-BiWFUqo-.d.mts +42 -0
- package/dist/route-utils-BiWFUqo-.d.ts +42 -0
- package/dist/route-utils.d.mts +2 -42
- package/dist/route-utils.d.ts +2 -42
- package/dist/route-utils.mjs +94 -121
- package/dist/scan-utils.d.mts +2 -114
- package/dist/scan-utils.d.ts +2 -114
- package/dist/scan-utils.mjs +14 -25
- package/dist/timing.d.mts +3 -2
- package/dist/timing.d.ts +3 -2
- package/dist/timing.mjs +11 -12
- package/package.json +88 -128
- package/dist/chokidar.cjs +0 -11
- package/dist/chokidar.d.cts +0 -9
- package/dist/config-core.cjs +0 -9
- package/dist/config-core.d.cts +0 -4
- package/dist/config-utils.cjs +0 -179
- package/dist/config-utils.d.cts +0 -62
- package/dist/define-config.cjs +0 -168
- package/dist/define-config.d.cts +0 -20
- package/dist/esbuild.cjs +0 -16
- package/dist/esbuild.d.cts +0 -1
- package/dist/esbuild.d.mts +0 -1
- package/dist/esbuild.d.ts +0 -1
- package/dist/esbuild.mjs +0 -1
- package/dist/hono.cjs +0 -20
- package/dist/hono.d.cts +0 -3
- package/dist/index.cjs +0 -50
- package/dist/index.d.cts +0 -10
- package/dist/jsonc-parser.cjs +0 -16
- package/dist/jsonc-parser.d.cts +0 -1
- package/dist/jsonc-utils.cjs +0 -25
- package/dist/jsonc-utils.d.cts +0 -7
- package/dist/load-rules.cjs +0 -39
- package/dist/load-rules.d.cts +0 -14
- package/dist/logger.browser.cjs +0 -55
- package/dist/logger.browser.d.cts +0 -21
- package/dist/logger.cjs +0 -55
- package/dist/logger.d.cts +0 -21
- package/dist/mock-files.cjs +0 -65
- package/dist/module-loader.cjs +0 -93
- package/dist/path-utils.cjs +0 -57
- package/dist/path-utils.d.cts +0 -7
- package/dist/pathe.cjs +0 -16
- package/dist/pathe.d.cts +0 -1
- package/dist/playground-grouping.cjs +0 -95
- package/dist/playground-grouping.d.cts +0 -12
- package/dist/route-constants.cjs +0 -30
- package/dist/route-utils.cjs +0 -126
- package/dist/route-utils.d.cts +0 -42
- package/dist/scan-utils.cjs +0 -39
- package/dist/scan-utils.d.cts +0 -114
- package/dist/shared/shared.DazgCdsk.d.cts +0 -49
- package/dist/shared/shared.DazgCdsk.d.mts +0 -49
- package/dist/shared/shared.DazgCdsk.d.ts +0 -49
- package/dist/timing.cjs +0 -20
- package/dist/timing.d.cts +0 -4
package/dist/config-utils.mjs
CHANGED
|
@@ -1,171 +1,155 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { isPromise, middlewareSymbol } from "./config-core.mjs";
|
|
2
|
+
import { t as pathe_exports } from "./pathe.mjs";
|
|
3
|
+
import { promises } from "node:fs";
|
|
4
|
+
//#region src/config-utils.ts
|
|
6
5
|
function readMiddlewareMeta(config) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
post: Array.isArray(meta.post) ? meta.post : []
|
|
16
|
-
};
|
|
6
|
+
const value = config[middlewareSymbol];
|
|
7
|
+
if (!value || typeof value !== "object") return null;
|
|
8
|
+
const meta = value;
|
|
9
|
+
return {
|
|
10
|
+
pre: Array.isArray(meta.pre) ? meta.pre : [],
|
|
11
|
+
normal: Array.isArray(meta.normal) ? meta.normal : [],
|
|
12
|
+
post: Array.isArray(meta.post) ? meta.post : []
|
|
13
|
+
};
|
|
17
14
|
}
|
|
18
15
|
function normalizeMiddlewareList(params) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
});
|
|
32
|
-
return middlewares;
|
|
16
|
+
const { value, source, position, warn, map } = params;
|
|
17
|
+
if (!value) return [];
|
|
18
|
+
const list = Array.isArray(value) ? value : [value];
|
|
19
|
+
const middlewares = [];
|
|
20
|
+
list.forEach((entry, index) => {
|
|
21
|
+
if (typeof entry !== "function") {
|
|
22
|
+
warn?.(`Invalid middleware in ${source}`);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
middlewares.push(map(entry, index, position));
|
|
26
|
+
});
|
|
27
|
+
return middlewares;
|
|
33
28
|
}
|
|
34
29
|
function buildConfigChain(file, rootDir) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
current = parent;
|
|
49
|
-
}
|
|
50
|
-
chain.reverse();
|
|
51
|
-
return chain;
|
|
30
|
+
const resolvedRoot = (0, pathe_exports.normalize)(rootDir);
|
|
31
|
+
const resolvedFileDir = (0, pathe_exports.normalize)((0, pathe_exports.dirname)(file));
|
|
32
|
+
const chain = [];
|
|
33
|
+
let current = resolvedFileDir;
|
|
34
|
+
while (true) {
|
|
35
|
+
chain.push(current);
|
|
36
|
+
if (current === resolvedRoot) break;
|
|
37
|
+
const parent = (0, pathe_exports.dirname)(current);
|
|
38
|
+
if (parent === current) break;
|
|
39
|
+
current = parent;
|
|
40
|
+
}
|
|
41
|
+
chain.reverse();
|
|
42
|
+
return chain;
|
|
52
43
|
}
|
|
53
44
|
function getConfigFileCandidates(dir, extensions) {
|
|
54
|
-
|
|
45
|
+
return extensions.map((extension) => (0, pathe_exports.join)(dir, `index.config${extension}`));
|
|
55
46
|
}
|
|
56
47
|
async function findConfigFile(dir, cache, extensions) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
cache.set(dir, null);
|
|
71
|
-
return null;
|
|
48
|
+
const cached = cache.get(dir);
|
|
49
|
+
if (cached !== void 0) return cached;
|
|
50
|
+
for (const candidate of getConfigFileCandidates(dir, extensions)) try {
|
|
51
|
+
await promises.stat(candidate);
|
|
52
|
+
cache.set(dir, candidate);
|
|
53
|
+
return candidate;
|
|
54
|
+
} catch {
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
cache.set(dir, null);
|
|
58
|
+
return null;
|
|
72
59
|
}
|
|
73
60
|
async function resolveDirectoryConfig(params) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
configChain,
|
|
167
|
-
configSources
|
|
168
|
-
};
|
|
61
|
+
const { file, rootDir, configExtensions, configCache, fileCache, loadConfig, warn, mapMiddleware } = params;
|
|
62
|
+
const chain = buildConfigChain(file, rootDir);
|
|
63
|
+
const merged = {};
|
|
64
|
+
const preMiddlewares = [];
|
|
65
|
+
const normalMiddlewares = [];
|
|
66
|
+
const postMiddlewares = [];
|
|
67
|
+
const configChain = [];
|
|
68
|
+
const configSources = {};
|
|
69
|
+
for (const dir of chain) {
|
|
70
|
+
const configPath = await findConfigFile(dir, fileCache, configExtensions);
|
|
71
|
+
if (!configPath) continue;
|
|
72
|
+
let config = configCache.get(configPath);
|
|
73
|
+
if (config === void 0) {
|
|
74
|
+
config = await loadConfig(configPath);
|
|
75
|
+
configCache.set(configPath, config);
|
|
76
|
+
}
|
|
77
|
+
if (!config) {
|
|
78
|
+
warn?.(`Invalid config in ${configPath}`);
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
configChain.push(configPath);
|
|
82
|
+
if (config.headers) {
|
|
83
|
+
merged.headers = {
|
|
84
|
+
...merged.headers ?? {},
|
|
85
|
+
...config.headers
|
|
86
|
+
};
|
|
87
|
+
configSources.headers = configPath;
|
|
88
|
+
}
|
|
89
|
+
if (typeof config.status === "number") {
|
|
90
|
+
merged.status = config.status;
|
|
91
|
+
configSources.status = configPath;
|
|
92
|
+
}
|
|
93
|
+
if (typeof config.delay === "number") {
|
|
94
|
+
merged.delay = config.delay;
|
|
95
|
+
configSources.delay = configPath;
|
|
96
|
+
}
|
|
97
|
+
if (typeof config.enabled === "boolean") {
|
|
98
|
+
merged.enabled = config.enabled;
|
|
99
|
+
configSources.enabled = configPath;
|
|
100
|
+
}
|
|
101
|
+
if (typeof config.ignorePrefix !== "undefined") {
|
|
102
|
+
merged.ignorePrefix = config.ignorePrefix;
|
|
103
|
+
configSources.ignorePrefix = configPath;
|
|
104
|
+
}
|
|
105
|
+
if (typeof config.include !== "undefined") {
|
|
106
|
+
merged.include = config.include;
|
|
107
|
+
configSources.include = configPath;
|
|
108
|
+
}
|
|
109
|
+
if (typeof config.exclude !== "undefined") {
|
|
110
|
+
merged.exclude = config.exclude;
|
|
111
|
+
configSources.exclude = configPath;
|
|
112
|
+
}
|
|
113
|
+
const meta = readMiddlewareMeta(config);
|
|
114
|
+
preMiddlewares.push(...normalizeMiddlewareList({
|
|
115
|
+
value: meta?.pre,
|
|
116
|
+
source: configPath,
|
|
117
|
+
position: "pre",
|
|
118
|
+
warn,
|
|
119
|
+
map: (handler, index, position) => mapMiddleware(handler, index, position, configPath)
|
|
120
|
+
}));
|
|
121
|
+
normalMiddlewares.push(...normalizeMiddlewareList({
|
|
122
|
+
value: meta?.normal,
|
|
123
|
+
source: configPath,
|
|
124
|
+
position: "normal",
|
|
125
|
+
warn,
|
|
126
|
+
map: (handler, index, position) => mapMiddleware(handler, index, position, configPath)
|
|
127
|
+
}));
|
|
128
|
+
normalMiddlewares.push(...normalizeMiddlewareList({
|
|
129
|
+
value: config.middleware,
|
|
130
|
+
source: configPath,
|
|
131
|
+
position: "normal",
|
|
132
|
+
warn,
|
|
133
|
+
map: (handler, index, position) => mapMiddleware(handler, index, position, configPath)
|
|
134
|
+
}));
|
|
135
|
+
postMiddlewares.push(...normalizeMiddlewareList({
|
|
136
|
+
value: meta?.post,
|
|
137
|
+
source: configPath,
|
|
138
|
+
position: "post",
|
|
139
|
+
warn,
|
|
140
|
+
map: (handler, index, position) => mapMiddleware(handler, index, position, configPath)
|
|
141
|
+
}));
|
|
142
|
+
}
|
|
143
|
+
return {
|
|
144
|
+
...merged,
|
|
145
|
+
middlewares: [
|
|
146
|
+
...preMiddlewares,
|
|
147
|
+
...normalMiddlewares,
|
|
148
|
+
...postMiddlewares
|
|
149
|
+
],
|
|
150
|
+
configChain,
|
|
151
|
+
configSources
|
|
152
|
+
};
|
|
169
153
|
}
|
|
170
|
-
|
|
171
|
-
export { buildConfigChain, findConfigFile, getConfigFileCandidates, middlewareSymbol, normalizeMiddlewareList, readMiddlewareMeta, resolveDirectoryConfig };
|
|
154
|
+
//#endregion
|
|
155
|
+
export { buildConfigChain, findConfigFile, getConfigFileCandidates, isPromise, middlewareSymbol, normalizeMiddlewareList, readMiddlewareMeta, resolveDirectoryConfig };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/define-config.d.ts
|
|
2
|
+
type HookErrorPolicy = 'warn' | 'silent' | 'throw';
|
|
3
|
+
type HookHandler = () => void | Promise<void>;
|
|
4
|
+
interface ConfigApp<TMiddleware> {
|
|
5
|
+
use: (...handlers: TMiddleware[]) => void;
|
|
6
|
+
}
|
|
7
|
+
type DefineConfigFactory<TConfig, TMiddleware> = (context: {
|
|
8
|
+
app: ConfigApp<TMiddleware>;
|
|
9
|
+
}) => TConfig | void | Promise<TConfig | void>;
|
|
10
|
+
declare function createDefineConfig<TConfig extends {
|
|
11
|
+
hookError?: HookErrorPolicy;
|
|
12
|
+
}, TMiddleware>(options: {
|
|
13
|
+
logPrefix: string;
|
|
14
|
+
}): {
|
|
15
|
+
defineConfig: (input: TConfig | DefineConfigFactory<TConfig, TMiddleware>) => TConfig | Promise<TConfig>;
|
|
16
|
+
onBeforeAll: (handler: HookHandler) => void;
|
|
17
|
+
onAfterAll: (handler: HookHandler) => void;
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { createDefineConfig as a, HookHandler as i, DefineConfigFactory as n, HookErrorPolicy as r, ConfigApp as t };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/define-config.d.ts
|
|
2
|
+
type HookErrorPolicy = 'warn' | 'silent' | 'throw';
|
|
3
|
+
type HookHandler = () => void | Promise<void>;
|
|
4
|
+
interface ConfigApp<TMiddleware> {
|
|
5
|
+
use: (...handlers: TMiddleware[]) => void;
|
|
6
|
+
}
|
|
7
|
+
type DefineConfigFactory<TConfig, TMiddleware> = (context: {
|
|
8
|
+
app: ConfigApp<TMiddleware>;
|
|
9
|
+
}) => TConfig | void | Promise<TConfig | void>;
|
|
10
|
+
declare function createDefineConfig<TConfig extends {
|
|
11
|
+
hookError?: HookErrorPolicy;
|
|
12
|
+
}, TMiddleware>(options: {
|
|
13
|
+
logPrefix: string;
|
|
14
|
+
}): {
|
|
15
|
+
defineConfig: (input: TConfig | DefineConfigFactory<TConfig, TMiddleware>) => TConfig | Promise<TConfig>;
|
|
16
|
+
onBeforeAll: (handler: HookHandler) => void;
|
|
17
|
+
onAfterAll: (handler: HookHandler) => void;
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { createDefineConfig as a, HookHandler as i, DefineConfigFactory as n, HookErrorPolicy as r, ConfigApp as t };
|
package/dist/define-config.d.mts
CHANGED
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
interface ConfigApp<TMiddleware> {
|
|
4
|
-
use: (...handlers: TMiddleware[]) => void;
|
|
5
|
-
}
|
|
6
|
-
type DefineConfigFactory<TConfig, TMiddleware> = (context: {
|
|
7
|
-
app: ConfigApp<TMiddleware>;
|
|
8
|
-
}) => TConfig | void | Promise<TConfig | void>;
|
|
9
|
-
declare function createDefineConfig<TConfig extends {
|
|
10
|
-
hookError?: HookErrorPolicy;
|
|
11
|
-
}, TMiddleware>(options: {
|
|
12
|
-
logPrefix: string;
|
|
13
|
-
}): {
|
|
14
|
-
defineConfig: (input: TConfig | DefineConfigFactory<TConfig, TMiddleware>) => TConfig | Promise<TConfig>;
|
|
15
|
-
onBeforeAll: (handler: HookHandler) => void;
|
|
16
|
-
onAfterAll: (handler: HookHandler) => void;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export { createDefineConfig };
|
|
20
|
-
export type { ConfigApp, DefineConfigFactory, HookErrorPolicy, HookHandler };
|
|
1
|
+
import { a as createDefineConfig, i as HookHandler, n as DefineConfigFactory, r as HookErrorPolicy, t as ConfigApp } from "./define-config-CzB1-X1m.mjs";
|
|
2
|
+
export { ConfigApp, DefineConfigFactory, HookErrorPolicy, HookHandler, createDefineConfig };
|
package/dist/define-config.d.ts
CHANGED
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
interface ConfigApp<TMiddleware> {
|
|
4
|
-
use: (...handlers: TMiddleware[]) => void;
|
|
5
|
-
}
|
|
6
|
-
type DefineConfigFactory<TConfig, TMiddleware> = (context: {
|
|
7
|
-
app: ConfigApp<TMiddleware>;
|
|
8
|
-
}) => TConfig | void | Promise<TConfig | void>;
|
|
9
|
-
declare function createDefineConfig<TConfig extends {
|
|
10
|
-
hookError?: HookErrorPolicy;
|
|
11
|
-
}, TMiddleware>(options: {
|
|
12
|
-
logPrefix: string;
|
|
13
|
-
}): {
|
|
14
|
-
defineConfig: (input: TConfig | DefineConfigFactory<TConfig, TMiddleware>) => TConfig | Promise<TConfig>;
|
|
15
|
-
onBeforeAll: (handler: HookHandler) => void;
|
|
16
|
-
onAfterAll: (handler: HookHandler) => void;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export { createDefineConfig };
|
|
20
|
-
export type { ConfigApp, DefineConfigFactory, HookErrorPolicy, HookHandler };
|
|
1
|
+
import { a as createDefineConfig, i as HookHandler, n as DefineConfigFactory, r as HookErrorPolicy, t as ConfigApp } from "./define-config-CzB1-X1m.mjs";
|
|
2
|
+
export { ConfigApp, DefineConfigFactory, HookErrorPolicy, HookHandler, createDefineConfig };
|