@typespec/compiler 1.2.0-dev.1 → 1.2.0-dev.10
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/config/config-interpolation.d.ts.map +1 -1
- package/dist/src/config/config-interpolation.js +23 -52
- package/dist/src/config/config-interpolation.js.map +1 -1
- package/dist/src/experimental/realm.d.ts +4 -4
- package/dist/src/experimental/realm.d.ts.map +1 -1
- package/dist/src/lib/visibility.d.ts.map +1 -1
- package/dist/src/lib/visibility.js +11 -0
- package/dist/src/lib/visibility.js.map +1 -1
- package/dist/src/server/client-config-provider.d.ts +24 -0
- package/dist/src/server/client-config-provider.d.ts.map +1 -0
- package/dist/src/server/client-config-provider.js +40 -0
- package/dist/src/server/client-config-provider.js.map +1 -0
- package/dist/src/server/compile-service.d.ts +3 -1
- package/dist/src/server/compile-service.d.ts.map +1 -1
- package/dist/src/server/compile-service.js +9 -1
- package/dist/src/server/compile-service.js.map +1 -1
- package/dist/src/server/server.js +6 -2
- package/dist/src/server/server.js.map +1 -1
- package/dist/src/server/serverlib.d.ts +2 -1
- package/dist/src/server/serverlib.d.ts.map +1 -1
- package/dist/src/server/serverlib.js +2 -1
- package/dist/src/server/serverlib.js.map +1 -1
- package/dist/src/testing/fourslash.d.ts +16 -0
- package/dist/src/testing/fourslash.d.ts.map +1 -0
- package/dist/src/testing/fourslash.js +17 -0
- package/dist/src/testing/fourslash.js.map +1 -0
- package/dist/src/testing/fs.d.ts +12 -0
- package/dist/src/testing/fs.d.ts.map +1 -0
- package/dist/src/testing/fs.js +133 -0
- package/dist/src/testing/fs.js.map +1 -0
- package/dist/src/testing/index.d.ts +9 -2
- package/dist/src/testing/index.d.ts.map +1 -1
- package/dist/src/testing/index.js +7 -1
- package/dist/src/testing/index.js.map +1 -1
- package/dist/src/testing/marked-template.d.ts +96 -0
- package/dist/src/testing/marked-template.d.ts.map +1 -0
- package/dist/src/testing/marked-template.js +107 -0
- package/dist/src/testing/marked-template.js.map +1 -0
- package/dist/src/testing/rule-tester.d.ts +2 -2
- package/dist/src/testing/rule-tester.d.ts.map +1 -1
- package/dist/src/testing/rule-tester.js +2 -1
- package/dist/src/testing/rule-tester.js.map +1 -1
- package/dist/src/testing/test-compiler-host.d.ts +11 -0
- package/dist/src/testing/test-compiler-host.d.ts.map +1 -0
- package/dist/src/testing/test-compiler-host.js +138 -0
- package/dist/src/testing/test-compiler-host.js.map +1 -0
- package/dist/src/testing/test-host.d.ts +3 -9
- package/dist/src/testing/test-host.d.ts.map +1 -1
- package/dist/src/testing/test-host.js +6 -218
- package/dist/src/testing/test-host.js.map +1 -1
- package/dist/src/testing/test-server-host.d.ts +1 -1
- package/dist/src/testing/test-server-host.d.ts.map +1 -1
- package/dist/src/testing/test-server-host.js +5 -2
- package/dist/src/testing/test-server-host.js.map +1 -1
- package/dist/src/testing/tester.d.ts +12 -0
- package/dist/src/testing/tester.d.ts.map +1 -0
- package/dist/src/testing/tester.js +341 -0
- package/dist/src/testing/tester.js.map +1 -0
- package/dist/src/testing/types.d.ts +146 -3
- package/dist/src/testing/types.d.ts.map +1 -1
- package/dist/src/testing/types.js +1 -0
- package/dist/src/testing/types.js.map +1 -1
- package/dist/src/typekit/kits/literal.d.ts.map +1 -1
- package/dist/src/typekit/kits/literal.js +4 -25
- package/dist/src/typekit/kits/literal.js.map +1 -1
- package/lib/intrinsics.tsp +1 -1
- package/package.json +4 -4
- package/templates/__snapshots__/emitter-ts/package.json +1 -1
- package/templates/__snapshots__/library-ts/package.json +1 -1
- package/templates/__snapshots__/library-ts/test/decorators.test.ts +1 -1
- package/templates/emitter-ts/package.json +1 -1
- package/templates/library-ts/package.json +1 -1
- package/templates/library-ts/test/decorators.test.ts.mu +1 -1
|
@@ -1,38 +1,17 @@
|
|
|
1
|
-
import { Numeric } from "../../core/numeric.js";
|
|
2
1
|
import { defineKit } from "../define-kit.js";
|
|
3
2
|
defineKit({
|
|
4
3
|
literal: {
|
|
5
4
|
create(value) {
|
|
6
|
-
|
|
7
|
-
return this.literal.createString(value);
|
|
8
|
-
}
|
|
9
|
-
else if (typeof value === "number") {
|
|
10
|
-
return this.literal.createNumeric(value);
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
return this.literal.createBoolean(value);
|
|
14
|
-
}
|
|
5
|
+
return this.program.checker.createLiteralType(value);
|
|
15
6
|
},
|
|
16
7
|
createString(value) {
|
|
17
|
-
return this.program.checker.
|
|
18
|
-
kind: "String",
|
|
19
|
-
value,
|
|
20
|
-
});
|
|
8
|
+
return this.program.checker.createLiteralType(value);
|
|
21
9
|
},
|
|
22
10
|
createNumeric(value) {
|
|
23
|
-
|
|
24
|
-
return this.program.checker.createType({
|
|
25
|
-
kind: "Number",
|
|
26
|
-
value,
|
|
27
|
-
valueAsString,
|
|
28
|
-
numericValue: Numeric(valueAsString),
|
|
29
|
-
});
|
|
11
|
+
return this.program.checker.createLiteralType(value);
|
|
30
12
|
},
|
|
31
13
|
createBoolean(value) {
|
|
32
|
-
return this.program.checker.
|
|
33
|
-
kind: "Boolean",
|
|
34
|
-
value,
|
|
35
|
-
});
|
|
14
|
+
return this.program.checker.createLiteralType(value);
|
|
36
15
|
},
|
|
37
16
|
isBoolean(type) {
|
|
38
17
|
return type.entityKind === "Type" && type.kind === "Boolean";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"literal.js","sourceRoot":"","sources":["../../../../src/typekit/kits/literal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"literal.js","sourceRoot":"","sources":["../../../../src/typekit/kits/literal.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AA+E7C,SAAS,CAAmB;IAC1B,OAAO,EAAE;QACP,MAAM,CAAC,KAAK;YACV,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QACvD,CAAC;QACD,YAAY,CAAC,KAAK;YAChB,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QACvD,CAAC;QAED,aAAa,CAAC,KAAK;YACjB,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QACvD,CAAC;QAED,aAAa,CAAC,KAAK;YACjB,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QACvD,CAAC;QAED,SAAS,CAAC,IAAI;YACZ,OAAO,IAAI,CAAC,UAAU,KAAK,MAAM,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC;QAC/D,CAAC;QACD,QAAQ,CAAC,IAAI;YACX,OAAO,IAAI,CAAC,UAAU,KAAK,MAAM,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC;QAC9D,CAAC;QACD,SAAS,CAAC,IAAI;YACZ,OAAO,IAAI,CAAC,UAAU,KAAK,MAAM,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC;QAC9D,CAAC;QACD,EAAE,CAAC,IAAI;YACL,OAAO,CACL,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAC5F,CAAC;QACJ,CAAC;KACF;CACF,CAAC,CAAC"}
|
package/lib/intrinsics.tsp
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/compiler",
|
|
3
|
-
"version": "1.2.0-dev.
|
|
3
|
+
"version": "1.2.0-dev.10",
|
|
4
4
|
"description": "TypeSpec Compiler Preview",
|
|
5
5
|
"author": "Microsoft Corporation",
|
|
6
6
|
"license": "MIT",
|
|
@@ -98,13 +98,13 @@
|
|
|
98
98
|
"temporal-polyfill": "^0.3.0",
|
|
99
99
|
"vscode-languageserver": "~9.0.1",
|
|
100
100
|
"vscode-languageserver-textdocument": "~1.0.12",
|
|
101
|
-
"yaml": "~2.
|
|
102
|
-
"yargs": "~
|
|
101
|
+
"yaml": "~2.8.0",
|
|
102
|
+
"yargs": "~18.0.0"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
105
|
"@types/babel__code-frame": "~7.0.6",
|
|
106
106
|
"@types/mustache": "~4.2.5",
|
|
107
|
-
"@types/node": "~
|
|
107
|
+
"@types/node": "~24.0.3",
|
|
108
108
|
"@types/semver": "^7.5.8",
|
|
109
109
|
"@types/yargs": "~17.0.33",
|
|
110
110
|
"@typespec/internal-build-utils": "^0.71.0 || >=0.72.0-dev <0.72.0",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build": "tsc",
|
|
30
30
|
"watch": "tsc --watch",
|
|
31
|
-
"test": "node --test",
|
|
31
|
+
"test": "node --test 'dist/test**/*.test.js'",
|
|
32
32
|
"lint": "eslint src/ test/ --report-unused-disable-directives --max-warnings=0",
|
|
33
33
|
"lint:fix": "eslint . --report-unused-disable-directives --fix",
|
|
34
34
|
"format": "prettier . --write",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"build": "tsc && npm run build:tsp",
|
|
32
32
|
"watch": "tsc --watch",
|
|
33
33
|
"build:tsp": "tsp compile . --warn-as-error --import @typespec/library-linter --no-emit",
|
|
34
|
-
"test": "node --test",
|
|
34
|
+
"test": "node --test 'dist/test/**/*.test.js'",
|
|
35
35
|
"lint": "eslint src/ test/ --report-unused-disable-directives --max-warnings=0",
|
|
36
36
|
"lint:fix": "eslint . --report-unused-disable-directives --fix",
|
|
37
37
|
"format": "prettier . --write",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { strictEqual } from "node:assert";
|
|
2
2
|
import { describe, it, beforeEach } from "node:test";
|
|
3
|
-
import { Operation } from "@typespec/compiler";
|
|
3
|
+
import type { Operation } from "@typespec/compiler";
|
|
4
4
|
import { BasicTestRunner, expectDiagnostics, extractCursor } from "@typespec/compiler/testing";
|
|
5
5
|
import { getAlternateName } from "../src/decorators.js";
|
|
6
6
|
import { createLibraryTsTestRunner } from "./test-host.js";
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build": "tsc",
|
|
30
30
|
"watch": "tsc --watch",
|
|
31
|
-
"test": "node --test",
|
|
31
|
+
"test": "node --test 'dist/test**/*.test.js'",
|
|
32
32
|
"lint": "eslint src/ test/ --report-unused-disable-directives --max-warnings=0",
|
|
33
33
|
"lint:fix": "eslint . --report-unused-disable-directives --fix",
|
|
34
34
|
"format": "prettier . --write",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"build": "tsc && npm run build:tsp",
|
|
32
32
|
"watch": "tsc --watch",
|
|
33
33
|
"build:tsp": "tsp compile . --warn-as-error --import @typespec/library-linter --no-emit",
|
|
34
|
-
"test": "node --test",
|
|
34
|
+
"test": "node --test 'dist/test/**/*.test.js'",
|
|
35
35
|
"lint": "eslint src/ test/ --report-unused-disable-directives --max-warnings=0",
|
|
36
36
|
"lint:fix": "eslint . --report-unused-disable-directives --fix",
|
|
37
37
|
"format": "prettier . --write",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { strictEqual } from "node:assert";
|
|
2
2
|
import { describe, it, beforeEach } from "node:test";
|
|
3
|
-
import { Operation } from "@typespec/compiler";
|
|
3
|
+
import type { Operation } from "@typespec/compiler";
|
|
4
4
|
import { BasicTestRunner, expectDiagnostics, extractCursor } from "@typespec/compiler/testing";
|
|
5
5
|
import { getAlternateName } from "../src/decorators.js";
|
|
6
6
|
import { create{{#casing.pascalCase}}{{name}}{{/casing.pascalCase}}TestRunner } from "./test-host.js";
|