veryfront 0.1.161 → 0.1.163

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.
Files changed (42) hide show
  1. package/esm/deno.js +1 -1
  2. package/esm/src/platform/adapters/fs/veryfront/base-operations.d.ts +1 -1
  3. package/esm/src/platform/adapters/fs/veryfront/base-operations.d.ts.map +1 -1
  4. package/esm/src/platform/adapters/fs/veryfront/directory-operations.d.ts.map +1 -1
  5. package/esm/src/platform/adapters/fs/veryfront/directory-operations.js +9 -52
  6. package/esm/src/platform/adapters/fs/veryfront/file-list-access.d.ts +33 -0
  7. package/esm/src/platform/adapters/fs/veryfront/file-list-access.d.ts.map +1 -0
  8. package/esm/src/platform/adapters/fs/veryfront/file-list-access.js +49 -0
  9. package/esm/src/platform/adapters/fs/veryfront/read-operations.d.ts +1 -20
  10. package/esm/src/platform/adapters/fs/veryfront/read-operations.d.ts.map +1 -1
  11. package/esm/src/platform/adapters/fs/veryfront/stat-operations.d.ts.map +1 -1
  12. package/esm/src/platform/adapters/fs/veryfront/stat-operations.js +8 -49
  13. package/esm/src/rendering/orchestrator/html-project-css.d.ts +31 -0
  14. package/esm/src/rendering/orchestrator/html-project-css.d.ts.map +1 -0
  15. package/esm/src/rendering/orchestrator/html-project-css.js +126 -0
  16. package/esm/src/rendering/orchestrator/html.d.ts +0 -5
  17. package/esm/src/rendering/orchestrator/html.d.ts.map +1 -1
  18. package/esm/src/rendering/orchestrator/html.js +7 -119
  19. package/esm/src/tool/factory.d.ts +3 -5
  20. package/esm/src/tool/factory.d.ts.map +1 -1
  21. package/esm/src/tool/factory.js +2 -1
  22. package/esm/src/tool/index.d.ts +2 -0
  23. package/esm/src/tool/index.d.ts.map +1 -1
  24. package/esm/src/tool/index.js +1 -0
  25. package/esm/src/tool/remote-source-tools.d.ts +8 -0
  26. package/esm/src/tool/remote-source-tools.d.ts.map +1 -0
  27. package/esm/src/tool/remote-source-tools.js +33 -0
  28. package/esm/src/utils/version-constant.d.ts +1 -1
  29. package/esm/src/utils/version-constant.js +1 -1
  30. package/package.json +1 -1
  31. package/src/deno.js +1 -1
  32. package/src/src/platform/adapters/fs/veryfront/base-operations.ts +1 -1
  33. package/src/src/platform/adapters/fs/veryfront/directory-operations.ts +10 -75
  34. package/src/src/platform/adapters/fs/veryfront/file-list-access.ts +109 -0
  35. package/src/src/platform/adapters/fs/veryfront/read-operations.ts +1 -22
  36. package/src/src/platform/adapters/fs/veryfront/stat-operations.ts +8 -71
  37. package/src/src/rendering/orchestrator/html-project-css.ts +203 -0
  38. package/src/src/rendering/orchestrator/html.ts +12 -169
  39. package/src/src/tool/factory.ts +4 -6
  40. package/src/src/tool/index.ts +5 -0
  41. package/src/src/tool/remote-source-tools.ts +54 -0
  42. package/src/src/utils/version-constant.ts +1 -1
