From 8d3e33d95f3a481d1689009a36a879177536a870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Vanvelthem?= Date: Thu, 19 May 2022 14:33:44 +0200 Subject: [PATCH 01/10] feat: add eslint plugin tailwind --- packages/eslint-config-bases/package.json | 8 +++-- .../eslint-config-bases/src/bases/tailwind.js | 33 +++++++++++++++++++ yarn.lock | 18 ++++++++-- 3 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 packages/eslint-config-bases/src/bases/tailwind.js diff --git a/packages/eslint-config-bases/package.json b/packages/eslint-config-bases/package.json index f9223bebc99..afbbb23b25f 100644 --- a/packages/eslint-config-bases/package.json +++ b/packages/eslint-config-bases/package.json @@ -49,13 +49,16 @@ "./storybook": { "require": "./src/bases/react.js" }, + "./tailwind": { + "require": "./src/bases/tailwind.js" + }, "./typescript": { "require": "./src/bases/typescript.js" } }, "scripts": { - "clean": "rimraf --no-glob ./dist ./coverage ./tsconfig.tsbuildinfo ./.eslintcache", - "lint": "eslint --ext .ts,.js", + "clean": "rimraf --no-glob ./dist ./coverage ./tsconfig.tsbuildinfo", + "lint": "eslint --ext .ts,.js --cache --cache-location ../../.cache/eslint/eslint-config-bases.eslintcache", "typecheck": "tsc --project tsconfig.json --noEmit", "fix-all-files": "eslint --ext .ts,.tsx,.js,.jsx --fix" }, @@ -82,6 +85,7 @@ "eslint-plugin-react-hooks": "4.5.0", "eslint-plugin-regexp": "1.7.0", "eslint-plugin-sonarjs": "0.13.0", + "eslint-plugin-tailwindcss": "3.5.0", "eslint-plugin-testing-library": "5.5.0", "prettier": "2.6.2", "rimraf": "3.0.2" diff --git a/packages/eslint-config-bases/src/bases/tailwind.js b/packages/eslint-config-bases/src/bases/tailwind.js new file mode 100644 index 00000000000..b4e91ef9121 --- /dev/null +++ b/packages/eslint-config-bases/src/bases/tailwind.js @@ -0,0 +1,33 @@ +/** + * Opinionated config base for projects using react. + * @see https://github.com/belgattitude/nextjs-monorepo-example/tree/main/packages/eslint-config-bases + */ + +const reactPatterns = { + files: ['*.{jsx,tsx}'], +}; + +/** + * Fine-tune naming convention react typescript jsx (function components) + * @link https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/naming-convention.md + */ + +module.exports = { + env: { + browser: true, + es6: true, + node: true, + }, + overrides: [ + { + files: [...reactPatterns.files], + extends: [ + // @see https://github.com/francoismassart/eslint-plugin-tailwindcss, + 'plugin:tailwindcss/recommended', + ], + rules: { + 'tailwindcss/no-custom-classname': 'off', + }, + }, + ], +}; diff --git a/yarn.lock b/yarn.lock index a6db49dd32e..d7c155744ee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8042,6 +8042,7 @@ __metadata: eslint-plugin-react-hooks: "npm:4.5.0" eslint-plugin-regexp: "npm:1.7.0" eslint-plugin-sonarjs: "npm:0.13.0" + eslint-plugin-tailwindcss: "npm:3.5.0" eslint-plugin-testing-library: "npm:5.5.0" graphql: "npm:16.5.0" prettier: "npm:2.6.2" @@ -13447,6 +13448,17 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-tailwindcss@npm:3.5.0": + version: 3.5.0 + resolution: "eslint-plugin-tailwindcss@npm:3.5.0" + dependencies: + fast-glob: "npm:^3.2.5" + postcss: "npm:^8.4.4" + tailwindcss: "npm:^3.0.7" + checksum: 6ed04288ac7b53779924c5fc5904779d806e60fa85f58c24d39172766a998c76a644ac58d9af14c19c17db541595585c9e21679023c5b29aa2545c30c6401e92 + languageName: node + linkType: hard + "eslint-plugin-testing-library@npm:5.5.0, eslint-plugin-testing-library@npm:^5.0.5": version: 5.5.0 resolution: "eslint-plugin-testing-library@npm:5.5.0" @@ -14020,7 +14032,7 @@ __metadata: languageName: node linkType: hard -"fast-glob@npm:3.2.11, fast-glob@npm:^3.0.3, fast-glob@npm:^3.2.11, fast-glob@npm:^3.2.9": +"fast-glob@npm:3.2.11, fast-glob@npm:^3.0.3, fast-glob@npm:^3.2.11, fast-glob@npm:^3.2.5, fast-glob@npm:^3.2.9": version: 3.2.11 resolution: "fast-glob@npm:3.2.11" dependencies: @@ -22837,7 +22849,7 @@ __metadata: languageName: node linkType: hard -"postcss@npm:8.4.14, postcss@npm:^7.0.30 || ^8.0.0, postcss@npm:^8.2.1, postcss@npm:^8.4.12, postcss@npm:^8.4.13": +"postcss@npm:8.4.14, postcss@npm:^7.0.30 || ^8.0.0, postcss@npm:^8.2.1, postcss@npm:^8.4.12, postcss@npm:^8.4.13, postcss@npm:^8.4.4": version: 8.4.14 resolution: "postcss@npm:8.4.14" dependencies: @@ -26547,7 +26559,7 @@ __metadata: languageName: node linkType: hard -"tailwindcss@npm:3.0.24": +"tailwindcss@npm:3.0.24, tailwindcss@npm:^3.0.7": version: 3.0.24 resolution: "tailwindcss@npm:3.0.24" dependencies: From ae40b956f0e0145de167c5c6e8059915da42a078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Vanvelthem?= Date: Thu, 19 May 2022 14:33:57 +0200 Subject: [PATCH 02/10] feat: add eslint plugin tailwind --- packages/eslint-config-bases/src/bases/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/eslint-config-bases/src/bases/index.js b/packages/eslint-config-bases/src/bases/index.js index 0a0527304e4..44f531f12f8 100644 --- a/packages/eslint-config-bases/src/bases/index.js +++ b/packages/eslint-config-bases/src/bases/index.js @@ -5,7 +5,8 @@ module.exports = { react: require('./react'), regexp: require('./regexp'), reactTestingLibrary: require('./rtl'), + sonar: require('./sonar'), storybook: require('./storybook'), + tailwind: require('./tailwind'), typescript: require('./typescript'), - sonar: require('./sonar'), }; From 200df788ab31e3c0ab41136f8460fce55be8744a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Vanvelthem?= Date: Thu, 19 May 2022 14:34:22 +0200 Subject: [PATCH 03/10] chore(eslint): enable tailwind plugin --- apps/nextjs-app/.eslintrc.js | 1 + apps/remix-app/.eslintrc.js | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/nextjs-app/.eslintrc.js b/apps/nextjs-app/.eslintrc.js index 87b3df11f58..c34816402db 100644 --- a/apps/nextjs-app/.eslintrc.js +++ b/apps/nextjs-app/.eslintrc.js @@ -16,6 +16,7 @@ module.exports = { '@your-org/eslint-config-bases/regexp', '@your-org/eslint-config-bases/jest', '@your-org/eslint-config-bases/react', + '@your-org/eslint-config-bases/tailwind', '@your-org/eslint-config-bases/rtl', '@your-org/eslint-config-bases/graphql-schema', // Add specific rules for nextjs diff --git a/apps/remix-app/.eslintrc.js b/apps/remix-app/.eslintrc.js index cf2cd6892c4..310149b390f 100644 --- a/apps/remix-app/.eslintrc.js +++ b/apps/remix-app/.eslintrc.js @@ -21,6 +21,7 @@ module.exports = { '@your-org/eslint-config-bases/regexp', '@your-org/eslint-config-bases/jest', '@your-org/eslint-config-bases/react', + '@your-org/eslint-config-bases/tailwind', '@your-org/eslint-config-bases/rtl', '@your-org/eslint-config-bases/graphql-schema', // Specific rules for remix From f5e2efb332971fb83294a64abd42db658245b619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Vanvelthem?= Date: Thu, 19 May 2022 14:34:53 +0200 Subject: [PATCH 04/10] chore: enhance eslint cache location --- apps/nextjs-app/package.json | 4 ++-- apps/remix-app/package.json | 4 ++-- apps/vite-app/package.json | 2 +- packages/api-gateway/package.json | 4 ++-- packages/common-i18n/package.json | 4 ++-- packages/core-lib/package.json | 4 ++-- packages/db-main-prisma/package.json | 4 ++-- packages/ui-lib/package.json | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/apps/nextjs-app/package.json b/apps/nextjs-app/package.json index 4030801e2e6..8085d018470 100644 --- a/apps/nextjs-app/package.json +++ b/apps/nextjs-app/package.json @@ -27,7 +27,7 @@ ] }, "scripts": { - "clean": "rimraf --no-glob ./.next ./out ./coverage ./tsconfig.tsbuildinfo ./.eslintcache", + "clean": "rimraf --no-glob ./.next ./out ./coverage ./tsconfig.tsbuildinfo", "dev": "next", "build": "next build", "build-fast": "cross-env NEXTJS_IGNORE_TYPECHECK=1 NEXTJS_IGNORE_ESLINT=1 NEXTJS_DISABLE_SENTRY=1 NEXTJS_SENTRY_UPLOAD_DRY_RUN=1 next build", @@ -45,7 +45,7 @@ "test-unit-watch": "vitest watch --ui", "test-e2e": "cross-env E2E_WEBSERVER_MODE=BUILD_AND_START playwright test", "typecheck": "tsc --project ./tsconfig.json --noEmit", - "lint": "eslint . --ext .ts,.tsx,.js,.jsx,.mdx,.graphql --cache", + "lint": "eslint . --ext .ts,.tsx,.js,.jsx,.mdx,.graphql --cache --cache-location ../../.cache/eslint/nextjs-app.eslintcache", "fix-all-files": "eslint . --ext .ts,.tsx,.js,.jsx,.mdx,.graphql --fix", "?postinstall": "@todo: the prisma generate seems to be required, but is installed at the root", "postinstall": "test -n \"$SKIP_POSTINSTALL\" || yarn workspace @your-org/db-main-prisma run prisma generate" diff --git a/apps/remix-app/package.json b/apps/remix-app/package.json index 321e4aff57b..e42a186cabe 100644 --- a/apps/remix-app/package.json +++ b/apps/remix-app/package.json @@ -20,7 +20,7 @@ "dev": "npm-run-all --parallel --print-label watch-tailwind remix-dev", "watch-tailwind": "tailwindcss -o ./src/tailwind.css --watch", "remix-dev": "remix dev", - "clean": "rimraf --no-glob ./.cache ./coverage ./src/tailwind.css ./tsconfig.tsbuildinfo ./.eslintcache && jest --clear-cache", + "clean": "rimraf --no-glob ./.cache ./coverage ./src/tailwind.css ./tsconfig.tsbuildinfo", "?share-static-symlink": "echo 'Use this command to link assets... from shared static folder'", "share-static-symlink": "rimraf ./public/shared-assets && symlink-dir ../../static/assets ./public/shared-assets", "?share-static-hardlink": "echo 'Use this command to link assets... from shared static folder'", @@ -28,7 +28,7 @@ "test": "yarn test-unit", "test-unit": "jest --config jest.config.js", "typecheck": "tsc --project ./tsconfig.json --noEmit", - "lint": "eslint . --ext .ts,.tsx,.js,.jsx,.mdx,.graphql --cache", + "lint": "eslint . --ext .ts,.tsx,.js,.jsx,.mdx,.graphql --cache --cache-location ../../.cache/eslint/remix-app.eslintcache", "lint-styles": "stylelint 'src/**/*.css'", "fix-all-files": "eslint . --ext .ts,.tsx,.js,.jsx,.mdx,.graphql --fix" }, diff --git a/apps/vite-app/package.json b/apps/vite-app/package.json index b746eb0aaa1..49ca0566c2f 100644 --- a/apps/vite-app/package.json +++ b/apps/vite-app/package.json @@ -11,7 +11,7 @@ "test": "yarn test-unit", "test-unit": "echo 'No test present yet'", "typecheck": "tsc --project ./tsconfig.json --noEmit", - "lint": "eslint . --ext .ts,.tsx,.js,.jsx --cache", + "lint": "eslint . --ext .ts,.tsx,.js,.jsx --cache --cache-location ../../.cache/eslint/vite-app.eslintcache", "fix-all-files": "eslint . --ext .ts,.tsx,.js,.jsx --fix" }, "dependencies": { diff --git a/packages/api-gateway/package.json b/packages/api-gateway/package.json index 0951f8634b6..ffe5f372eb9 100644 --- a/packages/api-gateway/package.json +++ b/packages/api-gateway/package.json @@ -20,8 +20,8 @@ "types": "dist/index.d.ts", "scripts": { "build-graphql-mesh": "mesh build", - "clean": "rimraf --no-glob ./dist ./coverage ./tsconfig.tsbuildinfo ./.eslintcache && jest --clear-cache", - "lint": "eslint . --ext .ts,.tsx,.js,.jsx", + "clean": "rimraf --no-glob ./dist ./coverage ./tsconfig.tsbuildinfo", + "lint": "eslint . --ext .ts,.tsx,.js,.jsx --cache --cache-location ../../.cache/eslint/api-gateway.eslintcache", "typecheck": "tsc --project ./tsconfig.json --noEmit", "test": "jest --config jest.config.js --passWithNoTests", "fix-all-files": "eslint . --ext .ts,.tsx,.js,.jsx --fix" diff --git a/packages/common-i18n/package.json b/packages/common-i18n/package.json index 127a40f0b75..bb2894cbf97 100644 --- a/packages/common-i18n/package.json +++ b/packages/common-i18n/package.json @@ -22,8 +22,8 @@ } }, "scripts": { - "clean": "rimraf --no-glob ./dist ./coverage ./tsconfig.tsbuildinfo ./.eslintcache && jest --clear-cache", - "lint": "eslint . --ext .ts,.tsx,.js,.jsx", + "clean": "rimraf --no-glob ./dist ./coverage ./tsconfig.tsbuildinfo", + "lint": "eslint . --ext .ts,.tsx,.js,.jsx --cache --cache-location ../../.cache/eslint/common-i18n.eslintcache", "typecheck": "tsc --project ./tsconfig.json --noEmit" }, "devDependencies": { diff --git a/packages/core-lib/package.json b/packages/core-lib/package.json index 8e6bd3f3a44..190360e62bd 100644 --- a/packages/core-lib/package.json +++ b/packages/core-lib/package.json @@ -22,8 +22,8 @@ "build": "rimraf --no-glob ./dist && cross-env NODE_ENV=production microbundle --tsconfig ./tsconfig.build.json --jsx React.createElement --jsxFragment React.Fragment -f cjs,es --no-compress", "build-react17jsx": "microbundle --tsconfig ./tsconfig.build.json --jsx jsx --jsxImportSource react --globals react/jsx-runtime=jsx --compress", "dev": "microbundle watch", - "clean": "rimraf --no-glob ./dist ./coverage ./tsconfig.tsbuildinfo ./.eslintcache && jest --clear-cache", - "lint": "eslint . --ext .ts,.tsx,.js,.jsx", + "clean": "rimraf --no-glob ./dist ./coverage ./tsconfig.tsbuildinfo", + "lint": "eslint . --ext .ts,.tsx,.js,.jsx --cache --cache-location ../../.cache/eslint/core-lib.eslintcache", "typecheck": "tsc --project ./tsconfig.json --noEmit", "test": "run-s test-unit", "test-unit": "jest --config jest.config.js", diff --git a/packages/db-main-prisma/package.json b/packages/db-main-prisma/package.json index e5d89875727..eecaeef6865 100644 --- a/packages/db-main-prisma/package.json +++ b/packages/db-main-prisma/package.json @@ -24,8 +24,8 @@ "prisma-db-seed": "dotenv-flow -- yarn prisma db seed", "prisma-db-push": "dotenv-flow -- yarn prisma db push", "prisma-studio": "dotenv-flow -- yarn prisma studio", - "clean": "rimraf --no-glob ./tsconfig.tsbuildinfo ./.eslintcache", - "lint": "eslint . --ext .ts,.tsx,.js,.jsx", + "clean": "rimraf --no-glob ./tsconfig.tsbuildinfo", + "lint": "eslint . --ext .ts,.tsx,.js,.jsx --cache --cache-location ../../.cache/eslint/db-main-prisma.eslintcache", "typecheck": "tsc --project ./tsconfig.json --noEmit", "test": "run-s test:unit", "test-unit": "echo \"No unit tests yet\"", diff --git a/packages/ui-lib/package.json b/packages/ui-lib/package.json index f85fc6ab8d2..03dad028588 100644 --- a/packages/ui-lib/package.json +++ b/packages/ui-lib/package.json @@ -23,7 +23,7 @@ "build-react17jsx": "microbundle --tsconfig ./tsconfig.build.json --jsx jsx --jsxImportSource react --globals react/jsx-runtime=jsx --compress", "dev": "microbundle watch --tsconfig ./tsconfig.build.json", "clean": "rimraf --no-glob ./dist ./tsconfig.tsbuildinfo ./node_modules/.cache", - "lint": "eslint . --ext .ts,.tsx,.js,.jsx", + "lint": "eslint . --ext .ts,.tsx,.js,.jsx --cache --cache-location ../../.cache/eslint/ui-lib.eslintcache", "typecheck": "tsc --project ./tsconfig.json --noEmit", "test": "run-s test-unit", "test-unit": "echo \"No unit tests yet\"", From afc48a638aec2ecc0e9810dffabe746cdefe51f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Vanvelthem?= Date: Thu, 19 May 2022 14:35:17 +0200 Subject: [PATCH 05/10] chore: add global cache clean --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index da02bc6d73f..8ad95812f81 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "packages/*" ], "scripts": { - "g:clean": "rimraf '.cache/*' && yarn workspaces foreach -ptv run clean", + "g:clean": "yarn clean:global-cache && yarn workspaces foreach -ptv run clean", "g:build": "yarn workspaces foreach -p --topological-dev -v run build", "g:build-changed": "yarn workspaces foreach --topological-dev --no-private -v --since=origin/main run build", "g:test-unit": "yarn workspaces foreach -ptv run test-unit", @@ -43,6 +43,7 @@ "g:release": "yarn g:build && changeset publish", "g:share-static-symlink": "yarn workspaces foreach -pv --include '*-app' run share-static-symlink", "g:share-static-hardlink": "yarn workspaces foreach -pv --include '*-app' run share-static-hardlink", + "clean:global-cache": "rimraf --no-glob ./.cache", "apps:build": "yarn workspaces foreach -ptv --include '*-app' run build", "apps:clean": "yarn workspaces foreach -ptv --include '*-app' run clean", "packages:build": "yarn workspaces foreach -ptv --include '@your-org/*' run build", From 41f8d0a3baf5850f979943ce82f60630f09d5b03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Vanvelthem?= Date: Thu, 19 May 2022 14:36:22 +0200 Subject: [PATCH 06/10] docs: mention global cache cleanup --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 07dc52348a4..1572e0c00cf 100644 --- a/README.md +++ b/README.md @@ -383,6 +383,7 @@ Some convenience scripts can be run in any folder of this repo and will call the | `yarn g:build` | Clean every caches and dist folders in all apps & packages | | `yarn g:clean` | Add a changeset | | `yarn g:check-dist` | Ensure build dist files passes es2017 (run `g:build` first). | +| `yarn clean:global-cache` | Clean tooling caches (eslint, jest...) | | `yarn deps:check --dep dev` | Will print what packages can be upgraded globally (see also [.ncurc.yml](https://github.com/sortlist/packages/blob/main/.ncurc.yml)) | | `yarn deps:update --dep dev` | Apply possible updates (run `yarn install && yarn dedupe` after) | | `yarn check:install` | Verify if there's no dependency missing in packages | From 8fcad0f7deeebc4019e475b2fe2d4f77731d3b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Vanvelthem?= Date: Thu, 19 May 2022 14:37:38 +0200 Subject: [PATCH 07/10] refactor: reorder tailwind classes --- apps/nextjs-app/src/components/Banner.tsx | 8 ++++---- .../src/features/demo/components/PoemCard.tsx | 2 +- .../src/features/home/blocks/cta/CtaBlock.tsx | 6 +++--- .../features/home/blocks/features/FeaturesBlock.tsx | 8 ++++---- .../src/features/home/blocks/hero/HeroBlock.tsx | 12 ++++++------ .../src/features/system/pages/ErrorPage.tsx | 6 +++--- .../src/features/system/pages/NotFoundPage.tsx | 4 ++-- .../src/features/system/pages/NotFoundPage.tsx | 4 ++-- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/apps/nextjs-app/src/components/Banner.tsx b/apps/nextjs-app/src/components/Banner.tsx index ea45f9e2208..8b2b198827d 100644 --- a/apps/nextjs-app/src/components/Banner.tsx +++ b/apps/nextjs-app/src/components/Banner.tsx @@ -8,7 +8,7 @@ type Props = { export const Banner: FC = () => { return (
-
+
@@ -21,7 +21,7 @@ export const Banner: FC = () => {

-
+ -
+
-
-
+
= (props) => { Error {statusCode} -
-
+
+

Woops !

Something went wrong. Please try again later.

-
+

Code: {statusCode}

Message: {message}

Error id: {errorId}

diff --git a/apps/nextjs-app/src/features/system/pages/NotFoundPage.tsx b/apps/nextjs-app/src/features/system/pages/NotFoundPage.tsx index d6e1aea8309..1b6015161a9 100644 --- a/apps/nextjs-app/src/features/system/pages/NotFoundPage.tsx +++ b/apps/nextjs-app/src/features/system/pages/NotFoundPage.tsx @@ -17,14 +17,14 @@ export const NotFoundPage: FC = (props) => { {title} -
+ diff --git a/apps/remix-app/src/features/system/pages/NotFoundPage.tsx b/apps/remix-app/src/features/system/pages/NotFoundPage.tsx index f21387d22d3..13b93f55ffc 100644 --- a/apps/remix-app/src/features/system/pages/NotFoundPage.tsx +++ b/apps/remix-app/src/features/system/pages/NotFoundPage.tsx @@ -9,14 +9,14 @@ export const NotFoundPage: FC = (props) => { const title = props.title || 'Not Found'; return ( <> -
+ From 5ad462a9a621564366c7a0ef0a77899fc855de85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Vanvelthem?= Date: Thu, 19 May 2022 14:38:44 +0200 Subject: [PATCH 08/10] docs: changesets --- .changeset/empty-knives-compare.md | 5 +++++ .changeset/grumpy-colts-run.md | 13 +++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 .changeset/empty-knives-compare.md create mode 100644 .changeset/grumpy-colts-run.md diff --git a/.changeset/empty-knives-compare.md b/.changeset/empty-knives-compare.md new file mode 100644 index 00000000000..62e381e772c --- /dev/null +++ b/.changeset/empty-knives-compare.md @@ -0,0 +1,5 @@ +--- +"@your-org/eslint-config-bases": minor +--- + +Add support for eslint-plugin-tailwind diff --git a/.changeset/grumpy-colts-run.md b/.changeset/grumpy-colts-run.md new file mode 100644 index 00000000000..13320e5f3cc --- /dev/null +++ b/.changeset/grumpy-colts-run.md @@ -0,0 +1,13 @@ +--- +"nextjs-app": minor +"remix-app": minor +"vite-app": minor +"@your-org/api-gateway": minor +"@your-org/common-i18n": minor +"@your-org/core-lib": minor +"@your-org/db-main-prisma": minor +"@your-org/eslint-config-bases": minor +"@your-org/ui-lib": minor +--- + +Enable eslint global cache From 6febbb3c3dfc3b20f76fd1a29c12a1ecd3bc55a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Vanvelthem?= Date: Thu, 19 May 2022 14:41:03 +0200 Subject: [PATCH 09/10] docs: fix description --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1572e0c00cf..5432cd119fd 100644 --- a/README.md +++ b/README.md @@ -381,7 +381,7 @@ Some convenience scripts can be run in any folder of this repo and will call the | `yarn g:test-unit` | Run unit tests in all apps & packages | | `yarn g:test-e2e` | Run unit tests in all apps & packages | | `yarn g:build` | Clean every caches and dist folders in all apps & packages | -| `yarn g:clean` | Add a changeset | +| `yarn g:clean` | Clean apps/packages builds | | `yarn g:check-dist` | Ensure build dist files passes es2017 (run `g:build` first). | | `yarn clean:global-cache` | Clean tooling caches (eslint, jest...) | | `yarn deps:check --dep dev` | Will print what packages can be upgraded globally (see also [.ncurc.yml](https://github.com/sortlist/packages/blob/main/.ncurc.yml)) | From 8987cde034c67596f0fddeb82d2db8a92b7bd746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Vanvelthem?= Date: Thu, 19 May 2022 14:47:04 +0200 Subject: [PATCH 10/10] ci: move cache to toplevel --- .github/workflows/ci-e2e-nextjs-app.yml | 1 - .github/workflows/ci-nextjs-app.yml | 3 +-- .github/workflows/ci-packages.yml | 3 +-- .github/workflows/ci-remix-app.yml | 2 +- .github/workflows/ci-vite-app.yml | 2 +- 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-e2e-nextjs-app.yml b/.github/workflows/ci-e2e-nextjs-app.yml index 335bcd543ca..6e0343478d9 100644 --- a/.github/workflows/ci-e2e-nextjs-app.yml +++ b/.github/workflows/ci-e2e-nextjs-app.yml @@ -72,7 +72,6 @@ jobs: ${{ github.workspace }}/apps/nextjs-app/.next/cache ${{ github.workspace }}/.cache ${{ github.workspace }}/**/tsconfig.tsbuildinfo - ${{ github.workspace }}/**/.eslintcache key: ${{ runner.os }}-nextjs-app-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/nextjs-app/src/**.[jt]sx?', 'apps/nextjs-app/src/**.json') }} restore-keys: | diff --git a/.github/workflows/ci-nextjs-app.yml b/.github/workflows/ci-nextjs-app.yml index da981a99c87..f078c3ca53a 100644 --- a/.github/workflows/ci-nextjs-app.yml +++ b/.github/workflows/ci-nextjs-app.yml @@ -65,7 +65,6 @@ jobs: ${{ github.workspace }}/apps/nextjs-app/.next/cache ${{ github.workspace }}/.cache ${{ github.workspace }}/**/tsconfig.tsbuildinfo - ${{ github.workspace }}/**/.eslintcache key: ${{ runner.os }}-nextjs-nextjs-app-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/nextjs-app/src/**.[jt]sx?', 'apps/nextjs-app/src/**.json') }} restore-keys: | @@ -85,7 +84,7 @@ jobs: - name: Linter working-directory: apps/nextjs-app run: | - yarn lint --cache + yarn lint - name: Unit tests working-directory: apps/nextjs-app diff --git a/.github/workflows/ci-packages.yml b/.github/workflows/ci-packages.yml index f4b8c6379e7..ed1d50d7e3b 100644 --- a/.github/workflows/ci-packages.yml +++ b/.github/workflows/ci-packages.yml @@ -67,7 +67,6 @@ jobs: path: | ${{ github.workspace }}/.cache ${{ github.workspace }}/**/tsconfig.tsbuildinfo - ${{ github.workspace }}/**/.eslintcache key: ${{ runner.os }}-packages-cache-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('packages/**.[jt]sx?', 'packages/**.json') }} restore-keys: | @@ -86,7 +85,7 @@ jobs: # Lint packages that have changed (--include & --since) - name: Linter run: | - yarn workspaces foreach -tv --include '@your-org/*' --since=origin/main --recursive run lint --cache + yarn workspaces foreach -tv --include '@your-org/*' --since=origin/main --recursive run lint yarn workspaces foreach -tv --include '@your-org/*' --since=origin/main --recursive run lint-styles # Test packages that have changed (--include & --since) diff --git a/.github/workflows/ci-remix-app.yml b/.github/workflows/ci-remix-app.yml index eb0145964ec..bac7f18b88b 100644 --- a/.github/workflows/ci-remix-app.yml +++ b/.github/workflows/ci-remix-app.yml @@ -67,7 +67,7 @@ jobs: - name: Linter working-directory: apps/remix-app run: | - yarn lint --cache + yarn lint yarn lint-styles - name: Unit tests diff --git a/.github/workflows/ci-vite-app.yml b/.github/workflows/ci-vite-app.yml index 1a60f5d45db..db6226a90f6 100644 --- a/.github/workflows/ci-vite-app.yml +++ b/.github/workflows/ci-vite-app.yml @@ -67,7 +67,7 @@ jobs: - name: Linter working-directory: apps/vite-app run: | - yarn lint --cache + yarn lint - name: Unit tests working-directory: apps/vite-app