Skip to content

Commit

Permalink
feat: migrate to @tanstack/config (#670)
Browse files Browse the repository at this point in the history
* chore: move to @tanstack/config/publish

* Successfully migrate virtual-core

* Update react-virtual setup

* Fix solid-virtual and vue-virtual

* Fix svelte-virtual

* Fix github workflows, prettier

* Add publint

* Add jsdom

* Ignore .svelte-kit

* Fix indent in ci.yml

* Remove incompatible workflow

* Add Nx cloud caching

* Update pnpm-workspace

* Update vite versions

---------

Co-authored-by: Lachlan Collins <[email protected]>
  • Loading branch information
piecyk and lachlancollins authored Feb 17, 2024
1 parent 504f9cd commit fd460bc
Show file tree
Hide file tree
Showing 105 changed files with 3,254 additions and 10,410 deletions.
47 changes: 29 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,53 @@
name: ci

on:
workflow_dispatch:
inputs:
tag:
description: override release tag
required: false
push:
branches: ['main', 'alpha', 'beta']

concurrency:
group: publish-${{ github.github.base_ref }}
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
on:
push:
branches:
- 'main'
- 'beta'

jobs:
test-and-publish:
name: 'Test & Publish'
name: Test & Publish
if: github.repository == 'TanStack/virtual'
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Setup Pnpm
uses: pnpm/action-setup@v2.2.4
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 7
version: 8
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16.19.0
cache: 'pnpm'
node-version-file: .nvmrc
cache: pnpm
- name: Install dependencies
run: pnpm --filter "./packages/**" --prefer-offline install --no-frozen-lockfile
run: pnpm install --frozen-lockfile --prefer-offline
- name: Run Tests
run: pnpm run test:ci
- name: Publish
run: |
git config --global user.name 'Tanner Linsley'
git config --global user.email '[email protected]'
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
pnpm cipublish
pnpm run cipublish
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
TAG: ${{ inputs.tag }}
45 changes: 30 additions & 15 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,42 @@
name: pr
on: [pull_request]

on:
pull_request:
paths-ignore:
- 'docs/**'
- 'media/**'
- '**/*.md'

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

jobs:
test:
name: 'Test'
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Setup Pnpm
uses: pnpm/action-setup@v2.2.4
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 7
version: 8
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16.19.0
cache: 'pnpm'
node-version-file: .nvmrc
cache: pnpm
- name: Install dependencies
run: pnpm --filter "./packages/**" --prefer-offline install --no-frozen-lockfile
- name: Build & Test
run: npx nx run-many --targets=test,build --projects=@tanstack/* --exclude=@tanstack/react-start
run: pnpm install --frozen-lockfile --prefer-offline
- name: Get base and head commits for `nx affected`
uses: nrwl/nx-set-shas@v3
with:
main-branch-name: 'main'
- name: Run Checks
run: pnpm run test:pr
15 changes: 0 additions & 15 deletions .github/workflows/size-comments.yml

This file was deleted.

8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ stats.html

*.log
.DS_Store
node_modules
.cache
dist
.nx/cache
.pnpm-store
.svelte-kit

vite.config.js.timestamp-*
vite.config.ts.timestamp-*
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
prefer-workspace-packages=true
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16
v18.19.0
4 changes: 4 additions & 0 deletions .nx/workflows/dynamic-changesets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
distribute-on:
small-changeset: 8 linux-medium-js
medium-changeset: 10 linux-medium-js
large-changeset: 12 linux-medium-js
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**/.next
**/.nx/cache
**/.svelte-kit
**/build
**/coverage
**/dist
**/docs
**/codemods/**/__testfixtures__
pnpm-lock.yaml
29 changes: 0 additions & 29 deletions babel.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion examples/react/dynamic/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
6 changes: 3 additions & 3 deletions examples/react/dynamic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"@types/node": "18.x",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@vitejs/plugin-react": "^3.0.1",
"typescript": "^4.9.5",
"vite": "^4.0.4"
"@vitejs/plugin-react": "^4.2.1",
"typescript": "5.2.2",
"vite": "^4.4.5"
}
}
2 changes: 1 addition & 1 deletion examples/react/dynamic/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()]
plugins: [react()],
})
2 changes: 1 addition & 1 deletion examples/react/fixed/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
6 changes: 3 additions & 3 deletions examples/react/fixed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"@types/node": "18.x",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@vitejs/plugin-react": "^3.0.1",
"typescript": "^4.9.5",
"vite": "^4.0.4"
"@vitejs/plugin-react": "^4.2.1",
"typescript": "5.2.2",
"vite": "^4.4.5"
}
}
4 changes: 2 additions & 2 deletions examples/react/fixed/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ function GridVirtualizerFixed() {
? 'ListItemOdd'
: 'ListItemEven'
: virtualRow.index % 2
? 'ListItemOdd'
: 'ListItemEven'
? 'ListItemOdd'
: 'ListItemEven'
}
style={{
position: 'absolute',
Expand Down
2 changes: 1 addition & 1 deletion examples/react/infinite-scroll/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
4 changes: 2 additions & 2 deletions examples/react/infinite-scroll/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"devDependencies": {
"@rollup/plugin-replace": "^4.0.0",
"@vitejs/plugin-react": "^1.2.0",
"vite": "^2.8.6"
"@vitejs/plugin-react": "^4.2.1",
"vite": "^4.4.5"
}
}
2 changes: 1 addition & 1 deletion examples/react/padding/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
4 changes: 2 additions & 2 deletions examples/react/padding/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"devDependencies": {
"@rollup/plugin-replace": "^4.0.0",
"@vitejs/plugin-react": "^1.2.0",
"vite": "^2.8.6"
"@vitejs/plugin-react": "^4.2.1",
"vite": "^4.4.5"
}
}
4 changes: 2 additions & 2 deletions examples/react/padding/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ function GridVirtualizerDynamic({ rows, columns }) {
? 'ListItemOdd'
: 'ListItemEven'
: virtualRow.index % 2
? 'ListItemOdd'
: 'ListItemEven'
? 'ListItemOdd'
: 'ListItemEven'
}
style={{
position: 'absolute',
Expand Down
2 changes: 1 addition & 1 deletion examples/react/scroll-padding/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
4 changes: 2 additions & 2 deletions examples/react/scroll-padding/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"devDependencies": {
"@rollup/plugin-replace": "^4.0.0",
"@vitejs/plugin-react": "^1.2.0",
"vite": "^2.8.6"
"@vitejs/plugin-react": "^4.2.1",
"vite": "^4.4.5"
}
}
2 changes: 1 addition & 1 deletion examples/react/smooth-scroll/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
4 changes: 2 additions & 2 deletions examples/react/smooth-scroll/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"devDependencies": {
"@rollup/plugin-replace": "^4.0.0",
"@vitejs/plugin-react": "^1.2.0",
"vite": "^2.8.6"
"@vitejs/plugin-react": "^4.2.1",
"vite": "^4.4.5"
}
}
2 changes: 1 addition & 1 deletion examples/react/sticky/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
4 changes: 2 additions & 2 deletions examples/react/sticky/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"devDependencies": {
"@rollup/plugin-replace": "^4.0.0",
"@vitejs/plugin-react": "^1.2.0",
"vite": "^2.8.6"
"@vitejs/plugin-react": "^4.2.1",
"vite": "^4.4.5"
}
}
2 changes: 1 addition & 1 deletion examples/react/table/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
4 changes: 2 additions & 2 deletions examples/react/table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"devDependencies": {
"@types/react": "^18.0.25",
"@types/react-dom": "^18.0.8",
"@vitejs/plugin-react": "^2.2.0",
"vite": "^3.2.3"
"@vitejs/plugin-react": "^4.2.1",
"vite": "^4.4.5"
}
}
2 changes: 1 addition & 1 deletion examples/react/table/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()]
plugins: [react()],
})
2 changes: 1 addition & 1 deletion examples/react/variable/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
4 changes: 2 additions & 2 deletions examples/react/variable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"devDependencies": {
"@rollup/plugin-replace": "^4.0.0",
"@vitejs/plugin-react": "^1.2.0",
"vite": "^2.8.6"
"@vitejs/plugin-react": "^4.2.1",
"vite": "^4.4.5"
}
}
Loading

0 comments on commit fd460bc

Please sign in to comment.