@stacksjs/defaults 0.74.50 → 0.74.51

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.
@@ -28,11 +28,23 @@ export default new Middleware({
28
28
  name: 'maintenance',
29
29
  priority: 0, // Run first, before all other middleware
30
30
 
31
- async handle(request) {
32
- const { maintenanceGate } = serverModule ??= await import('@stacksjs/server')
31
+ handle(request) {
32
+ if (!serverModule) {
33
+ return import('@stacksjs/server').then((module) => {
34
+ serverModule = module
35
+ return module.maintenanceGate(request)
36
+ }).then(throwIfGated)
37
+ }
33
38
 
34
- const gated = await maintenanceGate(request)
39
+ const gated = serverModule.maintenanceGate(request)
40
+ if (gated instanceof Promise)
41
+ return gated.then(throwIfGated)
35
42
  if (gated)
36
- throw gated // short-circuit the request
43
+ return Promise.reject(gated)
37
44
  },
38
45
  })
46
+
47
+ function throwIfGated(gated: Response | null): void {
48
+ if (gated)
49
+ throw gated // short-circuit the request
50
+ }
@@ -2,7 +2,7 @@
2
2
  "publisher": "Stacks",
3
3
  "name": "vscode-stacks",
4
4
  "displayName": "Stacks",
5
- "version": "0.74.50",
5
+ "version": "0.74.51",
6
6
  "description": "A modern Stacks development environment.",
7
7
  "license": "MIT",
8
8
  "funding": "https://github.com/sponsors/chrisbbreuer",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/defaults",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.74.50",
5
+ "version": "0.74.51",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/stacksjs/stacks.git",
@@ -55,7 +55,7 @@
55
55
  "dependencies": {
56
56
  "@iconify-json/f7": "^1.2.2",
57
57
  "@iconify-json/hugeicons": "^1.2.27",
58
- "@stacksjs/mobile": "^0.74.50",
58
+ "@stacksjs/mobile": "^0.74.51",
59
59
  "@stacksjs/sanitizer": "^0.2.113",
60
60
  "ts-qr-codes": "^0.1.8"
61
61
  }