Standardize test scripts in projects within Rush workspace

This commit is contained in:
Brandon Siegel 2019-05-02 19:07:36 -07:00
Родитель 10bd28a4cb
Коммит 0fc1a953e9
20 изменённых файлов: 294 добавлений и 332 удалений

Просмотреть файл

@ -122,18 +122,29 @@ By default, Rush only displays things written to `STDERR`. If you want to see th
#### Other NPM scripts
Most package scripts are exposed as Rush commands. Use `rush <scriptname>` in place of `npm run <scriptname>` to run the package script in all projects. Navigate to a project's directory and substitute `rushx` for `rush` to run the script for just the current project.
Most package scripts are exposed as Rush commands. Use `rush <scriptname>` in place of `npm run <scriptname>` to run the package script in all projects. Navigate to a project's directory and substitute `rushx` for `rush` to run the script for just the current project. Run `rush <scriptname> --help` for more information about each script.
All projects have at least the following scripts:
- `test`: Run tests (specifics vary by project)
- `audit`: Run `npm audit` on the project (with some workarounds for Rush)
- `build`: Build the project's production artifacts (Node and browser bundles)
- `build:test`: Build the project's test artifacts only
- `check-format`: Show Prettier formatting issues within the project
- `clean`: Remove generated and temporary files
- `lint`: Run tslint / eslint
- `format`: Run Prettier and reformat files to match the formatting guidelines
- `check-format`: Run Prettier display format issues without making any changes
- `pack`: Run `npm pack`
- `format`: Reformat project files with Prettier
- `integration-test:browser`: Execute browser integration tests
- `integration-test:node`: Execute Node integration tests
- `integration-test`: Execute all integration tests
- `lint:fix`: Fix ESLint issues within the project
- `lint`: Show ESLint issues within the project
- `pack`: Run `npm pack` on the project
- `test:browser`: Execute browser dev tests
- `test:node`: Execute Node dev tests
- `test`: Execute all dev tests
- `unit-test:browser`: Execute browser unit tests
- `unit-test:node`: Execute Node unit tests
- `unit-test`: Execute all unit tests
Projects may optionally have the following scripts:
- `unit-node`: Run NodeJS tests against the Node package
- `unit-browser`: Run browser tests against the browser bundle
- `extract-api`: Run API Extractor to show API issues and generate API reports
#### Getting back to a clean state

Просмотреть файл

