From 9abaa83a3224710b26d419815090143edb0ff23e Mon Sep 17 00:00:00 2001 From: Hunter Johnston <64506580+huntabyte@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:09:26 -0500 Subject: [PATCH] registry: pin deps (#1553) --- sites/docs/scripts/registry.ts | 5 +++-- sites/docs/scripts/tmp.ts | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 sites/docs/scripts/tmp.ts diff --git a/sites/docs/scripts/registry.ts b/sites/docs/scripts/registry.ts index dd420e02f..055bfd566 100644 --- a/sites/docs/scripts/registry.ts +++ b/sites/docs/scripts/registry.ts @@ -3,6 +3,7 @@ import path from "node:path"; import { parse, preprocess, walk } from "svelte/compiler"; import { type Registry, styles } from "../src/lib/registry"; import config from "../svelte.config.js"; +import { TMP_PINNED_DEPS } from "./tmp"; // [Dependency, [...PeerDependencies]] const DEPENDENCIES = new Map([ @@ -102,7 +103,7 @@ async function buildUIRegistry(componentPath: string, componentName: string, sty files, name: componentName, registryDependencies: Array.from(registryDependencies), - dependencies: Array.from(dependencies), + dependencies: Array.from(dependencies).map((dep) => TMP_PINNED_DEPS.get(dep) ?? dep), } satisfies RegistryItem; } @@ -133,7 +134,7 @@ async function crawlDemo(rootPath: string, style: string, demoType: "example" | style, files: [file], registryDependencies: Array.from(registryDependencies), - dependencies: Array.from(dependencies), + dependencies: Array.from(dependencies).map((dep) => TMP_PINNED_DEPS.get(dep) ?? dep), }); } diff --git a/sites/docs/scripts/tmp.ts b/sites/docs/scripts/tmp.ts new file mode 100644 index 000000000..96e1e2a63 --- /dev/null +++ b/sites/docs/scripts/tmp.ts @@ -0,0 +1 @@ +export const TMP_PINNED_DEPS = new Map([["formsnap", "formsnap@1.0.1"]]);