@typespec/compiler 1.14.0-dev.7 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manifest.js +2 -2
- package/dist/src/core/auto-decorator.d.ts +12 -0
- package/dist/src/core/auto-decorator.d.ts.map +1 -1
- package/dist/src/core/auto-decorator.js +16 -2
- package/dist/src/core/auto-decorator.js.map +1 -1
- package/dist/src/core/checker.d.ts.map +1 -1
- package/dist/src/core/checker.js +30 -22
- package/dist/src/core/checker.js.map +1 -1
- package/dist/src/core/cli/actions/vs.d.ts.map +1 -1
- package/dist/src/core/cli/actions/vs.js +21 -10
- package/dist/src/core/cli/actions/vs.js.map +1 -1
- package/dist/src/core/cli/actions/vscode.d.ts.map +1 -1
- package/dist/src/core/cli/actions/vscode.js +9 -4
- package/dist/src/core/cli/actions/vscode.js.map +1 -1
- package/dist/src/core/cli/cli.js +4 -4
- package/dist/src/core/cli/cli.js.map +1 -1
- package/dist/src/core/cli/download-vsix.d.ts +19 -0
- package/dist/src/core/cli/download-vsix.d.ts.map +1 -0
- package/dist/src/core/cli/download-vsix.js +76 -0
- package/dist/src/core/cli/download-vsix.js.map +1 -0
- package/dist/src/core/cli/utils.d.ts +7 -0
- package/dist/src/core/cli/utils.d.ts.map +1 -1
- package/dist/src/core/cli/utils.js +16 -0
- package/dist/src/core/cli/utils.js.map +1 -1
- package/dist/src/core/diagnostics.d.ts +3 -3
- package/dist/src/core/diagnostics.d.ts.map +1 -1
- package/dist/src/core/diagnostics.js +34 -3
- package/dist/src/core/diagnostics.js.map +1 -1
- package/dist/src/core/entrypoint-resolution.d.ts.map +1 -1
- package/dist/src/core/entrypoint-resolution.js +5 -4
- package/dist/src/core/entrypoint-resolution.js.map +1 -1
- package/dist/src/core/features.d.ts.map +1 -1
- package/dist/src/core/features.js +15 -5
- package/dist/src/core/features.js.map +1 -1
- package/dist/src/core/messages.d.ts +56 -2
- package/dist/src/core/messages.d.ts.map +1 -1
- package/dist/src/core/messages.js +18 -0
- package/dist/src/core/messages.js.map +1 -1
- package/dist/src/core/program.d.ts.map +1 -1
- package/dist/src/core/program.js +6 -1
- package/dist/src/core/program.js.map +1 -1
- package/dist/src/core/source-file.js +1 -1
- package/dist/src/core/source-file.js.map +1 -1
- package/dist/src/core/source-loader.d.ts.map +1 -1
- package/dist/src/core/source-loader.js +23 -0
- package/dist/src/core/source-loader.js.map +1 -1
- package/dist/src/core/suppression-tracking.d.ts +4 -0
- package/dist/src/core/suppression-tracking.d.ts.map +1 -1
- package/dist/src/core/suppression-tracking.js +25 -0
- package/dist/src/core/suppression-tracking.js.map +1 -1
- package/dist/src/core/types.d.ts +6 -0
- package/dist/src/core/types.d.ts.map +1 -1
- package/dist/src/core/types.js.map +1 -1
- package/dist/src/experimental/mutators.d.ts.map +1 -1
- package/dist/src/experimental/mutators.js +32 -8
- package/dist/src/experimental/mutators.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/testing/code-fix-testing.d.ts.map +1 -1
- package/dist/src/testing/code-fix-testing.js +2 -0
- package/dist/src/testing/code-fix-testing.js.map +1 -1
- package/dist/src/testing/fs.js +1 -0
- package/dist/src/testing/fs.js.map +1 -1
- package/dist/src/testing/index.d.ts +2 -1
- package/dist/src/testing/index.d.ts.map +1 -1
- package/dist/src/testing/index.js +3 -0
- package/dist/src/testing/index.js.map +1 -1
- package/dist/src/testing/rule-tester.d.ts.map +1 -1
- package/dist/src/testing/rule-tester.js +4 -1
- package/dist/src/testing/rule-tester.js.map +1 -1
- package/dist/src/testing/test-compiler-host.d.ts.map +1 -1
- package/dist/src/testing/test-compiler-host.js +5 -0
- package/dist/src/testing/test-compiler-host.js.map +1 -1
- package/dist/src/testing/test-host.d.ts +2 -2
- package/dist/src/testing/test-host.d.ts.map +1 -1
- package/dist/src/testing/test-host.js +4 -2
- package/dist/src/testing/test-host.js.map +1 -1
- package/dist/src/testing/test-utils.d.ts +6 -1
- package/dist/src/testing/test-utils.d.ts.map +1 -1
- package/dist/src/testing/test-utils.js +8 -1
- package/dist/src/testing/test-utils.js.map +1 -1
- package/dist/src/testing/tester.d.ts.map +1 -1
- package/dist/src/testing/tester.js +10 -0
- package/dist/src/testing/tester.js.map +1 -1
- package/dist/src/testing/types.d.ts +7 -0
- package/dist/src/testing/types.d.ts.map +1 -1
- package/dist/src/testing/types.js +2 -0
- package/dist/src/testing/types.js.map +1 -1
- package/package.json +6 -6
- package/templates/scaffolding.json +3 -11
- package/dist/src/core/cli/install-vsix.d.ts +0 -3
- package/dist/src/core/cli/install-vsix.d.ts.map +0 -1
- package/dist/src/core/cli/install-vsix.js +0 -41
- package/dist/src/core/cli/install-vsix.js.map +0 -1
- package/templates/__snapshots__/emitter-ts/src/testing/index.ts +0 -8
- package/templates/__snapshots__/library-ts/src/testing/index.ts +0 -8
- package/templates/emitter-ts/src/testing/index.ts.mu +0 -8
- package/templates/library-ts/src/testing/index.ts.mu +0 -8
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @deprecated Use {@link Tester} */
|
|
1
2
|
export class TestHostError extends Error {
|
|
2
3
|
code;
|
|
3
4
|
constructor(message, code) {
|
|
@@ -5,5 +6,6 @@ export class TestHostError extends Error {
|
|
|
5
6
|
this.code = code;
|
|
6
7
|
}
|
|
7
8
|
}
|
|
9
|
+
/* eslint-enable @typescript-eslint/no-deprecated */
|
|
8
10
|
// #endregion
|
|
9
11
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/testing/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/testing/types.ts"],"names":[],"mappings":"AA0RA,qCAAqC;AACrC,MAAM,OAAO,aAAc,SAAQ,KAAK;IAG7B;IAFT,YACE,OAAe,EACR,IAAuC;QAE9C,KAAK,CAAC,OAAO,CAAC,CAAC;QAFR,SAAI,GAAJ,IAAI,CAAmC;IAGhD,CAAC;CACF;AA8BD,oDAAoD;AACpD,aAAa"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/compiler",
|
|
3
|
-
"version": "1.14.0
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "TypeSpec compiler and standard library",
|
|
5
5
|
"author": "Microsoft Corporation",
|
|
6
6
|
"license": "MIT",
|
|
@@ -106,17 +106,17 @@
|
|
|
106
106
|
"@types/node": "^26.0.0",
|
|
107
107
|
"@types/semver": "^7.7.1",
|
|
108
108
|
"@types/yargs": "^17.0.35",
|
|
109
|
-
"@typespec/internal-build-utils": "^0.83.0 || >= 0.84.0-dev.0",
|
|
110
109
|
"@vitest/coverage-v8": "^4.1.3",
|
|
111
110
|
"@vitest/ui": "^4.1.3",
|
|
112
111
|
"pathe": "^2.0.3",
|
|
113
112
|
"rimraf": "^6.1.3",
|
|
114
113
|
"source-map-support": "^0.5.21",
|
|
115
|
-
"tmlanguage-generator": "^0.6.8 || >= 0.6.9-dev.8",
|
|
116
114
|
"typescript": "~6.0.2",
|
|
117
115
|
"vitest": "^4.1.3",
|
|
118
116
|
"vscode-oniguruma": "^2.0.1",
|
|
119
|
-
"vscode-textmate": "^9.3.2"
|
|
117
|
+
"vscode-textmate": "^9.3.2",
|
|
118
|
+
"@typespec/internal-build-utils": "^0.84.0",
|
|
119
|
+
"tmlanguage-generator": "^0.6.8"
|
|
120
120
|
},
|
|
121
121
|
"scripts": {
|
|
122
122
|
"clean": "rimraf ./dist ./temp",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"gen-manifest": "node scripts/generate-manifest.js",
|
|
138
138
|
"regen-nonascii": "node scripts/regen-nonascii.js",
|
|
139
139
|
"fuzz": "node dist/test/manual/fuzz.js run",
|
|
140
|
-
"lint": "
|
|
141
|
-
"lint:fix": "
|
|
140
|
+
"lint": "oxlint . --deny-warnings",
|
|
141
|
+
"lint:fix": "oxlint . --fix"
|
|
142
142
|
}
|
|
143
143
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"rest": {
|
|
3
3
|
"title": "Generic REST API",
|
|
4
4
|
"description": "Create a project representing a generic REST API service.",
|
|
5
|
-
"compilerVersion": "1.
|
|
5
|
+
"compilerVersion": "1.14.0",
|
|
6
6
|
"libraries": [
|
|
7
7
|
"@typespec/http",
|
|
8
8
|
"@typespec/rest",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"target": "library",
|
|
74
74
|
"title": "TypeSpec library",
|
|
75
75
|
"description": "Build your own TypeSpec library with custom types, decorators or linters.",
|
|
76
|
-
"compilerVersion": "1.
|
|
76
|
+
"compilerVersion": "1.14.0",
|
|
77
77
|
"libraries": [],
|
|
78
78
|
"files": [
|
|
79
79
|
{
|
|
@@ -124,10 +124,6 @@
|
|
|
124
124
|
"path": "library-ts/src/rules/no-interfaces.rule.ts",
|
|
125
125
|
"destination": "src/rules/no-interfaces.rule.ts"
|
|
126
126
|
},
|
|
127
|
-
{
|
|
128
|
-
"path": "library-ts/src/testing/index.ts.mu",
|
|
129
|
-
"destination": "src/testing/index.ts"
|
|
130
|
-
},
|
|
131
127
|
{
|
|
132
128
|
"path": "library-ts/test/decorators.test.ts.mu",
|
|
133
129
|
"destination": "test/decorators.test.ts"
|
|
@@ -150,7 +146,7 @@
|
|
|
150
146
|
"target": "library",
|
|
151
147
|
"title": "TypeSpec emitter",
|
|
152
148
|
"description": "Create a new package that emits artifacts from TypeSpec.",
|
|
153
|
-
"compilerVersion": "1.
|
|
149
|
+
"compilerVersion": "1.14.0",
|
|
154
150
|
"libraries": [],
|
|
155
151
|
"files": [
|
|
156
152
|
{
|
|
@@ -185,10 +181,6 @@
|
|
|
185
181
|
"path": "emitter-ts/src/lib.ts",
|
|
186
182
|
"destination": "src/lib.ts"
|
|
187
183
|
},
|
|
188
|
-
{
|
|
189
|
-
"path": "emitter-ts/src/testing/index.ts.mu",
|
|
190
|
-
"destination": "src/testing/index.ts"
|
|
191
|
-
},
|
|
192
184
|
{
|
|
193
185
|
"path": "emitter-ts/test/hello.test.ts",
|
|
194
186
|
"destination": "test/hello.test.ts"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"install-vsix.d.ts","sourceRoot":"","sources":["../../../../src/core/cli/install-vsix.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAG7C,wBAAsB,WAAW,CAAC,CAAC,GAAG,IAAI,EACxC,IAAI,EAAE,eAAe,EACrB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,GAClC,OAAO,CAAC,CAAC,CAAC,CA6CZ"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { mkdtemp, readdir, rm } from "fs/promises";
|
|
2
|
-
import os from "os";
|
|
3
|
-
import { compilerAssert } from "../diagnostics.js";
|
|
4
|
-
import { joinPaths } from "../path-utils.js";
|
|
5
|
-
import { run } from "./utils.js";
|
|
6
|
-
export async function installVsix(host, pkg, install) {
|
|
7
|
-
// download npm package to temporary directory
|
|
8
|
-
const temp = await mkdtemp(joinPaths(os.tmpdir(), "typespec"));
|
|
9
|
-
const npmArgs = ["install"];
|
|
10
|
-
// hide npm output unless --debug was passed to typespec
|
|
11
|
-
if (!host.debug) {
|
|
12
|
-
npmArgs.push("--silent");
|
|
13
|
-
}
|
|
14
|
-
// NOTE: Using cwd=temp with `--prefix .` instead of `--prefix ${temp}` to
|
|
15
|
-
// workaround https://github.com/npm/cli/issues/3256. It's still important
|
|
16
|
-
// to pass --prefix even though we're using cwd as otherwise, npm might
|
|
17
|
-
// find a package.json file in a parent directory and install to that
|
|
18
|
-
// directory.
|
|
19
|
-
npmArgs.push("--prefix", ".");
|
|
20
|
-
// To debug with a locally built package rather than pulling from npm,
|
|
21
|
-
// specify the full path to the packed .tgz using TYPESPEC_DEBUG_VSIX_TGZ
|
|
22
|
-
// environment variable.
|
|
23
|
-
npmArgs.push(process.env.TYPESPEC_DEBUG_VSIX_TGZ ?? pkg);
|
|
24
|
-
run(host, "npm", npmArgs, { cwd: temp });
|
|
25
|
-
// locate .vsix
|
|
26
|
-
const dir = joinPaths(temp, "node_modules", pkg);
|
|
27
|
-
const files = await readdir(dir);
|
|
28
|
-
const vsixPaths = [];
|
|
29
|
-
for (const file of files) {
|
|
30
|
-
if (file.endsWith(".vsix")) {
|
|
31
|
-
vsixPaths.push(joinPaths(dir, file));
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
compilerAssert(vsixPaths.length > 0, `Installed ${pkg} from npm, but didn't find any .vsix files in it.`);
|
|
35
|
-
// install extension
|
|
36
|
-
const result = install(vsixPaths);
|
|
37
|
-
// delete temporary directory
|
|
38
|
-
await rm(temp, { recursive: true });
|
|
39
|
-
return result;
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=install-vsix.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"install-vsix.js","sourceRoot":"","sources":["../../../../src/core/cli/install-vsix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAAqB,EACrB,GAAW,EACX,OAAmC;IAEnC,8CAA8C;IAC9C,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC;IAC/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0 @@
|
|
|
1
|
-
import { resolvePath } from "@typespec/compiler";
|
|
2
|
-
import { createTestLibrary, TypeSpecTestLibrary } from "@typespec/compiler/testing";
|
|
3
|
-
import { fileURLToPath } from "url";
|
|
4
|
-
|
|
5
|
-
export const EmitterTsTestLibrary: TypeSpecTestLibrary = createTestLibrary({
|
|
6
|
-
name: "emitter-ts",
|
|
7
|
-
packageRoot: resolvePath(fileURLToPath(import.meta.url), "../../../../"),
|
|
8
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { resolvePath } from "@typespec/compiler";
|
|
2
|
-
import { createTestLibrary, TypeSpecTestLibrary } from "@typespec/compiler/testing";
|
|
3
|
-
import { fileURLToPath } from "url";
|
|
4
|
-
|
|
5
|
-
export const LibraryTsTestLibrary: TypeSpecTestLibrary = createTestLibrary({
|
|
6
|
-
name: "library-ts",
|
|
7
|
-
packageRoot: resolvePath(fileURLToPath(import.meta.url), "../../../../"),
|
|
8
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { resolvePath } from "@typespec/compiler";
|
|
2
|
-
import { createTestLibrary, TypeSpecTestLibrary } from "@typespec/compiler/testing";
|
|
3
|
-
import { fileURLToPath } from "url";
|
|
4
|
-
|
|
5
|
-
export const {{#casing.pascalCase}}{{name}}{{/casing.pascalCase}}TestLibrary: TypeSpecTestLibrary = createTestLibrary({
|
|
6
|
-
name: "{{name}}",
|
|
7
|
-
packageRoot: resolvePath(fileURLToPath(import.meta.url), "../../../../"),
|
|
8
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { resolvePath } from "@typespec/compiler";
|
|
2
|
-
import { createTestLibrary, TypeSpecTestLibrary } from "@typespec/compiler/testing";
|
|
3
|
-
import { fileURLToPath } from "url";
|
|
4
|
-
|
|
5
|
-
export const {{#casing.pascalCase}}{{name}}{{/casing.pascalCase}}TestLibrary: TypeSpecTestLibrary = createTestLibrary({
|
|
6
|
-
name: "{{name}}",
|
|
7
|
-
packageRoot: resolvePath(fileURLToPath(import.meta.url), "../../../../"),
|
|
8
|
-
});
|