@ -11,111 +11,18 @@
* "rush my-global-command --help".
*/
"commands": [
// {
// /**
// * (Required) Determines the type of custom command.
// * Rush's "bulk" commands are invoked separately for each project. Rush will look in
// * each project's package.json file for a "scripts" entry whose name matches the
// * command name. By default, the command will run for every project in the repo,
// * according to the dependency graph (similar to how "rush build" works).
// * The set of projects can be restricted e.g. using the "--to" or "--from" parameters.
// */
// "commandKind": "bulk",
//
// /**
// * (Required) The name that will be typed as part of the command line. This is also the name
// * of the "scripts" hook in the project's package.json file.
// * The name should be comprised of lower case words separated by hyphens.
// */
// "name": "my-bulk-command",
//
// /**
// * (Required) A short summary of the custom command to be shown when printing command line
// * help, e.g. "rush --help".
// */
// "summary": "Example bulk custom command",
//
// /**
// * A detailed description of the command to be shown when printing command line
// * help (e.g. "rush --help my-command").
// * If omitted, the "summary" text will be shown instead.
// *
// * Whenever you introduce commands/parameters, taking a little time to write meaningful
// * documentation can make a big difference for the developer experience in your repo.
// */
// "description": "This is an example custom command that runs separately for each project",
//
// /**
// * By default, Rush operations acquire a lock file which prevents multiple commands from executing simultaneously
// * in the same repo folder. (For example, it would be a mistake to run "rush install" and "rush build" at the
// * same time.) If your command makes sense to run concurrently with other operations,
// * set "safeForSimultaneousRushProcesses" to true to disable this protection.
// *
// * In particular, this is needed for custom scripts that invoke other Rush commands.
// */
// "safeForSimultaneousRushProcesses": false,
//
// /**
// * (Required) If true, then this command is safe to be run in parallel, i.e. executed
// * simultaneously for multiple projects. Similar to "rush build", regardless of parallelism
// * projects will not start processing until their dependencies have completed processing.
// */
// "enableParallelism": false,
//
// /**
// * Normally Rush requires that each project's package.json has a "scripts" entry matching
// * the custom command name. To disable this check, set "ignoreMissingScript" to true;
// * projects with a missing definition will be skipped.
// */
// "ignoreMissingScript": false
// },
//
// {
// /**
// * (Required) Determines the type of custom command.
// * Rush's "global" commands are invoked once for the entire repo.
// */
// "commandKind": "global",
//
// "name": "my-global-command",
// "summary": "Example global custom command",
// "description": "This is an example custom command that runs once for the entire repo",
//
// "safeForSimultaneousRushProcesses": false,
//
// /**
// * A script that will be invoked using the OS shell. The working directory will be the folder
// * that contains rush.json. If custom parameters are associated with this command, their
// * values will be appended to the end of this string.
// */
// "shellCommand": "node common/scripts/my-global-command.js"
// }
// Required Scripts
{
"commandKind": "bulk",
"name": "test",
"summary": "Test projects",
"name": "audit",
"summary": "Audit projects",
"enableParallelism": true
},
{
"commandKind": "bulk",
"name": "unit-node",
"summary": "Run live tests for Node packages",
"enableParallelism": true,
"ignoreMissingScript": true
},
{
"commandKind": "bulk",
"name": "unit-browser",
"summary": "Run live tests for browser bundles",
"enableParallelism": true,
"ignoreMissingScript": true
},
{
"commandKind": "bulk",
"name": "extract-api",
"summary": "Run API Extractor on projects",
"enableParallelism": true,
"ignoreMissingScript": true
"name": "build:test",
"summary": "Build the test targets only in projects",
"enableParallelism": true
},
{
"commandKind": "bulk",
@ -123,24 +30,49 @@
"summary": "Show formatting issues within projects",
"enableParallelism": true
},
{
"commandKind": "bulk",
"name": "format",
"summary": "Reformat projects",
"enableParallelism": true
},
{
"commandKind": "bulk",
"name": "lint",
"summary": "Lint projects",
"enableParallelism": true
},
{
"commandKind": "bulk",
"name": "clean",
"summary": "Clean projects",
"enableParallelism": true
},
{
"commandKind": "bulk",
"name": "format",
"summary": "Reformat projects",
"enableParallelism": true
},
{
"commandKind": "bulk",
"name": "integration-test:browser",
"summary": "Execute browser integration tests defined in projects",
"enableParallelism": true
},
{
"commandKind": "bulk",
"name": "integration-test:node",
"summary": "Execute Node integration tests defined in projects",
"enableParallelism": true
},
{
"commandKind": "bulk",
"name": "integration-test",
"summary": "Execute integration tests defined in projects",
"description": "Execute tests which require an actual service instance (live Azure, emulator, etc). Integration tests typically require service endpoints to be specified via environment variables in order to run.",
"enableParallelism": true
},
{
"commandKind": "bulk",
"name": "lint:fix",
"summary": "Fix linting errors for projects",
"enableParallelism": true
},
{
"commandKind": "bulk",
"name": "lint",
"summary": "Lint projects",
"enableParallelism": true
},
{
"commandKind": "bulk",
"name": "pack",
@ -149,10 +81,66 @@
},
{
"commandKind": "bulk",
"name": "audit",
"summary": "Audit projects",
"name": "test:browser",
"summary": "Execute browser dev tests defined in projects",
"enableParallelism": true
},
{
"commandKind": "bulk",
"name": "test:node",
"summary": "Execute Node dev tests defined in projects",
"enableParallelism": true
},
{
"commandKind": "bulk",
"name": "test",
"summary": "Execute dev tests defined in projects",
"description": "Execute any tests which a developer typically runs in their inner dev loop. Dev tests *should* just refer to other test scripts, but they don't have to. This command is never run by the build server.",
"enableParallelism": true
},
{
"commandKind": "bulk",
"name": "unit-test:browser",
"summary": "Execute browser unit tests defined in projects",
"enableParallelism": true
},
{
"commandKind": "bulk",
"name": "unit-test:node",
"summary": "Execute Node unit tests defined in projects",
"enableParallelism": true
},
{
"commandKind": "bulk",
"name": "unit-test",
"summary": "Execute unit tests defined in projects",
"description": "Execute tests which don't need to connect to any external service.",
"enableParallelism": true
},
// Optional Scripts
{
"commandKind": "bulk",
"name": "extract-api",
"summary": "Run API Extractor on projects",
"enableParallelism": true,
"ignoreMissingScript": true
},
// Global Commands
{
"commandKind": "global",
"name": "list-files",
"summary": "List files within Rush project directories",
"shellCommand": "node common/scripts/list-files.js"
},
{
"commandKind": "global",
"name": "reset-workspace",
"summary": "Reset your workspace - !!DANGER!! unlink dependencies, purge downloaded node_modules, and remove all untracked files and directories",
"safeForSimultaneousRushProcesses": true,
"shellCommand": "rush unlink && echo \"\nStarting \\\"git clean\\\"\" && git clean -dfx && rush purge"
},
{
"commandKind": "global",
"name": "sync-versions",
@ -165,19 +153,6 @@
"summary": "Unlink dependencies and purge downloaded node_modules",
"safeForSimultaneousRushProcesses": true,
"shellCommand": "rush unlink && rush purge"
},
{
"commandKind": "global",
"name": "reset-workspace",
"summary": "Reset your workspace - !!DANGER!! unlink dependencies, purge downloaded node_modules, and remove all untracked files and directories",
"safeForSimultaneousRushProcesses": true,
"shellCommand": "rush unlink && echo \"\nStarting \\\"git clean\\\"\" && git clean -dfx && rush purge"
},
{
"commandKind": "global",
"name": "list-files",
"summary": "List files within Rush project directories",
"shellCommand": "node common/scripts/list-files.js"
}
],
@ -186,94 +161,6 @@
* For example, you might define a "--production" parameter for the "rush build" command.
*/
"parameters": [
// {
// /**
// * (Required) Determines the type of custom parameter.
// * A "flag" is a custom command-line parameter whose presence acts as an on/off switch.
// */
// "parameterKind": "flag",
//
// /**
// * (Required) The long name of the parameter. It must be lower-case and use dash delimiters.
// */
// "longName": "--my-flag",
//
// /**
// * An optional alternative short name for the parameter. It must be a dash followed by a single
// * lower-case or upper-case letter, which is case-sensitive.
// *
// * NOTE: The Rush developers recommend that automation scripts should always use the long name
// * to improve readability. The short name is only intended as a convenience for humans.
// * The alphabet letters run out quickly, and are difficult to memorize, so *only* use
// * a short name if you expect the parameter to be needed very often in everyday operations.
// */
// "shortName": "-m",
//
// /**
// * (Required) A long description to be shown in the command-line help.
// *
// * Whenever you introduce commands/parameters, taking a little time to write meaningful
// * documentation can make a big difference for the developer experience in your repo.
// */
// "description": "A custom flag parameter that is passed to the scripts that are invoked when building projects",
//
// /**
// * (Required) A list of custom commands and/or built-in Rush commands that this parameter may
// * be used with. The parameter will be appended to the shell command that Rush invokes.
// */
// "associatedCommands": [ "build", "rebuild" ]
// },
//
// {
// /**
// * (Required) Determines the type of custom parameter.
// * A "flag" is a custom command-line parameter whose presence acts as an on/off switch.
// */
// "parameterKind": "choice",
// "longName": "--my-choice",
// "description": "A custom choice parameter for the \"my-global-command\" custom command",
//
// "associatedCommands": [ "my-global-command" ],
//
// /**
// * Normally if a parameter is omitted from the command line, it will not be passed
// * to the shell command. this value will be inserted by default. Whereas if a "defaultValue"
// * is defined, the parameter will always be passed to the shell command, and will use the
// * default value if unspecified. The value must be one of the defined alternatives.
// */
// "defaultValue": "vanilla",
//
// /**
// * (Required) A list of alternative argument values that can be chosen for this parameter.
// */
// "alternatives": [
// {
// /**
// * A token that is one of the alternatives that can be used with the choice parameter,
// * e.g. "vanilla" in "--flavor vanilla".
// */
// "name": "vanilla",
//
// /**
// * A detailed description for the alternative that can be shown in the command-line help.
// *
// * Whenever you introduce commands/parameters, taking a little time to write meaningful
// * documentation can make a big difference for the developer experience in your repo.
// */
// "description": "Use the vanilla flavor (the default)"
// },
//
// {
// "name": "chocolate",
// "description": "Use the chocolate flavor"
// },
//
// {
// "name": "strawberry",
// "description": "Use the strawberry flavor"
// }
// ]
// }
{
"parameterKind": "flag",
"longName": "--sync-peers",

Просмотреть файл

@ -82,26 +82,24 @@
],
"scripts": {
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
"clean": "rimraf dist dist-esm typings temp browser/*.js* browser/*.zip statistics.html coverage coverage-browser .nyc_output *.tgz *.log test*.xml TEST*.xml",
"build:test": "tsc -p . && rollup -c rollup.test.config.js 2>&1",
"build": "tsc -p . && rollup -c 2>&1",
"check-format": "prettier --list-different --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf dist dist-esm typings temp browser/*.js* browser/*.zip statistics.html coverage coverage-browser test-browser .nyc_output *.tgz *.log test*.xml TEST*.xml",
"format": "prettier --write --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"tslint": "tslint -p . -c tslint.json --exclude samples/**/*.ts --exclude test/**/*.ts",
"lint": "npm run tslint",
"tsc": "tsc",
"prebuild": "rimraf dist typings dist-esm test-browser test-dist",
"build:node": "npm run tslint && npm run tsc && cross-env rollup -c",
"build:browser-test": "npm run tslint && npm run tsc && rollup -c rollup.test.config.js",
"build": "npm run build:node && npm run build:browser-test",
"unit": "cross-env TS_NODE_FILES=true TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\":\\\"commonjs\\\"}\" nyc --reporter=lcov --reporter=text-lcov mocha -r ts-node/register -t 50000 ./test/**/*.spec.ts",
"pretest": "npm run build:node && npm run build:browser-test",
"test:node": "npm run build:node && npm run unit",
"test:browser": "npm run build:browser-test && karma start",
"test": "npm run test:node",
"unit-test:browser": "npm run build:browser-test && npm run test:browser",
"unit-test:node": "npm run build:node && npm run test:node",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"prepack": "npm i && npm run build:node",
"pack": "npm pack 2>&1"
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "tslint -p . -c tslint.json --exclude samples/**/*.ts --exclude test/**/*.ts --fix",
"lint": "tslint -p . -c tslint.json --exclude samples/**/*.ts --exclude test/**/*.ts",
"pack": "npm pack 2>&1",
"prebuild": "npm run clean",
"test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node",
"test": "npm run build:test && npm run unit-test && npm run integration-test",
"unit-test:browser": "karma start --single-run",
"unit-test:node": "cross-env TS_NODE_FILES=true TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\":\\\"commonjs\\\"}\" nyc --reporter=lcov --reporter=text-lcov mocha -r ts-node/register -t 50000 ./test/**/*.spec.ts",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/%40azure/amqp-common_1.0.0-preview.4/sdk/core/amqp-common",
"repository": {

Просмотреть файл

@ -38,12 +38,12 @@ jobs:
- script: node common/scripts/install-run-rush.js install
displayName: "rush install"
- script: cd sdk/cosmosdb/cosmos && npm run build-dev
displayName: "npm run build"
- script: cd sdk/cosmosdb/cosmos && npm run build:test
displayName: "npm run build:test"
- bash: cd sdk/cosmosdb/cosmos && ACCOUNT_HOST=$COSMOSDBEMULATOR_ENDPOINT NODE_TLS_REJECT_UNAUTHORIZED="0" npm run integration-test -- --reporter mocha-multi-reporters --reporter-options spec=-,mocha-junit-reporter=- $(AdditionalTestArguments)
failOnStderr: true
displayName: "npm test"
displayName: "npm run integration-test"
env:
MOCHA_TIMEOUT: 100000

Просмотреть файл

@ -36,12 +36,12 @@ jobs:
- script: node common/scripts/install-run-rush.js install
displayName: "rush install"
- script: cd sdk/cosmosdb/cosmos && npm run build-dev
displayName: "npm run build"
- script: cd sdk/cosmosdb/cosmos && npm run build:test
displayName: "npm run build:test"
- bash: cd sdk/cosmosdb/cosmos && ACCOUNT_HOST=$COSMOSDBEMULATOR_ENDPOINT NODE_TLS_REJECT_UNAUTHORIZED="0" npm run integration-test -- --reporter mocha-multi-reporters --reporter-options spec=-,mocha-junit-reporter=- $(AdditionalTestArguments)
failOnStderr: true
displayName: "npm test"
displayName: "npm run integration-test"
env:
MOCHA_TIMEOUT: 100000

Просмотреть файл

@ -20,21 +20,30 @@
},
"scripts": {
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
"clean": "rimraf lib",
"lint": "tslint --project tsconfig.json",
"format": "prettier --write --config .prettierrc.json \"src/**/*.ts\"",
"build:dev": "npm run check-format && npm run lint && npm run build:test",
"build:test": "npm run compile:dev && npm run webpack:dev",
"build": "npm run compile && npm run webpack",
"check-format": "prettier --list-different --config .prettierrc.json \"src/**/*.ts\"",
"compile-dev": "echo Using TypeScript && tsc --version && tsc --pretty",
"clean": "rimraf lib",
"compile:dev": "echo Using TypeScript && tsc --version && tsc --pretty",
"compile": "echo Using TypeScript && tsc --version && tsc -p tsconfig.prod.json --pretty",
"format": "prettier --write --config .prettierrc.json \"src/**/*.ts\"",
"integration-test:browser": "echo skipped",
"integration-test:node": "mocha -r ./src/test/common/setup.ts ./lib/src/test/ --recursive --timeout 100000 -i -g .*ignore.js",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "tslint --project tsconfig.json --fix",
"lint": "tslint --project tsconfig.json",
"pack": "npm pack 2>&1",
"webpack-dev": "webpack -d",
"webpack": "webpack -p",
"build-dev": "npm run clean && npm run check-format && npm run lint && npm run compile-dev && npm run webpack-dev",
"build": "npm run clean && npm run check-format && npm run lint && npm run compile && npm run webpack",
"test": "echo Temporarily skipped. Current CI executes all unit tests using 'test' script. Cosmos emulator tests have their own builds",
"integration-test": "mocha -r ./src/test/common/setup.ts ./lib/src/test/ --recursive --timeout 100000 -i -g .*ignore.js",
"test-ts": "mocha -r ts-node/register -r ./src/test/common/setup.ts ./src/test/**/*.spec.ts --recursive --timeout 100000 -i -g .*ignore.js",
"ci": "npm run build && npm run test && node ts-test.js"
"prebuild": "npm run clean",
"smoke-test": "node ts-test.js",
"test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node",
"test": "npm run build:test && npm run unit-test && npm run integration-test",
"unit-test:browser": "echo skipped",
"unit-test:node": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"webpack:dev": "webpack -d",
"webpack": "webpack -p"
},
"devDependencies": {
"@types/mocha": "^5.2.5",

4
sdk/eventhub/event-hubs/.vscode/launch.json поставляемый
Просмотреть файл

@ -18,14 +18,14 @@
"${workspaceFolder}/test-dist/index.js"
],
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": "npm: build-test"
"preLaunchTask": "npm: build:test"
},
{
"type": "node",
"request": "launch",
"name": "Client Example",
"program": "${file}",
"preLaunchTask": "npm: build-samples",
"preLaunchTask": "npm: build:samples",
"outFiles": [
"${workspaceFolder}/dist-esm/**/*.js"
],

Просмотреть файл

@ -33,23 +33,29 @@
],
"scripts": {
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
"build-browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1",
"build-node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1",
"build-samples": "cd samples && tsc -p .",
"build-test": "tsc -p . && cross-env ONLY_NODE=true rollup -c rollup.test.config.js 2>&1",
"build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1",
"build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1",
"build:samples": "cd samples && tsc -p .",
"build:test": "tsc -p . && cross-env ONLY_NODE=true rollup -c rollup.test.config.js 2>&1",
"build": "tsc -p . && rollup -c 2>&1",
"check-format": "prettier --list-different --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf dist dist-esm test-dist typings *.tgz *.log",
"coverage": "npm run build-test && nyc --reporter=lcov --exclude-after-remap=false mocha -t 120000 test-dist/index.js",
"coverage": "nyc --reporter=lcov --exclude-after-remap=false mocha -t 120000 test-dist/index.js",
"extract-api": "tsc -p . && api-extractor run --local",
"format": "prettier --write --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"integration-test:browser": "echo skipped",
"integration-test:node": "mocha -t 120000 test-dist/index.js",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "tslint -p . -c tslint.json --fix",
"lint": "tslint -p . -c tslint.json",
"pack": "npm pack 2>&1",
"prebuild": "npm run clean",
"pretest": "npm run build-test",
"test": "npm run build",
"tsc": "tsc",
"unit-node": "npm run build-test && mocha -t 120000 test-dist/index.js"
"test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node",
"test": "npm run build:test && npm run unit-test && npm run integration-test",
"unit-test:browser": "echo skipped",
"unit-test:node": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
"dependencies": {
"@azure/amqp-common": "^1.0.0-preview.3",

Просмотреть файл

@ -18,7 +18,7 @@
"${workspaceFolder}/test-dist/index.js"
],
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": "npm: build-test",
"preLaunchTask": "npm: build:test",
"envFile": "${workspaceFolder}/.env" // You can take a look at the sample.env file for supported environment variables.
},
{
@ -29,7 +29,7 @@
"outFiles": [
"${workspaceFolder}/dist-esm/**/*.js"
],
"preLaunchTask": "npm: build-samples",
"preLaunchTask": "npm: build:samples",
"envFile": "${workspaceFolder}/.env" // You can take a look at the sample.env file for supported environment variables.
}
]

