From fbf297f7007593ffa7075c00a78f071754a49667 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Fri, 10 Oct 2025 03:12:40 +0100 Subject: [PATCH] fix playground --- packages/playground/samples/index.js | 6 +++--- packages/playground/vite.config.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/playground/samples/index.js b/packages/playground/samples/index.js index 4ed2e68..84ef12f 100644 --- a/packages/playground/samples/index.js +++ b/packages/playground/samples/index.js @@ -44,15 +44,15 @@ for (const suite of testSuites) { const content = readFileSync(fullPath, "utf-8"); const namespace = file.replace(/\.tsp$/, "").replace(/\//g, "."); - lexicons.set(namespace, { file, content, suite }); + lexicons.set(namespace, { file, content, suite, fullPath }); } } // Build samples list for playground const samplesList = {}; -for (const [namespace] of lexicons) { +for (const [namespace, lexicon] of lexicons) { samplesList[namespace] = { - filename: `samples/${namespace}.tsp`, + filename: relative(join(__dirname, ".."), lexicon.fullPath), preferredEmitter: "@typelex/emitter", }; } diff --git a/packages/playground/vite.config.ts b/packages/playground/vite.config.ts index 4cf29ae..5403510 100644 --- a/packages/playground/vite.config.ts +++ b/packages/playground/vite.config.ts @@ -1,6 +1,6 @@ import { definePlaygroundViteConfig } from "@typespec/playground/vite"; import { defineConfig } from "vite"; -import samples from "./samples/dist/samples.js"; +import samples from "./samples/index.js"; const playgroundConfig = definePlaygroundViteConfig({ defaultEmitter: "@typelex/emitter", -- 2.51.2