veryfront 0.1.97 → 0.1.99
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/cli/commands/styles/command.d.ts +15 -0
- package/esm/cli/commands/styles/command.d.ts.map +1 -1
- package/esm/cli/commands/styles/command.js +2 -2
- package/esm/deno.d.ts +2 -0
- package/esm/deno.js +36 -34
- package/esm/src/build/production-build/templates.d.ts.map +1 -1
- package/esm/src/build/production-build/templates.js +2 -2
- package/esm/src/platform/compat/esbuild-shared.d.ts +1 -1
- package/esm/src/platform/compat/esbuild-shared.js +1 -1
- package/esm/src/platform/compat/std/front-matter-yaml.d.ts.map +1 -1
- package/esm/src/platform/compat/std/front-matter-yaml.js +10 -1
- package/esm/src/proxy/cache/redis-cache.d.ts +3 -0
- package/esm/src/proxy/cache/redis-cache.d.ts.map +1 -1
- package/esm/src/proxy/cache/redis-cache.js +15 -2
- package/esm/src/proxy/cache/types.d.ts +3 -0
- package/esm/src/proxy/cache/types.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/index.d.ts +17 -1
- package/esm/src/react/components/ai/chat/index.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/index.js +0 -3
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +9 -0
- package/esm/src/studio/bridge/bridge-bundle.generated.d.ts.map +1 -1
- package/esm/src/studio/bridge/bridge-bundle.generated.js +1 -1
- package/esm/src/utils/redis-client.d.ts +4 -2
- package/esm/src/utils/redis-client.d.ts.map +1 -1
- package/esm/src/utils/redis-client.js +21 -1
- package/esm/src/utils/version.d.ts +1 -1
- package/esm/src/utils/version.js +1 -1
- package/package.json +20 -20
- package/src/cli/commands/styles/command.ts +4 -2
- package/src/deno.js +36 -34
- package/src/src/build/production-build/templates.ts +2 -2
- package/src/src/platform/compat/esbuild-shared.ts +1 -1
- package/src/src/platform/compat/std/front-matter-yaml.ts +17 -2
- package/src/src/proxy/cache/redis-cache.ts +15 -3
- package/src/src/proxy/cache/types.ts +3 -0
- package/src/src/react/components/ai/chat/index.tsx +11 -1
- package/src/src/server/handlers/dev/framework-candidates.generated.ts +9 -0
- package/src/src/studio/bridge/bridge-bundle.generated.ts +1 -1
- package/src/src/utils/redis-client.ts +32 -4
- package/src/src/utils/version.ts +1 -1
|
@@ -19,10 +19,13 @@ export interface RedisClient {
|
|
|
19
19
|
isOpen?: boolean;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
interface RedisClientOptions {
|
|
22
|
+
export interface RedisClientOptions {
|
|
23
23
|
url?: string;
|
|
24
24
|
connectTimeout?: number;
|
|
25
25
|
autoReconnect?: boolean;
|
|
26
|
+
tls?: boolean;
|
|
27
|
+
password?: string;
|
|
28
|
+
username?: string;
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
let sharedClient: RedisClient | null = null;
|
|
@@ -64,12 +67,14 @@ export async function getRedisClient(options: RedisClientOptions = {}): Promise<
|
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
async function createClient(options: RedisClientOptions): Promise<RedisClient> {
|
|
67
|
-
|
|
70
|
+
// deno-lint-ignore no-explicit-any
|
|
71
|
+
let createClientFn: ((opts: Record<string, any>) => RedisClient) | undefined;
|
|
68
72
|
|
|
69
73
|
try {
|
|
70
74
|
const redisClientModule = "npm:@redis/client@1.5.8";
|
|
71
75
|
const mod = await import(redisClientModule);
|
|
72
|
-
|
|
76
|
+
// deno-lint-ignore no-explicit-any
|
|
77
|
+
createClientFn = mod.createClient as (opts: Record<string, any>) => RedisClient;
|
|
73
78
|
} catch (error) {
|
|
74
79
|
logger.debug("Failed to load @redis/client module", { error });
|
|
75
80
|
throw DEPENDENCY_MISSING.create({
|
|
@@ -78,7 +83,30 @@ async function createClient(options: RedisClientOptions): Promise<RedisClient> {
|
|
|
78
83
|
});
|
|
79
84
|
}
|
|
80
85
|
|
|
81
|
-
const
|
|
86
|
+
const url = options.url ?? getEnv("REDIS_URL");
|
|
87
|
+
const useTls = options.tls ?? url?.startsWith("rediss://") ?? false;
|
|
88
|
+
|
|
89
|
+
if (!useTls && getEnv("NODE_ENV") === "production") {
|
|
90
|
+
logger.warn(
|
|
91
|
+
"Redis connection without TLS in production. Set REDIS_URL to rediss:// or pass tls: true.",
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// deno-lint-ignore no-explicit-any
|
|
96
|
+
const clientOpts: Record<string, any> = { url };
|
|
97
|
+
if (useTls) {
|
|
98
|
+
clientOpts.socket = { tls: true };
|
|
99
|
+
}
|
|
100
|
+
const password = options.password ?? getEnv("REDIS_PASSWORD");
|
|
101
|
+
if (password) {
|
|
102
|
+
clientOpts.password = password;
|
|
103
|
+
}
|
|
104
|
+
const username = options.username ?? getEnv("REDIS_USERNAME");
|
|
105
|
+
if (username) {
|
|
106
|
+
clientOpts.username = username;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const client = createClientFn(clientOpts);
|
|
82
110
|
|
|
83
111
|
if (typeof client.on === "function") {
|
|
84
112
|
client.on("error", (err: unknown) => {
|
package/src/src/utils/version.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { getEnv } from "../platform/compat/process.js";
|
|
|
3
3
|
|
|
4
4
|
// Keep in sync with deno.json version.
|
|
5
5
|
// scripts/release.ts updates this constant during releases.
|
|
6
|
-
export const VERSION = "0.1.
|
|
6
|
+
export const VERSION = "0.1.99";
|
|
7
7
|
|
|
8
8
|
export function normalizeVeryfrontVersion(version: string | undefined): string | undefined {
|
|
9
9
|
if (!version) return undefined;
|