package/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.161",
3
+ "version": "0.1.163",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "exclude": [
@@ -1,7 +1,7 @@
1
1
  import type { VeryfrontApiClient } from "../../veryfront-api-client/index.js";
2
2
  import { FileCache } from "../cache/file-cache.js";
3
+ import type { ContentContextProvider } from "./file-list-access.js";
3
4
  import { PathNormalizer } from "./path-normalizer.js";
4
- import type { ContentContextProvider } from "./read-operations.js";
5
5
  export declare class VeryfrontOperationsBase {
6
6
  protected readonly client: VeryfrontApiClient;
7
7
  protected readonly cache: FileCache;
@@ -1 +1 @@
1
- {"version":3,"file":"base-operations.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/fs/veryfront/base-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEnE,qBAAa,uBAAuB;IAEhC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,kBAAkB;IAC7C,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,SAAS;IACnC,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,cAAc;IAC7C,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,sBAAsB;gBAHxC,MAAM,EAAE,kBAAkB,EAC1B,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,cAAc,EAC1B,eAAe,CAAC,EAAE,sBAAsB,YAAA;CAE9D"}
1
+ {"version":3,"file":"base-operations.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/fs/veryfront/base-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,qBAAa,uBAAuB;IAEhC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,kBAAkB;IAC7C,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,SAAS;IACnC,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,cAAc;IAC7C,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,sBAAsB;gBAHxC,MAAM,EAAE,kBAAkB,EAC1B,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,cAAc,EAC1B,eAAe,CAAC,EAAE,sBAAsB,YAAA;CAE9D"}
@@ -1 +1 @@
1
- {"version":3,"file":"directory-operations.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/fs/veryfront/directory-operations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAgB/D,qBAAa,mBAAoB,SAAQ,uBAAuB;IAC9D,OAAO,CAAC,OAAO,CAAqC;IACpD,OAAO,CAAC,YAAY,CAA8B;IAElD,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;YAsDlC,eAAe;IAa7B,OAAO,CAAC,SAAS;IA6DjB,SAAS,IAAI,IAAI;IAIjB,OAAO,CAAC,cAAc;CAuEvB"}
1
+ {"version":3,"file":"directory-operations.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/fs/veryfront/directory-operations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAY/D,qBAAa,mBAAoB,SAAQ,uBAAuB;IAC9D,OAAO,CAAC,OAAO,CAAqC;IACpD,OAAO,CAAC,YAAY,CAA8B;IAElD,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;YAsDlC,eAAe;IAa7B,OAAO,CAAC,SAAS;IA6DjB,SAAS,IAAI,IAAI;IAIjB,OAAO,CAAC,cAAc;CAUvB"}
@@ -1,8 +1,8 @@
1
1
  import { logger as baseLogger } from "../../../../utils/index.js";
2
2
  import { VeryfrontOperationsBase } from "./base-operations.js";
3
- import { buildDirCacheKeyPrefix, buildFileCacheKeyPrefix, buildFileListCacheKey, } from "./cache-keys.js";
3
+ import { buildDirCacheKeyPrefix } from "./cache-keys.js";
4
+ import { loadAllProjectFiles } from "./file-list-access.js";
4
5
  import { withSpan } from "../../../../observability/tracing/otlp-setup.js";
5
- import { withRetryOnTransient } from "./retry.js";
6
6
  const logger = baseLogger.component("directory-operations");
7
7
  export class DirectoryOperations extends VeryfrontOperationsBase {
8
8
  dirTree = null;
@@ -110,55 +110,12 @@ export class DirectoryOperations extends VeryfrontOperationsBase {
110
110
  this.dirTree = null;
111
111
  }
112
112
  getAllFilesRaw() {
113
- return withSpan("fs.veryfront.getAllFilesRaw", async () => {
114
- const cacheStart = performance.now();
115
- const ctx = this.contextProvider?.getContentContext();
116
- const cacheKeyPrefix = buildFileCacheKeyPrefix(ctx);
117
- const skipPersistentCache = this.contextProvider?.isPersistentCacheInvalidated?.(cacheKeyPrefix) ?? false;
118
- const adapterFiles = !skipPersistentCache
119
- ? await this.contextProvider?.getFileList?.()
120
- : undefined;
121
- if (adapterFiles) {
122
- const cacheMs = Math.round(performance.now() - cacheStart);
123
- logger.debug("getAllFilesRaw - from adapter cache", {
124
- cacheMs,
125
- fileCount: adapterFiles.length,
126
- });
127
- return adapterFiles;
128
- }
129
- const cacheKey = buildFileListCacheKey(ctx);
130
- if (skipPersistentCache) {
131
- logger.debug("getAllFilesRaw - skipping persistent cache", {
132
- cacheKey,
133
- cacheKeyPrefix,
134
- });
135
- }
136
- const cached = skipPersistentCache
137
- ? undefined
138
- : await this.cache.getAsync(cacheKey);
139
- const cacheMs = Math.round(performance.now() - cacheStart);
140
- if (cached) {
141
- logger.debug("getAllFilesRaw - fallback cache HIT", {
142
- cacheKey,
143
- cacheMs,
144
- fileCount: cached.length,
145
- });
146
- return cached;
147
- }
148
- logger.warn("getAllFilesRaw - cache MISS, fetching from API", {
149
- cacheKey,
150
- cacheMs,
151
- });
152
- const isPublished = ctx?.sourceType !== "branch";
153
- logger.debug("Fetching files from API", {
154
- sourceType: ctx?.sourceType,
155
- cacheKey,
156
- });
157
- const files = await withRetryOnTransient(() => isPublished
158
- ? this.client.listPublishedFiles(undefined, ctx?.releaseId ?? undefined, ctx?.environmentName ?? undefined)
159
- : this.client.listAllFiles(), "getAllFilesRaw (dir)");
160
- this.cache.set(cacheKey, files);
161
- return files;
162
- });
113
+ return withSpan("fs.veryfront.getAllFilesRaw", () => loadAllProjectFiles({
114
+ client: this.client,
115
+ cache: this.cache,
116
+ contextProvider: this.contextProvider,
117
+ logger,
118
+ operationLabel: "dir",
119
+ }));
163
120
  }
164
121
  }
@@ -0,0 +1,33 @@
1
+ import type { ProjectFile, VeryfrontApiClient } from "../../veryfront-api-client/index.js";
2
+ import { FileCache } from "../cache/file-cache.js";
3
+ import type { ResolvedContentContext } from "./types.js";
4
+ export interface ContentContextProvider {
5
+ isProductionMode: () => boolean;
6
+ getReleaseId: () => string | null;
7
+ getContentContext: () => ResolvedContentContext | null;
8
+ getFileList?: () => Promise<Array<{
9
+ id?: string;
10
+ path: string;
11
+ content?: string;
12
+ type?: string;
13
+ size?: number;
14
+ updated_at?: string;
15
+ }> | undefined>;
16
+ hasCachedFileList?: () => Promise<boolean>;
17
+ isPersistentCacheInvalidated?: (prefix: string) => boolean;
18
+ isReleaseBeingInvalidated?: (releaseId: string) => boolean;
19
+ }
20
+ interface FileListLogger {
21
+ debug(message: string, context?: Record<string, unknown>): void;
22
+ warn(message: string, context?: Record<string, unknown>): void;
23
+ }
24
+ interface LoadAllProjectFilesOptions {
25
+ client: VeryfrontApiClient;
26
+ cache: FileCache;
27
+ contextProvider?: ContentContextProvider;
28
+ logger: FileListLogger;
29
+ operationLabel: string;
30
+ }
31
+ export declare function loadAllProjectFiles({ client, cache, contextProvider, logger, operationLabel, }: LoadAllProjectFilesOptions): Promise<ProjectFile[]>;
32
+ export {};
33
+ //# sourceMappingURL=file-list-access.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-list-access.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/fs/veryfront/file-list-access.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,EAAE,M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 import { buildFileCacheKeyPrefix, buildFileListCacheKey } from "./cache-keys.js";
2
+ import { withRetryOnTransient } from "./retry.js";
3
+ export async function loadAllProjectFiles({ client, cache, contextProvider, logger, operationLabel, }) {
4
+ const cacheStart = performance.now();
5
+ const ctx = contextProvider?.getContentContext();
6
+ const cacheKeyPrefix = buildFileCacheKeyPrefix(ctx);
7
+ const skipPersistentCache = contextProvider?.isPersistentCacheInvalidated?.(cacheKeyPrefix) ??
8
+ false;
9
+ const adapterFiles = !skipPersistentCache ? await contextProvider?.getFileList?.() : undefined;
10
+ if (adapterFiles) {
11
+ const cacheMs = Math.round(performance.now() - cacheStart);
12
+ logger.debug("getAllFilesRaw - from adapter cache", {
13
+ cacheMs,
14
+ fileCount: adapterFiles.length,
15
+ });
16
+ return adapterFiles;
17
+ }
18
+ const cacheKey = buildFileListCacheKey(ctx);
19
+ if (skipPersistentCache) {
20
+ logger.debug("getAllFilesRaw - skipping persistent cache", {
21
+ cacheKey,
22
+ cacheKeyPrefix,
23
+ });
24
+ }
25
+ const cached = skipPersistentCache ? undefined : await cache.getAsync(cacheKey);
26
+ const cacheMs = Math.round(performance.now() - cacheStart);
27
+ if (cached) {
28
+ logger.debug("getAllFilesRaw - fallback cache HIT", {
29
+ cacheKey,
30
+ cacheMs,
31
+ fileCount: cached.length,
32
+ });
33
+ return cached;
34
+ }
35
+ logger.warn("getAllFilesRaw - cache MISS, fetching from API", {
36
+ cacheKey,
37
+ cacheMs,
38
+ });
39
+ const isPublished = ctx?.sourceType !== "branch";
40
+ logger.debug("Fetching files from API", {
41
+ sourceType: ctx?.sourceType,
42
+ cacheKey,
43
+ });
44
+ const files = await withRetryOnTransient(() => isPublished
45
+ ? client.listPublishedFiles(undefined, ctx?.releaseId ?? undefined, ctx?.environmentName ?? undefined)
46
+ : client.listAllFiles(), `getAllFilesRaw (${operationLabel})`);
47
+ cache.set(cacheKey, files);
48
+ return files;
49
+ }
@@ -1,27 +1,8 @@
1
1
  import type { VeryfrontApiClient } from "../../veryfront-api-client/index.js";
2
2
  import { FileCache } from "../cache/file-cache.js";
3
3
  import { PathNormalizer } from "./path-normalizer.js";
4
- import type { ResolvedContentContext } from "./types.js";
4
+ import type { ContentContextProvider } from "./file-list-access.js";
5
5
  export { endRequestMetrics, getContentMetricsSnapshot, resetContentMetrics, startRequestMetrics, } from "./content-metrics.js";
6
- export interface ContentContextProvider {
7
- isProductionMode: () => boolean;
8
- getReleaseId: () => string | null;
9
- getContentContext: () => ResolvedContentContext | null;
10
- /** Cached file list from adapter initialization (single source of truth) */
11
- getFileList?: () => Promise<Array<{
12
- id?: string;
13
- path: string;
14
- content?: string;
15
- type?: string;
16
- size?: number;
17
- updated_at?: string;
18
- }> | undefined>;
19
- hasCachedFileList?: () => Promise<boolean>;
20
- /** True if cache prefix is being deleted - skip persistent cache reads */
21
- isPersistentCacheInvalidated?: (prefix: string) => boolean;
22
- /** Back-compat: release-scoped invalidation */
23
- isReleaseBeingInvalidated?: (releaseId: string) => boolean;
24
- }
25
6
  export declare class ReadOperations {
26
7
  private readonly client;
27
8
  private readonly cache;
@@ -1 +1 @@
1
- {"version":3,"file":"read-operations.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/fs/veryfront/read-operations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAKnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAWtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,OAAO,EACL,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAI9B,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,EAAE,MAAM,OAAO,CAAC;IAChC,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAClC,iBAAiB,EAAE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CAAkC;IAErD,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAGrC;IAEH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;YAiHvB,gBAAgB;YAwChB,UAAU;IAkDxB,UAAU,IAAI,IAAI;IAMlB,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM;YAIpC,cAAc;IAU5B,OAAO,CAAC,0BAA0B;IAgClC,OAAO,CAAC,qBAAqB;YAQf,sBAAsB;YA8EtB,iBAAiB;IASzB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAWtC,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAkI1F"}
@@ -2,12 +2,12 @@ import { logger as baseLogger } from "../../../../utils/index.js";
2
2
  import { isFrameworkSourcePath } from "../../../../utils/path-utils.js";
3
3
  import { VeryfrontOperationsBase } from "./base-operations.js";
4
4
  import { createError, toError } from "../../../../errors/index.js";
5
- import { buildFileCacheKeyPrefix, buildFileListCacheKey, buildStatCacheKeyPrefix, } from "./cache-keys.js";
6
- import { withRetryOnTransient } from "./retry.js";
5
+ import { buildStatCacheKeyPrefix } from "./cache-keys.js";
7
6
  import { STAT_OPERATION_EXTENSION_PRIORITY as EXTENSION_PRIORITY } from "./extension-priority.js";
8
7
  import { collectParentDirectories, normalizeIndexedFilePath, resolveByExtensionPriority, resolveIndexByExtensionPriority, sortPathsByExtensionPriority, stripKnownExtension, } from "./stat-operations-helpers.js";
9
8
  import { ApiSearchCircuitBreaker } from "./api-search-circuit-breaker.js";
10
9
  import { withSpan } from "../../../../observability/tracing/otlp-setup.js";
10
+ import { loadAllProjectFiles } from "./file-list-access.js";
11
11
  const logger = baseLogger.component("stat-operations");
12
12
  const NOT_FOUND_SENTINEL = "__NOT_FOUND__";
13
13
  const API_SEARCH_CIRCUIT_BREAKER_THRESHOLD = 5;
@@ -206,54 +206,13 @@ export class StatOperations extends VeryfrontOperationsBase {
206
206
  return this.pathMapping.get(normalizedPath) ?? normalizedPath;
207
207
  }
208
208
  async getAllFilesRaw() {
209
- const cacheStart = performance.now();
210
- const ctx = this.contextProvider?.getContentContext();
211
- const cacheKeyPrefix = buildFileCacheKeyPrefix(ctx);
212
- const skipPersistentCache = this.contextProvider?.isPersistentCacheInvalidated?.(cacheKeyPrefix) ?? false;
213
- if (!skipPersistentCache) {
214
- const files = await this.contextProvider?.getFileList?.();
215
- if (files) {
216
- const cacheMs = Math.round(performance.now() - cacheStart);
217
- logger.debug("getAllFilesRaw - from adapter cache", {
218
- cacheMs,
219
- fileCount: files.length,
220
- });
221
- return files;
222
- }
223
- }
224
- const cacheKey = buildFileListCacheKey(ctx);
225
- if (skipPersistentCache) {
226
- logger.debug("getAllFilesRaw - skipping persistent cache (invalidation)", {
227
- cacheKey,
228
- cacheKeyPrefix,
229
- });
230
- }
231
- const cached = skipPersistentCache
232
- ? undefined
233
- : await this.cache.getAsync(cacheKey);
234
- const cacheMs = Math.round(performance.now() - cacheStart);
235
- if (cached) {
236
- logger.debug("getAllFilesRaw - fallback cache HIT", {
237
- cacheKey,
238
- cacheMs,
239
- fileCount: cached.length,
240
- });
241
- return cached;
242
- }
243
- logger.warn("getAllFilesRaw - cache MISS, fetching from API", {
244
- cacheKey,
245
- cacheMs,
246
- });
247
- const isPublished = ctx?.sourceType !== "branch";
248
- logger.debug("Fetching files from API", {
249
- sourceType: ctx?.sourceType,
250
- cacheKey,
209
+ return await loadAllProjectFiles({
210
+ client: this.client,
211
+ cache: this.cache,
212
+ contextProvider: this.contextProvider,
213
+ logger,
214
+ operationLabel: "stat",
251
215
  });
252
- const files = await withRetryOnTransient(() => isPublished
253
- ? this.client.listPublishedFiles(undefined, ctx?.releaseId ?? undefined, ctx?.environmentName ?? undefined)
254
- : this.client.listAllFiles(), "getAllFilesRaw (stat)");
255
- this.cache.set(cacheKey, files);
256
- return files;
257
216
  }
258
217
  buildResolveSearchPatterns(normalizedPath, options, knownExtensionFallback = "exact") {
259
218
  const patterns = new Set();
@@ -0,0 +1,31 @@
1
+ import type { VeryfrontConfig } from "../../config/index.js";
2
+ import type { HTMLGenerationOptions } from "../../html/index.js";
3
+ import { getProjectCSS } from "../../html/styles-builder/index.js";
4
+ import { warmPreparedCSSArtifactFromFiles } from "../../html/styles-builder/css-pregeneration.js";
5
+ import { resolveStyleContentVersion } from "../../html/styles-builder/content-version.js";
6
+ import { createStyleScopeProfile } from "../../html/styles-builder/style-scope-profile.js";
7
+ import type { RuntimeAdapter } from "../../platform/adapters/base.js";
8
+ import { getRouteCandidates } from "./css-candidate-manifest.js";
9
+ import type { HTMLGenerationContext } from "./html.js";
10
+ export type ProjectCSSResult = Awaited<ReturnType<typeof getProjectCSS>> | null;
11
+ interface ProjectCssConfig {
12
+ projectDir: string;
13
+ adapter: RuntimeAdapter;
14
+ config: VeryfrontConfig;
15
+ mode: "development" | "production";
16
+ }
17
+ interface ProjectCssDeps {
18
+ createStyleScopeProfile?: typeof createStyleScopeProfile;
19
+ getProjectCSS?: typeof getProjectCSS;
20
+ getProjectContentVersion?: (config: Pick<ProjectCssConfig, "adapter" | "mode">) => string | undefined;
21
+ getRouteCandidates?: typeof getRouteCandidates;
22
+ resolveStyleContentVersion?: typeof resolveStyleContentVersion;
23
+ warmPreparedCSSArtifactFromFiles?: typeof warmPreparedCSSArtifactFromFiles;
24
+ }
25
+ export declare function buildRouteManifestKey(pagePath: string, projectDir: string): string;
26
+ export declare function getProjectContentVersion(config: Pick<ProjectCssConfig, "adapter" | "mode">, deps?: Pick<ProjectCssDeps, "resolveStyleContentVersion">): string | undefined;
27
+ export declare function startProjectCSSPreparation(context: HTMLGenerationContext, htmlOptions: HTMLGenerationOptions, deps?: Pick<ProjectCssDeps, "getProjectCSS">): Promise<ProjectCSSResult> | undefined;
28
+ export declare function startPreparedCSSWarmup(config: ProjectCssConfig, context: HTMLGenerationContext, htmlOptions: HTMLGenerationOptions, deps?: Pick<ProjectCssDeps, "createStyleScopeProfile" | "getProjectContentVersion" | "warmPreparedCSSArtifactFromFiles">): void;
29
+ export declare function extractProjectClassesForRoute(config: ProjectCssConfig, context: HTMLGenerationContext, appComponentPath?: string, deps?: Pick<ProjectCssDeps, "createStyleScopeProfile" | "getProjectContentVersion" | "getRouteCandidates">): Promise<Set<string>>;
30
+ export {};
31
+ //# sourceMappingURL=html-project-css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html-project-css.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/html-project-css.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,gDAAgD,CAAC;AAClG,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAC3F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAItE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAIvD,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,GAAG,IAAI,CAAC;AAEhF,UAAU,gBAAgB;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE,eAAe,CAAC;IACxB,IAAI,EAAE,aAAa,GAAG,YAAY,CAAC;CACpC;AAED,UAAU,cAAc;IACtB,uBAAuB,CAAC,EAAE,OAAO,uBAAuB,CAAC;IACzD,aA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126 @@
1
+ import { getProjectCSS } from "../../html/styles-builder/index.js";
2
+ import { warmPreparedCSSArtifactFromFiles } from "../../html/styles-builder/css-pregeneration.js";
3
+ import { resolveStyleContentVersion } from "../../html/styles-builder/content-version.js";
4
+ import { createStyleScopeProfile } from "../../html/styles-builder/style-scope-profile.js";
5
+ import { rendererLogger } from "../../utils/index.js";
6
+ import { extractRelativePath } from "../../utils/route-path-utils.js";
7
+ import { getRouteCandidates } from "./css-candidate-manifest.js";
8
+ const logger = rendererLogger.component("html-project-css");
9
+ function getUnderlyingFsAdapter(adapter) {
10
+ const wrappedFs = adapter.fs;
11
+ if (typeof wrappedFs.getUnderlyingAdapter !== "function")
12
+ return undefined;
13
+ return wrappedFs.getUnderlyingAdapter();
14
+ }
15
+ export function buildRouteManifestKey(pagePath, projectDir) {
16
+ const relativePagePath = extractRelativePath(pagePath, projectDir);
17
+ return relativePagePath
18
+ .replace(/\.(tsx|ts|jsx|mdx|md|js)$/, "")
19
+ .replace(/^pages\//, "");
20
+ }
21
+ export function getProjectContentVersion(config, deps = {}) {
22
+ const fsAdapter = getUnderlyingFsAdapter(config.adapter);
23
+ if (!fsAdapter)
24
+ return undefined;
25
+ const contentContext = typeof fsAdapter.getContentContext === "function"
26
+ ? fsAdapter.getContentContext()
27
+ : null;
28
+ if (contentContext) {
29
+ const resolveContentVersion = deps.resolveStyleContentVersion ?? resolveStyleContentVersion;
30
+ return resolveContentVersion(contentContext);
31
+ }
32
+ return fsAdapter.getProjectData?.()?.updated_at;
33
+ }
34
+ export function startProjectCSSPreparation(context, htmlOptions, deps = {}) {
35
+ const isLocalProject = htmlOptions.isLocalProject ?? false;
36
+ if (isLocalProject || htmlOptions.environment !== "production")
37
+ return undefined;
38
+ const projectScope = htmlOptions.projectSlug || htmlOptions.projectId || context.slug;
39
+ if (!projectScope || projectScope === "default")
40
+ return undefined;
41
+ const getProjectCss = deps.getProjectCSS ?? getProjectCSS;
42
+ return getProjectCss(projectScope, htmlOptions.globalCSS, new Set([...(htmlOptions.projectClasses ?? [])]), {
43
+ minify: true,
44
+ environment: htmlOptions.environment,
45
+ buildMode: htmlOptions.mode,
46
+ });
47
+ }
48
+ export function startPreparedCSSWarmup(config, context, htmlOptions, deps = {}) {
49
+ const isLocalProject = htmlOptions.isLocalProject ?? false;
50
+ const usesPreviewStylesheet = isLocalProject || htmlOptions.environment !== "production";
51
+ if (!usesPreviewStylesheet)
52
+ return;
53
+ const fsAdapter = getUnderlyingFsAdapter(config.adapter);
54
+ if (typeof fsAdapter?.getAllSourceFiles !== "function")
55
+ return;
56
+ const projectScope = htmlOptions.projectSlug || htmlOptions.projectId || context.slug;
57
+ if (!projectScope || projectScope === "default")
58
+ return;
59
+ const resolveProjectContentVersion = deps.getProjectContentVersion ?? getProjectContentVersion;
60
+ const projectVersion = resolveProjectContentVersion(config) ??
61
+ (config.mode === "development" ? "dev" : "unknown");
62
+ const createStyleProfile = deps.createStyleScopeProfile ?? createStyleScopeProfile;
63
+ const warmPreparedCss = deps.warmPreparedCSSArtifactFromFiles ?? warmPreparedCSSArtifactFromFiles;
64
+ const styleProfile = createStyleProfile(config.config);
65
+ const stylesheetPath = config.config?.tailwind?.stylesheet;
66
+ Promise.resolve(fsAdapter.getAllSourceFiles())
67
+ .then((files) => warmPreparedCss({
68
+ projectSlug: projectScope,
69
+ projectVersion,
70
+ projectDir: config.projectDir,
71
+ files,
72
+ styleProfile,
73
+ stylesheetPath,
74
+ minify: true,
75
+ environment: "preview",
76
+ buildMode: "production",
77
+ }))
78
+ .catch((error) => {
79
+ logger.debug("Prepared CSS warmup skipped after source scan failure", {
80
+ projectScope,
81
+ error: error instanceof Error ? error.message : String(error),
82
+ });
83
+ });
84
+ }
85
+ export async function extractProjectClassesForRoute(config, context, appComponentPath, deps = {}) {
86
+ const classes = new Set();
87
+ const fsAdapter = getUnderlyingFsAdapter(config.adapter);
88
+ if (typeof fsAdapter?.getAllSourceFiles !== "function")
89
+ return classes;
90
+ const files = await fsAdapter.getAllSourceFiles();
91
+ const projectScope = context.options?.projectSlug || context.options?.projectId ||
92
+ config.projectDir;
93
+ const resolveProjectContentVersion = deps.getProjectContentVersion ?? getProjectContentVersion;
94
+ const projectVersion = resolveProjectContentVersion(config) ??
95
+ (config.mode === "development" ? "dev" : "unknown");
96
+ const routeKey = buildRouteManifestKey(context.pageInfo.entity.path, config.projectDir);
97
+ const routeLayoutPaths = context.nestedLayouts
98
+ .map((layout) => layout.componentPath || layout.path)
99
+ .filter((path) => Boolean(path));
100
+ const routeFilePaths = [
101
+ context.pageInfo.entity.path,
102
+ ...routeLayoutPaths,
103
+ ...(appComponentPath ? [appComponentPath] : []),
104
+ ];
105
+ const createStyleProfile = deps.createStyleScopeProfile ?? createStyleScopeProfile;
106
+ const getRouteCssCandidates = deps.getRouteCandidates ?? getRouteCandidates;
107
+ const routeCandidates = getRouteCssCandidates({
108
+ projectScope,
109
+ projectVersion,
110
+ projectDir: config.projectDir,
111
+ styleProfile: createStyleProfile(config.config),
112
+ routeKey,
113
+ routeFilePaths,
114
+ files,
115
+ developmentMode: config.mode === "development",
116
+ });
117
+ for (const cls of routeCandidates)
118
+ classes.add(cls);
119
+ logger.debug("extractProjectClasses", {
120
+ filesProcessed: files.length,
121
+ routeKey,
122
+ routeFileCount: routeFilePaths.length,
123
+ totalClasses: classes.size,
124
+ });
125
+ return classes;
126
+ }
@@ -33,8 +33,6 @@ export declare class HTMLGenerator {
33
33
  private detectUseClientDirective;
34
34
  private wrapHTMLFragment;
35
35
  private generateShellParts;
36
- private startProjectCSSPreparation;
37
- private startPreparedCSSWarmup;
38
36
  private buildHeadElements;
39
37
  private mergeFrontmatter;
40
38
  private resolveAppPath;
@@ -46,8 +44,5 @@ export declare class HTMLGenerator {
46
44
  * double-loading globals.css when it's both auto-discovered and explicitly imported.
47
45
  */
48
46
  private mergeImportedCSS;
49
- private getProjectContentVersion;
50
- private buildRouteManifestKey;
51
- private extractProjectClassesForRoute;
52
47
  }
53
48
  //# sourceMappingURL=html.d.ts.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