Просмотреть файл

@ -32,23 +32,29 @@
],
"scripts": {
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
"build-browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1",
"build-node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1",
"build-samples": "cd examples && tsc -p .",
"build-test": "tsc -p . && cross-env ONLY_NODE=true rollup -c rollup.test.config.js 2>&1",
"build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1",
"build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1",
"build:samples": "cd samples && tsc -p .",
"build:test": "tsc -p . && cross-env ONLY_NODE=true rollup -c rollup.test.config.js 2>&1",
"build": "tsc -p . && rollup -c 2>&1",
"check-format": "prettier --list-different --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf dist dist-esm test-dist typings *.tgz *.log",
"coverage": "npm run build-test && nyc --reporter=lcov --exclude-after-remap=false mocha -t 120000 test-dist/index.js",
"coverage": "nyc --reporter=lcov --exclude-after-remap=false mocha -t 120000 test-dist/index.js",
"extract-api": "tsc -p . && api-extractor run --local",
"format": "prettier --write --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"integration-test:browser": "echo skipped",
"integration-test:node": "mocha -t 120000 test-dist/index.js",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "tslint -p . -c tslint.json --fix",
"lint": "tslint -p . -c tslint.json",
"pack": "npm pack 2>&1",
"prebuild": "npm run clean",
"pretest": "npm run build-test",
"test": "npm run build",
"tsc": "tsc",
"unit-node": "npm run build-test && mocha -t 120000 test-dist/index.js"
"test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node",
"test": "npm run build:test && npm run unit-test && npm run integration-test",
"unit-test:browser": "echo skipped",
"unit-test:node": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
"dependencies": {
"@azure/event-hubs": "^1.0.6",

Просмотреть файл

@ -30,14 +30,24 @@
},
"scripts": {
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
"build:test": "npm run build",
"build": "tsc",
"check-format": "true",
"check-format": "echo skipped",
"clean": "rimraf dist dist-esm test-dist typings *.tgz *.log",
"format": "true",
"lint": "true",
"format": "echo skipped",
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "echo skipped",
"lint": "echo skipped",
"pack": "npm pack 2>&1",
"prebuild": "npm run clean",
"prepare": "npm run build",
"test": "true"
"test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node",
"test": "npm run build:test && npm run unit-test && npm run integration-test",
"unit-test:browser": "echo skipped",
"unit-test:node": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
}
}

