@veryfront/ext-content-mdx 0.1.1081 → 0.1.1083
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/_dnt.polyfills.d.ts +0 -6
- package/esm/_dnt.polyfills.d.ts.map +1 -1
- package/esm/_dnt.shims.d.ts +1 -1
- package/esm/deno.d.ts +3 -0
- package/esm/deno.js +8 -5
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_loader_state.d.ts +2 -2
- package/esm/src/transforms/mdx/compiler/frontmatter-extractor.js +1 -1
- package/esm/src/utils/logger/logger.d.ts.map +1 -1
- package/esm/src/utils/logger/logger.js +16 -12
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +2 -2
- package/esm/src/config/defaults.d.ts +0 -39
- package/esm/src/config/defaults.d.ts.map +0 -1
- package/esm/src/config/defaults.js +0 -65
- package/esm/src/errors/error-registry/agent.d.ts +0 -18
- package/esm/src/errors/error-registry/agent.d.ts.map +0 -1
- package/esm/src/errors/error-registry/agent.js +0 -60
- package/esm/src/errors/error-registry/boundary.d.ts +0 -16
- package/esm/src/errors/error-registry/boundary.d.ts.map +0 -1
- package/esm/src/errors/error-registry/boundary.js +0 -52
- package/esm/src/errors/error-registry/build.d.ts +0 -20
- package/esm/src/errors/error-registry/build.d.ts.map +0 -1
- package/esm/src/errors/error-registry/build.js +0 -68
- package/esm/src/errors/error-registry/config.d.ts +0 -22
- package/esm/src/errors/error-registry/config.d.ts.map +0 -1
- package/esm/src/errors/error-registry/config.js +0 -70
- package/esm/src/errors/error-registry/deploy.d.ts +0 -12
- package/esm/src/errors/error-registry/deploy.d.ts.map +0 -1
- package/esm/src/errors/error-registry/deploy.js +0 -36
- package/esm/src/errors/error-registry/dev.d.ts +0 -14
- package/esm/src/errors/error-registry/dev.d.ts.map +0 -1
- package/esm/src/errors/error-registry/dev.js +0 -44
- package/esm/src/errors/error-registry/general.d.ts +0 -29
- package/esm/src/errors/error-registry/general.d.ts.map +0 -1
- package/esm/src/errors/error-registry/general.js +0 -92
- package/esm/src/errors/error-registry/module.d.ts +0 -16
- package/esm/src/errors/error-registry/module.d.ts.map +0 -1
- package/esm/src/errors/error-registry/module.js +0 -52
- package/esm/src/errors/error-registry/route.d.ts +0 -16
- package/esm/src/errors/error-registry/route.d.ts.map +0 -1
- package/esm/src/errors/error-registry/route.js +0 -52
- package/esm/src/errors/error-registry/runtime.d.ts +0 -18
- package/esm/src/errors/error-registry/runtime.d.ts.map +0 -1
- package/esm/src/errors/error-registry/runtime.js +0 -60
- package/esm/src/errors/error-registry/server.d.ts +0 -39
- package/esm/src/errors/error-registry/server.d.ts.map +0 -1
- package/esm/src/errors/error-registry/server.js +0 -129
- package/esm/src/errors/error-registry-helpers.d.ts +0 -6
- package/esm/src/errors/error-registry-helpers.d.ts.map +0 -1
- package/esm/src/errors/error-registry-helpers.js +0 -9
- package/esm/src/errors/error-registry.d.ts +0 -114
- package/esm/src/errors/error-registry.d.ts.map +0 -1
- package/esm/src/errors/error-registry.js +0 -60
- package/esm/src/errors/types.d.ts +0 -84
- package/esm/src/errors/types.d.ts.map +0 -1
- package/esm/src/errors/types.js +0 -69
- package/esm/src/errors/veryfront-error.d.ts +0 -149
- package/esm/src/errors/veryfront-error.d.ts.map +0 -1
- package/esm/src/errors/veryfront-error.js +0 -61
- package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.d.ts +0 -13
- package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.d.ts.map +0 -1
- package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.js +0 -55
- package/esm/src/observability/tracing/api-shim.d.ts +0 -191
- package/esm/src/observability/tracing/api-shim.d.ts.map +0 -1
- package/esm/src/observability/tracing/api-shim.js +0 -281
- package/esm/src/observability/tracing/otlp-setup.d.ts +0 -63
- package/esm/src/observability/tracing/otlp-setup.d.ts.map +0 -1
- package/esm/src/observability/tracing/otlp-setup.js +0 -219
- package/esm/src/observability/tracing/telemetry-env.d.ts +0 -3
- package/esm/src/observability/tracing/telemetry-env.d.ts.map +0 -1
- package/esm/src/observability/tracing/telemetry-env.js +0 -10
- package/esm/src/platform/adapters/base.d.ts +0 -209
- package/esm/src/platform/adapters/base.d.ts.map +0 -1
- package/esm/src/platform/adapters/base.js +0 -15
- package/esm/src/platform/compat/constants.d.ts +0 -13
- package/esm/src/platform/compat/constants.d.ts.map +0 -1
- package/esm/src/platform/compat/constants.js +0 -12
- package/esm/src/platform/compat/fs.d.ts +0 -75
- package/esm/src/platform/compat/fs.d.ts.map +0 -1
- package/esm/src/platform/compat/fs.js +0 -315
- package/esm/src/transforms/import-rewriter/url-builder.d.ts +0 -70
- package/esm/src/transforms/import-rewriter/url-builder.d.ts.map +0 -1
- package/esm/src/transforms/import-rewriter/url-builder.js +0 -152
- package/esm/src/utils/base64url.d.ts +0 -6
- package/esm/src/utils/base64url.d.ts.map +0 -1
- package/esm/src/utils/base64url.js +0 -12
- package/esm/src/utils/bundle-manifest.d.ts +0 -63
- package/esm/src/utils/bundle-manifest.d.ts.map +0 -1
- package/esm/src/utils/bundle-manifest.js +0 -96
- package/esm/src/utils/constants/buffers.d.ts +0 -24
- package/esm/src/utils/constants/buffers.d.ts.map +0 -1
- package/esm/src/utils/constants/buffers.js +0 -23
- package/esm/src/utils/constants/build.d.ts +0 -8
- package/esm/src/utils/constants/build.d.ts.map +0 -1
- package/esm/src/utils/constants/build.js +0 -7
- package/esm/src/utils/constants/cache.d.ts +0 -74
- package/esm/src/utils/constants/cache.d.ts.map +0 -1
- package/esm/src/utils/constants/cache.js +0 -133
- package/esm/src/utils/constants/cdn.d.ts +0 -29
- package/esm/src/utils/constants/cdn.d.ts.map +0 -1
- package/esm/src/utils/constants/cdn.js +0 -58
- package/esm/src/utils/constants/crypto.d.ts +0 -10
- package/esm/src/utils/constants/crypto.d.ts.map +0 -1
- package/esm/src/utils/constants/crypto.js +0 -9
- package/esm/src/utils/constants/env.d.ts +0 -16
- package/esm/src/utils/constants/env.d.ts.map +0 -1
- package/esm/src/utils/constants/env.js +0 -20
- package/esm/src/utils/constants/hash.d.ts +0 -5
- package/esm/src/utils/constants/hash.d.ts.map +0 -1
- package/esm/src/utils/constants/hash.js +0 -4
- package/esm/src/utils/constants/hmr.d.ts +0 -24
- package/esm/src/utils/constants/hmr.d.ts.map +0 -1
- package/esm/src/utils/constants/hmr.js +0 -26
- package/esm/src/utils/constants/html.d.ts +0 -13
- package/esm/src/utils/constants/html.d.ts.map +0 -1
- package/esm/src/utils/constants/html.js +0 -12
- package/esm/src/utils/constants/http.d.ts +0 -77
- package/esm/src/utils/constants/http.d.ts.map +0 -1
- package/esm/src/utils/constants/http.js +0 -76
- package/esm/src/utils/constants/index.d.ts +0 -23
- package/esm/src/utils/constants/index.d.ts.map +0 -1
- package/esm/src/utils/constants/index.js +0 -22
- package/esm/src/utils/constants/limits.d.ts +0 -27
- package/esm/src/utils/constants/limits.d.ts.map +0 -1
- package/esm/src/utils/constants/limits.js +0 -26
- package/esm/src/utils/constants/metrics.d.ts +0 -10
- package/esm/src/utils/constants/metrics.d.ts.map +0 -1
- package/esm/src/utils/constants/metrics.js +0 -34
- package/esm/src/utils/constants/network.d.ts +0 -23
- package/esm/src/utils/constants/network.d.ts.map +0 -1
- package/esm/src/utils/constants/network.js +0 -27
- package/esm/src/utils/constants/priorities.d.ts +0 -31
- package/esm/src/utils/constants/priorities.d.ts.map +0 -1
- package/esm/src/utils/constants/priorities.js +0 -30
- package/esm/src/utils/constants/retry.d.ts +0 -14
- package/esm/src/utils/constants/retry.d.ts.map +0 -1
- package/esm/src/utils/constants/retry.js +0 -13
- package/esm/src/utils/constants/server.d.ts +0 -107
- package/esm/src/utils/constants/server.d.ts.map +0 -1
- package/esm/src/utils/constants/server.js +0 -120
- package/esm/src/utils/feature-flags.d.ts +0 -7
- package/esm/src/utils/feature-flags.d.ts.map +0 -1
- package/esm/src/utils/feature-flags.js +0 -8
- package/esm/src/utils/hash-utils.d.ts +0 -19
- package/esm/src/utils/hash-utils.d.ts.map +0 -1
- package/esm/src/utils/hash-utils.js +0 -42
- package/esm/src/utils/import-lockfile.d.ts +0 -52
- package/esm/src/utils/import-lockfile.d.ts.map +0 -1
- package/esm/src/utils/import-lockfile.js +0 -187
- package/esm/src/utils/index.d.ts +0 -27
- package/esm/src/utils/index.d.ts.map +0 -1
- package/esm/src/utils/index.js +0 -25
- package/esm/src/utils/logger/components.d.ts +0 -73
- package/esm/src/utils/logger/components.d.ts.map +0 -1
- package/esm/src/utils/logger/components.js +0 -81
- package/esm/src/utils/logger/index.d.ts +0 -10
- package/esm/src/utils/logger/index.d.ts.map +0 -1
- package/esm/src/utils/logger/index.js +0 -9
- package/esm/src/utils/logger/request-context.d.ts +0 -27
- package/esm/src/utils/logger/request-context.d.ts.map +0 -1
- package/esm/src/utils/logger/request-context.js +0 -28
- package/esm/src/utils/memoize.d.ts +0 -19
- package/esm/src/utils/memoize.d.ts.map +0 -1
- package/esm/src/utils/memoize.js +0 -72
- package/esm/src/utils/parallel.d.ts +0 -25
- package/esm/src/utils/parallel.d.ts.map +0 -1
- package/esm/src/utils/parallel.js +0 -91
- package/esm/src/utils/path-utils.d.ts +0 -34
- package/esm/src/utils/path-utils.d.ts.map +0 -1
- package/esm/src/utils/path-utils.js +0 -138
- package/esm/src/utils/perf-timer.d.ts +0 -11
- package/esm/src/utils/perf-timer.d.ts.map +0 -1
- package/esm/src/utils/perf-timer.js +0 -114
- package/esm/src/utils/platform.d.ts +0 -9
- package/esm/src/utils/platform.d.ts.map +0 -1
- package/esm/src/utils/platform.js +0 -11
- package/esm/src/utils/runtime-guards.d.ts +0 -29
- package/esm/src/utils/runtime-guards.d.ts.map +0 -1
- package/esm/src/utils/runtime-guards.js +0 -23
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Centralized server endpoints and paths registry
|
|
3
|
-
*
|
|
4
|
-
* All internal veryfront URLs should be defined here as the single source of truth.
|
|
5
|
-
* This prevents hardcoding URLs across the codebase and makes refactoring easier.
|
|
6
|
-
*/
|
|
7
|
-
export { DEFAULT_PORT } from "../../config/defaults.js";
|
|
8
|
-
/** Default port for development dashboard (matches veryfront.config.ts default) */
|
|
9
|
-
export const DEFAULT_DASHBOARD_PORT = 3001;
|
|
10
|
-
/** Internal URL prefix for all veryfront endpoints */
|
|
11
|
-
export const INTERNAL_PREFIX = "/_veryfront";
|
|
12
|
-
/**
|
|
13
|
-
* All internal veryfront URL path prefixes (directories)
|
|
14
|
-
*/
|
|
15
|
-
export const INTERNAL_PATH_PREFIXES = {
|
|
16
|
-
/** React Server Components endpoints */
|
|
17
|
-
RSC: `${INTERNAL_PREFIX}/rsc/`,
|
|
18
|
-
/** File system access endpoints (base64 encoded paths) */
|
|
19
|
-
FS: `${INTERNAL_PREFIX}/fs/`,
|
|
20
|
-
/** Virtual module system */
|
|
21
|
-
MODULES: `${INTERNAL_PREFIX}/modules/`,
|
|
22
|
-
/** Generated page modules */
|
|
23
|
-
PAGES: `${INTERNAL_PREFIX}/pages/`,
|
|
24
|
-
/** Data JSON endpoints */
|
|
25
|
-
DATA: `${INTERNAL_PREFIX}/data/`,
|
|
26
|
-
/** Library modules and large vendor surfaces */
|
|
27
|
-
LIB: `${INTERNAL_PREFIX}/lib/`,
|
|
28
|
-
/** Chunk assets */
|
|
29
|
-
CHUNKS: `${INTERNAL_PREFIX}/chunks/`,
|
|
30
|
-
/** Client component modules */
|
|
31
|
-
CLIENT: `${INTERNAL_PREFIX}/client/`,
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Specific internal endpoint URLs
|
|
35
|
-
*/
|
|
36
|
-
export const INTERNAL_ENDPOINTS = {
|
|
37
|
-
// Development endpoints
|
|
38
|
-
HMR_RUNTIME: `${INTERNAL_PREFIX}/hmr-runtime.js`,
|
|
39
|
-
HMR: `${INTERNAL_PREFIX}/hmr.js`,
|
|
40
|
-
ERROR_OVERLAY: `${INTERNAL_PREFIX}/error-overlay.js`,
|
|
41
|
-
// Legacy endpoint retained for backward compatibility (no active handler).
|
|
42
|
-
DEV_LOADER: `${INTERNAL_PREFIX}/dev-loader.js`,
|
|
43
|
-
CLIENT_LOG: `${INTERNAL_PREFIX}/log`,
|
|
44
|
-
// Production endpoints
|
|
45
|
-
CLIENT_JS: `${INTERNAL_PREFIX}/client.js`,
|
|
46
|
-
ROUTER_JS: `${INTERNAL_PREFIX}/router.js`,
|
|
47
|
-
PREFETCH_JS: `${INTERNAL_PREFIX}/prefetch.js`,
|
|
48
|
-
MANIFEST_JSON: `${INTERNAL_PREFIX}/manifest.json`,
|
|
49
|
-
APP_JS: `${INTERNAL_PREFIX}/app.js`,
|
|
50
|
-
// RSC endpoints
|
|
51
|
-
RSC_CLIENT: `${INTERNAL_PREFIX}/rsc/client.js`,
|
|
52
|
-
RSC_MANIFEST: `${INTERNAL_PREFIX}/rsc/manifest`,
|
|
53
|
-
RSC_STREAM: `${INTERNAL_PREFIX}/rsc/stream`,
|
|
54
|
-
RSC_PAYLOAD: `${INTERNAL_PREFIX}/rsc/payload`,
|
|
55
|
-
RSC_RENDER: `${INTERNAL_PREFIX}/rsc/render`,
|
|
56
|
-
RSC_PAGE: `${INTERNAL_PREFIX}/rsc/page`,
|
|
57
|
-
RSC_MODULE: `${INTERNAL_PREFIX}/rsc/module`,
|
|
58
|
-
RSC_DOM: `${INTERNAL_PREFIX}/rsc/dom.js`,
|
|
59
|
-
// Library module endpoints
|
|
60
|
-
LIB_CHAT_REACT: `${INTERNAL_PREFIX}/lib/chat/react.js`,
|
|
61
|
-
LIB_CHAT_COMPONENTS: `${INTERNAL_PREFIX}/lib/chat/components.js`,
|
|
62
|
-
LIB_CHAT_PRIMITIVES: `${INTERNAL_PREFIX}/lib/chat/primitives.js`,
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* Build output directory paths (relative)
|
|
66
|
-
*/
|
|
67
|
-
export const BUILD_DIRS = {
|
|
68
|
-
/** Main build output directory */
|
|
69
|
-
ROOT: "_veryfront",
|
|
70
|
-
/** Chunks directory */
|
|
71
|
-
CHUNKS: "_veryfront/chunks",
|
|
72
|
-
/** Data directory */
|
|
73
|
-
DATA: "_veryfront/data",
|
|
74
|
-
/** Assets directory */
|
|
75
|
-
ASSETS: "_veryfront/assets",
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* Local project directory paths (relative to project root)
|
|
79
|
-
* These are .gitignore'd directories for caching and temporary files
|
|
80
|
-
*/
|
|
81
|
-
export const PROJECT_DIRS = {
|
|
82
|
-
/** Base veryfront internal directory */
|
|
83
|
-
ROOT: ".veryfront",
|
|
84
|
-
/** Cache directory for build artifacts, transforms, etc. */
|
|
85
|
-
CACHE: ".veryfront/cache",
|
|
86
|
-
/** KV store directory */
|
|
87
|
-
KV: ".veryfront/kv",
|
|
88
|
-
/** Log files directory */
|
|
89
|
-
LOGS: ".veryfront/logs",
|
|
90
|
-
/** Temporary files directory */
|
|
91
|
-
TMP: ".veryfront/tmp",
|
|
92
|
-
};
|
|
93
|
-
/** Default cache directory path */
|
|
94
|
-
export const DEFAULT_CACHE_DIR = PROJECT_DIRS.CACHE;
|
|
95
|
-
/**
|
|
96
|
-
* Helper to check if a pathname is an internal veryfront endpoint
|
|
97
|
-
*/
|
|
98
|
-
export function isInternalEndpoint(pathname) {
|
|
99
|
-
return pathname.startsWith(`${INTERNAL_PREFIX}/`);
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Helper to check if a pathname is a static asset (has extension or is internal)
|
|
103
|
-
*/
|
|
104
|
-
export function isStaticAsset(pathname) {
|
|
105
|
-
return pathname.includes(".") || isInternalEndpoint(pathname);
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Normalize a chunk path to include the base prefix
|
|
109
|
-
*/
|
|
110
|
-
export function normalizeChunkPath(filename, basePath = INTERNAL_PATH_PREFIXES.CHUNKS) {
|
|
111
|
-
if (filename.startsWith("/"))
|
|
112
|
-
return filename;
|
|
113
|
-
return `${basePath.replace(/\/$/, "")}/${filename}`;
|
|
114
|
-
}
|
|
115
|
-
// Re-export for backward compatibility
|
|
116
|
-
/** Shared dev server endpoints value. */
|
|
117
|
-
export const DEV_SERVER_ENDPOINTS = {
|
|
118
|
-
HMR_RUNTIME: INTERNAL_ENDPOINTS.HMR_RUNTIME,
|
|
119
|
-
ERROR_OVERLAY: INTERNAL_ENDPOINTS.ERROR_OVERLAY,
|
|
120
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"feature-flags.d.ts","sourceRoot":"","sources":["../../../src/src/utils/feature-flags.ts"],"names":[],"mappings":"AAEA,oCAAoC;AACpC,wBAAgB,YAAY,CAC1B,MAAM,CAAC,EAAE;IAAE,YAAY,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CAAE,GAC5C,OAAO,CAKT"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { getEnv } from "../platform/compat/process.js";
|
|
2
|
-
/** Check whether RSC is enabled. */
|
|
3
|
-
export function isRSCEnabled(config) {
|
|
4
|
-
const rsc = config?.experimental?.rsc;
|
|
5
|
-
if (rsc != null)
|
|
6
|
-
return rsc;
|
|
7
|
-
return getEnv("VERYFRONT_EXPERIMENTAL_RSC") === "1";
|
|
8
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/** Compute hash. */
|
|
2
|
-
export declare function computeHash(content: string): Promise<string>;
|
|
3
|
-
/** Source bundle content used for hash computation. */
|
|
4
|
-
export interface BundleCode {
|
|
5
|
-
code: string;
|
|
6
|
-
css?: string;
|
|
7
|
-
sourceMap?: string;
|
|
8
|
-
}
|
|
9
|
-
/** Compute code hash. */
|
|
10
|
-
export declare function computeCodeHash(code: BundleCode): Promise<string>;
|
|
11
|
-
/** Create simple hash. */
|
|
12
|
-
export declare function simpleHash(str: string): number;
|
|
13
|
-
/** Hash string to hex (base 16) - used for module filenames */
|
|
14
|
-
export declare function hashCodeHex(str: string): string;
|
|
15
|
-
/** Create short hash. */
|
|
16
|
-
export declare function shortHash(content: string): Promise<string>;
|
|
17
|
-
/** FNV-1a hash for strings - returns hex string */
|
|
18
|
-
export declare function fnv1aHash(input: string): string;
|
|
19
|
-
//# sourceMappingURL=hash-utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hash-utils.d.ts","sourceRoot":"","sources":["../../../src/src/utils/hash-utils.ts"],"names":[],"mappings":"AAOA,oBAAoB;AACpB,wBAAsB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAKlE;AACD,uDAAuD;AACvD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,yBAAyB;AACzB,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAEjE;AAED,0BAA0B;AAC1B,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAS9C;AAED,+DAA+D;AAC/D,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,yBAAyB;AACzB,wBAAsB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAGhE;AAED,mDAAmD;AACnD,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS/C"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import * as dntShim from "../../_dnt.shims.js";
|
|
2
|
-
import { FNV1A_PRIME_32 } from "./constants/crypto.js";
|
|
3
|
-
import { HASH_SEED_FNV1A } from "./constants/hash.js";
|
|
4
|
-
/** Number of hex characters kept by shortHash (8 hex chars = 32 bits) */
|
|
5
|
-
const SHORT_HASH_LENGTH = 8;
|
|
6
|
-
/** Compute hash. */
|
|
7
|
-
export async function computeHash(content) {
|
|
8
|
-
const data = new TextEncoder().encode(content);
|
|
9
|
-
const hashBuffer = await dntShim.crypto.subtle.digest("SHA-256", data);
|
|
10
|
-
return Array.from(new Uint8Array(hashBuffer), (b) => b.toString(16).padStart(2, "0")).join("");
|
|
11
|
-
}
|
|
12
|
-
/** Compute code hash. */
|
|
13
|
-
export function computeCodeHash(code) {
|
|
14
|
-
return computeHash(`${code.code}${code.css ?? ""}${code.sourceMap ?? ""}`);
|
|
15
|
-
}
|
|
16
|
-
/** Create simple hash. */
|
|
17
|
-
export function simpleHash(str) {
|
|
18
|
-
let hash = 0;
|
|
19
|
-
for (let i = 0; i < str.length; i++) {
|
|
20
|
-
hash = (hash << 5) - hash + str.charCodeAt(i);
|
|
21
|
-
hash &= hash;
|
|
22
|
-
}
|
|
23
|
-
return Math.abs(hash);
|
|
24
|
-
}
|
|
25
|
-
/** Hash string to hex (base 16) - used for module filenames */
|
|
26
|
-
export function hashCodeHex(str) {
|
|
27
|
-
return simpleHash(str).toString(16);
|
|
28
|
-
}
|
|
29
|
-
/** Create short hash. */
|
|
30
|
-
export async function shortHash(content) {
|
|
31
|
-
const fullHash = await computeHash(content);
|
|
32
|
-
return fullHash.slice(0, SHORT_HASH_LENGTH);
|
|
33
|
-
}
|
|
34
|
-
/** FNV-1a hash for strings - returns hex string */
|
|
35
|
-
export function fnv1aHash(input) {
|
|
36
|
-
let hash = HASH_SEED_FNV1A >>> 0;
|
|
37
|
-
for (const char of input) {
|
|
38
|
-
hash ^= char.charCodeAt(0);
|
|
39
|
-
hash = Math.imul(hash, FNV1A_PRIME_32);
|
|
40
|
-
}
|
|
41
|
-
return (hash >>> 0).toString(16);
|
|
42
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
export interface LockfileEntry {
|
|
2
|
-
resolved: string;
|
|
3
|
-
integrity: string;
|
|
4
|
-
dependencies?: string[];
|
|
5
|
-
fetchedAt?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface LockfileData {
|
|
8
|
-
version: 1;
|
|
9
|
-
imports: Record<string, LockfileEntry>;
|
|
10
|
-
}
|
|
11
|
-
export declare function createEmptyLockfile(): LockfileData;
|
|
12
|
-
/** Compute integrity. */
|
|
13
|
-
export declare function computeIntegrity(content: string): Promise<string>;
|
|
14
|
-
export declare function verifyIntegrity(content: string, integrity: string): Promise<boolean>;
|
|
15
|
-
/** Public API contract for lockfile manager. */
|
|
16
|
-
export interface LockfileManager {
|
|
17
|
-
read(): Promise<LockfileData | null>;
|
|
18
|
-
write(data: LockfileData): Promise<void>;
|
|
19
|
-
get(url: string): Promise<LockfileEntry | null>;
|
|
20
|
-
set(url: string, entry: LockfileEntry): Promise<void>;
|
|
21
|
-
has(url: string): Promise<boolean>;
|
|
22
|
-
clear(): Promise<void>;
|
|
23
|
-
flush(): Promise<void>;
|
|
24
|
-
}
|
|
25
|
-
export type FSAdapter = {
|
|
26
|
-
readFile(path: string): Promise<string>;
|
|
27
|
-
writeFile(path: string, content: string): Promise<void>;
|
|
28
|
-
exists(path: string): Promise<boolean>;
|
|
29
|
-
remove?(path: string): Promise<void>;
|
|
30
|
-
};
|
|
31
|
-
/** Create lockfile manager. */
|
|
32
|
-
export declare function createLockfileManager(projectDir: string, fsAdapter?: FSAdapter): LockfileManager;
|
|
33
|
-
export interface FetchWithLockOptions {
|
|
34
|
-
lockfile: LockfileManager;
|
|
35
|
-
url: string;
|
|
36
|
-
fetchFn?: typeof fetch;
|
|
37
|
-
strict?: boolean;
|
|
38
|
-
}
|
|
39
|
-
export interface FetchWithLockResult {
|
|
40
|
-
content: string;
|
|
41
|
-
resolvedUrl: string;
|
|
42
|
-
fromCache: boolean;
|
|
43
|
-
integrity: string;
|
|
44
|
-
}
|
|
45
|
-
export declare function fetchWithLock(options: FetchWithLockOptions): Promise<FetchWithLockResult>;
|
|
46
|
-
export interface ParsedImport {
|
|
47
|
-
specifier: string;
|
|
48
|
-
type: "static" | "dynamic";
|
|
49
|
-
}
|
|
50
|
-
export declare function extractImports(content: string): ParsedImport[];
|
|
51
|
-
export declare function resolveImportUrl(specifier: string, baseUrl: string): string | null;
|
|
52
|
-
//# sourceMappingURL=import-lockfile.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"import-lockfile.d.ts","sourceRoot":"","sources":["../../../src/src/utils/import-lockfile.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,CAAC,CAAC;IACX,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;CACxC;AAKD,wBAAgB,mBAAmB,IAAI,YAAY,CAElD;AAED,yBAAyB;AACzB,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAGvE;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAG1F;AAED,gDAAgD;AAChD,MAAM,WAAW,eAAe;IAC9B,IAAI,IAAI,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IACrC,KAAK,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IAChD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACnC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,MAAM,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC,CAAC;AAqBF,+BAA+B;AAC/B,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,eAAe,CAkFhG;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,eAAe,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAID,wBAAsB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA2D/F;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC5B;AAMD,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,EAAE,CAmB9D;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUlF"}
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import { computeHash } from "./hash-utils.js";
|
|
2
|
-
import { serverLogger } from "./logger/index.js";
|
|
3
|
-
import { createFileSystem } from "../platform/compat/fs.js";
|
|
4
|
-
import { CACHE_ERROR, NETWORK_ERROR } from "../errors/error-registry.js";
|
|
5
|
-
const logger = serverLogger.component("lockfile");
|
|
6
|
-
const LOCKFILE_NAME = "veryfront.lock";
|
|
7
|
-
const LOCKFILE_VERSION = 1;
|
|
8
|
-
export function createEmptyLockfile() {
|
|
9
|
-
return { version: LOCKFILE_VERSION, imports: {} };
|
|
10
|
-
}
|
|
11
|
-
/** Compute integrity. */
|
|
12
|
-
export async function computeIntegrity(content) {
|
|
13
|
-
const hash = await computeHash(content);
|
|
14
|
-
return `sha256-${hash}`;
|
|
15
|
-
}
|
|
16
|
-
export async function verifyIntegrity(content, integrity) {
|
|
17
|
-
const computed = await computeIntegrity(content);
|
|
18
|
-
return computed === integrity;
|
|
19
|
-
}
|
|
20
|
-
function createPlatformFSAdapter() {
|
|
21
|
-
const fs = createFileSystem();
|
|
22
|
-
return {
|
|
23
|
-
readFile(path) {
|
|
24
|
-
return fs.readTextFile(path);
|
|
25
|
-
},
|
|
26
|
-
writeFile(path, content) {
|
|
27
|
-
return fs.writeTextFile(path, content);
|
|
28
|
-
},
|
|
29
|
-
exists(path) {
|
|
30
|
-
return fs.exists(path);
|
|
31
|
-
},
|
|
32
|
-
remove(path) {
|
|
33
|
-
return fs.remove(path);
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
/** Create lockfile manager. */
|
|
38
|
-
export function createLockfileManager(projectDir, fsAdapter) {
|
|
39
|
-
const fs = fsAdapter ?? createPlatformFSAdapter();
|
|
40
|
-
const lockfilePath = `${projectDir}/${LOCKFILE_NAME}`;
|
|
41
|
-
let cache = null;
|
|
42
|
-
let dirty = false;
|
|
43
|
-
async function read() {
|
|
44
|
-
if (cache)
|
|
45
|
-
return cache;
|
|
46
|
-
try {
|
|
47
|
-
const exists = await fs.exists(lockfilePath);
|
|
48
|
-
if (!exists)
|
|
49
|
-
return null;
|
|
50
|
-
const content = await fs.readFile(lockfilePath);
|
|
51
|
-
const parsed = JSON.parse(content);
|
|
52
|
-
if (parsed.version !== LOCKFILE_VERSION) {
|
|
53
|
-
logger.warn(`[lockfile] Version mismatch, expected ${LOCKFILE_VERSION}, got ${parsed.version}`);
|
|
54
|
-
cache = createEmptyLockfile();
|
|
55
|
-
return cache;
|
|
56
|
-
}
|
|
57
|
-
cache = parsed;
|
|
58
|
-
return cache;
|
|
59
|
-
}
|
|
60
|
-
catch (e) {
|
|
61
|
-
logger.debug(`Could not read lockfile: ${e}`);
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
async function write(data) {
|
|
66
|
-
cache = data;
|
|
67
|
-
const sorted = {
|
|
68
|
-
version: data.version,
|
|
69
|
-
imports: Object.fromEntries(Object.entries(data.imports).sort(([a], [b]) => a.localeCompare(b))),
|
|
70
|
-
};
|
|
71
|
-
await fs.writeFile(lockfilePath, `${JSON.stringify(sorted, null, 2)}\n`);
|
|
72
|
-
dirty = false;
|
|
73
|
-
logger.debug(`Written ${Object.keys(data.imports).length} entries`);
|
|
74
|
-
}
|
|
75
|
-
async function get(url) {
|
|
76
|
-
const data = await read();
|
|
77
|
-
return data?.imports[url] ?? null;
|
|
78
|
-
}
|
|
79
|
-
async function set(url, entry) {
|
|
80
|
-
const data = (await read()) ?? createEmptyLockfile();
|
|
81
|
-
data.imports[url] = entry;
|
|
82
|
-
cache = data;
|
|
83
|
-
dirty = true;
|
|
84
|
-
}
|
|
85
|
-
async function has(url) {
|
|
86
|
-
const data = await read();
|
|
87
|
-
return url in (data?.imports ?? {});
|
|
88
|
-
}
|
|
89
|
-
async function clear() {
|
|
90
|
-
cache = createEmptyLockfile();
|
|
91
|
-
dirty = false;
|
|
92
|
-
if (!fs.remove)
|
|
93
|
-
return;
|
|
94
|
-
const exists = await fs.exists(lockfilePath);
|
|
95
|
-
if (!exists)
|
|
96
|
-
return;
|
|
97
|
-
await fs.remove(lockfilePath);
|
|
98
|
-
}
|
|
99
|
-
async function flush() {
|
|
100
|
-
if (!dirty || !cache)
|
|
101
|
-
return;
|
|
102
|
-
await write(cache);
|
|
103
|
-
}
|
|
104
|
-
return { read, write, get, set, has, clear, flush };
|
|
105
|
-
}
|
|
106
|
-
const USER_AGENT_HEADERS = { "user-agent": "Mozilla/5.0 Veryfront/1.0" };
|
|
107
|
-
export async function fetchWithLock(options) {
|
|
108
|
-
const { lockfile, url, fetchFn = fetch, strict = false } = options;
|
|
109
|
-
const entry = await lockfile.get(url);
|
|
110
|
-
if (entry) {
|
|
111
|
-
logger.debug(`Cache hit for ${url}`);
|
|
112
|
-
const res = await fetchFn(entry.resolved, { headers: USER_AGENT_HEADERS });
|
|
113
|
-
if (!res.ok) {
|
|
114
|
-
if (strict) {
|
|
115
|
-
throw CACHE_ERROR.create({
|
|
116
|
-
detail: `Lockfile entry stale: ${url} resolved to ${entry.resolved} returned ${res.status}`,
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
logger.warn(`Cached URL ${entry.resolved} returned ${res.status}, refetching`);
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
const content = await res.text();
|
|
123
|
-
const currentIntegrity = await computeIntegrity(content);
|
|
124
|
-
if (currentIntegrity === entry.integrity) {
|
|
125
|
-
return {
|
|
126
|
-
content,
|
|
127
|
-
resolvedUrl: entry.resolved,
|
|
128
|
-
fromCache: true,
|
|
129
|
-
integrity: entry.integrity,
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
if (strict) {
|
|
133
|
-
throw CACHE_ERROR.create({
|
|
134
|
-
detail: `Integrity mismatch for ${url}: expected ${entry.integrity}, got ${currentIntegrity}`,
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
logger.warn(`Integrity mismatch for ${url}, updating lockfile`);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
logger.debug(`Fetching fresh: ${url}`);
|
|
141
|
-
const res = await fetchFn(url, { headers: USER_AGENT_HEADERS, redirect: "follow" });
|
|
142
|
-
if (!res.ok)
|
|
143
|
-
throw NETWORK_ERROR.create({ detail: `Failed to fetch ${url}: ${res.status}` });
|
|
144
|
-
const content = await res.text();
|
|
145
|
-
const resolvedUrl = res.url || url;
|
|
146
|
-
const integrity = await computeIntegrity(content);
|
|
147
|
-
await lockfile.set(url, {
|
|
148
|
-
resolved: resolvedUrl,
|
|
149
|
-
integrity,
|
|
150
|
-
fetchedAt: new Date().toISOString(),
|
|
151
|
-
});
|
|
152
|
-
await lockfile.flush();
|
|
153
|
-
return { content, resolvedUrl, fromCache: false, integrity };
|
|
154
|
-
}
|
|
155
|
-
const IMPORT_REGEX = /import\s+(?:(?:[\w*\s{},]*)\s+from\s+)?['"]([^'"]+)['"]/g;
|
|
156
|
-
const DYNAMIC_IMPORT_REGEX = /import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
157
|
-
const EXPORT_FROM_REGEX = /export\s+(?:[\w*\s{},]*)\s+from\s+['"]([^'"]+)['"]/g;
|
|
158
|
-
export function extractImports(content) {
|
|
159
|
-
const imports = [];
|
|
160
|
-
const seen = new Set();
|
|
161
|
-
function addMatches(regex, type) {
|
|
162
|
-
for (const match of content.matchAll(regex)) {
|
|
163
|
-
const specifier = match[1];
|
|
164
|
-
if (!specifier || seen.has(specifier))
|
|
165
|
-
continue;
|
|
166
|
-
seen.add(specifier);
|
|
167
|
-
imports.push({ specifier, type });
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
addMatches(IMPORT_REGEX, "static");
|
|
171
|
-
addMatches(EXPORT_FROM_REGEX, "static");
|
|
172
|
-
addMatches(DYNAMIC_IMPORT_REGEX, "dynamic");
|
|
173
|
-
return imports;
|
|
174
|
-
}
|
|
175
|
-
export function resolveImportUrl(specifier, baseUrl) {
|
|
176
|
-
if (specifier.startsWith("http://") || specifier.startsWith("https://"))
|
|
177
|
-
return specifier;
|
|
178
|
-
if (!specifier.startsWith("./") && !specifier.startsWith("../"))
|
|
179
|
-
return null;
|
|
180
|
-
try {
|
|
181
|
-
return new URL(specifier, baseUrl).toString();
|
|
182
|
-
}
|
|
183
|
-
catch (_) {
|
|
184
|
-
/* expected: specifier may not be a valid relative URL */
|
|
185
|
-
return null;
|
|
186
|
-
}
|
|
187
|
-
}
|
package/esm/src/utils/index.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Runtime detection, logging, constants, hashing, and feature flags.
|
|
3
|
-
*
|
|
4
|
-
* @module utils
|
|
5
|
-
*
|
|
6
|
-
* @example Structured logging
|
|
7
|
-
* ```ts
|
|
8
|
-
* import { serverLogger } from "veryfront/utils";
|
|
9
|
-
*
|
|
10
|
-
* serverLogger.info("Booting server", { project_id: "proj_123" });
|
|
11
|
-
* ```
|
|
12
|
-
*/
|
|
13
|
-
export { type GlobalWithBun, type GlobalWithDeno, type GlobalWithProcess, hasBunRuntime, hasDenoRuntime, hasNodeProcess, } from "./runtime-guards.js";
|
|
14
|
-
export { __registerTraceContextGetter, __registerTraceContextGetter as registerTraceContextGetter, agentLogger, bundlerLogger, createRunUserLogger, logger, refreshLoggerConfig, rendererLogger, runWithRequestContextAsync, serverLogger, } from "./logger/index.js";
|
|
15
|
-
export type { Logger, RequestContext } from "./logger/index.js";
|
|
16
|
-
export { BREAKPOINT_LG, BREAKPOINT_MD, BREAKPOINT_SM, BREAKPOINT_XL, BYTES_PER_KB, DEFAULT_ALLOWED_CDN_HOSTS, DEFAULT_BUILD_CONCURRENCY, DEFAULT_DASHBOARD_PORT, DEFAULT_LRU_MAX_ENTRIES, DEV_SERVER_ENDPOINTS, FORBIDDEN_PATH_PATTERNS, getDenoStdNodeBase, getReactImportMap, HASH_SEED_DJB2, HASH_SEED_FNV1A, HMR_CLIENT_RELOAD_DELAY_MS, HMR_CLOSE_MESSAGE_TOO_LARGE, HMR_CLOSE_NORMAL, HMR_CLOSE_RATE_LIMIT, HMR_MAX_MESSAGE_SIZE_BYTES, HMR_MAX_MESSAGES_PER_MINUTE, HMR_RATE_LIMIT_WINDOW_MS, HTTP_BAD_REQUEST, HTTP_CONTENT_TYPE_IMAGE_GIF, HTTP_CONTENT_TYPE_IMAGE_ICO, HTTP_CONTENT_TYPE_IMAGE_JPEG, HTTP_CONTENT_TYPE_IMAGE_PNG, HTTP_CONTENT_TYPE_IMAGE_SVG, HTTP_CONTENT_TYPE_IMAGE_WEBP, HTTP_CONTENT_TYPES, HTTP_MODULE_FETCH_TIMEOUT_MS, HTTP_NETWORK_CONNECT_TIMEOUT, HTTP_NOT_FOUND, HTTP_NOT_IMPLEMENTED, HTTP_OK, HTTP_REDIRECT_FOUND, HTTP_SERVER_ERROR, HTTP_STATUS_CLIENT_ERROR_MIN, HTTP_STATUS_REDIRECT_MIN, HTTP_STATUS_SERVER_ERROR_MIN, HTTP_STATUS_SUCCESS_MIN, HTTP_UNAVAILABLE, IMAGE_OPTIMIZATION, MAX_BATCH_SIZE, MAX_PATH_LENGTH, MAX_PATH_TRAVERSAL_DEPTH, MS_PER_SECOND, PREFETCH_DEFAULT_DELAY_MS, PREFETCH_DEFAULT_TIMEOUT_MS, PREFETCH_MAX_SIZE_BYTES, REACT_DEFAULT_VERSION, RESPONSIVE_IMAGE_WIDTH_LG, RESPONSIVE_IMAGE_WIDTHS, RSC_MANIFEST_CACHE_TTL_MS, TSX_LAYOUT_MAX_ENTRIES, TSX_LAYOUT_PER_PROJECT_MAX_ENTRIES, Z_INDEX_DEV_INDICATOR, Z_INDEX_ERROR_OVERLAY, } from "./constants/index.js";
|
|
17
|
-
export { VERSION } from "./version.js";
|
|
18
|
-
export { type BundleCode as HashBundleCode, computeCodeHash, computeHash, fnv1aHash, shortHash, simpleHash, } from "./hash-utils.js";
|
|
19
|
-
export { MemoCache, memoize, memoizeAsync, simpleHash as memoizeHash } from "./memoize.js";
|
|
20
|
-
export { normalizePath } from "./path-utils.js";
|
|
21
|
-
export { type BundleCode, type BundleMetadata, getBundleManifestStore } from "./bundle-manifest.js";
|
|
22
|
-
export { isRSCEnabled } from "./feature-flags.js";
|
|
23
|
-
export { isCompiledBinary } from "./platform.js";
|
|
24
|
-
export { computeIntegrity, createLockfileManager, type LockfileManager, } from "./import-lockfile.js";
|
|
25
|
-
export { endRequest, isEnabled, startRequest, startTimer, timeAsync } from "./perf-timer.js";
|
|
26
|
-
export { parallelMap } from "./parallel.js";
|
|
27
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,aAAa,EACb,cAAc,EACd,cAAc,GACf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,IAAI,0BAA0B,EAC1D,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,MAAM,EACN,mBAAmB,EACnB,cAAc,EACd,0BAA0B,EAC1B,YAAY,GACb,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,EACL,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,0BAA0B,EAC1B,2BAA2B,EAC3B,gBAAgB,EAChB,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,wBAAwB,EACxB,gBAAgB,EAChB,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,EAC5B,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,EAC5B,kBAAkB,EAClB,4BAA4B,EAC5B,4BAA4B,EAC5B,cAAc,EACd,oBAAoB,EACpB,OAAO,EACP,mBAAmB,EACnB,iBAAiB,EACjB,4BAA4B,EAC5B,wBAAwB,EACxB,4BAA4B,EAC5B,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,wBAAwB,EACxB,aAAa,EACb,yBAAyB,EACzB,2BAA2B,EAC3B,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,kCAAkC,EAClC,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EACL,KAAK,UAAU,IAAI,cAAc,EACjC,eAAe,EACf,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,GACX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3F,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEpG,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,KAAK,eAAe,GACrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE7F,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
package/esm/src/utils/index.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Runtime detection, logging, constants, hashing, and feature flags.
|
|
3
|
-
*
|
|
4
|
-
* @module utils
|
|
5
|
-
*
|
|
6
|
-
* @example Structured logging
|
|
7
|
-
* ```ts
|
|
8
|
-
* import { serverLogger } from "veryfront/utils";
|
|
9
|
-
*
|
|
10
|
-
* serverLogger.info("Booting server", { project_id: "proj_123" });
|
|
11
|
-
* ```
|
|
12
|
-
*/
|
|
13
|
-
export { hasBunRuntime, hasDenoRuntime, hasNodeProcess, } from "./runtime-guards.js";
|
|
14
|
-
export { __registerTraceContextGetter, __registerTraceContextGetter as registerTraceContextGetter, agentLogger, bundlerLogger, createRunUserLogger, logger, refreshLoggerConfig, rendererLogger, runWithRequestContextAsync, serverLogger, } from "./logger/index.js";
|
|
15
|
-
export { BREAKPOINT_LG, BREAKPOINT_MD, BREAKPOINT_SM, BREAKPOINT_XL, BYTES_PER_KB, DEFAULT_ALLOWED_CDN_HOSTS, DEFAULT_BUILD_CONCURRENCY, DEFAULT_DASHBOARD_PORT, DEFAULT_LRU_MAX_ENTRIES, DEV_SERVER_ENDPOINTS, FORBIDDEN_PATH_PATTERNS, getDenoStdNodeBase, getReactImportMap, HASH_SEED_DJB2, HASH_SEED_FNV1A, HMR_CLIENT_RELOAD_DELAY_MS, HMR_CLOSE_MESSAGE_TOO_LARGE, HMR_CLOSE_NORMAL, HMR_CLOSE_RATE_LIMIT, HMR_MAX_MESSAGE_SIZE_BYTES, HMR_MAX_MESSAGES_PER_MINUTE, HMR_RATE_LIMIT_WINDOW_MS, HTTP_BAD_REQUEST, HTTP_CONTENT_TYPE_IMAGE_GIF, HTTP_CONTENT_TYPE_IMAGE_ICO, HTTP_CONTENT_TYPE_IMAGE_JPEG, HTTP_CONTENT_TYPE_IMAGE_PNG, HTTP_CONTENT_TYPE_IMAGE_SVG, HTTP_CONTENT_TYPE_IMAGE_WEBP, HTTP_CONTENT_TYPES, HTTP_MODULE_FETCH_TIMEOUT_MS, HTTP_NETWORK_CONNECT_TIMEOUT, HTTP_NOT_FOUND, HTTP_NOT_IMPLEMENTED, HTTP_OK, HTTP_REDIRECT_FOUND, HTTP_SERVER_ERROR, HTTP_STATUS_CLIENT_ERROR_MIN, HTTP_STATUS_REDIRECT_MIN, HTTP_STATUS_SERVER_ERROR_MIN, HTTP_STATUS_SUCCESS_MIN, HTTP_UNAVAILABLE, IMAGE_OPTIMIZATION, MAX_BATCH_SIZE, MAX_PATH_LENGTH, MAX_PATH_TRAVERSAL_DEPTH, MS_PER_SECOND, PREFETCH_DEFAULT_DELAY_MS, PREFETCH_DEFAULT_TIMEOUT_MS, PREFETCH_MAX_SIZE_BYTES, REACT_DEFAULT_VERSION, RESPONSIVE_IMAGE_WIDTH_LG, RESPONSIVE_IMAGE_WIDTHS, RSC_MANIFEST_CACHE_TTL_MS, TSX_LAYOUT_MAX_ENTRIES, TSX_LAYOUT_PER_PROJECT_MAX_ENTRIES, Z_INDEX_DEV_INDICATOR, Z_INDEX_ERROR_OVERLAY, } from "./constants/index.js";
|
|
16
|
-
export { VERSION } from "./version.js";
|
|
17
|
-
export { computeCodeHash, computeHash, fnv1aHash, shortHash, simpleHash, } from "./hash-utils.js";
|
|
18
|
-
export { MemoCache, memoize, memoizeAsync, simpleHash as memoizeHash } from "./memoize.js";
|
|
19
|
-
export { normalizePath } from "./path-utils.js";
|
|
20
|
-
export { getBundleManifestStore } from "./bundle-manifest.js";
|
|
21
|
-
export { isRSCEnabled } from "./feature-flags.js";
|
|
22
|
-
export { isCompiledBinary } from "./platform.js";
|
|
23
|
-
export { computeIntegrity, createLockfileManager, } from "./import-lockfile.js";
|
|
24
|
-
export { endRequest, isEnabled, startRequest, startTimer, timeAsync } from "./perf-timer.js";
|
|
25
|
-
export { parallelMap } from "./parallel.js";
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canonical component names for structured logging.
|
|
3
|
-
*
|
|
4
|
-
* These names are used with `logger.component("name")` to create
|
|
5
|
-
* component-scoped loggers. The component field appears in JSON output
|
|
6
|
-
* for Grafana/Loki filtering and as `[name]` in text output.
|
|
7
|
-
*
|
|
8
|
-
* Convention: lowercase-kebab-case.
|
|
9
|
-
* Not enforced at runtime — any string is accepted. This registry is a
|
|
10
|
-
* non-exhaustive reference to promote reuse and discoverability.
|
|
11
|
-
*
|
|
12
|
-
* @module
|
|
13
|
-
*/
|
|
14
|
-
export declare const LogComponents: {
|
|
15
|
-
readonly server: "server";
|
|
16
|
-
readonly config: "config";
|
|
17
|
-
readonly middleware: "middleware";
|
|
18
|
-
readonly cors: "cors";
|
|
19
|
-
readonly security: "security";
|
|
20
|
-
readonly discovery: "discovery";
|
|
21
|
-
readonly pipeline: "pipeline";
|
|
22
|
-
readonly global: "global";
|
|
23
|
-
readonly ssr: "ssr";
|
|
24
|
-
readonly ssrService: "ssr-service";
|
|
25
|
-
readonly ssrOrchestrator: "ssr-orchestrator";
|
|
26
|
-
readonly rsc: "rsc";
|
|
27
|
-
readonly html: "html";
|
|
28
|
-
readonly htmlGenerator: "html-generator";
|
|
29
|
-
readonly mdx: "mdx";
|
|
30
|
-
readonly mdxCompiler: "mdx-compiler";
|
|
31
|
-
readonly mdxCache: "mdx-cache";
|
|
32
|
-
readonly hmr: "hmr";
|
|
33
|
-
readonly hmrHandler: "hmr-handler";
|
|
34
|
-
readonly hmrServer: "hmr-server";
|
|
35
|
-
readonly renderer: "renderer";
|
|
36
|
-
readonly snippetRenderer: "snippet-renderer";
|
|
37
|
-
readonly build: "build";
|
|
38
|
-
readonly esm: "esm";
|
|
39
|
-
readonly esmTransform: "esm-transform";
|
|
40
|
-
readonly ssrTransform: "ssr-transform";
|
|
41
|
-
readonly ssrModuleLoader: "ssr-module-loader";
|
|
42
|
-
readonly moduleLoader: "module-loader";
|
|
43
|
-
readonly moduleServer: "module-server";
|
|
44
|
-
readonly cache: "cache";
|
|
45
|
-
readonly cacheRegistry: "cache-registry";
|
|
46
|
-
readonly distributedCache: "distributed-cache";
|
|
47
|
-
readonly httpCache: "http-cache";
|
|
48
|
-
readonly httpCacheWrapper: "http-cache-wrapper";
|
|
49
|
-
readonly ssrHttpCache: "ssr-http-cache";
|
|
50
|
-
readonly fileCache: "file-cache";
|
|
51
|
-
readonly moduleCache: "module-cache";
|
|
52
|
-
readonly transformCache: "transform-cache";
|
|
53
|
-
readonly api: "api";
|
|
54
|
-
readonly httpHandler: "http-handler";
|
|
55
|
-
readonly client: "client";
|
|
56
|
-
readonly runtimeHandler: "runtime-handler";
|
|
57
|
-
readonly redis: "redis";
|
|
58
|
-
readonly fsIntegration: "fs-integration";
|
|
59
|
-
readonly readOperations: "read-operations";
|
|
60
|
-
readonly otel: "otel";
|
|
61
|
-
readonly tracing: "tracing";
|
|
62
|
-
readonly metrics: "metrics";
|
|
63
|
-
readonly autoInstrument: "auto-instrument";
|
|
64
|
-
readonly perf: "perf";
|
|
65
|
-
readonly agent: "agent";
|
|
66
|
-
readonly tool: "tool";
|
|
67
|
-
readonly workflowDiscovery: "workflow-discovery";
|
|
68
|
-
readonly validator: "validator";
|
|
69
|
-
readonly error: "error";
|
|
70
|
-
readonly env: "env";
|
|
71
|
-
};
|
|
72
|
-
export type LogComponent = (typeof LogComponents)[keyof typeof LogComponents];
|
|
73
|
-
//# sourceMappingURL=components.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../src/src/utils/logger/components.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4EhB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC"}
|