veryfront 0.1.91 → 0.1.92
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 +1 -1
- package/esm/src/config/environment-config.js +1 -1
- package/esm/src/jobs/schemas.d.ts +14 -14
- package/esm/src/jobs/schemas.js +3 -3
- package/esm/src/observability/metrics/manager.js +2 -2
- package/esm/src/observability/tracing/otlp-setup.js +2 -2
- package/esm/src/platform/adapters/fs/veryfront/adapter.d.ts +1 -0
- package/esm/src/platform/adapters/fs/veryfront/adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/adapter.js +11 -5
- package/esm/src/proxy/logger.d.ts.map +1 -1
- package/esm/src/proxy/logger.js +2 -6
- package/esm/src/proxy/tracing.d.ts.map +1 -1
- package/esm/src/proxy/tracing.js +2 -5
- package/esm/src/proxy/version.d.ts +2 -0
- package/esm/src/proxy/version.d.ts.map +1 -0
- package/esm/src/proxy/version.js +18 -0
- package/esm/src/server/handlers/monitoring/health.handler.js +2 -2
- package/esm/src/utils/logger/logger.js +2 -2
- package/esm/src/utils/version.d.ts +9 -1
- package/esm/src/utils/version.d.ts.map +1 -1
- package/esm/src/utils/version.js +29 -2
- package/package.json +1 -1
- package/src/deno.js +1 -1
- package/src/src/config/environment-config.ts +1 -1
- package/src/src/jobs/schemas.ts +3 -3
- package/src/src/observability/metrics/manager.ts +2 -2
- package/src/src/observability/tracing/otlp-setup.ts +2 -2
- package/src/src/platform/adapters/fs/veryfront/adapter.ts +12 -5
- package/src/src/proxy/logger.ts +2 -8
- package/src/src/proxy/tracing.ts +2 -6
- package/src/src/proxy/version.ts +21 -0
- package/src/src/server/handlers/monitoring/health.handler.ts +2 -2
- package/src/src/utils/logger/logger.ts +2 -2
- package/src/src/utils/version.ts +37 -2
package/esm/deno.js
CHANGED
|
@@ -91,7 +91,7 @@ function readEnvSnapshot() {
|
|
|
91
91
|
v8MaxOldSpaceSize: v8MaxOldSpaceSizeRaw
|
|
92
92
|
? parseNumber(v8MaxOldSpaceSizeRaw, 0) || undefined
|
|
93
93
|
: undefined,
|
|
94
|
-
veryfrontVersion: getEnv("VERYFRONT_VERSION") || undefined,
|
|
94
|
+
veryfrontVersion: getEnv("VERYFRONT_VERSION") || getEnv("RELEASE_VERSION") || undefined,
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
export function initEnvironmentConfig() {
|
|
@@ -510,7 +510,7 @@ export declare const JobSchema: z.ZodObject<{
|
|
|
510
510
|
id: z.ZodString;
|
|
511
511
|
project_id: z.ZodString;
|
|
512
512
|
environment_id: z.ZodNullable<z.ZodString>;
|
|
513
|
-
branch_id: z.
|
|
513
|
+
branch_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
514
514
|
cron_job_id: z.ZodNullable<z.ZodString>;
|
|
515
515
|
batch_id: z.ZodNullable<z.ZodString>;
|
|
516
516
|
name: z.ZodString;
|
|
@@ -527,7 +527,7 @@ export declare const JobSchema: z.ZodObject<{
|
|
|
527
527
|
created_at: z.ZodString;
|
|
528
528
|
updated_at: z.ZodString;
|
|
529
529
|
} & {
|
|
530
|
-
failed_reason: z.
|
|
530
|
+
failed_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
531
531
|
kind: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<["knowledge_ingest"]>>>>;
|
|
532
532
|
failure_detail: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
533
533
|
result_summary: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
@@ -760,7 +760,6 @@ export declare const JobSchema: z.ZodObject<{
|
|
|
760
760
|
config: Record<string, unknown>;
|
|
761
761
|
name: string;
|
|
762
762
|
project_id: string;
|
|
763
|
-
branch_id: string | null;
|
|
764
763
|
batch_id: string | null;
|
|
765
764
|
kind: "knowledge_ingest" | null;
|
|
766
765
|
id: string;
|
|
@@ -820,7 +819,6 @@ export declare const JobSchema: z.ZodObject<{
|
|
|
820
819
|
backoff_limit: number;
|
|
821
820
|
completed_at: string | null;
|
|
822
821
|
created_by: string | null;
|
|
823
|
-
failed_reason: string | null;
|
|
824
822
|
failure_detail: string | null;
|
|
825
823
|
result_summary: {
|
|
826
824
|
kind: "knowledge_ingest";
|
|
@@ -835,6 +833,8 @@ export declare const JobSchema: z.ZodObject<{
|
|
|
835
833
|
kind: "artifacts";
|
|
836
834
|
artifact_count: number;
|
|
837
835
|
} | null;
|
|
836
|
+
branch_id?: string | null | undefined;
|
|
837
|
+
failed_reason?: string | null | undefined;
|
|
838
838
|
}, {
|
|
839
839
|
status: "failed" | "completed" | "canceled" | "submitted" | "working";
|
|
840
840
|
config: Record<string, unknown>;
|
|
@@ -920,7 +920,7 @@ export declare const JobListItemSchema: z.ZodObject<{
|
|
|
920
920
|
id: z.ZodString;
|
|
921
921
|
project_id: z.ZodString;
|
|
922
922
|
environment_id: z.ZodNullable<z.ZodString>;
|
|
923
|
-
branch_id: z.
|
|
923
|
+
branch_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
924
924
|
cron_job_id: z.ZodNullable<z.ZodString>;
|
|
925
925
|
batch_id: z.ZodNullable<z.ZodString>;
|
|
926
926
|
name: z.ZodString;
|
|
@@ -981,7 +981,6 @@ export declare const JobListItemSchema: z.ZodObject<{
|
|
|
981
981
|
config: Record<string, unknown>;
|
|
982
982
|
name: string;
|
|
983
983
|
project_id: string;
|
|
984
|
-
branch_id: string | null;
|
|
985
984
|
batch_id: string | null;
|
|
986
985
|
kind: "knowledge_ingest" | null;
|
|
987
986
|
id: string;
|
|
@@ -1011,6 +1010,7 @@ export declare const JobListItemSchema: z.ZodObject<{
|
|
|
1011
1010
|
kind: "artifacts";
|
|
1012
1011
|
artifact_count: number;
|
|
1013
1012
|
} | null;
|
|
1013
|
+
branch_id?: string | null | undefined;
|
|
1014
1014
|
}, {
|
|
1015
1015
|
status: "failed" | "completed" | "canceled" | "submitted" | "working";
|
|
1016
1016
|
config: Record<string, unknown>;
|
|
@@ -1052,7 +1052,7 @@ export declare const PaginatedJobsResponseSchema: z.ZodObject<{
|
|
|
1052
1052
|
id: z.ZodString;
|
|
1053
1053
|
project_id: z.ZodString;
|
|
1054
1054
|
environment_id: z.ZodNullable<z.ZodString>;
|
|
1055
|
-
branch_id: z.
|
|
1055
|
+
branch_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1056
1056
|
cron_job_id: z.ZodNullable<z.ZodString>;
|
|
1057
1057
|
batch_id: z.ZodNullable<z.ZodString>;
|
|
1058
1058
|
name: z.ZodString;
|
|
@@ -1113,7 +1113,6 @@ export declare const PaginatedJobsResponseSchema: z.ZodObject<{
|
|
|
1113
1113
|
config: Record<string, unknown>;
|
|
1114
1114
|
name: string;
|
|
1115
1115
|
project_id: string;
|
|
1116
|
-
branch_id: string | null;
|
|
1117
1116
|
batch_id: string | null;
|
|
1118
1117
|
kind: "knowledge_ingest" | null;
|
|
1119
1118
|
id: string;
|
|
@@ -1143,6 +1142,7 @@ export declare const PaginatedJobsResponseSchema: z.ZodObject<{
|
|
|
1143
1142
|
kind: "artifacts";
|
|
1144
1143
|
artifact_count: number;
|
|
1145
1144
|
} | null;
|
|
1145
|
+
branch_id?: string | null | undefined;
|
|
1146
1146
|
}, {
|
|
1147
1147
|
status: "failed" | "completed" | "canceled" | "submitted" | "working";
|
|
1148
1148
|
config: Record<string, unknown>;
|
|
@@ -1201,7 +1201,6 @@ export declare const PaginatedJobsResponseSchema: z.ZodObject<{
|
|
|
1201
1201
|
config: Record<string, unknown>;
|
|
1202
1202
|
name: string;
|
|
1203
1203
|
project_id: string;
|
|
1204
|
-
branch_id: string | null;
|
|
1205
1204
|
batch_id: string | null;
|
|
1206
1205
|
kind: "knowledge_ingest" | null;
|
|
1207
1206
|
id: string;
|
|
@@ -1231,6 +1230,7 @@ export declare const PaginatedJobsResponseSchema: z.ZodObject<{
|
|
|
1231
1230
|
kind: "artifacts";
|
|
1232
1231
|
artifact_count: number;
|
|
1233
1232
|
} | null;
|
|
1233
|
+
branch_id?: string | null | undefined;
|
|
1234
1234
|
}[];
|
|
1235
1235
|
page_info: {
|
|
1236
1236
|
self: string | null;
|
|
@@ -2054,7 +2054,7 @@ export declare const CronJobSchema: z.ZodObject<{
|
|
|
2054
2054
|
id: z.ZodString;
|
|
2055
2055
|
project_id: z.ZodString;
|
|
2056
2056
|
environment_id: z.ZodNullable<z.ZodString>;
|
|
2057
|
-
branch_id: z.
|
|
2057
|
+
branch_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2058
2058
|
name: z.ZodString;
|
|
2059
2059
|
status: z.ZodEnum<["active", "paused", "deleting"]>;
|
|
2060
2060
|
target: z.ZodString;
|
|
@@ -2074,7 +2074,6 @@ export declare const CronJobSchema: z.ZodObject<{
|
|
|
2074
2074
|
config: Record<string, unknown>;
|
|
2075
2075
|
name: string;
|
|
2076
2076
|
project_id: string;
|
|
2077
|
-
branch_id: string | null;
|
|
2078
2077
|
id: string;
|
|
2079
2078
|
updated_at: string;
|
|
2080
2079
|
created_at: string;
|
|
@@ -2088,6 +2087,7 @@ export declare const CronJobSchema: z.ZodObject<{
|
|
|
2088
2087
|
concurrency_policy: string;
|
|
2089
2088
|
last_scheduled_at: string | null;
|
|
2090
2089
|
last_successful_at: string | null;
|
|
2090
|
+
branch_id?: string | null | undefined;
|
|
2091
2091
|
}, {
|
|
2092
2092
|
status: "deleting" | "active" | "paused";
|
|
2093
2093
|
config: Record<string, unknown>;
|
|
@@ -2113,7 +2113,7 @@ export declare const PaginatedCronJobsResponseSchema: z.ZodObject<{
|
|
|
2113
2113
|
id: z.ZodString;
|
|
2114
2114
|
project_id: z.ZodString;
|
|
2115
2115
|
environment_id: z.ZodNullable<z.ZodString>;
|
|
2116
|
-
branch_id: z.
|
|
2116
|
+
branch_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2117
2117
|
name: z.ZodString;
|
|
2118
2118
|
status: z.ZodEnum<["active", "paused", "deleting"]>;
|
|
2119
2119
|
target: z.ZodString;
|
|
@@ -2133,7 +2133,6 @@ export declare const PaginatedCronJobsResponseSchema: z.ZodObject<{
|
|
|
2133
2133
|
config: Record<string, unknown>;
|
|
2134
2134
|
name: string;
|
|
2135
2135
|
project_id: string;
|
|
2136
|
-
branch_id: string | null;
|
|
2137
2136
|
id: string;
|
|
2138
2137
|
updated_at: string;
|
|
2139
2138
|
created_at: string;
|
|
@@ -2147,6 +2146,7 @@ export declare const PaginatedCronJobsResponseSchema: z.ZodObject<{
|
|
|
2147
2146
|
concurrency_policy: string;
|
|
2148
2147
|
last_scheduled_at: string | null;
|
|
2149
2148
|
last_successful_at: string | null;
|
|
2149
|
+
branch_id?: string | null | undefined;
|
|
2150
2150
|
}, {
|
|
2151
2151
|
status: "deleting" | "active" | "paused";
|
|
2152
2152
|
config: Record<string, unknown>;
|
|
@@ -2189,7 +2189,6 @@ export declare const PaginatedCronJobsResponseSchema: z.ZodObject<{
|
|
|
2189
2189
|
config: Record<string, unknown>;
|
|
2190
2190
|
name: string;
|
|
2191
2191
|
project_id: string;
|
|
2192
|
-
branch_id: string | null;
|
|
2193
2192
|
id: string;
|
|
2194
2193
|
updated_at: string;
|
|
2195
2194
|
created_at: string;
|
|
@@ -2203,6 +2202,7 @@ export declare const PaginatedCronJobsResponseSchema: z.ZodObject<{
|
|
|
2203
2202
|
concurrency_policy: string;
|
|
2204
2203
|
last_scheduled_at: string | null;
|
|
2205
2204
|
last_successful_at: string | null;
|
|
2205
|
+
branch_id?: string | null | undefined;
|
|
2206
2206
|
}[];
|
|
2207
2207
|
page_info: {
|
|
2208
2208
|
self: string | null;
|
package/esm/src/jobs/schemas.js
CHANGED
|
@@ -101,7 +101,7 @@ const BaseJobSchema = z.object({
|
|
|
101
101
|
id: z.string().uuid(),
|
|
102
102
|
project_id: z.string().uuid(),
|
|
103
103
|
environment_id: z.string().uuid().nullable(),
|
|
104
|
-
branch_id: z.string().nullable().optional()
|
|
104
|
+
branch_id: z.string().nullable().optional(),
|
|
105
105
|
cron_job_id: z.string().uuid().nullable(),
|
|
106
106
|
batch_id: z.string().uuid().nullable(),
|
|
107
107
|
name: z.string(),
|
|
@@ -119,7 +119,7 @@ const BaseJobSchema = z.object({
|
|
|
119
119
|
updated_at: z.string(),
|
|
120
120
|
});
|
|
121
121
|
export const JobSchema = BaseJobSchema.extend({
|
|
122
|
-
failed_reason: z.string().nullable().optional()
|
|
122
|
+
failed_reason: z.string().nullable().optional(),
|
|
123
123
|
kind: JobKindSchema.optional().default(null),
|
|
124
124
|
failure_detail: z.string().nullable().optional().default(null),
|
|
125
125
|
result_summary: JobResultSummarySchema.optional().default(null),
|
|
@@ -214,7 +214,7 @@ export const CronJobSchema = z.object({
|
|
|
214
214
|
id: z.string().uuid(),
|
|
215
215
|
project_id: z.string().uuid(),
|
|
216
216
|
environment_id: z.string().uuid().nullable(),
|
|
217
|
-
branch_id: z.string().nullable().optional()
|
|
217
|
+
branch_id: z.string().nullable().optional(),
|
|
218
218
|
name: z.string(),
|
|
219
219
|
status: CronJobStatusSchema,
|
|
220
220
|
target: z.string(),
|
|
@@ -6,7 +6,7 @@ import { serverLogger } from "../../utils/index.js";
|
|
|
6
6
|
import { loadConfig } from "./config.js";
|
|
7
7
|
import { initializeInstruments } from "../instruments/index.js";
|
|
8
8
|
import { MetricsRecorder } from "./recorder.js";
|
|
9
|
-
import {
|
|
9
|
+
import { RUNTIME_VERSION } from "../../utils/version.js";
|
|
10
10
|
const logger = serverLogger.component("metrics");
|
|
11
11
|
/**
|
|
12
12
|
* Metrics manager class
|
|
@@ -68,7 +68,7 @@ export class MetricsManager {
|
|
|
68
68
|
}
|
|
69
69
|
try {
|
|
70
70
|
this.api = await import("@opentelemetry/api");
|
|
71
|
-
this.meter = this.api.metrics.getMeter(finalConfig.prefix,
|
|
71
|
+
this.meter = this.api.metrics.getMeter(finalConfig.prefix, RUNTIME_VERSION);
|
|
72
72
|
this.instruments = initializeInstruments(this.meter, finalConfig, this.runtimeState);
|
|
73
73
|
this.recorder.instruments = this.instruments;
|
|
74
74
|
logger.info("OpenTelemetry metrics initialized", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getOtelTracingConfig } from "../../config/env.js";
|
|
2
2
|
import { serverLogger } from "../../utils/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { RUNTIME_VERSION } from "../../utils/version.js";
|
|
4
4
|
const logger = serverLogger.component("otel");
|
|
5
5
|
let initialized = false;
|
|
6
6
|
let tracerProvider = null;
|
|
@@ -76,7 +76,7 @@ export async function initializeOTLP() {
|
|
|
76
76
|
const { AsyncLocalStorageContextManager } = await import("@opentelemetry/context-async-hooks");
|
|
77
77
|
const resource = new Resource({
|
|
78
78
|
[ATTR_SERVICE_NAME]: config.serviceName,
|
|
79
|
-
[ATTR_SERVICE_VERSION]:
|
|
79
|
+
[ATTR_SERVICE_VERSION]: RUNTIME_VERSION,
|
|
80
80
|
});
|
|
81
81
|
const endpointBase = config.endpoint.replace(/\/$/, "");
|
|
82
82
|
const exporter = new OTLPTraceExporter({
|
|
@@ -32,6 +32,7 @@ export declare class VeryfrontFSAdapter implements FSAdapter {
|
|
|
32
32
|
constructor(config: FSAdapterConfig);
|
|
33
33
|
initialize(): Promise<void>;
|
|
34
34
|
private isPersistentCacheInvalidated;
|
|
35
|
+
private shouldBackgroundPregenerateStyles;
|
|
35
36
|
private scheduleFileListWarmup;
|
|
36
37
|
getPokeMetrics(): {
|
|
37
38
|
received: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/fs/veryfront/adapter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,UAAU,EAEV,cAAc,EACd,SAAS,EACT,eAAe,EAEf,sBAAsB,EACvB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,eAAe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G,SAAS;IAWrD,0BAA0B,CAC9B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IA0BvD,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIpC,iBAAiB,IAAI,IAAI;IAIzB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAK7C,gBAAgB,IAAI,MAAM,GAAG,IAAI;IAIjC,kBAAkB,IAAI,IAAI;IAK1B,iBAAiB,CAAC,OAAO,EAAE,sBAAsB,GAAG,IAAI;IAoCxD,iBAAiB,IAAI,sBAAsB,GAAG,IAAI;IAWlD,SAAS,IAAI,kBAAkB;YAIjB,iBAAiB;IAK/B;;;;;OAKG;YACW,uBAAuB;CAkEtC"}
|
|
@@ -246,10 +246,10 @@ export class VeryfrontFSAdapter {
|
|
|
246
246
|
sourceFiles: fileSummary.sourceFiles,
|
|
247
247
|
sourceFilesWithContent: fileSummary.sourceFilesWithContent,
|
|
248
248
|
});
|
|
249
|
-
// Trigger CSS pre-generation after the initial file snapshot is ready
|
|
250
|
-
//
|
|
251
|
-
//
|
|
252
|
-
if (fileSummary.sourceFilesWithContent > 0) {
|
|
249
|
+
// Trigger CSS pre-generation after the initial file snapshot is ready for
|
|
250
|
+
// published contexts. Branch previews should first try remote metadata
|
|
251
|
+
// recovery on cold starts instead of repopulating the prepared cache here.
|
|
252
|
+
if (fileSummary.sourceFilesWithContent > 0 && this.shouldBackgroundPregenerateStyles()) {
|
|
253
253
|
this.triggerCSSPregeneration(files).catch(() => {
|
|
254
254
|
// Error already logged in triggerCSSPregeneration
|
|
255
255
|
});
|
|
@@ -293,6 +293,12 @@ export class VeryfrontFSAdapter {
|
|
|
293
293
|
isPersistentCacheInvalidated(prefix) {
|
|
294
294
|
return isPrefixBeingInvalidated(prefix);
|
|
295
295
|
}
|
|
296
|
+
shouldBackgroundPregenerateStyles() {
|
|
297
|
+
// Branch previews should recover the last registered stylesheet artifact on
|
|
298
|
+
// cold starts before rebuilding CSS locally. Live edit pokes still
|
|
299
|
+
// pregenerate through the WebSocket path after branch content changes.
|
|
300
|
+
return this.contentContext?.sourceType !== "branch";
|
|
301
|
+
}
|
|
296
302
|
scheduleFileListWarmup(reason, cacheKey) {
|
|
297
303
|
if (!this.initialized || !this.contentContext)
|
|
298
304
|
return;
|
|
@@ -328,7 +334,7 @@ export class VeryfrontFSAdapter {
|
|
|
328
334
|
const files = await fetchFileListForContext(this.client, warmupContext);
|
|
329
335
|
await this.cache.setAsync(effectiveCacheKey, files);
|
|
330
336
|
const fileSummary = summarizeFileList(files);
|
|
331
|
-
if (fileSummary.sourceFilesWithContent > 0) {
|
|
337
|
+
if (fileSummary.sourceFilesWithContent > 0 && this.shouldBackgroundPregenerateStyles()) {
|
|
332
338
|
this.triggerCSSPregeneration(files).catch(() => {
|
|
333
339
|
// Error already logged in triggerCSSPregeneration
|
|
334
340
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/src/proxy/logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/src/proxy/logger.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAID;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,EAC1C,OAAO,EAAE,mBAAmB,E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;IAI9D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAI9D,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI;IAC7C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI;IAwB/E,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,gBAAgB;CAG1D;AAED,eAAO,MAAM,WAAW,aAAoB,CAAC"}
|
package/esm/src/proxy/logger.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
// Import version from root deno.json (the source of truth)
|
|
2
1
|
import * as dntShim from "../../_dnt.shims.js";
|
|
3
|
-
import denoConfig from "../../deno.js";
|
|
4
2
|
import { getEnv } from "./env.js";
|
|
5
3
|
import { getTraceContext } from "./tracing.js";
|
|
6
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5
|
+
import { PROXY_RUNTIME_VERSION } from "./version.js";
|
|
7
6
|
const requestContextStore = new AsyncLocalStorage();
|
|
8
7
|
/**
|
|
9
8
|
* Run a function with proxy request context.
|
|
@@ -18,9 +17,6 @@ export function runWithProxyRequestContext(context, fn) {
|
|
|
18
17
|
function getProxyRequestContext() {
|
|
19
18
|
return requestContextStore.getStore();
|
|
20
19
|
}
|
|
21
|
-
// Get version from environment variable or root deno.json
|
|
22
|
-
const VERYFRONT_VERSION = getEnv("VERYFRONT_VERSION") ??
|
|
23
|
-
(typeof denoConfig.version === "string" ? denoConfig.version : "0.0.0");
|
|
24
20
|
const LOG_LEVEL_ORDER = {
|
|
25
21
|
debug: 0,
|
|
26
22
|
info: 1,
|
|
@@ -208,7 +204,7 @@ class ProxyLogger {
|
|
|
208
204
|
timestamp: new Date().toISOString(),
|
|
209
205
|
level,
|
|
210
206
|
service: "proxy",
|
|
211
|
-
veryfrontVersion:
|
|
207
|
+
veryfrontVersion: PROXY_RUNTIME_VERSION,
|
|
212
208
|
message,
|
|
213
209
|
...(traceCtx.traceId && { traceId: traceCtx.traceId, spanId: traceCtx.spanId }),
|
|
214
210
|
// Include request context fields at top level (like renderer logs)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../../src/src/proxy/tracing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAG/C,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAU,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../../src/src/proxy/tracing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAG/C,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAU,MAAM,oBAAoB,CAAC;AA6DhE,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAyD5D;AAED,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CASlD;AAOD,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,GAAG,OAAO,GAAG,SAAS,CAgB5E;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,GAAG,IAAI,CAgB5D;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,aAAa,CAAC,EAAE,OAAO,GACtB;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAMzC;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAiBvF;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAGrF;AAWD,wBAAgB,eAAe,IAAI;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAIvE;AAED;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;CAKjB,CAAC;AAEX;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,CAAC,EAC9B,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GACrD,OAAO,CAAC,CAAC,CAAC,CA0BZ"}
|
package/esm/src/proxy/tracing.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import denoConfig from "../../deno.js";
|
|
2
1
|
import { getEnv } from "./env.js";
|
|
3
2
|
import { proxyLogger } from "./logger.js";
|
|
4
|
-
|
|
5
|
-
const VERYFRONT_VERSION = getEnv("VERYFRONT_VERSION") ??
|
|
6
|
-
(typeof denoConfig.version === "string" ? denoConfig.version : "0.0.0");
|
|
3
|
+
import { PROXY_RUNTIME_VERSION } from "./version.js";
|
|
7
4
|
let initialized = false;
|
|
8
5
|
let tracerProvider = null;
|
|
9
6
|
let tracer = null;
|
|
@@ -72,7 +69,7 @@ export async function initializeOTLPWithApis() {
|
|
|
72
69
|
const resourceAttrs = parseResourceAttributes(getEnv("OTEL_RESOURCE_ATTRIBUTES"));
|
|
73
70
|
const resource = new Resource({
|
|
74
71
|
[ATTR_SERVICE_NAME]: config.serviceName,
|
|
75
|
-
[ATTR_SERVICE_VERSION]:
|
|
72
|
+
[ATTR_SERVICE_VERSION]: PROXY_RUNTIME_VERSION,
|
|
76
73
|
...resourceAttrs,
|
|
77
74
|
});
|
|
78
75
|
const exporter = new OTLPTraceExporter({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/src/proxy/version.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,qBAAqB,QAIzB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import denoConfig from "../../deno.js";
|
|
2
|
+
import { getEnv } from "./env.js";
|
|
3
|
+
function normalizeVersion(version) {
|
|
4
|
+
if (!version)
|
|
5
|
+
return undefined;
|
|
6
|
+
return version.replace(/^v(?=\d)/, "");
|
|
7
|
+
}
|
|
8
|
+
function getVersionEnv(name) {
|
|
9
|
+
try {
|
|
10
|
+
return getEnv(name);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export const PROXY_RUNTIME_VERSION = normalizeVersion(getVersionEnv("VERYFRONT_VERSION") ?? getVersionEnv("RELEASE_VERSION")) ??
|
|
17
|
+
normalizeVersion(typeof denoConfig.version === "string" ? denoConfig.version : undefined) ??
|
|
18
|
+
"0.0.0";
|
|
@@ -2,7 +2,7 @@ import { BaseHandler } from "../response/base.js";
|
|
|
2
2
|
import { joinPath } from "../../../utils/path-utils.js";
|
|
3
3
|
import { HTTP_OK, HTTP_UNAVAILABLE, PRIORITY_HIGH } from "../../../utils/constants/index.js";
|
|
4
4
|
import { isTracingDegraded, isTracingEnabled } from "../../../observability/tracing/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { RUNTIME_VERSION } from "../../../utils/version.js";
|
|
6
6
|
let serverInitialized = false;
|
|
7
7
|
export function setServerInitialized(ready) {
|
|
8
8
|
serverInitialized = ready;
|
|
@@ -57,7 +57,7 @@ export class HealthHandler extends BaseHandler {
|
|
|
57
57
|
status: tracingDegraded ? "degraded" : "ok",
|
|
58
58
|
timestamp: new Date().toISOString(),
|
|
59
59
|
mode: hasStaticBuild ? "static+ssr" : "ssr",
|
|
60
|
-
version:
|
|
60
|
+
version: RUNTIME_VERSION,
|
|
61
61
|
tracing: {
|
|
62
62
|
enabled: isTracingEnabled(),
|
|
63
63
|
degraded: tracingDegraded,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as dntShim from "../../../_dnt.shims.js";
|
|
2
2
|
import { getEnv } from "../../platform/compat/process.js";
|
|
3
3
|
import { hasDenoRuntime, hasNodeProcess } from "../runtime-guards.js";
|
|
4
|
-
import {
|
|
4
|
+
import { RUNTIME_VERSION } from "../version.js";
|
|
5
5
|
import { ANSI, colorize, formatContextText, formatTimestamp, LEVEL_COLORS, LEVEL_GLYPHS, padTag, serializeError, } from "./core.js";
|
|
6
6
|
export var LogLevel;
|
|
7
7
|
(function (LogLevel) {
|
|
@@ -165,7 +165,7 @@ class ConsoleLogger {
|
|
|
165
165
|
timestamp: new Date().toISOString(),
|
|
166
166
|
level,
|
|
167
167
|
service: this.prefix.toLowerCase(),
|
|
168
|
-
veryfrontVersion:
|
|
168
|
+
veryfrontVersion: RUNTIME_VERSION,
|
|
169
169
|
message,
|
|
170
170
|
};
|
|
171
171
|
if (this.componentName)
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.92";
|
|
2
|
+
export declare function normalizeVeryfrontVersion(version: string | undefined): string | undefined;
|
|
3
|
+
export declare function resolveRuntimeVersion(options?: {
|
|
4
|
+
veryfrontVersion?: string;
|
|
5
|
+
releaseVersion?: string;
|
|
6
|
+
denoVersion?: string;
|
|
7
|
+
fallbackVersion?: string;
|
|
8
|
+
}): string;
|
|
9
|
+
export declare const RUNTIME_VERSION: string;
|
|
2
10
|
export declare const SERVER_START_TIME: number;
|
|
3
11
|
export interface BuildVersion {
|
|
4
12
|
framework: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/src/utils/version.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/src/utils/version.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,OAAO,WAAW,CAAC;AAEhC,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAGzF;AAUD,wBAAgB,qBAAqB,CAAC,OAAO,GAAE;IAC7C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,MAAM,CAKd;AAED,eAAO,MAAM,eAAe,QAK1B,CAAC;AAEH,eAAO,MAAM,iBAAiB,EAAE,MAAmB,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,kBAAkB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,YAAY,CAM1E"}
|
package/esm/src/utils/version.js
CHANGED
|
@@ -1,10 +1,37 @@
|
|
|
1
|
+
import denoConfig from "../../deno.js";
|
|
2
|
+
import { getEnv } from "../platform/compat/process.js";
|
|
1
3
|
// Keep in sync with deno.json version.
|
|
2
4
|
// scripts/release.ts updates this constant during releases.
|
|
3
|
-
export const VERSION = "0.1.
|
|
5
|
+
export const VERSION = "0.1.92";
|
|
6
|
+
export function normalizeVeryfrontVersion(version) {
|
|
7
|
+
if (!version)
|
|
8
|
+
return undefined;
|
|
9
|
+
return version.replace(/^v(?=\d)/, "");
|
|
10
|
+
}
|
|
11
|
+
function getVersionEnv(name) {
|
|
12
|
+
try {
|
|
13
|
+
return getEnv(name);
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function resolveRuntimeVersion(options = {}) {
|
|
20
|
+
return normalizeVeryfrontVersion(options.veryfrontVersion ?? options.releaseVersion) ??
|
|
21
|
+
normalizeVeryfrontVersion(options.denoVersion) ??
|
|
22
|
+
options.fallbackVersion ??
|
|
23
|
+
VERSION;
|
|
24
|
+
}
|
|
25
|
+
export const RUNTIME_VERSION = resolveRuntimeVersion({
|
|
26
|
+
veryfrontVersion: getVersionEnv("VERYFRONT_VERSION"),
|
|
27
|
+
releaseVersion: getVersionEnv("RELEASE_VERSION"),
|
|
28
|
+
denoVersion: typeof denoConfig.version === "string" ? denoConfig.version : undefined,
|
|
29
|
+
fallbackVersion: VERSION,
|
|
30
|
+
});
|
|
4
31
|
export const SERVER_START_TIME = Date.now();
|
|
5
32
|
export function createBuildVersion(projectUpdatedAt) {
|
|
6
33
|
return {
|
|
7
|
-
framework:
|
|
34
|
+
framework: RUNTIME_VERSION,
|
|
8
35
|
serverStart: SERVER_START_TIME,
|
|
9
36
|
projectUpdated: projectUpdatedAt,
|
|
10
37
|
};
|
package/package.json
CHANGED
package/src/deno.js
CHANGED
|
@@ -188,7 +188,7 @@ function readEnvSnapshot(): EnvironmentConfig {
|
|
|
188
188
|
? parseNumber(v8MaxOldSpaceSizeRaw, 0) || undefined
|
|
189
189
|
: undefined,
|
|
190
190
|
|
|
191
|
-
veryfrontVersion: getEnv("VERYFRONT_VERSION") || undefined,
|
|
191
|
+
veryfrontVersion: getEnv("VERYFRONT_VERSION") || getEnv("RELEASE_VERSION") || undefined,
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
194
|
|
package/src/src/jobs/schemas.ts
CHANGED
|
@@ -115,7 +115,7 @@ const BaseJobSchema = z.object({
|
|
|
115
115
|
id: z.string().uuid(),
|
|
116
116
|
project_id: z.string().uuid(),
|
|
117
117
|
environment_id: z.string().uuid().nullable(),
|
|
118
|
-
branch_id: z.string().nullable().optional()
|
|
118
|
+
branch_id: z.string().nullable().optional(),
|
|
119
119
|
cron_job_id: z.string().uuid().nullable(),
|
|
120
120
|
batch_id: z.string().uuid().nullable(),
|
|
121
121
|
name: z.string(),
|
|
@@ -134,7 +134,7 @@ const BaseJobSchema = z.object({
|
|
|
134
134
|
});
|
|
135
135
|
|
|
136
136
|
export const JobSchema = BaseJobSchema.extend({
|
|
137
|
-
failed_reason: z.string().nullable().optional()
|
|
137
|
+
failed_reason: z.string().nullable().optional(),
|
|
138
138
|
kind: JobKindSchema.optional().default(null),
|
|
139
139
|
failure_detail: z.string().nullable().optional().default(null),
|
|
140
140
|
result_summary: JobResultSummarySchema.optional().default(null),
|
|
@@ -242,7 +242,7 @@ export const CronJobSchema = z.object({
|
|
|
242
242
|
id: z.string().uuid(),
|
|
243
243
|
project_id: z.string().uuid(),
|
|
244
244
|
environment_id: z.string().uuid().nullable(),
|
|
245
|
-
branch_id: z.string().nullable().optional()
|
|
245
|
+
branch_id: z.string().nullable().optional(),
|
|
246
246
|
name: z.string(),
|
|
247
247
|
status: CronJobStatusSchema,
|
|
248
248
|
target: z.string(),
|
|
@@ -10,7 +10,7 @@ import { loadConfig } from "./config.js";
|
|
|
10
10
|
import { initializeInstruments } from "../instruments/index.js";
|
|
11
11
|
import { MetricsRecorder } from "./recorder.js";
|
|
12
12
|
import type { MetricsConfig, MetricsInstruments, OpenTelemetryAPI, RuntimeState } from "./types.js";
|
|
13
|
-
import {
|
|
13
|
+
import { RUNTIME_VERSION } from "../../utils/version.js";
|
|
14
14
|
|
|
15
15
|
const logger = serverLogger.component("metrics");
|
|
16
16
|
|
|
@@ -80,7 +80,7 @@ export class MetricsManager {
|
|
|
80
80
|
|
|
81
81
|
try {
|
|
82
82
|
this.api = await import("@opentelemetry/api");
|
|
83
|
-
this.meter = this.api.metrics.getMeter(finalConfig.prefix,
|
|
83
|
+
this.meter = this.api.metrics.getMeter(finalConfig.prefix, RUNTIME_VERSION);
|
|
84
84
|
|
|
85
85
|
this.instruments = initializeInstruments(this.meter, finalConfig, this.runtimeState);
|
|
86
86
|
this.recorder.instruments = this.instruments;
|
|
@@ -13,7 +13,7 @@ import * as dntShim from "../../../_dnt.shims.js";
|
|
|
13
13
|
|
|
14
14
|
import { getOtelTracingConfig } from "../../config/env.js";
|
|
15
15
|
import { serverLogger } from "../../utils/index.js";
|
|
16
|
-
import {
|
|
16
|
+
import { RUNTIME_VERSION } from "../../utils/version.js";
|
|
17
17
|
|
|
18
18
|
const logger = serverLogger.component("otel");
|
|
19
19
|
|
|
@@ -118,7 +118,7 @@ export async function initializeOTLP(): Promise<void> {
|
|
|
118
118
|
|
|
119
119
|
const resource = new Resource({
|
|
120
120
|
[ATTR_SERVICE_NAME]: config.serviceName,
|
|
121
|
-
[ATTR_SERVICE_VERSION]:
|
|
121
|
+
[ATTR_SERVICE_VERSION]: RUNTIME_VERSION,
|
|
122
122
|
});
|
|
123
123
|
|
|
124
124
|
const endpointBase = config.endpoint.replace(/\/$/, "");
|
|
@@ -350,10 +350,10 @@ export class VeryfrontFSAdapter implements FSAdapter {
|
|
|
350
350
|
sourceFilesWithContent: fileSummary.sourceFilesWithContent,
|
|
351
351
|
});
|
|
352
352
|
|
|
353
|
-
// Trigger CSS pre-generation after the initial file snapshot is ready
|
|
354
|
-
//
|
|
355
|
-
//
|
|
356
|
-
if (fileSummary.sourceFilesWithContent > 0) {
|
|
353
|
+
// Trigger CSS pre-generation after the initial file snapshot is ready for
|
|
354
|
+
// published contexts. Branch previews should first try remote metadata
|
|
355
|
+
// recovery on cold starts instead of repopulating the prepared cache here.
|
|
356
|
+
if (fileSummary.sourceFilesWithContent > 0 && this.shouldBackgroundPregenerateStyles()) {
|
|
357
357
|
this.triggerCSSPregeneration(files).catch(() => {
|
|
358
358
|
// Error already logged in triggerCSSPregeneration
|
|
359
359
|
});
|
|
@@ -403,6 +403,13 @@ export class VeryfrontFSAdapter implements FSAdapter {
|
|
|
403
403
|
return isPrefixBeingInvalidated(prefix);
|
|
404
404
|
}
|
|
405
405
|
|
|
406
|
+
private shouldBackgroundPregenerateStyles(): boolean {
|
|
407
|
+
// Branch previews should recover the last registered stylesheet artifact on
|
|
408
|
+
// cold starts before rebuilding CSS locally. Live edit pokes still
|
|
409
|
+
// pregenerate through the WebSocket path after branch content changes.
|
|
410
|
+
return this.contentContext?.sourceType !== "branch";
|
|
411
|
+
}
|
|
412
|
+
|
|
406
413
|
private scheduleFileListWarmup(reason: string, cacheKey?: string): void {
|
|
407
414
|
if (!this.initialized || !this.contentContext) return;
|
|
408
415
|
|
|
@@ -446,7 +453,7 @@ export class VeryfrontFSAdapter implements FSAdapter {
|
|
|
446
453
|
await this.cache.setAsync(effectiveCacheKey, files);
|
|
447
454
|
const fileSummary = summarizeFileList(files);
|
|
448
455
|
|
|
449
|
-
if (fileSummary.sourceFilesWithContent > 0) {
|
|
456
|
+
if (fileSummary.sourceFilesWithContent > 0 && this.shouldBackgroundPregenerateStyles()) {
|
|
450
457
|
this.triggerCSSPregeneration(files).catch(() => {
|
|
451
458
|
// Error already logged in triggerCSSPregeneration
|
|
452
459
|
});
|
package/src/src/proxy/logger.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
// Import version from root deno.json (the source of truth)
|
|
2
1
|
import * as dntShim from "../../_dnt.shims.js";
|
|
3
|
-
|
|
4
|
-
import denoConfig from "../../deno.js";
|
|
5
2
|
import { getEnv } from "./env.js";
|
|
6
3
|
import { getTraceContext } from "./tracing.js";
|
|
7
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5
|
+
import { PROXY_RUNTIME_VERSION } from "./version.js";
|
|
8
6
|
|
|
9
7
|
// NOTE: Formatting utilities are INLINED below instead of imported from ../utils/logger/core.ts
|
|
10
8
|
// because the proxy Docker build only copies src/proxy/ and has no access to src/utils/.
|
|
@@ -45,10 +43,6 @@ function getProxyRequestContext(): ProxyRequestContext | undefined {
|
|
|
45
43
|
return requestContextStore.getStore();
|
|
46
44
|
}
|
|
47
45
|
|
|
48
|
-
// Get version from environment variable or root deno.json
|
|
49
|
-
const VERYFRONT_VERSION: string = getEnv("VERYFRONT_VERSION") ??
|
|
50
|
-
(typeof denoConfig.version === "string" ? denoConfig.version : "0.0.0");
|
|
51
|
-
|
|
52
46
|
export type LogLevel = "debug" | "info" | "warn" | "error";
|
|
53
47
|
|
|
54
48
|
const LOG_LEVEL_ORDER: Record<LogLevel, number> = {
|
|
@@ -295,7 +289,7 @@ class ProxyLogger {
|
|
|
295
289
|
timestamp: new Date().toISOString(),
|
|
296
290
|
level,
|
|
297
291
|
service: "proxy",
|
|
298
|
-
veryfrontVersion:
|
|
292
|
+
veryfrontVersion: PROXY_RUNTIME_VERSION,
|
|
299
293
|
message,
|
|
300
294
|
...(traceCtx.traceId && { traceId: traceCtx.traceId, spanId: traceCtx.spanId }),
|
|
301
295
|
// Include request context fields at top level (like renderer logs)
|
package/src/src/proxy/tracing.ts
CHANGED
|
@@ -6,13 +6,9 @@ import * as dntShim from "../../_dnt.shims.js";
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
import type { Context, Span, Tracer } from "@opentelemetry/api";
|
|
9
|
-
import denoConfig from "../../deno.js";
|
|
10
9
|
import { getEnv } from "./env.js";
|
|
11
10
|
import { proxyLogger } from "./logger.js";
|
|
12
|
-
|
|
13
|
-
// Get version from environment variable or root deno.json
|
|
14
|
-
const VERYFRONT_VERSION: string = getEnv("VERYFRONT_VERSION") ??
|
|
15
|
-
(typeof denoConfig.version === "string" ? denoConfig.version : "0.0.0");
|
|
11
|
+
import { PROXY_RUNTIME_VERSION } from "./version.js";
|
|
16
12
|
|
|
17
13
|
let initialized = false;
|
|
18
14
|
let tracerProvider: { shutdown: () => Promise<void> } | null = null;
|
|
@@ -100,7 +96,7 @@ export async function initializeOTLPWithApis(): Promise<void> {
|
|
|
100
96
|
const resourceAttrs = parseResourceAttributes(getEnv("OTEL_RESOURCE_ATTRIBUTES"));
|
|
101
97
|
const resource = new Resource({
|
|
102
98
|
[ATTR_SERVICE_NAME]: config.serviceName,
|
|
103
|
-
[ATTR_SERVICE_VERSION]:
|
|
99
|
+
[ATTR_SERVICE_VERSION]: PROXY_RUNTIME_VERSION,
|
|
104
100
|
...resourceAttrs,
|
|
105
101
|
});
|
|
106
102
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import denoConfig from "../../deno.js";
|
|
2
|
+
import { getEnv } from "./env.js";
|
|
3
|
+
|
|
4
|
+
function normalizeVersion(version: string | undefined): string | undefined {
|
|
5
|
+
if (!version) return undefined;
|
|
6
|
+
return version.replace(/^v(?=\d)/, "");
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function getVersionEnv(name: string): string | undefined {
|
|
10
|
+
try {
|
|
11
|
+
return getEnv(name);
|
|
12
|
+
} catch {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const PROXY_RUNTIME_VERSION = normalizeVersion(
|
|
18
|
+
getVersionEnv("VERYFRONT_VERSION") ?? getVersionEnv("RELEASE_VERSION"),
|
|
19
|
+
) ??
|
|
20
|
+
normalizeVersion(typeof denoConfig.version === "string" ? denoConfig.version : undefined) ??
|
|
21
|
+
"0.0.0";
|
|
@@ -4,7 +4,7 @@ import type { HandlerContext, HandlerMetadata, HandlerPriority, HandlerResult }
|
|
|
4
4
|
import { joinPath } from "../../../utils/path-utils.js";
|
|
5
5
|
import { HTTP_OK, HTTP_UNAVAILABLE, PRIORITY_HIGH } from "../../../utils/constants/index.js";
|
|
6
6
|
import { isTracingDegraded, isTracingEnabled } from "../../../observability/tracing/index.js";
|
|
7
|
-
import {
|
|
7
|
+
import { RUNTIME_VERSION } from "../../../utils/version.js";
|
|
8
8
|
|
|
9
9
|
let serverInitialized = false;
|
|
10
10
|
|
|
@@ -74,7 +74,7 @@ export class HealthHandler extends BaseHandler {
|
|
|
74
74
|
status: tracingDegraded ? "degraded" : "ok",
|
|
75
75
|
timestamp: new Date().toISOString(),
|
|
76
76
|
mode: hasStaticBuild ? "static+ssr" : "ssr",
|
|
77
|
-
version:
|
|
77
|
+
version: RUNTIME_VERSION,
|
|
78
78
|
tracing: {
|
|
79
79
|
enabled: isTracingEnabled(),
|
|
80
80
|
degraded: tracingDegraded,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as dntShim from "../../../_dnt.shims.js";
|
|
2
2
|
import { getEnv } from "../../platform/compat/process.js";
|
|
3
3
|
import { hasDenoRuntime, hasNodeProcess } from "../runtime-guards.js";
|
|
4
|
-
import {
|
|
4
|
+
import { RUNTIME_VERSION } from "../version.js";
|
|
5
5
|
import {
|
|
6
6
|
ANSI,
|
|
7
7
|
colorize,
|
|
@@ -287,7 +287,7 @@ class ConsoleLogger implements Logger {
|
|
|
287
287
|
timestamp: new Date().toISOString(),
|
|
288
288
|
level,
|
|
289
289
|
service: this.prefix.toLowerCase(),
|
|
290
|
-
veryfrontVersion:
|
|
290
|
+
veryfrontVersion: RUNTIME_VERSION,
|
|
291
291
|
message,
|
|
292
292
|
};
|
|
293
293
|
|
package/src/src/utils/version.ts
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
|
+
import denoConfig from "../../deno.js";
|
|
2
|
+
import { getEnv } from "../platform/compat/process.js";
|
|
3
|
+
|
|
1
4
|
// Keep in sync with deno.json version.
|
|
2
5
|
// scripts/release.ts updates this constant during releases.
|
|
3
|
-
export const VERSION = "0.1.
|
|
6
|
+
export const VERSION = "0.1.92";
|
|
7
|
+
|
|
8
|
+
export function normalizeVeryfrontVersion(version: string | undefined): string | undefined {
|
|
9
|
+
if (!version) return undefined;
|
|
10
|
+
return version.replace(/^v(?=\d)/, "");
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function getVersionEnv(name: string): string | undefined {
|
|
14
|
+
try {
|
|
15
|
+
return getEnv(name);
|
|
16
|
+
} catch {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function resolveRuntimeVersion(options: {
|
|
22
|
+
veryfrontVersion?: string;
|
|
23
|
+
releaseVersion?: string;
|
|
24
|
+
denoVersion?: string;
|
|
25
|
+
fallbackVersion?: string;
|
|
26
|
+
} = {}): string {
|
|
27
|
+
return normalizeVeryfrontVersion(options.veryfrontVersion ?? options.releaseVersion) ??
|
|
28
|
+
normalizeVeryfrontVersion(options.denoVersion) ??
|
|
29
|
+
options.fallbackVersion ??
|
|
30
|
+
VERSION;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const RUNTIME_VERSION = resolveRuntimeVersion({
|
|
34
|
+
veryfrontVersion: getVersionEnv("VERYFRONT_VERSION"),
|
|
35
|
+
releaseVersion: getVersionEnv("RELEASE_VERSION"),
|
|
36
|
+
denoVersion: typeof denoConfig.version === "string" ? denoConfig.version : undefined,
|
|
37
|
+
fallbackVersion: VERSION,
|
|
38
|
+
});
|
|
4
39
|
|
|
5
40
|
export const SERVER_START_TIME: number = Date.now();
|
|
6
41
|
|
|
@@ -12,7 +47,7 @@ export interface BuildVersion {
|
|
|
12
47
|
|
|
13
48
|
export function createBuildVersion(projectUpdatedAt?: string): BuildVersion {
|
|
14
49
|
return {
|
|
15
|
-
framework:
|
|
50
|
+
framework: RUNTIME_VERSION,
|
|
16
51
|
serverStart: SERVER_START_TIME,
|
|
17
52
|
projectUpdated: projectUpdatedAt,
|
|
18
53
|
};
|