Просмотреть файл

@ -42,15 +42,25 @@
],
"scripts": {
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
"build": "tsc && rollup -c rollup.config.js 2>&1 && npm run minify",
"build:minify": "uglifyjs -c -m --comments --source-map \"content='./dist/keyvault.js.map'\" -o ./dist/keyvault.min.js ./dist/keyvault.js 2>&1",
"build:test": "npm run build",
"build": "tsc && rollup -c rollup.config.js 2>&1 && npm run build:minify",
"check-format": "prettier --list-different --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf dist esm test-dist typings *.tgz *.log",
"format": "prettier --write --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"lint": "true",
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/keyvault.js.map'\" -o ./dist/keyvault.min.js ./dist/keyvault.js 2>&1",
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "echo skipped",
"lint": "echo skipped",
"pack": "npm pack 2>&1",
"prebuild": "npm run clean",
"test": "true"
"test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node",
"test": "npm run build:test && npm run unit-test && npm run integration-test",
"unit-test:browser": "echo skipped",
"unit-test:node": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
"sideEffects": false
}

Просмотреть файл

@ -9,7 +9,7 @@
"request": "launch",
"name": "Debug sample",
"program": "${file}",
"preLaunchTask": "npm: build-samples",
"preLaunchTask": "npm: build:samples",
"outFiles": [
"${workspaceFolder}/dist-esm/**/*.js"
]
@ -29,7 +29,7 @@
"${workspaceFolder}/test-dist/index.js"
],
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": "npm: build-test"
"preLaunchTask": "npm: build:test"
}
]
}

