From fd27fb73629e379e36ca50903a8c123798c23a2c Mon Sep 17 00:00:00 2001 From: Adrien Cacciaguerra Date: Tue, 8 Mar 2022 12:11:42 +0100 Subject: [PATCH] chore(libraries): mark libaries as side-effects free https://webpack.js.org/guides/tree-shaking/\#conclusion --- .syncpackrc.js | 1 + contracts/core-contracts/package.json | 1 + contracts/forum-contracts/package.json | 1 + contracts/users-contracts/package.json | 1 + frontend/app/package.json | 4 ++-- packages/configuration/package.json | 1 + packages/serverless-configuration/package.json | 1 + packages/serverless-helpers/package.json | 1 + tools/generators/library/typed-json-config/package.json.ts | 1 + tools/generators/types/PackageJson.ts | 1 + 10 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.syncpackrc.js b/.syncpackrc.js index 67fd3af7..c12de5a7 100644 --- a/.syncpackrc.js +++ b/.syncpackrc.js @@ -24,6 +24,7 @@ module.exports = { 'bugs', 'repository', 'workspaces', + 'sideEffects', 'files', 'main', 'module', diff --git a/contracts/core-contracts/package.json b/contracts/core-contracts/package.json index 5aa0cbf2..eb9a9c6f 100644 --- a/contracts/core-contracts/package.json +++ b/contracts/core-contracts/package.json @@ -3,6 +3,7 @@ "private": true, "version": "1.0.0", "license": "UNLICENSED", + "sideEffects": false, "files": [ "dist" ], diff --git a/contracts/forum-contracts/package.json b/contracts/forum-contracts/package.json index 1f56d07a..eba22354 100644 --- a/contracts/forum-contracts/package.json +++ b/contracts/forum-contracts/package.json @@ -3,6 +3,7 @@ "private": true, "version": "1.0.0", "license": "UNLICENSED", + "sideEffects": false, "files": [ "dist" ], diff --git a/contracts/users-contracts/package.json b/contracts/users-contracts/package.json index 4d3543f7..fed22b91 100644 --- a/contracts/users-contracts/package.json +++ b/contracts/users-contracts/package.json @@ -3,6 +3,7 @@ "private": true, "version": "1.0.0", "license": "UNLICENSED", + "sideEffects": false, "files": [ "dist" ], diff --git a/frontend/app/package.json b/frontend/app/package.json index c3ab5679..0458b5f4 100644 --- a/frontend/app/package.json +++ b/frontend/app/package.json @@ -15,9 +15,9 @@ "stylelint-fix": "yarn stylelint-base-config --fix", "test": "yarn test-linter && yarn test-type && yarn test-unit", "test-linter": "yarn linter-base-config src", + "test-stylelint": "yarn stylelint-base-config **/*.{ts,tsx}", "test-type": "tsc --noEmit", - "test-unit": "jest --runInBand --collectCoverage --logHeapUsage --passWithNoTests", - "test-stylelint": "yarn stylelint-base-config **/*.{ts,tsx}" + "test-unit": "jest --runInBand --collectCoverage --logHeapUsage --passWithNoTests" }, "dependencies": { "@emotion/react": "^11.8.1", diff --git a/packages/configuration/package.json b/packages/configuration/package.json index df2eba94..fa62c559 100644 --- a/packages/configuration/package.json +++ b/packages/configuration/package.json @@ -3,6 +3,7 @@ "private": true, "version": "1.0.0", "license": "UNLICENSED", + "sideEffects": false, "files": [ "dist" ], diff --git a/packages/serverless-configuration/package.json b/packages/serverless-configuration/package.json index 812786ea..8b06833e 100644 --- a/packages/serverless-configuration/package.json +++ b/packages/serverless-configuration/package.json @@ -3,6 +3,7 @@ "private": true, "version": "1.0.0", "license": "UNLICENSED", + "sideEffects": false, "files": [ "dist" ], diff --git a/packages/serverless-helpers/package.json b/packages/serverless-helpers/package.json index a5f134c7..01dd9362 100644 --- a/packages/serverless-helpers/package.json +++ b/packages/serverless-helpers/package.json @@ -3,6 +3,7 @@ "private": true, "version": "1.0.0", "license": "UNLICENSED", + "sideEffects": false, "files": [ "dist" ], diff --git a/tools/generators/library/typed-json-config/package.json.ts b/tools/generators/library/typed-json-config/package.json.ts index 1e0e2406..93b65a14 100644 --- a/tools/generators/library/typed-json-config/package.json.ts +++ b/tools/generators/library/typed-json-config/package.json.ts @@ -8,6 +8,7 @@ export const packageJson = (options: NormalizedSchema): PackageJson => ({ private: true, version: '1.0.0', license: 'UNLICENSED', + sideEffects: false, files: ['dist'], main: 'dist/cjs/index.js', module: 'dist/esm/index.js', diff --git a/tools/generators/types/PackageJson.ts b/tools/generators/types/PackageJson.ts index 13aba53b..2d1fc1da 100644 --- a/tools/generators/types/PackageJson.ts +++ b/tools/generators/types/PackageJson.ts @@ -4,6 +4,7 @@ export interface PackageJson { private: boolean; version: string; license: string; + sideEffects: boolean; files: string[]; main: string; module: string;