From b8f21ad3571fe6b0c0f1fbce5ab404e34b0f8d6a Mon Sep 17 00:00:00 2001 From: Heitor Carvalho Date: Tue, 26 Apr 2022 22:56:07 -0300 Subject: [PATCH 1/2] Add 'optionalDependencies' to package.json - Move dependencies that are not necessary to build the application to 'optionalDependencies' - A faster yarn install can now be performed with 'yarn install --ignore-optional' --- package.json | 50 ++++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index 9b39fd66..af7fd017 100644 --- a/package.json +++ b/package.json @@ -56,50 +56,52 @@ }, "devDependencies": { "@babel/core": "^7.17.8", - "@cypress/code-coverage": "^3.9.10", - "@graphql-codegen/cli": "^2.2.1", - "@graphql-codegen/typescript": "^2.2.4", - "@graphql-codegen/typescript-operations": "^2.1.8", - "@lhci/cli": "^0.9.0", - "@netlify/plugin-gatsby": "^2.0.0-beta", - "@storybook/addon-a11y": "^6.4.20", - "@storybook/addon-actions": "^6.4.20", - "@storybook/addon-essentials": "^6.4.20", - "@storybook/addon-links": "^6.4.20", - "@storybook/builder-webpack5": "^6.4.20", - "@storybook/manager-webpack5": "^6.4.20", - "@storybook/react": "^6.4.20", - "@testing-library/cypress": "^8.0.0", - "@types/cypress": "^1.1.3", - "@vtex/lighthouse-config": "^1.7.33", - "@vtex/prettier-config": "1.0.0", - "@vtex/tsconfig": "0.6.0", + "babel-loader": "^8.2.4", + "gatsby-plugin-bundle-stats": "^3.1.3", + "gatsby-plugin-postcss": "^5.3.0", + "husky": "^5.2.0", + "postcss": "^8.4.4" + }, + "optionalDependencies": { "autoprefixer": "^10.4.0", "axe-core": "^4.3.3", - "babel-loader": "^8.2.4", "babel-plugin-remove-graphql-queries": "^4.11.1", "cypress": "6.6.0", "cypress-axe": "^0.13.0", "cypress-wait-until": "^1.7.2", + "@cypress/code-coverage": "^3.9.10", "dotenv": "^8.2.0", "eslint": "^7.22.0", "eslint-config-vtex-react": "^7.0.0", - "gatsby-plugin-bundle-stats": "^3.1.3", - "gatsby-plugin-postcss": "^5.3.0", - "husky": "^5.2.0", + "@graphql-codegen/cli": "^2.2.1", + "@graphql-codegen/typescript": "^2.2.4", + "@graphql-codegen/typescript-operations": "^2.1.8", "is-ci": "^3.0.0", + "@lhci/cli": "^0.9.0", "lint-staged": "^10.5.4", - "postcss": "^8.4.4", + "@netlify/plugin-gatsby": "^2.0.0-beta", "prettier": "^2.2.0", "storybook-addon-gatsby": "^0.0.5", + "@storybook/addon-a11y": "^6.4.20", + "@storybook/addon-actions": "^6.4.20", + "@storybook/addon-essentials": "^6.4.20", + "@storybook/addon-links": "^6.4.20", + "@storybook/builder-webpack5": "^6.4.20", + "@storybook/manager-webpack5": "^6.4.20", + "@storybook/react": "^6.4.20", "stylelint": "^14.6.0", "stylelint-config-recess-order": "^3.0.0", "stylelint-config-standard": "^24.0.0", "stylelint-config-standard-scss": "^3.0.0", "stylelint-order": "^5.0.0", "stylelint-scss": "^4.0.1", + "@testing-library/cypress": "^8.0.0", "tsconfig-paths-webpack-plugin": "^3.5.2", - "typescript": "^4.6.2" + "@types/cypress": "^1.1.3", + "typescript": "^4.6.2", + "@vtex/lighthouse-config": "^1.7.33", + "@vtex/prettier-config": "1.0.0", + "@vtex/tsconfig": "0.6.0" }, "resolutions": { "@typescript-eslint/parser": "^4", From abbf79784e611947c89306c3a491f9f2cfa156db Mon Sep 17 00:00:00 2001 From: Heitor Carvalho Date: Thu, 5 May 2022 15:40:11 -0300 Subject: [PATCH 2/2] Add YARN_IGNORE_OPTIONAL_DEPS to vtex.env - This boolean env var allows us to choose if yarn install will be run with the '--ignore-optional' flag when running the CI --- vtex.env | 1 + 1 file changed, 1 insertion(+) diff --git a/vtex.env b/vtex.env index 736d2801..678f90e9 100644 --- a/vtex.env +++ b/vtex.env @@ -7,6 +7,7 @@ GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR=false # Set to false while the WebOps team fixes the Jira's DXWP-279 issue. USE_NODE_MODULES_CACHE=false USE_GATSBY_CACHE=true +YARN_IGNORE_OPTIONAL_DEPS=true # 🐞🐞 Uncomment for debugging final bundle 🐞🐞 # GATSBY_STORE_PROFILING=true