Просмотреть файл

@ -84,22 +84,28 @@
],
"scripts": {
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
"build-browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1",
"build-node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1",
"build-samples": "node .scripts/prepSamples.js && cd samples && tsc -p .",
"build-test": "tsc -p . && cross-env ONLY_NODE=true rollup -c rollup.test.config.js 2>&1",
"build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1",
"build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1",
"build:samples": "node .scripts/prepSamples.js && cd samples && tsc -p .",
"build:test": "tsc -p . && cross-env ONLY_NODE=true rollup -c rollup.test.config.js 2>&1",
"build": "tsc -p . && rollup -c 2>&1",
"check-format": "prettier --list-different --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf dist dist-esm test-dist typings *.tgz *.log",
"coverage": "npm run build-test && nyc --reporter=lcov --exclude-after-remap=false mocha -t 120000 test-dist/index.js",
"coverage": "nyc --reporter=lcov --exclude-after-remap=false mocha -t 120000 test-dist/index.js",
"extract-api": "tsc -p . && api-extractor run --local",
"format": "prettier --write --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"integration-test:browser": "echo skipped",
"integration-test:node": "mocha -t 120000 test-dist/index.js",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "tslint -p . -c tslint.json --fix",
"lint": "tslint -p . -c tslint.json",
"pack": "npm pack 2>&1",
"prebuild": "npm run clean",
"pretest": "npm run build-test",
"test": "npm run build",
"tsc": "tsc",
"unit-node": "npm run build-test && mocha -t 120000 test-dist/index.js"
"test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node",
"test": "npm run build:test && npm run unit-test && npm run integration-test",
"unit-test:browser": "echo skipped",
"unit-test:node": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
}
}

