-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate playground samples and fix docs to deprecated version (#2977)
fix #1560 Json schema emitter also didn't respect the `noEmit` flag
- Loading branch information
1 parent
de6bd7b
commit abba29c
Showing
13 changed files
with
55 additions
and
7 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
.chronus/changes/validate-playground-samples-2024-2-1-22-7-17.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking | ||
changeKind: fix | ||
packages: | ||
- "@typespec/json-schema" | ||
--- | ||
|
||
Respect compiler `noEmit` flag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { NodeHost, compile, resolvePath } from "@typespec/compiler"; | ||
import { expectDiagnosticEmpty, findTestPackageRoot } from "@typespec/compiler/testing"; | ||
import { it } from "vitest"; | ||
import { TypeSpecPlaygroundConfig } from "../src/index.js"; | ||
|
||
const samples = TypeSpecPlaygroundConfig.samples; | ||
const packageRoot = await findTestPackageRoot(import.meta.url); | ||
for (const [name, sample] of Object.entries(samples)) { | ||
it(`compile ${name}`, async () => { | ||
const program = await compile(NodeHost, resolvePath(packageRoot, sample.filename), { | ||
noEmit: true, | ||
emit: [sample.preferredEmitter], | ||
}); | ||
expectDiagnosticEmpty(program.diagnostics); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { configDefaults, defineConfig, mergeConfig } from "vitest/config"; | ||
import { defaultTypeSpecVitestConfig } from "../../vitest.workspace.js"; | ||
|
||
export default mergeConfig( | ||
defaultTypeSpecVitestConfig, | ||
defineConfig({ | ||
test: { | ||
exclude: [...configDefaults.exclude, "dist-dev/**/*"], | ||
}, | ||
}) | ||
); |
1 change: 0 additions & 1 deletion
1
packages/website/static/tsp-samples/openapi3/interoperate/main.tsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
@service({ | ||
title: "Pet Store Service", | ||
version: "2021-03-25", | ||
}) | ||
namespace PetStore; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.