@azure-tools/typespec-autorest 0.38.0-dev.3 → 0.38.0-dev.5

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.
@@ -1,3 +1,3 @@
1
- import AutorestOpenAPISchema from "../../schema/dist/schema.js";
1
+ declare let AutorestOpenAPISchema: any;
2
2
  export { AutorestOpenAPISchema };
3
3
  //# sourceMappingURL=autorest-openapi-schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"autorest-openapi-schema.d.ts","sourceRoot":"","sources":["../../src/autorest-openapi-schema.ts"],"names":[],"mappings":"AAEA,OAAO,qBAAqB,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
1
+ {"version":3,"file":"autorest-openapi-schema.d.ts","sourceRoot":"","sources":["../../src/autorest-openapi-schema.ts"],"names":[],"mappings":"AAAA,QAAA,IAAI,qBAAqB,EAAE,GAAG,CAAC;AAU/B,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
@@ -1,5 +1,12 @@
1
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2
- // @ts-ignore
3
- import AutorestOpenAPISchema from "../../schema/dist/schema.js";
1
+ let AutorestOpenAPISchema;
2
+ try {
3
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
4
+ // @ts-ignore
5
+ AutorestOpenAPISchema = (await import("../../schema/dist/schema.js")).default;
6
+ }
7
+ catch {
8
+ const name = "../schema/dist/schema.js";
9
+ AutorestOpenAPISchema = (await import(/* @vite-ignore */ name)).default;
10
+ }
4
11
  export { AutorestOpenAPISchema };
5
12
  //# sourceMappingURL=autorest-openapi-schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"autorest-openapi-schema.js","sourceRoot":"","sources":["../../src/autorest-openapi-schema.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,aAAa;AACb,OAAO,qBAAqB,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
1
+ {"version":3,"file":"autorest-openapi-schema.js","sourceRoot":"","sources":["../../src/autorest-openapi-schema.ts"],"names":[],"mappings":"AAAA,IAAI,qBAA0B,CAAC;AAC/B,IAAI,CAAC;IACH,6DAA6D;IAC7D,aAAa;IACb,qBAAqB,GAAG,CAAC,MAAM,MAAM,CAAC,6BAA6B,CAAC,CAAC,CAAC,OAAO,CAAC;AAChF,CAAC;AAAC,MAAM,CAAC;IACP,MAAM,IAAI,GAAG,0BAA0B,CAAC;IACxC,qBAAqB,GAAG,CAAC,MAAM,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;AAC1E,CAAC;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
package/dist/src/lib.d.ts CHANGED
@@ -143,7 +143,7 @@ export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
143
143
  "invalid-format": {
144
144
  readonly default: import("@typespec/compiler").CallableMessage<["schema", "format"]>;
145
145
  };
146
- }, AutorestEmitterOptions>;
146
+ }, AutorestEmitterOptions, never>;
147
147
  export declare const reportDiagnostic: <C extends "security-service-namespace" | "resource-namespace" | "missing-path-param" | "duplicate-body-types" | "duplicate-header" | "duplicate-example" | "duplicate-example-file" | "invalid-schema" | "union-null" | "union-unsupported" | "invalid-default" | "invalid-property-type-for-collection-format" | "invalid-collection-format" | "non-recommended-collection-format" | "invalid-multi-collection-format" | "inline-cycle" | "nonspecific-scalar" | "example-loading" | "unsupported-http-auth-scheme" | "unsupported-status-code-range" | "unsupported-multipart-type" | "unsupported-param-type" | "invalid-format", M extends keyof {
148
148
  "security-service-namespace": {
149
149
  readonly default: "Cannot add security details to a namespace other than the service namespace.";
@@ -1 +1 @@
1
- {"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;;;;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GG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;;OAGG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC;IAEpD;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,6BAA6B,CAAC,EAAE,OAAO,CAAC;CACzC;AAoPD,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAAgC,CAAC;AAClD,eAAO,MAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAE,iBAAiB,4BAAE,SAAS,wFAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/testing/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGjE,eAAO,MAAM,mBAAmB,EAAE,mBAoBjC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/testing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAuB,MAAM,4BAA4B,CAAC;AAEtF,eAAO,MAAM,mBAAmB,EAAE,mBAoBjC,CAAC"}
@@ -1,8 +1,7 @@
1
- import { resolvePath } from "@typespec/compiler";
2
- import { fileURLToPath } from "url";
1
+ import { findTestPackageRoot } from "@typespec/compiler/testing";
3
2
  export const AutorestTestLibrary = {
4
3
  name: "@azure-tools/typespec-autorest",
5
- packageRoot: resolvePath(fileURLToPath(import.meta.url), "../../../../"),
4
+ packageRoot: await findTestPackageRoot(import.meta.url),
6
5
  files: [
7
6
  {
8
7
  realDir: "",
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/testing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,CAAC,MAAM,mBAAmB,GAAwB;IACtD,IAAI,EAAE,gCAAgC;IACtC,WAAW,EAAE,WAAW,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,cAAc,CAAC;IACxE,KAAK,EAAE;QACL;YACE,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,cAAc;YACvB,WAAW,EAAE,+CAA+C;SAC7D;QACD;YACE,OAAO,EAAE,UAAU;YACnB,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,wDAAwD;SACtE;QACD;YACE,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,OAAO;YAChB,WAAW,EAAE,mDAAmD;SACjE;KACF;CACF,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/testing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtF,MAAM,CAAC,MAAM,mBAAmB,GAAwB;IACtD,IAAI,EAAE,gCAAgC;IACtC,WAAW,EAAE,MAAM,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;IACvD,KAAK,EAAE;QACL;YACE,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,cAAc;YACvB,WAAW,EAAE,+CAA+C;SAC7D;QACD;YACE,OAAO,EAAE,UAAU;YACnB,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,wDAAwD;SACtE;QACD;YACE,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,OAAO;YAChB,WAAW,EAAE,mDAAmD;SACjE;KACF;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const _default: import("vite").UserConfig;
2
+ export default _default;
3
+ //# sourceMappingURL=vitest.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vitest.config.d.ts","sourceRoot":"","sources":["../vitest.config.ts"],"names":[],"mappings":";AAEA,wBAYG"}
@@ -0,0 +1,15 @@
1
+ import { defineConfig } from "vitest/config";
2
+ export default defineConfig({
3
+ test: {
4
+ environment: "node",
5
+ testTimeout: 10000,
6
+ isolate: false,
7
+ coverage: {
8
+ reporter: ["cobertura", "json", "text"],
9
+ },
10
+ outputFile: {
11
+ junit: "./test-results.xml",
12
+ },
13
+ },
14
+ });
15
+ //# sourceMappingURL=vitest.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vitest.config.js","sourceRoot":"","sources":["../vitest.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,eAAe,YAAY,CAAC;IAC1B,IAAI,EAAE;QACJ,WAAW,EAAE,MAAM;QACnB,WAAW,EAAE,KAAK;QAClB,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE;YACR,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC;SACxC;QACD,UAAU,EAAE;YACV,KAAK,EAAE,oBAAoB;SAC5B;KACF;CACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-tools/typespec-autorest",
3
- "version": "0.38.0-dev.3",
3
+ "version": "0.38.0-dev.5",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "TypeSpec library for emitting openapi from the TypeSpec REST protocol binding",
6
6
  "homepage": "https://azure.github.io/typespec-azure",
@@ -41,7 +41,7 @@
41
41
  ],
42
42
  "peerDependencies": {
43
43
  "@typespec/compiler": "~0.51.0 || >=0.52.0-dev <0.52.0",
44
- "@azure-tools/typespec-azure-core": "~0.37.1 || >=0.38.0-dev <0.38.0",
44
+ "@azure-tools/typespec-azure-core": "~0.37.2 || >=0.38.0-dev <0.38.0",
45
45
  "@typespec/http": "~0.51.0 || >=0.52.0-dev <0.52.0",
46
46
  "@typespec/rest": "~0.51.0 || >=0.52.0-dev <0.52.0",
47
47
  "@typespec/openapi": "~0.51.0 || >=0.52.0-dev <0.52.0",
@@ -50,11 +50,10 @@
50
50
  "devDependencies": {
51
51
  "@typespec/compiler": "~0.51.0 || >=0.52.0-dev <0.52.0",
52
52
  "@typespec/json-schema": "~0.51.0 || >=0.52.0-dev <0.52.0",
53
- "@azure-tools/typespec-azure-core": "~0.37.1 || >=0.38.0-dev <0.38.0",
53
+ "@azure-tools/typespec-azure-core": "~0.37.2 || >=0.38.0-dev <0.38.0",
54
54
  "@typespec/http": "~0.51.0 || >=0.52.0-dev <0.52.0",
55
55
  "@typespec/rest": "~0.51.0 || >=0.52.0-dev <0.52.0",
56
56
  "@typespec/openapi": "~0.51.0 || >=0.52.0-dev <0.52.0",
57
- "@types/mocha": "~10.0.6",
58
57
  "@types/node": "~18.11.9",
59
58
  "@typespec/versioning": "~0.51.0 || >=0.52.0-dev <0.52.0",
60
59
  "@typespec/eslint-config-typespec": "~0.51.0 || >=0.52.0-dev <0.52.0",
@@ -62,9 +61,8 @@
62
61
  "@typespec/eslint-plugin": "~0.51.0 || >=0.52.0-dev <0.52.0",
63
62
  "@typespec/tspd": "~0.46.0 || >=0.47.0-dev <0.47.0",
64
63
  "eslint": "^8.55.0",
65
- "mocha": "~10.2.0",
66
- "mocha-junit-reporter": "~2.2.1",
67
- "mocha-multi-reporters": "~1.5.1",
64
+ "vitest": "^1.1.0",
65
+ "@vitest/coverage-v8": "^1.1.0",
68
66
  "c8": "~8.0.1",
69
67
  "rimraf": "~5.0.1",
70
68
  "typescript": "~5.3.3",
@@ -77,8 +75,9 @@
77
75
  "watch": "tsc -p . --watch",
78
76
  "lint-typespec-library": "tsp compile . --warn-as-error --import @typespec/library-linter --no-emit",
79
77
  "regen-autorest-openapi-schema": "tsp compile ./schema/autorest-openapi-schema.tsp --warn-as-error && node ./.scripts/schema-json-to-js.js",
80
- "test": "mocha",
81
- "test-official": "c8 mocha --forbid-only --reporter mocha-multi-reporters",
78
+ "test": "vitest run",
79
+ "test:watch": "vitest -w",
80
+ "test-official": "vitest run --coverage --reporter=junit --reporter=default --no-file-parallelism",
82
81
  "lint": "eslint . --ext .ts --max-warnings=0",
83
82
  "lint:fix": "eslint . --fix --ext .ts",
84
83
  "regen-docs": "tspd doc . --enable-experimental --output-dir ../../docs/emitters/typespec-autorest/reference"