@typespec/compiler 0.52.0-dev.11 → 0.52.0-dev.13

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.
Files changed (90) hide show
  1. package/dist/.scripts/build-init-templates.js +11 -1
  2. package/dist/.scripts/build-init-templates.js.map +1 -1
  3. package/dist/manifest.js +2 -2
  4. package/dist/src/core/index.d.ts +1 -1
  5. package/dist/src/core/index.d.ts.map +1 -1
  6. package/dist/src/core/index.js +1 -1
  7. package/dist/src/core/index.js.map +1 -1
  8. package/dist/src/core/node-host.d.ts +1 -0
  9. package/dist/src/core/node-host.d.ts.map +1 -1
  10. package/dist/src/core/node-host.js +2 -2
  11. package/dist/src/core/node-host.js.map +1 -1
  12. package/dist/src/init/core-templates.d.ts.map +1 -1
  13. package/dist/src/init/core-templates.js +2 -3
  14. package/dist/src/init/core-templates.js.map +1 -1
  15. package/dist/src/server/classify.d.ts +8 -0
  16. package/dist/src/server/classify.d.ts.map +1 -0
  17. package/dist/src/server/classify.js +310 -0
  18. package/dist/src/server/classify.js.map +1 -0
  19. package/dist/src/server/compile-service.d.ts +42 -0
  20. package/dist/src/server/compile-service.d.ts.map +1 -0
  21. package/dist/src/server/compile-service.js +163 -0
  22. package/dist/src/server/compile-service.js.map +1 -0
  23. package/dist/src/server/constants.d.ts +7 -0
  24. package/dist/src/server/constants.d.ts.map +1 -0
  25. package/dist/src/server/constants.js +13 -0
  26. package/dist/src/server/constants.js.map +1 -0
  27. package/dist/src/server/file-service.d.ts +18 -0
  28. package/dist/src/server/file-service.d.ts.map +1 -0
  29. package/dist/src/server/file-service.js +56 -0
  30. package/dist/src/server/file-service.js.map +1 -0
  31. package/dist/src/server/file-system-cache.d.ts +25 -0
  32. package/dist/src/server/file-system-cache.d.ts.map +1 -0
  33. package/dist/src/server/file-system-cache.js +27 -0
  34. package/dist/src/server/file-system-cache.js.map +1 -0
  35. package/dist/src/server/index.d.ts +2 -1
  36. package/dist/src/server/index.d.ts.map +1 -1
  37. package/dist/src/server/index.js +2 -1
  38. package/dist/src/server/index.js.map +1 -1
  39. package/dist/src/server/server.js.map +1 -1
  40. package/dist/src/server/serverlib.d.ts +1 -71
  41. package/dist/src/server/serverlib.d.ts.map +1 -1
  42. package/dist/src/server/serverlib.js +115 -622
  43. package/dist/src/server/serverlib.js.map +1 -1
  44. package/dist/src/server/types.d.ts +76 -0
  45. package/dist/src/server/types.d.ts.map +1 -0
  46. package/dist/src/server/types.js +26 -0
  47. package/dist/src/server/types.js.map +1 -0
  48. package/dist/src/server/update-manager.d.ts +19 -0
  49. package/dist/src/server/update-manager.d.ts.map +1 -0
  50. package/dist/src/server/update-manager.js +70 -0
  51. package/dist/src/server/update-manager.js.map +1 -0
  52. package/dist/src/testing/types.d.ts +2 -2
  53. package/dist/src/testing/types.d.ts.map +1 -1
  54. package/package.json +1 -1
  55. package/templates/__snapshots__/emitter-ts/src/testing/index.ts +5 -7
  56. package/templates/__snapshots__/emitter-ts/test/test-host.ts +2 -2
  57. package/templates/__snapshots__/library-ts/.eslintrc.yml +14 -0
  58. package/templates/__snapshots__/library-ts/lib/decorators.tsp +12 -0
  59. package/templates/__snapshots__/library-ts/lib/main.tsp +1 -0
  60. package/templates/__snapshots__/library-ts/package.json +40 -0
  61. package/templates/__snapshots__/library-ts/prettierrc.yaml +8 -0
  62. package/templates/__snapshots__/library-ts/src/decorators.ts +33 -0
  63. package/templates/__snapshots__/library-ts/src/index.ts +2 -0
  64. package/templates/__snapshots__/library-ts/src/lib.ts +20 -0
  65. package/templates/__snapshots__/library-ts/src/linter.ts +14 -0
  66. package/templates/__snapshots__/library-ts/src/rules/no-interfaces.rule.ts +19 -0
  67. package/templates/__snapshots__/library-ts/src/testing/index.ts +8 -0
  68. package/templates/__snapshots__/library-ts/test/decorators.test.ts +48 -0
  69. package/templates/__snapshots__/library-ts/test/rules/no-interfaces.rule.test.ts +29 -0
  70. package/templates/__snapshots__/library-ts/test/test-host.ts +17 -0
  71. package/templates/__snapshots__/library-ts/tsconfig.json +17 -0
  72. package/templates/emitter-ts/src/testing/index.ts.mu +8 -0
  73. package/templates/emitter-ts/test/test-host.ts.mu +2 -2
  74. package/templates/library-ts/.eslintrc.yml +14 -0
  75. package/templates/library-ts/lib/decorators.tsp.mu +12 -0
  76. package/templates/library-ts/lib/main.tsp +1 -0
  77. package/templates/library-ts/package.json +40 -0
  78. package/templates/library-ts/prettierrc.yaml +8 -0
  79. package/templates/library-ts/src/decorators.ts +33 -0
  80. package/templates/library-ts/src/index.ts +2 -0
  81. package/templates/library-ts/src/lib.ts +20 -0
  82. package/templates/library-ts/src/linter.ts +14 -0
  83. package/templates/library-ts/src/rules/no-interfaces.rule.ts +19 -0
  84. package/templates/library-ts/src/testing/index.ts.mu +8 -0
  85. package/templates/library-ts/test/decorators.test.ts.mu +48 -0
  86. package/templates/library-ts/test/rules/no-interfaces.rule.test.ts +29 -0
  87. package/templates/library-ts/test/test-host.ts.mu +17 -0
  88. package/templates/library-ts/tsconfig.json +17 -0
  89. package/templates/scaffolding.json +77 -1
  90. package/templates/emitter-ts/src/testing/index.ts +0 -10
