veryfront 0.1.1039 → 0.1.1040
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/esm/deno.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-response-cache.d.ts","sourceRoot":"","sources":["../../../../src/src/modules/server/module-response-cache.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAQzD,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,oCAAoC;IACnD,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gCAAgC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,+BAA+B,CAAC;IACvC,MAAM,EAAE,QAAQ,GAAG,aAAa,CAAC;CAClC;
|
|
1
|
+
{"version":3,"file":"module-response-cache.d.ts","sourceRoot":"","sources":["../../../../src/src/modules/server/module-response-cache.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAQzD,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,oCAAoC;IACnD,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gCAAgC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,+BAA+B,CAAC;IACvC,MAAM,EAAE,QAAQ,GAAG,aAAa,CAAC;CAClC;AAkED,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,oCAAoC,GAC5C,MAAM,CAqBR;AAED,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,6BAA6B,GAAG,SAAS,CAAC,CAqBpD;AAED,wBAAsB,6BAA6B,CACjD,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,+BAA+B,GACrC,OAAO,CAAC,IAAI,CAAC,CAef;AAED,wBAAgB,+BAA+B,IAAI,IAAI,CAEtD;AAED,wBAAgB,kDAAkD,CAChE,KAAK,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,GACrC,IAAI,CAEN"}
|
|
@@ -44,6 +44,22 @@ async function getDistributedCache() {
|
|
|
44
44
|
return null;
|
|
45
45
|
return cache.type === "api" || cache.type === "redis" ? cache : null;
|
|
46
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* The distributed cache backend validates keys against a strict charset
|
|
49
|
+
* (alphanumeric plus `_ : . - /`) and rejects anything else with HTTP 400.
|
|
50
|
+
* Request module paths routinely contain characters outside that set — notably
|
|
51
|
+
* `@` (e.g. `/@vite/env`) — so an unsanitized path makes the composed key
|
|
52
|
+
* unstorable and the response is silently never cached.
|
|
53
|
+
*
|
|
54
|
+
* We prefix a hash of the exact path (collision resistance for two paths that
|
|
55
|
+
* clamp to the same readable form) with a charset-clamped readable form (kept
|
|
56
|
+
* for debuggability). `:` is deliberately excluded from the readable form so it
|
|
57
|
+
* cannot be confused with the key's field separator.
|
|
58
|
+
*/
|
|
59
|
+
function sanitizeModulePathForCacheKey(modulePath) {
|
|
60
|
+
const readable = modulePath.replace(/[^a-zA-Z0-9_.\-/]/g, "-");
|
|
61
|
+
return `${hashString(modulePath)}-${readable}`;
|
|
62
|
+
}
|
|
47
63
|
export function buildReleaseModuleResponseCacheKey(options) {
|
|
48
64
|
const projectScope = [
|
|
49
65
|
options.projectIdentity,
|
|
@@ -51,6 +67,8 @@ export function buildReleaseModuleResponseCacheKey(options) {
|
|
|
51
67
|
options.projectSlug ?? "",
|
|
52
68
|
options.branch ?? "",
|
|
53
69
|
].join("\0");
|
|
70
|
+
// Fields are joined with `:` (an allowed key character) rather than a NUL
|
|
71
|
+
// byte, which the distributed cache backend's key validator also rejects.
|
|
54
72
|
return [
|
|
55
73
|
"module-server-release-response",
|
|
56
74
|
hashString(projectScope),
|
|
@@ -60,8 +78,8 @@ export function buildReleaseModuleResponseCacheKey(options) {
|
|
|
60
78
|
options.releaseDependencyManifestVersion == null
|
|
61
79
|
? ""
|
|
62
80
|
: `release-dependency-manifest:${options.releaseDependencyManifestVersion}`,
|
|
63
|
-
options.modulePath,
|
|
64
|
-
].join("
|
|
81
|
+
sanitizeModulePathForCacheKey(options.modulePath),
|
|
82
|
+
].join(":");
|
|
65
83
|
}
|
|
66
84
|
export async function getReleaseModuleResponse(cacheKey) {
|
|
67
85
|
const localEntry = releaseModuleResponseCache.get(cacheKey);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "veryfront",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1040",
|
|
4
4
|
"description": "The simplest way to build AI-powered apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -330,9 +330,9 @@
|
|
|
330
330
|
"@types/react": "19.2.14",
|
|
331
331
|
"@types/react-dom": "19.2.3",
|
|
332
332
|
"ws": "8.21.0",
|
|
333
|
-
"@veryfront/ext-bundler-esbuild": "0.1.
|
|
334
|
-
"@veryfront/ext-content-mdx": "0.1.
|
|
335
|
-
"@veryfront/ext-css-tailwind": "0.1.
|
|
333
|
+
"@veryfront/ext-bundler-esbuild": "0.1.1040",
|
|
334
|
+
"@veryfront/ext-content-mdx": "0.1.1040",
|
|
335
|
+
"@veryfront/ext-css-tailwind": "0.1.1040"
|
|
336
336
|
},
|
|
337
337
|
"devDependencies": {
|
|
338
338
|
"@types/node": "20.9.0"
|