acrylblends 0.6.0 → 0.6.2
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 +8 -6
- package/dist/index.d.ts +2 -0
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/docs/framework/UPSTREAM.md +1 -1
- package/docs/framework/api/presets.md +0 -3
- package/docs/framework/cordis/acryl-in-a-cordis-app.md +3 -0
- package/docs/framework/getting-started/basic.md +4 -4
- package/docs/framework/guides/jsx.md +1 -1
- package/docs/framework/guides/middleware.md +1 -1
- package/docs/framework/helpers/cookie.md +1 -1
- package/docs/framework/helpers/dev.md +0 -3
- package/docs/framework/helpers/jwt.md +1 -1
- package/docs/framework/helpers/proxy.md +0 -3
- package/docs/framework/middleware/builtin/basic-auth.md +6 -6
- package/docs/framework/middleware/builtin/cache.md +0 -3
- package/docs/framework/middleware/builtin/combine.md +1 -1
- package/docs/framework/middleware/builtin/ip-restriction.md +1 -1
- package/docs/framework/middleware/builtin/logger.md +1 -1
- package/docs/framework/middleware/builtin/mount.md +0 -3
- package/docs/framework/upstream.json +2 -2
- package/lib/accepts.d.ts +1 -1
- package/lib/acryl-base.d.ts +1 -1
- package/lib/adapter.d.ts +1 -1
- package/lib/{app-CmAYW1Al.d.ts → app-BdrVHBlJ.d.ts} +1 -1
- package/lib/basic-auth.d.ts +1 -1
- package/lib/bearer-auth.d.ts +1 -1
- package/lib/body-limit.d.ts +1 -1
- package/lib/cache.d.ts +43 -0
- package/lib/cache.js +169 -0
- package/lib/client.d.ts +2 -2
- package/lib/combine.d.ts +1 -1
- package/lib/compress.d.ts +1 -1
- package/lib/conninfo.d.ts +2 -2
- package/lib/{context-Bm7rI-oK.d.ts → context-B5Y1lLha.d.ts} +1 -1
- package/lib/context-storage.d.ts +1 -1
- package/lib/{cookie-ClMaKDQf.d.ts → cookie-D9_nQbsM.d.ts} +1 -1
- package/lib/cookie.d.ts +3 -3
- package/lib/cors.d.ts +1 -1
- package/lib/csrf.d.ts +1 -1
- package/lib/dev.d.ts +19 -0
- package/lib/dev.js +50 -0
- package/lib/etag.d.ts +1 -1
- package/lib/factory.d.ts +2 -2
- package/lib/{index-B-3F4wt2.d.ts → index-DtEoak1i.d.ts} +2 -2
- package/lib/{index-UTBmM3GX.d.ts → index-Kqou8Fjh.d.ts} +2 -2
- package/lib/{index-oOClm_Xk.d.ts → index-m12zcmph.d.ts} +3 -3
- package/lib/index.d.ts +4 -4
- package/lib/ip-restriction.d.ts +2 -2
- package/lib/jwk.d.ts +4 -4
- package/lib/{jwt-Dg493Tai.d.ts → jwt-BA65QhnJ.d.ts} +1 -1
- package/lib/jwt.d.ts +4 -4
- package/lib/language.d.ts +1 -1
- package/lib/linear-router-C3FPib6h.js +96 -0
- package/lib/logger.d.ts +1 -1
- package/lib/loopback-only.d.ts +1 -1
- package/lib/method-not-allowed.d.ts +2 -2
- package/lib/method-override.d.ts +2 -2
- package/lib/mount.d.ts +44 -0
- package/lib/mount.js +67 -0
- package/lib/node-server/conninfo.d.ts +1 -1
- package/lib/node-server/serve-static.d.ts +1 -1
- package/lib/node-server.d.ts +1 -1
- package/lib/pattern-router-HZxjDGEQ.js +41 -0
- package/lib/powered-by.d.ts +1 -1
- package/lib/pretty-json.d.ts +1 -1
- package/lib/proxy.d.ts +72 -0
- package/lib/proxy.js +121 -0
- package/lib/quick.d.ts +8 -0
- package/lib/quick.js +17 -0
- package/lib/request-id.d.ts +1 -1
- package/lib/request.d.ts +1 -1
- package/lib/route.d.ts +1 -1
- package/lib/router/linear-router.js +1 -95
- package/lib/router/pattern-router.js +1 -40
- package/lib/schema-validator.d.ts +1 -1
- package/lib/secure-headers.d.ts +1 -1
- package/lib/serve-static.d.ts +1 -1
- package/lib/streaming.d.ts +1 -1
- package/lib/testing.d.ts +4 -4
- package/lib/timeout.d.ts +1 -1
- package/lib/timing.d.ts +1 -1
- package/lib/tiny.d.ts +8 -0
- package/lib/tiny.js +15 -0
- package/lib/trailing-slash.d.ts +1 -1
- package/lib/{types-CHesD1KG.d.ts → types-Bd29gh2o.d.ts} +3 -3
- package/lib/{types-CwrQjlaM.d.ts → types-D9DEXMjE.d.ts} +3 -1
- package/lib/{types-CDO6I3B0.d.ts → types-ZM9gIiKh.d.ts} +1 -1
- package/lib/types.d.ts +1 -1
- package/lib/utils/body.d.ts +1 -1
- package/lib/utils/cookie.d.ts +1 -1
- package/lib/utils/crypto.d.ts +1 -1
- package/lib/utils/ipaddr.d.ts +1 -1
- package/lib/utils/jwt.d.ts +1 -1
- package/lib/utils/types.d.ts +2 -2
- package/lib/validator.d.ts +2 -2
- package/lib/ws.d.ts +1 -1
- package/package.json +25 -1
- package/plugins/acryl-inspect/upstream.json +1 -1
- package/plugins/acryl-node-server/upstream.json +1 -1
- package/plugins/acryl-router/src/core/helper/dev/index.test.ts +181 -0
- package/plugins/acryl-router/src/core/helper/dev/index.ts +79 -0
- package/plugins/acryl-router/src/core/helper/proxy/index.test.ts +356 -0
- package/plugins/acryl-router/src/core/helper/proxy/index.ts +203 -0
- package/plugins/acryl-router/src/core/middleware/cache/index.test.ts +1211 -0
- package/plugins/acryl-router/src/core/middleware/cache/index.ts +323 -0
- package/plugins/acryl-router/src/core/middleware/mount/index.test.ts +334 -0
- package/plugins/acryl-router/src/core/middleware/mount/index.ts +108 -0
- package/plugins/acryl-router/src/core/preset/quick.test.ts +42 -0
- package/plugins/acryl-router/src/core/preset/quick.ts +24 -0
- package/plugins/acryl-router/src/core/preset/tiny.test.ts +42 -0
- package/plugins/acryl-router/src/core/preset/tiny.ts +20 -0
- package/plugins/acryl-router/src/core/utils/types.ts +3 -0
- package/plugins/acryl-router/src/helpers/index.ts +2 -0
- package/plugins/acryl-router/src/middleware/index.ts +2 -0
- package/plugins/acryl-router/src/service.ts +22 -5
- package/plugins/acryl-router/upstream.json +2 -2
- package/plugins/acryl-router-http/upstream.json +1 -1
- package/plugins/acryl-state/upstream.json +1 -1
- package/plugins/desktop/upstream.json +1 -1
- package/plugins/desktop-web/main.ts +92 -0
- package/plugins/desktop-web/plugin.json +17 -0
- package/plugins/desktop-web/shutdown.ts +177 -0
- package/plugins/desktop-web/upstream.json +12 -0
- package/plugins/desktop-web/user-data.ts +38 -0
- package/plugins/desktop-web/window.ts +29 -0
- package/plugins/tsconfig.json +2 -0
- package/templates/todo/upstream.json +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** Electron user-data location for isolated local launches: an explicit override, else the selected app instance's own folder. */
|
|
2
|
+
|
|
3
|
+
import { join, resolve } from 'node:path'
|
|
4
|
+
|
|
5
|
+
/** Env var consumed by the Electron bootstrap before the single-instance lock. */
|
|
6
|
+
export const DSH_DESKTOP_USER_DATA_ENV = 'DSH_DESKTOP_USER_DATA'
|
|
7
|
+
|
|
8
|
+
/** What the selected app instance says about where its Electron user data lives (see `AppInstance.userDataName`). */
|
|
9
|
+
export interface InstanceUserData {
|
|
10
|
+
/**
|
|
11
|
+
* The platform's application-data folder (`app.getPath('appData')`). A function because it is asked only when it is needed: Electron throws for it on
|
|
12
|
+
* Windows when the user profile is redirected (an isolated run moves USERPROFILE), and an explicit `DSH_DESKTOP_USER_DATA` makes it unnecessary.
|
|
13
|
+
*/
|
|
14
|
+
readonly appData: () => string
|
|
15
|
+
/** The instance's user-data folder name. */
|
|
16
|
+
readonly userDataName: string
|
|
17
|
+
/** The name Electron would otherwise derive the folder from. */
|
|
18
|
+
readonly productName: string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Resolve a launch-time user-data directory from the environment.
|
|
23
|
+
* An explicit `DSH_DESKTOP_USER_DATA` wins; empty or whitespace-only values are treated as unset so a blank override never points Electron at the
|
|
24
|
+
* current working directory. Without one, an instance whose `userDataName` differs from the product name (a worktree, the development app, a launch
|
|
25
|
+
* with `ACRYL_LOCAL_PRODUCT_NAME`) gets its own folder under the application-data folder, so it never shares window state, logs, crash evidence or
|
|
26
|
+
* the single-instance lock with the installed app. The default instance names its folder after the product, so it is left alone.
|
|
27
|
+
* @param env - process environment, injected in tests.
|
|
28
|
+
* @param instance - the selected instance's user-data facts, when the caller has them.
|
|
29
|
+
*/
|
|
30
|
+
export function resolveDesktopUserDataOverride(
|
|
31
|
+
env: Record<string, string | undefined> = process.env,
|
|
32
|
+
instance?: InstanceUserData,
|
|
33
|
+
): string | undefined {
|
|
34
|
+
const raw = env[DSH_DESKTOP_USER_DATA_ENV]
|
|
35
|
+
if (raw !== undefined && raw.trim().length > 0) return resolve(raw)
|
|
36
|
+
if (instance === undefined || instance.userDataName === instance.productName) return undefined
|
|
37
|
+
return join(instance.appData(), instance.userDataName)
|
|
38
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** The one window of a desktop app: the operating system's frame around a page the app's own server serves, with the renderer locked down. */
|
|
2
|
+
import type { BrowserWindowConstructorOptions } from 'electron'
|
|
3
|
+
|
|
4
|
+
export interface WindowSpec {
|
|
5
|
+
readonly title: string
|
|
6
|
+
readonly width?: number
|
|
7
|
+
readonly height?: number
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Secure BrowserWindow options. The settings are ACRYL Desktop's: context isolation on, no Node in the page, the sandbox on, web security on; the window stays
|
|
12
|
+
* hidden until the page has painted (`show: false`, shown on `ready-to-show`).
|
|
13
|
+
*/
|
|
14
|
+
export function windowOptions(spec: WindowSpec): BrowserWindowConstructorOptions {
|
|
15
|
+
return {
|
|
16
|
+
title: spec.title,
|
|
17
|
+
width: spec.width ?? 1100,
|
|
18
|
+
height: spec.height ?? 760,
|
|
19
|
+
minWidth: 480,
|
|
20
|
+
minHeight: 360,
|
|
21
|
+
show: false,
|
|
22
|
+
webPreferences: {
|
|
23
|
+
contextIsolation: true,
|
|
24
|
+
nodeIntegration: false,
|
|
25
|
+
sandbox: true,
|
|
26
|
+
webSecurity: true,
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
}
|
package/plugins/tsconfig.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"examples/acryl-todo/src/index.ts": "src/todo.ts",
|
|
6
6
|
"examples/acryl-todo/src/page.ts": "src/page.ts"
|
|
7
7
|
},
|
|
8
|
-
"commit": "
|
|
8
|
+
"commit": "0174cb01625bfd32d0162ad56179c582f353321e"
|
|
9
9
|
},
|
|
10
10
|
"rewrittenSpecifiers": 4,
|
|
11
11
|
"digest": "sha256:9093704776563001f7f472f94cc5c2fdd79206342c1cb59c11fce62aa74df3ed"
|