@@ -0,0 +1,8 @@
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
+ });
@@ -0,0 +1,48 @@
1
+ import { strictEqual } from "node:assert";
2
+ import { describe, it, beforeEach } from "node:test";
3
+ import { Operation } from "@typespec/compiler";
4
+ import { BasicTestRunner, expectDiagnostics, extractCursor } from "@typespec/compiler/testing";
5
+ import { getAlternateName } from "../src/decorators.js";
6
+ import { createLibraryTsTestRunner } from "./test-host.js";
7
+
8
+ describe("decorators", () => {
9
+ let runner: BasicTestRunner;
10
+
11
+ beforeEach(async () => {
12
+ runner = await createLibraryTsTestRunner();
13
+ })
14
+
15
+ describe("@alternateName", () => {
16
+ it("set alternate name on operation", async () => {
17
+ const { test } = (await runner.compile(
18
+ `@alternateName("bar") @test op test(): void;`
19
+ )) as { test: Operation };
20
+ strictEqual(getAlternateName(runner.program, test), "bar");
21
+ });
22
+
23
+ it("emit diagnostic if not used on an operation", async () => {
24
+ const diagnostics = await runner.diagnose(
25
+ `@alternateName("bar") model Test {}`
26
+ );
27
+ expectDiagnostics(diagnostics, {
28
+ severity: "error",
29
+ code: "decorator-wrong-target",
30
+ message: "Cannot apply @alternateName decorator to Test since it is not assignable to Operation"
31
+ })
32
+ });
33
+
34
+
35
+ it("emit diagnostic if using banned name", async () => {
36
+ const {pos, source} = extractCursor(`@alternateName(┆"banned") op test(): void;`)
37
+ const diagnostics = await runner.diagnose(
38
+ source
39
+ );
40
+ expectDiagnostics(diagnostics, {
41
+ severity: "error",
42
+ code: "library-ts/banned-alternate-name",
43
+ message: `Banned alternate name "banned".`,
44
+ pos: pos + runner.autoCodeOffset
45
+ })
46
+ });
47
+ });
48
+ });
@@ -0,0 +1,29 @@
1
+ import {
2
+ LinterRuleTester,
3
+ createLinterRuleTester,
4
+ createTestRunner,
5
+ } from "@typespec/compiler/testing";
6
+ import { beforeEach, describe, it } from "node:test";
7
+ import { noInterfaceRule } from "../../src/rules/no-interfaces.rule.js";
8
+
9
+ describe("noInterfaceRule", () => {
10
+ let ruleTester: LinterRuleTester;
11
+
12
+ beforeEach(async () => {
13
+ const runner = await createTestRunner();
14
+ ruleTester = createLinterRuleTester(runner, noInterfaceRule, "library-ts");
15
+ });
16
+
17
+ describe("models", () => {
18
+ it("emit diagnostics if using interfaces", async () => {
19
+ await ruleTester.expect(`interface Test {}`).toEmitDiagnostics({
20
+ code: "library-ts/no-interface",
21
+ message: "Interface shouldn't be used with this library. Keep operations at the root.",
22
+ });
23
+ });
24
+
25
+ it("should be valid if operation is at the root", async () => {
26
+ await ruleTester.expect(`op test(): void;`).toBeValid();
27
+ });
28
+ });
29
+ });
@@ -0,0 +1,17 @@
1
+ import { createTestHost, createTestWrapper } from "@typespec/compiler/testing";
2
+ import { LibraryTsTestLibrary } from "../src/testing/index.js";
3
+
4
+ export async function createLibraryTsTestHost() {
5
+ return createTestHost({
6
+ libraries: [LibraryTsTestLibrary],
7
+ });
8
+ }
9
+
10
+ export async function createLibraryTsTestRunner() {
11
+ const host = await createLibraryTsTestHost();
12
+
13
+ return createTestWrapper(host, {
14
+ autoUsings: ["LibraryTs"]
15
+ });
16
+ }
17
+
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "useDefineForClassFields": true,
5
+ "module": "NodeNext",
6
+ "moduleResolution": "NodeNext",
7
+ "lib": ["ES2022"],
8
+ "rootDir": ".",
9
+ "outDir": "dist",
10
+ "sourceMap": true,
11
+ "declaration": true,
12
+
13
+ /* Linting */
14
+ "strict": true
15
+ },
16
+ "include": ["src", "test"]
17
+ }
@@ -0,0 +1,8 @@
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
+ });
@@ -4,11 +4,11 @@ import {
4
4
  createTestWrapper,
5
5
  expectDiagnosticEmpty,
6
6
  } from "@typespec/compiler/testing";
