mockaton 12.3.3 → 12.3.5
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/package.json
CHANGED
package/src/client/app.js
CHANGED
|
@@ -734,7 +734,7 @@ function CloudIcon() {
|
|
|
734
734
|
function HelpIcon() {
|
|
735
735
|
return (
|
|
736
736
|
s('svg', { viewBox: '0 0 24 24' },
|
|
737
|
-
s('path', { d: '
|
|
737
|
+
s('path', { d: 'M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4' })))
|
|
738
738
|
}
|
|
739
739
|
|
|
740
740
|
|
package/src/client/styles.css
CHANGED
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
--colorDisabledMockSelector: #444;
|
|
19
19
|
--colorHover: rgba(119, 193, 255, 0.4);
|
|
20
20
|
--colorLabel: #555;
|
|
21
|
-
--colorLightRed: #ffe4ee;
|
|
22
21
|
--colorRed: #da0f00;
|
|
23
22
|
--colorText: #000;
|
|
24
23
|
--colorPink: #ed206a;
|
|
@@ -41,7 +40,6 @@
|
|
|
41
40
|
--colorDisabledMockSelector: #b9b9b9;
|
|
42
41
|
--colorHover: rgba(0, 63, 115, 0.5);
|
|
43
42
|
--colorLabel: #aaa;
|
|
44
|
-
--colorLightRed: #ffe4ee;
|
|
45
43
|
--colorRed: #f41606;
|
|
46
44
|
--colorText: #fff;
|
|
47
45
|
--colorPink: #f92672;
|
|
@@ -111,6 +109,7 @@ select {
|
|
|
111
109
|
background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23888888'><path d='M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z'/></svg>") no-repeat;
|
|
112
110
|
background-size: 16px;
|
|
113
111
|
background-position: calc(100% - 3px) center;
|
|
112
|
+
transition: all 240ms ease-out;
|
|
114
113
|
|
|
115
114
|
&:enabled {
|
|
116
115
|
border-color: var(--colorSecondaryActionBorder);
|
|
@@ -137,7 +136,7 @@ header {
|
|
|
137
136
|
align-self: end;
|
|
138
137
|
margin-right: 22px;
|
|
139
138
|
margin-bottom: 3px;
|
|
140
|
-
opacity:
|
|
139
|
+
opacity: 90%;
|
|
141
140
|
transition: opacity 240ms ease-in-out;
|
|
142
141
|
|
|
143
142
|
&:hover {
|
|
@@ -182,8 +181,9 @@ header {
|
|
|
182
181
|
background: transparent;
|
|
183
182
|
border-radius: 50px;
|
|
184
183
|
color: var(--colorRed);
|
|
184
|
+
|
|
185
185
|
@media (prefers-color-scheme: dark) {
|
|
186
|
-
color: var(--
|
|
186
|
+
color: var(--colorText);
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
&:hover {
|
|
@@ -217,6 +217,13 @@ header {
|
|
|
217
217
|
color: var(--colorLabel);
|
|
218
218
|
font-size: 11px;
|
|
219
219
|
gap: 4px;
|
|
220
|
+
transition: color 200ms ease-out;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
&:hover {
|
|
224
|
+
span {
|
|
225
|
+
color: var(--colorText);
|
|
226
|
+
}
|
|
220
227
|
}
|
|
221
228
|
|
|
222
229
|
input[type=url],
|
|
@@ -412,10 +419,10 @@ main {
|
|
|
412
419
|
margin-left: 100px;
|
|
413
420
|
}
|
|
414
421
|
&.nonGroupedByMethod {
|
|
415
|
-
margin-left:
|
|
422
|
+
margin-left: 118px;
|
|
416
423
|
|
|
417
424
|
&.canProxy {
|
|
418
|
-
margin-left:
|
|
425
|
+
margin-left: 146px;
|
|
419
426
|
}
|
|
420
427
|
}
|
|
421
428
|
}
|
|
@@ -583,6 +590,7 @@ main {
|
|
|
583
590
|
&:not(:checked):enabled:hover + .checkboxBody {
|
|
584
591
|
border-color: var(--colorRed);
|
|
585
592
|
color: var(--colorRed);
|
|
593
|
+
background: transparent;
|
|
586
594
|
}
|
|
587
595
|
&:checked + .checkboxBody {
|
|
588
596
|
border-color: var(--colorRed);
|
|
@@ -68,7 +68,7 @@ async function applyPlugins(filePath, req, response) {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
export async function jsToJsonPlugin(filePath, req, response) {
|
|
71
|
-
const jsExport = (await import(pathToFileURL(filePath)
|
|
71
|
+
const jsExport = (await import(pathToFileURL(filePath))).default
|
|
72
72
|
const body = typeof jsExport === 'function'
|
|
73
73
|
? await jsExport(req, response)
|
|
74
74
|
: JSON.stringify(jsExport, null, 2)
|
package/src/server/Mockaton.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { register } from 'node:module'
|
|
1
2
|
import { createServer } from 'node:http'
|
|
2
3
|
|
|
3
4
|
import pkgJSON from '../../package.json' with { type: 'json' }
|
|
@@ -25,6 +26,7 @@ import { watchMocksDir, watchStaticDir } from './Watcher.js'
|
|
|
25
26
|
|
|
26
27
|
export function Mockaton(options) {
|
|
27
28
|
return new Promise((resolve, reject) => {
|
|
29
|
+
register('./cacheBustResolver.js', import.meta.url)
|
|
28
30
|
setup(options)
|
|
29
31
|
|
|
30
32
|
mockBrokerCollection.init()
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// We register this hook at runtime so it doesn’t interfere with non-dynamic imports.
|
|
2
|
+
export async function resolve(specifier, context, nextResolve) {
|
|
3
|
+
const result = await nextResolve(specifier, context)
|
|
4
|
+
const url = new URL(result.url)
|
|
5
|
+
url.searchParams.set('t', performance.now())
|
|
6
|
+
return {
|
|
7
|
+
...result,
|
|
8
|
+
url: url.href,
|
|
9
|
+
shortCircuit: true
|
|
10
|
+
}
|
|
11
|
+
}
|