From 8da0359d73b5b1dd4e437b31a900250ccbd56a6b Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Mon, 11 Nov 2024 18:26:53 +0800 Subject: [PATCH 1/7] fix broken lint i'm currently getting errors with yarn lint locally, but CI is succeeding. meaning i always have to bypass commit hooks Unable to resolve path to module '@uppy/...' import/no-unresolved --- .github/workflows/linters.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 214796b1b6..39ea4aa383 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -42,10 +42,8 @@ jobs: with: node-version: lts/* - name: Install dependencies - # List all projects that use a custom ESLint config: run: - corepack yarn workspaces focus @uppy/angular @uppy-example/angular - @uppy-example/react-native-expo @uppy/react-native @uppy-dev/build + corepack yarn install --immutable - name: Run linter run: corepack yarn run lint - name: Run Prettier From 8b5fdbf3d4f4a18849a238bd2f5cf9b6fc548cf0 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Mon, 11 Nov 2024 18:36:22 +0800 Subject: [PATCH 2/7] use built in cache --- .github/workflows/linters.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 39ea4aa383..80f9e54d5c 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -30,20 +30,13 @@ jobs: run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT - - uses: actions/cache@v4 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - name: Install Node.js uses: actions/setup-node@v4 with: node-version: lts/* + cache: yarn - name: Install dependencies - run: - corepack yarn install --immutable + run: corepack yarn install --immutable - name: Run linter run: corepack yarn run lint - name: Run Prettier From 437aecd87648c00428a7d660e395c28fd8b375b4 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Mon, 11 Nov 2024 18:39:26 +0800 Subject: [PATCH 3/7] skip corepack check --- .github/workflows/linters.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 80f9e54d5c..0a60418f7c 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -17,6 +17,7 @@ on: env: YARN_ENABLE_GLOBAL_CACHE: false + SKIP_YARN_COREPACK_CHECK: true jobs: lint_js: From c86e34fcaa148d7c30ac7f394a7bdb377cde9a25 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Mon, 11 Nov 2024 18:56:31 +0800 Subject: [PATCH 4/7] disable no-unresolved rule i don't think it's very necessary now that we have typescript --- .eslintrc.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index b6dcece1e8..77e5fbe8fd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -54,11 +54,7 @@ module.exports = { ignore: svgPresentationAttributes, }], - // Special rules for CI: - ...(process.env.CI && { - // Some imports are available only after a full build, which we don't do on CI. - 'import/no-unresolved': 'off', - }), + 'import/no-unresolved': 'off', // rules we want to enforce 'array-callback-return': 'error', From 22faa0552fab786a2231f42601a709b1c798c3ef Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Mon, 11 Nov 2024 18:58:45 +0800 Subject: [PATCH 5/7] revert --- .github/workflows/linters.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 0a60418f7c..8b678cbd08 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -37,7 +37,10 @@ jobs: node-version: lts/* cache: yarn - name: Install dependencies - run: corepack yarn install --immutable + # List all projects that use a custom ESLint config: + run: + corepack yarn workspaces focus @uppy/angular @uppy-example/angular + @uppy-example/react-native-expo @uppy/react-native @uppy-dev/build - name: Run linter run: corepack yarn run lint - name: Run Prettier From 491902fd5e267bd681c5b8b8db334eb1fd449481 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Mon, 11 Nov 2024 19:08:44 +0800 Subject: [PATCH 6/7] remove remnants of refactor https://github.com/transloadit/uppy/commit/c8d16f6a55fd1a5928f36e04defb8915693e3ad4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 39d067e66a..b1fa51fec6 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ "build:angular": "yarn workspace angular build", "build:js:typeless": "npm-run-all build:lib build:companion build:svelte", "build:js": "npm-run-all build:js:typeless build:locale-pack build:angular build:bundle", - "build:ts": "yarn workspaces list --no-private --json | yarn tsc -b && yarn workspace @uppy/svelte check", + "build:ts": "yarn tsc -b && yarn workspace @uppy/svelte check", "build:lib": "yarn node ./bin/build-lib.js", "build:locale-pack": "yarn workspace @uppy-dev/locale-pack build && eslint packages/@uppy/locales/src/en_US.ts --fix && yarn workspace @uppy-dev/locale-pack test unused", "build": "npm-run-all --serial build:ts --parallel build:js build:css --serial size", From e9bb37988eb0d45d31fe54b63b4dfc35c88d6fbd Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Mon, 11 Nov 2024 19:09:11 +0800 Subject: [PATCH 7/7] use built in cache for the other lint too --- .github/workflows/linters.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 8b678cbd08..12a96650b7 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -26,10 +26,6 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v4 - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: - echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT - name: Install Node.js uses: actions/setup-node@v4 @@ -52,22 +48,11 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v4 - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: - echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT - - - uses: actions/cache@v4 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - name: Install Node.js uses: actions/setup-node@v4 with: node-version: lts/* + cache: yarn - name: Install dependencies run: corepack yarn workspaces focus @uppy-dev/build - name: Run linter