7
- import { TestLibrary } from "../src/testing/index.js";
7
+ import { {{#casing.pascalCase}}{{name}}{{/casing.pascalCase}}TestLibrary } from "../src/testing/index.js";
8
8
 
9
9
  export async function create{{#casing.pascalCase}}{{name}}{{/casing.pascalCase}}TestHost() {
10
10
  return createTestHost({
11
- libraries: [TestLibrary],
11
+ libraries: [{{#casing.pascalCase}}{{name}}{{/casing.pascalCase}}TestLibrary],
12
12
  });
13
13
  }
14
14
 
@@ -0,0 +1,14 @@
1
+ root: true
2
+ env:
3
+ es2021: true
4
+ node: true
5
+ extends:
6
+ - eslint:recommended
7
+ - plugin:@typescript-eslint/recommended
8
+ parser: "@typescript-eslint/parser"
9
+ parserOptions:
10
+ ecmaVersion: latest
11
+ sourceType: module
12
+ plugins:
13
+ - "@typescript-eslint"
14
+ rules: {}
@@ -0,0 +1,12 @@
1
+ import "../dist/src/decorators.js";
2
+
3
+ using TypeSpec.Reflection;
4
+
5
+ namespace {{#casing.pascalCase}}{{name}}{{/casing.pascalCase}};
6
+
7
+ /**
8
+ * __Example Decorator__
9
+ * Provide an alternate name for an operation.
10
+ * @param name The alternate name.
11
+ */
12
+ extern dec alternateName(target: Operation, name: valueof string);
@@ -0,0 +1 @@
1
+ import "./decorators.tsp";
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "{{name}}",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "main": "dist/src/index.js",
6
+ "tspMain": "lib/main.tsp",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/src/index.d.ts",
10
+ "default": "./dist/src/index.js"
11
+ },
12
+ "./testing": {
13
+ "types": "./dist/src/testing/index.d.ts",
14
+ "default": "./dist/src/testing/index.js"
15
+ }
16
+ },
17
+ "dependencies": {
18
+ "@typespec/compiler": "latest"
19
+ },
20
+ "devDependencies": {
21
+ "@types/node": "latest",
22
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
23
+ "@typescript-eslint/parser": "^6.0.0",
24
+ "@typespec/library-linter": "latest",
25
+ "eslint": "^8.45.0",
26
+ "prettier": "^3.0.3",
27
+ "typescript": "^5.3.3"
28
+ },
29
+ "scripts": {
30
+ "build": "tsc && npm run build:tsp",
31
+ "watch": "tsc --watch",
32
+ "build:tsp": "tsp compile . --warn-as-error --import @typespec/library-linter --no-emit",
33
+ "test": "node --test ./dist/test/",
34
+ "lint": "eslint src/ test/ --report-unused-disable-directives --max-warnings=0",
35
+ "lint:fix": "eslint . --report-unused-disable-directives --fix",
36
+ "format": "prettier . --write",
37
+ "format:check": "prettier --check ."
38
+ },
39
+ "private": true
40
+ }
@@ -0,0 +1,8 @@
1
+ trailingComma: "all"
2
+ printWidth: 120
3
+ quoteProps: "consistent"
4
+ endOfLine: lf
5
+ arrowParens: always
6
+ plugins:
7
+ - "./node_modules/@typespec/prettier-plugin-typespec/dist/index.js"
8
+ overrides: [{ "files": "*.tsp", "options": { "parser": "typespec" } }]
@@ -0,0 +1,33 @@
1
+ import { DecoratorContext, Operation, Program } from "@typespec/compiler";
2
+ import { StateKeys, reportDiagnostic } from "./lib.js";
3
+
4
+ export const namespace = "{{#casing.pascalCase}}{{name}}{{/casing.pascalCase}}";
5
+
6
+ /**
7
+ * __Example implementation of the `@alternateName` decorator.__
8
+ *
9
+ * @param context Decorator context.
10
+ * @param target Decorator target. Must be an operation.
11
+ * @param name Alternate name.
12
+ */
13
+ export function $alternateName(context: DecoratorContext, target: Operation, name: string) {
14
+ if (name === "banned") {
15
+ reportDiagnostic(context.program, {
16
+ code: "banned-alternate-name",
17
+ target: context.getArgumentTarget(0)!,
18
+ format: { name },
19
+ });
20
+ }
21
+ context.program.stateMap(StateKeys.alternateName).set(target, name);
22
+ }
23
+
24
+ /**
25
+ * __Example accessor for the `@alternateName` decorator.__
26
+ *
27
+ * @param program TypeSpec program.
28
+ * @param target Decorator target. Must be an operation.
29
+ * @returns Altenate name if provided on the given operation or undefined
30
+ */
31
+ export function getAlternateName(program: Program, target: Operation): string | undefined {
32
+ return program.stateMap(StateKeys.alternateName).get(target);
33
+ }
@@ -0,0 +1,2 @@
1
+ export { getAlternateName } from "./decorators.js";
2
+ export { $lib } from "./lib.js";
@@ -0,0 +1,20 @@
1
+ import { createTypeSpecLibrary, paramMessage } from "@typespec/compiler";
2
+
3
+ export const $lib = createTypeSpecLibrary({
4
+ name: "{{name}}",
5
+ // Define diagnostics for the library. This will provide a typed API to report diagnostic as well as a auto doc generation.
6
+ diagnostics: {
7
+ "banned-alternate-name": {
8
+ severity: "error",
9
+ messages: {
10
+ default: paramMessage`Banned alternate name "${"name"}".`,
11
+ },
12
+ },
13
+ },
14
+ // Defined state keys for storing metadata in decorator.
15
+ state: {
16
+ alternateName: { description: "alternateName" },
17
+ },
18
+ });
19
+
20
+ export const { reportDiagnostic, createDiagnostic, stateKeys: StateKeys } = $lib;
@@ -0,0 +1,14 @@
1
+ import { defineLinter } from "@typespec/compiler";
2
+ import { noInterfaceRule } from "./rules/no-interfaces.rule.js";
3
+
4
+ export const $linter = defineLinter({
5
+ rules: [noInterfaceRule],
6
+ ruleSets: {
7
+ recommended: {
8
+ enable: { [`{{name}}/${noInterfaceRule.name}`]: true },
9
+ },
10
+ all: {
11
+ enable: { [`{{name}}/${noInterfaceRule.name}`]: true },
12
+ },
13
+ },
14
+ });
@@ -0,0 +1,19 @@
1
+ import { createRule } from "@typespec/compiler";
2
+
3
+ export const noInterfaceRule = createRule({
4
+ name: "no-interface",
5
+ severity: "warning",
6
+ description: "Make sure interface are not used.",
7
+ messages: {
8
+ default: "Interface shouldn't be used with this library. Keep operations at the root.",
9
+ },
10
+ create: (context) => {
11
+ return {
12
+ interface: (iface) => {
13
+ context.reportDiagnostic({
14
+ target: iface,
15
+ });
16
+ },
17
+ };
18
+ },
19
+ });
@@ -0,0 +1,8 @@
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
+ });
@@ -0,0 +1,48 @@
1
+ import { strictEqual } from "node:assert";
2
+ import { describe, it, beforeEach } from "node:test";
3
+ import { Operation } from "@typespec/compiler";
4
+ import { BasicTestRunner, expectDiagnostics, extractCursor } from "@typespec/compiler/testing";
5
+ import { getAlternateName } from "../src/decorators.js";
6
+ import { create{{#casing.pascalCase}}{{name}}{{/casing.pascalCase}}TestRunner } from "./test-host.js";
7
+
8
+ describe("decorators", () => {
9
+ let runner: BasicTestRunner;
10
+
11
+ beforeEach(async () => {
12
+ runner = await create{{#casing.pascalCase}}{{name}}{{/casing.pascalCase}}TestRunner();
13
+ })
14
+
15
+ describe("@alternateName", () => {
16
+ it("set alternate name on operation", async () => {
17
+ const { test } = (await runner.compile(
18
+ `@alternateName("bar") @test op test(): void;`
19
+ )) as { test: Operation };
20
+ strictEqual(getAlternateName(runner.program, test), "bar");
21
+ });
22
+
23
+ it("emit diagnostic if not used on an operation", async () => {
24
+ const diagnostics = await runner.diagnose(
25
+ `@alternateName("bar") model Test {}`
26
+ );
27
+ expectDiagnostics(diagnostics, {
28
+ severity: "error",
29
+ code: "decorator-wrong-target",
30
+ message: "Cannot apply @alternateName decorator to Test since it is not assignable to Operation"
31
+ })
32
+ });
33
+
34
+
35
+ it("emit diagnostic if using banned name", async () => {
36
+ const {pos, source} = extractCursor(`@alternateName(┆"banned") op test(): void;`)
37
+ const diagnostics = await runner.diagnose(
38
+ source
39
+ );
40
+ expectDiagnostics(diagnostics, {
41
+ severity: "error",
42
+ code: "{{name}}/banned-alternate-name",
43
+ message: `Banned alternate name "banned".`,
44
+ pos: pos + runner.autoCodeOffset
45
+ })
46
+ });
47
+ });
48
+ });
@@ -0,0 +1,29 @@
1
+ import {
2
+ LinterRuleTester,
3
+ createLinterRuleTester,
4
+ createTestRunner,
5
+ } from "@typespec/compiler/testing";
6
+ import { beforeEach, describe, it } from "node:test";
7
+ import { noInterfaceRule } from "../../src/rules/no-interfaces.rule.js";
8
+
9
+ describe("noInterfaceRule", () => {
10
+ let ruleTester: LinterRuleTester;
11
+
12
+ beforeEach(async () => {
13
+ const runner = await createTestRunner();
14
+ ruleTester = createLinterRuleTester(runner, noInterfaceRule, "{{name}}");
15
+ });
16
+
17
+ describe("models", () => {
18
+ it("emit diagnostics if using interfaces", async () => {
19
+ await ruleTester.expect(`interface Test {}`).toEmitDiagnostics({
20
+ code: "{{name}}/no-interface",
21
+ message: "Interface shouldn't be used with this library. Keep operations at the root.",
22
+ });
23
+ });
24
+
25
+ it("should be valid if operation is at the root", async () => {
26
+ await ruleTester.expect(`op test(): void;`).toBeValid();
27
+ });
28
+ });
29
+ });
@@ -0,0 +1,17 @@
1
+ import { createTestHost, createTestWrapper } from "@typespec/compiler/testing";
2
+ import { {{#casing.pascalCase}}{{name}}{{/casing.pascalCase}}TestLibrary } from "../src/testing/index.js";
3
+
4
+ export async function create{{#casing.pascalCase}}{{name}}{{/casing.pascalCase}}TestHost() {
5
+ return createTestHost({
6
+ libraries: [{{#casing.pascalCase}}{{name}}{{/casing.pascalCase}}TestLibrary],
7
+ });
8
+ }
9
+
10
+ export async function create{{#casing.pascalCase}}{{name}}{{/casing.pascalCase}}TestRunner() {
11
+ const host = await create{{#casing.pascalCase}}{{name}}{{/casing.pascalCase}}TestHost();
12
+
13
+ return createTestWrapper(host, {
14
+ autoUsings: ["{{#casing.pascalCase}}{{name}}{{/casing.pascalCase}}"]
15
+ });
16
+ }
17
+
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "useDefineForClassFields": true,
5
+ "module": "NodeNext",
6
+ "moduleResolution": "NodeNext",
7
+ "lib": ["ES2022"],
8
+ "rootDir": ".",
9
+ "outDir": "dist",
10
+ "sourceMap": true,
11
+ "declaration": true,
12
+
13
+ /* Linting */
14
+ "strict": true
15
+ },
16
+ "include": ["src", "test"]
17
+ }
@@ -20,6 +20,82 @@
20
20
  ]
21
21
  }
22
22
  },
23
+ "library-ts": {
24
+ "title": "TypeSpec Library (With TypeScript)",
25
+ "description": "Create a new package to add decorators or linters to typespec.",
26
+ "compilerVersion": "0.51.0",
27
+ "libraries": [],
28
+ "files": [
29
+ {
30
+ "destination": "main.tsp",
31
+ "skipGeneration": true
32
+ },
33
+ {
34
+ "destination": "tspconfig.yaml",
35
+ "skipGeneration": true
36
+ },
37
+ {
38
+ "path": "library-ts/.eslintrc.yml",
39
+ "destination": ".eslintrc.yml"
40
+ },
41
+ {
42
+ "path": "library-ts/lib/decorators.tsp.mu",
43
+ "destination": "lib/decorators.tsp"
44
+ },
45
+ {
46
+ "path": "library-ts/lib/main.tsp",
47
+ "destination": "lib/main.tsp"
48
+ },
49
+ {
50
+ "path": "library-ts/package.json",
51
+ "destination": "package.json"
52
+ },
53
+ {
54
+ "path": "library-ts/prettierrc.yaml",
55
+ "destination": "prettierrc.yaml"
56
+ },
57
+ {
58
+ "path": "library-ts/src/decorators.ts",
59
+ "destination": "src/decorators.ts"
60
+ },
61
+ {
62
+ "path": "library-ts/src/index.ts",
63
+ "destination": "src/index.ts"
64
+ },
65
+ {
66
+ "path": "library-ts/src/lib.ts",
67
+ "destination": "src/lib.ts"
68
+ },
69
+ {
70
+ "path": "library-ts/src/linter.ts",
71
+ "destination": "src/linter.ts"
72
+ },
73
+ {
74
+ "path": "library-ts/src/rules/no-interfaces.rule.ts",
75
+ "destination": "src/rules/no-interfaces.rule.ts"
76
+ },
77
+ {
78
+ "path": "library-ts/src/testing/index.ts.mu",
79
+ "destination": "src/testing/index.ts"
80
+ },
81
+ {
82
+ "path": "library-ts/test/decorators.test.ts.mu",
83
+ "destination": "test/decorators.test.ts"
84
+ },
85
+ {
86
+ "path": "library-ts/test/rules/no-interfaces.rule.test.ts",
87
+ "destination": "test/rules/no-interfaces.rule.test.ts"
88
+ },
89
+ {
90
+ "path": "library-ts/test/test-host.ts.mu",
91
+ "destination": "test/test-host.ts"
92
+ },
93
+ {
94
+ "path": "library-ts/tsconfig.json",
95
+ "destination": "tsconfig.json"
96
+ }
97
+ ]
98
+ },
23
99
  "emitter-ts": {
24
100
  "title": "TypeSpec Emitter (With TypeScript)",
25
101
  "description": "Create a new package that will be emitting typespec",
@@ -59,7 +135,7 @@
59
135
  "destination": "src/lib.ts"
60
136
  },
61
137
  {
62
- "path": "emitter-ts/src/testing/index.ts",
138
+ "path": "emitter-ts/src/testing/index.ts.mu",
63
139
  "destination": "src/testing/index.ts"
64
140
  },
65
141
  {
@@ -1,10 +0,0 @@
1
- import {
2
- createTestLibrary,
3
- findTestPackageRoot,
4
- TypeSpecTestLibrary,
5
- } from "@typespec/compiler/testing";
6
-
7
- export const TestLibrary: TypeSpecTestLibrary = createTestLibrary({
8
- name: "{{name}}",
9
- packageRoot: await findTestPackageRoot(import.meta.url),
10
- });