From 52ac2263fc46429f27c573e2a36d675e34de9e19 Mon Sep 17 00:00:00 2001 From: Avi Vahl Date: Sun, 15 Dec 2024 02:13:29 +0200 Subject: [PATCH] feat: mark packages as sideEffects: false reverts #2192 to remove only sideEffect in engine-core package --- packages/core/package.json | 3 ++- .../core/src/polyfills/report-error-polyfill.ts | 13 ------------- packages/core/src/runtime-main.ts | 2 -- packages/engine-cli/package.json | 3 ++- packages/runtime-node/package.json | 3 ++- packages/test-kit/package.json | 3 ++- 6 files changed, 8 insertions(+), 19 deletions(-) delete mode 100644 packages/core/src/polyfills/report-error-polyfill.ts diff --git a/packages/core/package.json b/packages/core/package.json index 1bfe481a6..ff76a1a08 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -30,5 +30,6 @@ "license": "MIT", "publishConfig": { "access": "public" - } + }, + "sideEffects": false } diff --git a/packages/core/src/polyfills/report-error-polyfill.ts b/packages/core/src/polyfills/report-error-polyfill.ts deleted file mode 100644 index e911d4085..000000000 --- a/packages/core/src/polyfills/report-error-polyfill.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { reportError } from '../com/index.js'; - -/** - * This polyfill is not essential for the engine itself. But applications built - * on the engine may require this polyfill to correctly report initialization - * errors in older browsers. - * Ideally, the engine should offer a mechanism allowing applications to - * initialize necessary polyfills before the evaluation of feature files begins. - * But so far we only need this single polyfill. - */ -if (globalThis.reportError === undefined) { - globalThis.reportError = reportError; -} diff --git a/packages/core/src/runtime-main.ts b/packages/core/src/runtime-main.ts index 7661feadc..6952ef509 100644 --- a/packages/core/src/runtime-main.ts +++ b/packages/core/src/runtime-main.ts @@ -1,5 +1,3 @@ -import './polyfills/report-error-polyfill.js'; - import type { IRunOptions, TopLevelConfig } from './types.js'; import type { AnyEnvironment } from './entities/index.js'; import { FeatureLoadersRegistry, IFeatureLoader } from './run-engine-app.js'; diff --git a/packages/engine-cli/package.json b/packages/engine-cli/package.json index f1e8cee6d..d187bf3a0 100644 --- a/packages/engine-cli/package.json +++ b/packages/engine-cli/package.json @@ -41,5 +41,6 @@ "license": "MIT", "publishConfig": { "access": "public" - } + }, + "sideEffects": false } diff --git a/packages/runtime-node/package.json b/packages/runtime-node/package.json index c19e185ef..2dec733fe 100644 --- a/packages/runtime-node/package.json +++ b/packages/runtime-node/package.json @@ -32,5 +32,6 @@ "license": "MIT", "publishConfig": { "access": "public" - } + }, + "sideEffects": false } diff --git a/packages/test-kit/package.json b/packages/test-kit/package.json index 8dea56dcb..fbbb14b3b 100644 --- a/packages/test-kit/package.json +++ b/packages/test-kit/package.json @@ -37,5 +37,6 @@ "license": "MIT", "publishConfig": { "access": "public" - } + }, + "sideEffects": false }