@typespec/playground 0.15.0-dev.4 → 0.15.0-dev.6

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.
@@ -1983,12 +1983,11 @@ var OutputTabs = ({ filenames, selected, onSelect }) => {
1983
1983
  * Tracks which output files have changed between compilations.
1984
1984
  * Returns the set of changed file paths and a map of changed line numbers per file.
1985
1985
  */
1986
- function useFileChanges(program, outputFiles, highlightChanges) {
1986
+ function useFileChanges(program, outputFiles) {
1987
1987
  const [changedFiles, setChangedFiles] = useState(/* @__PURE__ */ new Set());
1988
1988
  const [changedLines, setChangedLines] = useState(/* @__PURE__ */ new Map());
1989
1989
  const prevContentsRef = useRef(/* @__PURE__ */ new Map());
1990
1990
  useEffect(() => {
1991
- if (!highlightChanges) return;
1992
1991
  let cancelled = false;
1993
1992
  async function diffFiles() {
1994
1993
  const changed = /* @__PURE__ */ new Set();
@@ -2024,11 +2023,7 @@ function useFileChanges(program, outputFiles, highlightChanges) {
2024
2023
  return () => {
2025
2024
  cancelled = true;
2026
2025
  };
2027
- }, [
2028
- program,
2029
- outputFiles,
2030
- highlightChanges
2031
- ]);
2026
+ }, [program, outputFiles]);
2032
2027
  return useMemo(() => ({
2033
2028
  changedFiles,
2034
2029
  changedLines
@@ -2052,10 +2047,10 @@ var output_view_module_default = {
2052
2047
  };
2053
2048
  //#endregion
2054
2049
  //#region src/react/output-view/file-viewer.tsx
2055
- var FileViewerComponent = ({ program, outputFiles, fileViewers, highlightChanges }) => {
2050
+ var FileViewerComponent = ({ program, outputFiles, fileViewers }) => {
2056
2051
  const [filename, setFilename] = useState("");
2057
2052
  const [content, setContent] = useState("");
2058
- const { changedFiles, changedLines } = useFileChanges(program, outputFiles, highlightChanges);
2053
+ const { changedFiles, changedLines } = useFileChanges(program, outputFiles);
2059
2054
  const showFileTree = useMemo(() => outputFiles.some((f) => f.includes("/")) || outputFiles.length >= 3, [outputFiles]);
2060
2055
  const loadOutputFile = useCallback(async (path) => {
2061
2056
  setContent((await program.host.readFile("./tsp-output/" + path)).text);
@@ -2090,7 +2085,7 @@ var FileViewerComponent = ({ program, outputFiles, fileViewers, highlightChanges
2090
2085
  files: outputFiles,
2091
2086
  selected: filename,
2092
2087
  onSelect: handleFileSelection,
2093
- changedFiles: highlightChanges ? changedFiles : void 0
2088
+ changedFiles
2094
2089
  })
2095
2090
  }), /* @__PURE__ */ jsx(Pane, { children: /* @__PURE__ */ jsxs("div", {
2096
2091
  className: output_view_module_default["file-viewer-content-with-breadcrumb"],
@@ -2100,7 +2095,7 @@ var FileViewerComponent = ({ program, outputFiles, fileViewers, highlightChanges
2100
2095
  filename,
2101
2096
  content,
2102
2097
  viewers: fileViewers,
2103
- changedLineNumbers: highlightChanges ? changedLines.get(filename) : void 0
2098
+ changedLineNumbers: changedLines.get(filename)
2104
2099
  })
2105
2100
  })]
2106
2101
  }) })]
@@ -2118,14 +2113,13 @@ var FileViewerComponent = ({ program, outputFiles, fileViewers, highlightChanges
2118
2113
  filename,
2119
2114
  content,
2120
2115
  viewers: fileViewers,
2121
- changedLineNumbers: highlightChanges ? changedLines.get(filename) : void 0
2116
+ changedLineNumbers: changedLines.get(filename)
2122
2117
  })
2123
2118
  })]
2124
2119
  });
2125
2120
  };