Просмотреть файл

@ -2,7 +2,7 @@ import chai from "chai";
import fs from "fs";
import path from "path";
// Since `npm run build-samples` now update the typescript samples to make them debuggable,
// Since `npm run build:samples` now update the typescript samples to make them debuggable,
// we now have the below tests to ensure such updates dont get checked in.
describe("Ensure typescript samples use published package", function(): void {
const regex = new RegExp('from "@azure/service-bus"');

Просмотреть файл

@ -71,21 +71,25 @@
"build:browserzip": "gulp zip",
"build:es6": "tsc -p tsconfig.json",
"build:nodebrowser": "rollup -c 2>&1",
"build:test": "rollup -c rollup.test.config.js 2>&1",
"build:test": "npm run build:es6 && rollup -c rollup.test.config.js 2>&1",
"build": "npm run build:es6 && npm run build:nodebrowser && npm run build:browserzip",
"check-format": "prettier --list-different --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf dist dist-esm dist-test typings temp browser/*.js* browser/*.zip statistics.html coverage coverage-browser .nyc_output *.tgz *.log test*.xml TEST*.xml",
"extract-api": "tsc -p . && api-extractor run --local",
"format": "prettier --write --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"lint": "true",
"integration-test:browser": "karma start --single-run",
"integration-test:node": "cross-env TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\": \\\"commonjs\\\"}\" nyc mocha --compilers ts-node/register --require source-map-support/register --reporter mocha-multi-reporters --reporter-options configFile=mocha.reporter.config.json --full-trace --no-timeouts test/*.test.ts test/node/*.test.ts",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "echo skipped",
"lint": "echo skipped",
"pack": "npm pack 2>&1",
"prebuild": "npm run clean",
"pretest": "npm run build:test",
"test:browser": "karma start --single-run",
"test:node": "cross-env TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\": \\\"commonjs\\\"}\" nyc mocha --compilers ts-node/register --require source-map-support/register --reporter mocha-multi-reporters --reporter-options configFile=mocha.reporter.config.json --full-trace --no-timeouts test/*.test.ts test/node/*.test.ts",
"test": "npm run test:node && npm run test:browser",
"unit-browser": "npm run build && npm run build:test && npm run test:browser",
"unit-node": "npm run build && npm run build:test && npm run test:node"
"test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node",
"test": "npm run build:test && npm run unit-test && npm run integration-test",
"unit-test:browser": "echo skipped",
"unit-test:node": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
"files": [
"BreakingChanges.md",

Просмотреть файл

@ -71,21 +71,25 @@
"build:browserzip": "gulp zip",
"build:es6": "tsc -p tsconfig.json",
"build:nodebrowser": "rollup -c 2>&1",
"build:test": "rollup -c rollup.test.config.js 2>&1",
"build:test": "npm run build:es6 && rollup -c rollup.test.config.js 2>&1",
"build": "npm run build:es6 && npm run build:nodebrowser && npm run build:browserzip",
"check-format": "prettier --list-different --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf dist dist-esm dist-test typings temp browser/*.js* browser/*.zip statistics.html coverage coverage-browser .nyc_output *.tgz *.log test*.xml TEST*.xml",
"extract-api": "tsc -p . && api-extractor run --local",
"format": "prettier --write --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"lint": "true",
"integration-test:browser": "karma start --single-run",
"integration-test:node": "cross-env TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\": \\\"commonjs\\\"}\" nyc mocha --compilers ts-node/register --require source-map-support/register --reporter mocha-multi-reporters --reporter-options configFile=mocha.reporter.config.json --full-trace --no-timeouts test/*.test.ts test/node/*.test.ts",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "echo skipped",
"lint": "echo skipped",
"pack": "npm pack 2>&1",
"prebuild": "npm run clean",
"pretest": "npm run build:test",
"test:browser": "karma start --single-run",
"test:node": "cross-env TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\": \\\"commonjs\\\"}\" nyc mocha --compilers ts-node/register --require source-map-support/register --reporter mocha-multi-reporters --reporter-options configFile=mocha.reporter.config.json --full-trace --no-timeouts test/*.test.ts test/node/*.test.ts",
"test": "npm run test:node && npm run test:browser",
"unit-browser": "npm run build && npm run build:test && npm run test:browser",
"unit-node": "npm run build && npm run build:test && npm run test:node"
"test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node",
"test": "npm run build:test && npm run unit-test && npm run integration-test",
"unit-test:browser": "echo skipped",
"unit-test:node": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
"files": [
"BreakingChanges.md",

Просмотреть файл

@ -69,21 +69,25 @@
"build:browserzip": "gulp zip",
"build:es6": "tsc -p tsconfig.json",
"build:nodebrowser": "rollup -c 2>&1",
"build:test": "rollup -c rollup.test.config.js 2>&1",
"build:test": "npm run build:es6 && rollup -c rollup.test.config.js 2>&1",
"build": "npm run build:es6 && npm run build:nodebrowser && npm run build:browserzip",
"check-format": "prettier --list-different --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf dist dist-esm dist-test typings temp browser/*.js* browser/*.zip statistics.html coverage coverage-browser .nyc_output *.tgz *.log test*.xml TEST*.xml",
"extract-api": "tsc -p . && api-extractor run --local",
"format": "prettier --write --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"lint": "true",
"integration-test:browser": "karma start --single-run",
"integration-test:node": "cross-env TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\": \\\"commonjs\\\"}\" nyc mocha --compilers ts-node/register --require source-map-support/register --reporter mocha-multi-reporters --reporter-options configFile=mocha.reporter.config.json --full-trace --no-timeouts test/*.test.ts test/node/*.test.ts",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "echo skipped",
"lint": "echo skipped",
"pack": "npm pack 2>&1",
"prebuild": "npm run clean",
"pretest": "npm run build:test",
"test:browser": "karma start --single-run",
"test:node": "cross-env TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\": \\\"commonjs\\\"}\" nyc mocha --compilers ts-node/register --require source-map-support/register --reporter mocha-multi-reporters --reporter-options configFile=mocha.reporter.config.json --full-trace --no-timeouts test/*.test.ts test/node/*.test.ts",
"test": "npm run test:node && npm run test:browser",
"unit-browser": "npm run build && npm run build:test && npm run test:browser",
"unit-node": "npm run build && npm run build:test && npm run test:node"
"test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node",
"test": "npm run build:test && npm run unit-test && npm run integration-test",
"unit-test:browser": "echo skipped",
"unit-test:node": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
"files": [
"BreakingChanges.md",

2
sdk/template/template/.vscode/tasks.json поставляемый
Просмотреть файл

@ -6,7 +6,7 @@
{
"label": "Build Node",
"type": "npm",
"script": "build-node",
"script": "build:node",
"group": {
"kind": "build",
"isDefault": true

Просмотреть файл

@ -12,20 +12,27 @@
"types": "dist-esm/index.d.ts",
"scripts": {
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
"build-browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1",
"build-node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1",
"build-test": "tsc -p . && rollup -c rollup.test.config.js 2>&1",
"build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1",
"build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1",
"build:samples": "cd samples && tsc -p .",
"build:test": "tsc -p . && rollup -c rollup.test.config.js 2>&1",
"build": "tsc -p . && rollup -c 2>&1",
"check-format": "prettier --list-different --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf dist dist-esm test-dist typings *.tgz *.log",
"format": "prettier --write --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"lint-and-test": "npm run lint && npm run test",
"lint-fix": "eslint \"src/**/*.ts\" \"test/**/*.ts\" -c .eslintrc.json --fix --fix-type [problem,suggestion]",
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "eslint \"src/**/*.ts\" \"test/**/*.ts\" -c .eslintrc.json --fix --fix-type [problem,suggestion]",
"lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\" -c .eslintrc.json",
"pack": "npm pack 2>&1",
"prebuild": "npm run clean",
"pretest": "npm run build-test",
"test": "mocha test-dist/**/*.js --reporter spec"
"test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node",
"test": "npm run build:test && npm run unit-test && npm run integration-test",
"unit-test:browser": "echo skipped",
"unit-test:node": "mocha test-dist/**/*.js --reporter spec",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
"files": [
"browser/*.js*",