Skip to content

Commit c01f5ad

Browse files
Fixed all the scripts in package.json (Azure#13385)
* Fixed all the scripts in package.json * Minor Formatting * Update sdk/quantum/quantum-jobs/package.json Co-authored-by: Harsha Nalluru <[email protected]> * Update sdk/quantum/quantum-jobs/package.json Co-authored-by: Harsha Nalluru <[email protected]> * Update sdk/quantum/quantum-jobs/package.json Co-authored-by: Harsha Nalluru <[email protected]> * Update sdk/quantum/quantum-jobs/package.json Co-authored-by: Harsha Nalluru <[email protected]> * Update sdk/quantum/quantum-jobs/package.json Co-authored-by: Harsha Nalluru <[email protected]> * Update sdk/quantum/quantum-jobs/package.json Co-authored-by: Harsha Nalluru <[email protected]> * Update sdk/quantum/quantum-jobs/rollup.base.config.js Co-authored-by: Harsha Nalluru <[email protected]> * Update sdk/quantum/quantum-jobs/rollup.base.config.js Co-authored-by: Harsha Nalluru <[email protected]> * Update sdk/quantum/quantum-jobs/rollup.base.config.js Co-authored-by: Harsha Nalluru <[email protected]> * Update sdk/quantum/quantum-jobs/test/public/quantumJobClient.spec.ts Co-authored-by: Harsha Nalluru <[email protected]> * Add License Headers * Fix the Headers * Fix the Types Path * Update sdk/quantum/quantum-jobs/package.json Co-authored-by: Harsha Nalluru <[email protected]> * Added License Text File * Update sdk/quantum/quantum-jobs/package.json Co-authored-by: Harsha Nalluru <[email protected]> * Update sdk/quantum/quantum-jobs/rollup.base.config.js Co-authored-by: Harsha Nalluru <[email protected]> Co-authored-by: Harsha Nalluru <[email protected]>
1 parent 332f56a commit c01f5ad

File tree

7 files changed

+421
-81
lines changed

7 files changed

+421
-81
lines changed

sdk/quantum/quantum-jobs/api-extractor.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3-
"mainEntryPointFilePath": "./types/index.d.ts",
3+
"mainEntryPointFilePath": "./types/src/index.d.ts",
44
"docModel": { "enabled": true },
55
"apiReport": { "enabled": true, "reportFolder": "./review" },
66
"dtsRollup": {
77
"enabled": true,
88
"untrimmedFilePath": "",
9-
"publicTrimmedFilePath": "./esm/index.d.ts"
9+
"publicTrimmedFilePath": "./types/latest/quantum-jobs.d.ts"
1010
},
1111
"messages": {
1212
"tsdocMessageReporting": { "default": { "logLevel": "none" } },
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
// https://github.com/karma-runner/karma-chrome-launcher
2+
process.env.CHROME_BIN = require("puppeteer").executablePath();
3+
require("dotenv").config();
4+
5+
module.exports = function(config) {
6+
config.set({
7+
// base path that will be used to resolve all patterns (eg. files, exclude)
8+
basePath: "./",
9+
10+
// frameworks to use
11+
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
12+
frameworks: ["mocha"],
13+
14+
plugins: [
15+
"karma-mocha",
16+
"karma-mocha-reporter",
17+
"karma-chrome-launcher",
18+
"karma-edge-launcher",
19+
"karma-firefox-launcher",
20+
"karma-ie-launcher",
21+
"karma-env-preprocessor",
22+
"karma-coverage",
23+
"karma-sourcemap-loader",
24+
"karma-junit-reporter"
25+
],
26+
27+
// list of files / patterns to load in the browser
28+
files: [
29+
// polyfill service supporting IE11 missing features
30+
// Promise,String.prototype.startsWith,String.prototype.endsWith,String.prototype.repeat,String.prototype.includes,Array.prototype.includes,Object.keys
31+
"https://cdn.polyfill.io/v2/polyfill.js?features=Promise,String.prototype.startsWith,String.prototype.endsWith,String.prototype.repeat,String.prototype.includes,Array.prototype.includes,Object.keys|always",
32+
"test-browser/index.js",
33+
{ pattern: "test-browser/index.js.map", type: "html", included: false, served: true }
34+
],
35+
36+
// list of files / patterns to exclude
37+
exclude: [],
38+
39+
// preprocess matching files before serving them to the browser
40+
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
41+
preprocessors: {
42+
"**/*.js": ["env"]
43+
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
44+
// Preprocess source file to calculate code coverage, however this will make source file unreadable
45+
// "test-browser/index.js": ["coverage"]
46+
},
47+
48+
// inject following environment values into browser testing with window.__env__
49+
// environment values MUST be exported or set with same console running "karma start"
50+
// https://www.npmjs.com/package/karma-env-preprocessor
51+
envPreprocessor: [
52+
"AZURE_CLIENT_ID",
53+
"AZURE_CLIENT_SECRET",
54+
"AZURE_TENANT_ID",
55+
"TEST_MODE"
56+
],
57+
58+
// test results reporter to use
59+
// possible values: 'dots', 'progress'
60+
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
61+
reporters: ["mocha", "coverage", "junit"],
62+
63+
coverageReporter: {
64+
// specify a common output directory
65+
dir: "coverage-browser/",
66+
reporters: [
67+
{ type: "json", subdir: ".", file: "coverage.json" },
68+
{ type: "lcovonly", subdir: ".", file: "lcov.info" },
69+
{ type: "html", subdir: "html" },
70+
{ type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" }
71+
]
72+
},
73+
74+
junitReporter: {
75+
outputDir: "", // results will be saved as $outputDir/$browserName.xml
76+
outputFile: "test-results.browser.xml", // if included, results will be saved as $outputDir/$browserName/$outputFile
77+
suite: "", // suite will become the package name attribute in xml testsuite element
78+
useBrowserName: false, // add browser name to report and classes names
79+
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
80+
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
81+
properties: {} // key value pair of properties to add to the <properties> section of the report
82+
},
83+
84+
// web server port
85+
port: 9876,
86+
87+
// enable / disable colors in the output (reporters and logs)
88+
colors: true,
89+
90+
// level of logging
91+
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
92+
logLevel: config.LOG_INFO,
93+
94+
// enable / disable watching file and executing tests whenever any file changes
95+
autoWatch: false,
96+
97+
// start these browsers
98+
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
99+
// 'ChromeHeadless', 'Chrome', 'Firefox', 'Edge', 'IE'
100+
browsers: ["ChromeHeadlessNoSandbox"],
101+
customLaunchers: {
102+
ChromeHeadlessNoSandbox: {
103+
base: "ChromeHeadless",
104+
flags: ["--no-sandbox"]
105+
}
106+
},
107+
108+
// Continuous Integration mode
109+
// if true, Karma captures browsers, runs the tests and exits
110+
singleRun: false,
111+
112+
// Concurrency level
113+
// how many browser should be started simultaneous
114+
concurrency: 1,
115+
116+
browserNoActivityTimeout: 600000,
117+
browserDisconnectTimeout: 10000,
118+
browserDisconnectTolerance: 3,
119+
120+
client: {
121+
mocha: {
122+
// change Karma's debug.html to the mocha web reporter
123+
reporter: "html",
124+
timeout: "600000"
125+
}
126+
}
127+
});
128+
};

sdk/quantum/quantum-jobs/package.json

Lines changed: 81 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -6,79 +6,110 @@
66
"dependencies": {
77
"@azure/core-paging": "^1.1.1",
88
"@azure/core-http": "^1.2.0",
9-
"tslib": "^2.0.0"
9+
"tslib": "^2.0.0",
10+
"@opentelemetry/api": "^0.10.2"
1011
},
1112
"keywords": [
1213
"node",
1314
"azure",
1415
"typescript",
1516
"browser",
16-
"isomorphic"
17+
"isomorphic",
18+
"cloud"
1719
],
1820
"license": "MIT",
19-
"main": "./dist/quantum-jobs.js",
20-
"module": "./esm/index.js",
21-
"types": "./esm/index.d.ts",
21+
"main": "dist/index.js",
22+
"module": "./dist-esm/src/index.js",
23+
"types": "./types/latest/quantum-jobs.d.ts",
2224
"devDependencies": {
23-
"typescript": "4.1.2",
24-
"rollup": "^1.16.3",
2525
"rollup-plugin-node-resolve": "^3.4.0",
26+
"mkdirp": "^1.0.4",
27+
"@azure/dev-tool": "^1.0.0",
28+
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
29+
"@azure/identity": "^1.1.0",
30+
"@azure/test-utils-recorder": "^1.0.0",
31+
"@microsoft/api-extractor": "7.7.11",
32+
"@rollup/plugin-commonjs": "11.0.2",
33+
"@rollup/plugin-inject": "^4.0.0",
34+
"@rollup/plugin-json": "^4.0.0",
35+
"@rollup/plugin-multi-entry": "^3.0.0",
36+
"@rollup/plugin-node-resolve": "^8.0.0",
37+
"@rollup/plugin-replace": "^2.2.0",
38+
"@types/chai": "^4.1.6",
39+
"@types/mocha": "^7.0.2",
40+
"@types/node": "^8.0.0",
41+
"@types/sinon": "^9.0.4",
42+
"assert": "^1.4.1",
43+
"chai": "^4.2.0",
44+
"dotenv": "^8.2.0",
45+
"eslint": "^7.15.0",
46+
"esm": "^3.2.18",
47+
"karma": "^5.1.0",
48+
"karma-chrome-launcher": "^3.0.0",
49+
"karma-coverage": "^2.0.0",
50+
"karma-edge-launcher": "^0.4.2",
51+
"karma-env-preprocessor": "^0.1.1",
52+
"karma-firefox-launcher": "^1.1.0",
53+
"karma-ie-launcher": "^1.0.0",
54+
"karma-junit-reporter": "^2.0.1",
55+
"karma-mocha": "^2.0.1",
56+
"karma-mocha-reporter": "^2.2.5",
57+
"karma-sourcemap-loader": "^0.3.8",
58+
"mocha": "^7.1.1",
59+
"mocha-junit-reporter": "^1.18.0",
60+
"nock": "^12.0.3",
61+
"nyc": "^14.0.0",
62+
"prettier": "^1.16.4",
63+
"rimraf": "^3.0.0",
64+
"rollup": "^1.16.3",
65+
"rollup-plugin-shim": "^1.0.0",
2666
"rollup-plugin-sourcemaps": "^0.4.2",
67+
"rollup-plugin-terser": "^5.1.1",
68+
"sinon": "^9.0.2",
69+
"ts-node": "^8.3.0",
70+
"typescript": "4.1.2",
2771
"uglify-js": "^3.4.9",
28-
"@microsoft/api-extractor": "7.7.11",
29-
"mkdirp": "^1.0.4"
72+
"cross-env": "^7.0.2",
73+
"typedoc": "0.15.2"
3074
},
3175
"homepage": "https://github.com/Azure/azure-sdk-for-js",
32-
"repository": {
33-
"type": "git",
34-
"url": "https://github.com/Azure/azure-sdk-for-js.git"
35-
},
76+
"repository": "github:Azure/azure-sdk-for-js",
3677
"bugs": {
3778
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
3879
},
3980
"files": [
40-
"dist/**/*.js",
41-
"dist/**/*.js.map",
42-
"dist/**/*.d.ts",
43-
"dist/**/*.d.ts.map",
44-
"esm/**/*.js",
45-
"esm/**/*.js.map",
46-
"esm/**/*.d.ts",
47-
"esm/**/*.d.ts.map",
48-
"./src//**/*.ts",
81+
"dist/",
82+
"dist-esm/src/",
4983
"README.md",
50-
"rollup.config.js",
51-
"tsconfig.json"
84+
"LICENSE.txt"
5285
],
5386
"scripts": {
54-
"build": "tsc && rollup -c rollup.config.js && mkdirp ./review && npm run extract-api",
87+
"build": "npm run build:node && npm run build:browser",
88+
"build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1 && npm run extract-api",
89+
"build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1",
90+
"build:test": "npm run build:test:node && npm run build:test:browser",
91+
"build:test:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c rollup.test.config.js 2>&1",
92+
"build:test:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c rollup.test.config.js 2>&1",
93+
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
5594
"clean": "rimraf dist dist-esm dist-browser test-dist test-browser types *.tgz *.log",
56-
"extract-api": "api-extractor run --local",
95+
"extract-api": "tsc -p . && api-extractor run --local",
96+
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
97+
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix",
98+
"lint": "eslint package.json api-extractor.json src test --ext .ts -f html -o quantum-jobs-lintReport.html || exit 0",
99+
"prebuild": "npm run clean",
100+
"pack": "npm pack 2>&1",
101+
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
102+
"integration-test:browser": "karma start --single-run",
103+
"integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 180000 --full-trace dist-esm/test/*.spec.js dist-esm/test/**/*.spec.js",
104+
"test:browser": "npm run clean && npm run build:test:browser && npm run unit-test:browser",
105+
"test:node": "npm run clean && npm run build:test:node && npm run unit-test:node",
106+
"test": "npm run clean && npm run test:node && npm run test:browser",
107+
"unit-test:browser": "karma start --single-run",
108+
"unit-test:node": "mocha --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 180000 --full-trace test-dist/index.node.js",
109+
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
110+
"docs": "typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src",
57111
"build:samples": "echo skip",
58-
"build:node": "echo skip",
59-
"build:browser": "echo skip",
60-
"build:test": "echo skip",
61-
"build:test:node": "echo skip",
62-
"build:test:browser": "echo skip",
63-
"check-format": "echo skip",
64-
"coverage": "echo skip",
65-
"execute:samples": "echo skip",
66-
"format": "echo skip",
67-
"lint:fix": "echo skip",
68-
"lint": "echo skip",
69-
"prebuild": "echo skip",
70-
"pack": "echo skip",
71-
"swagger": "echo skip",
72-
"integration-test": "echo skip",
73-
"integration-test:browser": "echo skip",
74-
"integration-test:node": "echo skip",
75-
"test": "echo skip",
76-
"test:browser": "echo skip",
77-
"test:node": "echo skip",
78-
"unit-test": "echo skip",
79-
"unit-test:browser": "echo skip",
80-
"unit-test:node": "echo skip",
81-
"docs": "echo skip"
112+
"execute:samples": "echo skip"
82113
},
83114
"sideEffects": false
84115
}

0 commit comments

Comments
 (0)