@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,87 @@
|
|
|
1
|
+
import { dirname, join, resolve as pathResolve } from "../../../platform/compat/path/index.js";
|
|
2
|
+
function toAbsPath(spec, basedir) {
|
|
3
|
+
try {
|
|
4
|
+
if (spec.startsWith("file://"))
|
|
5
|
+
return new URL(spec).pathname;
|
|
6
|
+
if (spec.startsWith("/"))
|
|
7
|
+
return pathResolve(spec);
|
|
8
|
+
if (spec.startsWith("http://") || spec.startsWith("https://"))
|
|
9
|
+
return spec;
|
|
10
|
+
if (!spec.startsWith(".") && !spec.startsWith("/"))
|
|
11
|
+
return spec;
|
|
12
|
+
return pathResolve(join(basedir, spec));
|
|
13
|
+
}
|
|
14
|
+
catch (_) {
|
|
15
|
+
/* expected: specifier may not be a valid URL or path */
|
|
16
|
+
return spec;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function toBrowserFs(abs, baseUrl) {
|
|
20
|
+
if (abs.startsWith("http://") || abs.startsWith("https://"))
|
|
21
|
+
return abs;
|
|
22
|
+
const b64 = btoa(abs).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
|
|
23
|
+
const path = `/_veryfront/fs/${b64}.js`;
|
|
24
|
+
return baseUrl ? `${baseUrl}${path}` : path;
|
|
25
|
+
}
|
|
26
|
+
function mapSpec(spec, basedir, target, baseUrl) {
|
|
27
|
+
// Handle @/ project-relative aliases
|
|
28
|
+
// @/ maps to components/ directory in veryfront projects
|
|
29
|
+
if (spec.startsWith("@/")) {
|
|
30
|
+
if (target !== "browser")
|
|
31
|
+
return spec;
|
|
32
|
+
const relativePath = spec.slice(2);
|
|
33
|
+
const path = `/_vf_modules/${relativePath}.js`;
|
|
34
|
+
return baseUrl ? `${baseUrl}${path}` : path;
|
|
35
|
+
}
|
|
36
|
+
const abs = toAbsPath(spec, basedir);
|
|
37
|
+
const isBare = abs === spec &&
|
|
38
|
+
!spec.startsWith(".") &&
|
|
39
|
+
!spec.startsWith("/") &&
|
|
40
|
+
!spec.startsWith("file://") &&
|
|
41
|
+
!spec.startsWith("http");
|
|
42
|
+
if (isBare)
|
|
43
|
+
return spec;
|
|
44
|
+
if (target === "browser")
|
|
45
|
+
return toBrowserFs(abs, baseUrl);
|
|
46
|
+
return abs.startsWith("http") ? abs : `file://${abs}`;
|
|
47
|
+
}
|
|
48
|
+
function rewriteLine(line, basedir, target, baseUrl) {
|
|
49
|
+
const mapper = (spec) => mapSpec(spec, basedir, target, baseUrl);
|
|
50
|
+
return line
|
|
51
|
+
.replace(/^(\s*import\s+[^'";]+?from\s+)(["'])([^"']+)(\2)/, (_m, p1, q, s, q2) => `${p1}${q}${mapper(s)}${q2}`)
|
|
52
|
+
.replace(/^(\s*import\s+)(["'])([^"']+)(\2)/, (_m, p1, q, s, q2) => `${p1}${q}${mapper(s)}${q2}`)
|
|
53
|
+
.replace(/^(\s*export\s+[^'";]+?from\s+)(["'])([^"']+)(\2)/, (_m, p1, q, s, q2) => `${p1}${q}${mapper(s)}${q2}`);
|
|
54
|
+
}
|
|
55
|
+
export function rewriteBodyImports(body, config) {
|
|
56
|
+
const basedir = dirname(config.filePath);
|
|
57
|
+
return body
|
|
58
|
+
.split(/\r?\n/)
|
|
59
|
+
.map((line) => {
|
|
60
|
+
const trimmed = line.trimStart();
|
|
61
|
+
if (!trimmed.startsWith("import") && !trimmed.startsWith("export"))
|
|
62
|
+
return line;
|
|
63
|
+
return rewriteLine(line, basedir, config.target, config.baseUrl);
|
|
64
|
+
})
|
|
65
|
+
.join("\n");
|
|
66
|
+
}
|
|
67
|
+
export function rewriteCompiledImports(compiledCode, config) {
|
|
68
|
+
const basedir = dirname(config.filePath);
|
|
69
|
+
const mapper = (spec) => mapSpec(spec, basedir, config.target, config.baseUrl);
|
|
70
|
+
const replaceAll = (code, patterns) => {
|
|
71
|
+
for (const pattern of patterns) {
|
|
72
|
+
code = code.replace(pattern, (_m, p1, p2, p3) => `${p1}${mapper(p2)}${p3}`);
|
|
73
|
+
}
|
|
74
|
+
return code;
|
|
75
|
+
};
|
|
76
|
+
let code = compiledCode;
|
|
77
|
+
code = replaceAll(code, [
|
|
78
|
+
/(from\s+["'])(@\/[^"']+)(["'])/g,
|
|
79
|
+
/(import\(\s*["'])(@\/[^"']+)(["']\s*\))/g,
|
|
80
|
+
/(from\s+["'])(\.{1,2}\/[^"']+)(["'])/g,
|
|
81
|
+
/(from\s+["'])(file:\/\/[^"']+)(["'])/g,
|
|
82
|
+
/(import\(\s*["'])(\.{1,2}\/[^"']+)(["']\s*\))/g,
|
|
83
|
+
/(import\(\s*["'])(file:\/\/[^"']+)(["']\s*\))/g,
|
|
84
|
+
]);
|
|
85
|
+
code = code.replace(/file:\/\/[A-Za-z0-9_\-./%]+/g, (match) => mapper(match));
|
|
86
|
+
return code;
|
|
87
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64url.d.ts","sourceRoot":"","sources":["../../../src/src/utils/base64url.ts"],"names":[],"mappings":"AAAA;;yBAEyB;AAMzB,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAE9D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/***********************
|
|
2
|
+
* Base64url encoding utilities
|
|
3
|
+
***********************/
|
|
4
|
+
function toBase64Url(b64) {
|
|
5
|
+
return b64.replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
|
|
6
|
+
}
|
|
7
|
+
export function base64urlEncode(input) {
|
|
8
|
+
return toBase64Url(btoa(input));
|
|
9
|
+
}
|
|
10
|
+
export function base64urlEncodeBytes(bytes) {
|
|
11
|
+
return toBase64Url(btoa(String.fromCharCode(...bytes)));
|
|
12
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/** Public API contract for bundle metadata. */
|
|
2
|
+
export interface BundleMetadata {
|
|
3
|
+
hash: string;
|
|
4
|
+
codeHash: string;
|
|
5
|
+
size: number;
|
|
6
|
+
compiledAt: number;
|
|
7
|
+
source: string;
|
|
8
|
+
mode: "development" | "production";
|
|
9
|
+
meta?: {
|
|
10
|
+
type?: "mdx" | "component" | "layout" | "provider";
|
|
11
|
+
depsHash?: string;
|
|
12
|
+
reactVersion?: string;
|
|
13
|
+
/** Headings extracted from MDX for sidebar/TOC navigation */
|
|
14
|
+
headings?: Array<{
|
|
15
|
+
id: string;
|
|
16
|
+
text: string;
|
|
17
|
+
level: number;
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** Public API contract for bundle code. */
|
|
22
|
+
export interface BundleCode {
|
|
23
|
+
code: string;
|
|
24
|
+
sourceMap?: string;
|
|
25
|
+
css?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface BundleManifestStats {
|
|
28
|
+
totalBundles: number;
|
|
29
|
+
totalSize: number;
|
|
30
|
+
oldestBundle?: number;
|
|
31
|
+
newestBundle?: number;
|
|
32
|
+
}
|
|
33
|
+
export interface BundleManifestStore {
|
|
34
|
+
getBundleMetadata(key: string): Promise<BundleMetadata | undefined>;
|
|
35
|
+
setBundleMetadata(key: string, metadata: BundleMetadata, ttlMs?: number): Promise<void>;
|
|
36
|
+
getBundleCode(hash: string): Promise<BundleCode | undefined>;
|
|
37
|
+
setBundleCode(hash: string, code: BundleCode, ttlMs?: number): Promise<void>;
|
|
38
|
+
deleteBundle(key: string): Promise<void>;
|
|
39
|
+
invalidateSource(source: string): Promise<number>;
|
|
40
|
+
clear(): Promise<void>;
|
|
41
|
+
isAvailable(): Promise<boolean>;
|
|
42
|
+
getStats(): Promise<BundleManifestStats>;
|
|
43
|
+
}
|
|
44
|
+
export declare class InMemoryBundleManifestStore implements BundleManifestStore {
|
|
45
|
+
private metadata;
|
|
46
|
+
private code;
|
|
47
|
+
private sourceIndex;
|
|
48
|
+
private getIfNotExpired;
|
|
49
|
+
getBundleMetadata(key: string): Promise<BundleMetadata | undefined>;
|
|
50
|
+
setBundleMetadata(key: string, metadata: BundleMetadata, ttlMs?: number): Promise<void>;
|
|
51
|
+
getBundleCode(hash: string): Promise<BundleCode | undefined>;
|
|
52
|
+
setBundleCode(hash: string, code: BundleCode, ttlMs?: number): Promise<void>;
|
|
53
|
+
deleteBundle(key: string): Promise<void>;
|
|
54
|
+
invalidateSource(source: string): Promise<number>;
|
|
55
|
+
clear(): Promise<void>;
|
|
56
|
+
isAvailable(): Promise<boolean>;
|
|
57
|
+
getStats(): Promise<BundleManifestStats>;
|
|
58
|
+
}
|
|
59
|
+
export declare function setBundleManifestStore(store: BundleManifestStore): void;
|
|
60
|
+
/** Return bundle manifest store. */
|
|
61
|
+
export declare function getBundleManifestStore(): BundleManifestStore;
|
|
62
|
+
export { computeCodeHash, computeHash } from "./hash-utils.js";
|
|
63
|
+
//# sourceMappingURL=bundle-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-manifest.d.ts","sourceRoot":"","sources":["../../../src/src/utils/bundle-manifest.ts"],"names":[],"mappings":"AAIA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AC;CAsB/C;AAID,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAKvE;AAED,oCAAoC;AACpC,wBAAgB,sBAAsB,IAAI,mBAAmB,CAE5D;AAED,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { serverLogger } from "./logger/index.js";
|
|
2
|
+
const logger = serverLogger.component("bundle-manifest");
|
|
3
|
+
export class InMemoryBundleManifestStore {
|
|
4
|
+
metadata = new Map();
|
|
5
|
+
code = new Map();
|
|
6
|
+
sourceIndex = new Map();
|
|
7
|
+
getIfNotExpired(map, key) {
|
|
8
|
+
const entry = map.get(key);
|
|
9
|
+
if (!entry)
|
|
10
|
+
return undefined;
|
|
11
|
+
if (entry.expiry != null && Date.now() > entry.expiry) {
|
|
12
|
+
map.delete(key);
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
return entry.value;
|
|
16
|
+
}
|
|
17
|
+
async getBundleMetadata(key) {
|
|
18
|
+
return this.getIfNotExpired(this.metadata, key);
|
|
19
|
+
}
|
|
20
|
+
async setBundleMetadata(key, metadata, ttlMs) {
|
|
21
|
+
const expiry = ttlMs != null ? Date.now() + ttlMs : undefined;
|
|
22
|
+
this.metadata.set(key, { value: metadata, expiry });
|
|
23
|
+
const keys = this.sourceIndex.get(metadata.source) ?? new Set();
|
|
24
|
+
keys.add(key);
|
|
25
|
+
this.sourceIndex.set(metadata.source, keys);
|
|
26
|
+
}
|
|
27
|
+
async getBundleCode(hash) {
|
|
28
|
+
return this.getIfNotExpired(this.code, hash);
|
|
29
|
+
}
|
|
30
|
+
async setBundleCode(hash, code, ttlMs) {
|
|
31
|
+
const expiry = ttlMs != null ? Date.now() + ttlMs : undefined;
|
|
32
|
+
this.code.set(hash, { value: code, expiry });
|
|
33
|
+
}
|
|
34
|
+
async deleteBundle(key) {
|
|
35
|
+
const metadata = await this.getBundleMetadata(key);
|
|
36
|
+
this.metadata.delete(key);
|
|
37
|
+
if (!metadata)
|
|
38
|
+
return;
|
|
39
|
+
this.code.delete(metadata.codeHash);
|
|
40
|
+
const sourceKeys = this.sourceIndex.get(metadata.source);
|
|
41
|
+
if (!sourceKeys)
|
|
42
|
+
return;
|
|
43
|
+
sourceKeys.delete(key);
|
|
44
|
+
if (sourceKeys.size === 0)
|
|
45
|
+
this.sourceIndex.delete(metadata.source);
|
|
46
|
+
}
|
|
47
|
+
async invalidateSource(source) {
|
|
48
|
+
const keys = this.sourceIndex.get(source);
|
|
49
|
+
if (!keys)
|
|
50
|
+
return 0;
|
|
51
|
+
const keysArray = [...keys];
|
|
52
|
+
await Promise.all(keysArray.map((key) => this.deleteBundle(key)));
|
|
53
|
+
this.sourceIndex.delete(source);
|
|
54
|
+
return keysArray.length;
|
|
55
|
+
}
|
|
56
|
+
async clear() {
|
|
57
|
+
this.metadata.clear();
|
|
58
|
+
this.code.clear();
|
|
59
|
+
this.sourceIndex.clear();
|
|
60
|
+
}
|
|
61
|
+
async isAvailable() {
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
async getStats() {
|
|
65
|
+
let totalSize = 0;
|
|
66
|
+
let oldestBundle;
|
|
67
|
+
let newestBundle;
|
|
68
|
+
for (const { value } of this.metadata.values()) {
|
|
69
|
+
totalSize += value.size;
|
|
70
|
+
oldestBundle = oldestBundle == null
|
|
71
|
+
? value.compiledAt
|
|
72
|
+
: Math.min(oldestBundle, value.compiledAt);
|
|
73
|
+
newestBundle = newestBundle == null
|
|
74
|
+
? value.compiledAt
|
|
75
|
+
: Math.max(newestBundle, value.compiledAt);
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
totalBundles: this.metadata.size,
|
|
79
|
+
totalSize,
|
|
80
|
+
oldestBundle,
|
|
81
|
+
newestBundle,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
let manifestStore = new InMemoryBundleManifestStore();
|
|
86
|
+
export function setBundleManifestStore(store) {
|
|
87
|
+
manifestStore = store;
|
|
88
|
+
logger.info("Bundle manifest store configured", {
|
|
89
|
+
type: store.constructor.name,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/** Return bundle manifest store. */
|
|
93
|
+
export function getBundleManifestStore() {
|
|
94
|
+
return manifestStore;
|
|
95
|
+
}
|
|
96
|
+
export { computeCodeHash, computeHash } from "./hash-utils.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const BUFFER_SIZE_256_BYTES = 256;
|
|
2
|
+
export declare const BUFFER_SIZE_512_BYTES = 512;
|
|
3
|
+
export declare const BUFFER_SIZE_1_KB = 1024;
|
|
4
|
+
export declare const BUFFER_SIZE_2_KB = 2048;
|
|
5
|
+
export declare const BUFFER_SIZE_4_KB = 4096;
|
|
6
|
+
export declare const BUFFER_SIZE_8_KB = 8192;
|
|
7
|
+
export declare const BUFFER_SIZE_16_KB = 16384;
|
|
8
|
+
export declare const BUFFER_SIZE_32_KB = 32768;
|
|
9
|
+
export declare const BUFFER_SIZE_64_KB = 65536;
|
|
10
|
+
/** RSC file reading buffer for 'use client'/'use server' detection */
|
|
11
|
+
export declare const RSC_FILE_READ_BUFFER_SIZE_BYTES = 2048;
|
|
12
|
+
/** Default maximum body size (1MB) */
|
|
13
|
+
export declare const DEFAULT_MAX_BODY_SIZE_BYTES: number;
|
|
14
|
+
/** Default maximum URL length (2KB) */
|
|
15
|
+
export declare const DEFAULT_MAX_URL_LENGTH_BYTES = 2048;
|
|
16
|
+
/** Default maximum HTTP header size (8KB) */
|
|
17
|
+
export declare const DEFAULT_MAX_HEADER_SIZE_BYTES = 8192;
|
|
18
|
+
/** Default maximum file upload size (5MB) */
|
|
19
|
+
export declare const DEFAULT_MAX_FILE_SIZE_BYTES: number;
|
|
20
|
+
/** Prefetch queue maximum size (1MB) */
|
|
21
|
+
export declare const PREFETCH_QUEUE_MAX_SIZE_BYTES: number;
|
|
22
|
+
/** Maximum chunk size for bundling (4MB) */
|
|
23
|
+
export declare const MAX_BUNDLE_CHUNK_SIZE_BYTES: number;
|
|
24
|
+
//# sourceMappingURL=buffers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buffers.d.ts","sourceRoot":"","sources":["../../../../src/src/utils/constants/buffers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AACvC,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AACvC,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AAEvC,sEAAsE;AACtE,eAAO,MAAM,+BAA+B,OAAmB,CAAC;AAEhE,sCAAsC;AACtC,eAAO,MAAM,2BAA2B,QAAc,CAAC;AAEvD,uCAAuC;AACvC,eAAO,MAAM,4BAA4B,OAAmB,CAAC;AAE7D,6CAA6C;AAC7C,eAAO,MAAM,6BAA6B,OAAmB,CAAC;AAE9D,6CAA6C;AAC7C,eAAO,MAAM,2BAA2B,QAAkB,CAAC;AAE3D,wCAAwC;AACxC,eAAO,MAAM,6BAA6B,QAA8B,CAAC;AAEzE,4CAA4C;AAC5C,eAAO,MAAM,2BAA2B,QAAc,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const BUFFER_SIZE_256_BYTES = 256;
|
|
2
|
+
export const BUFFER_SIZE_512_BYTES = 512;
|
|
3
|
+
export const BUFFER_SIZE_1_KB = 1024;
|
|
4
|
+
export const BUFFER_SIZE_2_KB = 2048;
|
|
5
|
+
export const BUFFER_SIZE_4_KB = 4096;
|
|
6
|
+
export const BUFFER_SIZE_8_KB = 8192;
|
|
7
|
+
export const BUFFER_SIZE_16_KB = 16384;
|
|
8
|
+
export const BUFFER_SIZE_32_KB = 32768;
|
|
9
|
+
export const BUFFER_SIZE_64_KB = 65536;
|
|
10
|
+
/** RSC file reading buffer for 'use client'/'use server' detection */
|
|
11
|
+
export const RSC_FILE_READ_BUFFER_SIZE_BYTES = BUFFER_SIZE_2_KB;
|
|
12
|
+
/** Default maximum body size (1MB) */
|
|
13
|
+
export const DEFAULT_MAX_BODY_SIZE_BYTES = 1024 * 1024;
|
|
14
|
+
/** Default maximum URL length (2KB) */
|
|
15
|
+
export const DEFAULT_MAX_URL_LENGTH_BYTES = BUFFER_SIZE_2_KB;
|
|
16
|
+
/** Default maximum HTTP header size (8KB) */
|
|
17
|
+
export const DEFAULT_MAX_HEADER_SIZE_BYTES = BUFFER_SIZE_8_KB;
|
|
18
|
+
/** Default maximum file upload size (5MB) */
|
|
19
|
+
export const DEFAULT_MAX_FILE_SIZE_BYTES = 5 * 1024 * 1024;
|
|
20
|
+
/** Prefetch queue maximum size (1MB) */
|
|
21
|
+
export const PREFETCH_QUEUE_MAX_SIZE_BYTES = DEFAULT_MAX_BODY_SIZE_BYTES;
|
|
22
|
+
/** Maximum chunk size for bundling (4MB) */
|
|
23
|
+
export const MAX_BUNDLE_CHUNK_SIZE_BYTES = 4096 * 1024;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Default value for build concurrency. */
|
|
2
|
+
export declare const DEFAULT_BUILD_CONCURRENCY = 4;
|
|
3
|
+
/** Shared image optimization value. */
|
|
4
|
+
export declare const IMAGE_OPTIMIZATION: {
|
|
5
|
+
readonly DEFAULT_SIZES: readonly [640, 750, 828, 1080, 1200, 1920, 2048, 3840];
|
|
6
|
+
readonly DEFAULT_QUALITY: 80;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../src/src/utils/constants/build.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C,uCAAuC;AACvC,eAAO,MAAM,kBAAkB;;;CAGrB,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export declare const SECONDS_PER_MINUTE = 60;
|
|
2
|
+
export declare const MINUTES_PER_HOUR = 60;
|
|
3
|
+
export declare const HOURS_PER_DAY = 24;
|
|
4
|
+
/** Shared ms per second value. */
|
|
5
|
+
export declare const MS_PER_SECOND = 1000;
|
|
6
|
+
export declare const MS_PER_MINUTE: number;
|
|
7
|
+
export declare const MS_PER_HOUR: number;
|
|
8
|
+
export declare const ONE_DAY_MS: number;
|
|
9
|
+
/** Default value for lru max entries. */
|
|
10
|
+
export declare const DEFAULT_LRU_MAX_ENTRIES: number;
|
|
11
|
+
export declare const COMPONENT_LOADER_MAX_ENTRIES: number;
|
|
12
|
+
export declare const COMPONENT_LOADER_TTL_MS: number;
|
|
13
|
+
export declare const MDX_RENDERER_MAX_ENTRIES: number;
|
|
14
|
+
export declare const MDX_RENDERER_TTL_MS: number;
|
|
15
|
+
export declare const RENDERER_CORE_MAX_ENTRIES: number;
|
|
16
|
+
export declare const RENDERER_CORE_TTL_MS: number;
|
|
17
|
+
/** Shared TSX layout max entries value. */
|
|
18
|
+
export declare const TSX_LAYOUT_MAX_ENTRIES: number;
|
|
19
|
+
export declare const TSX_LAYOUT_TTL_MS: number;
|
|
20
|
+
/**
|
|
21
|
+
* Per-project cap for the TSX layout component cache.
|
|
22
|
+
* Prevents a single noisy tenant from evicting every other project's
|
|
23
|
+
* cached layouts. Defaults to ceil(TSX_LAYOUT_MAX_ENTRIES / 10) so no
|
|
24
|
+
* one project consumes more than ~10 % of the global budget.
|
|
25
|
+
* Set via TSX_LAYOUT_PER_PROJECT_MAX_ENTRIES env var.
|
|
26
|
+
*/
|
|
27
|
+
export declare const TSX_LAYOUT_PER_PROJECT_MAX_ENTRIES: number;
|
|
28
|
+
export declare const DATA_FETCHING_MAX_ENTRIES: number;
|
|
29
|
+
export declare const DATA_FETCHING_TTL_MS: number;
|
|
30
|
+
export declare const MDX_CACHE_TTL_PRODUCTION_MS: number;
|
|
31
|
+
export declare const MDX_CACHE_TTL_DEVELOPMENT_MS: number;
|
|
32
|
+
export declare const BUNDLE_CACHE_TTL_PRODUCTION_MS: number;
|
|
33
|
+
export declare const BUNDLE_CACHE_TTL_DEVELOPMENT_MS: number;
|
|
34
|
+
export declare const BUNDLE_MANIFEST_PROD_TTL_MS: number;
|
|
35
|
+
export declare const BUNDLE_MANIFEST_DEV_TTL_MS: number;
|
|
36
|
+
/** Shared RSC manifest cache ttl ms value. */
|
|
37
|
+
export declare const RSC_MANIFEST_CACHE_TTL_MS = 5000;
|
|
38
|
+
export declare const SERVER_ACTION_DEFAULT_TTL_SEC: number;
|
|
39
|
+
export declare const DISTRIBUTED_SSR_MODULE_TTL_PRODUCTION_SEC: number;
|
|
40
|
+
export declare const DISTRIBUTED_SSR_MODULE_TTL_PREVIEW_SEC: number;
|
|
41
|
+
export declare const DISTRIBUTED_TRANSFORM_TTL_PRODUCTION_SEC: number;
|
|
42
|
+
export declare const DISTRIBUTED_TRANSFORM_TTL_PREVIEW_SEC: number;
|
|
43
|
+
export declare const DISTRIBUTED_FILE_TTL_PRODUCTION_SEC: number;
|
|
44
|
+
export declare const DISTRIBUTED_FILE_TTL_PREVIEW_SEC: number;
|
|
45
|
+
export declare const DISTRIBUTED_CSS_TTL_PRODUCTION_SEC: number;
|
|
46
|
+
export declare const DISTRIBUTED_CSS_TTL_PREVIEW_SEC: number;
|
|
47
|
+
/** Get environment-aware distributed cache TTL in seconds */
|
|
48
|
+
export declare function getDistributedCacheTTL(cacheType: "ssr-module" | "transform" | "file" | "css", isProduction?: boolean): number;
|
|
49
|
+
export declare const DENO_KV_SAFE_SIZE_LIMIT_BYTES = 64000;
|
|
50
|
+
export declare const LRU_DEFAULT_MAX_ENTRIES_V2: number;
|
|
51
|
+
export declare const LRU_DEFAULT_MAX_SIZE_BYTES: number;
|
|
52
|
+
export declare const MEMORY_CACHE_MAX_ENTRIES: number;
|
|
53
|
+
export declare const MEMORY_CACHE_MAX_SIZE_BYTES: number;
|
|
54
|
+
export declare const FILE_CACHE_MAX_ENTRIES: number;
|
|
55
|
+
export declare const FILE_CACHE_MAX_SIZE_MB: number;
|
|
56
|
+
export declare const HTTP_CACHE_SHORT_MAX_AGE_SEC = 60;
|
|
57
|
+
export declare const HTTP_CACHE_MEDIUM_MAX_AGE_SEC = 3600;
|
|
58
|
+
export declare const HTTP_CACHE_LONG_MAX_AGE_SEC = 31536000;
|
|
59
|
+
export declare const CACHE_CLEANUP_INTERVAL_MS = 60000;
|
|
60
|
+
export declare const CLEANUP_INTERVAL_MULTIPLIER = 2;
|
|
61
|
+
export declare const MAX_CONCURRENT_REVALIDATIONS: number;
|
|
62
|
+
export declare const MAX_CONCURRENT_HTTP_FETCHES: number;
|
|
63
|
+
export declare const REVALIDATION_TIMEOUT_MS: number;
|
|
64
|
+
export declare const REVALIDATION_PER_PROJECT_LIMIT: number;
|
|
65
|
+
export declare const BUNDLE_MANIFEST_DISTRIBUTED_TTL_SEC: number;
|
|
66
|
+
export declare const BUNDLE_MANIFEST_LRU_MAX_ENTRIES: number;
|
|
67
|
+
export declare const HTTP_MODULE_CACHE_MAX_ENTRIES: number;
|
|
68
|
+
export declare const HTTP_MODULE_DISTRIBUTED_TTL_SEC: number;
|
|
69
|
+
export declare const TRANSFORM_DISTRIBUTED_TTL_SEC: number;
|
|
70
|
+
export declare const MODULE_CACHE_MAX_ENTRIES: number;
|
|
71
|
+
export declare const MODULE_CACHE_TTL_MS: number;
|
|
72
|
+
export declare const ESM_CACHE_MAX_ENTRIES: number;
|
|
73
|
+
export declare const ESM_CACHE_TTL_MS: number;
|
|
74
|
+
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":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A6B,QAGzC,CAAC;AAIF,eAAO,MAAM,wBAAwB,QAAkD,CAAC;AACxF,eAAO,MAAM,mBAAmB,QAG/B,CAAC;AAGF,eAAO,MAAM,qBAAqB,QAA8C,CAAC;AACjF,eAAO,MAAM,gBAAgB,QAG5B,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import * as dntShim from "../../../_dnt.shims.js";
|
|
2
|
+
export const SECONDS_PER_MINUTE = 60;
|
|
3
|
+
export const MINUTES_PER_HOUR = 60;
|
|
4
|
+
export const HOURS_PER_DAY = 24;
|
|
5
|
+
/** Shared ms per second value. */
|
|
6
|
+
export const MS_PER_SECOND = 1000;
|
|
7
|
+
export const MS_PER_MINUTE = SECONDS_PER_MINUTE * MS_PER_SECOND;
|
|
8
|
+
export const MS_PER_HOUR = MINUTES_PER_HOUR * MS_PER_MINUTE;
|
|
9
|
+
export const ONE_DAY_MS = HOURS_PER_DAY * MS_PER_HOUR;
|
|
10
|
+
function getEnvString(key) {
|
|
11
|
+
const g = dntShim.dntGlobalThis;
|
|
12
|
+
try {
|
|
13
|
+
return g.Deno?.env?.get?.(key) ?? g.process?.env?.[key];
|
|
14
|
+
}
|
|
15
|
+
catch (_) {
|
|
16
|
+
/* expected: Deno may deny --allow-env permission */
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function getEnvNumber(key, fallback) {
|
|
21
|
+
const value = getEnvString(key);
|
|
22
|
+
if (value == null)
|
|
23
|
+
return fallback;
|
|
24
|
+
const parsed = Number.parseInt(value, 10);
|
|
25
|
+
if (Number.isNaN(parsed))
|
|
26
|
+
return fallback;
|
|
27
|
+
return parsed;
|
|
28
|
+
}
|
|
29
|
+
function isProductionMode() {
|
|
30
|
+
return (getEnvString("PROXY_MODE") === "1" ||
|
|
31
|
+
getEnvString("NODE_ENV") === "production" ||
|
|
32
|
+
getEnvString("PRODUCTION_MODE") === "1");
|
|
33
|
+
}
|
|
34
|
+
// Cache entry limits (override via env vars)
|
|
35
|
+
/** Default value for lru max entries. */
|
|
36
|
+
export const DEFAULT_LRU_MAX_ENTRIES = getEnvNumber("LRU_DEFAULT_MAX_ENTRIES", 100);
|
|
37
|
+
export const COMPONENT_LOADER_MAX_ENTRIES = getEnvNumber("COMPONENT_LOADER_MAX_ENTRIES", 200);
|
|
38
|
+
export const COMPONENT_LOADER_TTL_MS = 10 * MS_PER_MINUTE;
|
|
39
|
+
export const MDX_RENDERER_MAX_ENTRIES = getEnvNumber("MDX_RENDERER_MAX_ENTRIES", 500);
|
|
40
|
+
export const MDX_RENDERER_TTL_MS = 10 * MS_PER_MINUTE;
|
|
41
|
+
export const RENDERER_CORE_MAX_ENTRIES = getEnvNumber("RENDERER_CORE_MAX_ENTRIES", 200);
|
|
42
|
+
export const RENDERER_CORE_TTL_MS = 5 * MS_PER_MINUTE;
|
|
43
|
+
/** Shared TSX layout max entries value. */
|
|
44
|
+
export const TSX_LAYOUT_MAX_ENTRIES = getEnvNumber("TSX_LAYOUT_MAX_ENTRIES", 100);
|
|
45
|
+
export const TSX_LAYOUT_TTL_MS = 10 * MS_PER_MINUTE;
|
|
46
|
+
/**
|
|
47
|
+
* Per-project cap for the TSX layout component cache.
|
|
48
|
+
* Prevents a single noisy tenant from evicting every other project's
|
|
49
|
+
* cached layouts. Defaults to ceil(TSX_LAYOUT_MAX_ENTRIES / 10) so no
|
|
50
|
+
* one project consumes more than ~10 % of the global budget.
|
|
51
|
+
* Set via TSX_LAYOUT_PER_PROJECT_MAX_ENTRIES env var.
|
|
52
|
+
*/
|
|
53
|
+
export const TSX_LAYOUT_PER_PROJECT_MAX_ENTRIES = getEnvNumber("TSX_LAYOUT_PER_PROJECT_MAX_ENTRIES", Math.ceil(TSX_LAYOUT_MAX_ENTRIES / 10));
|
|
54
|
+
export const DATA_FETCHING_MAX_ENTRIES = getEnvNumber("DATA_FETCHING_MAX_ENTRIES", 500);
|
|
55
|
+
export const DATA_FETCHING_TTL_MS = 10 * MS_PER_MINUTE;
|
|
56
|
+
export const MDX_CACHE_TTL_PRODUCTION_MS = ONE_DAY_MS;
|
|
57
|
+
export const MDX_CACHE_TTL_DEVELOPMENT_MS = 5 * MS_PER_MINUTE;
|
|
58
|
+
export const BUNDLE_CACHE_TTL_PRODUCTION_MS = ONE_DAY_MS;
|
|
59
|
+
export const BUNDLE_CACHE_TTL_DEVELOPMENT_MS = 5 * MS_PER_MINUTE;
|
|
60
|
+
export const BUNDLE_MANIFEST_PROD_TTL_MS = 7 * ONE_DAY_MS;
|
|
61
|
+
export const BUNDLE_MANIFEST_DEV_TTL_MS = MS_PER_HOUR;
|
|
62
|
+
/** Shared RSC manifest cache ttl ms value. */
|
|
63
|
+
export const RSC_MANIFEST_CACHE_TTL_MS = 5000;
|
|
64
|
+
export const SERVER_ACTION_DEFAULT_TTL_SEC = MINUTES_PER_HOUR * SECONDS_PER_MINUTE;
|
|
65
|
+
// Distributed cache TTL (Redis/API)
|
|
66
|
+
// Production: longer TTLs (release content is immutable)
|
|
67
|
+
// Preview: shorter TTLs (branch content changes frequently)
|
|
68
|
+
export const DISTRIBUTED_SSR_MODULE_TTL_PRODUCTION_SEC = getEnvNumber("DISTRIBUTED_SSR_MODULE_TTL_SEC", 6 * MINUTES_PER_HOUR * SECONDS_PER_MINUTE);
|
|
69
|
+
export const DISTRIBUTED_SSR_MODULE_TTL_PREVIEW_SEC = getEnvNumber("DISTRIBUTED_SSR_MODULE_TTL_PREVIEW_SEC", 10 * SECONDS_PER_MINUTE);
|
|
70
|
+
export const DISTRIBUTED_TRANSFORM_TTL_PRODUCTION_SEC = getEnvNumber("DISTRIBUTED_TRANSFORM_TTL_SEC", 6 * MINUTES_PER_HOUR * SECONDS_PER_MINUTE);
|
|
71
|
+
export const DISTRIBUTED_TRANSFORM_TTL_PREVIEW_SEC = getEnvNumber("DISTRIBUTED_TRANSFORM_TTL_PREVIEW_SEC", 10 * SECONDS_PER_MINUTE);
|
|
72
|
+
export const DISTRIBUTED_FILE_TTL_PRODUCTION_SEC = getEnvNumber("DISTRIBUTED_FILE_TTL_SEC", MINUTES_PER_HOUR * SECONDS_PER_MINUTE);
|
|
73
|
+
export const DISTRIBUTED_FILE_TTL_PREVIEW_SEC = getEnvNumber("DISTRIBUTED_FILE_TTL_PREVIEW_SEC", 5 * SECONDS_PER_MINUTE);
|
|
74
|
+
export const DISTRIBUTED_CSS_TTL_PRODUCTION_SEC = getEnvNumber("DISTRIBUTED_CSS_TTL_SEC", 6 * MINUTES_PER_HOUR * SECONDS_PER_MINUTE);
|
|
75
|
+
export const DISTRIBUTED_CSS_TTL_PREVIEW_SEC = getEnvNumber("DISTRIBUTED_CSS_TTL_PREVIEW_SEC", 10 * SECONDS_PER_MINUTE);
|
|
76
|
+
/** Get environment-aware distributed cache TTL in seconds */
|
|
77
|
+
export function getDistributedCacheTTL(cacheType, isProduction = isProductionMode()) {
|
|
78
|
+
if (cacheType === "ssr-module") {
|
|
79
|
+
return isProduction
|
|
80
|
+
? DISTRIBUTED_SSR_MODULE_TTL_PRODUCTION_SEC
|
|
81
|
+
: DISTRIBUTED_SSR_MODULE_TTL_PREVIEW_SEC;
|
|
82
|
+
}
|
|
83
|
+
if (cacheType === "transform") {
|
|
84
|
+
return isProduction
|
|
85
|
+
? DISTRIBUTED_TRANSFORM_TTL_PRODUCTION_SEC
|
|
86
|
+
: DISTRIBUTED_TRANSFORM_TTL_PREVIEW_SEC;
|
|
87
|
+
}
|
|
88
|
+
if (cacheType === "file") {
|
|
89
|
+
return isProduction ? DISTRIBUTED_FILE_TTL_PRODUCTION_SEC : DISTRIBUTED_FILE_TTL_PREVIEW_SEC;
|
|
90
|
+
}
|
|
91
|
+
return isProduction ? DISTRIBUTED_CSS_TTL_PRODUCTION_SEC : DISTRIBUTED_CSS_TTL_PREVIEW_SEC;
|
|
92
|
+
}
|
|
93
|
+
// Size limits (override via env vars)
|
|
94
|
+
export const DENO_KV_SAFE_SIZE_LIMIT_BYTES = 64_000;
|
|
95
|
+
export const LRU_DEFAULT_MAX_ENTRIES_V2 = getEnvNumber("LRU_MAX_ENTRIES", 2000);
|
|
96
|
+
export const LRU_DEFAULT_MAX_SIZE_BYTES = getEnvNumber("LRU_MAX_SIZE_MB", 200) * 1024 * 1024;
|
|
97
|
+
export const MEMORY_CACHE_MAX_ENTRIES = getEnvNumber("MEMORY_CACHE_MAX_ENTRIES", 2000);
|
|
98
|
+
export const MEMORY_CACHE_MAX_SIZE_BYTES = getEnvNumber("MEMORY_CACHE_MAX_SIZE_MB", 50) * 1024 *
|
|
99
|
+
1024;
|
|
100
|
+
export const FILE_CACHE_MAX_ENTRIES = getEnvNumber("FILE_CACHE_MAX_ENTRIES", 1000);
|
|
101
|
+
export const FILE_CACHE_MAX_SIZE_MB = getEnvNumber("FILE_CACHE_MAX_SIZE_MB", 100);
|
|
102
|
+
// HTTP cache headers
|
|
103
|
+
export const HTTP_CACHE_SHORT_MAX_AGE_SEC = 60;
|
|
104
|
+
export const HTTP_CACHE_MEDIUM_MAX_AGE_SEC = 3600;
|
|
105
|
+
export const HTTP_CACHE_LONG_MAX_AGE_SEC = 31536000;
|
|
106
|
+
// Maintenance
|
|
107
|
+
export const CACHE_CLEANUP_INTERVAL_MS = 60000;
|
|
108
|
+
export const CLEANUP_INTERVAL_MULTIPLIER = 2;
|
|
109
|
+
// Concurrency limits (override via env vars)
|
|
110
|
+
export const MAX_CONCURRENT_REVALIDATIONS = getEnvNumber("MAX_CONCURRENT_REVALIDATIONS", 32);
|
|
111
|
+
export const MAX_CONCURRENT_HTTP_FETCHES = getEnvNumber("MAX_CONCURRENT_HTTP_FETCHES", 50);
|
|
112
|
+
export const REVALIDATION_TIMEOUT_MS = getEnvNumber("REVALIDATION_TIMEOUT_MS", 15000);
|
|
113
|
+
// Per-project fairness limit for revalidations (prevents one project from starving others)
|
|
114
|
+
export const REVALIDATION_PER_PROJECT_LIMIT = getEnvNumber("REVALIDATION_PER_PROJECT_LIMIT", Math.ceil(MAX_CONCURRENT_REVALIDATIONS / 3));
|
|
115
|
+
// Bundle manifest for atomic HTTP bundle group validation
|
|
116
|
+
export const BUNDLE_MANIFEST_DISTRIBUTED_TTL_SEC = getEnvNumber("BUNDLE_MANIFEST_DISTRIBUTED_TTL_SEC", HOURS_PER_DAY * MINUTES_PER_HOUR * SECONDS_PER_MINUTE);
|
|
117
|
+
export const BUNDLE_MANIFEST_LRU_MAX_ENTRIES = getEnvNumber("BUNDLE_MANIFEST_LRU_MAX_ENTRIES", 5000);
|
|
118
|
+
// HTTP module cache (esm.sh, CDN bundles)
|
|
119
|
+
// These bundles are immutable once fetched, so long TTLs are safe
|
|
120
|
+
export const HTTP_MODULE_CACHE_MAX_ENTRIES = getEnvNumber("HTTP_MODULE_CACHE_MAX_ENTRIES", 2000);
|
|
121
|
+
export const HTTP_MODULE_DISTRIBUTED_TTL_SEC = getEnvNumber("HTTP_MODULE_DISTRIBUTED_TTL_SEC", HOURS_PER_DAY * MINUTES_PER_HOUR * SECONDS_PER_MINUTE);
|
|
122
|
+
// Transform cache for module compilation
|
|
123
|
+
// MUST be shorter than HTTP_MODULE_DISTRIBUTED_TTL_SEC (24h) so that
|
|
124
|
+
// HTTP bundles always outlive the transforms that reference them.
|
|
125
|
+
// 6h matches DISTRIBUTED_TRANSFORM_TTL_PRODUCTION_SEC used by the SSR loader.
|
|
126
|
+
export const TRANSFORM_DISTRIBUTED_TTL_SEC = getEnvNumber("TRANSFORM_DISTRIBUTED_TTL_SEC", 6 * MINUTES_PER_HOUR * SECONDS_PER_MINUTE);
|
|
127
|
+
// Pod-level module cache (shared across all RenderPipeline instances)
|
|
128
|
+
// These caches map module paths to transformed temp file paths
|
|
129
|
+
export const MODULE_CACHE_MAX_ENTRIES = getEnvNumber("MODULE_CACHE_MAX_ENTRIES", 10000);
|
|
130
|
+
export const MODULE_CACHE_TTL_MS = getEnvNumber("MODULE_CACHE_TTL_MS", 5 * MS_PER_MINUTE);
|
|
131
|
+
// ESM cache for external module mappings
|
|
132
|
+
export const ESM_CACHE_MAX_ENTRIES = getEnvNumber("ESM_CACHE_MAX_ENTRIES", 5000);
|
|
133
|
+
export const ESM_CACHE_TTL_MS = getEnvNumber("ESM_CACHE_TTL_MS", 10 * MS_PER_MINUTE);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const ESM_CDN_BASE = "https://esm.sh";
|
|
2
|
+
export declare const JSDELIVR_CDN_BASE = "https://cdn.jsdelivr.net";
|
|
3
|
+
export declare const DENO_STD_BASE = "https://deno.land";
|
|
4
|
+
export declare const REACT_VERSION_17 = "17.0.2";
|
|
5
|
+
export declare const REACT_VERSION_18_2 = "18.2.0";
|
|
6
|
+
export declare const REACT_VERSION_18_3 = "18.3.1";
|
|
7
|
+
export declare const REACT_VERSION_19_RC = "19.0.0-rc.0";
|
|
8
|
+
export declare const REACT_VERSION_19 = "19.2.4";
|
|
9
|
+
/** Shared React default version value. */
|
|
10
|
+
export declare const REACT_DEFAULT_VERSION = "19.2.4";
|
|
11
|
+
export declare function esmShReact(pkg: string, version: string, path?: string, external?: boolean): string;
|
|
12
|
+
export declare function getReactUrls(version?: string): Record<string, string>;
|
|
13
|
+
/** Return React import map. */
|
|
14
|
+
export declare function getReactImportMap(version?: string): Record<string, string>;
|
|
15
|
+
export declare function getReactCDNUrl(version?: string): string;
|
|
16
|
+
export declare function getReactDOMCDNUrl(version?: string): string;
|
|
17
|
+
export declare function getReactDOMClientCDNUrl(version?: string): string;
|
|
18
|
+
export declare function getReactDOMServerCDNUrl(version?: string): string;
|
|
19
|
+
export declare function getReactJSXRuntimeCDNUrl(version?: string): string;
|
|
20
|
+
export declare function getReactJSXDevRuntimeCDNUrl(version?: string): string;
|
|
21
|
+
/** Default value for allowed cdn hosts. */
|
|
22
|
+
export declare const DEFAULT_ALLOWED_CDN_HOSTS: string[];
|
|
23
|
+
export declare const DENO_STD_VERSION = "0.220.0";
|
|
24
|
+
/** Return Deno std node base. */
|
|
25
|
+
export declare function getDenoStdNodeBase(): string;
|
|
26
|
+
export { TAILWIND_VERSION } from "../../transforms/import-rewriter/url-builder.js";
|
|
27
|
+
export declare function getTailwindCSSUrl(): string;
|
|
28
|
+
export { VERSION as VERYFRONT_VERSION } from "../version-constant.js";
|
|
29
|
+
//# sourceMappingURL=cdn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cdn.d.ts","sourceRoot":"","sources":["../../../../src/src/utils/constants/cdn.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,mBAAmB,CAAC;AAC7C,eAAO,MAAM,iBAAiB,6BAA6B,CAAC;AAC5D,eAAO,MAAM,aAAa,sBAAsB,CAAC;AAEjD,eAAO,MAAM,gBAAgB,WAAW,CAAC;AACzC,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAC3C,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAC3C,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AACjD,eAAO,MAAM,gBAAgB,WAAW,CAAC;AAEzC,0CAA0C;AAC1C,eAAO,MAAM,qBAAqB,WAAmB,CAAC;AAQtD,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,IAAI,SAAK,EACT,QAAQ,UAAQ,GACf,MAAM,CAOR;AAED,wBAAgB,YAAY,CAAC,OAAO,SAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASpF;AAED,+BAA+B;AAC/B,wBAAgB,iBAAiB,CAAC,OAAO,SAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEzF;AAED,wBAAgB,cAAc,CAAC,OAAO,SAAwB,GAAG,MAAM,CAEtE;AAED,wBAAgB,iBAAiB,CAAC,OAAO,SAAwB,GAAG,MAAM,CAEzE;AAED,wBAAgB,uBAAuB,CAAC,OAAO,SAAwB,GAAG,MAAM,CAE/E;AAED,wBAAgB,uBAAuB,CAAC,OAAO,SAAwB,GAAG,MAAM,CAE/E;AAED,wBAAgB,wBAAwB,CAAC,OA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