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",