@azure-tools/typespec-ts 0.56.0-dev.2 → 0.56.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.
- package/README.md +0 -6
- package/dist/src/interfaces.d.ts +0 -1
- package/dist/src/interfaces.d.ts.map +1 -1
- package/dist/src/interfaces.js.map +1 -1
- package/dist/src/lib.d.ts +0 -1
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +0 -5
- package/dist/src/lib.js.map +1 -1
- package/dist/src/metadata/build-readme-file.d.ts.map +1 -1
- package/dist/src/metadata/build-readme-file.js +14 -67
- package/dist/src/metadata/build-readme-file.js.map +1 -1
- package/dist/src/metadata/render-template.d.ts +24 -0
- package/dist/src/metadata/render-template.d.ts.map +1 -0
- package/dist/src/metadata/render-template.js +148 -0
- package/dist/src/metadata/render-template.js.map +1 -0
- package/dist/src/metadata/test/build-recorded-client.d.ts.map +1 -1
- package/dist/src/metadata/test/build-recorded-client.js +1 -7
- package/dist/src/metadata/test/build-recorded-client.js.map +1 -1
- package/dist/src/metadata/test/build-sample-test.d.ts.map +1 -1
- package/dist/src/metadata/test/build-sample-test.js +1 -4
- package/dist/src/metadata/test/build-sample-test.js.map +1 -1
- package/dist/src/metadata/test/build-snippets.d.ts.map +1 -1
- package/dist/src/metadata/test/build-snippets.js +2 -4
- package/dist/src/metadata/test/build-snippets.js.map +1 -1
- package/dist/src/metadata/test/template.d.ts +0 -1
- package/dist/src/metadata/test/template.d.ts.map +1 -1
- package/dist/src/metadata/test/template.js +0 -127
- package/dist/src/metadata/test/template.js.map +1 -1
- package/dist/src/transform/transform-client-options.d.ts.map +1 -1
- package/dist/src/transform/transform-client-options.js +0 -2
- package/dist/src/transform/transform-client-options.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -21
- package/src/interfaces.ts +0 -1
- package/src/lib.ts +0 -6
- package/src/metadata/build-readme-file.ts +17 -91
- package/src/metadata/render-template.ts +202 -0
- package/src/metadata/test/build-recorded-client.ts +1 -7
- package/src/metadata/test/build-sample-test.ts +1 -4
- package/src/metadata/test/build-snippets.ts +2 -4
- package/src/metadata/test/template.ts +0 -128
- package/src/transform/transform-client-options.ts +0 -2
|
@@ -1,131 +1,3 @@
|
|
|
1
|
-
export const karmaConfig = `
|
|
2
|
-
// https://github.com/karma-runner/karma-chrome-launcher
|
|
3
|
-
process.env.CHROME_BIN = require("puppeteer").executablePath();
|
|
4
|
-
require("dotenv").config();
|
|
5
|
-
const { relativeRecordingsPath } = require("@azure-tools/test-recorder");
|
|
6
|
-
process.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath();
|
|
7
|
-
|
|
8
|
-
module.exports = function (config) {
|
|
9
|
-
config.set({
|
|
10
|
-
// base path that will be used to resolve all patterns (eg. files, exclude)
|
|
11
|
-
basePath: "./",
|
|
12
|
-
|
|
13
|
-
// frameworks to use
|
|
14
|
-
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
|
15
|
-
frameworks: ["source-map-support", "mocha"],
|
|
16
|
-
|
|
17
|
-
plugins: [
|
|
18
|
-
"karma-mocha",
|
|
19
|
-
"karma-mocha-reporter",
|
|
20
|
-
"karma-chrome-launcher",
|
|
21
|
-
"karma-firefox-launcher",
|
|
22
|
-
"karma-env-preprocessor",
|
|
23
|
-
"karma-coverage",
|
|
24
|
-
"karma-sourcemap-loader",
|
|
25
|
-
"karma-junit-reporter",
|
|
26
|
-
"karma-source-map-support",
|
|
27
|
-
],
|
|
28
|
-
|
|
29
|
-
// list of files / patterns to load in the browser
|
|
30
|
-
files: [
|
|
31
|
-
"dist-test/index.browser.js",
|
|
32
|
-
{ pattern: "dist-test/index.browser.js.map", type: "html", included: false, served: true },
|
|
33
|
-
],
|
|
34
|
-
|
|
35
|
-
// list of files / patterns to exclude
|
|
36
|
-
exclude: [],
|
|
37
|
-
|
|
38
|
-
// preprocess matching files before serving them to the browser
|
|
39
|
-
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
|
40
|
-
preprocessors: {
|
|
41
|
-
"**/*.js": ["sourcemap", "env"],
|
|
42
|
-
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
|
|
43
|
-
// Preprocess source file to calculate code coverage, however this will make source file unreadable
|
|
44
|
-
// "dist-test/index.js": ["coverage"]
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
envPreprocessor: [
|
|
48
|
-
"TEST_MODE",
|
|
49
|
-
"ENDPOINT",
|
|
50
|
-
"AZURE_CLIENT_SECRET",
|
|
51
|
-
"AZURE_CLIENT_ID",
|
|
52
|
-
"AZURE_TENANT_ID",
|
|
53
|
-
"SUBSCRIPTION_ID",
|
|
54
|
-
"RECORDINGS_RELATIVE_PATH",
|
|
55
|
-
],
|
|
56
|
-
|
|
57
|
-
// test results reporter to use
|
|
58
|
-
// possible values: 'dots', 'progress'
|
|
59
|
-
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
|
60
|
-
reporters: ["mocha", "coverage", "junit"],
|
|
61
|
-
|
|
62
|
-
coverageReporter: {
|
|
63
|
-
// specify a common output directory
|
|
64
|
-
dir: "coverage-browser/",
|
|
65
|
-
reporters: [
|
|
66
|
-
{ type: "json", subdir: ".", file: "coverage.json" },
|
|
67
|
-
{ type: "lcovonly", subdir: ".", file: "lcov.info" },
|
|
68
|
-
{ type: "html", subdir: "html" },
|
|
69
|
-
{ type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" },
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
junitReporter: {
|
|
74
|
-
outputDir: "", // results will be saved as $outputDir/$browserName.xml
|
|
75
|
-
outputFile: "test-results.browser.xml", // if included, results will be saved as $outputDir/$browserName/$outputFile
|
|
76
|
-
suite: "", // suite will become the package name attribute in xml testsuite element
|
|
77
|
-
useBrowserName: false, // add browser name to report and classes names
|
|
78
|
-
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
|
|
79
|
-
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
|
|
80
|
-
properties: {}, // key value pair of properties to add to the <properties> section of the report
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
// web server port
|
|
84
|
-
port: 9876,
|
|
85
|
-
|
|
86
|
-
// enable / disable colors in the output (reporters and logs)
|
|
87
|
-
colors: true,
|
|
88
|
-
|
|
89
|
-
// level of logging
|
|
90
|
-
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
|
91
|
-
logLevel: config.LOG_INFO,
|
|
92
|
-
|
|
93
|
-
// enable / disable watching file and executing tests whenever any file changes
|
|
94
|
-
autoWatch: false,
|
|
95
|
-
|
|
96
|
-
// --no-sandbox allows our tests to run in Linux without having to change the system.
|
|
97
|
-
// --disable-web-security allows us to authenticate from the browser without having to write tests using interactive auth, which would be far more complex.
|
|
98
|
-
browsers: ["ChromeHeadlessNoSandbox"],
|
|
99
|
-
customLaunchers: {
|
|
100
|
-
ChromeHeadlessNoSandbox: {
|
|
101
|
-
base: "ChromeHeadless",
|
|
102
|
-
flags: ["--no-sandbox", "--disable-web-security"],
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
// Continuous Integration mode
|
|
107
|
-
// if true, Karma captures browsers, runs the tests and exits
|
|
108
|
-
singleRun: false,
|
|
109
|
-
|
|
110
|
-
// Concurrency level
|
|
111
|
-
// how many browser should be started simultaneous
|
|
112
|
-
concurrency: 1,
|
|
113
|
-
|
|
114
|
-
browserNoActivityTimeout: 60000000,
|
|
115
|
-
browserDisconnectTimeout: 10000,
|
|
116
|
-
browserDisconnectTolerance: 3,
|
|
117
|
-
|
|
118
|
-
client: {
|
|
119
|
-
mocha: {
|
|
120
|
-
// change Karma's debug.html to the mocha web reporter
|
|
121
|
-
reporter: "html",
|
|
122
|
-
timeout: "600000",
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
});
|
|
126
|
-
};
|
|
127
|
-
`;
|
|
128
|
-
|
|
129
1
|
export const recordedClientContent = `
|
|
130
2
|
|
|
131
3
|
import {
|
|
@@ -44,7 +44,6 @@ function extractClientOptions(
|
|
|
44
44
|
const enableModelNamespace = getEnableModelNamespace(dpgContext, emitterOptions);
|
|
45
45
|
const hierarchyClient = getHierarchyClient(emitterOptions);
|
|
46
46
|
const clearOutputFolder = getClearOutputFolder(emitterOptions);
|
|
47
|
-
const isTypeSpecTest = emitterOptions["is-typespec-test"];
|
|
48
47
|
const compatibilityMode = emitterOptions["compatibility-mode"];
|
|
49
48
|
const compatibilityLro = emitterOptions["compatibility-lro"];
|
|
50
49
|
const experimentalExtensibleEnums = emitterOptions["experimental-extensible-enums"];
|
|
@@ -73,7 +72,6 @@ function extractClientOptions(
|
|
|
73
72
|
hierarchyClient,
|
|
74
73
|
azureArm: dpgContext.arm,
|
|
75
74
|
clearOutputFolder,
|
|
76
|
-
isTypeSpecTest,
|
|
77
75
|
compatibilityMode,
|
|
78
76
|
compatibilityLro,
|
|
79
77
|
experimentalExtensibleEnums,
|