2126
- function createFileViewer(fileViewers, options) {
2121
+ function createFileViewer(fileViewers) {
2127
2122
  const viewerMap = Object.fromEntries(fileViewers.map((x) => [x.key, x]));
2128
- const highlightChanges = options?.highlightChanges ?? false;
2129
2123
  return {
2130
2124
  key: "file-output",
2131
2125
  label: "Output explorer",
@@ -2133,8 +2127,7 @@ function createFileViewer(fileViewers, options) {
2133
2127
  render: (props) => {
2134
2128
  return /* @__PURE__ */ jsx(FileViewerComponent, {
2135
2129
  ...props,
2136
- fileViewers: viewerMap,
2137
- highlightChanges
2130
+ fileViewers: viewerMap
2138
2131
  });
2139
2132
  }
2140
2133
  };
@@ -2166,12 +2159,8 @@ var TypeGraphViewer = {
2166
2159
  };
2167
2160
  //#endregion
2168
2161
  //#region src/react/output-view/output-view.tsx
2169
- var OutputView = ({ compilationState, isCompiling, isOutputStale, viewers, fileViewers, highlightChanges, selectedViewer, onViewerChange, viewerState, onViewerStateChange }) => {
2170
- const resolvedViewers = useMemo(() => resolveViewers(viewers, fileViewers, highlightChanges), [
2171
- fileViewers,
2172
- viewers,
2173
- highlightChanges
2174
- ]);
2162
+ var OutputView = ({ compilationState, isCompiling, isOutputStale, viewers, fileViewers, selectedViewer, onViewerChange, viewerState, onViewerStateChange }) => {
2163
+ const resolvedViewers = useMemo(() => resolveViewers(viewers, fileViewers), [fileViewers, viewers]);
2175
2164
  if (compilationState === void 0) {
2176
2165
  if (isCompiling) return /* @__PURE__ */ jsx("div", {
2177
2166
  className: output_view_module_default["output-compiling"],
@@ -2208,8 +2197,8 @@ var OutputView = ({ compilationState, isCompiling, isOutputStale, viewers, fileV
2208
2197
  ]
2209
2198
  });
2210
2199
  };
2211
- function resolveViewers(viewers, fileViewers, highlightChanges) {
2212
- const fileViewer = createFileViewer(fileViewers ?? [], { highlightChanges });
2200
+ function resolveViewers(viewers, fileViewers) {
2201
+ const fileViewer = createFileViewer(fileViewers ?? []);
2213
2202
  const output = { programViewers: {
2214
2203
  [fileViewer.key]: fileViewer,
2215
2204
  [TypeGraphViewer.key]: TypeGraphViewer
@@ -2598,20 +2587,34 @@ var Playground = (props) => {
2598
2587
  props.samples
2599
2588
  ]);
2600
2589
  const compileIdRef = useRef(0);
2590
+ const isCompilingRef = useRef(false);
2591
+ const pendingRecompileRef = useRef(false);
2592
+ const doCompileRef = useRef(() => Promise.resolve());
2601
2593
  const doCompile = useCallback(async () => {
2594
+ if (isCompilingRef.current) {
2595
+ pendingRecompileRef.current = true;
2596
+ return;
2597
+ }
2602
2598
  const currentContent = typespecModel.getValue();
2603
2599
  const typespecCompiler = host.compiler;
2604
2600
  const compileId = ++compileIdRef.current;
2601
+ isCompilingRef.current = true;
2605
2602
  setIsCompiling(true);
2606
2603
  let state;
2607
2604
  try {
2608
2605
  state = await compile(host, currentContent, selectedEmitter, compilerOptions);
2609
2606
  } catch (error) {
2610
2607
  console.error("Compilation failed", error);
2611
- return;
2612
- } finally {
2608
+ isCompilingRef.current = false;
2613
2609
  setIsCompiling(false);
2610
+ if (pendingRecompileRef.current) {
2611
+ pendingRecompileRef.current = false;
2612
+ doCompileRef.current();
2613
+ }
2614
+ return;
2614
2615
  }
2616
+ isCompilingRef.current = false;
2617
+ setIsCompiling(false);
2615
2618
  if (compileId !== compileIdRef.current) return;
2616
2619
  if ("program" in state && state.program.hasError() && state.outputFiles.length === 0 && lastSuccessfulOutputRef.current.length > 0) {
2617
2620
  setIsOutputStale(true);
@@ -2639,12 +2642,19 @@ var Playground = (props) => {
2639
2642
  updateDiagnosticsForCodeFixes(typespecCompiler, []);
2640
2643
  editor.setModelMarkers(typespecModel, "owner", []);
2641
2644
  }
2645
+ if (pendingRecompileRef.current) {
2646
+ pendingRecompileRef.current = false;
2647
+ doCompileRef.current();
2648
+ }
2642
2649
  }, [
2643
2650
  host,
2644
2651
  selectedEmitter,
2645
2652
  compilerOptions,
2646
2653
  typespecModel
2647
2654
  ]);
2655
+ useEffect(() => {
2656
+ doCompileRef.current = doCompile;
2657
+ }, [doCompile]);
2648
2658
  const currentEmitterOptions = selectedEmitter ? props.emitterOptions?.[selectedEmitter] : void 0;
2649
2659
  useEffect(() => {
2650
2660
  const debouncer = debounce(() => doCompile(), currentEmitterOptions?.debounce ?? 200);
@@ -2760,7 +2770,6 @@ var Playground = (props) => {
2760
2770
  editorOptions: props.editorOptions,
2761
2771
  viewers: props.viewers,
2762
2772
  fileViewers: selectedEmitter ? props.emitterViewers?.[selectedEmitter] : void 0,
2763
- highlightChanges: currentEmitterOptions?.newChangeDiff,
2764
2773
  selectedViewer,
2765
2774
  onViewerChange: onSelectedViewerChange,
2766
2775
  viewerState,
@@ -1,7 +1,3 @@
1
1
  import { FileOutputViewer, ProgramViewer } from '../types.js';
2
- export interface FileViewerOptions {
3
- /** When true, highlights changed files in the tree and changed lines in the editor after recompilation. */
4
- highlightChanges?: boolean;
5
- }
6
- export declare function createFileViewer(fileViewers: FileOutputViewer[], options?: FileViewerOptions): ProgramViewer;
2
+ export declare function createFileViewer(fileViewers: FileOutputViewer[]): ProgramViewer;
7
3
  //# sourceMappingURL=file-viewer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-viewer.d.ts","sourceRoot":"","sources":["../../../../src/react/output-view/file-viewer.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAqB,aAAa,EAAE,MAAM,aAAa,CAAC;AAsGtF,MAAM,WAAW,iBAAiB;IAChC,2GAA2G;IAC3G,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,gBAAgB,EAAE,EAC/B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,aAAa,CAiBf"}
1
+ {"version":3,"file":"file-viewer.d.ts","sourceRoot":"","sources":["../../../../src/react/output-view/file-viewer.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAqB,aAAa,EAAE,MAAM,aAAa,CAAC;AAoGtF,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,gBAAgB,EAAE,GAAG,aAAa,CAU/E"}
@@ -12,10 +12,6 @@ export interface OutputViewProps {
12
12
  */
13
13
  viewers?: ProgramViewer[];
14
14
  fileViewers?: FileOutputViewer[];
15
- /**
16
- * When true, highlights changed files and lines after recompilation.
17
- */
18
- highlightChanges?: boolean;
19
15
  /**
20
16
  * The currently selected viewer key.
21
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"output-view.d.ts","sourceRoot":"","sources":["../../../../src/react/output-view/output-view.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAkC,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,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a,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,wBAAwB,CAAC;IACzC;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACjC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;CAC5D;AAED,eAAO,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,CAmDzD,CAAC"}
@@ -7,5 +7,5 @@ export interface FileChanges {
7
7
  * Tracks which output files have changed between compilations.
8
8
  * Returns the set of changed file paths and a map of changed line numbers per file.
9
9
  */
10
- export declare function useFileChanges(program: CompileResult["program"], outputFiles: string[], highlightChanges: boolean): FileChanges;
10
+ export declare function useFileChanges(program: CompileResult["program"], outputFiles: string[]): FileChanges;
11
11
  //# sourceMappingURL=use-file-changes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-file-changes.d.ts","sourceRoot":"","sources":["../../../../src/react/output-view/use-file-changes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACrC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,EACjC,WAAW,EAAE,MAAM,EAAE,EACrB,gBAAgB,EAAE,OAAO,GACxB,WAAW,CA8Db"}
1
+ {"version":3,"file":"use-file-changes.d.ts","sourceRoot":"","sources":["../../../../src/react/output-view/use-file-changes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACrC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,EACjC,WAAW,EAAE,MAAM,EAAE,GACpB,WAAW,CA6Db"}
@@ -7,8 +7,6 @@ export type { PlaygroundState };
7
7
  export interface PlaygroundEmitterOptions {
8
8
  /** Compile debounce delay in milliseconds. Default is 200. */
9
9
  debounce?: number;
10
- /** When true, highlights changed files and lines after recompilation. */
11
- newChangeDiff?: boolean;
12
10
  }
13
11
  export interface PlaygroundProps {
14
12
  host: BrowserHost;
@@ -1 +1 @@
1
- {"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../../../src/react/playground.tsx"],"names":[],"mappings":"AAGA,OAAO,sCAAsC,CAAC;AAG9C,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AASjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAoB,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEpF,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAIrF,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC,MAAM,WAAW,wBAAwB;IACvC,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yEAA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AAW,EAAE,SAAS,CAAC;IACvE,OAAO,CAAC,EAAE,MAAM,CAAC,oCAAoC,CAAC;CACvD;AAED,eAAO,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,CAejE,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,aAAa,CAAC,EAAE,wBAAwB,CAAC;CAC1C,CA8CA,CAAC"}
1
+ {"version":3,"file":"typespec-editor.d.ts","sourceRoot":"","sources":["../../../src/react/typespec-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAS,MAAM,eAAe,CAAC;AAC9C,OAAO,EAA4C,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACzF,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,uBAAuB,CAAC;AAG/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC;IACvE,OAAO,CAAC,EAAE,MAAM,CAAC,oCAAoC,CAAC;CACvD;AAED,eAAO,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,CAejE,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,aAAa,CAAC,EAAE,wBAAwB,CAAC;CAC1C,CA8CA,CAAC"}
package/dist/style.css CHANGED
@@ -287,6 +287,10 @@
287
287
  margin: 0;
288
288
  line-height: 1.4;
289
289
  }
290
+ /* Monaco decoration class (must be a plain global selector) */
291
+ .playground-changed-line {
292
+ background-color: rgba(0, 180, 0, 0.15);
293
+ }
290
294
  ._settings_1yvpj_1 {
291
295
  display: flex;
292
296
  flex-direction: column;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typespec/playground",
3
- "version": "0.15.0-dev.4",
3
+ "version": "0.15.0-dev.6",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "TypeSpec playground UI components.",
6
6
  "homepage": "https://typespec.io",
@@ -74,8 +74,8 @@
74
74
  "debounce": "^3.0.0",
75
75
  "lzutf8": "0.6.3",
76
76
  "monaco-editor": "^0.55.1",
77
- "react": "^19.2.4",
78
- "react-dom": "^19.2.4",
77
+ "react": "^19.2.5",
78
+ "react-dom": "^19.2.5",
79
79
  "react-error-boundary": "^6.1.1",
80
80
  "swagger-ui-dist": "^5.32.2",
81
81
  "vscode-languageserver": "^9.0.1",
@@ -102,7 +102,7 @@
102
102
  "rimraf": "^6.1.3",
103
103
  "storybook": "^10.3.5",
104
104
  "typescript": "~6.0.2",
105
- "vite": "^8.0.7",
105
+ "vite": "^8.0.8",
106
106
  "vite-plugin-checker": "^0.12.0",
107
107
  "vite-plugin-dts": "4.5.4",
108
108
  "vitest": "^4.1.3",