@typespec/playground 0.5.0-dev.1 → 0.5.0-dev.3

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 CHANGED
@@ -1,4 +1,4 @@
1
- export { c as createBrowserHost, a as createUrlStateStorage, r as registerMonacoLanguage } from './state-storage-BjOULkS3.js';
1
+ export { c as createBrowserHost, a as createUrlStateStorage, r as registerMonacoLanguage } from './state-storage-CPYqeLVy.js';
2
2
 
3
3
  function registerMonacoDefaultWorkersForVite() {
4
4
  self.MonacoEnvironment = {
@@ -0,0 +1,6 @@
1
+ const manifest = {
2
+ "version": "0.59.1",
3
+ "commit": "9e370211862a3949fc527944645ecd423d34df0c"
4
+ };
5
+
6
+ export { manifest as default };
@@ -7,7 +7,7 @@ import { mergeClasses as mergeClasses$1, Popover, PopoverTrigger, PopoverSurface
7
7
  import { Settings24Regular, Save16Regular, Broom16Filled, Bug16Regular, FolderListRegular, CircleFilled, Square16Filled, Square12Filled, Checkmark16Filled, Checkmark12Filled, AppsListRegular, DatabaseRegular, ChevronDownRegular, ChevronRightRegular, DataLineRegular, ErrorCircle16Filled, Warning16Filled, ChevronDown16Regular } from '@fluentui/react-icons';
8
8
  import debounce from 'debounce';
9
9
  import { CompletionItemTag as CompletionItemTag$1 } from 'vscode-languageserver';
10
- import { g as getMonacoRange, a as createUrlStateStorage, c as createBrowserHost, r as registerMonacoLanguage } from '../state-storage-BjOULkS3.js';
10
+ import { g as getMonacoRange, a as createUrlStateStorage, c as createBrowserHost, r as registerMonacoLanguage } from '../state-storage-CPYqeLVy.js';
11
11
  import { ErrorBoundary } from 'react-error-boundary';
12
12
  import { getSourceLocation } from '@typespec/compiler';
13
13
  import { createRoot } from 'react-dom/client';
@@ -67,10 +67,10 @@ function useMonacoModel(uri, language) {
67
67
  }, [uri, language]);
68
68
  }
69
69
 
70
- const footer = "_footer_cn8nf_1";
70
+ const footer = "_footer_e6dic_1";
71
71
  const style$i = {
72
72
  footer: footer,
73
- "footer-item": "_footer-item_cn8nf_9"
73
+ "footer-item": "_footer-item_e6dic_9"
74
74
  };
75
75
 
76
76
  const FooterItem = ({ children, link, className }) => {
@@ -31419,6 +31419,12 @@ const diagnostics = {
31419
31419
  default: paramMessage `Path "${"path"}" cannot be relative. Use {cwd} or {project-root} to specify what the path should be relative to.`,
31420
31420
  },
31421
31421
  },
31422
+ "path-unix-style": {
31423
+ severity: "warning",
31424
+ messages: {
31425
+ default: paramMessage `Path should use unix style separators. Use "/" instead of "\\".`,
31426
+ },
31427
+ },
31422
31428
  "config-path-not-found": {
31423
31429
  severity: "error",
31424
31430
  messages: {
@@ -31658,6 +31664,7 @@ const diagnostics = {
31658
31664
  wrongType: paramMessage `Encoding '${"encoding"}' cannot be used on type '${"type"}'. Expected: ${"expected"}.`,
31659
31665
  wrongEncodingType: paramMessage `Encoding '${"encoding"}' on type '${"type"}' is expected to be serialized as '${"expected"}' but got '${"actual"}'.`,
31660
31666
  wrongNumericEncodingType: paramMessage `Encoding '${"encoding"}' on type '${"type"}' is expected to be serialized as '${"expected"}' but got '${"actual"}'. Set '@encode' 2nd parameter to be of type ${"expected"}. e.g. '@encode("${"encoding"}", int32)'`,
31667
+ firstArg: `First argument of "@encode" must be the encoding name or the string type when encoding numeric types.`,
31661
31668
  },
31662
31669
  },
31663
31670
  "invalid-mime-type": {
@@ -38687,6 +38694,15 @@ function compilerAssert(condition, message, target) {
38687
38694
  throw new Error(message);
38688
38695
  }
38689
38696
 
38697
+ function absolutePathStatus(path) {
38698
+ if (path.startsWith(".") || !isPathAbsolute(path)) {
38699
+ return "not-absolute";
38700
+ }
38701
+ // if (path.includes("\\")) {
38702
+ // return "windows-style";
38703
+ // }
38704
+ return "valid";
38705
+ }
38690
38706
  function createJSONSchemaValidator(schema, options = { strict: true }) {
38691
38707
  const ajv = new ajvExports.Ajv({
38692
38708
  strict: options.strict,
@@ -38695,9 +38711,7 @@ function createJSONSchemaValidator(schema, options = { strict: true }) {
38695
38711
  });
38696
38712
  ajv.addFormat("absolute-path", {
38697
38713
  type: "string",
38698
- validate: (path) => {
38699
- return !path.startsWith(".") && isPathAbsolute(path);
38700
- },
38714
+ validate: (path) => absolutePathStatus(path) === "valid",
38701
38715
  });
38702
38716
  return { validate };
38703
38717
  function validate(config, target) {
@@ -38716,9 +38730,10 @@ const IGNORED_AJV_PARAMS = new Set(["type", "errors"]);
38716
38730
  function ajvErrorToDiagnostic(obj, error, target) {
38717
38731
  const tspTarget = resolveTarget(error, target);
38718
38732
  if (error.params.format === "absolute-path") {
38733
+ const value = getErrorValue(obj, error);
38719
38734
  return createDiagnostic({
38720
38735
  code: "config-path-absolute",
38721
- format: { path: getErrorValue(obj, error) },
38736
+ format: { path: value },
38722
38737
  target: tspTarget,
38723
38738
  });
38724
38739
  }
@@ -38792,7 +38807,7 @@ let manifest;
38792
38807
  try {
38793
38808
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
38794
38809
  // @ts-ignore
38795
- manifest = (await import('../manifest-dq4u9tDK-dq4u9tDK.js')).default;
38810
+ manifest = (await import('../manifest-fUEUc7Kt-fUEUc7Kt.js')).default;
38796
38811
  }
38797
38812
  catch {
38798
38813
  const name = "../dist/manifest.js";
@@ -40492,6 +40507,8 @@ function parse$1(original) {
40492
40507
  return { n, e: exp, s: sign, d: decimal };
40493
40508
  }
40494
40509
  function stringify(value) {
40510
+ if (value.n === 0n)
40511
+ return "0";
40495
40512
  const n = value.n.toString();
40496
40513
  const sign = value.s === -1 ? "-" : "";
40497
40514
  const int = value.e === 0 ? "0" : n.slice(0, value.e);
@@ -51998,7 +52015,8 @@ function computeTree(program) {
51998
52015
  };
51999
52016
  }
52000
52017
  function computeTypeNode(parentPath, type, name) {
52001
- const path = parentPath + "." + type.name.toString();
52018
+ const pathSeg = name ?? type.name.toString();
52019
+ const path = parentPath + "." + pathSeg;
52002
52020
  return computeTypeNodeProps(path, type, name);
52003
52021
  }
52004
52022
  function computeTypeNodeProps(path, type, name) {
@@ -1 +1 @@
1
- {"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/services.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EAEd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAmC9C,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,WAAW,iBA4T7D;AAED,wBAAgB,cAAc,CAC5B,gBAAgB,EAAE,cAAc,oBAAoB,CAAC,EACrD,MAAM,EAAE,gBAAgB,GAAG,OAAO,QAAQ,GACzC,MAAM,CAAC,MAAM,CAkBf"}
1
+ {"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/services.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EAEd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAmC9C,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,WAAW,iBA+T7D;AAED,wBAAgB,cAAc,CAC5B,gBAAgB,EAAE,cAAc,oBAAoB,CAAC,EACrD,MAAM,EAAE,gBAAgB,GAAG,OAAO,QAAQ,GACzC,MAAM,CAAC,MAAM,CAkBf"}
@@ -286,6 +286,9 @@ function getTypeSpecLanguageConfiguration() {
286
286
  };
287
287
  }
288
288
  async function registerMonacoLanguage(host) {
289
+ if (monaco.languages.getLanguages().some((x) => x.id === "typespec")) {
290
+ return;
291
+ }
289
292
  monaco.languages.register({ id: "typespec", extensions: [".tsp"] });
290
293
  monaco.languages.setLanguageConfiguration("typespec", getTypeSpecLanguageConfiguration());
291
294
  const serverHost = {
package/dist/style.css CHANGED
@@ -1,19 +1,19 @@
1
- ._footer_cn8nf_1 {
1
+ ._footer_e6dic_1 {
2
2
  grid-area: footer;
3
3
  display: flex;
4
4
  font-size: 14px;
5
5
 
6
- background-color: #007acc;
6
+ background-color: #0073c1;
7
7
  }
8
8
 
9
- ._footer-item_cn8nf_9 {
9
+ ._footer-item_e6dic_9 {
10
10
  text-decoration: none;
11
11
  color: #fefefe;
12
12
  border-right: 1px solid #d5d5d5;
13
13
  padding: 0 5px;
14
14
  }
15
15
 
16
- ._footer-item_cn8nf_9:hover {
16
+ ._footer-item_e6dic_9:hover {
17
17
  background-color: #063a5c;
18
18
  }
19
19
  ._version-item_1c15n_1 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typespec/playground",
3
- "version": "0.5.0-dev.1",
3
+ "version": "0.5.0-dev.3",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "TypeSpec playground UI components.",
6
6
  "homepage": "https://typespec.io",
@@ -57,15 +57,15 @@
57
57
  "dependencies": {
58
58
  "@fluentui/react-components": "~9.54.5",
59
59
  "@fluentui/react-icons": "^2.0.249",
60
- "@typespec/bundler": "~0.1.5 || >=0.2.0-dev <0.2.0",
61
- "@typespec/compiler": "~0.58.1 || >=0.59.0-dev <0.59.0",
62
- "@typespec/html-program-viewer": "~0.58.0 || >=0.59.0-dev <0.59.0",
63
- "@typespec/http": "~0.58.0 || >=0.59.0-dev <0.59.0",
64
- "@typespec/openapi": "~0.58.0 || >=0.59.0-dev <0.59.0",
65
- "@typespec/openapi3": "~0.58.0 || >=0.59.0-dev <0.59.0",
66
- "@typespec/protobuf": "~0.58.0 || >=0.59.0-dev <0.59.0",
67
- "@typespec/rest": "~0.58.0 || >=0.59.0-dev <0.59.0",
68
- "@typespec/versioning": "~0.58.0 || >=0.59.0-dev <0.59.0",
60
+ "@typespec/bundler": "~0.1.6 || >=0.2.0-dev <0.2.0",
61
+ "@typespec/compiler": "~0.59.1 || >=0.60.0-dev <0.60.0",
62
+ "@typespec/html-program-viewer": "~0.59.0 || >=0.60.0-dev <0.60.0",
63
+ "@typespec/http": "~0.59.1 || >=0.60.0-dev <0.60.0",
64
+ "@typespec/openapi": "~0.59.0 || >=0.60.0-dev <0.60.0",
65
+ "@typespec/openapi3": "~0.59.1 || >=0.60.0-dev <0.60.0",
66
+ "@typespec/protobuf": "~0.59.0 || >=0.60.0-dev <0.60.0",
67
+ "@typespec/rest": "~0.59.1 || >=0.60.0-dev <0.60.0",
68
+ "@typespec/versioning": "~0.59.0 || >=0.60.0-dev <0.60.0",
69
69
  "clsx": "^2.1.1",
70
70
  "debounce": "~2.1.0",
71
71
  "lzutf8": "0.6.3",
@@ -91,7 +91,7 @@
91
91
  "@types/react": "~18.3.3",
92
92
  "@types/react-dom": "~18.3.0",
93
93
  "@types/swagger-ui-dist": "~3.30.5",
94
- "@typespec/bundler": "~0.1.5 || >=0.2.0-dev <0.2.0",
94
+ "@typespec/bundler": "~0.1.6 || >=0.2.0-dev <0.2.0",
95
95
  "@vitejs/plugin-react": "~4.3.1",
96
96
  "c8": "^10.1.2",
97
97
  "cross-env": "~7.0.3",
@@ -1,6 +0,0 @@
1
- const manifest = {
2
- "version": "0.58.1",
3
- "commit": "54c6d889564a230afc1b9f13c71905171e350fb3"
4
- };
5
-
6
- export { manifest as default };