An experimental TypeSpec syntax for Lexicon

fix playground

+4 -4
+3 -3
packages/playground/samples/index.js
··· 44 44 const content = readFileSync(fullPath, "utf-8"); 45 45 const namespace = file.replace(/\.tsp$/, "").replace(/\//g, "."); 46 46 47 - lexicons.set(namespace, { file, content, suite }); 47 + lexicons.set(namespace, { file, content, suite, fullPath }); 48 48 } 49 49 } 50 50 51 51 // Build samples list for playground 52 52 const samplesList = {}; 53 - for (const [namespace] of lexicons) { 53 + for (const [namespace, lexicon] of lexicons) { 54 54 samplesList[namespace] = { 55 - filename: `samples/${namespace}.tsp`, 55 + filename: relative(join(__dirname, ".."), lexicon.fullPath), 56 56 preferredEmitter: "@typelex/emitter", 57 57 }; 58 58 }
+1 -1
packages/playground/vite.config.ts
··· 1 1 import { definePlaygroundViteConfig } from "@typespec/playground/vite"; 2 2 import { defineConfig } from "vite"; 3 - import samples from "./samples/dist/samples.js"; 3 + import samples from "./samples/index.js"; 4 4 5 5 const playgroundConfig = definePlaygroundViteConfig({ 6 6 defaultEmitter: "@typelex/emitter",