@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,25 @@
|
|
|
1
|
+
import * as dntShim from "../../../../_dnt.shims.js";
|
|
2
|
+
import { getDenoRuntime, isDeno as IS_DENO } from "../runtime.js";
|
|
3
|
+
const nodeProcess = dntShim.dntGlobalThis.process;
|
|
4
|
+
/**
|
|
5
|
+
* Detect a real Node/Bun process object.
|
|
6
|
+
* Browser bundles may inject `window.process = { env: {} }`, which is not enough
|
|
7
|
+
* to safely call process APIs like cwd(), exit(), or on().
|
|
8
|
+
*/
|
|
9
|
+
export function testHasRuntimeProcess(processLike) {
|
|
10
|
+
if (!processLike || typeof processLike !== "object")
|
|
11
|
+
return false;
|
|
12
|
+
const versions = processLike.versions;
|
|
13
|
+
return typeof versions?.node === "string" && versions.node.length > 0;
|
|
14
|
+
}
|
|
15
|
+
export const runtimeProcess = testHasRuntimeProcess(nodeProcess)
|
|
16
|
+
? nodeProcess
|
|
17
|
+
: null;
|
|
18
|
+
export function isWindowsPlatform() {
|
|
19
|
+
const deno = IS_DENO ? getDenoRuntime() : undefined;
|
|
20
|
+
if (deno)
|
|
21
|
+
return deno.build.os === "windows";
|
|
22
|
+
const platform = runtimeProcess?.platform ??
|
|
23
|
+
dntShim.dntGlobalThis.process?.platform;
|
|
24
|
+
return platform === "win32";
|
|
25
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { deleteEnv, env, type EnvBooleanOptions, getEnv, getEnvBoolean, getEnvNumber, getEnvOverlayStorage, getEnvString, getHostEnv, setEnv, } from "./process/env.js";
|
|
2
|
+
export { chdir, cwd, execPath, exit, getArgs, getOsType, getRuntimeVersion, getStdout, getTerminalSize, isInteractive, isStdoutTTY, memoryUsage, onGlobalError, onSignal, pid, promptSync, readStdinByteSync, unrefTimer, uptime, writeStdout, writeStdoutAsync, } from "./process/lifecycle.js";
|
|
3
|
+
export { testHasRuntimeProcess } from "./process/runtime-process.js";
|
|
4
|
+
export { type CommandOptions, type CommandResult, runCommand } from "./process/command.js";
|
|
5
|
+
//# sourceMappingURL=process.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../../../src/src/platform/compat/process.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,GAAG,EACH,KAAK,iBAAiB,EACtB,MAAM,EACN,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,UAAU,EACV,MAAM,GACP,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,EACL,GAAG,EACH,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,SAAS,EACT,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,aAAa,EACb,WAAW,EACX,WAAW,EACX,aAAa,EACb,QAAQ,EACR,GAAG,EACH,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,MAAM,EACN,WAAW,EACX,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { deleteEnv, env, getEnv, getEnvBoolean, getEnvNumber, getEnvOverlayStorage, getEnvString, getHostEnv, setEnv, } from "./process/env.js";
|
|
2
|
+
export { chdir, cwd, execPath, exit, getArgs, getOsType, getRuntimeVersion, getStdout, getTerminalSize, isInteractive, isStdoutTTY, memoryUsage, onGlobalError, onSignal, pid, promptSync, readStdinByteSync, unrefTimer, uptime, writeStdout, writeStdoutAsync, } from "./process/lifecycle.js";
|
|
3
|
+
export { testHasRuntimeProcess } from "./process/runtime-process.js";
|
|
4
|
+
export { runCommand } from "./process/command.js";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as dntShim from "../../../_dnt.shims.js";
|
|
2
|
+
export declare function getDenoRuntime(): typeof dntShim.Deno | undefined;
|
|
3
|
+
/**
|
|
4
|
+
* Check if an executable path is a compiled Deno binary.
|
|
5
|
+
* Detects by binary name: "deno" or "deno.exe" = standard runtime, anything else = compiled.
|
|
6
|
+
* @internal Exported for testing only.
|
|
7
|
+
*/
|
|
8
|
+
export declare function testDenoCompiledDetection(execPath: string): boolean;
|
|
9
|
+
/** True if running in Bun runtime (check first since Bun has process.versions.node) */
|
|
10
|
+
export declare const isBun: boolean;
|
|
11
|
+
/** True if running in Node.js runtime (has process.versions.node, not Bun, not shimmed Deno) */
|
|
12
|
+
export declare const isNode: boolean;
|
|
13
|
+
/** True if running in real Deno runtime (not dnt shim) */
|
|
14
|
+
export declare const isDeno: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* True if running in a compiled Deno binary.
|
|
17
|
+
* Compiled binaries cannot dynamically import HTTP URLs - they must use local file:// paths.
|
|
18
|
+
* This is evaluated once at module load time.
|
|
19
|
+
*/
|
|
20
|
+
export declare const isDenoCompiled: boolean;
|
|
21
|
+
/** True if running in Cloudflare Workers runtime */
|
|
22
|
+
export declare const isCloudflare: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Detect if running in Node.js (vs Deno) at call time.
|
|
25
|
+
* Use this function instead of the constant when runtime detection needs to happen
|
|
26
|
+
* at call time (e.g., when bundled with esbuild's __esm lazy initialization pattern).
|
|
27
|
+
*/
|
|
28
|
+
export declare function isNodeRuntime(): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Detect if code is executing in a server environment (SSR).
|
|
31
|
+
*
|
|
32
|
+
* This function provides consistent SSR detection that works correctly even when
|
|
33
|
+
* SSR globals stub the window/document objects. It should be used instead of
|
|
34
|
+
* `typeof window === "undefined"` checks to avoid hydration mismatches.
|
|
35
|
+
*
|
|
36
|
+
* Priority:
|
|
37
|
+
* 1. Check __VERYFRONT_SSR__ flag (set by ssr-globals/index.ts) - most reliable
|
|
38
|
+
* 2. Check if window is undefined (fallback for non-veryfront environments)
|
|
39
|
+
*
|
|
40
|
+
* @returns true if executing on server, false if in browser
|
|
41
|
+
* @see plans/architecture-audit/006.1-ssr-detection-inconsistencies.md
|
|
42
|
+
*/
|
|
43
|
+
export declare function isServerEnvironment(): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Detect if code is executing in a browser environment.
|
|
46
|
+
* Inverse of isServerEnvironment() - use this instead of `typeof window !== "undefined"`.
|
|
47
|
+
*
|
|
48
|
+
* @returns true if executing in browser, false if on server
|
|
49
|
+
*/
|
|
50
|
+
export declare function isBrowserEnvironment(): boolean;
|
|
51
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/src/platform/compat/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAelD,wBAAgB,cAAc,IAAI,OAAO,OAAO,CAAC,IAAI,GAAG,SAAS,CAWhE;AAMD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAOnE;AAmBD,uFAAuF;AACvF,eAAO,MAAM,KAAK,EAAE,OAAwB,CAAC;AAE7C,gGAAgG;AAChG,eAAO,MAAM,MAAM,EAAE,OAAoC,CAAC;AAE1D,0DAA0D;AAC1D,eAAO,MAAM,MAAM,EAAE,OAA4C,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,OAA0C,CAAC;AAExE,oDAAoD;AACpD,eAAO,MAAM,YAAY,EAAE,OAAgC,CAAC;AAE5D;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAEvC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAK7C;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import * as dntShim from "../../../_dnt.shims.js";
|
|
2
|
+
function hasNodeProcess() {
|
|
3
|
+
const global = dntShim.dntGlobalThis;
|
|
4
|
+
return global.process?.versions?.node != null && !global.process?.versions?.deno;
|
|
5
|
+
}
|
|
6
|
+
function hasBunGlobal() {
|
|
7
|
+
return dntShim.dntGlobalThis.Bun != null;
|
|
8
|
+
}
|
|
9
|
+
export function getDenoRuntime() {
|
|
10
|
+
const deno = Reflect.get(dntShim.dntGlobalThis, "Deno");
|
|
11
|
+
if (deno &&
|
|
12
|
+
typeof deno.version === "object" &&
|
|
13
|
+
typeof deno.build === "object" &&
|
|
14
|
+
typeof deno.build.os === "string") {
|
|
15
|
+
return deno;
|
|
16
|
+
}
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
function hasRealDeno() {
|
|
20
|
+
return getDenoRuntime() != null;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Check if an executable path is a compiled Deno binary.
|
|
24
|
+
* Detects by binary name: "deno" or "deno.exe" = standard runtime, anything else = compiled.
|
|
25
|
+
* @internal Exported for testing only.
|
|
26
|
+
*/
|
|
27
|
+
export function testDenoCompiledDetection(execPath) {
|
|
28
|
+
if (!execPath)
|
|
29
|
+
return false;
|
|
30
|
+
const binaryName = execPath.split(/[/\\]/).pop()?.toLowerCase();
|
|
31
|
+
if (!binaryName)
|
|
32
|
+
return false;
|
|
33
|
+
return binaryName !== "deno" && binaryName !== "deno.exe";
|
|
34
|
+
}
|
|
35
|
+
/** Compiled Deno binaries cannot dynamically import HTTP URLs at runtime. */
|
|
36
|
+
function isDenoCompiledBinary() {
|
|
37
|
+
const deno = getDenoRuntime();
|
|
38
|
+
if (!deno)
|
|
39
|
+
return false;
|
|
40
|
+
try {
|
|
41
|
+
return testDenoCompiledDetection(deno.execPath());
|
|
42
|
+
}
|
|
43
|
+
catch (_) {
|
|
44
|
+
/* expected: Deno.execPath() may not be available in all environments */
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function hasCloudflareGlobals() {
|
|
49
|
+
return "caches" in dntShim.dntGlobalThis && "WebSocketPair" in dntShim.dntGlobalThis;
|
|
50
|
+
}
|
|
51
|
+
/** True if running in Bun runtime (check first since Bun has process.versions.node) */
|
|
52
|
+
export const isBun = hasBunGlobal();
|
|
53
|
+
/** True if running in Node.js runtime (has process.versions.node, not Bun, not shimmed Deno) */
|
|
54
|
+
export const isNode = !isBun && hasNodeProcess();
|
|
55
|
+
/** True if running in real Deno runtime (not dnt shim) */
|
|
56
|
+
export const isDeno = !isNode && !isBun && hasRealDeno();
|
|
57
|
+
/**
|
|
58
|
+
* True if running in a compiled Deno binary.
|
|
59
|
+
* Compiled binaries cannot dynamically import HTTP URLs - they must use local file:// paths.
|
|
60
|
+
* This is evaluated once at module load time.
|
|
61
|
+
*/
|
|
62
|
+
export const isDenoCompiled = isDeno && isDenoCompiledBinary();
|
|
63
|
+
/** True if running in Cloudflare Workers runtime */
|
|
64
|
+
export const isCloudflare = hasCloudflareGlobals();
|
|
65
|
+
/**
|
|
66
|
+
* Detect if running in Node.js (vs Deno) at call time.
|
|
67
|
+
* Use this function instead of the constant when runtime detection needs to happen
|
|
68
|
+
* at call time (e.g., when bundled with esbuild's __esm lazy initialization pattern).
|
|
69
|
+
*/
|
|
70
|
+
export function isNodeRuntime() {
|
|
71
|
+
return !hasBunGlobal() && hasNodeProcess();
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Detect if code is executing in a server environment (SSR).
|
|
75
|
+
*
|
|
76
|
+
* This function provides consistent SSR detection that works correctly even when
|
|
77
|
+
* SSR globals stub the window/document objects. It should be used instead of
|
|
78
|
+
* `typeof window === "undefined"` checks to avoid hydration mismatches.
|
|
79
|
+
*
|
|
80
|
+
* Priority:
|
|
81
|
+
* 1. Check __VERYFRONT_SSR__ flag (set by ssr-globals/index.ts) - most reliable
|
|
82
|
+
* 2. Check if window is undefined (fallback for non-veryfront environments)
|
|
83
|
+
*
|
|
84
|
+
* @returns true if executing on server, false if in browser
|
|
85
|
+
* @see plans/architecture-audit/006.1-ssr-detection-inconsistencies.md
|
|
86
|
+
*/
|
|
87
|
+
export function isServerEnvironment() {
|
|
88
|
+
const ssrFlag = dntShim.dntGlobalThis.__VERYFRONT_SSR__;
|
|
89
|
+
if (ssrFlag === true)
|
|
90
|
+
return true;
|
|
91
|
+
return typeof dntShim.dntGlobalThis === "undefined";
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Detect if code is executing in a browser environment.
|
|
95
|
+
* Inverse of isServerEnvironment() - use this instead of `typeof window !== "undefined"`.
|
|
96
|
+
*
|
|
97
|
+
* @returns true if executing in browser, false if on server
|
|
98
|
+
*/
|
|
99
|
+
export function isBrowserEnvironment() {
|
|
100
|
+
return !isServerEnvironment();
|
|
101
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Portable @std/front-matter/yaml shim.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
export interface Extract<T> {
|
|
7
|
+
attrs: T;
|
|
8
|
+
body: string;
|
|
9
|
+
frontMatter: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function extract<T = Record<string, unknown>>(text: string): Extract<T>;
|
|
12
|
+
export declare function test(text: string): boolean;
|
|
13
|
+
//# sourceMappingURL=front-matter-yaml.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"front-matter-yaml.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/std/front-matter-yaml.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,WAAW,OAAO,CAAC,CAAC;IACxB,KAAK,EAAE,CAAC,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAID,wBAAgB,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAkB7E;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE1C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Portable @std/front-matter/yaml shim.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { parse } from "../../../../deps/jsr.io/@std/yaml/1.1.0/parse.js";
|
|
7
|
+
const FRONTMATTER_RE = /^---\r?\n([\s\S]*?)(?:\r?\n)?---(?:\r?\n|$)([\s\S]*)$/;
|
|
8
|
+
export function extract(text) {
|
|
9
|
+
const match = text.match(FRONTMATTER_RE);
|
|
10
|
+
if (!match) {
|
|
11
|
+
return {
|
|
12
|
+
attrs: {},
|
|
13
|
+
body: text,
|
|
14
|
+
frontMatter: "",
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
const frontMatter = match[1] ?? "";
|
|
18
|
+
const parsed = frontMatter.trim() ? parse(frontMatter) : {};
|
|
19
|
+
const attrs = (parsed && typeof parsed === "object" ? parsed : {});
|
|
20
|
+
return {
|
|
21
|
+
attrs,
|
|
22
|
+
body: match[2] ?? "",
|
|
23
|
+
frontMatter,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export function test(text) {
|
|
27
|
+
return /^---\r?\n/.test(text);
|
|
28
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical URL builders for import rewriting.
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for all URL generation.
|
|
5
|
+
* Ensures consistent URLs across SSR and browser for hydration parity.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Default React version - used when not specified.
|
|
9
|
+
*
|
|
10
|
+
* MUST match the React version the build bundles (see `react/deno.json`),
|
|
11
|
+
* because veryfront's framework React re-export is generated against that
|
|
12
|
+
* version and references its named exports. A drift guard in
|
|
13
|
+
* `src/utils/constants/cdn.test.ts` enforces this.
|
|
14
|
+
*/
|
|
15
|
+
export declare const DEFAULT_REACT_VERSION = "19.2.4";
|
|
16
|
+
/** Tailwind CSS version */
|
|
17
|
+
export declare const TAILWIND_VERSION = "4.1.8";
|
|
18
|
+
/** csstype version - must match deno.json for type consistency */
|
|
19
|
+
export declare const CSSTYPE_VERSION = "3.2.3";
|
|
20
|
+
type EsmShOptions = {
|
|
21
|
+
external?: string[];
|
|
22
|
+
target?: string;
|
|
23
|
+
deps?: Record<string, string>;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Build esm.sh URL with proper configuration.
|
|
27
|
+
*
|
|
28
|
+
* @param pkg - Package name (e.g., "react", "lodash")
|
|
29
|
+
* @param version - Package version (optional)
|
|
30
|
+
* @param subpath - Subpath (e.g., "/jsx-runtime")
|
|
31
|
+
* @param options - URL options
|
|
32
|
+
*/
|
|
33
|
+
export declare function buildEsmShUrl(pkg: string, version?: string, subpath?: string, options?: EsmShOptions): string;
|
|
34
|
+
/**
|
|
35
|
+
* Build React esm.sh URL.
|
|
36
|
+
* Uses deps=csstype for type consistency.
|
|
37
|
+
*/
|
|
38
|
+
export declare function buildReactUrl(pkg: "react" | "react-dom", version: string, subpath?: string, external?: boolean): string;
|
|
39
|
+
/**
|
|
40
|
+
* Get complete React import map for a specific version.
|
|
41
|
+
*/
|
|
42
|
+
export declare function getReactImportMap(version: string): Record<string, string>;
|
|
43
|
+
/**
|
|
44
|
+
* Build module server URL for a path.
|
|
45
|
+
*/
|
|
46
|
+
export declare function buildModuleServerUrl(baseUrl: string, path: string): string;
|
|
47
|
+
/**
|
|
48
|
+
* Build cross-project import URL.
|
|
49
|
+
*/
|
|
50
|
+
export declare function buildCrossProjectUrl(projectSlug: string, version: string | null, path: string): string;
|
|
51
|
+
/**
|
|
52
|
+
* Build veryfront framework module URL.
|
|
53
|
+
*/
|
|
54
|
+
export declare function buildVeryfrontModuleUrl(path: string): string;
|
|
55
|
+
/**
|
|
56
|
+
* Normalize file extension for JavaScript output.
|
|
57
|
+
*/
|
|
58
|
+
export declare function normalizeExtension(path: string, options?: {
|
|
59
|
+
removeExtension?: boolean;
|
|
60
|
+
}): string;
|
|
61
|
+
/**
|
|
62
|
+
* Check if a URL is an esm.sh URL.
|
|
63
|
+
*/
|
|
64
|
+
export declare function isEsmShUrl(url: string): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Add deps query param to esm.sh URL if not already present.
|
|
67
|
+
*/
|
|
68
|
+
export declare function addEsmShDeps(url: string, reactVersion: string): string;
|
|
69
|
+
export {};
|
|
70
|
+
//# sourceMappingURL=url-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url-builder.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/import-rewriter/url-builder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAE9C,2BAA2B;AAC3B,eAAO,MAAM,gBAAgB,UAAU,CAAC;AAExC,kEAAkE;AAClE,eAAO,MAAM,eAAe,UAAU,CAAC;AAEvC,KAAK,YAAY,GAAG;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,YAAY,GACrB,MAAM,CAqBR;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,OAAO,GAAG,WAAW,EAC1B,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,UAAQ,GACf,MAAM,CAKR;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAWzE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAI1E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,IAAI,EAAE,MAAM,GACX,MAAM,CAIR;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG5D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAGhG;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE/C;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAgDtE"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical URL builders for import rewriting.
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for all URL generation.
|
|
5
|
+
* Ensures consistent URLs across SSR and browser for hydration parity.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Default React version - used when not specified.
|
|
9
|
+
*
|
|
10
|
+
* MUST match the React version the build bundles (see `react/deno.json`),
|
|
11
|
+
* because veryfront's framework React re-export is generated against that
|
|
12
|
+
* version and references its named exports. A drift guard in
|
|
13
|
+
* `src/utils/constants/cdn.test.ts` enforces this.
|
|
14
|
+
*/
|
|
15
|
+
export const DEFAULT_REACT_VERSION = "19.2.4";
|
|
16
|
+
/** Tailwind CSS version */
|
|
17
|
+
export const TAILWIND_VERSION = "4.1.8";
|
|
18
|
+
/** csstype version - must match deno.json for type consistency */
|
|
19
|
+
export const CSSTYPE_VERSION = "3.2.3";
|
|
20
|
+
/**
|
|
21
|
+
* Build esm.sh URL with proper configuration.
|
|
22
|
+
*
|
|
23
|
+
* @param pkg - Package name (e.g., "react", "lodash")
|
|
24
|
+
* @param version - Package version (optional)
|
|
25
|
+
* @param subpath - Subpath (e.g., "/jsx-runtime")
|
|
26
|
+
* @param options - URL options
|
|
27
|
+
*/
|
|
28
|
+
export function buildEsmShUrl(pkg, version, subpath, options) {
|
|
29
|
+
const params = [];
|
|
30
|
+
if (options?.external?.length) {
|
|
31
|
+
params.push(`external=${options.external.join(",")}`);
|
|
32
|
+
}
|
|
33
|
+
params.push(`target=${options?.target ?? "es2022"}`);
|
|
34
|
+
if (options?.deps) {
|
|
35
|
+
const depsStr = Object.entries(options.deps)
|
|
36
|
+
.map(([k, v]) => `${k}@${v}`)
|
|
37
|
+
.join(",");
|
|
38
|
+
params.push(`deps=${depsStr}`);
|
|
39
|
+
}
|
|
40
|
+
const versionStr = version ? `@${version}` : "";
|
|
41
|
+
const pathStr = subpath ?? "";
|
|
42
|
+
const queryStr = params.length ? `?${params.join("&")}` : "";
|
|
43
|
+
return `https://esm.sh/${pkg}${versionStr}${pathStr}${queryStr}`;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Build React esm.sh URL.
|
|
47
|
+
* Uses deps=csstype for type consistency.
|
|
48
|
+
*/
|
|
49
|
+
export function buildReactUrl(pkg, version, subpath, external = false) {
|
|
50
|
+
return buildEsmShUrl(pkg, version, subpath, {
|
|
51
|
+
external: external ? ["react"] : undefined,
|
|
52
|
+
deps: { csstype: CSSTYPE_VERSION },
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Get complete React import map for a specific version.
|
|
57
|
+
*/
|
|
58
|
+
export function getReactImportMap(version) {
|
|
59
|
+
return {
|
|
60
|
+
react: buildReactUrl("react", version),
|
|
61
|
+
"react-dom": buildReactUrl("react-dom", version, undefined, true),
|
|
62
|
+
"react-dom/client": buildReactUrl("react-dom", version, "/client", true),
|
|
63
|
+
"react-dom/server": buildReactUrl("react-dom", version, "/server", true),
|
|
64
|
+
"react/jsx-runtime": buildReactUrl("react", version, "/jsx-runtime", true),
|
|
65
|
+
"react/jsx-dev-runtime": buildReactUrl("react", version, "/jsx-dev-runtime", true),
|
|
66
|
+
// Prefix match for any react/* subpath imports
|
|
67
|
+
"react/": buildReactUrl("react", version, "/", true),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Build module server URL for a path.
|
|
72
|
+
*/
|
|
73
|
+
export function buildModuleServerUrl(baseUrl, path) {
|
|
74
|
+
const normalizedBase = baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl;
|
|
75
|
+
const normalizedPath = path.startsWith("/") ? path : `/${path}`;
|
|
76
|
+
return `${normalizedBase}${normalizedPath}`;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Build cross-project import URL.
|
|
80
|
+
*/
|
|
81
|
+
export function buildCrossProjectUrl(projectSlug, version, path) {
|
|
82
|
+
const modulePath = /\.(js|mjs|jsx|ts|tsx|mdx)$/.test(path) ? path : `${path}.tsx`;
|
|
83
|
+
const projectRef = version && version !== "latest" ? `${projectSlug}@${version}` : projectSlug;
|
|
84
|
+
return `/_vf_modules/_cross/${projectRef}/@/${modulePath}`;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Build veryfront framework module URL.
|
|
88
|
+
*/
|
|
89
|
+
export function buildVeryfrontModuleUrl(path) {
|
|
90
|
+
const normalizedPath = path.replace(/\.(tsx?|jsx)$/, ".js");
|
|
91
|
+
return `/_vf_modules/_veryfront/${normalizedPath}`;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Normalize file extension for JavaScript output.
|
|
95
|
+
*/
|
|
96
|
+
export function normalizeExtension(path, options) {
|
|
97
|
+
if (options?.removeExtension)
|
|
98
|
+
return path.replace(/\.(tsx?|jsx|mdx)$/, "");
|
|
99
|
+
return path.replace(/\.(tsx?|jsx|mdx)$/, ".js");
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Check if a URL is an esm.sh URL.
|
|
103
|
+
*/
|
|
104
|
+
export function isEsmShUrl(url) {
|
|
105
|
+
return url.startsWith("https://esm.sh/") || url.startsWith("http://esm.sh/");
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Add deps query param to esm.sh URL if not already present.
|
|
109
|
+
*/
|
|
110
|
+
export function addEsmShDeps(url, reactVersion) {
|
|
111
|
+
if (!isEsmShUrl(url))
|
|
112
|
+
return url;
|
|
113
|
+
if (url.includes(`react@${reactVersion}`))
|
|
114
|
+
return url;
|
|
115
|
+
try {
|
|
116
|
+
const parsed = new URL(url);
|
|
117
|
+
const params = new URLSearchParams(parsed.search);
|
|
118
|
+
const externals = new Set();
|
|
119
|
+
for (const value of params.getAll("external")) {
|
|
120
|
+
for (const external of value.split(",")) {
|
|
121
|
+
const normalized = external.trim();
|
|
122
|
+
if (normalized)
|
|
123
|
+
externals.add(normalized);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
for (const external of ["react", "react-dom"]) {
|
|
127
|
+
if (params.has(external)) {
|
|
128
|
+
externals.add(external);
|
|
129
|
+
params.delete(external);
|
|
130
|
+
}
|
|
131
|
+
externals.add(external);
|
|
132
|
+
}
|
|
133
|
+
const orderedExternals = [
|
|
134
|
+
"react",
|
|
135
|
+
"react-dom",
|
|
136
|
+
...Array.from(externals).filter((external) => external !== "react" && external !== "react-dom"),
|
|
137
|
+
];
|
|
138
|
+
const target = params.get("target") ?? "es2022";
|
|
139
|
+
params.delete("external");
|
|
140
|
+
params.delete("target");
|
|
141
|
+
const query = [
|
|
142
|
+
`external=${orderedExternals.join(",")}`,
|
|
143
|
+
`target=${target}`,
|
|
144
|
+
...Array.from(params.entries()).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`),
|
|
145
|
+
].join("&");
|
|
146
|
+
return `${parsed.origin}${parsed.pathname}?${query}${parsed.hash}`;
|
|
147
|
+
}
|
|
148
|
+
catch (_) {
|
|
149
|
+
/* expected: malformed URL falls back to the original string */
|
|
150
|
+
return url;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markdown Preview Utilities
|
|
3
|
+
*
|
|
4
|
+
* Helpers for determining markdown preview mode and related checks.
|
|
5
|
+
*
|
|
6
|
+
* @module transforms/md/utils
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Check if a markdown file should be rendered with GitHub preview styles.
|
|
10
|
+
* Returns true for all .md files unless opted out via `prose: false` frontmatter.
|
|
11
|
+
* This includes both standalone files and routable pages (pages/, app/).
|
|
12
|
+
*/
|
|
13
|
+
export declare function isMarkdownPreview(_filePath: string | undefined, frontmatter?: Record<string, unknown>): boolean;
|
|
14
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/md/utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACpC,OAAO,CAGT"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markdown Preview Utilities
|
|
3
|
+
*
|
|
4
|
+
* Helpers for determining markdown preview mode and related checks.
|
|
5
|
+
*
|
|
6
|
+
* @module transforms/md/utils
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Check if a markdown file should be rendered with GitHub preview styles.
|
|
10
|
+
* Returns true for all .md files unless opted out via `prose: false` frontmatter.
|
|
11
|
+
* This includes both standalone files and routable pages (pages/, app/).
|
|
12
|
+
*/
|
|
13
|
+
export function isMarkdownPreview(_filePath, frontmatter) {
|
|
14
|
+
if (frontmatter?.prose === false)
|
|
15
|
+
return false;
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface FrontmatterExtractionResult {
|
|
2
|
+
body: string;
|
|
3
|
+
frontmatter: Record<string, unknown>;
|
|
4
|
+
}
|
|
5
|
+
export declare function extractFrontmatter(content: string, providedFrontmatter?: Record<string, unknown>): FrontmatterExtractionResult;
|
|
6
|
+
//# sourceMappingURL=frontmatter-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontmatter-extractor.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/compiler/frontmatter-extractor.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AA0CD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5C,2BAA2B,CAc7B"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { rendererLogger as logger } from "../../../utils/index.js";
|
|
2
|
+
import { extract } from "../../../platform/compat/std/front-matter-yaml.js";
|
|
3
|
+
function extractYamlFrontmatter(content) {
|
|
4
|
+
if (!content.trim().startsWith("---"))
|
|
5
|
+
return { body: content, frontmatter: {} };
|
|
6
|
+
const extracted = extract(content);
|
|
7
|
+
return {
|
|
8
|
+
body: extracted.body,
|
|
9
|
+
frontmatter: extracted.attrs,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function parseExportValue(rawValue) {
|
|
13
|
+
if (rawValue === "true")
|
|
14
|
+
return true;
|
|
15
|
+
if (rawValue === "false")
|
|
16
|
+
return false;
|
|
17
|
+
if (rawValue === "null")
|
|
18
|
+
return null;
|
|
19
|
+
if (/^\d+(?:\.\d+)?$/.test(rawValue))
|
|
20
|
+
return parseFloat(rawValue);
|
|
21
|
+
return rawValue.replace(/^['"`]|['"`]$/g, "");
|
|
22
|
+
}
|
|
23
|
+
function extractExportConstants(body) {
|
|
24
|
+
const exportRegex = /^export\s+const\s+(\w+)\s*=\s*(['"`][^'"`\n]*['"`]|\d+(?:\.\d+)?|true|false|null)\s*;?\s*$/gm;
|
|
25
|
+
const exports = {};
|
|
26
|
+
let cleanedBody = body;
|
|
27
|
+
let match;
|
|
28
|
+
while ((match = exportRegex.exec(body)) !== null) {
|
|
29
|
+
const key = match[1];
|
|
30
|
+
const rawValue = match[2];
|
|
31
|
+
if (!key || !rawValue)
|
|
32
|
+
continue;
|
|
33
|
+
exports[key] = parseExportValue(rawValue);
|
|
34
|
+
cleanedBody = cleanedBody.replace(match[0], "");
|
|
35
|
+
}
|
|
36
|
+
return { body: cleanedBody, exports };
|
|
37
|
+
}
|
|
38
|
+
export function extractFrontmatter(content, providedFrontmatter) {
|
|
39
|
+
const { body: yamlBody, frontmatter: yamlFrontmatter } = extractYamlFrontmatter(content);
|
|
40
|
+
const { body, exports } = extractExportConstants(yamlBody);
|
|
41
|
+
const frontmatter = {
|
|
42
|
+
...yamlFrontmatter,
|
|
43
|
+
...(providedFrontmatter ?? {}),
|
|
44
|
+
...exports,
|
|
45
|
+
};
|
|
46
|
+
logger.debug("Extracted frontmatter:", frontmatter);
|
|
47
|
+
return { body, frontmatter };
|
|
48
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CompilationTarget } from "veryfront/extensions/content";
|
|
2
|
+
export interface ImportRewriterConfig {
|
|
3
|
+
filePath: string;
|
|
4
|
+
target: CompilationTarget;
|
|
5
|
+
baseUrl?: string;
|
|
6
|
+
projectDir?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function rewriteBodyImports(body: string, config: ImportRewriterConfig): string;
|
|
9
|
+
export declare function rewriteCompiledImports(compiledCode: string, config: ImportRewriterConfig): string;
|
|
10
|
+
//# sourceMappingURL=import-rewriter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-rewriter.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/compiler/import-rewriter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AA8ED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAWrF;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAyBjG"}
|