@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 @@
|
|
|
1
|
+
{"version":3,"file":"omap.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/yaml/1.1.0/_type/omap.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAiBxC,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE,CAOjE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Ported from js-yaml v3.13.1:
|
|
2
|
+
// https://github.com/nodeca/js-yaml/commit/665aadda42349dcae869f12040d9b10ef18d12da
|
|
3
|
+
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
|
|
4
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
5
|
+
import { isPlainObject } from "../_utils.js";
|
|
6
|
+
function resolveYamlOmap(data) {
|
|
7
|
+
const objectKeys = new Set();
|
|
8
|
+
for (const object of data) {
|
|
9
|
+
if (!isPlainObject(object))
|
|
10
|
+
return false;
|
|
11
|
+
const keys = Object.keys(object);
|
|
12
|
+
if (keys.length !== 1)
|
|
13
|
+
return false;
|
|
14
|
+
for (const key of keys) {
|
|
15
|
+
if (objectKeys.has(key))
|
|
16
|
+
return false;
|
|
17
|
+
objectKeys.add(key);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
export const omap = {
|
|
23
|
+
tag: "tag:yaml.org,2002:omap",
|
|
24
|
+
kind: "sequence",
|
|
25
|
+
resolve: resolveYamlOmap,
|
|
26
|
+
construct(data) {
|
|
27
|
+
return data;
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pairs.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/yaml/1.1.0/_type/pairs.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAQxC,eAAO,MAAM,KAAK,EAAE,IAAI,CAAC,UAAU,CAQlC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Ported from js-yaml v3.13.1:
|
|
2
|
+
// https://github.com/nodeca/js-yaml/commit/665aadda42349dcae869f12040d9b10ef18d12da
|
|
3
|
+
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
|
|
4
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
5
|
+
import { isPlainObject } from "../_utils.js";
|
|
6
|
+
function resolveYamlPairs(data) {
|
|
7
|
+
if (data === null)
|
|
8
|
+
return true;
|
|
9
|
+
return data.every((it) => isPlainObject(it) && Object.keys(it).length === 1);
|
|
10
|
+
}
|
|
11
|
+
export const pairs = {
|
|
12
|
+
tag: "tag:yaml.org,2002:pairs",
|
|
13
|
+
construct(data) {
|
|
14
|
+
// Converts an array of objects into an array of key-value pairs.
|
|
15
|
+
return data?.flatMap(Object.entries) ?? [];
|
|
16
|
+
},
|
|
17
|
+
kind: "sequence",
|
|
18
|
+
resolve: resolveYamlPairs,
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regexp.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/yaml/1.1.0/_type/regexp.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAIxC,eAAO,MAAM,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,CAuBzC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Ported and adapted from js-yaml-js-types v1.0.0:
|
|
2
|
+
// https://github.com/nodeca/js-yaml-js-types/tree/ac537e7bbdd3c2cbbd9882ca3919c520c2dc022b
|
|
3
|
+
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
|
|
4
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
5
|
+
const REGEXP = /^\/(?<regexp>[\s\S]+)\/(?<modifiers>[gismuy]*)$/;
|
|
6
|
+
export const regexp = {
|
|
7
|
+
tag: "tag:yaml.org,2002:js/regexp",
|
|
8
|
+
kind: "scalar",
|
|
9
|
+
resolve(data) {
|
|
10
|
+
if (data === null || !data.length)
|
|
11
|
+
return false;
|
|
12
|
+
if (data.charAt(0) === "/") {
|
|
13
|
+
// Ensure regex is properly terminated
|
|
14
|
+
const groups = data.match(REGEXP)?.groups;
|
|
15
|
+
if (!groups)
|
|
16
|
+
return false;
|
|
17
|
+
// Check no duplicate modifiers
|
|
18
|
+
const modifiers = groups.modifiers ?? "";
|
|
19
|
+
if (new Set(modifiers).size < modifiers.length)
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
return true;
|
|
23
|
+
},
|
|
24
|
+
construct(data) {
|
|
25
|
+
const { regexp = data, modifiers = "" } = data.match(REGEXP)?.groups ?? {};
|
|
26
|
+
return new RegExp(regexp, modifiers);
|
|
27
|
+
},
|
|
28
|
+
predicate: (object) => object instanceof RegExp,
|
|
29
|
+
represent: (object) => object.toString(),
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seq.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/yaml/1.1.0/_type/seq.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,eAAO,MAAM,GAAG,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,CAK3C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Ported from js-yaml v3.13.1:
|
|
2
|
+
// https://github.com/nodeca/js-yaml/commit/665aadda42349dcae869f12040d9b10ef18d12da
|
|
3
|
+
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
|
|
4
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
5
|
+
export const seq = {
|
|
6
|
+
tag: "tag:yaml.org,2002:seq",
|
|
7
|
+
kind: "sequence",
|
|
8
|
+
resolve: () => true,
|
|
9
|
+
construct: (data) => data !== null ? data : [],
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/yaml/1.1.0/_type/set.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,eAAO,MAAM,GAAG,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAS7D,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Ported from js-yaml v3.13.1:
|
|
2
|
+
// https://github.com/nodeca/js-yaml/commit/665aadda42349dcae869f12040d9b10ef18d12da
|
|
3
|
+
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
|
|
4
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
5
|
+
export const set = {
|
|
6
|
+
tag: "tag:yaml.org,2002:set",
|
|
7
|
+
kind: "mapping",
|
|
8
|
+
construct: (data) => data !== null ? data : {},
|
|
9
|
+
resolve: (data) => {
|
|
10
|
+
if (data === null)
|
|
11
|
+
return true;
|
|
12
|
+
return Object.values(data).every((it) => it === null);
|
|
13
|
+
},
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"str.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/yaml/1.1.0/_type/str.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,eAAO,MAAM,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,CAKtC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Ported from js-yaml v3.13.1:
|
|
2
|
+
// https://github.com/nodeca/js-yaml/commit/665aadda42349dcae869f12040d9b10ef18d12da
|
|
3
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
4
|
+
export const str = {
|
|
5
|
+
tag: "tag:yaml.org,2002:str",
|
|
6
|
+
kind: "scalar",
|
|
7
|
+
resolve: () => true,
|
|
8
|
+
construct: (data) => data !== null ? data : "",
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timestamp.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/yaml/1.1.0/_type/timestamp.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAsFxC,eAAO,MAAM,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAS1C,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// Ported from js-yaml v3.13.1:
|
|
2
|
+
// https://github.com/nodeca/js-yaml/commit/665aadda42349dcae869f12040d9b10ef18d12da
|
|
3
|
+
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
|
|
4
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
5
|
+
const YAML_DATE_REGEXP = new RegExp("^([0-9][0-9][0-9][0-9])" + // [1] year
|
|
6
|
+
"-([0-9][0-9])" + // [2] month
|
|
7
|
+
"-([0-9][0-9])$");
|
|
8
|
+
const YAML_TIMESTAMP_REGEXP = new RegExp("^([0-9][0-9][0-9][0-9])" + // [1] year
|
|
9
|
+
"-([0-9][0-9]?)" + // [2] month
|
|
10
|
+
"-([0-9][0-9]?)" + // [3] day
|
|
11
|
+
"(?:[Tt]|[ \\t]+)" + // ...
|
|
12
|
+
"([0-9][0-9]?)" + // [4] hour
|
|
13
|
+
":([0-9][0-9])" + // [5] minute
|
|
14
|
+
":([0-9][0-9])" + // [6] second
|
|
15
|
+
"(?:\\.([0-9]*))?" + // [7] fraction
|
|
16
|
+
"(?:[ \\t]*(Z|([-+])([0-9][0-9]?)" + // [8] tz [9] tz_sign [10] tz_hour
|
|
17
|
+
"(?::([0-9][0-9]))?))?$");
|
|
18
|
+
function resolveYamlTimestamp(data) {
|
|
19
|
+
if (data === null)
|
|
20
|
+
return false;
|
|
21
|
+
if (YAML_DATE_REGEXP.exec(data) !== null)
|
|
22
|
+
return true;
|
|
23
|
+
if (YAML_TIMESTAMP_REGEXP.exec(data) !== null)
|
|
24
|
+
return true;
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
function constructYamlTimestamp(data) {
|
|
28
|
+
let match = YAML_DATE_REGEXP.exec(data);
|
|
29
|
+
if (match === null)
|
|
30
|
+
match = YAML_TIMESTAMP_REGEXP.exec(data);
|
|
31
|
+
if (match === null) {
|
|
32
|
+
throw new Error("Cannot construct YAML timestamp: date resolve error");
|
|
33
|
+
}
|
|
34
|
+
// match: [1] year [2] month [3] day
|
|
35
|
+
const year = +match[1];
|
|
36
|
+
const month = +match[2] - 1; // JS month starts with 0
|
|
37
|
+
const day = +match[3];
|
|
38
|
+
if (!match[4]) {
|
|
39
|
+
// no hour
|
|
40
|
+
return new Date(Date.UTC(year, month, day));
|
|
41
|
+
}
|
|
42
|
+
// match: [4] hour [5] minute [6] second [7] fraction
|
|
43
|
+
const hour = +match[4];
|
|
44
|
+
const minute = +match[5];
|
|
45
|
+
const second = +match[6];
|
|
46
|
+
let fraction = 0;
|
|
47
|
+
if (match[7]) {
|
|
48
|
+
let partFraction = match[7].slice(0, 3);
|
|
49
|
+
while (partFraction.length < 3) {
|
|
50
|
+
// milli-seconds
|
|
51
|
+
partFraction += "0";
|
|
52
|
+
}
|
|
53
|
+
fraction = +partFraction;
|
|
54
|
+
}
|
|
55
|
+
// match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute
|
|
56
|
+
let delta = null;
|
|
57
|
+
if (match[9] && match[10]) {
|
|
58
|
+
const tzHour = +match[10];
|
|
59
|
+
const tzMinute = +(match[11] || 0);
|
|
60
|
+
delta = (tzHour * 60 + tzMinute) * 60000; // delta in milli-seconds
|
|
61
|
+
if (match[9] === "-")
|
|
62
|
+
delta = -delta;
|
|
63
|
+
}
|
|
64
|
+
const date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
|
|
65
|
+
if (delta)
|
|
66
|
+
date.setTime(date.getTime() - delta);
|
|
67
|
+
return date;
|
|
68
|
+
}
|
|
69
|
+
function representYamlTimestamp(date) {
|
|
70
|
+
return date.toISOString();
|
|
71
|
+
}
|
|
72
|
+
export const timestamp = {
|
|
73
|
+
tag: "tag:yaml.org,2002:timestamp",
|
|
74
|
+
construct: constructYamlTimestamp,
|
|
75
|
+
predicate(object) {
|
|
76
|
+
return object instanceof Date;
|
|
77
|
+
},
|
|
78
|
+
kind: "scalar",
|
|
79
|
+
represent: representYamlTimestamp,
|
|
80
|
+
resolve: resolveYamlTimestamp,
|
|
81
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"undefined.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/yaml/1.1.0/_type/undefined.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,eAAO,MAAM,aAAa,EAAE,IAAI,CAAC,QAAQ,EAAE,SAAS,CAenD,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Ported and adapted from js-yaml-js-types v1.0.0:
|
|
2
|
+
// https://github.com/nodeca/js-yaml-js-types/tree/ac537e7bbdd3c2cbbd9882ca3919c520c2dc022b
|
|
3
|
+
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
|
|
4
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
5
|
+
export const undefinedType = {
|
|
6
|
+
tag: "tag:yaml.org,2002:js/undefined",
|
|
7
|
+
kind: "scalar",
|
|
8
|
+
resolve() {
|
|
9
|
+
return true;
|
|
10
|
+
},
|
|
11
|
+
construct() {
|
|
12
|
+
return undefined;
|
|
13
|
+
},
|
|
14
|
+
predicate(object) {
|
|
15
|
+
return typeof object === "undefined";
|
|
16
|
+
},
|
|
17
|
+
represent() {
|
|
18
|
+
return "";
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The kind of YAML node.
|
|
3
|
+
*/
|
|
4
|
+
export type KindType = "sequence" | "scalar" | "mapping";
|
|
5
|
+
/**
|
|
6
|
+
* The style variation for `styles` option of {@linkcode stringify}
|
|
7
|
+
*/
|
|
8
|
+
export type StyleVariant = "lowercase" | "uppercase" | "camelcase" | "decimal" | "binary" | "octal" | "hexadecimal";
|
|
9
|
+
/**
|
|
10
|
+
* Function to convert data to a string for YAML serialization.
|
|
11
|
+
*/
|
|
12
|
+
export type RepresentFn<D> = (data: D, style?: StyleVariant) => string;
|
|
13
|
+
/**
|
|
14
|
+
* A type definition for a YAML node.
|
|
15
|
+
*/
|
|
16
|
+
export interface Type<K extends KindType, D = any> {
|
|
17
|
+
/** Tag to identify the type */
|
|
18
|
+
tag: string;
|
|
19
|
+
/** Kind of type */
|
|
20
|
+
kind: K;
|
|
21
|
+
/** Cast the type. Used to stringify */
|
|
22
|
+
predicate?: (data: unknown) => data is D;
|
|
23
|
+
/** Function to represent data. Used to stringify */
|
|
24
|
+
represent?: RepresentFn<D> | Record<string, RepresentFn<D>>;
|
|
25
|
+
/** Default style for the type. Used to stringify */
|
|
26
|
+
defaultStyle?: StyleVariant;
|
|
27
|
+
/** Function to test whether data can be resolved by this type. Used to parse */
|
|
28
|
+
resolve: (data: any) => boolean;
|
|
29
|
+
/** Function to construct data from string. Used to parse */
|
|
30
|
+
construct: (data: any) => D;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=_type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_type.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/yaml/1.1.0/_type.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;AACzD;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,WAAW,GACX,WAAW,GACX,SAAS,GACT,QAAQ,GACR,OAAO,GACP,aAAa,CAAC;AAElB;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,YAAY,KAAK,MAAM,CAAC;AAEvE;;GAEG;AAEH,MAAM,WAAW,IAAI,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,GAAG,GAAG;IAC/C,+BAA+B;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,mBAAmB;IACnB,IAAI,EAAE,CAAC,CAAC;IACR,uCAAuC;IACvC,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,IAAI,CAAC,CAAC;IACzC,oDAAoD;IACpD,SAAS,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,oDAAoD;IACpD,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,gFAAgF;IAEhF,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC;IAChC,4DAA4D;IAE5D,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC;CAC7B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Ported from js-yaml v3.13.1:
|
|
2
|
+
// https://github.com/nodeca/js-yaml/commit/665aadda42349dcae869f12040d9b10ef18d12da
|
|
3
|
+
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
|
|
4
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
5
|
+
// This module is browser compatible.
|
|
6
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_utils.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/yaml/1.1.0/_utils.ts"],"names":[],"mappings":"AAKA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,MAAM,CAE/D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Ported from js-yaml v3.13.1:
|
|
2
|
+
// https://github.com/nodeca/js-yaml/commit/665aadda42349dcae869f12040d9b10ef18d12da
|
|
3
|
+
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
|
|
4
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
5
|
+
export function isObject(value) {
|
|
6
|
+
return value !== null && typeof value === "object";
|
|
7
|
+
}
|
|
8
|
+
export function isNegativeZero(i) {
|
|
9
|
+
return i === 0 && Number.NEGATIVE_INFINITY === 1 / i;
|
|
10
|
+
}
|
|
11
|
+
export function isPlainObject(object) {
|
|
12
|
+
return Object.prototype.toString.call(object) === "[object Object]";
|
|
13
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { type SchemaType } from "./_schema.js";
|
|
2
|
+
export type { SchemaType };
|
|
3
|
+
/** Options for {@linkcode parse}. */
|
|
4
|
+
export interface ParseOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Name of the schema to use.
|
|
7
|
+
*
|
|
8
|
+
* @default {"default"}
|
|
9
|
+
*/
|
|
10
|
+
schema?: SchemaType;
|
|
11
|
+
/**
|
|
12
|
+
* If `true`, duplicate keys will overwrite previous values. Otherwise,
|
|
13
|
+
* duplicate keys will throw a {@linkcode SyntaxError}.
|
|
14
|
+
*
|
|
15
|
+
* @default {false}
|
|
16
|
+
*/
|
|
17
|
+
allowDuplicateKeys?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* If defined, a function to call on warning messages taking an
|
|
20
|
+
* {@linkcode Error} as its only argument.
|
|
21
|
+
*/
|
|
22
|
+
onWarning?(error: Error): void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Parse and return a YAML string as a parsed YAML document object.
|
|
26
|
+
*
|
|
27
|
+
* Note: This does not support functions. Untrusted data is safe to parse.
|
|
28
|
+
*
|
|
29
|
+
* @example Usage
|
|
30
|
+
* ```ts
|
|
31
|
+
* import { parse } from "@std/yaml/parse";
|
|
32
|
+
* import { assertEquals } from "@std/assert";
|
|
33
|
+
*
|
|
34
|
+
* const data = parse(`
|
|
35
|
+
* id: 1
|
|
36
|
+
* name: Alice
|
|
37
|
+
* `);
|
|
38
|
+
*
|
|
39
|
+
* assertEquals(data, { id: 1, name: "Alice" });
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @throws {SyntaxError} Throws error on invalid YAML.
|
|
43
|
+
* @param content YAML string to parse.
|
|
44
|
+
* @param options Parsing options.
|
|
45
|
+
* @returns Parsed document.
|
|
46
|
+
*/
|
|
47
|
+
export declare function parse(content: string, options?: ParseOptions): unknown;
|
|
48
|
+
/**
|
|
49
|
+
* Same as {@linkcode parse}, but understands multi-document YAML sources, and
|
|
50
|
+
* returns multiple parsed YAML document objects.
|
|
51
|
+
*
|
|
52
|
+
* @example Usage
|
|
53
|
+
* ```ts
|
|
54
|
+
* import { parseAll } from "@std/yaml/parse";
|
|
55
|
+
* import { assertEquals } from "@std/assert";
|
|
56
|
+
*
|
|
57
|
+
* const data = parseAll(`
|
|
58
|
+
* ---
|
|
59
|
+
* id: 1
|
|
60
|
+
* name: Alice
|
|
61
|
+
* ---
|
|
62
|
+
* id: 2
|
|
63
|
+
* name: Bob
|
|
64
|
+
* ---
|
|
65
|
+
* id: 3
|
|
66
|
+
* name: Eve
|
|
67
|
+
* `);
|
|
68
|
+
* assertEquals(data, [ { id: 1, name: "Alice" }, { id: 2, name: "Bob" }, { id: 3, name: "Eve" }]);
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @param content YAML string to parse.
|
|
72
|
+
* @param options Parsing options.
|
|
73
|
+
* @returns Array of parsed documents.
|
|
74
|
+
*/
|
|
75
|
+
export declare function parseAll(content: string, options?: ParseOptions): unknown;
|
|
76
|
+
//# sourceMappingURL=parse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/yaml/1.1.0/parse.ts"],"names":[],"mappings":"AAQA,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAE3D,YAAY,EAAE,UAAU,EAAE,CAAC;AAE3B,qCAAqC;AACrC,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,SAAS,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CAChC;AAgBD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,KAAK,CACnB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,YAAiB,GACzB,OAAO,CAcT;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAO7E"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// Ported from js-yaml v3.13.1:
|
|
2
|
+
// https://github.com/nodeca/js-yaml/commit/665aadda42349dcae869f12040d9b10ef18d12da
|
|
3
|
+
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
|
|
4
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
5
|
+
// This module is browser compatible.
|
|
6
|
+
import { isEOL } from "./_chars.js";
|
|
7
|
+
import { LoaderState } from "./_loader_state.js";
|
|
8
|
+
import { SCHEMA_MAP } from "./_schema.js";
|
|
9
|
+
function sanitizeInput(input) {
|
|
10
|
+
input = String(input);
|
|
11
|
+
if (input.length > 0) {
|
|
12
|
+
// Add trailing `\n` if not exists
|
|
13
|
+
if (!isEOL(input.charCodeAt(input.length - 1)))
|
|
14
|
+
input += "\n";
|
|
15
|
+
// Strip BOM
|
|
16
|
+
if (input.charCodeAt(0) === 0xfeff)
|
|
17
|
+
input = input.slice(1);
|
|
18
|
+
}
|
|
19
|
+
return input;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Parse and return a YAML string as a parsed YAML document object.
|
|
23
|
+
*
|
|
24
|
+
* Note: This does not support functions. Untrusted data is safe to parse.
|
|
25
|
+
*
|
|
26
|
+
* @example Usage
|
|
27
|
+
* ```ts
|
|
28
|
+
* import { parse } from "@std/yaml/parse";
|
|
29
|
+
* import { assertEquals } from "@std/assert";
|
|
30
|
+
*
|
|
31
|
+
* const data = parse(`
|
|
32
|
+
* id: 1
|
|
33
|
+
* name: Alice
|
|
34
|
+
* `);
|
|
35
|
+
*
|
|
36
|
+
* assertEquals(data, { id: 1, name: "Alice" });
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @throws {SyntaxError} Throws error on invalid YAML.
|
|
40
|
+
* @param content YAML string to parse.
|
|
41
|
+
* @param options Parsing options.
|
|
42
|
+
* @returns Parsed document.
|
|
43
|
+
*/
|
|
44
|
+
export function parse(content, options = {}) {
|
|
45
|
+
content = sanitizeInput(content);
|
|
46
|
+
const state = new LoaderState(content, {
|
|
47
|
+
...options,
|
|
48
|
+
schema: SCHEMA_MAP.get(options.schema),
|
|
49
|
+
});
|
|
50
|
+
const documentGenerator = state.readDocuments();
|
|
51
|
+
const document = documentGenerator.next().value;
|
|
52
|
+
if (!documentGenerator.next().done) {
|
|
53
|
+
throw new SyntaxError("Found more than 1 document in the stream: expected a single document");
|
|
54
|
+
}
|
|
55
|
+
return document ?? null;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Same as {@linkcode parse}, but understands multi-document YAML sources, and
|
|
59
|
+
* returns multiple parsed YAML document objects.
|
|
60
|
+
*
|
|
61
|
+
* @example Usage
|
|
62
|
+
* ```ts
|
|
63
|
+
* import { parseAll } from "@std/yaml/parse";
|
|
64
|
+
* import { assertEquals } from "@std/assert";
|
|
65
|
+
*
|
|
66
|
+
* const data = parseAll(`
|
|
67
|
+
* ---
|
|
68
|
+
* id: 1
|
|
69
|
+
* name: Alice
|
|
70
|
+
* ---
|
|
71
|
+
* id: 2
|
|
72
|
+
* name: Bob
|
|
73
|
+
* ---
|
|
74
|
+
* id: 3
|
|
75
|
+
* name: Eve
|
|
76
|
+
* `);
|
|
77
|
+
* assertEquals(data, [ { id: 1, name: "Alice" }, { id: 2, name: "Bob" }, { id: 3, name: "Eve" }]);
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* @param content YAML string to parse.
|
|
81
|
+
* @param options Parsing options.
|
|
82
|
+
* @returns Array of parsed documents.
|
|
83
|
+
*/
|
|
84
|
+
export function parseAll(content, options = {}) {
|
|
85
|
+
content = sanitizeInput(content);
|
|
86
|
+
const state = new LoaderState(content, {
|
|
87
|
+
...options,
|
|
88
|
+
schema: SCHEMA_MAP.get(options.schema),
|
|
89
|
+
});
|
|
90
|
+
return [...state.readDocuments()];
|
|
91
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-compile.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/ext-content-mdx/src/compiler/markdown-compile.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAkDnG,wBAAsB,eAAe,CACnC,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,uBAAuB,CAAC,CA4DlC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { unified } from "unified";
|
|
2
|
+
import remarkParse from "remark-parse";
|
|
3
|
+
import remarkGfm from "remark-gfm";
|
|
4
|
+
import remarkFrontmatter from "remark-frontmatter";
|
|
5
|
+
import remarkRehype from "remark-rehype";
|
|
6
|
+
import rehypeStarryNight from "rehype-starry-night";
|
|
7
|
+
import rehypeSlug from "rehype-slug";
|
|
8
|
+
import rehypeRaw from "rehype-raw";
|
|
9
|
+
import rehypeSanitize, { defaultSchema } from "rehype-sanitize";
|
|
10
|
+
import rehypeStringify from "rehype-stringify";
|
|
11
|
+
import { visit } from "unist-util-visit";
|
|
12
|
+
import { toString } from "mdast-util-to-string";
|
|
13
|
+
import Slugger from "github-slugger";
|
|
14
|
+
import { extractFrontmatter } from "../../../../src/transforms/mdx/compiler/frontmatter-extractor.js";
|
|
15
|
+
import { isMarkdownPreview } from "../../../../src/transforms/md/utils.js";
|
|
16
|
+
import { rehypeNodePositions } from "../plugins/rehype-node-positions.js";
|
|
17
|
+
function remarkExtractHeadings(headings) {
|
|
18
|
+
const slugger = new Slugger();
|
|
19
|
+
return (tree) => {
|
|
20
|
+
visit(tree, "heading", (node) => {
|
|
21
|
+
const text = toString(node);
|
|
22
|
+
const id = slugger.slug(text);
|
|
23
|
+
headings.push({ id, text, level: node.depth });
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function escapeForJsString(str) {
|
|
28
|
+
return str.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
29
|
+
}
|
|
30
|
+
function createCompiledCode(escapedHtml, isPreview) {
|
|
31
|
+
const injector = `dangerouslySetInnerHTML: { __html: \`${escapedHtml}\` }`;
|
|
32
|
+
if (isPreview) {
|
|
33
|
+
return `import { jsx as _jsx } from "react/jsx-runtime";
|
|
34
|
+
export default function MDContent({ components, params, ...props }) {
|
|
35
|
+
return _jsx("div", {
|
|
36
|
+
className: "markdown-body",
|
|
37
|
+
${injector}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
}
|
|
42
|
+
return `import { jsx as _jsx } from "react/jsx-runtime";
|
|
43
|
+
export default function MDContent({ components, params, className, ...props }) {
|
|
44
|
+
return _jsx("div", {
|
|
45
|
+
className,
|
|
46
|
+
${injector}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
}
|
|
51
|
+
export async function compileMarkdown(options) {
|
|
52
|
+
const { content, frontmatter: providedFrontmatter, filePath, studioEmbed } = options;
|
|
53
|
+
const { body, frontmatter: extractedFrontmatter } = extractFrontmatter(content, providedFrontmatter);
|
|
54
|
+
const headings = [];
|
|
55
|
+
const pipeline = unified()
|
|
56
|
+
.use(remarkParse)
|
|
57
|
+
.use(remarkGfm)
|
|
58
|
+
.use(remarkFrontmatter)
|
|
59
|
+
.use(remarkExtractHeadings, headings)
|
|
60
|
+
.use(remarkRehype, { allowDangerousHtml: true })
|
|
61
|
+
.use(rehypeStarryNight)
|
|
62
|
+
.use(rehypeSlug);
|
|
63
|
+
pipeline.use(rehypeRaw);
|
|
64
|
+
if (studioEmbed && filePath) {
|
|
65
|
+
pipeline.use(rehypeNodePositions, { filePath });
|
|
66
|
+
}
|
|
67
|
+
const sanitizeSchema = studioEmbed
|
|
68
|
+
? {
|
|
69
|
+
...defaultSchema,
|
|
70
|
+
attributes: {
|
|
71
|
+
...defaultSchema.attributes,
|
|
72
|
+
"*": [
|
|
73
|
+
...(defaultSchema.attributes?.["*"] ?? []),
|
|
74
|
+
"data-node-file",
|
|
75
|
+
"data-node-name",
|
|
76
|
+
"data-node-line",
|
|
77
|
+
"data-node-column",
|
|
78
|
+
"data-node-source",
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
}
|
|
82
|
+
: defaultSchema;
|
|
83
|
+
const result = await pipeline
|
|
84
|
+
.use(rehypeSanitize, sanitizeSchema)
|
|
85
|
+
.use(rehypeStringify)
|
|
86
|
+
.process(body);
|
|
87
|
+
const html = String(result);
|
|
88
|
+
const escapedHtml = escapeForJsString(html);
|
|
89
|
+
const isPreview = isMarkdownPreview(filePath, extractedFrontmatter);
|
|
90
|
+
const compiledCode = createCompiledCode(escapedHtml, isPreview);
|
|
91
|
+
return {
|
|
92
|
+
compiledCode,
|
|
93
|
+
frontmatter: extractedFrontmatter,
|
|
94
|
+
globals: {},
|
|
95
|
+
headings,
|
|
96
|
+
nodeMap: new Map(),
|
|
97
|
+
rawHtml: html,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdx-compile.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/ext-content-mdx/src/compiler/mdx-compile.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAQnG,wBAAsB,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAuEjG"}
|