From b79f779d06d48af213894ee733b46b182f18c52b Mon Sep 17 00:00:00 2001 From: Christoph Reiter <reiter.christoph@gmail.com> Date: Tue, 27 Apr 2021 17:11:53 +0200 Subject: [PATCH] Switch from chai to @esm-bundle/chai This has proper support for rollup while providing the same API. This is what open-wc recommends now and uses in their @open-wc/testing package --- packages/app-shell/package.json | 2 +- packages/app-shell/rollup.config.js | 7 --- packages/app-shell/test/unit.js | 2 +- packages/auth/package.json | 2 +- packages/auth/rollup.config.js | 7 --- packages/auth/test/unit.js | 2 +- packages/check-in-place-select/package.json | 2 +- .../check-in-place-select/rollup.config.js | 7 --- packages/check-in-place-select/test/unit.js | 2 +- packages/common/package.json | 2 +- packages/common/rollup.config.js | 7 --- packages/common/test/abort.js | 2 +- packages/common/test/eventbus.js | 2 +- packages/common/test/i18next.js | 2 +- packages/common/test/unit.js | 2 +- packages/data-table-view/package.json | 2 +- packages/data-table-view/rollup.config.js | 11 ---- packages/data-table-view/test/unit.js | 2 +- packages/file-handling/package.json | 2 +- packages/file-handling/rollup.config.js | 7 --- packages/file-handling/test/unit.js | 2 +- .../package.json | 2 +- .../rollup.config.js | 7 --- .../test/unit.js | 2 +- packages/language-select/package.json | 2 +- packages/language-select/rollup.config.js | 7 --- packages/language-select/test/unit.js | 2 +- packages/matomo/package.json | 2 +- packages/matomo/rollup.config.js | 7 --- packages/matomo/test/unit.js | 2 +- packages/notification/package.json | 2 +- packages/notification/rollup.config.js | 7 --- packages/notification/test/unit.js | 2 +- packages/organization-select/package.json | 2 +- packages/organization-select/rollup.config.js | 7 --- packages/organization-select/test/unit.js | 2 +- packages/person-profile/package.json | 2 +- packages/person-profile/rollup.config.js | 7 --- packages/person-profile/test/unit.js | 2 +- packages/person-select/package.json | 2 +- packages/person-select/rollup.config.js | 7 --- packages/person-select/test/unit.js | 2 +- packages/provider/package.json | 2 +- packages/provider/rollup.config.js | 7 --- packages/provider/test/unit.js | 2 +- packages/qr-code-scanner/package.json | 2 +- packages/qr-code-scanner/rollup.config.js | 7 --- packages/qr-code-scanner/test/unit.js | 2 +- packages/typescript-example/package.json | 2 +- packages/typescript-example/rollup.config.js | 7 --- packages/typescript-example/test/unit.ts | 2 +- toolkit-showcase/package.json | 2 +- toolkit-showcase/rollup.config.js | 12 ---- toolkit-showcase/yarn.lock | 56 ++++--------------- yarn.lock | 56 ++++--------------- 55 files changed, 60 insertions(+), 252 deletions(-) diff --git a/packages/app-shell/package.json b/packages/app-shell/package.json index 9980382e..2e033125 100644 --- a/packages/app-shell/package.json +++ b/packages/app-shell/package.json @@ -18,7 +18,7 @@ "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^11.0.0", "babel-eslint": "^10.1.0", - "chai": "^4.2.0", + "@esm-bundle/chai": "^4.2.0", "eslint": "^7.3.1", "eslint-plugin-jsdoc": "^32.0.0", "glob": "^7.1.6", diff --git a/packages/app-shell/rollup.config.js b/packages/app-shell/rollup.config.js index 868975d7..d51e613e 100644 --- a/packages/app-shell/rollup.config.js +++ b/packages/app-shell/rollup.config.js @@ -20,13 +20,6 @@ export default (async () => { format: 'esm', sourcemap: true }, - onwarn: function (warning, warn) { - // ignore chai warnings - if (warning.code === 'CIRCULAR_DEPENDENCY' && warning.message.includes('/chai/')) { - return; - } - warn(warning); - }, plugins: [ del({ targets: 'dist/*' diff --git a/packages/app-shell/test/unit.js b/packages/app-shell/test/unit.js index 1ae456f0..ba047aeb 100644 --- a/packages/app-shell/test/unit.js +++ b/packages/app-shell/test/unit.js @@ -1,4 +1,4 @@ -import {assert} from 'chai'; +import {assert} from '@esm-bundle/chai'; import {Router} from '../src/router.js'; diff --git a/packages/auth/package.json b/packages/auth/package.json index 7c0b0950..c45d239b 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -20,7 +20,7 @@ "@rollup/plugin-replace": "^2.3.3", "@rollup/plugin-url": "^6.0.0", "babel-eslint": "^10.1.0", - "chai": "^4.2.0", + "@esm-bundle/chai": "^4.2.0", "eslint": "^7.3.1", "eslint-plugin-jsdoc": "^32.0.0", "glob": "^7.1.6", diff --git a/packages/auth/rollup.config.js b/packages/auth/rollup.config.js index abdacf28..1bafcc27 100644 --- a/packages/auth/rollup.config.js +++ b/packages/auth/rollup.config.js @@ -22,13 +22,6 @@ export default (async () => { format: 'esm', sourcemap: true }, - onwarn: function (warning, warn) { - // ignore chai warnings - if (warning.code === 'CIRCULAR_DEPENDENCY' && warning.message.includes('/chai/')) { - return; - } - warn(warning); - }, plugins: [ del({ targets: 'dist/*' diff --git a/packages/auth/test/unit.js b/packages/auth/test/unit.js index 9995d6ef..c7729814 100644 --- a/packages/auth/test/unit.js +++ b/packages/auth/test/unit.js @@ -1,4 +1,4 @@ -import {assert} from 'chai'; +import {assert} from '@esm-bundle/chai'; import '../src/dbp-auth'; import '../src/dbp-auth-demo'; diff --git a/packages/check-in-place-select/package.json b/packages/check-in-place-select/package.json index ff460886..c8728355 100644 --- a/packages/check-in-place-select/package.json +++ b/packages/check-in-place-select/package.json @@ -19,7 +19,7 @@ "@rollup/plugin-node-resolve": "^11.0.0", "@rollup/plugin-replace": "^2.3.3", "@rollup/plugin-url": "^6.0.0", - "chai": "^4.2.0", + "@esm-bundle/chai": "^4.2.0", "eslint": "^7.3.1", "eslint-plugin-jsdoc": "^32.0.0", "i18next-scanner": "^3.0.0", diff --git a/packages/check-in-place-select/rollup.config.js b/packages/check-in-place-select/rollup.config.js index 384e0e65..7a3aadb0 100644 --- a/packages/check-in-place-select/rollup.config.js +++ b/packages/check-in-place-select/rollup.config.js @@ -22,13 +22,6 @@ export default (async () => { format: 'esm', sourcemap: true }, - onwarn: function (warning, warn) { - // ignore chai warnings - if (warning.code === 'CIRCULAR_DEPENDENCY' && warning.message.includes('/chai/')) { - return; - } - warn(warning); - }, plugins: [ del({ targets: 'dist/*' diff --git a/packages/check-in-place-select/test/unit.js b/packages/check-in-place-select/test/unit.js index c8d13045..9c8605e6 100644 --- a/packages/check-in-place-select/test/unit.js +++ b/packages/check-in-place-select/test/unit.js @@ -1,4 +1,4 @@ -import {assert} from 'chai'; +import {assert} from '@esm-bundle/chai'; import '../src/dbp-check-in-place-select.js'; import '../src/demo.js'; diff --git a/packages/common/package.json b/packages/common/package.json index 2c7440e0..5f5331ff 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -14,7 +14,7 @@ "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^11.0.0", "babel-eslint": "^10.1.0", - "chai": "^4.2.0", + "@esm-bundle/chai": "^4.2.0", "eslint": "^7.3.1", "eslint-plugin-jsdoc": "^32.0.0", "karma": "^6.0.0", diff --git a/packages/common/rollup.config.js b/packages/common/rollup.config.js index 217b6814..2079af55 100644 --- a/packages/common/rollup.config.js +++ b/packages/common/rollup.config.js @@ -21,13 +21,6 @@ export default (async () => { format: 'esm', sourcemap: true }, - onwarn: function (warning, warn) { - // ignore chai warnings - if (warning.code === 'CIRCULAR_DEPENDENCY' && warning.message.includes('/chai/')) { - return; - } - warn(warning); - }, plugins: [ del({ targets: 'dist/*' diff --git a/packages/common/test/abort.js b/packages/common/test/abort.js index 9c0af4dc..f1dccbc5 100644 --- a/packages/common/test/abort.js +++ b/packages/common/test/abort.js @@ -1,4 +1,4 @@ -import {assert} from 'chai'; +import {assert} from '@esm-bundle/chai'; import {createLinkedAbortController, createTimeoutAbortSignal} from '../src/abort.js'; suite('abort', () => { diff --git a/packages/common/test/eventbus.js b/packages/common/test/eventbus.js index 1f80e773..dc49ae57 100644 --- a/packages/common/test/eventbus.js +++ b/packages/common/test/eventbus.js @@ -1,4 +1,4 @@ -import {assert} from 'chai'; +import {assert} from '@esm-bundle/chai'; import {EventBus, createEventName, checkIndentifier} from '../src/eventbus.js'; suite('helpers', () => { diff --git a/packages/common/test/i18next.js b/packages/common/test/i18next.js index ed69fa91..3b75700e 100644 --- a/packages/common/test/i18next.js +++ b/packages/common/test/i18next.js @@ -1,4 +1,4 @@ -import {assert} from 'chai'; +import {assert} from '@esm-bundle/chai'; import * as i18next from '../i18next.js'; suite('i18next', () => { diff --git a/packages/common/test/unit.js b/packages/common/test/unit.js index 4a931042..e5379404 100644 --- a/packages/common/test/unit.js +++ b/packages/common/test/unit.js @@ -1,4 +1,4 @@ -import {expect, assert} from 'chai'; +import {expect, assert} from '@esm-bundle/chai'; import * as utils from '../utils'; import * as styles from '../styles'; import '../jsonld.js'; diff --git a/packages/data-table-view/package.json b/packages/data-table-view/package.json index 15b80aa5..08b0e6fc 100644 --- a/packages/data-table-view/package.json +++ b/packages/data-table-view/package.json @@ -18,7 +18,7 @@ "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^11.0.0", "@rollup/plugin-url": "^6.0.0", - "chai": "^4.2.0", + "@esm-bundle/chai": "^4.2.0", "eslint": "^7.3.1", "eslint-plugin-jsdoc": "^32.0.0", "glob": "^7.1.6", diff --git a/packages/data-table-view/rollup.config.js b/packages/data-table-view/rollup.config.js index bf17e14a..42fa3dec 100644 --- a/packages/data-table-view/rollup.config.js +++ b/packages/data-table-view/rollup.config.js @@ -23,17 +23,6 @@ export default (async () => { format: 'esm', sourcemap: true }, - onwarn: function (warning, warn) { - // ignore "suggestions" warning re "use strict" - if (warning.code === 'MODULE_LEVEL_DIRECTIVE') { - return; - } - // ignore chai warnings - if (warning.code === 'CIRCULAR_DEPENDENCY' && warning.message.includes('/chai/')) { - return; - } - warn(warning); - }, watch: { chokidar: true, }, diff --git a/packages/data-table-view/test/unit.js b/packages/data-table-view/test/unit.js index 7ce5434a..289c8bff 100644 --- a/packages/data-table-view/test/unit.js +++ b/packages/data-table-view/test/unit.js @@ -1,4 +1,4 @@ -import {assert} from 'chai'; +import {assert} from '@esm-bundle/chai'; import '../src/dbp-data-table-view'; import '../src/dbp-data-table-view-demo'; diff --git a/packages/file-handling/package.json b/packages/file-handling/package.json index d733c4f2..9b6ed623 100644 --- a/packages/file-handling/package.json +++ b/packages/file-handling/package.json @@ -17,7 +17,7 @@ "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-json": "^4.0.2", "@rollup/plugin-node-resolve": "^11.0.0", - "chai": "^4.2.0", + "@esm-bundle/chai": "^4.2.0", "eslint": "^7.3.1", "eslint-plugin-jsdoc": "^32.0.0", "i18next-scanner": "^3.0.0", diff --git a/packages/file-handling/rollup.config.js b/packages/file-handling/rollup.config.js index 82af637b..63b5926c 100644 --- a/packages/file-handling/rollup.config.js +++ b/packages/file-handling/rollup.config.js @@ -25,13 +25,6 @@ export default (async () => { format: 'esm', sourcemap: true }, - onwarn: function (warning, warn) { - // ignore chai warnings - if (warning.code === 'CIRCULAR_DEPENDENCY' && warning.message.includes('/chai/')) { - return; - } - warn(warning); - }, plugins: [ del({ targets: 'dist/*' diff --git a/packages/file-handling/test/unit.js b/packages/file-handling/test/unit.js index ce2943ed..2474b33c 100644 --- a/packages/file-handling/test/unit.js +++ b/packages/file-handling/test/unit.js @@ -1,4 +1,4 @@ -import {assert} from 'chai'; +import {assert} from '@esm-bundle/chai'; import '../src/dbp-file-source'; import '../src/demo'; diff --git a/packages/knowledge-base-web-page-element-view/package.json b/packages/knowledge-base-web-page-element-view/package.json index e56e160e..cc7087b4 100644 --- a/packages/knowledge-base-web-page-element-view/package.json +++ b/packages/knowledge-base-web-page-element-view/package.json @@ -18,7 +18,7 @@ "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^11.0.0", "@rollup/plugin-url": "^6.0.0", - "chai": "^4.2.0", + "@esm-bundle/chai": "^4.2.0", "eslint": "^7.3.1", "eslint-plugin-jsdoc": "^32.0.0", "karma": "^6.0.0", diff --git a/packages/knowledge-base-web-page-element-view/rollup.config.js b/packages/knowledge-base-web-page-element-view/rollup.config.js index 9fda2046..4d768f0c 100644 --- a/packages/knowledge-base-web-page-element-view/rollup.config.js +++ b/packages/knowledge-base-web-page-element-view/rollup.config.js @@ -22,13 +22,6 @@ export default (async () => { format: 'esm', sourcemap: true }, - onwarn: function (warning, warn) { - // ignore chai warnings - if (warning.code === 'CIRCULAR_DEPENDENCY' && warning.message.includes('/chai/')) { - return; - } - warn(warning); - }, plugins: [ del({ targets: 'dist/*' diff --git a/packages/knowledge-base-web-page-element-view/test/unit.js b/packages/knowledge-base-web-page-element-view/test/unit.js index 43594f7f..acd3ddd8 100644 --- a/packages/knowledge-base-web-page-element-view/test/unit.js +++ b/packages/knowledge-base-web-page-element-view/test/unit.js @@ -1,4 +1,4 @@ -import {assert} from 'chai'; +import {assert} from '@esm-bundle/chai'; import '../src/dbp-knowledge-base-web-page-element-view.js'; import '../src/dbp-knowledge-base-web-page-element-view-demo.js'; diff --git a/packages/language-select/package.json b/packages/language-select/package.json index 858b0dce..c8b50613 100644 --- a/packages/language-select/package.json +++ b/packages/language-select/package.json @@ -17,7 +17,7 @@ "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^11.0.0", - "chai": "^4.2.0", + "@esm-bundle/chai": "^4.2.0", "eslint": "^7.3.1", "eslint-plugin-jsdoc": "^32.0.0", "i18next-scanner": "^3.0.0", diff --git a/packages/language-select/rollup.config.js b/packages/language-select/rollup.config.js index 17a88b97..8fbb2e9a 100644 --- a/packages/language-select/rollup.config.js +++ b/packages/language-select/rollup.config.js @@ -19,13 +19,6 @@ export default { format: 'esm', sourcemap: true }, - onwarn: function (warning, warn) { - // ignore chai warnings - if (warning.code === 'CIRCULAR_DEPENDENCY' && warning.message.includes('/chai/')) { - return; - } - warn(warning); - }, plugins: [ del({ targets: 'dist/*' diff --git a/packages/language-select/test/unit.js b/packages/language-select/test/unit.js index 2f060bcb..c3eee2cc 100644 --- a/packages/language-select/test/unit.js +++ b/packages/language-select/test/unit.js @@ -1,4 +1,4 @@ -import {assert, expect} from 'chai'; +import {assert, expect} from '@esm-bundle/chai'; import '../src/dbp-language-select.js'; import '../src/demo.js'; diff --git a/packages/matomo/package.json b/packages/matomo/package.json index dda45626..e8ca14bd 100644 --- a/packages/matomo/package.json +++ b/packages/matomo/package.json @@ -18,7 +18,7 @@ "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^11.0.0", "@rollup/plugin-url": "^6.0.0", - "chai": "^4.2.0", + "@esm-bundle/chai": "^4.2.0", "eslint": "^7.3.1", "eslint-plugin-jsdoc": "^32.0.0", "i18next-scanner": "^3.0.0", diff --git a/packages/matomo/rollup.config.js b/packages/matomo/rollup.config.js index bae3922e..3f0bd711 100644 --- a/packages/matomo/rollup.config.js +++ b/packages/matomo/rollup.config.js @@ -50,13 +50,6 @@ export default (async () => { format: 'esm', sourcemap: true }, - onwarn: function (warning, warn) { - // ignore chai warnings - if (warning.code === 'CIRCULAR_DEPENDENCY' && warning.message.includes('/chai/')) { - return; - } - warn(warning); - }, plugins: [ del({ targets: 'dist/*' diff --git a/packages/matomo/test/unit.js b/packages/matomo/test/unit.js index cbdbc701..70224834 100644 --- a/packages/matomo/test/unit.js +++ b/packages/matomo/test/unit.js @@ -1,4 +1,4 @@ -import {assert} from 'chai'; +import {assert} from '@esm-bundle/chai'; import '../src/dbp-matomo'; suite('dbp-matomo', () => { diff --git a/packages/notification/package.json b/packages/notification/package.json index 767e22b6..8e0fa2aa 100644 --- a/packages/notification/package.json +++ b/packages/notification/package.json @@ -18,7 +18,7 @@ "@rollup/plugin-json": "^4.0.0", "@rollup/plugin-node-resolve": "^11.0.0", "@rollup/plugin-url": "^6.0.0", - "chai": "^4.2.0", + "@esm-bundle/chai": "^4.2.0", "eslint": "^7.3.1", "eslint-plugin-jsdoc": "^32.0.0", "i18next-scanner": "^3.0.0", diff --git a/packages/notification/rollup.config.js b/packages/notification/rollup.config.js index 867ad09e..db5e077f 100644 --- a/packages/notification/rollup.config.js +++ b/packages/notification/rollup.config.js @@ -20,13 +20,6 @@ export default { format: 'esm', sourcemap: true }, - onwarn: function (warning, warn) { - // ignore chai warnings - if (warning.code === 'CIRCULAR_DEPENDENCY' && warning.message.includes('/chai/')) { - return; - } - warn(warning); - }, plugins: [ del({ targets: 'dist/*' diff --git a/packages/notification/test/unit.js b/packages/notification/test/unit.js index e476e86b..c3819865 100644 --- a/packages/notification/test/unit.js +++ b/packages/notification/test/unit.js @@ -1,4 +1,4 @@ -import {assert} from 'chai'; +import {assert} from '@esm-bundle/chai'; import '../src/dbp-notification'; diff --git a/packages/organization-select/package.json b/packages/organization-select/package.json index bfc3be7a..6b88622b 100644 --- a/packages/organization-select/package.json +++ b/packages/organization-select/package.json @@ -19,7 +19,7 @@ "@rollup/plugin-node-resolve": "^11.0.0", "@rollup/plugin-replace": "^2.3.3", "@rollup/plugin-url": "^6.0.0", - "chai": "^4.2.0", + "@esm-bundle/chai": "^4.2.0", "eslint": "^7.3.1", "eslint-plugin-jsdoc": "^32.0.0", "i18next-scanner": "^3.0.0", diff --git a/packages/organization-select/rollup.config.js b/packages/organization-select/rollup.config.js index d58061c3..277d22c2 100644 --- a/packages/organization-select/rollup.config.js +++ b/packages/organization-select/rollup.config.js @@ -22,13 +22,6 @@ export default (async () => { format: 'esm', sourcemap: true }, - onwarn: function (warning, warn) { - // ignore chai warnings - if (warning.code === 'CIRCULAR_DEPENDENCY' && warning.message.includes('/chai/')) { - return; - } - warn(warning); - }, plugins: [ del({ targets: 'dist/*' diff --git a/packages/organization-select/test/unit.js b/packages/organization-select/test/unit.js index a403d71e..96209687 100644 --- a/packages/organization-select/test/unit.js +++ b/packages/organization-select/test/unit.js @@ -1,4 +1,4 @@ -import {assert} from 'chai'; +import {assert} from '@esm-bundle/chai'; import '../src/dbp-organization-select.js'; import '../src/demo.js'; diff --git a/packages/person-profile/package.json b/packages/person-profile/package.json index 951dd69f..735df51c 100644 --- a/packages/person-profile/package.json +++ b/packages/person-profile/package.json @@ -18,7 +18,7 @@ "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^11.0.0", "@rollup/plugin-url": "^6.0.0", - "chai": "^4.2.0", + "@esm-bundle/chai": "^4.2.0", "eslint": "^7.3.1", "eslint-plugin-jsdoc": "^32.0.0", "i18next-scanner": "^3.0.0", diff --git a/packages/person-profile/rollup.config.js b/packages/person-profile/rollup.config.js index 59d995be..ade77cbb 100644 --- a/packages/person-profile/rollup.config.js +++ b/packages/person-profile/rollup.config.js @@ -23,13 +23,6 @@ export default (async () => { format: 'esm', sourcemap: true }, - onwarn: function (warning, warn) { - // ignore chai warnings - if (warning.code === 'CIRCULAR_DEPENDENCY' && warning.message.includes('/chai/')) { - return; - } - warn(warning); - }, plugins: [ del({ targets: 'dist/*' diff --git a/packages/person-profile/test/unit.js b/packages/person-profile/test/unit.js index db0670b4..09a3efbf 100644 --- a/packages/person-profile/test/unit.js +++ b/packages/person-profile/test/unit.js @@ -1,4 +1,4 @@ -import {assert} from 'chai'; +import {assert} from '@esm-bundle/chai'; import '../src/dbp-person-profile-demo.js'; diff --git a/packages/person-select/package.json b/packages/person-select/package.json index 6de1ffd3..10052897 100644 --- a/packages/person-select/package.json +++ b/packages/person-select/package.json @@ -19,7 +19,7 @@ "@rollup/plugin-node-resolve": "^11.0.0", "@rollup/plugin-replace": "^2.3.3", "@rollup/plugin-url": "^6.0.0", - "chai": "^4.2.0", + "@esm-bundle/chai": "^4.2.0", "eslint": "^7.3.1", "eslint-plugin-jsdoc": "^32.0.0", "i18next-scanner": "^3.0.0", diff --git a/packages/person-select/rollup.config.js b/packages/person-select/rollup.config.js index d0dc05e9..cbc4cd85 100644 --- a/packages/person-select/rollup.config.js +++ b/packages/person-select/rollup.config.js @@ -22,13 +22,6 @@ export default (async () => { format: 'esm', sourcemap: true }, - onwarn: function (warning, warn) { - // ignore chai warnings - if (warning.code === 'CIRCULAR_DEPENDENCY' && warning.message.includes('/chai/')) { - return; - } - warn(warning); - }, plugins: [ del({ targets: 'dist/*' diff --git a/packages/person-select/test/unit.js b/packages/person-select/test/unit.js index fcefa861..8468b3e8 100644 --- a/packages/person-select/test/unit.js +++ b/packages/person-select/test/unit.js @@ -1,4 +1,4 @@ -import {assert} from 'chai'; +import {assert} from '@esm-bundle/chai'; import '../src/dbp-person-select.js'; import '../src/demo.js'; diff --git a/packages/provider/package.json b/packages/provider/package.json index 010e1b6e..06d28bc1 100644 --- a/packages/provider/package.json +++ b/packages/provider/package.json @@ -18,7 +18,7 @@ "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^11.0.0", "@rollup/plugin-url": "^6.0.0", - "chai": "^4.2.0", + "@esm-bundle/chai": "^4.2.0", "eslint": "^7.3.1", "eslint-plugin-jsdoc": "^32.0.0", "glob": "^7.1.6", diff --git a/packages/provider/rollup.config.js b/packages/provider/rollup.config.js index b95c9317..3a1aee65 100644 --- a/packages/provider/rollup.config.js +++ b/packages/provider/rollup.config.js @@ -48,13 +48,6 @@ export default (async () => { format: 'esm', sourcemap: true }, - onwarn: function (warning, warn) { - // ignore chai warnings - if (warning.code === 'CIRCULAR_DEPENDENCY' && warning.message.includes('chai')) { - return; - } - warn(warning); - }, plugins: [ del({ targets: 'dist/*' diff --git a/packages/provider/test/unit.js b/packages/provider/test/unit.js index 7275c1ac..54e2c9d1 100644 --- a/packages/provider/test/unit.js +++ b/packages/provider/test/unit.js @@ -1,4 +1,4 @@ -import {assert} from 'chai'; +import {assert} from '@esm-bundle/chai'; import '../src/dbp-provider'; import '../src/dbp-provider-demo'; diff --git a/packages/qr-code-scanner/package.json b/packages/qr-code-scanner/package.json index 6fe27791..33fa275d 100644 --- a/packages/qr-code-scanner/package.json +++ b/packages/qr-code-scanner/package.json @@ -18,7 +18,7 @@ "@rollup/plugin-json": "^4.0.0", "@rollup/plugin-node-resolve": "^11.0.0", "@rollup/plugin-url": "^6.0.0", - "chai": "^4.2.0", + "@esm-bundle/chai": "^4.2.0", "eslint": "^7.11.0", "eslint-plugin-jsdoc": "^32.0.0", "i18next-scanner": "^3.0.0", diff --git a/packages/qr-code-scanner/rollup.config.js b/packages/qr-code-scanner/rollup.config.js index aa6e0f8a..45dc4d71 100644 --- a/packages/qr-code-scanner/rollup.config.js +++ b/packages/qr-code-scanner/rollup.config.js @@ -44,13 +44,6 @@ export default (async () => { format: 'esm', sourcemap: true }, - onwarn: function (warning, warn) { - // ignore chai warnings - if (warning.code === 'CIRCULAR_DEPENDENCY' && warning.message.includes('/chai/')) { - return; - } - warn(warning); - }, plugins: [ del({ targets: 'dist/*' diff --git a/packages/qr-code-scanner/test/unit.js b/packages/qr-code-scanner/test/unit.js index 3e3340c1..9631ba2a 100644 --- a/packages/qr-code-scanner/test/unit.js +++ b/packages/qr-code-scanner/test/unit.js @@ -1,4 +1,4 @@ -import {assert} from 'chai'; +import {assert} from '@esm-bundle/chai'; import '../src/dbp-qr-code-scanner'; diff --git a/packages/typescript-example/package.json b/packages/typescript-example/package.json index 3ade4b46..35b281c1 100644 --- a/packages/typescript-example/package.json +++ b/packages/typescript-example/package.json @@ -19,7 +19,7 @@ "@types/mocha": "^8.2.0", "@typescript-eslint/eslint-plugin": "^4.22.0", "@typescript-eslint/parser": "^4.22.0", - "chai": "^4.2.0", + "@esm-bundle/chai": "^4.2.0", "karma": "^6.0.0", "karma-chrome-launcher": "^3.0.0", "karma-firefox-launcher": "^2.1.0", diff --git a/packages/typescript-example/rollup.config.js b/packages/typescript-example/rollup.config.js index 6dae7eda..9b2a0b13 100644 --- a/packages/typescript-example/rollup.config.js +++ b/packages/typescript-example/rollup.config.js @@ -20,13 +20,6 @@ export default { format: 'esm', sourcemap: true }, - onwarn: function (warning, warn) { - // ignore chai warnings - if (warning.code === 'CIRCULAR_DEPENDENCY' && warning.message.includes('/chai/')) { - return; - } - warn(warning); - }, plugins: [ del({ targets: 'dist/*' diff --git a/packages/typescript-example/test/unit.ts b/packages/typescript-example/test/unit.ts index c487d543..b8aa3328 100644 --- a/packages/typescript-example/test/unit.ts +++ b/packages/typescript-example/test/unit.ts @@ -1,4 +1,4 @@ -import {assert} from 'chai'; +import {assert} from '@esm-bundle/chai'; import '../src/dbp-typescript-example'; diff --git a/toolkit-showcase/package.json b/toolkit-showcase/package.json index 57404cb8..9c68fde4 100644 --- a/toolkit-showcase/package.json +++ b/toolkit-showcase/package.json @@ -21,7 +21,7 @@ "@rollup/plugin-node-resolve": "^11.0.0", "@rollup/plugin-url": "^6.0.0", "babel-eslint": "^10.0.3", - "chai": "^4.2.0", + "@esm-bundle/chai": "^4.2.0", "chokidar": "^3.4.0", "eslint": "^7.3.1", "eslint-plugin-jsdoc": "^32.0.0", diff --git a/toolkit-showcase/rollup.config.js b/toolkit-showcase/rollup.config.js index c850547c..f87cd067 100644 --- a/toolkit-showcase/rollup.config.js +++ b/toolkit-showcase/rollup.config.js @@ -80,18 +80,6 @@ export default (async () => { sourcemap: true }, preserveEntrySignatures: false, - // external: ['zlib', 'http', 'fs', 'https', 'url'], - onwarn: function (warning, warn) { - // ignore "suggestions" warning re "use strict" - if (warning.code === 'MODULE_LEVEL_DIRECTIVE') { - return; - } - // ignore chai warnings - if (warning.code === 'CIRCULAR_DEPENDENCY' && warning.message.includes('/chai/')) { - return; - } - warn(warning); - }, plugins: [ del({ targets: 'dist/*' diff --git a/toolkit-showcase/yarn.lock b/toolkit-showcase/yarn.lock index 5cbe8c4f..624aeebd 100644 --- a/toolkit-showcase/yarn.lock +++ b/toolkit-showcase/yarn.lock @@ -987,6 +987,13 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" +"@esm-bundle/chai@^4.2.0": + version "4.3.4" + resolved "https://registry.yarnpkg.com/@esm-bundle/chai/-/chai-4.3.4.tgz#74ed4a0794b3a9f9517ff235744ac6f4be0d34dc" + integrity sha512-6Tx35wWiNw7X0nLY9RMx8v3EL8SacCFW+eEZOE9Hc+XxmU5HFE2AFEg+GehUZpiyDGwVvPH75ckGlqC7coIPnA== + dependencies: + "@types/chai" "^4.2.12" + "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" @@ -1168,6 +1175,11 @@ "@sentry/types" "6.1.0" tslib "^1.9.3" +"@types/chai@^4.2.12": + version "4.2.17" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.17.tgz#85f9f0610f514b22a94125d441f73eef65bde5cc" + integrity sha512-LaiwWNnYuL8xJlQcE91QB2JoswWZckq9A4b+nMPq8dt8AP96727Nb3X4e74u+E3tm4NLTILNI9MYFsyVc30wSA== + "@types/component-emitter@^1.2.10": version "1.2.10" resolved "https://registry.yarnpkg.com/@types/component-emitter/-/component-emitter-1.2.10.tgz#ef5b1589b9f16544642e473db5ea5639107ef3ea" @@ -1490,11 +1502,6 @@ assert-plus@1.0.0, assert-plus@^1.0.0: resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= -assertion-error@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" - integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== - assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" @@ -1805,18 +1812,6 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -chai@^4.2.0: - version "4.3.4" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.4.tgz#b55e655b31e1eac7099be4c08c21964fce2e6c49" - integrity sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA== - dependencies: - assertion-error "^1.1.0" - check-error "^1.0.2" - deep-eql "^3.0.1" - get-func-name "^2.0.0" - pathval "^1.1.1" - type-detect "^4.0.5" - chalk@^2.0.0, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" @@ -1842,11 +1837,6 @@ chalk@^4.1.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -check-error@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" - integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= - chokidar@3.5.1, chokidar@^3.4.0, chokidar@^3.4.2: version "3.5.1" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a" @@ -2239,13 +2229,6 @@ decompress-response@^4.2.0: dependencies: mimic-response "^2.0.0" -deep-eql@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" - integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== - dependencies: - type-detect "^4.0.0" - deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" @@ -3055,11 +3038,6 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-func-name@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" - integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= - get-intrinsic@^1.0.2: version "1.1.1" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" @@ -4670,11 +4648,6 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -pathval@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" - integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== - pdfjs-dist@^2.4.456: version "2.7.570" resolved "https://registry.yarnpkg.com/pdfjs-dist/-/pdfjs-dist-2.7.570.tgz#7233241a2437ac22387656099b6e549d032f0b35" @@ -5926,11 +5899,6 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -type-detect@^4.0.0, type-detect@^4.0.5: - version "4.0.8" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== - type-fest@^0.20.2: version "0.20.2" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" diff --git a/yarn.lock b/yarn.lock index 5dc286bb..bf4202e5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -116,6 +116,13 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" +"@esm-bundle/chai@^4.2.0": + version "4.3.4" + resolved "https://registry.yarnpkg.com/@esm-bundle/chai/-/chai-4.3.4.tgz#74ed4a0794b3a9f9517ff235744ac6f4be0d34dc" + integrity sha512-6Tx35wWiNw7X0nLY9RMx8v3EL8SacCFW+eEZOE9Hc+XxmU5HFE2AFEg+GehUZpiyDGwVvPH75ckGlqC7coIPnA== + dependencies: + "@types/chai" "^4.2.12" + "@lerna/add@4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@lerna/add/-/add-4.0.0.tgz#c36f57d132502a57b9e7058d1548b7a565ef183f" @@ -1131,6 +1138,11 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== +"@types/chai@^4.2.12": + version "4.2.17" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.17.tgz#85f9f0610f514b22a94125d441f73eef65bde5cc" + integrity sha512-LaiwWNnYuL8xJlQcE91QB2JoswWZckq9A4b+nMPq8dt8AP96727Nb3X4e74u+E3tm4NLTILNI9MYFsyVc30wSA== + "@types/component-emitter@^1.2.10": version "1.2.10" resolved "https://registry.yarnpkg.com/@types/component-emitter/-/component-emitter-1.2.10.tgz#ef5b1589b9f16544642e473db5ea5639107ef3ea" @@ -1576,11 +1588,6 @@ assert-plus@1.0.0, assert-plus@^1.0.0: resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= -assertion-error@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" - integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== - assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" @@ -1877,18 +1884,6 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -chai@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.2.0.tgz#760aa72cf20e3795e84b12877ce0e83737aa29e5" - integrity sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw== - dependencies: - assertion-error "^1.1.0" - check-error "^1.0.2" - deep-eql "^3.0.1" - get-func-name "^2.0.0" - pathval "^1.1.0" - type-detect "^4.0.5" - chalk@^2.0.0, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" @@ -1911,11 +1906,6 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -check-error@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" - integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= - chokidar@3.4.3, chokidar@^3.4.2: version "3.4.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.3.tgz#c1df38231448e45ca4ac588e6c79573ba6a57d5b" @@ -2460,13 +2450,6 @@ dedent@^0.7.0: resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= -deep-eql@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" - integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== - dependencies: - type-detect "^4.0.0" - deep-is@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" @@ -3343,11 +3326,6 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-func-name@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" - integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= - get-intrinsic@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.0.1.tgz#94a9768fcbdd0595a1c9273aacf4c89d075631be" @@ -5746,11 +5724,6 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -pathval@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0" - integrity sha1-uULm1L3mUwBe9rcTYd74cn0GReA= - performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" @@ -7192,11 +7165,6 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" -type-detect@^4.0.0, type-detect@^4.0.5: - version "4.0.8" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== - type-fest@^0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" -- GitLab