diff --git a/common/changes/@typespec/compiler/feature-yaml-ast_2023-08-09-16-14.json b/common/changes/@typespec/compiler/feature-yaml-ast_2023-08-09-16-14.json new file mode 100644 index 00000000000..213a1a3af0f --- /dev/null +++ b/common/changes/@typespec/compiler/feature-yaml-ast_2023-08-09-16-14.json @@ -0,0 +1,15 @@ +{ + "changes": [ + { + "packageName": "@typespec/compiler", + "comment": "Changed yaml parser from `js-yaml` to `yaml`", + "type": "none" + }, + { + "packageName": "@typespec/compiler", + "comment": "Parsing and validation of the tspconfig.yaml will not report the error location.", + "type": "none" + } + ], + "packageName": "@typespec/compiler" +} diff --git a/common/changes/@typespec/json-schema/feature-yaml-ast_2023-08-09-16-14.json b/common/changes/@typespec/json-schema/feature-yaml-ast_2023-08-09-16-14.json new file mode 100644 index 00000000000..45dc5b87f29 --- /dev/null +++ b/common/changes/@typespec/json-schema/feature-yaml-ast_2023-08-09-16-14.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@typespec/json-schema", + "comment": "Changed yaml parser from `js-yaml` to `yaml`", + "type": "none" + } + ], + "packageName": "@typespec/json-schema" +} \ No newline at end of file diff --git a/common/changes/@typespec/migrate/feature-yaml-ast_2023-08-09-16-14.json b/common/changes/@typespec/migrate/feature-yaml-ast_2023-08-09-16-14.json new file mode 100644 index 00000000000..0ba5281da7d --- /dev/null +++ b/common/changes/@typespec/migrate/feature-yaml-ast_2023-08-09-16-14.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@typespec/migrate", + "comment": "Changed yaml parser from `js-yaml` to `yaml`", + "type": "none" + } + ], + "packageName": "@typespec/migrate" +} \ No newline at end of file diff --git a/common/changes/@typespec/openapi3/feature-yaml-ast_2023-08-09-16-14.json b/common/changes/@typespec/openapi3/feature-yaml-ast_2023-08-09-16-14.json new file mode 100644 index 00000000000..212eec718a3 --- /dev/null +++ b/common/changes/@typespec/openapi3/feature-yaml-ast_2023-08-09-16-14.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@typespec/openapi3", + "comment": "Changed yaml parser from `js-yaml` to `yaml`", + "type": "none" + } + ], + "packageName": "@typespec/openapi3" +} \ No newline at end of file diff --git a/common/changes/@typespec/prettier-plugin-typespec/feature-yaml-ast_2023-08-09-16-14.json b/common/changes/@typespec/prettier-plugin-typespec/feature-yaml-ast_2023-08-09-16-14.json new file mode 100644 index 00000000000..6c41a3f9663 --- /dev/null +++ b/common/changes/@typespec/prettier-plugin-typespec/feature-yaml-ast_2023-08-09-16-14.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@typespec/prettier-plugin-typespec", + "comment": "Changed yaml parser from `js-yaml` to `yaml`", + "type": "none" + } + ], + "packageName": "@typespec/prettier-plugin-typespec" +} \ No newline at end of file diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 5cbb416c4ee..7c4445a331a 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -45,7 +45,7 @@ importers: version: 5.0.1 typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 ../../packages/bundler: dependencies: @@ -103,7 +103,7 @@ importers: version: 5.0.1 typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 vite: specifier: ^4.2.1 version: 4.2.1(@types/node@18.11.9) @@ -122,9 +122,6 @@ importers: globby: specifier: ~13.1.1 version: 13.1.1 - js-yaml: - specifier: ~4.1.0 - version: 4.1.0 mustache: specifier: ~4.2.0 version: 4.2.0 @@ -146,6 +143,9 @@ importers: vscode-languageserver-textdocument: specifier: ~1.0.1 version: 1.0.1 + yaml: + specifier: ~2.3.1 + version: 2.3.1 yargs: specifier: ~17.7.1 version: 17.7.1 @@ -153,9 +153,6 @@ importers: '@types/babel__code-frame': specifier: ~7.0.3 version: 7.0.3 - '@types/js-yaml': - specifier: ~4.0.1 - version: 4.0.1 '@types/mocha': specifier: ~10.0.1 version: 10.0.1 @@ -203,7 +200,7 @@ importers: version: 1.5.1(mocha@10.2.0) prettier-plugin-organize-imports: specifier: ~3.2.0 - version: 3.2.0(prettier@3.0.1)(typescript@5.1.5) + version: 3.2.0(prettier@3.0.1)(typescript@5.1.3) rimraf: specifier: ~5.0.1 version: 5.0.1 @@ -218,7 +215,7 @@ importers: version: link:../tmlanguage-generator typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 vscode-oniguruma: specifier: ~1.7.0 version: 1.7.0 @@ -233,10 +230,10 @@ importers: version: 1.3.2 '@typescript-eslint/eslint-plugin': specifier: ^6.2.1 - version: 6.2.1(@typescript-eslint/parser@6.2.1)(eslint@8.42.0)(typescript@5.1.5) + version: 6.2.1(@typescript-eslint/parser@6.2.1)(eslint@8.42.0)(typescript@5.1.3) '@typescript-eslint/parser': specifier: ^6.2.1 - version: 6.2.1(eslint@8.42.0)(typescript@5.1.5) + version: 6.2.1(eslint@8.42.0)(typescript@5.1.3) eslint: specifier: ^8.42.0 version: 8.42.0 @@ -245,7 +242,7 @@ importers: version: 8.5.0(eslint@8.42.0) eslint-plugin-deprecation: specifier: ^1.4.1 - version: 1.4.1(eslint@8.42.0)(typescript@5.1.5) + version: 1.4.1(eslint@8.42.0)(typescript@5.1.3) eslint-plugin-mocha: specifier: ^10.0.5 version: 10.0.5(eslint@8.42.0) @@ -257,13 +254,13 @@ importers: version: 47.0.0(eslint@8.42.0) typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 ../../packages/eslint-plugin-typespec: dependencies: '@typescript-eslint/utils': specifier: ~5.59.11 - version: 5.59.11(eslint@8.42.0)(typescript@5.1.5) + version: 5.59.11(eslint@8.42.0)(typescript@5.1.3) devDependencies: '@types/mocha': specifier: ~10.0.1 @@ -273,7 +270,7 @@ importers: version: 18.11.9 '@typescript-eslint/parser': specifier: ^6.2.1 - version: 6.2.1(eslint@8.42.0)(typescript@5.1.5) + version: 6.2.1(eslint@8.42.0)(typescript@5.1.3) '@typespec/eslint-config-typespec': specifier: workspace:~0.47.0 version: link:../eslint-config-typespec @@ -297,7 +294,7 @@ importers: version: 5.0.1 typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 ../../packages/html-program-viewer: dependencies: @@ -358,7 +355,7 @@ importers: version: 5.0.1 typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 ../../packages/http: devDependencies: @@ -403,7 +400,7 @@ importers: version: 5.0.1 typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 ../../packages/internal-build-utils: dependencies: @@ -452,17 +449,14 @@ importers: version: 5.0.1 typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 ../../packages/json-schema: dependencies: - js-yaml: - specifier: ~4.1.0 - version: 4.1.0 + yaml: + specifier: ~2.3.1 + version: 2.3.1 devDependencies: - '@types/js-yaml': - specifier: ~4.0.1 - version: 4.0.1 '@types/mocha': specifier: ~10.0.1 version: 10.0.1 @@ -513,7 +507,7 @@ importers: version: 5.0.1 typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 ../../packages/library-linter: devDependencies: @@ -549,7 +543,7 @@ importers: version: 5.0.1 typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 ../../packages/lint: devDependencies: @@ -588,7 +582,7 @@ importers: version: 5.0.1 typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 ../../packages/migrate: dependencies: @@ -613,22 +607,19 @@ importers: globby: specifier: ~13.1.1 version: 13.1.1 - js-yaml: - specifier: ~4.1.0 - version: 4.1.0 prettier: specifier: ~3.0.1 version: 3.0.1 semver: specifier: ^7.3.8 version: 7.3.8 + yaml: + specifier: ~2.3.1 + version: 2.3.1 yargs: specifier: ~17.7.1 version: 17.7.1 devDependencies: - '@types/js-yaml': - specifier: ~4.0.1 - version: 4.0.1 '@types/mocha': specifier: ~10.0.1 version: 10.0.1 @@ -667,7 +658,7 @@ importers: version: 5.0.1 typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 ../../packages/openapi: devDependencies: @@ -718,17 +709,14 @@ importers: version: 5.0.1 typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 ../../packages/openapi3: dependencies: - js-yaml: - specifier: ~4.1.0 - version: 4.1.0 + yaml: + specifier: ~2.3.1 + version: 2.3.1 devDependencies: - '@types/js-yaml': - specifier: ~4.0.1 - version: 4.0.1 '@types/mocha': specifier: ~10.0.1 version: 10.0.1 @@ -782,7 +770,7 @@ importers: version: 5.0.1 typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 ../../packages/playground: dependencies: @@ -912,7 +900,7 @@ importers: version: 5.9.0 typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 vite: specifier: ^4.2.1 version: 4.2.1(@types/node@18.11.9) @@ -1021,7 +1009,7 @@ importers: version: 5.9.0 typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 vite: specifier: ^4.2.1 version: 4.2.1(@types/node@18.11.9) @@ -1106,7 +1094,7 @@ importers: version: 5.0.1 typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 ../../packages/rest: devDependencies: @@ -1154,7 +1142,7 @@ importers: version: 5.0.1 typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 ../../packages/samples: dependencies: @@ -1212,7 +1200,7 @@ importers: version: 5.0.1 typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 ../../packages/spec: devDependencies: @@ -1252,29 +1240,26 @@ importers: version: 5.0.1 typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 ../../packages/tspd: dependencies: '@typespec/compiler': specifier: workspace:~0.47.1 version: link:../compiler - js-yaml: - specifier: ~4.1.0 - version: 4.1.0 picocolors: specifier: ~1.0.0 version: 1.0.0 prettier: specifier: ~3.0.1 version: 3.0.1 + yaml: + specifier: ~2.3.1 + version: 2.3.1 yargs: specifier: ~17.7.1 version: 17.7.1 devDependencies: - '@types/js-yaml': - specifier: ~4.0.1 - version: 4.0.1 '@types/mocha': specifier: ~10.0.1 version: 10.0.1 @@ -1313,13 +1298,13 @@ importers: version: 0.5.19 typedoc: specifier: ~0.24.8 - version: 0.24.8(typescript@5.1.5) + version: 0.24.8(typescript@5.1.3) typedoc-plugin-markdown: specifier: ~4.0.0-next.18 version: 4.0.0-next.18(typedoc@0.24.8) typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 ../../packages/typespec-vs: devDependencies: @@ -1382,7 +1367,7 @@ importers: version: 3.24.0 typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 vscode-languageclient: specifier: ~8.1.0 version: 8.1.0 @@ -1430,19 +1415,19 @@ importers: version: 5.0.1 typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 ../../packages/website: dependencies: '@docusaurus/core': specifier: ^2.2.0 - version: 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) + version: 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) '@docusaurus/preset-classic': specifier: ^2.2.0 - version: 2.2.0(@algolia/client-search@4.17.2)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(search-insights@2.6.0)(typescript@5.1.5) + version: 2.2.0(@algolia/client-search@4.17.2)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(search-insights@2.6.0)(typescript@5.1.3) '@docusaurus/theme-mermaid': specifier: ^2.2.0 - version: 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) + version: 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) '@mdx-js/react': specifier: ^1.6.22 version: 1.6.22(react@17.0.2) @@ -1524,7 +1509,7 @@ importers: version: 5.0.1 typescript: specifier: ~5.1.3 - version: 5.1.5 + version: 5.1.3 packages: @@ -3516,7 +3501,7 @@ packages: - search-insights dev: false - /@docusaurus/core@2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5): + /@docusaurus/core@2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3): resolution: {integrity: sha512-Vd6XOluKQqzG12fEs9prJgDtyn6DPok9vmUWDR2E6/nV5Fl9SVkhEQOBxwObjk3kQh7OY7vguFaLh0jqdApWsA==} engines: {node: '>=16.14'} hasBin: true @@ -3575,7 +3560,7 @@ packages: postcss-loader: 7.3.3(postcss@8.4.24)(webpack@5.87.0) prompts: 2.4.2 react: 17.0.2 - react-dev-utils: 12.0.1(eslint@8.42.0)(typescript@5.1.5)(webpack@5.87.0) + react-dev-utils: 12.0.1(eslint@8.42.0)(typescript@5.1.3)(webpack@5.87.0) react-dom: 17.0.2(react@17.0.2) react-helmet-async: 1.3.0(react-dom@17.0.2)(react@17.0.2) react-loadable: /@docusaurus/react-loadable@5.5.2(react@17.0.2) @@ -3691,14 +3676,14 @@ packages: - uglify-js - webpack-cli - /@docusaurus/plugin-content-blog@2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5): + /@docusaurus/plugin-content-blog@2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3): resolution: {integrity: sha512-0mWBinEh0a5J2+8ZJXJXbrCk1tSTNf7Nm4tYAl5h2/xx+PvH/Bnu0V+7mMljYm/1QlDYALNIIaT/JcoZQFUN3w==} engines: {node: '>=16.14'} peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) + '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) '@docusaurus/logger': 2.2.0 '@docusaurus/mdx-loader': 2.2.0(@docusaurus/types@2.2.0)(react-dom@17.0.2)(react@17.0.2) '@docusaurus/types': 2.2.0(react-dom@17.0.2)(react@17.0.2) @@ -3734,14 +3719,14 @@ packages: - webpack-cli dev: false - /@docusaurus/plugin-content-docs@2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5): + /@docusaurus/plugin-content-docs@2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3): resolution: {integrity: sha512-BOazBR0XjzsHE+2K1wpNxz5QZmrJgmm3+0Re0EVPYFGW8qndCWGNtXW/0lGKhecVPML8yyFeAmnUCIs7xM2wPw==} engines: {node: '>=16.14'} peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) + '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) '@docusaurus/logger': 2.2.0 '@docusaurus/mdx-loader': 2.2.0(@docusaurus/types@2.2.0)(react-dom@17.0.2)(react@17.0.2) '@docusaurus/module-type-aliases': 2.2.0(react-dom@17.0.2)(react@17.0.2) @@ -3777,14 +3762,14 @@ packages: - webpack-cli dev: false - /@docusaurus/plugin-content-pages@2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5): + /@docusaurus/plugin-content-pages@2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3): resolution: {integrity: sha512-+OTK3FQHk5WMvdelz8v19PbEbx+CNT6VSpx7nVOvMNs5yJCKvmqBJBQ2ZSxROxhVDYn+CZOlmyrC56NSXzHf6g==} engines: {node: '>=16.14'} peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) + '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) '@docusaurus/mdx-loader': 2.2.0(@docusaurus/types@2.2.0)(react-dom@17.0.2)(react@17.0.2) '@docusaurus/types': 2.2.0(react-dom@17.0.2)(react@17.0.2) '@docusaurus/utils': 2.2.0(@docusaurus/types@2.2.0) @@ -3812,14 +3797,14 @@ packages: - webpack-cli dev: false - /@docusaurus/plugin-debug@2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5): + /@docusaurus/plugin-debug@2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3): resolution: {integrity: sha512-p9vOep8+7OVl6r/NREEYxf4HMAjV8JMYJ7Bos5fCFO0Wyi9AZEo0sCTliRd7R8+dlJXZEgcngSdxAUo/Q+CJow==} engines: {node: '>=16.14'} peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) + '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) '@docusaurus/types': 2.2.0(react-dom@17.0.2)(react@17.0.2) '@docusaurus/utils': 2.2.0(@docusaurus/types@2.2.0) fs-extra: 10.1.0 @@ -3847,14 +3832,14 @@ packages: - webpack-cli dev: false - /@docusaurus/plugin-google-analytics@2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5): + /@docusaurus/plugin-google-analytics@2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3): resolution: {integrity: sha512-+eZVVxVeEnV5nVQJdey9ZsfyEVMls6VyWTIj8SmX0k5EbqGvnIfET+J2pYEuKQnDIHxy+syRMoRM6AHXdHYGIg==} engines: {node: '>=16.14'} peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) + '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) '@docusaurus/types': 2.2.0(react-dom@17.0.2)(react@17.0.2) '@docusaurus/utils-validation': 2.2.0(@docusaurus/types@2.2.0) react: 17.0.2 @@ -3878,14 +3863,14 @@ packages: - webpack-cli dev: false - /@docusaurus/plugin-google-gtag@2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5): + /@docusaurus/plugin-google-gtag@2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3): resolution: {integrity: sha512-6SOgczP/dYdkqUMGTRqgxAS1eTp6MnJDAQMy8VCF1QKbWZmlkx4agHDexihqmYyCujTYHqDAhm1hV26EET54NQ==} engines: {node: '>=16.14'} peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) + '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) '@docusaurus/types': 2.2.0(react-dom@17.0.2)(react@17.0.2) '@docusaurus/utils-validation': 2.2.0(@docusaurus/types@2.2.0) react: 17.0.2 @@ -3909,14 +3894,14 @@ packages: - webpack-cli dev: false - /@docusaurus/plugin-sitemap@2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5): + /@docusaurus/plugin-sitemap@2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3): resolution: {integrity: sha512-0jAmyRDN/aI265CbWZNZuQpFqiZuo+5otk2MylU9iVrz/4J7gSc+ZJ9cy4EHrEsW7PV8s1w18hIEsmcA1YgkKg==} engines: {node: '>=16.14'} peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) + '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) '@docusaurus/logger': 2.2.0 '@docusaurus/types': 2.2.0(react-dom@17.0.2)(react@17.0.2) '@docusaurus/utils': 2.2.0(@docusaurus/types@2.2.0) @@ -3945,24 +3930,24 @@ packages: - webpack-cli dev: false - /@docusaurus/preset-classic@2.2.0(@algolia/client-search@4.17.2)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(search-insights@2.6.0)(typescript@5.1.5): + /@docusaurus/preset-classic@2.2.0(@algolia/client-search@4.17.2)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(search-insights@2.6.0)(typescript@5.1.3): resolution: {integrity: sha512-yKIWPGNx7BT8v2wjFIWvYrS+nvN04W+UameSFf8lEiJk6pss0kL6SG2MRvyULiI3BDxH+tj6qe02ncpSPGwumg==} engines: {node: '>=16.14'} peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) - '@docusaurus/plugin-content-blog': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) - '@docusaurus/plugin-content-docs': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) - '@docusaurus/plugin-content-pages': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) - '@docusaurus/plugin-debug': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) - '@docusaurus/plugin-google-analytics': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) - '@docusaurus/plugin-google-gtag': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) - '@docusaurus/plugin-sitemap': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) - '@docusaurus/theme-classic': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) - '@docusaurus/theme-common': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) - '@docusaurus/theme-search-algolia': 2.2.0(@algolia/client-search@4.17.2)(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(search-insights@2.6.0)(typescript@5.1.5) + '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) + '@docusaurus/plugin-content-blog': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) + '@docusaurus/plugin-content-docs': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) + '@docusaurus/plugin-content-pages': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) + '@docusaurus/plugin-debug': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) + '@docusaurus/plugin-google-analytics': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) + '@docusaurus/plugin-google-gtag': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) + '@docusaurus/plugin-sitemap': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) + '@docusaurus/theme-classic': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) + '@docusaurus/theme-common': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) + '@docusaurus/theme-search-algolia': 2.2.0(@algolia/client-search@4.17.2)(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(search-insights@2.6.0)(typescript@5.1.3) '@docusaurus/types': 2.2.0(react-dom@17.0.2)(react@17.0.2) react: 17.0.2 react-dom: 17.0.2(react@17.0.2) @@ -3997,20 +3982,20 @@ packages: prop-types: 15.8.1 react: 17.0.2 - /@docusaurus/theme-classic@2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5): + /@docusaurus/theme-classic@2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3): resolution: {integrity: sha512-kjbg/qJPwZ6H1CU/i9d4l/LcFgnuzeiGgMQlt6yPqKo0SOJIBMPuz7Rnu3r/WWbZFPi//o8acclacOzmXdUUEg==} engines: {node: '>=16.14'} peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) + '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) '@docusaurus/mdx-loader': 2.2.0(@docusaurus/types@2.2.0)(react-dom@17.0.2)(react@17.0.2) '@docusaurus/module-type-aliases': 2.2.0(react-dom@17.0.2)(react@17.0.2) - '@docusaurus/plugin-content-blog': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) - '@docusaurus/plugin-content-docs': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) - '@docusaurus/plugin-content-pages': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) - '@docusaurus/theme-common': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) + '@docusaurus/plugin-content-blog': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) + '@docusaurus/plugin-content-docs': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) + '@docusaurus/plugin-content-pages': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) + '@docusaurus/theme-common': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) '@docusaurus/theme-translations': 2.2.0 '@docusaurus/types': 2.2.0(react-dom@17.0.2)(react@17.0.2) '@docusaurus/utils': 2.2.0(@docusaurus/types@2.2.0) @@ -4049,7 +4034,7 @@ packages: - webpack-cli dev: false - /@docusaurus/theme-common@2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5): + /@docusaurus/theme-common@2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3): resolution: {integrity: sha512-R8BnDjYoN90DCL75gP7qYQfSjyitXuP9TdzgsKDmSFPNyrdE3twtPNa2dIN+h+p/pr+PagfxwWbd6dn722A1Dw==} engines: {node: '>=16.14'} peerDependencies: @@ -4058,9 +4043,9 @@ packages: dependencies: '@docusaurus/mdx-loader': 2.2.0(@docusaurus/types@2.2.0)(react-dom@17.0.2)(react@17.0.2) '@docusaurus/module-type-aliases': 2.2.0(react-dom@17.0.2)(react@17.0.2) - '@docusaurus/plugin-content-blog': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) - '@docusaurus/plugin-content-docs': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) - '@docusaurus/plugin-content-pages': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) + '@docusaurus/plugin-content-blog': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) + '@docusaurus/plugin-content-docs': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) + '@docusaurus/plugin-content-pages': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) '@docusaurus/utils': 2.2.0(@docusaurus/types@2.2.0) '@types/history': 4.7.11 '@types/react': 18.2.9 @@ -4091,16 +4076,16 @@ packages: - webpack-cli dev: false - /@docusaurus/theme-mermaid@2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5): + /@docusaurus/theme-mermaid@2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3): resolution: {integrity: sha512-rEhVvWyZ9j9eABTvJ8nhfB5NbyiThva3U9J7iu4RxKYymjImEh9MiqbEdOrZusq6AQevbkoHB7n+9VsfmS55kg==} engines: {node: '>=16.14'} peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) + '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) '@docusaurus/module-type-aliases': 2.2.0(react-dom@17.0.2)(react@17.0.2) - '@docusaurus/theme-common': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) + '@docusaurus/theme-common': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) '@docusaurus/types': 2.2.0(react-dom@17.0.2)(react@17.0.2) '@docusaurus/utils-validation': 2.2.0(@docusaurus/types@2.2.0) '@mdx-js/react': 1.6.22(react@17.0.2) @@ -4126,7 +4111,7 @@ packages: - webpack-cli dev: false - /@docusaurus/theme-search-algolia@2.2.0(@algolia/client-search@4.17.2)(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(search-insights@2.6.0)(typescript@5.1.5): + /@docusaurus/theme-search-algolia@2.2.0(@algolia/client-search@4.17.2)(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(search-insights@2.6.0)(typescript@5.1.3): resolution: {integrity: sha512-2h38B0tqlxgR2FZ9LpAkGrpDWVdXZ7vltfmTdX+4RsDs3A7khiNsmZB+x/x6sA4+G2V2CvrsPMlsYBy5X+cY1w==} engines: {node: '>=16.14'} peerDependencies: @@ -4134,10 +4119,10 @@ packages: react-dom: ^16.8.4 || ^17.0.0 dependencies: '@docsearch/react': 3.5.1(@algolia/client-search@4.17.2)(react-dom@17.0.2)(react@17.0.2)(search-insights@2.6.0) - '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) + '@docusaurus/core': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) '@docusaurus/logger': 2.2.0 - '@docusaurus/plugin-content-docs': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) - '@docusaurus/theme-common': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.5) + '@docusaurus/plugin-content-docs': 2.2.0(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) + '@docusaurus/theme-common': 2.2.0(@docusaurus/types@2.2.0)(eslint@8.42.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.1.3) '@docusaurus/theme-translations': 2.2.0 '@docusaurus/utils': 2.2.0(@docusaurus/types@2.2.0) '@docusaurus/utils-validation': 2.2.0(@docusaurus/types@2.2.0) @@ -6467,10 +6452,6 @@ packages: '@types/istanbul-lib-report': 3.0.0 dev: false - /@types/js-yaml@4.0.1: - resolution: {integrity: sha512-xdOvNmXmrZqqPy3kuCQ+fz6wA0xU5pji9cd1nDrflWaAWtYLLGk5ykW0H6yg5TVyehHP1pfmuuSaZkhP+kspVA==} - dev: true - /@types/json-schema@7.0.12: resolution: {integrity: sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==} @@ -6677,7 +6658,7 @@ packages: dependencies: '@types/yargs-parser': 21.0.0 - /@typescript-eslint/eslint-plugin@6.2.1(@typescript-eslint/parser@6.2.1)(eslint@8.42.0)(typescript@5.1.5): + /@typescript-eslint/eslint-plugin@6.2.1(@typescript-eslint/parser@6.2.1)(eslint@8.42.0)(typescript@5.1.3): resolution: {integrity: sha512-iZVM/ALid9kO0+I81pnp1xmYiFyqibAHzrqX4q5YvvVEyJqY+e6rfTXSCsc2jUxGNqJqTfFSSij/NFkZBiBzLw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -6689,10 +6670,10 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.5.1 - '@typescript-eslint/parser': 6.2.1(eslint@8.42.0)(typescript@5.1.5) + '@typescript-eslint/parser': 6.2.1(eslint@8.42.0)(typescript@5.1.3) '@typescript-eslint/scope-manager': 6.2.1 - '@typescript-eslint/type-utils': 6.2.1(eslint@8.42.0)(typescript@5.1.5) - '@typescript-eslint/utils': 6.2.1(eslint@8.42.0)(typescript@5.1.5) + '@typescript-eslint/type-utils': 6.2.1(eslint@8.42.0)(typescript@5.1.3) + '@typescript-eslint/utils': 6.2.1(eslint@8.42.0)(typescript@5.1.3) '@typescript-eslint/visitor-keys': 6.2.1 debug: 4.3.4(supports-color@8.1.1) eslint: 8.42.0 @@ -6701,13 +6682,13 @@ packages: natural-compare: 1.4.0 natural-compare-lite: 1.4.0 semver: 7.5.4 - ts-api-utils: 1.0.1(typescript@5.1.5) - typescript: 5.1.5 + ts-api-utils: 1.0.1(typescript@5.1.3) + typescript: 5.1.3 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/parser@6.2.1(eslint@8.42.0)(typescript@5.1.5): + /@typescript-eslint/parser@6.2.1(eslint@8.42.0)(typescript@5.1.3): resolution: {integrity: sha512-Ld+uL1kYFU8e6btqBFpsHkwQ35rw30IWpdQxgOqOh4NfxSDH6uCkah1ks8R/RgQqI5hHPXMaLy9fbFseIe+dIg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -6719,11 +6700,11 @@ packages: dependencies: '@typescript-eslint/scope-manager': 6.2.1 '@typescript-eslint/types': 6.2.1 - '@typescript-eslint/typescript-estree': 6.2.1(typescript@5.1.5) + '@typescript-eslint/typescript-estree': 6.2.1(typescript@5.1.3) '@typescript-eslint/visitor-keys': 6.2.1 debug: 4.3.4(supports-color@8.1.1) eslint: 8.42.0 - typescript: 5.1.5 + typescript: 5.1.3 transitivePeerDependencies: - supports-color @@ -6742,7 +6723,7 @@ packages: '@typescript-eslint/types': 6.2.1 '@typescript-eslint/visitor-keys': 6.2.1 - /@typescript-eslint/type-utils@6.2.1(eslint@8.42.0)(typescript@5.1.5): + /@typescript-eslint/type-utils@6.2.1(eslint@8.42.0)(typescript@5.1.3): resolution: {integrity: sha512-fTfCgomBMIgu2Dh2Or3gMYgoNAnQm3RLtRp+jP7A8fY+LJ2+9PNpi5p6QB5C4RSP+U3cjI0vDlI3mspAkpPVbQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -6752,12 +6733,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.2.1(typescript@5.1.5) - '@typescript-eslint/utils': 6.2.1(eslint@8.42.0)(typescript@5.1.5) + '@typescript-eslint/typescript-estree': 6.2.1(typescript@5.1.3) + '@typescript-eslint/utils': 6.2.1(eslint@8.42.0)(typescript@5.1.3) debug: 4.3.4(supports-color@8.1.1) eslint: 8.42.0 - ts-api-utils: 1.0.1(typescript@5.1.5) - typescript: 5.1.5 + ts-api-utils: 1.0.1(typescript@5.1.3) + typescript: 5.1.3 transitivePeerDependencies: - supports-color dev: false @@ -6771,7 +6752,7 @@ packages: resolution: {integrity: sha512-528bGcoelrpw+sETlyM91k51Arl2ajbNT9L4JwoXE2dvRe1yd8Q64E4OL7vHYw31mlnVsf+BeeLyAZUEQtqahQ==} engines: {node: ^16.0.0 || >=18.0.0} - /@typescript-eslint/typescript-estree@5.59.11(typescript@5.1.5): + /@typescript-eslint/typescript-estree@5.59.11(typescript@5.1.3): resolution: {integrity: sha512-YupOpot5hJO0maupJXixi6l5ETdrITxeo5eBOeuV7RSKgYdU3G5cxO49/9WRnJq9EMrB7AuTSLH/bqOsXi7wPA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -6786,13 +6767,13 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.4 - tsutils: 3.21.0(typescript@5.1.5) - typescript: 5.1.5 + tsutils: 3.21.0(typescript@5.1.3) + typescript: 5.1.3 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/typescript-estree@6.2.1(typescript@5.1.5): + /@typescript-eslint/typescript-estree@6.2.1(typescript@5.1.3): resolution: {integrity: sha512-G+UJeQx9AKBHRQBpmvr8T/3K5bJa485eu+4tQBxFq0KoT22+jJyzo1B50JDT9QdC1DEmWQfdKsa8ybiNWYsi0Q==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -6807,12 +6788,12 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.4 - ts-api-utils: 1.0.1(typescript@5.1.5) - typescript: 5.1.5 + ts-api-utils: 1.0.1(typescript@5.1.3) + typescript: 5.1.3 transitivePeerDependencies: - supports-color - /@typescript-eslint/utils@5.59.11(eslint@8.42.0)(typescript@5.1.5): + /@typescript-eslint/utils@5.59.11(eslint@8.42.0)(typescript@5.1.3): resolution: {integrity: sha512-didu2rHSOMUdJThLk4aZ1Or8IcO3HzCw/ZvEjTTIfjIrcdd5cvSIwwDy2AOlE7htSNp7QIZ10fLMyRCveesMLg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -6823,7 +6804,7 @@ packages: '@types/semver': 7.3.13 '@typescript-eslint/scope-manager': 5.59.11 '@typescript-eslint/types': 5.59.11 - '@typescript-eslint/typescript-estree': 5.59.11(typescript@5.1.5) + '@typescript-eslint/typescript-estree': 5.59.11(typescript@5.1.3) eslint: 8.42.0 eslint-scope: 5.1.1 semver: 7.3.8 @@ -6832,7 +6813,7 @@ packages: - typescript dev: false - /@typescript-eslint/utils@6.2.1(eslint@8.42.0)(typescript@5.1.5): + /@typescript-eslint/utils@6.2.1(eslint@8.42.0)(typescript@5.1.3): resolution: {integrity: sha512-eBIXQeupYmxVB6S7x+B9SdBeB6qIdXKjgQBge2J+Ouv8h9Cxm5dHf/gfAZA6dkMaag+03HdbVInuXMmqFB/lKQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -6843,7 +6824,7 @@ packages: '@types/semver': 7.5.0 '@typescript-eslint/scope-manager': 6.2.1 '@typescript-eslint/types': 6.2.1 - '@typescript-eslint/typescript-estree': 6.2.1(typescript@5.1.5) + '@typescript-eslint/typescript-estree': 6.2.1(typescript@5.1.3) eslint: 8.42.0 semver: 7.5.4 transitivePeerDependencies: @@ -9457,17 +9438,17 @@ packages: chalk: 4.1.2 dev: true - /eslint-plugin-deprecation@1.4.1(eslint@8.42.0)(typescript@5.1.5): + /eslint-plugin-deprecation@1.4.1(eslint@8.42.0)(typescript@5.1.3): resolution: {integrity: sha512-4vxTghWzxsBukPJVQupi6xlTuDc8Pyi1QlRCrFiLgwLPMJQW3cJCNaehJUKQqQFvuue5m4W27e179Y3Qjzeghg==} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 typescript: ^3.7.5 || ^4.0.0 || ^5.0.0 dependencies: - '@typescript-eslint/utils': 5.59.11(eslint@8.42.0)(typescript@5.1.5) + '@typescript-eslint/utils': 5.59.11(eslint@8.42.0)(typescript@5.1.3) eslint: 8.42.0 tslib: 2.5.3 - tsutils: 3.21.0(typescript@5.1.5) - typescript: 5.1.5 + tsutils: 3.21.0(typescript@5.1.3) + typescript: 5.1.3 transitivePeerDependencies: - supports-color dev: false @@ -10017,7 +9998,7 @@ packages: signal-exit: 4.0.2 dev: true - /fork-ts-checker-webpack-plugin@6.5.3(eslint@8.42.0)(typescript@5.1.5)(webpack@5.87.0): + /fork-ts-checker-webpack-plugin@6.5.3(eslint@8.42.0)(typescript@5.1.3)(webpack@5.87.0): resolution: {integrity: sha512-SbH/l9ikmMWycd5puHJKTkZJKddF4iRLyW3DeZ08HTI7NGyLS38MXd/KGgeWumQO7YNQbW2u/NtPT2YowbPaGQ==} engines: {node: '>=10', yarn: '>=1.0.0'} peerDependencies: @@ -10045,7 +10026,7 @@ packages: schema-utils: 2.7.0 semver: 7.5.4 tapable: 1.1.3 - typescript: 5.1.5 + typescript: 5.1.3 webpack: 5.87.0 dev: false @@ -12820,7 +12801,7 @@ packages: fast-diff: 1.3.0 dev: false - /prettier-plugin-organize-imports@3.2.0(prettier@3.0.1)(typescript@5.1.5): + /prettier-plugin-organize-imports@3.2.0(prettier@3.0.1)(typescript@5.1.3): resolution: {integrity: sha512-jeZ13YVKgXYCzkuwnoR6saKxJmdRYWMxS2G/su1V3qDWqTo1Q5iSoTblBxsXXAmomXfPqa/uA7YCK0/S86KLOQ==} peerDependencies: '@volar/vue-language-plugin-pug': ^1.0.4 @@ -12834,7 +12815,7 @@ packages: optional: true dependencies: prettier: 3.0.1 - typescript: 5.1.5 + typescript: 5.1.3 dev: true /prettier@2.7.1: @@ -13100,7 +13081,7 @@ packages: react: 18.2.0 dev: false - /react-dev-utils@12.0.1(eslint@8.42.0)(typescript@5.1.5)(webpack@5.87.0): + /react-dev-utils@12.0.1(eslint@8.42.0)(typescript@5.1.3)(webpack@5.87.0): resolution: {integrity: sha512-84Ivxmr17KjUupyqzFode6xKhjwuEJDROWKJy/BthkL7Wn6NJ8h4WE6k/exAv6ImS+0oZLRRW5j/aINMHyeGeQ==} engines: {node: '>=14'} dependencies: @@ -13113,7 +13094,7 @@ packages: escape-string-regexp: 4.0.0 filesize: 8.0.7 find-up: 5.0.0 - fork-ts-checker-webpack-plugin: 6.5.3(eslint@8.42.0)(typescript@5.1.5)(webpack@5.87.0) + fork-ts-checker-webpack-plugin: 6.5.3(eslint@8.42.0)(typescript@5.1.3)(webpack@5.87.0) global-modules: 2.0.0 globby: 11.1.0 gzip-size: 6.0.0 @@ -14767,13 +14748,13 @@ packages: resolution: {integrity: sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==} dev: false - /ts-api-utils@1.0.1(typescript@5.1.5): + /ts-api-utils@1.0.1(typescript@5.1.3): resolution: {integrity: sha512-lC/RGlPmwdrIBFTX59wwNzqh7aR2otPNPR/5brHZm/XKFYKsfqxihXUe9pU3JI+3vGkl+vyCoNNnPhJn3aLK1A==} engines: {node: '>=16.13.0'} peerDependencies: typescript: '>=4.2.0' dependencies: - typescript: 5.1.5 + typescript: 5.1.3 /tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} @@ -14786,14 +14767,14 @@ packages: /tslib@2.6.1: resolution: {integrity: sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==} - /tsutils@3.21.0(typescript@5.1.5): + /tsutils@3.21.0(typescript@5.1.3): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 5.1.5 + typescript: 5.1.3 dev: false /tunnel-agent@0.6.0: @@ -14871,10 +14852,10 @@ packages: peerDependencies: typedoc: '>=0.24.0' dependencies: - typedoc: 0.24.8(typescript@5.1.5) + typedoc: 0.24.8(typescript@5.1.3) dev: true - /typedoc@0.24.8(typescript@5.1.5): + /typedoc@0.24.8(typescript@5.1.3): resolution: {integrity: sha512-ahJ6Cpcvxwaxfu4KtjA8qZNqS43wYt6JL27wYiIgl1vd38WW/KWX11YuAeZhuz9v+ttrutSsgK+XO1CjL1kA3w==} engines: {node: '>= 14.14'} hasBin: true @@ -14885,11 +14866,11 @@ packages: marked: 4.3.0 minimatch: 9.0.1 shiki: 0.14.2 - typescript: 5.1.5 + typescript: 5.1.3 dev: true - /typescript@5.1.5: - resolution: {integrity: sha512-FOH+WN/DQjUvN6WgW+c4Ml3yi0PH+a/8q+kNIfRehv1wLhWONedw85iu+vQ39Wp49IzTJEsZ2lyLXpBF7mkF1g==} + /typescript@5.1.3: + resolution: {integrity: sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==} engines: {node: '>=14.17'} hasBin: true @@ -15802,6 +15783,11 @@ packages: engines: {node: '>= 6'} dev: false + /yaml@2.3.1: + resolution: {integrity: sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==} + engines: {node: '>= 14'} + dev: false + /yargs-parser@20.2.4: resolution: {integrity: sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==} engines: {node: '>=10'} diff --git a/docs/extending-typespec/basics.md b/docs/extending-typespec/basics.md index c2a04c7487a..36ce99e4887 100644 --- a/docs/extending-typespec/basics.md +++ b/docs/extending-typespec/basics.md @@ -150,7 +150,7 @@ TypeSpec libraries are defined using `peerDependencies` so we don't end-up with ```jsonc { "dependencies": { - "js-yaml": "~4.1.0" // This is a regular package this library/emitter will use + "yaml": "~2.3.1" // This is a regular package this library/emitter will use }, "peerDependencies": { // Those are all TypeSpec libraries this library/emitter depend on diff --git a/eng/scripts/package.json b/eng/scripts/package.json index 6e1754bd87e..3dbc1ca591c 100644 --- a/eng/scripts/package.json +++ b/eng/scripts/package.json @@ -1,7 +1,3 @@ { - "type": "module", - "dependencies": { - "autorest": "^3.3.2", - "js-yaml": "^4.1.0" - } + "type": "module" } diff --git a/packages/compiler/package.json b/packages/compiler/package.json index afa92021ef8..257afec9f60 100644 --- a/packages/compiler/package.json +++ b/packages/compiler/package.json @@ -77,7 +77,7 @@ "ajv": "~8.12.0", "picocolors": "~1.0.0", "globby": "~13.1.1", - "js-yaml": "~4.1.0", + "yaml": "~2.3.1", "mustache": "~4.2.0", "prettier": "~3.0.1", "prompts": "~2.4.1", @@ -89,7 +89,6 @@ }, "devDependencies": { "@types/babel__code-frame": "~7.0.3", - "@types/js-yaml": "~4.0.1", "@types/mocha": "~10.0.1", "@types/mustache": "~4.2.1", "@types/node": "~18.11.9", diff --git a/packages/compiler/src/config/config-loader.ts b/packages/compiler/src/config/config-loader.ts index 629287907ab..72dce4eca22 100644 --- a/packages/compiler/src/config/config-loader.ts +++ b/packages/compiler/src/config/config-loader.ts @@ -1,9 +1,12 @@ -import jsyaml from "js-yaml"; import { createDiagnostic } from "../core/messages.js"; import { getDirectoryPath, isPathAbsolute, joinPaths, resolvePath } from "../core/path-utils.js"; import { createJSONSchemaValidator } from "../core/schema-validator.js"; -import { CompilerHost, Diagnostic, NoTarget } from "../core/types.js"; -import { deepClone, deepFreeze, doIO, loadFile, omitUndefined } from "../core/util.js"; +import { CompilerHost, Diagnostic, NoTarget, SourceFile } from "../core/types.js"; +import { deepClone, deepFreeze, doIO, omitUndefined } from "../core/util.js"; +import { createSourceFile } from "../index.js"; +import { getLocationInYamlScript } from "../yaml/index.js"; +import { parseYaml } from "../yaml/parser.js"; +import { YamlScript } from "../yaml/types.js"; import { TypeSpecConfigJsonSchema } from "./config-schema.js"; import { TypeSpecConfig, TypeSpecRawConfig } from "./types.js"; @@ -123,7 +126,7 @@ export async function loadTypeSpecConfigFile( host: CompilerHost, filePath: string ): Promise { - const config = await loadConfigFile(host, filePath, jsyaml.load); + const config = await loadConfigFile(host, filePath, parseYaml); if (config.diagnostics.length === 0 && config.extends) { const extendPath = resolvePath(getDirectoryPath(filePath), config.extends); const parent = await loadTypeSpecConfigFile(host, extendPath); @@ -180,15 +183,19 @@ async function searchConfigFile( async function loadConfigFile( host: CompilerHost, filename: string, - loadData: (content: string) => any + loadData: (content: SourceFile) => [YamlScript, readonly Diagnostic[]] ): Promise { let diagnostics: Diagnostic[] = []; const reportDiagnostic = (d: Diagnostic) => diagnostics.push(d); + const file = + (await doIO(host.readFile, filename, reportDiagnostic)) ?? createSourceFile("", filename); + const [yamlScript, yamlDiagnostics] = loadData(file); + yamlDiagnostics.forEach((d) => reportDiagnostic(d)); - let [data, file] = await loadFile(host, filename, loadData, reportDiagnostic); + let data: any = yamlScript.value; if (data) { - diagnostics = diagnostics.concat(configValidator.validate(data, file)); + diagnostics = diagnostics.concat(configValidator.validate(data, yamlScript)); } if (!data || diagnostics.length > 0) { @@ -203,6 +210,7 @@ async function loadConfigFile( return omitUndefined({ projectRoot: getDirectoryPath(filename), + file: yamlScript, filename, diagnostics, extends: data.extends, @@ -221,29 +229,35 @@ async function loadConfigFile( export function validateConfigPathsAbsolute(config: TypeSpecConfig): readonly Diagnostic[] { const diagnostics: Diagnostic[] = []; - function checkPath(value: string | undefined) { + function checkPath(value: string | undefined, path: string[]) { if (value === undefined) { return; } - const diagnostic = validatePathAbsolute(value); + const diagnostic = validatePathAbsolute( + value, + config.file ? { file: config.file, path } : NoTarget + ); if (diagnostic) { diagnostics.push(diagnostic); } } - checkPath(config.outputDir); - for (const emitterOptions of Object.values(config.options ?? {})) { - checkPath(emitterOptions["emitter-output-dir"]); + checkPath(config.outputDir, ["output-dir"]); + for (const [emitterName, emitterOptions] of Object.entries(config.options ?? {})) { + checkPath(emitterOptions["emitter-output-dir"], ["options", emitterName, "emitter-output-dir"]); } return diagnostics; } -function validatePathAbsolute(path: string): Diagnostic | undefined { +function validatePathAbsolute( + path: string, + target: { file: YamlScript; path: string[] } | typeof NoTarget +): Diagnostic | undefined { if (path.startsWith(".") || !isPathAbsolute(path)) { return createDiagnostic({ code: "config-path-absolute", format: { path }, - target: NoTarget, + target: target === NoTarget ? target : getLocationInYamlScript(target.file, target.path), }); } diff --git a/packages/compiler/src/config/config-schema.ts b/packages/compiler/src/config/config-schema.ts index e712ab83f77..e717985d1a5 100644 --- a/packages/compiler/src/config/config-schema.ts +++ b/packages/compiler/src/config/config-schema.ts @@ -89,6 +89,7 @@ export const TypeSpecConfigJsonSchema: JSONSchemaType = { type: "object", nullable: true, required: [], + additionalProperties: false, properties: { extends: { type: "array", diff --git a/packages/compiler/src/config/types.ts b/packages/compiler/src/config/types.ts index c4414ccb69d..ec40bb6af63 100644 --- a/packages/compiler/src/config/types.ts +++ b/packages/compiler/src/config/types.ts @@ -1,4 +1,5 @@ import { Diagnostic, RuleRef } from "../core/index.js"; +import { YamlScript } from "../yaml/types.js"; /** * Represent the normalized user configuration. @@ -9,6 +10,9 @@ export interface TypeSpecConfig { */ projectRoot: string; + /** Yaml file used in this configuration. */ + file?: YamlScript; + /** * Path to the config file used to create this configuration. */ diff --git a/packages/compiler/src/core/cli/actions/compile/compile.ts b/packages/compiler/src/core/cli/actions/compile/compile.ts index 65247eef818..940f305bb24 100644 --- a/packages/compiler/src/core/cli/actions/compile/compile.ts +++ b/packages/compiler/src/core/cli/actions/compile/compile.ts @@ -48,7 +48,7 @@ async function getCompilerOptionsOrExit( if (diagnostics.length > 0) { logDiagnostics(diagnostics, host.logSink); } - if (options === undefined) { + if (options === undefined || diagnostics.length > 0) { logDiagnosticCount(diagnostics); process.exit(1); } diff --git a/packages/compiler/src/core/cli/actions/info.ts b/packages/compiler/src/core/cli/actions/info.ts index 8114a0c46bb..4a69b2c07ee 100644 --- a/packages/compiler/src/core/cli/actions/info.ts +++ b/packages/compiler/src/core/cli/actions/info.ts @@ -1,8 +1,8 @@ /* eslint-disable no-console */ import { fileURLToPath } from "url"; +import { stringify } from "yaml"; import { loadTypeSpecConfigForPath } from "../../../config/config-loader.js"; import { CompilerHost, Diagnostic } from "../../types.js"; - /** * Print the resolved TypeSpec configuration. */ @@ -11,14 +11,11 @@ export async function printInfoAction(host: CompilerHost): Promise - excluded.includes(emitter) ? undefined : value; + const { diagnostics, filename, ...restOfConfig } = config; console.log(`User Config: ${config.filename ?? "No config file found"}`); console.log("-----------"); - console.log(jsyaml.dump(config, { replacer })); + console.log(stringify(restOfConfig)); console.log("-----------"); return config.diagnostics; } diff --git a/packages/compiler/src/core/schema-validator.ts b/packages/compiler/src/core/schema-validator.ts index 49bd50f3be1..1cdb2d9cdde 100644 --- a/packages/compiler/src/core/schema-validator.ts +++ b/packages/compiler/src/core/schema-validator.ts @@ -1,4 +1,6 @@ -import Ajv, { ErrorObject } from "ajv"; +import Ajv, { DefinedError, Options } from "ajv"; +import { getLocationInYamlScript } from "../yaml/diagnostics.js"; +import { YamlScript } from "../yaml/types.js"; import { compilerAssert } from "./diagnostics.js"; import { Diagnostic, JSONSchemaType, JSONSchemaValidator, NoTarget, SourceFile } from "./types.js"; @@ -14,11 +16,15 @@ export function createJSONSchemaValidator( const ajv = new (Ajv as any)({ strict: options.strict, coerceTypes: options.coerceTypes, - }); + allErrors: true, + } satisfies Options); return { validate }; - function validate(config: unknown, target: SourceFile | typeof NoTarget): Diagnostic[] { + function validate( + config: unknown, + target: YamlScript | SourceFile | typeof NoTarget + ): Diagnostic[] { const validate = ajv.compile(schema); const valid = validate(config); compilerAssert( @@ -39,8 +45,8 @@ export function createJSONSchemaValidator( const IGNORED_AJV_PARAMS = new Set(["type", "errors"]); function ajvErrorToDiagnostic( - error: ErrorObject, - target: SourceFile | typeof NoTarget + error: DefinedError, + target: YamlScript | SourceFile | typeof NoTarget ): Diagnostic { const messageLines = [`Schema violation: ${error.message} (${error.instancePath || "/"})`]; for (const [name, value] of Object.entries(error.params).filter( @@ -55,6 +61,44 @@ function ajvErrorToDiagnostic( code: "invalid-schema", message, severity: "error", - target: target === NoTarget ? target : { file: target, pos: 0, end: 0 }, + target: + target === NoTarget + ? target + : "kind" in target + ? getLocationInYamlScript(target, getErrorPath(error), "key") + : { file: target, pos: 0, end: 0 }, }; } + +function getErrorPath(error: DefinedError): string[] { + const instancePath = parseJsonPointer(error.instancePath); + switch (error.keyword) { + case "additionalProperties": + return [...instancePath, error.params.additionalProperty]; + default: + return instancePath; + } +} + +/** + * Converts a json pointer into a array of reference tokens + */ +export function parseJsonPointer(pointer: string): string[] { + if (pointer === "") { + return []; + } + if (pointer.charAt(0) !== "/") { + compilerAssert(false, `Invalid JSON pointer: "${pointer}"`); + } + return pointer.substring(1).split(/\//).map(unescape); +} + +/** + * Unescape a reference token + * + * @param str + * @returns {string} + */ +function unescape(str: string): string { + return str.replace(/~1/g, "/").replace(/~0/g, "~"); +} diff --git a/packages/compiler/src/core/types.ts b/packages/compiler/src/core/types.ts index 51d6668305a..110f8121b13 100644 --- a/packages/compiler/src/core/types.ts +++ b/packages/compiler/src/core/types.ts @@ -1,6 +1,7 @@ import type { JSONSchemaType as AjvJSONSchemaType } from "ajv"; import { TypeEmitter } from "../emitter-framework/type-emitter.js"; import { AssetEmitter } from "../emitter-framework/types.js"; +import { YamlScript } from "../yaml/types.js"; import { ModuleResolutionResult } from "./module-resolver.js"; import { Program } from "./program.js"; @@ -1741,9 +1742,12 @@ export interface SourceLocation extends TextRange { isSynthetic?: boolean; } +/** Used to explicitly specify that a diagnostic has no target. */ export const NoTarget = Symbol.for("NoTarget"); -export type DiagnosticTarget = Node | Type | Sym | SourceLocation; +/** Diagnostic target that can be used when working with TypeSpec types. */ +export type TypeSpecDiagnosticTarget = Node | Type | Sym; +export type DiagnosticTarget = TypeSpecDiagnosticTarget | SourceLocation; export type DiagnosticSeverity = "error" | "warning"; @@ -1957,7 +1961,7 @@ export interface JSONSchemaValidator { * @param target Source file target to use for diagnostics. * @returns Diagnostics produced by schema validation of the configuration. */ - validate(config: unknown, target: SourceFile | typeof NoTarget): Diagnostic[]; + validate(config: unknown, target: YamlScript | SourceFile | typeof NoTarget): Diagnostic[]; } /** @deprecated Use TypeSpecLibraryDef */ diff --git a/packages/compiler/src/init/init.ts b/packages/compiler/src/init/init.ts index 09a8a8b12bf..e8c0cececb5 100644 --- a/packages/compiler/src/init/init.ts +++ b/packages/compiler/src/init/init.ts @@ -1,8 +1,8 @@ import { readdir } from "fs/promises"; -import jsyaml from "js-yaml"; import Mustache from "mustache"; import prompts from "prompts"; import * as semver from "semver"; +import { stringify } from "yaml"; import { TypeSpecConfigFilename } from "../config/config-loader.js"; import { formatTypeSpec } from "../core/formatter.js"; import { createDiagnostic } from "../core/messages.js"; @@ -429,7 +429,7 @@ async function writeConfig(host: CompilerHost, config: ScaffoldingConfig) { if (!config.config) { return; } - const content = jsyaml.dump(config.config); + const content = stringify(config.config); return host.writeFile(joinPaths(config.directory, TypeSpecConfigFilename), content); } diff --git a/packages/compiler/src/server/serverlib.ts b/packages/compiler/src/server/serverlib.ts index 66c9b5a8ee3..160040bffa7 100644 --- a/packages/compiler/src/server/serverlib.ts +++ b/packages/compiler/src/server/serverlib.ts @@ -385,7 +385,7 @@ export function createServer(host: ServerHost): Server { ): Promise { const path = await getPath(document); const mainFile = await getMainFileForDocument(path); - const config = await getConfig(mainFile, path); + const config = await getConfig(mainFile); const options = { ...serverOptions, @@ -447,8 +447,11 @@ export function createServer(host: ServerHost): Server { } } - async function getConfig(mainFile: string, path: string): Promise { - const configPath = await findTypeSpecConfigPath(compilerHost, mainFile, true); + async function getConfig(mainFile: string): Promise { + const entrypointStat = await host.compilerHost.stat(mainFile); + + const lookupDir = entrypointStat.isDirectory() ? mainFile : getDirectoryPath(mainFile); + const configPath = await findTypeSpecConfigPath(compilerHost, lookupDir, true); if (!configPath) { return { ...defaultConfig, projectRoot: getDirectoryPath(mainFile) }; } diff --git a/packages/compiler/src/yaml/diagnostics.ts b/packages/compiler/src/yaml/diagnostics.ts new file mode 100644 index 00000000000..2abdecd50eb --- /dev/null +++ b/packages/compiler/src/yaml/diagnostics.ts @@ -0,0 +1,51 @@ +import { Node, isCollection, isMap, isScalar } from "yaml"; +import { findPair } from "yaml/util"; +import { SourceLocation } from "../core/types.js"; +import { YamlDiagnosticTargetType, YamlScript } from "./types.js"; + +export function getLocationInYamlScript( + file: YamlScript, + path: string[], + kind: YamlDiagnosticTargetType = "value" +): SourceLocation { + const node: Node | undefined = findYamlNode(file, path, kind); + return { + file: file.file, + pos: node?.range?.[0] ?? 0, + end: node?.range?.[1] ?? 0, + }; +} + +function findYamlNode( + file: YamlScript, + path: string[], + kind: YamlDiagnosticTargetType = "value" +): Node | undefined { + let current: Node | null = file.doc.contents; + + for (let i = 0; i < path.length; i++) { + const key = path[i]; + const isLast = i === path.length - 1; + if (isScalar(current)) { + return current; + } else if (isCollection(current)) { + if (isLast) { + if (kind === "value" || !isMap(current)) { + return current.get(key, true); + } else { + const pair = findPair(current.items, key); + if (kind === "key") { + return pair?.key as any; + } else { + return pair as any; + } + } + } else { + current = current.get(key, true) as any; + } + } else { + continue; + } + } + return current ?? undefined; +} diff --git a/packages/compiler/src/yaml/index.ts b/packages/compiler/src/yaml/index.ts new file mode 100644 index 00000000000..2638e24bbf8 --- /dev/null +++ b/packages/compiler/src/yaml/index.ts @@ -0,0 +1,3 @@ +export * from "./diagnostics.js"; +export * from "./parser.js"; +export * from "./types.js"; diff --git a/packages/compiler/src/yaml/parser.ts b/packages/compiler/src/yaml/parser.ts new file mode 100644 index 00000000000..ee5ad615143 --- /dev/null +++ b/packages/compiler/src/yaml/parser.ts @@ -0,0 +1,39 @@ +import { YAMLError, parseDocument } from "yaml"; +import { createDiagnosticCollector, createSourceFile } from "../core/diagnostics.js"; +import { Diagnostic, DiagnosticSeverity, SourceFile } from "../core/types.js"; +import { YamlScript } from "./types.js"; + +export function parseYaml(source: string | SourceFile): [YamlScript, readonly Diagnostic[]] { + const diagnostics = createDiagnosticCollector(); + + const file = typeof source === "string" ? createSourceFile(source, "") : source; + + const doc = parseDocument(file.text, { + prettyErrors: false, // We are handling the error display ourself to be consistent in the style. + }); + for (const error of doc.errors) { + diagnostics.add(convertYamlErrorToDiagnostic("error", error, file)); + } + for (const warning of doc.warnings) { + diagnostics.add(convertYamlErrorToDiagnostic("warning", warning, file)); + } + return diagnostics.wrap({ + kind: "yaml-script", + file, + value: doc.toJSON(), + doc, + }); +} + +function convertYamlErrorToDiagnostic( + severity: DiagnosticSeverity, + error: YAMLError, + file: SourceFile +): Diagnostic { + return { + code: `yaml-${error.code.toLowerCase().replace(/_/g, "-")}`, + message: error.message, + severity, + target: { file, pos: error.pos[0], end: error.pos[1] }, + }; +} diff --git a/packages/compiler/src/yaml/types.ts b/packages/compiler/src/yaml/types.ts new file mode 100644 index 00000000000..6fe808c26a7 --- /dev/null +++ b/packages/compiler/src/yaml/types.ts @@ -0,0 +1,14 @@ +import { Document } from "yaml"; +import { SourceFile } from "../core/types.js"; + +export interface YamlScript { + readonly kind: "yaml-script"; + readonly file: SourceFile; + /** Value of the yaml script. */ + readonly value: unknown; + + /** @internal yaml library document. We do not expose this as the "yaml" library is not part of the contract. */ + readonly doc: Document.Parsed; +} + +export type YamlDiagnosticTargetType = "value" | "key"; diff --git a/packages/compiler/test/cli.test.ts b/packages/compiler/test/cli.test.ts index 126334cf344..69569fccdd9 100644 --- a/packages/compiler/test/cli.test.ts +++ b/packages/compiler/test/cli.test.ts @@ -1,5 +1,5 @@ import { deepStrictEqual, strictEqual } from "assert"; -import { dump } from "js-yaml"; +import { stringify } from "yaml"; import { TypeSpecRawConfig } from "../src/config/types.js"; import { CompileCliArgs, getCompilerOptions } from "../src/core/cli/actions/compile/args.js"; import { CompilerOptions } from "../src/core/options.js"; @@ -55,7 +55,7 @@ describe("compiler: cli", () => { beforeEach(() => { host.addTypeSpecFile( "ws/tspconfig.yaml", - dump({ + stringify({ parameters: { "custom-arg": { default: "/default-arg-value", @@ -156,7 +156,7 @@ describe("compiler: cli", () => { it("emit diagnostic if using relative path in config paths", async () => { host.addTypeSpecFile( "ws/tspconfig.yaml", - dump({ + stringify({ "output-dir": "./my-output", }) ); @@ -182,7 +182,7 @@ describe("compiler: cli", () => { args?: CompileCliArgs; config?: TypeSpecRawConfig; }) { - host.addTypeSpecFile("ws/tspconfig.yaml", dump(config ?? {})); + host.addTypeSpecFile("ws/tspconfig.yaml", stringify(config ?? {})); return (await resolveCompilerOptions(args ?? {})) ?? {}; } diff --git a/packages/compiler/test/config/config.test.ts b/packages/compiler/test/config/config.test.ts index b15633ab9ce..49e0b16ad29 100644 --- a/packages/compiler/test/config/config.test.ts +++ b/packages/compiler/test/config/config.test.ts @@ -21,7 +21,7 @@ describe("compiler: config file loading", () => { errorIfNotFound: boolean = true ) => { const fullPath = join(scenarioRoot, path); - const { filename, projectRoot, ...config } = await loadTypeSpecConfigForPath( + const { filename, projectRoot, file, ...config } = await loadTypeSpecConfigForPath( NodeHost, fullPath, errorIfNotFound, diff --git a/packages/compiler/test/yaml/diagnostics.test.ts b/packages/compiler/test/yaml/diagnostics.test.ts new file mode 100644 index 00000000000..be500486445 --- /dev/null +++ b/packages/compiler/test/yaml/diagnostics.test.ts @@ -0,0 +1,83 @@ +import { strictEqual } from "assert"; +import { expectDiagnosticEmpty } from "../../src/testing/expect.js"; +import { extractCursor } from "../../src/testing/test-server-host.js"; +import { getLocationInYamlScript } from "../../src/yaml/diagnostics.js"; +import { parseYaml } from "../../src/yaml/parser.js"; + +describe("compiler: yaml: diagnostics", () => { + function parseValidYaml(code: string) { + const [yamlScript, diagnostics] = parseYaml(code); + expectDiagnosticEmpty(diagnostics); + return yamlScript; + } + + function findRightLocation(code: string, path: string[]) { + const { pos, source } = extractCursor(code); + const yamlScript = parseValidYaml(source); + const location = getLocationInYamlScript(yamlScript, path); + strictEqual(location.pos, pos); + } + + function itFindKeyAndValueLocation(code: string, path: string[]) { + const { pos: keyPos, source: sourceWithoutKeyCursor } = extractCursor(code, "┆K┆"); + const { pos: valuePos, source } = extractCursor(sourceWithoutKeyCursor, "┆V┆"); + + it("value", () => { + const yamlScript = parseValidYaml(source); + const valueLocation = getLocationInYamlScript(yamlScript, path, "value"); + strictEqual(valueLocation.pos, valuePos); + }); + + it("key", () => { + const yamlScript = parseValidYaml(source); + const keyLocation = getLocationInYamlScript(yamlScript, path, "key"); + strictEqual(keyLocation.pos, keyPos); + }); + } + + describe("property at root", () => + itFindKeyAndValueLocation( + ` + one: abc + ┆K┆two: ┆V┆def + three: ghi + `, + ["two"] + )); + + describe("property at in nested object", () => + itFindKeyAndValueLocation( + ` + root: true + nested: + more: + one: abc + ┆K┆two: ┆V┆def + three: ghi + `, + ["nested", "more", "two"] + )); + + describe("property under array", () => + itFindKeyAndValueLocation( + ` + items: + - name: abc + - one: abc + ┆K┆two: ┆V┆def + three: ghi + `, + ["items", "1", "two"] + )); + + it("array item", () => + findRightLocation( + ` + items: + - name: abc + - ┆one: abc + three: ghi + `, + ["items", "1"] + )); +}); diff --git a/packages/compiler/test/yaml/parser.test.ts b/packages/compiler/test/yaml/parser.test.ts new file mode 100644 index 00000000000..26e35a12df9 --- /dev/null +++ b/packages/compiler/test/yaml/parser.test.ts @@ -0,0 +1,28 @@ +import { deepStrictEqual } from "assert"; +import { expectDiagnosticEmpty, expectDiagnostics } from "../../src/testing/expect.js"; +import { extractCursor } from "../../src/testing/test-server-host.js"; +import { parseYaml } from "../../src/yaml/parser.js"; + +describe("compiler: yaml: parser", () => { + it("parse yaml", () => { + const [yamlScript, diagnostics] = parseYaml(` + foo: 123 + bar: 456 + `); + expectDiagnosticEmpty(diagnostics); + deepStrictEqual(yamlScript.value, { foo: 123, bar: 456 }); + }); + + it("report errors as diagnostics", () => { + const { pos, source } = extractCursor(` + foo: 123 + ┆foo: 456 + `); + const [_, diagnostics] = parseYaml(source); + expectDiagnostics(diagnostics, { + code: "yaml-duplicate-key", + message: "Map keys must be unique", + pos, + }); + }); +}); diff --git a/packages/json-schema/package.json b/packages/json-schema/package.json index 2e9c666c8dc..d96e05a74f6 100644 --- a/packages/json-schema/package.json +++ b/packages/json-schema/package.json @@ -61,12 +61,10 @@ "rimraf": "~5.0.1", "typescript": "~5.1.3", "ajv": "~8.12.0", - "@types/js-yaml": "~4.0.1", "@typespec/internal-build-utils": "workspace:~0.47.0", - "js-yaml": "~4.1.0", "ajv-formats": "~2.1.1" }, "dependencies": { - "js-yaml": "~4.1.0" + "yaml": "~2.3.1" } } diff --git a/packages/json-schema/src/json-schema-emitter.ts b/packages/json-schema/src/json-schema-emitter.ts index a9fabc76371..acd91c23fb8 100644 --- a/packages/json-schema/src/json-schema-emitter.ts +++ b/packages/json-schema/src/json-schema-emitter.ts @@ -44,7 +44,7 @@ import { SourceFileScope, TypeEmitter, } from "@typespec/compiler/emitter-framework"; -import yaml from "js-yaml"; +import { stringify } from "yaml"; import { findBaseUri, getContains, @@ -596,7 +596,7 @@ export class JsonSchemaEmitter extends TypeEmitter, JSONSche if (this.emitter.getOptions()["file-type"] === "json") { serializedContent = JSON.stringify(content, null, 4); } else { - serializedContent = yaml.dump(content); + serializedContent = stringify(content); } return { diff --git a/packages/json-schema/test/utils.ts b/packages/json-schema/test/utils.ts index fe573f809d1..d2a1d36c183 100644 --- a/packages/json-schema/test/utils.ts +++ b/packages/json-schema/test/utils.ts @@ -1,6 +1,6 @@ import { createAssetEmitter } from "@typespec/compiler/emitter-framework"; import { createTestHost } from "@typespec/compiler/testing"; -import yaml from "js-yaml"; +import { parse } from "yaml"; import { JsonSchemaEmitter } from "../src/json-schema-emitter.js"; import { JSONSchemaEmitterOptions } from "../src/lib.js"; import { JsonSchemaTestLibrary } from "../src/testing/index.js"; @@ -52,7 +52,7 @@ export async function emitSchema( for (const file of files) { const sf = await emitter.getProgram().host.readFile(`./cadl-output/${file}`); if (options?.["file-type"] === "yaml") { - schemas[file] = yaml.load(sf.text); + schemas[file] = parse(sf.text); } else { schemas[file] = JSON.parse(sf.text); } diff --git a/packages/migrate/package.json b/packages/migrate/package.json index 81a78626d69..ba83f8959df 100644 --- a/packages/migrate/package.json +++ b/packages/migrate/package.json @@ -48,12 +48,11 @@ "prettier": "~3.0.1", "semver": "^7.3.8", "yargs": "~17.7.1", - "js-yaml": "~4.1.0" + "yaml": "~2.3.1" }, "devDependencies": { "@types/mocha": "~10.0.1", "@types/node": "~18.11.9", - "@types/js-yaml": "~4.0.1", "@types/semver": "^7.3.13", "@types/yargs": "~17.0.24", "@typespec/compiler": "workspace:~0.47.1", diff --git a/packages/migrate/src/migrations/v0.41/typespec-rename.ts b/packages/migrate/src/migrations/v0.41/typespec-rename.ts index 009e66beb9c..732aff1b638 100644 --- a/packages/migrate/src/migrations/v0.41/typespec-rename.ts +++ b/packages/migrate/src/migrations/v0.41/typespec-rename.ts @@ -1,8 +1,8 @@ import type { Node, TypeSpecScriptNode } from "@typespec/compiler"; import { NodePackage, getAnyExtensionFromPath } from "@typespec/compiler"; import { readFile } from "fs/promises"; -import * as yaml from "js-yaml"; import * as path from "path"; +import * as yaml from "yaml"; import type { TypeSpecCompilerV0_40 } from "../../migration-config.js"; import { AstContentMigrateAction, @@ -221,7 +221,7 @@ export const migrateTspConfigFile = createFileContentMigration({ // load data & convert to new format if needed to let tspConfig: any; try { - tspConfig = yaml.load(content); + tspConfig = yaml.parse(content); // if config has older deprecated emitters format, convert to new format if (tspConfig?.emitters !== undefined) { (tspConfig as { emit: Array }).emit = []; @@ -239,7 +239,7 @@ export const migrateTspConfigFile = createFileContentMigration({ tspConfig.emitters = undefined; if (tspConfig.options.length === 0) tspConfig.options = undefined; - content = yaml.dump(tspConfig); + content = yaml.stringify(tspConfig); } } catch (err) { console.warn( diff --git a/packages/openapi3/package.json b/packages/openapi3/package.json index 533ea1d7b39..630da2b910c 100644 --- a/packages/openapi3/package.json +++ b/packages/openapi3/package.json @@ -53,7 +53,7 @@ "!dist/test/**" ], "dependencies": { - "js-yaml": "~4.1.0" + "yaml": "~2.3.1" }, "peerDependencies": { "@typespec/versioning": "workspace:~0.47.0", @@ -65,7 +65,6 @@ "devDependencies": { "@types/mocha": "~10.0.1", "@types/node": "~18.11.9", - "@types/js-yaml": "~4.0.1", "@typespec/compiler": "workspace:~0.47.1", "@typespec/http": "workspace:~0.47.0", "@typespec/rest": "workspace:~0.47.0", diff --git a/packages/openapi3/src/openapi.ts b/packages/openapi3/src/openapi.ts index c0de56b174f..e66338dbdd8 100644 --- a/packages/openapi3/src/openapi.ts +++ b/packages/openapi3/src/openapi.ts @@ -96,7 +96,7 @@ import { shouldInline, } from "@typespec/openapi"; import { buildVersionProjections } from "@typespec/versioning"; -import yaml from "js-yaml"; +import { stringify } from "yaml"; import { getOneOf, getRef } from "./decorators.js"; import { FileType, OpenAPI3EmitterOptions, reportDiagnostic } from "./lib.js"; import { @@ -1985,12 +1985,16 @@ function serializeDocument(root: OpenAPI3Document, fileType: FileType): string { case "json": return prettierOutput(JSON.stringify(root, null, 2)); case "yaml": - return yaml.dump(root, { - noRefs: true, - replacer: function (key, value) { + return stringify( + root, + (key, value) => { return value instanceof Ref ? value.toJSON() : value; }, - }); + { + singleQuote: true, + aliasDuplicateObjects: false, + } + ); } } diff --git a/packages/openapi3/test/output-file.test.ts b/packages/openapi3/test/output-file.test.ts index 3bac2f1e3a2..184ae1ca6e6 100644 --- a/packages/openapi3/test/output-file.test.ts +++ b/packages/openapi3/test/output-file.test.ts @@ -27,7 +27,7 @@ describe("openapi3: output file", () => { `openapi: 3.0.0`, `info:`, ` title: (title)`, - ` version: '0000-00-00'`, + ` version: 0000-00-00`, `tags: []`, `paths: {}`, `components: {}`, diff --git a/packages/prettier-plugin-typespec/rollup.config.mjs b/packages/prettier-plugin-typespec/rollup.config.mjs index e7ed0d41620..4184dc6eeb8 100644 --- a/packages/prettier-plugin-typespec/rollup.config.mjs +++ b/packages/prettier-plugin-typespec/rollup.config.mjs @@ -19,7 +19,7 @@ export default defineConfig({ treeshake: { // Ignore those 2 modules are they aren't used in the code needed for the formatter. // Otherwise rollup think they have side effect and to include a lot of unnecessary code in the bundle. - moduleSideEffects: ["ajv", "js-yaml"], + moduleSideEffects: ["ajv"], }, plugins: [ resolve({ preferBuiltins: true }), diff --git a/packages/samples/test/output/authentication/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/authentication/@typespec/openapi3/openapi.yaml index 2297a3a99a6..57801aa9198 100644 --- a/packages/samples/test/output/authentication/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/authentication/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Authenticated service - version: '0000-00-00' + version: 0000-00-00 tags: [] paths: /: diff --git a/packages/samples/test/output/binary/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/binary/@typespec/openapi3/openapi.yaml index 7d8648646eb..966fdf2643d 100644 --- a/packages/samples/test/output/binary/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/binary/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Binary sample - version: '0000-00-00' + version: 0000-00-00 tags: [] paths: /test/base64: diff --git a/packages/samples/test/output/documentation/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/documentation/@typespec/openapi3/openapi.yaml index 3da2182ac63..a73c751441f 100644 --- a/packages/samples/test/output/documentation/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/documentation/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Documentaion sample - version: '0000-00-00' + version: 0000-00-00 tags: [] paths: /foo/DefaultDescriptions: diff --git a/packages/samples/test/output/encoding/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/encoding/@typespec/openapi3/openapi.yaml index 4b4e0689b11..a611be2361b 100644 --- a/packages/samples/test/output/encoding/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/encoding/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: (title) - version: '0000-00-00' + version: 0000-00-00 tags: [] paths: /: diff --git a/packages/samples/test/output/grpc-kiosk-example/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/grpc-kiosk-example/@typespec/openapi3/openapi.yaml index 560d3ef752c..3a452c973ed 100644 --- a/packages/samples/test/output/grpc-kiosk-example/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/grpc-kiosk-example/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Grpc Kiosk sample - version: '0000-00-00' + version: 0000-00-00 tags: - name: Display paths: @@ -50,7 +50,7 @@ paths: application/json: schema: $ref: '#/components/schemas/RpcStatus' - /v1/kiosks/{id}: + '/v1/kiosks/{id}': get: tags: - Display @@ -90,16 +90,15 @@ paths: format: int32 responses: '204': - description: >- - There is no content to send for this request, but the headers may be - useful. + description: 'There is no content to send for this request, but the headers may + be useful. ' default: description: An unexpected error response. content: application/json: schema: $ref: '#/components/schemas/RpcStatus' - /v1/kiosks/{kiosk_id}/sign: + '/v1/kiosks/{kiosk_id}/sign': get: tags: - Display @@ -164,7 +163,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ListSignsResponse' - /v1/signs/{id}: + '/v1/signs/{id}': get: tags: - Display @@ -204,16 +203,15 @@ paths: format: int32 responses: '204': - description: >- - There is no content to send for this request, but the headers may be - useful. + description: 'There is no content to send for this request, but the headers may + be useful. ' default: description: An unexpected error response. content: application/json: schema: $ref: '#/components/schemas/RpcStatus' - /v1/signs/{sign_id}: + '/v1/signs/{sign_id}': post: tags: - Display @@ -223,9 +221,8 @@ paths: - $ref: '#/components/parameters/SetSignIdForKioskIdsRequest.sign_id' responses: '204': - description: >- - There is no content to send for this request, but the headers may be - useful. + description: 'There is no content to send for this request, but the headers may + be useful. ' default: description: An unexpected error response. content: @@ -297,8 +294,7 @@ components: An object that represents a latitude/longitude pair. This is expressed as a - pair of doubles to represent degrees latitude and degrees longitude. - Unless + pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this must conform to the diff --git a/packages/samples/test/output/grpc-library-example/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/grpc-library-example/@typespec/openapi3/openapi.yaml index f70be4910ec..1cf2eedb474 100644 --- a/packages/samples/test/output/grpc-library-example/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/grpc-library-example/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Grpc Library sample - version: '0000-00-00' + version: 0000-00-00 tags: - name: LibraryService paths: @@ -55,7 +55,7 @@ paths: application/json: schema: $ref: '#/components/schemas/RpcStatus' - /v1/shelves/shelf_name/books/{name}: + '/v1/shelves/shelf_name/books/{name}': get: tags: - LibraryService @@ -85,16 +85,15 @@ paths: - $ref: '#/components/parameters/DeleteBookRequest' responses: '204': - description: >- - There is no content to send for this request, but the headers may be - useful. + description: 'There is no content to send for this request, but the headers may + be useful. ' default: description: An unexpected error response. content: application/json: schema: $ref: '#/components/schemas/RpcStatus' - /v1/shelves/{name}: + '/v1/shelves/{name}': get: tags: - LibraryService @@ -124,16 +123,15 @@ paths: - $ref: '#/components/parameters/DeleteShelfRequest' responses: '204': - description: >- - There is no content to send for this request, but the headers may be - useful. + description: 'There is no content to send for this request, but the headers may + be useful. ' default: description: An unexpected error response. content: application/json: schema: $ref: '#/components/schemas/RpcStatus' - /v1/shelves/{name}/books: + '/v1/shelves/{name}/books': post: tags: - LibraryService @@ -189,7 +187,7 @@ paths: application/json: schema: $ref: '#/components/schemas/RpcStatus' - /v1/shelves/{name}:merge: + '/v1/shelves/{name}:merge': post: tags: - LibraryService @@ -201,8 +199,7 @@ paths: `other_shelf_name`. Returns the updated shelf. - The book ids of the moved books may not be the same as the original - books. + The book ids of the moved books may not be the same as the original books. Returns NOT_FOUND if either shelf does not exist. @@ -367,8 +364,7 @@ components: [ListShelvesRequest.page_token][google.example.library.v1.ListShelvesRequest.page_token] - field in the subsequent call to `ListShelves` method to retrieve the - next + field in the subsequent call to `ListShelves` method to retrieve the next page of results. ListResponseBase: @@ -383,8 +379,7 @@ components: [ListShelvesRequest.page_token][google.example.library.v1.ListShelvesRequest.page_token] - field in the subsequent call to `ListShelves` method to retrieve the - next + field in the subsequent call to `ListShelves` method to retrieve the next page of results. ListShelvesResponse: @@ -407,8 +402,7 @@ components: [ListShelvesRequest.page_token][google.example.library.v1.ListShelvesRequest.page_token] - field in the subsequent call to `ListShelves` method to retrieve the - next + field in the subsequent call to `ListShelves` method to retrieve the next page of results. MoveBookRequest: diff --git a/packages/samples/test/output/multiple-types-union/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/multiple-types-union/@typespec/openapi3/openapi.yaml index 4b752733585..b4e8e74173b 100644 --- a/packages/samples/test/output/multiple-types-union/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/multiple-types-union/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Pet Store Service - version: '2021-03-25' + version: 2021-03-25 tags: [] paths: /: diff --git a/packages/samples/test/output/nested/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/nested/@typespec/openapi3/openapi.yaml index 54538a99c44..72d8c341250 100644 --- a/packages/samples/test/output/nested/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/nested/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Nested sample - version: '0000-00-00' + version: 0000-00-00 tags: [] paths: /: diff --git a/packages/samples/test/output/nullable/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/nullable/@typespec/openapi3/openapi.yaml index 241f33009b8..090b3b29618 100644 --- a/packages/samples/test/output/nullable/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/nullable/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Nullable sample - version: '0000-00-00' + version: 0000-00-00 tags: [] paths: /test: diff --git a/packages/samples/test/output/openapi-extensions/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/openapi-extensions/@typespec/openapi3/openapi.yaml index af69c1b09f4..fdf859a3ff2 100644 --- a/packages/samples/test/output/openapi-extensions/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/openapi-extensions/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: (title) - version: '0000-00-00' + version: 0000-00-00 tags: [] paths: /: diff --git a/packages/samples/test/output/optional/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/optional/@typespec/openapi3/openapi.yaml index 717c4fce22f..8fa818f0e0e 100644 --- a/packages/samples/test/output/optional/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/optional/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Optional sample - version: '0000-00-00' + version: 0000-00-00 tags: [] paths: /test: diff --git a/packages/samples/test/output/param-decorators/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/param-decorators/@typespec/openapi3/openapi.yaml index e10b6389bb2..6b01c1897f7 100644 --- a/packages/samples/test/output/param-decorators/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/param-decorators/@typespec/openapi3/openapi.yaml @@ -1,10 +1,10 @@ openapi: 3.0.0 info: title: Parameter Decorators - version: '0000-00-00' + version: 0000-00-00 tags: [] paths: - /thing/{name}: + '/thing/{name}': get: operationId: Operations_getThing parameters: diff --git a/packages/samples/test/output/petstore/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/petstore/@typespec/openapi3/openapi.yaml index c864f04cdc6..d08486f3fb4 100644 --- a/packages/samples/test/output/petstore/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/petstore/@typespec/openapi3/openapi.yaml @@ -1,12 +1,11 @@ openapi: 3.0.0 info: title: Pet Store Service - version: '2021-03-25' - description: >- - This is a sample server Petstore server. You can find out more about - Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, - #swagger](http://swagger.io/irc/). For this sample, you can use the api key - `special-key` to test the authorization filters. + version: 2021-03-25 + description: 'This is a sample server Petstore server. You can find out more + about Swagger at [http://swagger.io](http://swagger.io) or on + [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you + can use the api key `special-key` to test the authorization filters.' tags: [] paths: /pets: @@ -54,7 +53,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Pet' - /pets/{petId}: + '/pets/{petId}': delete: operationId: Pets_delete description: Delete a pet. @@ -82,8 +81,7 @@ paths: schema: $ref: '#/components/schemas/Pet' '304': - description: >- - The client has made a conditional request and the resource has not + description: The client has made a conditional request and the resource has not been modified. content: application/json: @@ -95,7 +93,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - /pets/{petId}/toys: + '/pets/{petId}/toys': get: operationId: ListPetToysResponse_list parameters: diff --git a/packages/samples/test/output/polymorphism/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/polymorphism/@typespec/openapi3/openapi.yaml index 5eb9d6aa363..cd1b0203aab 100644 --- a/packages/samples/test/output/polymorphism/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/polymorphism/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Polymorphism sample - version: '0000-00-00' + version: 0000-00-00 tags: [] paths: /Pets: diff --git a/packages/samples/test/output/projected-names/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/projected-names/@typespec/openapi3/openapi.yaml index ff234d3d7e0..d5073cf8f20 100644 --- a/packages/samples/test/output/projected-names/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/projected-names/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Sample showcasing projected names - version: '0000-00-00' + version: 0000-00-00 tags: [] paths: /: diff --git a/packages/samples/test/output/rest/petstore/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/rest/petstore/@typespec/openapi3/openapi.yaml index 4bd595728ad..c711181a4a9 100644 --- a/packages/samples/test/output/rest/petstore/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/rest/petstore/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Pet Store Service - version: '2021-03-25' + version: 2021-03-25 tags: [] paths: /checkups: @@ -22,7 +22,7 @@ paths: application/json: schema: $ref: '#/components/schemas/PetStoreError' - /checkups/{checkupId}: + '/checkups/{checkupId}': patch: operationId: Checkups_createOrUpdate description: Creates or update an instance of the resource. @@ -100,7 +100,7 @@ paths: application/json: schema: $ref: '#/components/schemas/PetStoreError' - /owners/{ownerId}: + '/owners/{ownerId}': get: operationId: Owners_get description: Gets an instance of the resource. @@ -157,7 +157,7 @@ paths: application/json: schema: $ref: '#/components/schemas/PetStoreError' - /owners/{ownerId}/checkups: + '/owners/{ownerId}/checkups': get: operationId: OwnerCheckups_list description: Lists all instances of the extension resource. @@ -176,7 +176,7 @@ paths: application/json: schema: $ref: '#/components/schemas/PetStoreError' - /owners/{ownerId}/checkups/{checkupId}: + '/owners/{ownerId}/checkups/{checkupId}': patch: operationId: OwnerCheckups_createOrUpdate description: Creates or update an instance of the extension resource. @@ -208,7 +208,7 @@ paths: application/json: schema: $ref: '#/components/schemas/CheckupUpdate' - /owners/{ownerId}/insurance: + '/owners/{ownerId}/insurance': get: operationId: OwnerInsurance_get description: Gets the singleton resource. @@ -298,7 +298,7 @@ paths: application/json: schema: $ref: '#/components/schemas/PetStoreError' - /pets/{petId}: + '/pets/{petId}': get: operationId: Pets_get description: Gets an instance of the resource. @@ -355,7 +355,7 @@ paths: application/json: schema: $ref: '#/components/schemas/PetStoreError' - /pets/{petId}/checkups: + '/pets/{petId}/checkups': get: operationId: PetCheckups_list description: Lists all instances of the extension resource. @@ -374,7 +374,7 @@ paths: application/json: schema: $ref: '#/components/schemas/PetStoreError' - /pets/{petId}/checkups/{checkupId}: + '/pets/{petId}/checkups/{checkupId}': patch: operationId: PetCheckups_createOrUpdate description: Creates or update an instance of the extension resource. @@ -406,7 +406,7 @@ paths: application/json: schema: $ref: '#/components/schemas/CheckupUpdate' - /pets/{petId}/insurance: + '/pets/{petId}/insurance': get: operationId: PetInsurance_get description: Gets the singleton resource. @@ -449,7 +449,7 @@ paths: application/json: schema: $ref: '#/components/schemas/InsuranceUpdate' - /pets/{petId}/toys: + '/pets/{petId}/toys': get: operationId: Toys_list parameters: @@ -472,7 +472,7 @@ paths: application/json: schema: $ref: '#/components/schemas/PetStoreError' - /pets/{petId}/toys/{toyId}: + '/pets/{petId}/toys/{toyId}': get: operationId: Toys_get description: Gets an instance of the resource. @@ -492,7 +492,7 @@ paths: application/json: schema: $ref: '#/components/schemas/PetStoreError' - /pets/{petId}/toys/{toyId}/insurance: + '/pets/{petId}/toys/{toyId}/insurance': get: operationId: ToyInsurance_get description: Gets the singleton resource. diff --git a/packages/samples/test/output/signatures/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/signatures/@typespec/openapi3/openapi.yaml index 9d2bff3136b..343669429c0 100644 --- a/packages/samples/test/output/signatures/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/signatures/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: (title) - version: '0000-00-00' + version: 0000-00-00 tags: [] paths: /accountProfiles: @@ -28,7 +28,7 @@ paths: application/json: schema: $ref: '#/components/schemas/AccountProfile' - /accountProfiles/{name}: + '/accountProfiles/{name}': get: operationId: AccountProfiles_get description: Reads an instance of the AccountProfile resource. @@ -75,7 +75,7 @@ paths: application/json: schema: $ref: '#/components/schemas/CodeSignAccount' - /codeSignAccounts/{name}: + '/codeSignAccounts/{name}': get: operationId: CodeSignAccounts_get description: Reads an instance of the CodeSignAccount resource. diff --git a/packages/samples/test/output/simple/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/simple/@typespec/openapi3/openapi.yaml index 15512b5a75e..d73bca8270f 100644 --- a/packages/samples/test/output/simple/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/simple/@typespec/openapi3/openapi.yaml @@ -1,10 +1,10 @@ openapi: 3.0.0 info: title: (title) - version: '0000-00-00' + version: 0000-00-00 tags: [] paths: - /alpha/{id}: + '/alpha/{id}': get: operationId: doAlpha parameters: @@ -20,7 +20,7 @@ paths: application/json: schema: type: string - /beta/{id}: + '/beta/{id}': get: operationId: doBeta parameters: diff --git a/packages/samples/test/output/tags/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/tags/@typespec/openapi3/openapi.yaml index b0737f8a862..6a4a1a93683 100644 --- a/packages/samples/test/output/tags/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/tags/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Tags sample - version: '0000-00-00' + version: 0000-00-00 tags: - name: foo - name: tag1 @@ -26,7 +26,7 @@ paths: type: array items: $ref: '#/components/schemas/Resp' - /bar/{id}: + '/bar/{id}': post: tags: - tag3 @@ -41,10 +41,9 @@ paths: format: int32 responses: '204': - description: >- - There is no content to send for this request, but the headers may be - useful. - /foo/{id}: + description: 'There is no content to send for this request, but the headers may + be useful. ' + '/foo/{id}': get: tags: - foo @@ -60,9 +59,8 @@ paths: format: int32 responses: '204': - description: >- - There is no content to send for this request, but the headers may be - useful. + description: 'There is no content to send for this request, but the headers may + be useful. ' post: tags: - foo @@ -79,10 +77,9 @@ paths: format: int32 responses: '204': - description: >- - There is no content to send for this request, but the headers may be - useful. - /nested/{id}: + description: 'There is no content to send for this request, but the headers may + be useful. ' + '/nested/{id}': post: tags: - outer @@ -99,9 +96,8 @@ paths: format: int32 responses: '204': - description: >- - There is no content to send for this request, but the headers may be - useful. + description: 'There is no content to send for this request, but the headers may + be useful. ' components: schemas: Resp: diff --git a/packages/samples/test/output/testserver/body-boolean/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/testserver/body-boolean/@typespec/openapi3/openapi.yaml index 7e2527ad501..94ac8a91462 100644 --- a/packages/samples/test/output/testserver/body-boolean/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/testserver/body-boolean/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: sample - version: '0000-00-00' + version: 0000-00-00 tags: [] paths: /bool/false: diff --git a/packages/samples/test/output/testserver/body-complex/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/testserver/body-complex/@typespec/openapi3/openapi.yaml index b1fb8673ea6..8f2531e8381 100644 --- a/packages/samples/test/output/testserver/body-complex/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/testserver/body-complex/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: sample - version: '0000-00-00' + version: 0000-00-00 tags: [] paths: /complex/array/valid: @@ -44,7 +44,7 @@ paths: /complex/basic/valid: get: operationId: Complex_getValid - description: 'Get complex type {id: 2, name: ''abc'', color: ''YELLOW''}' + description: "Get complex type {id: 2, name: 'abc', color: 'YELLOW'}" parameters: [] responses: '200': @@ -61,7 +61,7 @@ paths: $ref: '#/components/schemas/Error' put: operationId: Complex_putValid - description: 'Please put {id: 2, name: ''abc'', color: ''Magenta''}' + description: "Please put {id: 2, name: 'abc', color: 'Magenta'}" parameters: [] responses: '200': @@ -510,8 +510,7 @@ components: description: Basic Id name: type: string - description: >- - Name property with a very long description that does not fit on a + description: Name property with a very long description that does not fit on a single line and a line break. color: $ref: '#/components/schemas/CMYKColors' @@ -565,8 +564,7 @@ components: type: object required: - field1 - - >- - field_56_zeros_after_the_dot_and_negative_zero_before_dot_and_this_is_a_long_field_name_on_purpose + - field_56_zeros_after_the_dot_and_negative_zero_before_dot_and_this_is_a_long_field_name_on_purpose properties: field1: type: number diff --git a/packages/samples/test/output/testserver/body-string/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/testserver/body-string/@typespec/openapi3/openapi.yaml index 440a8edc1b2..dd01c032615 100644 --- a/packages/samples/test/output/testserver/body-string/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/testserver/body-string/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: sample - version: '0000-00-00' + version: 0000-00-00 tags: - name: String Operations paths: @@ -180,8 +180,7 @@ paths: tags: - String Operations operationId: String_getMbcs - description: >- - Get mbcs string value + description: Get mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€' parameters: [] responses: @@ -192,8 +191,7 @@ paths: schema: type: string enum: - - >- - 啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ + - 啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ default: description: An unexpected error response. content: @@ -204,8 +202,7 @@ paths: tags: - String Operations operationId: String_putMbCs - description: >- - Put mbcs string value + description: Put mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€' parameters: [] responses: @@ -224,8 +221,7 @@ paths: schema: type: string enum: - - >- - 啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ + - 啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ /string/null: get: tags: @@ -274,8 +270,7 @@ paths: tags: - String Operations operationId: String_getWhitespace - description: >- - Get string value with leading and trailing whitespace + description: Get string value with leading and trailing whitespace 'Now is the time for all good men to come to the aid of their country' parameters: [] @@ -287,7 +282,8 @@ paths: schema: type: string enum: - - ' Now is the time for all good men to come to the aid of their country ' + - ' Now is the time for all good men to come to the aid of + their country ' default: description: An unexpected error response. content: @@ -298,8 +294,7 @@ paths: tags: - String Operations operationId: String_putWhitespace - description: >- - Get string value with leading and trailing whitespace + description: Get string value with leading and trailing whitespace 'Now is the time for all good men to come to the aid of their country' parameters: [] @@ -319,7 +314,8 @@ paths: schema: type: string enum: - - ' Now is the time for all good men to come to the aid of their country ' + - ' Now is the time for all good men to come to the aid of + their country ' components: schemas: Colors: diff --git a/packages/samples/test/output/testserver/body-time/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/testserver/body-time/@typespec/openapi3/openapi.yaml index 03440bbd82c..816a017bd35 100644 --- a/packages/samples/test/output/testserver/body-time/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/testserver/body-time/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: sample - version: '0000-00-00' + version: 0000-00-00 tags: [] paths: /time: diff --git a/packages/samples/test/output/testserver/media-types/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/testserver/media-types/@typespec/openapi3/openapi.yaml index 23349b22be1..84c926f922b 100644 --- a/packages/samples/test/output/testserver/media-types/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/testserver/media-types/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: sample - version: '0000-00-00' + version: 0000-00-00 tags: [] paths: /mediatypes/analyze: @@ -38,9 +38,8 @@ paths: /mediatypes/contentTypeWithEncoding: post: operationId: contentTypeWithEncoding - description: >- - Pass in contentType 'text/plain; encoding=UTF-8' to pass test. Value for - input does not matter + description: Pass in contentType 'text/plain; encoding=UTF-8' to pass test. + Value for input does not matter parameters: [] responses: '200': diff --git a/packages/samples/test/output/testserver/multiple-inheritance/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/testserver/multiple-inheritance/@typespec/openapi3/openapi.yaml index a29bc562b0d..427e82790e6 100644 --- a/packages/samples/test/output/testserver/multiple-inheritance/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/testserver/multiple-inheritance/@typespec/openapi3/openapi.yaml @@ -1,15 +1,13 @@ openapi: 3.0.0 info: title: sample - version: '0000-00-00' + version: 0000-00-00 tags: [] paths: /multipleInheritance/cat: get: operationId: MultipleInheritance_getCat - description: >- - Get a cat with name 'Whiskers' where likesMilk, meows, and hisses is - true + description: Get a cat with name 'Whiskers' where likesMilk, meows, and hisses is true parameters: [] responses: '200': @@ -26,9 +24,8 @@ paths: type: string put: operationId: MultipleInheritance_putCat - description: >- - Put a cat with name 'Boots' where likesMilk and hisses is false, meows - is true + description: Put a cat with name 'Boots' where likesMilk and hisses is false, + meows is true parameters: [] responses: '200': @@ -134,9 +131,8 @@ paths: /multipleInheritance/kitten: get: operationId: MultipleInheritance_getKitten - description: >- - Get a kitten with name 'Gatito' where likesMilk and meows is true, and - hisses and eatsMiceYet is false + description: Get a kitten with name 'Gatito' where likesMilk and meows is true, + and hisses and eatsMiceYet is false parameters: [] responses: '200': @@ -153,8 +149,7 @@ paths: type: string put: operationId: MultipleInheritance_putKitten - description: >- - Put a kitten with name 'Kitty' where likesMilk and hisses is false, + description: Put a kitten with name 'Kitty' where likesMilk and hisses is false, meows and eatsMiceYet is true parameters: [] responses: diff --git a/packages/samples/test/output/use-versioned-lib/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/use-versioned-lib/@typespec/openapi3/openapi.yaml index 90fff97abf1..08823945415 100644 --- a/packages/samples/test/output/use-versioned-lib/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/use-versioned-lib/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Pet Store Service - version: '0000-00-00' + version: 0000-00-00 tags: [] paths: /: diff --git a/packages/samples/test/output/visibility/@typespec/openapi3/openapi.yaml b/packages/samples/test/output/visibility/@typespec/openapi3/openapi.yaml index db45afe06fd..087993cb394 100644 --- a/packages/samples/test/output/visibility/@typespec/openapi3/openapi.yaml +++ b/packages/samples/test/output/visibility/@typespec/openapi3/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Visibility sample - version: '0000-00-00' + version: 0000-00-00 tags: [] paths: /hello: @@ -70,7 +70,7 @@ paths: application/json: schema: $ref: '#/components/schemas/PersonUpdate' - /hello/{id}: + '/hello/{id}': get: operationId: Hello_read parameters: diff --git a/packages/tspd/package.json b/packages/tspd/package.json index 7735618b024..0dd68984015 100644 --- a/packages/tspd/package.json +++ b/packages/tspd/package.json @@ -54,7 +54,7 @@ ], "dependencies": { "@typespec/compiler": "workspace:~0.47.1", - "js-yaml": "~4.1.0", + "yaml": "~2.3.1", "prettier": "~3.0.1", "picocolors": "~1.0.0", "yargs": "~17.7.1" @@ -65,7 +65,6 @@ "@typespec/prettier-plugin-typespec": "workspace:~0.47.0", "@types/mocha": "~10.0.1", "@types/node": "~18.11.9", - "@types/js-yaml": "~4.0.1", "@types/yargs": "~17.0.24", "c8": "~8.0.0", "eslint": "^8.42.0", diff --git a/packages/tspd/src/ref-doc/api-docs.ts b/packages/tspd/src/ref-doc/api-docs.ts index 4808b023176..8e338420525 100644 --- a/packages/tspd/src/ref-doc/api-docs.ts +++ b/packages/tspd/src/ref-doc/api-docs.ts @@ -1,8 +1,8 @@ import { joinPaths } from "@typespec/compiler"; import { writeFile } from "fs/promises"; -import { dump } from "js-yaml"; import { Application, DeclarationReflection, PageEvent, ReflectionKind } from "typedoc"; import { PluginOptions, load } from "typedoc-plugin-markdown"; +import { stringify } from "yaml"; export async function generateJsApiDocs(libraryPath: string, outputDir: string) { const app = new Application(); @@ -66,7 +66,7 @@ export function loadRenderer(app: Application) { } function createFrontMatter(model: DeclarationReflection) { - return ["---", dump(createFrontMatterData(model)), "---", ""].join("\n"); + return ["---", stringify(createFrontMatterData(model)), "---", ""].join("\n"); } function createFrontMatterData(model: DeclarationReflection) {