diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cec3a8123..26ba0d8186 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,37 +1,41 @@ name: Node CI -on: [push, pull_request] +on: + push: + branches: + - main + pull_request: + branches: + - main + jobs: build: runs-on: ubuntu-latest strategy: matrix: - node-version: [16.x, 18.x] + node-version: [20.x] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} + cache: 'yarn' - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - - uses: actions/cache@v2 - 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- - - - run: yarn install - name: Install Dependencies + - name: Enable Corepack + run: corepack enable + + - name: Configure Yarn + run: | + yarn config set nodeLinker node-modules + yarn config set enableGlobalCache false + - name: Install Dependencies + run: yarn install + - name: TurboRepo local server uses: felixmosh/turborepo-gh-artifacts@v2 with: @@ -47,7 +51,4 @@ jobs: TURBO_TEAM: 'react-dnd' - name: Publish coverage to codecov.io - uses: codecov/codecov-action@v1.0.13 - if: success() && matrix.node-version == '14.x' - with: - token: ${{ secrets.CODECOV_TOKEN }} + uses: codecov/codecov-action@v3 \ No newline at end of file diff --git a/.github/workflows/docsite.yml b/.github/workflows/docsite.yml index 4225ea1c0f..b87d32aa23 100644 --- a/.github/workflows/docsite.yml +++ b/.github/workflows/docsite.yml @@ -7,21 +7,22 @@ on: jobs: deploy-documentation: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - name: Use Node.js 16.x - uses: actions/setup-node@v1 + - uses: actions/checkout@v3 + - name: Use Node.js 20.x + uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 20.x + cache: 'yarn' - run: yarn install - run: 'yarn build:' - run: yarn build:docsite - name: deploy - uses: peaceiris/actions-gh-pages@v2.10.1 - env: - ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} - PUBLISH_BRANCH: gh-pages - PUBLISH_DIR: ./packages/docsite/public + uses: peaceiris/actions-gh-pages@v3 + with: + deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} + publish_branch: gh-pages + publish_dir: ./packages/docsite/public diff --git a/.github/workflows/fix-dependabot.yml b/.github/workflows/fix-dependabot.yml index a13ca7932e..a7458ed5c5 100644 --- a/.github/workflows/fix-dependabot.yml +++ b/.github/workflows/fix-dependabot.yml @@ -8,15 +8,16 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 2 - persist-credentials: false # minimize exposure + persist-credentials: false - - name: Use Node.js 14.x - uses: actions/setup-node@v1 + - name: Use Node.js 20.x + uses: actions/setup-node@v3 with: - node-version: '14' + node-version: '20' + cache: 'yarn' - name: Config Git run: | diff --git a/.github/workflows/version-check.yml b/.github/workflows/version-check.yml index 4e37d7dc00..f547e937bd 100644 --- a/.github/workflows/version-check.yml +++ b/.github/workflows/version-check.yml @@ -1,7 +1,14 @@ name: Version Check -on: [push, pull_request] +on: + push: + branches: + - main + pull_request: + branches: + - main + env: - DEFAULT_NODE_VERSION: 16 + DEFAULT_NODE_VERSION: 20 jobs: version-check: runs-on: ubuntu-latest @@ -10,7 +17,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v3 with: node-version: ${{env.DEFAULT_NODE_VERSION}} - - run: yarn version check + - run: yarn version check \ No newline at end of file diff --git a/packages/docsite/markdown/docs/00 Quick Start/Tutorial.md b/packages/docsite/markdown/docs/00 Quick Start/Tutorial.md index a61210af77..73addfab3a 100644 --- a/packages/docsite/markdown/docs/00 Quick Start/Tutorial.md +++ b/packages/docsite/markdown/docs/00 Quick Start/Tutorial.md @@ -662,6 +662,23 @@ import { canMoveKnight, moveKnight } from './Game' import { ItemTypes } from './Constants' import { useDrop } from 'react-dnd' +const Overlay = ({color}) => { + return ( +
+ ) +} + function BoardSquare({ x, y, children }) { const black = (x + y) % 2 === 1 const [{ isOver, canDrop }, drop] = useDrop( diff --git a/packages/react-dnd/src/types/connectors.ts b/packages/react-dnd/src/types/connectors.ts index 92614f90d6..58d2bff16f 100644 --- a/packages/react-dnd/src/types/connectors.ts +++ b/packages/react-dnd/src/types/connectors.ts @@ -1,6 +1,6 @@ import type { ReactElement, RefObject } from 'react' -import type { DragPreviewOptions, DragSourceOptions } from './options' +import type { DragPreviewOptions, DragSourceOptions } from './options.js' export type ConnectableElement = RefObject | ReactElement | Element | null