@typespec/playground 0.15.1 → 0.16.0-dev.2
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.
- package/dist/index.js +1 -1
- package/dist/react/index.js +145 -104
- package/dist/{services-okAeHMZK.js → services-D_Na2-tW.js} +46 -0
- package/dist/src/react/compilation/compile.d.ts +1 -2
- package/dist/src/react/compilation/compile.d.ts.map +1 -1
- package/dist/src/react/editor-panel/config-panel.d.ts +3 -0
- package/dist/src/react/editor-panel/config-panel.d.ts.map +1 -1
- package/dist/src/react/editor-panel/editor-panel.d.ts +2 -0
- package/dist/src/react/editor-panel/editor-panel.d.ts.map +1 -1
- package/dist/src/react/editor-panel/tspconfig-utils.d.ts +6 -0
- package/dist/src/react/editor-panel/tspconfig-utils.d.ts.map +1 -1
- package/dist/src/react/hooks/use-compilation.d.ts +3 -3
- package/dist/src/react/hooks/use-compilation.d.ts.map +1 -1
- package/dist/src/react/hooks/use-editor-actions.d.ts +2 -1
- package/dist/src/react/hooks/use-editor-actions.d.ts.map +1 -1
- package/dist/src/react/playground.d.ts.map +1 -1
- package/dist/src/react/standalone.d.ts.map +1 -1
- package/dist/src/react/use-playground-state.d.ts +5 -0
- package/dist/src/react/use-playground-state.d.ts.map +1 -1
- package/dist/src/services.d.ts.map +1 -1
- package/package.json +13 -13
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as createBrowserHost, n as registerMonacoLanguage } from "./services-
|
|
1
|
+
import { i as createBrowserHost, n as registerMonacoLanguage } from "./services-D_Na2-tW.js";
|
|
2
2
|
import { createUrlStateStorage } from "./state-storage.js";
|
|
3
3
|
//#region src/monaco-worker.ts
|
|
4
4
|
function registerMonacoDefaultWorkersForVite() {
|
package/dist/react/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as resolveVirtualPath, i as createBrowserHost, n as registerMonacoLanguage, o as debugGlobals, r as updateDiagnosticsForCodeFixes, s as printDebugInfo, t as getMonacoRange } from "../services-
|
|
1
|
+
import { a as resolveVirtualPath, i as createBrowserHost, n as registerMonacoLanguage, o as debugGlobals, r as updateDiagnosticsForCodeFixes, s as printDebugInfo, t as getMonacoRange } from "../services-D_Na2-tW.js";
|
|
2
2
|
import { createUrlStateStorage } from "../state-storage.js";
|
|
3
3
|
import { getSourceLocation } from "@typespec/compiler";
|
|
4
4
|
import { KeyCode, KeyMod, MarkerSeverity, MarkerTag, Range, Uri, editor } from "monaco-editor";
|
|
@@ -7,11 +7,11 @@ import { Button, Card, Checkbox, DrawerBody, DrawerHeader, DrawerHeaderTitle, Fl
|
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { Broom16Filled, Bug16Regular, Checkmark16Regular, ChevronDown16Regular, ChevronDownRegular, ChevronRightRegular, DataLineRegular, Dismiss24Regular, DocumentBulletList24Regular, DocumentRegular, ErrorCircle16Filled, FolderListRegular, FolderRegular, MoreHorizontal24Filled, Save16Regular, SettingsRegular, Warning16Filled } from "@fluentui/react-icons";
|
|
9
9
|
import debounce from "debounce";
|
|
10
|
-
import { parse, stringify } from "yaml";
|
|
11
10
|
import { $ } from "@typespec/compiler/typekit";
|
|
12
11
|
import { ErrorBoundary } from "react-error-boundary";
|
|
13
12
|
import { TypeGraph } from "@typespec/html-program-viewer/react";
|
|
14
13
|
import "@typespec/html-program-viewer/style.css";
|
|
14
|
+
import { isMap, parse, parseDocument, stringify } from "yaml";
|
|
15
15
|
import { createRoot } from "react-dom/client";
|
|
16
16
|
//#region src/react/context/playground-context.tsx
|
|
17
17
|
var PlaygroundContext = createContext(void 0);
|
|
@@ -1594,88 +1594,34 @@ var config_panel_module_default = {
|
|
|
1594
1594
|
"form-content": "_form-content_cffut_23"
|
|
1595
1595
|
};
|
|
1596
1596
|
//#endregion
|
|
1597
|
-
//#region src/react/editor-panel/tspconfig-utils.ts
|
|
1598
|
-
/**
|
|
1599
|
-
* Serialize the current playground state (emitter + compiler options) to tspconfig.yaml content.
|
|
1600
|
-
*/
|
|
1601
|
-
function compilerOptionsToTspConfig(selectedEmitter, compilerOptions) {
|
|
1602
|
-
const config = {};
|
|
1603
|
-
if (selectedEmitter) config.emit = [selectedEmitter];
|
|
1604
|
-
if (compilerOptions.options && Object.keys(compilerOptions.options).length > 0) config.options = compilerOptions.options;
|
|
1605
|
-
if (compilerOptions.linterRuleSet) config.linter = compilerOptions.linterRuleSet;
|
|
1606
|
-
return stringify(config, { indent: 2 }) || "";
|
|
1607
|
-
}
|
|
1608
|
-
/**
|
|
1609
|
-
* Parse tspconfig.yaml content back to playground state.
|
|
1610
|
-
* Returns undefined if the YAML is invalid.
|
|
1611
|
-
*/
|
|
1612
|
-
function parseTspConfigYaml(yamlContent) {
|
|
1613
|
-
try {
|
|
1614
|
-
const config = parse(yamlContent);
|
|
1615
|
-
if (!config || typeof config !== "object") return { compilerOptions: {} };
|
|
1616
|
-
const compilerOptions = {};
|
|
1617
|
-
if (config.options) compilerOptions.options = config.options;
|
|
1618
|
-
if (config.linter) compilerOptions.linterRuleSet = config.linter;
|
|
1619
|
-
return {
|
|
1620
|
-
selectedEmitter: config.emit?.[0],
|
|
1621
|
-
compilerOptions
|
|
1622
|
-
};
|
|
1623
|
-
} catch {
|
|
1624
|
-
return;
|
|
1625
|
-
}
|
|
1626
|
-
}
|
|
1627
|
-
//#endregion
|
|
1628
1597
|
//#region src/react/editor-panel/config-panel.tsx
|
|
1629
|
-
var ConfigPanel = ({ host, selectedEmitter, compilerOptions, onCompilerOptionsChange, onSelectedEmitterChange, editorOptions }) => {
|
|
1598
|
+
var ConfigPanel = ({ host, selectedEmitter, compilerOptions, tspconfig, onCompilerOptionsChange, onSelectedEmitterChange, onTspconfigChange, editorOptions }) => {
|
|
1630
1599
|
const [mode, setMode] = useState("form");
|
|
1631
1600
|
const yamlModel = useMonacoModel("inmemory://test/tspconfig.yaml", "yaml");
|
|
1632
1601
|
const changeFromYamlRef = useRef(false);
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
changeFromYamlRef.current = false;
|
|
1637
|
-
return;
|
|
1638
|
-
}
|
|
1639
|
-
const yaml = compilerOptionsToTspConfig(selectedEmitter, compilerOptions);
|
|
1640
|
-
if (yamlModel.getValue() !== yaml) yamlModel.setValue(yaml);
|
|
1641
|
-
}, [
|
|
1642
|
-
selectedEmitter,
|
|
1643
|
-
compilerOptions,
|
|
1644
|
-
mode,
|
|
1645
|
-
yamlModel
|
|
1646
|
-
]);
|
|
1647
|
-
const parseAndSync = useMemo(() => debounce((content) => {
|
|
1648
|
-
const parsed = parseTspConfigYaml(content);
|
|
1649
|
-
if (!parsed) return;
|
|
1650
|
-
changeFromYamlRef.current = true;
|
|
1651
|
-
if (parsed.selectedEmitter && parsed.selectedEmitter !== selectedEmitter) onSelectedEmitterChange(parsed.selectedEmitter);
|
|
1652
|
-
onCompilerOptionsChange(parsed.compilerOptions);
|
|
1653
|
-
}, 200), [
|
|
1654
|
-
selectedEmitter,
|
|
1655
|
-
onCompilerOptionsChange,
|
|
1656
|
-
onSelectedEmitterChange
|
|
1657
|
-
]);
|
|
1602
|
+
const propagateChange = useMemo(() => debounce((content) => {
|
|
1603
|
+
onTspconfigChange(content);
|
|
1604
|
+
}, 200), [onTspconfigChange]);
|
|
1658
1605
|
useEffect(() => {
|
|
1659
1606
|
const disposable = yamlModel.onDidChangeContent(() => {
|
|
1660
|
-
|
|
1607
|
+
changeFromYamlRef.current = true;
|
|
1608
|
+
propagateChange(yamlModel.getValue());
|
|
1661
1609
|
});
|
|
1662
1610
|
return () => {
|
|
1663
|
-
|
|
1611
|
+
propagateChange.clear();
|
|
1664
1612
|
disposable.dispose();
|
|
1665
1613
|
};
|
|
1666
|
-
}, [yamlModel,
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
yamlModel.setValue(yaml);
|
|
1614
|
+
}, [yamlModel, propagateChange]);
|
|
1615
|
+
useEffect(() => {
|
|
1616
|
+
if (changeFromYamlRef.current) {
|
|
1617
|
+
changeFromYamlRef.current = false;
|
|
1618
|
+
return;
|
|
1672
1619
|
}
|
|
1673
|
-
|
|
1674
|
-
}, [
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
]);
|
|
1620
|
+
if (yamlModel.getValue() !== tspconfig) yamlModel.setValue(tspconfig);
|
|
1621
|
+
}, [tspconfig, yamlModel]);
|
|
1622
|
+
const handleModeChange = useCallback((_, data) => {
|
|
1623
|
+
setMode(data.value);
|
|
1624
|
+
}, []);
|
|
1679
1625
|
return /* @__PURE__ */ jsxs("div", {
|
|
1680
1626
|
className: config_panel_module_default["config-panel"],
|
|
1681
1627
|
children: [/* @__PURE__ */ jsx("div", {
|
|
@@ -1733,7 +1679,7 @@ var TypeSpecIcon = () => /* @__PURE__ */ jsx("svg", {
|
|
|
1733
1679
|
transform: "matrix(4.553588, 0, 0, 3.175088, -811.313782, -249.035522)"
|
|
1734
1680
|
})
|
|
1735
1681
|
});
|
|
1736
|
-
var EditorPanel = ({ host, model, actions, editorOptions, onMount, selectedEmitter, compilerOptions, onCompilerOptionsChange, onSelectedEmitterChange, commandBar }) => {
|
|
1682
|
+
var EditorPanel = ({ host, model, actions, editorOptions, onMount, selectedEmitter, compilerOptions, tspconfig, onCompilerOptionsChange, onSelectedEmitterChange, onTspconfigChange, commandBar }) => {
|
|
1737
1683
|
const [selectedTab, setSelectedTab] = useState("tsp");
|
|
1738
1684
|
const onTabSelect = useCallback((_, data) => {
|
|
1739
1685
|
setSelectedTab(data.value);
|
|
@@ -1772,8 +1718,10 @@ var EditorPanel = ({ host, model, actions, editorOptions, onMount, selectedEmitt
|
|
|
1772
1718
|
host,
|
|
1773
1719
|
selectedEmitter,
|
|
1774
1720
|
compilerOptions,
|
|
1721
|
+
tspconfig,
|
|
1775
1722
|
onCompilerOptionsChange,
|
|
1776
1723
|
onSelectedEmitterChange,
|
|
1724
|
+
onTspconfigChange,
|
|
1777
1725
|
editorOptions
|
|
1778
1726
|
})]
|
|
1779
1727
|
})]
|
|
@@ -1782,23 +1730,29 @@ var EditorPanel = ({ host, model, actions, editorOptions, onMount, selectedEmitt
|
|
|
1782
1730
|
//#endregion
|
|
1783
1731
|
//#region src/react/compilation/compile.ts
|
|
1784
1732
|
var outputDir = resolveVirtualPath("tsp-output");
|
|
1785
|
-
async function compile(host, content, selectedEmitter,
|
|
1733
|
+
async function compile(host, content, selectedEmitter, tspconfig) {
|
|
1786
1734
|
await host.writeFile("main.tsp", content);
|
|
1735
|
+
await host.writeFile("tspconfig.yaml", tspconfig);
|
|
1787
1736
|
await emptyOutputDir(host);
|
|
1788
1737
|
try {
|
|
1738
|
+
const typespecCompiler = host.compiler;
|
|
1739
|
+
const [resolvedOptions] = await typespecCompiler.resolveCompilerOptions(host, {
|
|
1740
|
+
cwd: resolveVirtualPath("."),
|
|
1741
|
+
entrypoint: resolveVirtualPath("main.tsp")
|
|
1742
|
+
});
|
|
1743
|
+
const options = {
|
|
1744
|
+
...resolvedOptions,
|
|
1745
|
+
options: {
|
|
1746
|
+
...resolvedOptions.options,
|
|
1747
|
+
...selectedEmitter ? { [selectedEmitter]: {
|
|
1748
|
+
...resolvedOptions.options?.[selectedEmitter],
|
|
1749
|
+
"emitter-output-dir": outputDir
|
|
1750
|
+
} } : {}
|
|
1751
|
+
},
|
|
1752
|
+
outputDir
|
|
1753
|
+
};
|
|
1789
1754
|
return {
|
|
1790
|
-
program: await
|
|
1791
|
-
...options,
|
|
1792
|
-
options: {
|
|
1793
|
-
...options.options,
|
|
1794
|
-
[selectedEmitter]: {
|
|
1795
|
-
...options.options?.[selectedEmitter],
|
|
1796
|
-
"emitter-output-dir": outputDir
|
|
1797
|
-
}
|
|
1798
|
-
},
|
|
1799
|
-
outputDir,
|
|
1800
|
-
emit: selectedEmitter ? [selectedEmitter] : []
|
|
1801
|
-
}),
|
|
1755
|
+
program: await typespecCompiler.compile(host, resolveVirtualPath("main.tsp"), options),
|
|
1802
1756
|
outputFiles: await findOutputFiles(host)
|
|
1803
1757
|
};
|
|
1804
1758
|
} catch (error) {
|
|
@@ -1831,7 +1785,7 @@ async function emptyOutputDir(host) {
|
|
|
1831
1785
|
}
|
|
1832
1786
|
//#endregion
|
|
1833
1787
|
//#region src/react/hooks/use-compilation.ts
|
|
1834
|
-
function useCompilation({ host, selectedEmitter,
|
|
1788
|
+
function useCompilation({ host, selectedEmitter, tspconfig, typespecModel }) {
|
|
1835
1789
|
const [compilationState, setCompilationState] = useState(void 0);
|
|
1836
1790
|
const [isCompiling, setIsCompiling] = useState(false);
|
|
1837
1791
|
const [isOutputStale, setIsOutputStale] = useState(false);
|
|
@@ -1856,7 +1810,7 @@ function useCompilation({ host, selectedEmitter, compilerOptions, typespecModel
|
|
|
1856
1810
|
setIsCompiling(true);
|
|
1857
1811
|
let state;
|
|
1858
1812
|
try {
|
|
1859
|
-
state = await compile(host, currentContent, selectedEmitter,
|
|
1813
|
+
state = await compile(host, currentContent, selectedEmitter, tspconfig);
|
|
1860
1814
|
} catch (error) {
|
|
1861
1815
|
console.error("Compilation failed", error);
|
|
1862
1816
|
isCompilingRef.current = false;
|
|
@@ -1903,7 +1857,7 @@ function useCompilation({ host, selectedEmitter, compilerOptions, typespecModel
|
|
|
1903
1857
|
}, [
|
|
1904
1858
|
host,
|
|
1905
1859
|
selectedEmitter,
|
|
1906
|
-
|
|
1860
|
+
tspconfig,
|
|
1907
1861
|
typespecModel
|
|
1908
1862
|
]);
|
|
1909
1863
|
useEffect(() => {
|
|
@@ -1941,12 +1895,13 @@ function useDebouncedCompile({ typespecModel, doCompile, debounceDelay = 200 })
|
|
|
1941
1895
|
}
|
|
1942
1896
|
//#endregion
|
|
1943
1897
|
//#region src/react/hooks/use-editor-actions.ts
|
|
1944
|
-
function useEditorActions({ typespecModel, editorRef, selectedEmitter, compilerOptions, selectedSampleName, isSampleUntouched, selectedViewer, viewerState, onSave, onFileBug }) {
|
|
1898
|
+
function useEditorActions({ typespecModel, editorRef, selectedEmitter, compilerOptions, tspconfig, selectedSampleName, isSampleUntouched, selectedViewer, viewerState, onSave, onFileBug }) {
|
|
1945
1899
|
const saveCode = useCallback(() => {
|
|
1946
1900
|
if (onSave) onSave({
|
|
1947
1901
|
content: typespecModel.getValue(),
|
|
1948
1902
|
emitter: selectedEmitter,
|
|
1949
1903
|
compilerOptions,
|
|
1904
|
+
tspconfig,
|
|
1950
1905
|
sampleName: isSampleUntouched ? selectedSampleName : void 0,
|
|
1951
1906
|
selectedViewer,
|
|
1952
1907
|
viewerState
|
|
@@ -1956,6 +1911,7 @@ function useEditorActions({ typespecModel, editorRef, selectedEmitter, compilerO
|
|
|
1956
1911
|
onSave,
|
|
1957
1912
|
selectedEmitter,
|
|
1958
1913
|
compilerOptions,
|
|
1914
|
+
tspconfig,
|
|
1959
1915
|
selectedSampleName,
|
|
1960
1916
|
isSampleUntouched,
|
|
1961
1917
|
selectedViewer,
|
|
@@ -2612,6 +2568,62 @@ var ProblemPaneContent = ({ compilationState, onDiagnosticSelected }) => {
|
|
|
2612
2568
|
});
|
|
2613
2569
|
};
|
|
2614
2570
|
//#endregion
|
|
2571
|
+
//#region src/react/editor-panel/tspconfig-utils.ts
|
|
2572
|
+
function hasLinterRules(linterRuleSet) {
|
|
2573
|
+
if (!linterRuleSet) return false;
|
|
2574
|
+
return Boolean(linterRuleSet.extends && linterRuleSet.extends.length > 0 || linterRuleSet.enable && Object.keys(linterRuleSet.enable).length > 0 || linterRuleSet.disable && Object.keys(linterRuleSet.disable).length > 0);
|
|
2575
|
+
}
|
|
2576
|
+
/**
|
|
2577
|
+
* Serialize the current playground state (emitter + compiler options) to tspconfig.yaml content.
|
|
2578
|
+
*/
|
|
2579
|
+
function compilerOptionsToTspConfig(selectedEmitter, compilerOptions) {
|
|
2580
|
+
const config = {};
|
|
2581
|
+
if (selectedEmitter) config.emit = [selectedEmitter];
|
|
2582
|
+
if (compilerOptions.options && Object.keys(compilerOptions.options).length > 0) config.options = compilerOptions.options;
|
|
2583
|
+
if (hasLinterRules(compilerOptions.linterRuleSet)) config.linter = compilerOptions.linterRuleSet;
|
|
2584
|
+
return stringify(config, { indent: 2 }) || "";
|
|
2585
|
+
}
|
|
2586
|
+
/**
|
|
2587
|
+
* Update an existing tspconfig.yaml with structured changes coming from the visual form
|
|
2588
|
+
* (emitter + compiler options) while preserving comments and any other fields the form
|
|
2589
|
+
* doesn't manage (e.g. `output-dir`, `warn-as-error`, `imports`).
|
|
2590
|
+
*/
|
|
2591
|
+
function updateTspConfigYaml(existingYaml, selectedEmitter, compilerOptions) {
|
|
2592
|
+
let doc;
|
|
2593
|
+
try {
|
|
2594
|
+
doc = parseDocument(existingYaml ?? "");
|
|
2595
|
+
} catch {
|
|
2596
|
+
return compilerOptionsToTspConfig(selectedEmitter, compilerOptions);
|
|
2597
|
+
}
|
|
2598
|
+
if (doc.errors.length > 0 || !isMap(doc.contents)) return compilerOptionsToTspConfig(selectedEmitter, compilerOptions);
|
|
2599
|
+
if (selectedEmitter) doc.setIn(["emit"], [selectedEmitter]);
|
|
2600
|
+
else doc.deleteIn(["emit"]);
|
|
2601
|
+
if (compilerOptions.options && Object.keys(compilerOptions.options).length > 0) doc.setIn(["options"], compilerOptions.options);
|
|
2602
|
+
else doc.deleteIn(["options"]);
|
|
2603
|
+
if (hasLinterRules(compilerOptions.linterRuleSet)) doc.setIn(["linter"], compilerOptions.linterRuleSet);
|
|
2604
|
+
else doc.deleteIn(["linter"]);
|
|
2605
|
+
return doc.toString();
|
|
2606
|
+
}
|
|
2607
|
+
/**
|
|
2608
|
+
* Parse tspconfig.yaml content back to playground state.
|
|
2609
|
+
* Returns undefined if the YAML is invalid.
|
|
2610
|
+
*/
|
|
2611
|
+
function parseTspConfigYaml(yamlContent) {
|
|
2612
|
+
try {
|
|
2613
|
+
const config = parse(yamlContent);
|
|
2614
|
+
if (!config || typeof config !== "object") return { compilerOptions: {} };
|
|
2615
|
+
const compilerOptions = {};
|
|
2616
|
+
if (config.options) compilerOptions.options = config.options;
|
|
2617
|
+
if (config.linter) compilerOptions.linterRuleSet = config.linter;
|
|
2618
|
+
return {
|
|
2619
|
+
selectedEmitter: config.emit?.[0],
|
|
2620
|
+
compilerOptions
|
|
2621
|
+
};
|
|
2622
|
+
} catch {
|
|
2623
|
+
return;
|
|
2624
|
+
}
|
|
2625
|
+
}
|
|
2626
|
+
//#endregion
|
|
2615
2627
|
//#region src/react/use-playground-state.ts
|
|
2616
2628
|
function usePlaygroundState({ libraries, samples, playgroundState: controlledPlaygroundState, defaultPlaygroundState, onPlaygroundStateChange, defaultEmitter, defaultContent }) {
|
|
2617
2629
|
const [playgroundState, setPlaygroundState] = useControllableValue(controlledPlaygroundState, useMemo(() => {
|
|
@@ -2633,8 +2645,14 @@ function usePlaygroundState({ libraries, samples, playgroundState: controlledPla
|
|
|
2633
2645
|
libraries,
|
|
2634
2646
|
defaultContent
|
|
2635
2647
|
]), onPlaygroundStateChange);
|
|
2636
|
-
const
|
|
2637
|
-
|
|
2648
|
+
const tspconfig = useMemo(() => playgroundState.tspconfig ?? compilerOptionsToTspConfig(playgroundState.emitter ?? "", playgroundState.compilerOptions ?? {}), [
|
|
2649
|
+
playgroundState.tspconfig,
|
|
2650
|
+
playgroundState.emitter,
|
|
2651
|
+
playgroundState.compilerOptions
|
|
2652
|
+
]);
|
|
2653
|
+
const parsedConfig = useMemo(() => parseTspConfigYaml(tspconfig) ?? { compilerOptions: {} }, [tspconfig]);
|
|
2654
|
+
const selectedEmitter = parsedConfig.selectedEmitter ?? "";
|
|
2655
|
+
const compilerOptions = parsedConfig.compilerOptions;
|
|
2638
2656
|
const selectedSampleName = playgroundState.sampleName ?? "";
|
|
2639
2657
|
const selectedViewer = playgroundState.selectedViewer;
|
|
2640
2658
|
const content = playgroundState.content ?? "";
|
|
@@ -2644,8 +2662,17 @@ function usePlaygroundState({ libraries, samples, playgroundState: controlledPla
|
|
|
2644
2662
|
...updates
|
|
2645
2663
|
});
|
|
2646
2664
|
}, [playgroundState, setPlaygroundState]);
|
|
2647
|
-
const
|
|
2648
|
-
const
|
|
2665
|
+
const onTspconfigChange = useCallback((tspconfig) => updateState({ tspconfig }), [updateState]);
|
|
2666
|
+
const onSelectedEmitterChange = useCallback((emitter) => updateState({ tspconfig: updateTspConfigYaml(tspconfig, emitter, compilerOptions) }), [
|
|
2667
|
+
updateState,
|
|
2668
|
+
tspconfig,
|
|
2669
|
+
compilerOptions
|
|
2670
|
+
]);
|
|
2671
|
+
const onCompilerOptionsChange = useCallback((newOptions) => updateState({ tspconfig: updateTspConfigYaml(tspconfig, selectedEmitter, newOptions) }), [
|
|
2672
|
+
updateState,
|
|
2673
|
+
tspconfig,
|
|
2674
|
+
selectedEmitter
|
|
2675
|
+
]);
|
|
2649
2676
|
const onSelectedSampleNameChange = useCallback((sampleName) => updateState({ sampleName }), [updateState]);
|
|
2650
2677
|
const onSelectedViewerChange = useCallback((selectedViewer) => updateState({ selectedViewer }), [updateState]);
|
|
2651
2678
|
const onViewerStateChange = useCallback((viewerState) => updateState({ viewerState }), [updateState]);
|
|
@@ -2657,8 +2684,7 @@ function usePlaygroundState({ libraries, samples, playgroundState: controlledPla
|
|
|
2657
2684
|
if (config?.content) {
|
|
2658
2685
|
lastProcessedSample.current = selectedSampleName;
|
|
2659
2686
|
const updates = { content: config.content };
|
|
2660
|
-
if (config.preferredEmitter) updates.
|
|
2661
|
-
if (config.compilerOptions) updates.compilerOptions = config.compilerOptions;
|
|
2687
|
+
if (config.preferredEmitter || config.compilerOptions) updates.tspconfig = compilerOptionsToTspConfig(config.preferredEmitter ?? "", config.compilerOptions ?? {});
|
|
2662
2688
|
updateState(updates);
|
|
2663
2689
|
}
|
|
2664
2690
|
}
|
|
@@ -2670,12 +2696,14 @@ function usePlaygroundState({ libraries, samples, playgroundState: controlledPla
|
|
|
2670
2696
|
return {
|
|
2671
2697
|
selectedEmitter,
|
|
2672
2698
|
compilerOptions,
|
|
2699
|
+
tspconfig,
|
|
2673
2700
|
selectedSampleName,
|
|
2674
2701
|
selectedViewer,
|
|
2675
2702
|
viewerState: playgroundState.viewerState ?? {},
|
|
2676
2703
|
content,
|
|
2677
2704
|
onSelectedEmitterChange,
|
|
2678
2705
|
onCompilerOptionsChange,
|
|
2706
|
+
onTspconfigChange,
|
|
2679
2707
|
onSelectedSampleNameChange,
|
|
2680
2708
|
onSelectedViewerChange,
|
|
2681
2709
|
onViewerStateChange,
|
|
@@ -2785,7 +2813,7 @@ var Playground = (props) => {
|
|
|
2785
2813
|
debugGlobals().host = host;
|
|
2786
2814
|
}, [host]);
|
|
2787
2815
|
const typespecModel = useMonacoModel("inmemory://test/main.tsp", "typespec");
|
|
2788
|
-
const { selectedEmitter, compilerOptions, selectedSampleName, selectedViewer, viewerState, content, onSelectedEmitterChange, onCompilerOptionsChange, onSelectedSampleNameChange, onSelectedViewerChange, onViewerStateChange, onContentChange } = usePlaygroundState({
|
|
2816
|
+
const { selectedEmitter, compilerOptions, tspconfig, selectedSampleName, selectedViewer, viewerState, content, onSelectedEmitterChange, onCompilerOptionsChange, onTspconfigChange, onSelectedSampleNameChange, onSelectedViewerChange, onViewerStateChange, onContentChange } = usePlaygroundState({
|
|
2789
2817
|
libraries: props.libraries,
|
|
2790
2818
|
samples: props.samples,
|
|
2791
2819
|
playgroundState: props.playgroundState,
|
|
@@ -2802,7 +2830,7 @@ var Playground = (props) => {
|
|
|
2802
2830
|
const { compilationState, isCompiling, isOutputStale, doCompile } = useCompilation({
|
|
2803
2831
|
host,
|
|
2804
2832
|
selectedEmitter,
|
|
2805
|
-
|
|
2833
|
+
tspconfig,
|
|
2806
2834
|
typespecModel
|
|
2807
2835
|
});
|
|
2808
2836
|
useDebouncedCompile({
|
|
@@ -2815,6 +2843,7 @@ var Playground = (props) => {
|
|
|
2815
2843
|
editorRef,
|
|
2816
2844
|
selectedEmitter,
|
|
2817
2845
|
compilerOptions,
|
|
2846
|
+
tspconfig,
|
|
2818
2847
|
selectedSampleName,
|
|
2819
2848
|
isSampleUntouched: useMemo(() => {
|
|
2820
2849
|
return Boolean(selectedSampleName && content === props.samples?.[selectedSampleName]?.content);
|
|
@@ -2882,8 +2911,10 @@ var Playground = (props) => {
|
|
|
2882
2911
|
onMount: onTypeSpecEditorMount,
|
|
2883
2912
|
selectedEmitter,
|
|
2884
2913
|
compilerOptions,
|
|
2914
|
+
tspconfig,
|
|
2885
2915
|
onCompilerOptionsChange,
|
|
2886
2916
|
onSelectedEmitterChange,
|
|
2917
|
+
onTspconfigChange,
|
|
2887
2918
|
commandBar: isMobile ? void 0 : commandBar
|
|
2888
2919
|
});
|
|
2889
2920
|
const outputPanel = /* @__PURE__ */ jsx(OutputView, {
|
|
@@ -2981,8 +3012,8 @@ var StandalonePlayground = (config) => {
|
|
|
2981
3012
|
const onPlaygroundStateChange = useCallback((newState) => {
|
|
2982
3013
|
saveToStorage({
|
|
2983
3014
|
content: lastSavedData?.content || "",
|
|
2984
|
-
emitter:
|
|
2985
|
-
|
|
3015
|
+
emitter: "",
|
|
3016
|
+
tspconfig: newState.tspconfig,
|
|
2986
3017
|
sampleName: newState.sampleName,
|
|
2987
3018
|
selectedViewer: newState.selectedViewer,
|
|
2988
3019
|
viewerState: newState.viewerState
|
|
@@ -2995,6 +3026,7 @@ var StandalonePlayground = (config) => {
|
|
|
2995
3026
|
defaultPlaygroundState: {
|
|
2996
3027
|
emitter: context.initialState.emitter ?? config.defaultPlaygroundState?.emitter,
|
|
2997
3028
|
compilerOptions: context.initialState.compilerOptions ?? config.defaultPlaygroundState?.compilerOptions,
|
|
3029
|
+
tspconfig: context.initialState.tspconfig ?? config.defaultPlaygroundState?.tspconfig,
|
|
2998
3030
|
sampleName: context.initialState.sampleName ?? config.defaultPlaygroundState?.sampleName,
|
|
2999
3031
|
selectedViewer: context.initialState.selectedViewer ?? config.defaultPlaygroundState?.selectedViewer,
|
|
3000
3032
|
viewerState: context.initialState.viewerState ?? config.defaultPlaygroundState?.viewerState
|
|
@@ -3035,6 +3067,10 @@ function createStandalonePlaygroundStateStorage() {
|
|
|
3035
3067
|
type: "object",
|
|
3036
3068
|
queryParam: "options"
|
|
3037
3069
|
},
|
|
3070
|
+
tspconfig: {
|
|
3071
|
+
queryParam: "tspconfig",
|
|
3072
|
+
compress: "lz-base64"
|
|
3073
|
+
},
|
|
3038
3074
|
sampleName: { queryParam: "sample" },
|
|
3039
3075
|
selectedViewer: { queryParam: "v" },
|
|
3040
3076
|
viewerState: {
|
|
@@ -3046,11 +3082,16 @@ function createStandalonePlaygroundStateStorage() {
|
|
|
3046
3082
|
load: stateStorage.load,
|
|
3047
3083
|
resolveSearchParams: stateStorage.resolveSearchParams,
|
|
3048
3084
|
save(data) {
|
|
3049
|
-
|
|
3085
|
+
const cleaned = {
|
|
3050
3086
|
...data,
|
|
3087
|
+
emitter: void 0,
|
|
3088
|
+
compilerOptions: void 0
|
|
3089
|
+
};
|
|
3090
|
+
stateStorage.save(cleaned.sampleName ? {
|
|
3091
|
+
...cleaned,
|
|
3051
3092
|
content: void 0,
|
|
3052
|
-
sampleName:
|
|
3053
|
-
} :
|
|
3093
|
+
sampleName: cleaned.sampleName
|
|
3094
|
+
} : cleaned);
|
|
3054
3095
|
}
|
|
3055
3096
|
};
|
|
3056
3097
|
}
|
|
@@ -386,6 +386,10 @@ async function registerMonacoLanguage(host) {
|
|
|
386
386
|
extensions: [".tsp"]
|
|
387
387
|
});
|
|
388
388
|
monaco.languages.setLanguageConfiguration("typespec", getTypeSpecLanguageConfiguration());
|
|
389
|
+
monaco.languages.register({
|
|
390
|
+
id: "yaml",
|
|
391
|
+
extensions: [".yaml", ".yml"]
|
|
392
|
+
});
|
|
389
393
|
if (window.registeredServices) return;
|
|
390
394
|
window.registeredServices = true;
|
|
391
395
|
const serverHost = {
|
|
@@ -597,6 +601,48 @@ async function registerMonacoLanguage(host) {
|
|
|
597
601
|
return { suggestions };
|
|
598
602
|
}
|
|
599
603
|
});
|
|
604
|
+
monaco.languages.registerCompletionItemProvider({
|
|
605
|
+
language: "yaml",
|
|
606
|
+
pattern: "**/tspconfig.yaml"
|
|
607
|
+
}, {
|
|
608
|
+
triggerCharacters: [
|
|
609
|
+
":",
|
|
610
|
+
" ",
|
|
611
|
+
"/",
|
|
612
|
+
"-",
|
|
613
|
+
".",
|
|
614
|
+
"\""
|
|
615
|
+
],
|
|
616
|
+
async provideCompletionItems(model, position) {
|
|
617
|
+
const result = await serverLib.complete(lspArgs(model, position));
|
|
618
|
+
const word = model.getWordUntilPosition(position);
|
|
619
|
+
const range = {
|
|
620
|
+
startLineNumber: position.lineNumber,
|
|
621
|
+
endLineNumber: position.lineNumber,
|
|
622
|
+
startColumn: word.startColumn,
|
|
623
|
+
endColumn: word.endColumn
|
|
624
|
+
};
|
|
625
|
+
const suggestions = [];
|
|
626
|
+
for (const item of result.items) {
|
|
627
|
+
let itemRange = range;
|
|
628
|
+
let insertText = item.insertText ?? item.label;
|
|
629
|
+
if (item.textEdit && "range" in item.textEdit) {
|
|
630
|
+
itemRange = LspToMonaco.range(item.textEdit.range);
|
|
631
|
+
insertText = item.textEdit.newText;
|
|
632
|
+
}
|
|
633
|
+
suggestions.push({
|
|
634
|
+
label: item.label,
|
|
635
|
+
kind: item.kind,
|
|
636
|
+
documentation: item.documentation,
|
|
637
|
+
insertText,
|
|
638
|
+
range: itemRange,
|
|
639
|
+
commitCharacters: item.commitCharacters,
|
|
640
|
+
tags: item.tags
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
return { suggestions };
|
|
644
|
+
}
|
|
645
|
+
});
|
|
600
646
|
monaco.languages.registerCodeActionProvider("typespec", { async provideCodeActions(model, range) {
|
|
601
647
|
const compiler = _currentCompiler;
|
|
602
648
|
if (!compiler) return {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { CompilerOptions } from '@typespec/compiler';
|
|
2
1
|
import { BrowserHost } from '../../types.js';
|
|
3
2
|
import { CompilationState } from '../types.js';
|
|
4
|
-
export declare function compile(host: BrowserHost, content: string, selectedEmitter: string,
|
|
3
|
+
export declare function compile(host: BrowserHost, content: string, selectedEmitter: string, tspconfig: string): Promise<CompilationState>;
|
|
5
4
|
//# sourceMappingURL=compile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../../src/react/compilation/compile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../../src/react/compilation/compile.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIpD,wBAAsB,OAAO,CAC3B,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,MAAM,EACvB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,gBAAgB,CAAC,CAsC3B"}
|
|
@@ -6,8 +6,11 @@ export interface ConfigPanelProps {
|
|
|
6
6
|
host: BrowserHost;
|
|
7
7
|
selectedEmitter: string;
|
|
8
8
|
compilerOptions: CompilerOptions;
|
|
9
|
+
/** Raw tspconfig.yaml content (source of truth). */
|
|
10
|
+
tspconfig: string;
|
|
9
11
|
onCompilerOptionsChange: (options: CompilerOptions) => void;
|
|
10
12
|
onSelectedEmitterChange: (emitter: string) => void;
|
|
13
|
+
onTspconfigChange: (tspconfig: string) => void;
|
|
11
14
|
editorOptions?: PlaygroundEditorsOptions;
|
|
12
15
|
}
|
|
13
16
|
export declare const ConfigPanel: FunctionComponent<ConfigPanelProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-panel.d.ts","sourceRoot":"","sources":["../../../../src/react/editor-panel/config-panel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EAAqD,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAClG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"config-panel.d.ts","sourceRoot":"","sources":["../../../../src/react/editor-panel/config-panel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EAAqD,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAClG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAIjE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,WAAW,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,eAAe,CAAC;IACjC,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,uBAAuB,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAC5D,uBAAuB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,aAAa,CAAC,EAAE,wBAAwB,CAAC;CAC1C;AAID,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,CAgF3D,CAAC"}
|
|
@@ -13,8 +13,10 @@ export interface EditorPanelProps {
|
|
|
13
13
|
onMount?: (data: OnMountData) => void;
|
|
14
14
|
selectedEmitter: string;
|
|
15
15
|
compilerOptions: CompilerOptions;
|
|
16
|
+
tspconfig: string;
|
|
16
17
|
onCompilerOptionsChange: (options: CompilerOptions) => void;
|
|
17
18
|
onSelectedEmitterChange: (emitter: string) => void;
|
|
19
|
+
onTspconfigChange: (tspconfig: string) => void;
|
|
18
20
|
/** Toolbar content rendered above the editor area */
|
|
19
21
|
commandBar?: ReactNode;
|
|
20
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-panel.d.ts","sourceRoot":"","sources":["../../../../src/react/editor-panel/editor-panel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAyB,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACtF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAKjE,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,KAAK,CAAC;AAkB3C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,iBAAiB,EAAE,CAAC;IACrC,aAAa,CAAC,EAAE,wBAAwB,CAAC;IACzC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;IAEtC,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,eAAe,CAAC;IACjC,uBAAuB,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAC5D,uBAAuB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"editor-panel.d.ts","sourceRoot":"","sources":["../../../../src/react/editor-panel/editor-panel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAyB,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACtF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAKjE,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,KAAK,CAAC;AAkB3C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,iBAAiB,EAAE,CAAC;IACrC,aAAa,CAAC,EAAE,wBAAwB,CAAC;IACzC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;IAEtC,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,eAAe,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,uBAAuB,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAC5D,uBAAuB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAE/C,qDAAqD;IACrD,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,CA4D3D,CAAC"}
|
|
@@ -12,6 +12,12 @@ export interface TspConfig {
|
|
|
12
12
|
* Serialize the current playground state (emitter + compiler options) to tspconfig.yaml content.
|
|
13
13
|
*/
|
|
14
14
|
export declare function compilerOptionsToTspConfig(selectedEmitter: string, compilerOptions: CompilerOptions): string;
|
|
15
|
+
/**
|
|
16
|
+
* Update an existing tspconfig.yaml with structured changes coming from the visual form
|
|
17
|
+
* (emitter + compiler options) while preserving comments and any other fields the form
|
|
18
|
+
* doesn't manage (e.g. `output-dir`, `warn-as-error`, `imports`).
|
|
19
|
+
*/
|
|
20
|
+
export declare function updateTspConfigYaml(existingYaml: string, selectedEmitter: string, compilerOptions: CompilerOptions): string;
|
|
15
21
|
export interface ParsedTspConfig {
|
|
16
22
|
selectedEmitter?: string;
|
|
17
23
|
compilerOptions: CompilerOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tspconfig-utils.d.ts","sourceRoot":"","sources":["../../../../src/react/editor-panel/tspconfig-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGzE,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAClD,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"tspconfig-utils.d.ts","sourceRoot":"","sources":["../../../../src/react/editor-panel/tspconfig-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGzE,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAClD,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAWD;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,MAAM,EACvB,eAAe,EAAE,eAAe,GAC/B,MAAM,CAgBR;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,EACvB,eAAe,EAAE,eAAe,GAC/B,MAAM,CAgCR;AAED,MAAM,WAAW,eAAe;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,eAAe,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAuBnF"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { CompilerOptions } from '@typespec/compiler';
|
|
2
1
|
import { editor } from 'monaco-editor';
|
|
3
2
|
import { BrowserHost } from '../../types.js';
|
|
4
3
|
import { CompilationState } from '../types.js';
|
|
5
4
|
export interface UseCompilationOptions {
|
|
6
5
|
host: BrowserHost;
|
|
7
6
|
selectedEmitter: string;
|
|
8
|
-
|
|
7
|
+
/** Raw tspconfig.yaml content used to configure the compilation. */
|
|
8
|
+
tspconfig: string;
|
|
9
9
|
typespecModel: editor.ITextModel;
|
|
10
10
|
}
|
|
11
11
|
export interface UseCompilationResult {
|
|
@@ -14,5 +14,5 @@ export interface UseCompilationResult {
|
|
|
14
14
|
isOutputStale: boolean;
|
|
15
15
|
doCompile: () => Promise<void>;
|
|
16
16
|
}
|
|
17
|
-
export declare function useCompilation({ host, selectedEmitter,
|
|
17
|
+
export declare function useCompilation({ host, selectedEmitter, tspconfig, typespecModel, }: UseCompilationOptions): UseCompilationResult;
|
|
18
18
|
//# sourceMappingURL=use-compilation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-compilation.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/use-compilation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-compilation.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/use-compilation.ts"],"names":[],"mappings":"AACA,OAAO,EAA6B,MAAM,EAAE,MAAM,eAAe,CAAC;AAGlE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,WAAW,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,oEAAoE;IACpE,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC,UAAU,CAAC;CAClC;AAED,MAAM,WAAW,oBAAoB;IACnC,gBAAgB,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC/C,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAChC;AAED,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,eAAe,EACf,SAAS,EACT,aAAa,GACd,EAAE,qBAAqB,GAAG,oBAAoB,CA0G9C"}
|
|
@@ -13,6 +13,7 @@ export interface UseEditorActionsOptions {
|
|
|
13
13
|
editorRef: RefObject<editor.IStandaloneCodeEditor | undefined>;
|
|
14
14
|
selectedEmitter: string;
|
|
15
15
|
compilerOptions: CompilerOptions;
|
|
16
|
+
tspconfig: string;
|
|
16
17
|
selectedSampleName: string;
|
|
17
18
|
isSampleUntouched: boolean;
|
|
18
19
|
selectedViewer?: string;
|
|
@@ -26,5 +27,5 @@ export interface UseEditorActionsResult {
|
|
|
26
27
|
fileBug: () => Promise<void>;
|
|
27
28
|
editorActions: editor.IActionDescriptor[];
|
|
28
29
|
}
|
|
29
|
-
export declare function useEditorActions({ typespecModel, editorRef, selectedEmitter, compilerOptions, selectedSampleName, isSampleUntouched, selectedViewer, viewerState, onSave, onFileBug, }: UseEditorActionsOptions): UseEditorActionsResult;
|
|
30
|
+
export declare function useEditorActions({ typespecModel, editorRef, selectedEmitter, compilerOptions, tspconfig, selectedSampleName, isSampleUntouched, selectedViewer, viewerState, onSave, onFileBug, }: UseEditorActionsOptions): UseEditorActionsResult;
|
|
30
31
|
//# sourceMappingURL=use-editor-actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-editor-actions.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/use-editor-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAmB,MAAM,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACzD,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE,MAAM,CAAC,UAAU,CAAC;IACjC,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAAC;IAC/D,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,eAAe,CAAC;IACjC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC7C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC,iBAAiB,EAAE,CAAC;CAC3C;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,aAAa,EACb,SAAS,EACT,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,MAAM,EACN,SAAS,GACV,EAAE,uBAAuB,GAAG,sBAAsB,
|
|
1
|
+
{"version":3,"file":"use-editor-actions.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/use-editor-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAmB,MAAM,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACzD,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE,MAAM,CAAC,UAAU,CAAC;IACjC,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAAC;IAC/D,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,eAAe,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC,MAAM,EA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
|
+
{"version":3,"file":"standalone.d.ts","sourceRoot":"","sources":["../../../src/react/standalone.tsx"],"names":[],"mappings":"AASA,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAExB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,qBAAsB,SAAQ,OAAO,CAAC,eAAe,CAAC;IACrE,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,YAAY,CAAC,EAAE,oBAAoB,CAAC;IAC7C,sEAAsE;IACtE,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAyBD,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,CAAC,qBAAqB,CA0FzE,CAAC;AAEF,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,qBAAqB,wCAExE;AAED,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,qBAAqB,iBASxE;AAED,wBAAgB,sCAAsC,IAAI,eAAe,CAAC,kBAAkB,CAAC,CAkD5F"}
|
|
@@ -5,6 +5,8 @@ export interface PlaygroundState {
|
|
|
5
5
|
emitter?: string;
|
|
6
6
|
/** Emitter options */
|
|
7
7
|
compilerOptions?: CompilerOptions;
|
|
8
|
+
/** Raw tspconfig.yaml content. Source of truth for the compiler configuration. */
|
|
9
|
+
tspconfig?: string;
|
|
8
10
|
/** Sample to use */
|
|
9
11
|
sampleName?: string;
|
|
10
12
|
/** Selected viewer */
|
|
@@ -36,12 +38,15 @@ export interface UsePlaygroundStateProps {
|
|
|
36
38
|
export interface PlaygroundStateResult {
|
|
37
39
|
selectedEmitter: string;
|
|
38
40
|
compilerOptions: CompilerOptions;
|
|
41
|
+
/** Raw tspconfig.yaml content (source of truth for the configuration). */
|
|
42
|
+
tspconfig: string;
|
|
39
43
|
selectedSampleName: string;
|
|
40
44
|
selectedViewer?: string;
|
|
41
45
|
viewerState: Record<string, any>;
|
|
42
46
|
content: string;
|
|
43
47
|
onSelectedEmitterChange: (emitter: string) => void;
|
|
44
48
|
onCompilerOptionsChange: (compilerOptions: CompilerOptions) => void;
|
|
49
|
+
onTspconfigChange: (tspconfig: string) => void;
|
|
45
50
|
onSelectedSampleNameChange: (sampleName: string) => void;
|
|
46
51
|
onSelectedViewerChange: (selectedViewer: string) => void;
|
|
47
52
|
onViewerStateChange: (viewerState: Record<string, any>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-playground-state.d.ts","sourceRoot":"","sources":["../../../src/react/use-playground-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"use-playground-state.d.ts","sourceRoot":"","sources":["../../../src/react/use-playground-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAOpD,MAAM,WAAW,eAAe;IAC9B,qBAAqB;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sBAAsB;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gCAAgC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,uBAAuB;IACvB,OAAO,C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O,EAAE,MAAM,KAAK,IAAI,CAAC;IAG3C,eAAe,EAAE,eAAe,CAAC;IACjC,kBAAkB,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;CACtD;AAED,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,OAAO,EACP,eAAe,EAAE,yBAAyB,EAC1C,sBAAsB,EACtB,uBAAuB,EAEvB,cAAc,EACd,cAAc,GACf,EAAE,uBAAuB,GAAG,qBAAqB,CAsIjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/services.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EAEd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAMxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAO9C;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,cAAc,oBAAoB,CAAC,EAC7C,WAAW,EAAE,SAAS,UAAU,EAAE,QAInC;AAmCD,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/services.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EAEd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAMxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAO9C;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,cAAc,oBAAoB,CAAC,EAC7C,WAAW,EAAE,SAAS,UAAU,EAAE,QAInC;AAmCD,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,WAAW,iBA2b7D;AAED,wBAAgB,cAAc,CAC5B,gBAAgB,EAAE,cAAc,oBAAoB,CAAC,EACrD,MAAM,EAAE,gBAAgB,GAAG,OAAO,QAAQ,GACzC,MAAM,CAAC,MAAM,CAkBf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/playground",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0-dev.2",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec playground UI components.",
|
|
6
6
|
"homepage": "https://typespec.io",
|
|
@@ -61,6 +61,15 @@
|
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@fluentui/react-components": "^9.73.7",
|
|
63
63
|
"@fluentui/react-icons": "^2.0.323",
|
|
64
|
+
"@typespec/bundler": "^0.6.0 || >= 0.6.1-dev.0",
|
|
65
|
+
"@typespec/compiler": "^1.13.0 || >= 1.14.0-dev.0",
|
|
66
|
+
"@typespec/html-program-viewer": "^0.83.0 || >= 0.84.0-dev.0",
|
|
67
|
+
"@typespec/http": "^1.13.0 || >= 1.14.0-dev.0",
|
|
68
|
+
"@typespec/openapi": "^1.13.0 || >= 1.14.0-dev.0",
|
|
69
|
+
"@typespec/openapi3": "^1.13.0 || >= 1.14.0-dev.1",
|
|
70
|
+
"@typespec/protobuf": "^0.83.0 || >= 0.84.0-dev.0",
|
|
71
|
+
"@typespec/rest": "^0.83.0 || >= 0.84.0-dev.0",
|
|
72
|
+
"@typespec/versioning": "^0.83.0 || >= 0.84.0-dev.0",
|
|
64
73
|
"clsx": "^2.1.1",
|
|
65
74
|
"debounce": "^3.0.0",
|
|
66
75
|
"lzutf8": "0.6.3",
|
|
@@ -71,16 +80,7 @@
|
|
|
71
80
|
"swagger-ui-dist": "^5.32.2",
|
|
72
81
|
"vscode-languageserver": "^9.0.1",
|
|
73
82
|
"vscode-languageserver-textdocument": "^1.0.12",
|
|
74
|
-
"yaml": "^2.8.3"
|
|
75
|
-
"@typespec/bundler": "^0.6.0",
|
|
76
|
-
"@typespec/html-program-viewer": "^0.83.0",
|
|
77
|
-
"@typespec/compiler": "^1.13.0",
|
|
78
|
-
"@typespec/http": "^1.13.0",
|
|
79
|
-
"@typespec/openapi": "^1.13.0",
|
|
80
|
-
"@typespec/versioning": "^0.83.0",
|
|
81
|
-
"@typespec/openapi3": "^1.13.0",
|
|
82
|
-
"@typespec/rest": "^0.83.0",
|
|
83
|
-
"@typespec/protobuf": "^0.83.0"
|
|
83
|
+
"yaml": "^2.8.3"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
86
|
"@babel/core": "^7.29.0",
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"@types/react": "^19.2.16",
|
|
96
96
|
"@types/react-dom": "^19.2.3",
|
|
97
97
|
"@types/swagger-ui-dist": "^3.30.6",
|
|
98
|
+
"@typespec/bundler": "^0.6.0 || >= 0.6.1-dev.0",
|
|
98
99
|
"@vitejs/plugin-react": "^6.0.1",
|
|
99
100
|
"cross-env": "^10.1.0",
|
|
100
101
|
"es-module-shims": "^2.8.0",
|
|
@@ -105,8 +106,7 @@
|
|
|
105
106
|
"vite-plugin-checker": "^0.14.1",
|
|
106
107
|
"vite-plugin-dts": "5.0.1",
|
|
107
108
|
"vitest": "^4.1.3",
|
|
108
|
-
"@typespec/react-components": "^0.57.0"
|
|
109
|
-
"@typespec/bundler": "^0.6.0"
|
|
109
|
+
"@typespec/react-components": "^0.57.0"
|
|
110
110
|
},
|
|
111
111
|
"scripts": {
|
|
112
112
|
"clean": "rimraf ./dist ./dist-dev ./temp ./typespecContents.json",
|