From 97fc1a29d68cdb49ea99f53612960b4572326d66 Mon Sep 17 00:00:00 2001 From: Jeremy Meng Date: Wed, 30 Sep 2020 00:39:56 +0000 Subject: [PATCH 1/3] [core-paging] Include esm version too in addition to CommonJS --- sdk/core/core-paging/package.json | 8 +++++--- sdk/core/core-paging/tsconfig.es.json | 7 +++++++ sdk/core/core-paging/tsconfig.json | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 sdk/core/core-paging/tsconfig.es.json diff --git a/sdk/core/core-paging/package.json b/sdk/core/core-paging/package.json index 3a67f81bf4fa..14274a73f05c 100644 --- a/sdk/core/core-paging/package.json +++ b/sdk/core/core-paging/package.json @@ -14,7 +14,8 @@ "azure", "cloud" ], - "main": "dist-esm/index.js", + "main": "dist/index.js", + "module": "dist-esm/index.js", "types": "./types/latest/core-paging.d.ts", "typesVersions": { "<3.6": { @@ -26,6 +27,7 @@ "files": [ "types/latest/core-paging.d.ts", "types/3.1", + "dist/index.js", "dist-esm/index.js", "LICENSE", "README.md" @@ -41,10 +43,10 @@ }, "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 -p .", + "build": "tsc -p tsconfig.json && tsc -p tsconfig.es.json", "build:test": "echo skipped", "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\"", - "clean": "echo skipped", + "clean": "rimraf dist dist-esm", "execute:samples": "echo skipped", "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\"", "integration-test:browser": "echo skipped", diff --git a/sdk/core/core-paging/tsconfig.es.json b/sdk/core/core-paging/tsconfig.es.json new file mode 100644 index 000000000000..28fe305c7857 --- /dev/null +++ b/sdk/core/core-paging/tsconfig.es.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "es6", + "outDir": "dist-esm" + } +} diff --git a/sdk/core/core-paging/tsconfig.json b/sdk/core/core-paging/tsconfig.json index 6ec5edb05fd8..93aac16a8ac7 100644 --- a/sdk/core/core-paging/tsconfig.json +++ b/sdk/core/core-paging/tsconfig.json @@ -7,7 +7,7 @@ "declarationMap": false, "sourceMap": false, "inlineSources": false, - "outDir": "./dist-esm", + "outDir": "./dist", "resolveJsonModule": true }, "exclude": ["node_modules"], From d02b2e9e4129372a54ba4d85e11e79bd7e5ba017 Mon Sep 17 00:00:00 2001 From: Jeremy Meng Date: Wed, 30 Sep 2020 16:55:35 +0000 Subject: [PATCH 2/3] Make linter happy --- sdk/core/core-paging/.eslintrc.json | 10 +--------- sdk/core/core-paging/package.json | 4 ++-- sdk/core/core-paging/tsconfig.es.json | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/sdk/core/core-paging/.eslintrc.json b/sdk/core/core-paging/.eslintrc.json index dc6bd6af2766..591615ee984d 100644 --- a/sdk/core/core-paging/.eslintrc.json +++ b/sdk/core/core-paging/.eslintrc.json @@ -4,14 +4,6 @@ "rules": { // `package.json`'s sideEffects has to be true because this package loads a // polyfill. - "@azure/azure-sdk/ts-package-json-sideeffects": "off", - // this package does not have a module in `dist` because the directory does - // not exist. - "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", - // this package does not export a module. - "@azure/azure-sdk/ts-package-json-module": "off", - // this package does not create a `dist` directory to be included in `files` - // list in `package.json`. - "@azure/azure-sdk/ts-package-json-files-required": "off" + "@azure/azure-sdk/ts-package-json-sideeffects": "off" } } diff --git a/sdk/core/core-paging/package.json b/sdk/core/core-paging/package.json index 14274a73f05c..6464ff85069b 100644 --- a/sdk/core/core-paging/package.json +++ b/sdk/core/core-paging/package.json @@ -15,7 +15,7 @@ "cloud" ], "main": "dist/index.js", - "module": "dist-esm/index.js", + "module": "dist-esm/src/index.js", "types": "./types/latest/core-paging.d.ts", "typesVersions": { "<3.6": { @@ -28,7 +28,7 @@ "types/latest/core-paging.d.ts", "types/3.1", "dist/index.js", - "dist-esm/index.js", + "dist-esm/src/index.js", "LICENSE", "README.md" ], diff --git a/sdk/core/core-paging/tsconfig.es.json b/sdk/core/core-paging/tsconfig.es.json index 28fe305c7857..7eb7e6276638 100644 --- a/sdk/core/core-paging/tsconfig.es.json +++ b/sdk/core/core-paging/tsconfig.es.json @@ -2,6 +2,6 @@ "extends": "./tsconfig.json", "compilerOptions": { "module": "es6", - "outDir": "dist-esm" + "outDir": "dist-esm/src" } } From 981b8859e8151b8eaefe9d0c69434c152c9c7bdd Mon Sep 17 00:00:00 2001 From: Jeremy Meng Date: Wed, 30 Sep 2020 16:55:46 +0000 Subject: [PATCH 3/3] Prepare CHANGELOG for release --- sdk/core/core-paging/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/core/core-paging/CHANGELOG.md b/sdk/core/core-paging/CHANGELOG.md index 6bd0b860e8ad..78dbe63e7494 100644 --- a/sdk/core/core-paging/CHANGELOG.md +++ b/sdk/core/core-paging/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.1.3 (Unreleased) +## 1.1.3 (2020-09-30) +- Also pack `esm` build in addition to `commonjs` build. This fixes the warning about `core-paging` in Angular 10 applications [Issue 11550](https://github.com/Azure/azure-sdk-for-js/issues/11550). ## 1.1.2 (2020-09-02)