-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core-client] Create package for AutoRest specific code (#9620)
Create a new package we can use for helpers for generated code.
- Loading branch information
Showing
20 changed files
with
617 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"plugins": ["@azure/azure-sdk"], | ||
"extends": ["plugin:@azure/azure-sdk/azure-sdk-base"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Current TS File", | ||
"args": ["${fileBasename}"], | ||
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"], | ||
"cwd": "${fileDirname}", | ||
"sourceMaps": true, | ||
"protocol": "inspector" | ||
}, | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Run unit tests", | ||
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", | ||
"args": ["--timeout", "999999", "--colors", "${workspaceFolder}/dist-test/index.node.js"], | ||
"cwd": "${workspaceFolder}", | ||
"internalConsoleOptions": "openOnSessionStart", | ||
"skipFiles": ["<node_internals>/**/async_hooks.js", "<node_internals>/**/*.js"] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Build Node", | ||
"type": "npm", | ||
"script": "build:node", | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Release History | ||
|
||
## 1.0.0.preview.1 (UNRELEASED) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2020 Microsoft | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Azure Core Service client library for JavaScript (Experimental) | ||
|
||
This library is primarily intended to be used in code generated by [AutoRest](https://github.com/Azure/Autorest) and [`autorest.typescript`](https://github.com/Azure/autorest.typescript). | ||
|
||
## Getting started | ||
|
||
### Requirements | ||
|
||
- [Node.js](https://nodejs.org) version > 8.x | ||
|
||
### Installation | ||
|
||
This package is primarily used in generated code and not meant to be consumed directly by end users. | ||
|
||
## Key concepts | ||
|
||
TODO: talk about OperationSpec? | ||
|
||
## Examples | ||
|
||
Examples can be found in the `samples` folder. | ||
|
||
## Next steps | ||
|
||
TODO: need some good content here | ||
|
||
## Troubleshooting | ||
|
||
If you run into issues while using this library, please feel free to [file an issue](https://github.com/Azure/azure-sdk-for-js/issues/new). | ||
|
||
## Contributing | ||
|
||
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code. | ||
|
||
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcore%2Fcore-client%2FREADME.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
"mainEntryPointFilePath": "types/latest/src/index.d.ts", | ||
"docModel": { | ||
"enabled": false | ||
}, | ||
"apiReport": { | ||
"enabled": true, | ||
"reportFolder": "./review" | ||
}, | ||
"dtsRollup": { | ||
"enabled": true, | ||
"untrimmedFilePath": "", | ||
"publicTrimmedFilePath": "./types/latest/core-client.d.ts" | ||
}, | ||
"messages": { | ||
"tsdocMessageReporting": { | ||
"default": { | ||
"logLevel": "none" | ||
} | ||
}, | ||
"extractorMessageReporting": { | ||
"ae-missing-release-tag": { | ||
"logLevel": "none" | ||
}, | ||
"ae-unresolved-link": { | ||
"logLevel": "none" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
// https://github.com/karma-runner/karma-chrome-launcher | ||
process.env.CHROME_BIN = require("puppeteer").executablePath(); | ||
|
||
module.exports = function(config) { | ||
config.set({ | ||
// base path that will be used to resolve all patterns (eg. files, exclude) | ||
basePath: "./", | ||
|
||
// frameworks to use | ||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter | ||
frameworks: ["mocha"], | ||
|
||
plugins: [ | ||
"karma-mocha", | ||
"karma-mocha-reporter", | ||
"karma-chrome-launcher", | ||
"karma-edge-launcher", | ||
"karma-firefox-launcher", | ||
"karma-ie-launcher", | ||
"karma-env-preprocessor", | ||
"karma-coverage", | ||
"karma-remap-istanbul", | ||
"karma-junit-reporter" | ||
], | ||
|
||
// list of files / patterns to load in the browser | ||
files: [ | ||
// Uncomment the cdn link below for the polyfill service to support IE11 missing features | ||
// Promise,String.prototype.startsWith,String.prototype.endsWith,String.prototype.repeat,String.prototype.includes,Array.prototype.includes,Object.keys | ||
// "https://cdn.polyfill.io/v2/polyfill.js?features=Symbol,Promise,String.prototype.startsWith,String.prototype.endsWith,String.prototype.repeat,String.prototype.includes,Array.prototype.includes,Object.keys|always", | ||
"dist-test/index.browser.js" | ||
], | ||
|
||
// list of files / patterns to exclude | ||
exclude: [], | ||
|
||
// preprocess matching files before serving them to the browser | ||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | ||
preprocessors: { | ||
"**/*.js": ["env"], | ||
// IMPORTANT: COMMENT following line if you want to debug in your browsers!! | ||
// Preprocess source file to calculate code coverage, however this will make source file unreadable | ||
"test-browser/index.js": ["coverage"] | ||
}, | ||
|
||
// inject following environment values into browser testing with window.__env__ | ||
// environment values MUST be exported or set with same console running "karma start" | ||
// https://www.npmjs.com/package/karma-env-preprocessor | ||
// EXAMPLE: envPreprocessor: ["ACCOUNT_NAME", "ACCOUNT_SAS"], | ||
|
||
// test results reporter to use | ||
// possible values: 'dots', 'progress' | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
reporters: ["mocha", "coverage", "karma-remap-istanbul", "junit"], | ||
|
||
coverageReporter: { | ||
// specify a common output directory | ||
dir: "coverage-browser/", | ||
reporters: [{ type: "json", subdir: ".", file: "coverage.json" }] | ||
}, | ||
|
||
remapIstanbulReporter: { | ||
src: "coverage-browser/coverage.json", | ||
reports: { | ||
lcovonly: "coverage-browser/lcov.info", | ||
html: "coverage-browser/html/report", | ||
"text-summary": null, | ||
cobertura: "./coverage-browser/cobertura-coverage.xml" | ||
} | ||
}, | ||
|
||
junitReporter: { | ||
outputDir: "", // results will be saved as $outputDir/$browserName.xml | ||
outputFile: "test-results.browser.xml", // if included, results will be saved as $outputDir/$browserName/$outputFile | ||
suite: "", // suite will become the package name attribute in xml testsuite element | ||
useBrowserName: false, // add browser name to report and classes names | ||
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element | ||
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element | ||
properties: {} // key value pair of properties to add to the <properties> section of the report | ||
}, | ||
|
||
// web server port | ||
port: 9876, | ||
|
||
// enable / disable colors in the output (reporters and logs) | ||
colors: true, | ||
|
||
// level of logging | ||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
logLevel: config.LOG_INFO, | ||
|
||
// enable / disable watching file and executing tests whenever any file changes | ||
autoWatch: false, | ||
|
||
// start these browsers | ||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
// 'ChromeHeadless', 'Chrome', 'Firefox', 'Edge', 'IE' | ||
browsers: ["ChromeHeadless"], | ||
|
||
// Continuous Integration mode | ||
// if true, Karma captures browsers, runs the tests and exits | ||
singleRun: true, | ||
|
||
// Concurrency level | ||
// how many browser should be started simultaneous | ||
concurrency: 1, | ||
|
||
browserNoActivityTimeout: 600000, | ||
browserDisconnectTimeout: 10000, | ||
browserDisconnectTolerance: 3, | ||
|
||
client: { | ||
mocha: { | ||
// change Karma's debug.html to the mocha web reporter | ||
reporter: "html", | ||
timeout: "600000" | ||
} | ||
} | ||
}); | ||
}; |
Oops, something went wrong.