@veryfront/ext-content-mdx 0.1.985
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/LICENSE +202 -0
- package/NOTICE +2 -0
- package/README.md +42 -0
- package/esm/_dnt.polyfills.d.ts +18 -0
- package/esm/_dnt.polyfills.d.ts.map +1 -0
- package/esm/_dnt.polyfills.js +15 -0
- package/esm/_dnt.shims.d.ts +12 -0
- package/esm/_dnt.shims.d.ts.map +1 -0
- package/esm/_dnt.shims.js +68 -0
- package/esm/deno.d.ts +427 -0
- package/esm/deno.d.ts.map +1 -0
- package/esm/deno.js +512 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_chars.d.ts +33 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_chars.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_chars.js +48 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_loader_state.d.ts +64 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_loader_state.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_loader_state.js +1371 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_schema.d.ts +44 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_schema.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_schema.js +117 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/binary.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/binary.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/binary.js +103 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/bool.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/bool.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/bool.js +32 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/float.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/float.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/float.js +96 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/int.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/int.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/int.js +159 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/map.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/map.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/map.js +14 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/merge.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/merge.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/merge.js +10 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/nil.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/nil.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/nil.js +22 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/omap.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/omap.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/omap.js +29 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/pairs.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/pairs.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/pairs.js +19 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/regexp.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/regexp.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/regexp.js +30 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/seq.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/seq.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/seq.js +10 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/set.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/set.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/set.js +14 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/str.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/str.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/str.js +9 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/timestamp.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/timestamp.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/timestamp.js +81 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/undefined.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/undefined.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/undefined.js +20 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type.d.ts +32 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type.js +6 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_utils.d.ts +4 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_utils.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_utils.js +13 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/parse.d.ts +76 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/parse.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/parse.js +91 -0
- package/esm/extensions/ext-content-mdx/src/compiler/markdown-compile.d.ts +3 -0
- package/esm/extensions/ext-content-mdx/src/compiler/markdown-compile.d.ts.map +1 -0
- package/esm/extensions/ext-content-mdx/src/compiler/markdown-compile.js +99 -0
- package/esm/extensions/ext-content-mdx/src/compiler/mdx-compile.d.ts +3 -0
- package/esm/extensions/ext-content-mdx/src/compiler/mdx-compile.d.ts.map +1 -0
- package/esm/extensions/ext-content-mdx/src/compiler/mdx-compile.js +53 -0
- package/esm/extensions/ext-content-mdx/src/index.d.ts +31 -0
- package/esm/extensions/ext-content-mdx/src/index.d.ts.map +1 -0
- package/esm/extensions/ext-content-mdx/src/index.js +56 -0
- package/esm/extensions/ext-content-mdx/src/plugins/plugin-loader.d.ts +4 -0
- package/esm/extensions/ext-content-mdx/src/plugins/plugin-loader.d.ts.map +1 -0
- package/esm/extensions/ext-content-mdx/src/plugins/plugin-loader.js +18 -0
- package/esm/extensions/ext-content-mdx/src/plugins/rehype-node-positions.d.ts +20 -0
- package/esm/extensions/ext-content-mdx/src/plugins/rehype-node-positions.d.ts.map +1 -0
- package/esm/extensions/ext-content-mdx/src/plugins/rehype-node-positions.js +45 -0
- package/esm/extensions/ext-content-mdx/src/plugins/remark-headings.d.ts +4 -0
- package/esm/extensions/ext-content-mdx/src/plugins/remark-headings.d.ts.map +1 -0
- package/esm/extensions/ext-content-mdx/src/plugins/remark-headings.js +69 -0
- package/esm/extensions/ext-content-mdx/src/plugins/remark-mdx-utils.d.ts +14 -0
- package/esm/extensions/ext-content-mdx/src/plugins/remark-mdx-utils.d.ts.map +1 -0
- package/esm/extensions/ext-content-mdx/src/plugins/remark-mdx-utils.js +191 -0
- package/esm/package.json +3 -0
- package/esm/src/config/defaults.d.ts +39 -0
- package/esm/src/config/defaults.d.ts.map +1 -0
- package/esm/src/config/defaults.js +65 -0
- package/esm/src/errors/error-registry/agent.d.ts +18 -0
- package/esm/src/errors/error-registry/agent.d.ts.map +1 -0
- package/esm/src/errors/error-registry/agent.js +60 -0
- package/esm/src/errors/error-registry/boundary.d.ts +16 -0
- package/esm/src/errors/error-registry/boundary.d.ts.map +1 -0
- package/esm/src/errors/error-registry/boundary.js +52 -0
- package/esm/src/errors/error-registry/build.d.ts +20 -0
- package/esm/src/errors/error-registry/build.d.ts.map +1 -0
- package/esm/src/errors/error-registry/build.js +68 -0
- package/esm/src/errors/error-registry/config.d.ts +22 -0
- package/esm/src/errors/error-registry/config.d.ts.map +1 -0
- package/esm/src/errors/error-registry/config.js +70 -0
- package/esm/src/errors/error-registry/deploy.d.ts +12 -0
- package/esm/src/errors/error-registry/deploy.d.ts.map +1 -0
- package/esm/src/errors/error-registry/deploy.js +36 -0
- package/esm/src/errors/error-registry/dev.d.ts +14 -0
- package/esm/src/errors/error-registry/dev.d.ts.map +1 -0
- package/esm/src/errors/error-registry/dev.js +44 -0
- package/esm/src/errors/error-registry/general.d.ts +29 -0
- package/esm/src/errors/error-registry/general.d.ts.map +1 -0
- package/esm/src/errors/error-registry/general.js +92 -0
- package/esm/src/errors/error-registry/module.d.ts +16 -0
- package/esm/src/errors/error-registry/module.d.ts.map +1 -0
- package/esm/src/errors/error-registry/module.js +52 -0
- package/esm/src/errors/error-registry/route.d.ts +16 -0
- package/esm/src/errors/error-registry/route.d.ts.map +1 -0
- package/esm/src/errors/error-registry/route.js +52 -0
- package/esm/src/errors/error-registry/runtime.d.ts +18 -0
- package/esm/src/errors/error-registry/runtime.d.ts.map +1 -0
- package/esm/src/errors/error-registry/runtime.js +60 -0
- package/esm/src/errors/error-registry/server.d.ts +39 -0
- package/esm/src/errors/error-registry/server.d.ts.map +1 -0
- package/esm/src/errors/error-registry/server.js +129 -0
- package/esm/src/errors/error-registry-helpers.d.ts +6 -0
- package/esm/src/errors/error-registry-helpers.d.ts.map +1 -0
- package/esm/src/errors/error-registry-helpers.js +9 -0
- package/esm/src/errors/error-registry.d.ts +114 -0
- package/esm/src/errors/error-registry.d.ts.map +1 -0
- package/esm/src/errors/error-registry.js +60 -0
- package/esm/src/errors/types.d.ts +84 -0
- package/esm/src/errors/types.d.ts.map +1 -0
- package/esm/src/errors/types.js +69 -0
- package/esm/src/errors/veryfront-error.d.ts +149 -0
- package/esm/src/errors/veryfront-error.d.ts.map +1 -0
- package/esm/src/errors/veryfront-error.js +61 -0
- package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.d.ts +13 -0
- package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.d.ts.map +1 -0
- package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.js +55 -0
- package/esm/src/observability/tracing/api-shim.d.ts +178 -0
- package/esm/src/observability/tracing/api-shim.d.ts.map +1 -0
- package/esm/src/observability/tracing/api-shim.js +241 -0
- package/esm/src/observability/tracing/otlp-setup.d.ts +56 -0
- package/esm/src/observability/tracing/otlp-setup.d.ts.map +1 -0
- package/esm/src/observability/tracing/otlp-setup.js +206 -0
- package/esm/src/observability/tracing/telemetry-env.d.ts +3 -0
- package/esm/src/observability/tracing/telemetry-env.d.ts.map +1 -0
- package/esm/src/observability/tracing/telemetry-env.js +10 -0
- package/esm/src/platform/adapters/base.d.ts +188 -0
- package/esm/src/platform/adapters/base.d.ts.map +1 -0
- package/esm/src/platform/adapters/base.js +15 -0
- package/esm/src/platform/compat/constants.d.ts +13 -0
- package/esm/src/platform/compat/constants.d.ts.map +1 -0
- package/esm/src/platform/compat/constants.js +12 -0
- package/esm/src/platform/compat/dynamic-import.d.ts +11 -0
- package/esm/src/platform/compat/dynamic-import.d.ts.map +1 -0
- package/esm/src/platform/compat/dynamic-import.js +10 -0
- package/esm/src/platform/compat/fs.d.ts +71 -0
- package/esm/src/platform/compat/fs.d.ts.map +1 -0
- package/esm/src/platform/compat/fs.js +277 -0
- package/esm/src/platform/compat/path/basic-operations.d.ts +9 -0
- package/esm/src/platform/compat/path/basic-operations.d.ts.map +1 -0
- package/esm/src/platform/compat/path/basic-operations.js +56 -0
- package/esm/src/platform/compat/path/index.d.ts +13 -0
- package/esm/src/platform/compat/path/index.d.ts.map +1 -0
- package/esm/src/platform/compat/path/index.js +11 -0
- package/esm/src/platform/compat/path/parse-format.d.ts +4 -0
- package/esm/src/platform/compat/path/parse-format.d.ts.map +1 -0
- package/esm/src/platform/compat/path/parse-format.js +26 -0
- package/esm/src/platform/compat/path/resolution.d.ts +6 -0
- package/esm/src/platform/compat/path/resolution.d.ts.map +1 -0
- package/esm/src/platform/compat/path/resolution.js +121 -0
- package/esm/src/platform/compat/path/runtime.d.ts +8 -0
- package/esm/src/platform/compat/path/runtime.d.ts.map +1 -0
- package/esm/src/platform/compat/path/runtime.js +20 -0
- package/esm/src/platform/compat/path/security.d.ts +2 -0
- package/esm/src/platform/compat/path/security.d.ts.map +1 -0
- package/esm/src/platform/compat/path/security.js +24 -0
- package/esm/src/platform/compat/path/types.d.ts +22 -0
- package/esm/src/platform/compat/path/types.d.ts.map +1 -0
- package/esm/src/platform/compat/path/types.js +1 -0
- package/esm/src/platform/compat/path/url-conversion.d.ts +3 -0
- package/esm/src/platform/compat/path/url-conversion.d.ts.map +1 -0
- package/esm/src/platform/compat/path/url-conversion.js +45 -0
- package/esm/src/platform/compat/process/command.d.ts +31 -0
- package/esm/src/platform/compat/process/command.d.ts.map +1 -0
- package/esm/src/platform/compat/process/command.js +194 -0
- package/esm/src/platform/compat/process/env.d.ts +35 -0
- package/esm/src/platform/compat/process/env.d.ts.map +1 -0
- package/esm/src/platform/compat/process/env.js +194 -0
- package/esm/src/platform/compat/process/lifecycle.d.ts +99 -0
- package/esm/src/platform/compat/process/lifecycle.d.ts.map +1 -0
- package/esm/src/platform/compat/process/lifecycle.js +327 -0
- package/esm/src/platform/compat/process/runtime-process.d.ts +10 -0
- package/esm/src/platform/compat/process/runtime-process.d.ts.map +1 -0
- package/esm/src/platform/compat/process/runtime-process.js +25 -0
- package/esm/src/platform/compat/process.d.ts +5 -0
- package/esm/src/platform/compat/process.d.ts.map +1 -0
- package/esm/src/platform/compat/process.js +4 -0
- package/esm/src/platform/compat/runtime.d.ts +51 -0
- package/esm/src/platform/compat/runtime.d.ts.map +1 -0
- package/esm/src/platform/compat/runtime.js +101 -0
- package/esm/src/platform/compat/std/front-matter-yaml.d.ts +13 -0
- package/esm/src/platform/compat/std/front-matter-yaml.d.ts.map +1 -0
- package/esm/src/platform/compat/std/front-matter-yaml.js +28 -0
- package/esm/src/transforms/import-rewriter/url-builder.d.ts +70 -0
- package/esm/src/transforms/import-rewriter/url-builder.d.ts.map +1 -0
- package/esm/src/transforms/import-rewriter/url-builder.js +152 -0
- package/esm/src/transforms/md/utils.d.ts +14 -0
- package/esm/src/transforms/md/utils.d.ts.map +1 -0
- package/esm/src/transforms/md/utils.js +17 -0
- package/esm/src/transforms/mdx/compiler/frontmatter-extractor.d.ts +6 -0
- package/esm/src/transforms/mdx/compiler/frontmatter-extractor.d.ts.map +1 -0
- package/esm/src/transforms/mdx/compiler/frontmatter-extractor.js +48 -0
- package/esm/src/transforms/mdx/compiler/import-rewriter.d.ts +10 -0
- package/esm/src/transforms/mdx/compiler/import-rewriter.d.ts.map +1 -0
- package/esm/src/transforms/mdx/compiler/import-rewriter.js +87 -0
- package/esm/src/utils/base64url.d.ts +6 -0
- package/esm/src/utils/base64url.d.ts.map +1 -0
- package/esm/src/utils/base64url.js +12 -0
- package/esm/src/utils/bundle-manifest.d.ts +63 -0
- package/esm/src/utils/bundle-manifest.d.ts.map +1 -0
- package/esm/src/utils/bundle-manifest.js +96 -0
- package/esm/src/utils/constants/buffers.d.ts +24 -0
- package/esm/src/utils/constants/buffers.d.ts.map +1 -0
- package/esm/src/utils/constants/buffers.js +23 -0
- package/esm/src/utils/constants/build.d.ts +8 -0
- package/esm/src/utils/constants/build.d.ts.map +1 -0
- package/esm/src/utils/constants/build.js +7 -0
- package/esm/src/utils/constants/cache.d.ts +74 -0
- package/esm/src/utils/constants/cache.d.ts.map +1 -0
- package/esm/src/utils/constants/cache.js +133 -0
- package/esm/src/utils/constants/cdn.d.ts +29 -0
- package/esm/src/utils/constants/cdn.d.ts.map +1 -0
- package/esm/src/utils/constants/cdn.js +58 -0
- package/esm/src/utils/constants/crypto.d.ts +10 -0
- package/esm/src/utils/constants/crypto.d.ts.map +1 -0
- package/esm/src/utils/constants/crypto.js +9 -0
- package/esm/src/utils/constants/env.d.ts +16 -0
- package/esm/src/utils/constants/env.d.ts.map +1 -0
- package/esm/src/utils/constants/env.js +20 -0
- package/esm/src/utils/constants/hash.d.ts +5 -0
- package/esm/src/utils/constants/hash.d.ts.map +1 -0
- package/esm/src/utils/constants/hash.js +4 -0
- package/esm/src/utils/constants/hmr.d.ts +24 -0
- package/esm/src/utils/constants/hmr.d.ts.map +1 -0
- package/esm/src/utils/constants/hmr.js +26 -0
- package/esm/src/utils/constants/html.d.ts +13 -0
- package/esm/src/utils/constants/html.d.ts.map +1 -0
- package/esm/src/utils/constants/html.js +12 -0
- package/esm/src/utils/constants/http.d.ts +77 -0
- package/esm/src/utils/constants/http.d.ts.map +1 -0
- package/esm/src/utils/constants/http.js +76 -0
- package/esm/src/utils/constants/index.d.ts +23 -0
- package/esm/src/utils/constants/index.d.ts.map +1 -0
- package/esm/src/utils/constants/index.js +22 -0
- package/esm/src/utils/constants/limits.d.ts +27 -0
- package/esm/src/utils/constants/limits.d.ts.map +1 -0
- package/esm/src/utils/constants/limits.js +26 -0
- package/esm/src/utils/constants/metrics.d.ts +10 -0
- package/esm/src/utils/constants/metrics.d.ts.map +1 -0
- package/esm/src/utils/constants/metrics.js +34 -0
- package/esm/src/utils/constants/network.d.ts +23 -0
- package/esm/src/utils/constants/network.d.ts.map +1 -0
- package/esm/src/utils/constants/network.js +27 -0
- package/esm/src/utils/constants/priorities.d.ts +31 -0
- package/esm/src/utils/constants/priorities.d.ts.map +1 -0
- package/esm/src/utils/constants/priorities.js +30 -0
- package/esm/src/utils/constants/retry.d.ts +14 -0
- package/esm/src/utils/constants/retry.d.ts.map +1 -0
- package/esm/src/utils/constants/retry.js +13 -0
- package/esm/src/utils/constants/security.d.ts +16 -0
- package/esm/src/utils/constants/security.d.ts.map +1 -0
- package/esm/src/utils/constants/security.js +15 -0
- package/esm/src/utils/constants/server.d.ts +107 -0
- package/esm/src/utils/constants/server.d.ts.map +1 -0
- package/esm/src/utils/constants/server.js +120 -0
- package/esm/src/utils/feature-flags.d.ts +7 -0
- package/esm/src/utils/feature-flags.d.ts.map +1 -0
- package/esm/src/utils/feature-flags.js +8 -0
- package/esm/src/utils/hash-utils.d.ts +19 -0
- package/esm/src/utils/hash-utils.d.ts.map +1 -0
- package/esm/src/utils/hash-utils.js +42 -0
- package/esm/src/utils/import-lockfile.d.ts +52 -0
- package/esm/src/utils/import-lockfile.d.ts.map +1 -0
- package/esm/src/utils/import-lockfile.js +187 -0
- package/esm/src/utils/index.d.ts +27 -0
- package/esm/src/utils/index.d.ts.map +1 -0
- package/esm/src/utils/index.js +25 -0
- package/esm/src/utils/logger/components.d.ts +73 -0
- package/esm/src/utils/logger/components.d.ts.map +1 -0
- package/esm/src/utils/logger/components.js +81 -0
- package/esm/src/utils/logger/core.d.ts +73 -0
- package/esm/src/utils/logger/core.d.ts.map +1 -0
- package/esm/src/utils/logger/core.js +143 -0
- package/esm/src/utils/logger/index.d.ts +10 -0
- package/esm/src/utils/logger/index.d.ts.map +1 -0
- package/esm/src/utils/logger/index.js +9 -0
- package/esm/src/utils/logger/logger.d.ts +166 -0
- package/esm/src/utils/logger/logger.d.ts.map +1 -0
- package/esm/src/utils/logger/logger.js +445 -0
- package/esm/src/utils/logger/redact.d.ts +74 -0
- package/esm/src/utils/logger/redact.d.ts.map +1 -0
- package/esm/src/utils/logger/redact.js +294 -0
- package/esm/src/utils/logger/request-context.d.ts +27 -0
- package/esm/src/utils/logger/request-context.d.ts.map +1 -0
- package/esm/src/utils/logger/request-context.js +28 -0
- package/esm/src/utils/memoize.d.ts +19 -0
- package/esm/src/utils/memoize.d.ts.map +1 -0
- package/esm/src/utils/memoize.js +72 -0
- package/esm/src/utils/parallel.d.ts +25 -0
- package/esm/src/utils/parallel.d.ts.map +1 -0
- package/esm/src/utils/parallel.js +91 -0
- package/esm/src/utils/path-utils.d.ts +34 -0
- package/esm/src/utils/path-utils.d.ts.map +1 -0
- package/esm/src/utils/path-utils.js +138 -0
- package/esm/src/utils/perf-timer.d.ts +11 -0
- package/esm/src/utils/perf-timer.d.ts.map +1 -0
- package/esm/src/utils/perf-timer.js +114 -0
- package/esm/src/utils/platform.d.ts +9 -0
- package/esm/src/utils/platform.d.ts.map +1 -0
- package/esm/src/utils/platform.js +20 -0
- package/esm/src/utils/runtime-guards.d.ts +29 -0
- package/esm/src/utils/runtime-guards.d.ts.map +1 -0
- package/esm/src/utils/runtime-guards.js +23 -0
- package/esm/src/utils/version-constant.d.ts +3 -0
- package/esm/src/utils/version-constant.d.ts.map +1 -0
- package/esm/src/utils/version-constant.js +4 -0
- package/esm/src/utils/version.d.ts +17 -0
- package/esm/src/utils/version.d.ts.map +1 -0
- package/esm/src/utils/version.js +36 -0
- package/package.json +80 -0
|
@@ -0,0 +1,187 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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";
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,81 @@
|
|
|
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 const LogComponents = {
|
|
15
|
+
// Server & infrastructure
|
|
16
|
+
server: "server",
|
|
17
|
+
config: "config",
|
|
18
|
+
middleware: "middleware",
|
|
19
|
+
cors: "cors",
|
|
20
|
+
security: "security",
|
|
21
|
+
discovery: "discovery",
|
|
22
|
+
pipeline: "pipeline",
|
|
23
|
+
global: "global",
|
|
24
|
+
// Rendering
|
|
25
|
+
ssr: "ssr",
|
|
26
|
+
ssrService: "ssr-service",
|
|
27
|
+
ssrOrchestrator: "ssr-orchestrator",
|
|
28
|
+
rsc: "rsc",
|
|
29
|
+
html: "html",
|
|
30
|
+
htmlGenerator: "html-generator",
|
|
31
|
+
mdx: "mdx",
|
|
32
|
+
mdxCompiler: "mdx-compiler",
|
|
33
|
+
mdxCache: "mdx-cache",
|
|
34
|
+
hmr: "hmr",
|
|
35
|
+
hmrHandler: "hmr-handler",
|
|
36
|
+
hmrServer: "hmr-server",
|
|
37
|
+
renderer: "renderer",
|
|
38
|
+
snippetRenderer: "snippet-renderer",
|
|
39
|
+
// Build & transforms
|
|
40
|
+
build: "build",
|
|
41
|
+
esm: "esm",
|
|
42
|
+
esmTransform: "esm-transform",
|
|
43
|
+
ssrTransform: "ssr-transform",
|
|
44
|
+
ssrModuleLoader: "ssr-module-loader",
|
|
45
|
+
moduleLoader: "module-loader",
|
|
46
|
+
moduleServer: "module-server",
|
|
47
|
+
// Caching
|
|
48
|
+
cache: "cache",
|
|
49
|
+
cacheRegistry: "cache-registry",
|
|
50
|
+
distributedCache: "distributed-cache",
|
|
51
|
+
httpCache: "http-cache",
|
|
52
|
+
httpCacheWrapper: "http-cache-wrapper",
|
|
53
|
+
ssrHttpCache: "ssr-http-cache",
|
|
54
|
+
fileCache: "file-cache",
|
|
55
|
+
moduleCache: "module-cache",
|
|
56
|
+
transformCache: "transform-cache",
|
|
57
|
+
// API & HTTP
|
|
58
|
+
api: "api",
|
|
59
|
+
httpHandler: "http-handler",
|
|
60
|
+
client: "client",
|
|
61
|
+
runtimeHandler: "runtime-handler",
|
|
62
|
+
// Platform & adapters
|
|
63
|
+
redis: "redis",
|
|
64
|
+
fsIntegration: "fs-integration",
|
|
65
|
+
readOperations: "read-operations",
|
|
66
|
+
// Observability
|
|
67
|
+
otel: "otel",
|
|
68
|
+
tracing: "tracing",
|
|
69
|
+
metrics: "metrics",
|
|
70
|
+
autoInstrument: "auto-instrument",
|
|
71
|
+
perf: "perf",
|
|
72
|
+
// Agent & AI
|
|
73
|
+
agent: "agent",
|
|
74
|
+
tool: "tool",
|
|
75
|
+
// Workflow
|
|
76
|
+
workflowDiscovery: "workflow-discovery",
|
|
77
|
+
// Misc
|
|
78
|
+
validator: "validator",
|
|
79
|
+
error: "error",
|
|
80
|
+
env: "env",
|
|
81
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared logger formatting utilities.
|
|
3
|
+
* This module contains pure formatting functions with no external dependencies,
|
|
4
|
+
* enabling reuse between the main logger and proxy logger.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
export declare const TAG_WIDTH = 10;
|
|
9
|
+
export declare const PREFIX_WIDTH = 23;
|
|
10
|
+
export type LogLevelName = "debug" | "info" | "warn" | "error";
|
|
11
|
+
export declare const LEVEL_GLYPHS: Record<LogLevelName, string>;
|
|
12
|
+
export declare const ANSI: {
|
|
13
|
+
readonly reset: "\u001B[0m";
|
|
14
|
+
readonly dim: "\u001B[2m";
|
|
15
|
+
readonly gray: "\u001B[90m";
|
|
16
|
+
readonly red: "\u001B[31m";
|
|
17
|
+
readonly green: "\u001B[32m";
|
|
18
|
+
readonly yellow: "\u001B[33m";
|
|
19
|
+
readonly blue: "\u001B[34m";
|
|
20
|
+
readonly magenta: "\u001B[35m";
|
|
21
|
+
readonly cyan: "\u001B[36m";
|
|
22
|
+
};
|
|
23
|
+
export declare const LEVEL_COLORS: Record<LogLevelName, string>;
|
|
24
|
+
/**
|
|
25
|
+
* Pad or truncate a tag to fixed width for aligned output.
|
|
26
|
+
*/
|
|
27
|
+
export declare function padTag(tag: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Format a timestamp as HH:MM:SS.
|
|
30
|
+
*/
|
|
31
|
+
export declare function formatTimestamp(date?: Date): string;
|
|
32
|
+
/**
|
|
33
|
+
* Apply ANSI color codes to text if enabled.
|
|
34
|
+
*/
|
|
35
|
+
export declare function colorize(text: string, color: string | undefined, enable: boolean): string;
|
|
36
|
+
/**
|
|
37
|
+
* Normalize whitespace in text (collapse multiple spaces to single space).
|
|
38
|
+
*/
|
|
39
|
+
export declare function normalizeText(value: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* Truncate text to maxLength, adding ellipsis if truncated.
|
|
42
|
+
*/
|
|
43
|
+
export declare function truncateText(value: string, maxLength?: number): string;
|
|
44
|
+
/**
|
|
45
|
+
* Format a value for log output (handles strings, numbers, booleans, objects).
|
|
46
|
+
*/
|
|
47
|
+
export declare function formatValue(value: unknown): string;
|
|
48
|
+
/**
|
|
49
|
+
* Serialized error structure for structured logging.
|
|
50
|
+
*/
|
|
51
|
+
export interface SerializedError {
|
|
52
|
+
name: string;
|
|
53
|
+
message: string;
|
|
54
|
+
stack?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Format a serialized error for text output.
|
|
58
|
+
*/
|
|
59
|
+
export declare function formatErrorText(error: SerializedError | undefined): string;
|
|
60
|
+
/**
|
|
61
|
+
* Serialize an error object for structured logging.
|
|
62
|
+
*/
|
|
63
|
+
export declare function serializeError(error: unknown): SerializedError | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Format context and error as indented key=value pairs.
|
|
66
|
+
* Filters out undefined values for cleaner output.
|
|
67
|
+
*/
|
|
68
|
+
export declare function formatContextText(context: Record<string, unknown>, error: SerializedError | undefined, enableColor: boolean): string;
|
|
69
|
+
/**
|
|
70
|
+
* Check if value is a non-null, non-array object (plain record).
|
|
71
|
+
*/
|
|
72
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
73
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/src/utils/logger/core.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,eAAO,MAAM,SAAS,KAAK,CAAC;AAC5B,eAAO,MAAM,YAAY,KAAK,CAAC;AAE/B,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE/D,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAKrD,CAAC;AAEF,eAAO,MAAM,IAAI;;;;;;;;;;CAUP,CAAC;AAEX,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAKrD,CAAC;AAMF;;GAEG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG1C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,GAAE,IAAiB,GAAG,MAAM,CAG/D;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAGzF;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,SAAK,GAAG,MAAM,CAGlE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAoBlD;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,GAAG,SAAS,GAAG,MAAM,CAI1E;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,GAAG,SAAS,CAM1E;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,KAAK,EAAE,eAAe,GAAG,SAAS,EAClC,WAAW,EAAE,OAAO,GACnB,MAAM,CASR;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared logger formatting utilities.
|
|
3
|
+
* This module contains pure formatting functions with no external dependencies,
|
|
4
|
+
* enabling reuse between the main logger and proxy logger.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
// ============================================================================
|
|
9
|
+
// Constants
|
|
10
|
+
// ============================================================================
|
|
11
|
+
export const TAG_WIDTH = 10;
|
|
12
|
+
export const PREFIX_WIDTH = 23; // timestamp(8) + gap(2) + tag(10) + space(1) + glyph(1) + space(1)
|
|
13
|
+
export const LEVEL_GLYPHS = {
|
|
14
|
+
debug: "·",
|
|
15
|
+
info: "●",
|
|
16
|
+
warn: "▲",
|
|
17
|
+
error: "✖",
|
|
18
|
+
};
|
|
19
|
+
export const ANSI = {
|
|
20
|
+
reset: "\u001b[0m",
|
|
21
|
+
dim: "\u001b[2m",
|
|
22
|
+
gray: "\u001b[90m",
|
|
23
|
+
red: "\u001b[31m",
|
|
24
|
+
green: "\u001b[32m",
|
|
25
|
+
yellow: "\u001b[33m",
|
|
26
|
+
blue: "\u001b[34m",
|
|
27
|
+
magenta: "\u001b[35m",
|
|
28
|
+
cyan: "\u001b[36m",
|
|
29
|
+
};
|
|
30
|
+
export const LEVEL_COLORS = {
|
|
31
|
+
debug: ANSI.gray,
|
|
32
|
+
info: ANSI.green,
|
|
33
|
+
warn: ANSI.yellow,
|
|
34
|
+
error: ANSI.red,
|
|
35
|
+
};
|
|
36
|
+
// ============================================================================
|
|
37
|
+
// Pure Formatting Functions (no dependencies)
|
|
38
|
+
// ============================================================================
|
|
39
|
+
/**
|
|
40
|
+
* Pad or truncate a tag to fixed width for aligned output.
|
|
41
|
+
*/
|
|
42
|
+
export function padTag(tag) {
|
|
43
|
+
if (tag.length >= TAG_WIDTH)
|
|
44
|
+
return tag.slice(0, TAG_WIDTH);
|
|
45
|
+
return tag.padEnd(TAG_WIDTH, " ");
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Format a timestamp as HH:MM:SS.
|
|
49
|
+
*/
|
|
50
|
+
export function formatTimestamp(date = new Date()) {
|
|
51
|
+
const pad = (value) => String(value).padStart(2, "0");
|
|
52
|
+
return `${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Apply ANSI color codes to text if enabled.
|
|
56
|
+
*/
|
|
57
|
+
export function colorize(text, color, enable) {
|
|
58
|
+
if (!enable || !color)
|
|
59
|
+
return text;
|
|
60
|
+
return `${color}${text}${ANSI.reset}`;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Normalize whitespace in text (collapse multiple spaces to single space).
|
|
64
|
+
*/
|
|
65
|
+
export function normalizeText(value) {
|
|
66
|
+
return value.replace(/\s+/g, " ");
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Truncate text to maxLength, adding ellipsis if truncated.
|
|
70
|
+
*/
|
|
71
|
+
export function truncateText(value, maxLength = 80) {
|
|
72
|
+
if (value.length <= maxLength)
|
|
73
|
+
return value;
|
|
74
|
+
return `${value.slice(0, maxLength - 1)}…`;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Format a value for log output (handles strings, numbers, booleans, objects).
|
|
78
|
+
*/
|
|
79
|
+
export function formatValue(value) {
|
|
80
|
+
if (typeof value === "string") {
|
|
81
|
+
const trimmed = normalizeText(value);
|
|
82
|
+
return /\s/.test(trimmed) ? JSON.stringify(trimmed) : trimmed;
|
|
83
|
+
}
|
|
84
|
+
if (typeof value === "number" || typeof value === "boolean")
|
|
85
|
+
return String(value);
|
|
86
|
+
if (value === null)
|
|
87
|
+
return "null";
|
|
88
|
+
if (value === undefined)
|
|
89
|
+
return "undefined";
|
|
90
|
+
let text;
|
|
91
|
+
try {
|
|
92
|
+
text = JSON.stringify(value);
|
|
93
|
+
}
|
|
94
|
+
catch (_) {
|
|
95
|
+
/* expected: JSON.stringify fails on circular references */
|
|
96
|
+
text = String(value);
|
|
97
|
+
}
|
|
98
|
+
// JSON.stringify can return undefined for certain values (e.g., functions, symbols)
|
|
99
|
+
if (text === undefined)
|
|
100
|
+
return "undefined";
|
|
101
|
+
return truncateText(normalizeText(text));
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Format a serialized error for text output.
|
|
105
|
+
*/
|
|
106
|
+
export function formatErrorText(error) {
|
|
107
|
+
if (!error)
|
|
108
|
+
return "";
|
|
109
|
+
const text = `${error.name}: ${error.message}`;
|
|
110
|
+
return truncateText(normalizeText(text), 120);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Serialize an error object for structured logging.
|
|
114
|
+
*/
|
|
115
|
+
export function serializeError(error) {
|
|
116
|
+
if (error instanceof Error) {
|
|
117
|
+
return { name: error.name, message: error.message, stack: error.stack };
|
|
118
|
+
}
|
|
119
|
+
if (error == null)
|
|
120
|
+
return undefined;
|
|
121
|
+
return { name: "UnknownError", message: String(error) };
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Format context and error as indented key=value pairs.
|
|
125
|
+
* Filters out undefined values for cleaner output.
|
|
126
|
+
*/
|
|
127
|
+
export function formatContextText(context, error, enableColor) {
|
|
128
|
+
const entries = Object.entries(context)
|
|
129
|
+
.filter(([_, value]) => value !== undefined)
|
|
130
|
+
.map(([key, value]) => `${key}=${formatValue(value)}`);
|
|
131
|
+
if (error)
|
|
132
|
+
entries.push(`err=${formatErrorText(error)}`);
|
|
133
|
+
if (entries.length === 0)
|
|
134
|
+
return "";
|
|
135
|
+
const indent = " ".repeat(PREFIX_WIDTH);
|
|
136
|
+
return `\n${indent}${colorize(entries.join(" "), ANSI.dim, enableColor)}`;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Check if value is a non-null, non-array object (plain record).
|
|
140
|
+
*/
|
|
141
|
+
export function isRecord(value) {
|
|
142
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
143
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utils Logger
|
|
3
|
+
*
|
|
4
|
+
* @module utils/logger
|
|
5
|
+
*/
|
|
6
|
+
export { __registerRequestContextGetter, __registerTraceContextGetter, __resetLoggerConfigForTests, __resetTraceContextGetterForTests, agentLogger, bundlerLogger, cliLogger, createRequestLogger, createRunUserLogger, getBaseLogger, getDefaultLevel, type LogEntry, type LogFormat, type Logger, logger, LogLevel, proxyLogger, refreshLoggerConfig, rendererLogger, serverLogger, } from "./logger.js";
|
|
7
|
+
export { ANSI, colorize, formatContextText, formatErrorText, formatTimestamp, formatValue, isRecord, LEVEL_COLORS, LEVEL_GLYPHS, type LogLevelName, normalizeText, padTag, PREFIX_WIDTH, type SerializedError, serializeError, TAG_WIDTH, truncateText, } from "./core.js";
|
|
8
|
+
export { getRequestContext, getRequestLogger, type RequestContext, requestContextStore, runWithRequestContext, runWithRequestContextAsync, } from "./request-context.js";
|
|
9
|
+
export { type LogComponent, LogComponents } from "./components.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/utils/logger/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,8BAA8B,EAC9B,4BAA4B,EAC5B,2BAA2B,EAC3B,iCAAiC,EACjC,WAAW,EACX,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,MAAM,EACX,MAAM,EACN,QAAQ,EACR,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,IAAI,EACJ,QAAQ,EACR,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,KAAK,YAAY,EACjB,aAAa,EACb,MAAM,EACN,YAAY,EACZ,KAAK,eAAe,EACpB,cAAc,EACd,SAAS,EACT,YAAY,GACb,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,cAAc,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utils Logger
|
|
3
|
+
*
|
|
4
|
+
* @module utils/logger
|
|
5
|
+
*/
|
|
6
|
+
export { __registerRequestContextGetter, __registerTraceContextGetter, __resetLoggerConfigForTests, __resetTraceContextGetterForTests, agentLogger, bundlerLogger, cliLogger, createRequestLogger, createRunUserLogger, getBaseLogger, getDefaultLevel, logger, LogLevel, proxyLogger, refreshLoggerConfig, rendererLogger, serverLogger, } from "./logger.js";
|
|
7
|
+
export { ANSI, colorize, formatContextText, formatErrorText, formatTimestamp, formatValue, isRecord, LEVEL_COLORS, LEVEL_GLYPHS, normalizeText, padTag, PREFIX_WIDTH, serializeError, TAG_WIDTH, truncateText, } from "./core.js";
|
|
8
|
+
export { getRequestContext, getRequestLogger, requestContextStore, runWithRequestContext, runWithRequestContextAsync, } from "./request-context.js";
|
|
9
|
+
export { LogComponents } from "./components.js";
|