Skip to content

Commit

Permalink
feat: Migrate all packages to use TanStack Config (#34)
Browse files Browse the repository at this point in the history
* chore: WIP migrate all packages to use TanStack Config

* chore: add missing scripts to root

* chore: fix prettier usage in windows

* chore: apply prettier

* chore: fix TSC usage in Windows

* chore: fix CI and ESLint+TSC
  • Loading branch information
crutchcorn committed Jan 9, 2024
1 parent 6b16bff commit 5dfb993
Show file tree
Hide file tree
Showing 47 changed files with 2,458 additions and 2,405 deletions.
46 changes: 22 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,45 @@
name: ci
concurrency:
group: publish-${{ github.github.base_ref }}
cancel-in-progress: true

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

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

env:
NX_DAEMON: false
NX_VERBOSE_LOGGING: true
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }}

jobs:
test-and-publish:
if: github.repository == 'TanStack/store' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta')
name: 'Test & Publish'
name: Test & Publish
if: github.repository == 'TanStack/store'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: pnpm/action-setup@v2.2.4
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18.15.0
registry-url: https://registry.npmjs.org/
cache: 'pnpm'
node-version-file: .nvmrc
cache: pnpm
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
run: pnpm install --frozen-lockfile --prefer-offline
- name: Run Tests
uses: nick-fields/retry@v2.8.3
with:
command: pnpm run test:ci
timeout_minutes: 10
max_attempts: 3
run: pnpm run test:ci
- name: Publish
run: |
git config --global user.name 'Tanner Linsley'
Expand All @@ -52,5 +49,6 @@ jobs:
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 }}
46 changes: 31 additions & 15 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,43 @@
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 }}
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_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
20 changes: 11 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.vite

# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
node_modules
package-lock.json
yarn.lock

# builds
types
Expand Down Expand Up @@ -31,21 +33,21 @@ yarn-error.log*
.history
size-plugin.json
stats-hydration.json
stats-react.json
stats.json
stats.html
.vscode/settings.json
.idea/

*.log
.DS_Store
node_modules
.cache
dist
ts-perf

/examples/*/*/yarn.lock
/examples/*/*/package-lock.json

.netlify
.idea

nx-cloud.env
.nx

.nx/cache
.tsup
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
prefer-workspace-packages=true
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14.17.6
v18.19.0
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
49 changes: 0 additions & 49 deletions babel.config.cjs

This file was deleted.

40 changes: 14 additions & 26 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,19 @@
"affected": {
"defaultBase": "main"
},
"tasksRunnerOptions": {
"default": {
"runner": "nx-cloud",
"options": {
"cacheableOperations": [
"test:lib",
"test:eslint",
"test:types",
"test:build",
"build"
],
"parallel": 5,
"accessToken": "OTI3Y2U3NGQtYzQ3ZC00ZmE3LWJjZWQtYTYxOTEyNmNiN2IyfHJlYWQtb25seQ=="
}
}
},
"defaultBase": "main",
"pluginsConfig": {
"@nrwl/js": {
"analyzeSourceFiles": false
}
},
"nxCloudAccessToken": "OTI3Y2U3NGQtYzQ3ZC00ZmE3LWJjZWQtYTYxOTEyNmNiN2IyfHJlYWQtb25seQ==",
"parallel": 5,
"namedInputs": {
"sharedGlobals": [
"{workspaceRoot}/.browserslistrc",
"{workspaceRoot}/.eslintrc.cjs",
"{workspaceRoot}/babel.config.cjs",
"{workspaceRoot}/.nvmrc",
"{workspaceRoot}/package.json",
"{workspaceRoot}/scripts/getRollupConfig.js",
"{workspaceRoot}/tsconfig.json"
],
"default": [
Expand All @@ -43,32 +27,36 @@
"default",
"{projectRoot}/build",
"{projectRoot}/dist",
"!{projectRoot}/.eslintrc.cjs",
"!{projectRoot}/tsconfig.eslint.json"
"!{projectRoot}/.eslintrc.cjs"
]
},
"targetDefaults": {
"test:lib": {
"dependsOn": ["^build"],
"inputs": ["default", "^public"],
"outputs": ["{projectRoot}/coverage"]
"outputs": ["{projectRoot}/coverage"],
"cache": true
},
"test:eslint": {
"dependsOn": ["^build"],
"inputs": ["default", "^public"]
"inputs": ["default", "^public"],
"cache": true
},
"test:types": {
"dependsOn": ["^build"],
"inputs": ["default", "^public"]
"inputs": ["default", "^public"],
"cache": true
},
"build": {
"dependsOn": ["^build"],
"inputs": ["default", "^public"],
"outputs": ["{projectRoot}/build", "{projectRoot}/dist"]
"outputs": ["{projectRoot}/build", "{projectRoot}/dist"],
"cache": true
},
"test:build": {
"dependsOn": ["build"],
"inputs": ["^public"]
"inputs": ["^public"],
"cache": true
}
}
}
Loading

0 comments on commit 5dfb993

Please sign in to comment.