Skip to content

Commit d538019

Browse files
Migrate AIO package to TS, build with @tanstack/vite-config (#224)
1 parent 3aa4812 commit d538019

27 files changed

Lines changed: 89 additions & 75 deletions

File tree

.changeset/nice-games-invite.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/config': patch
3+
---
4+
5+
Migrate to TS, build with @tanstack/vite-config

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: pr
1+
name: PR
22

33
on:
44
pull_request:

docs/ci-cd.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ title: CI/CD
99
- Runs tests for all pull requests
1010
- Runs `nx affected`, which only executes tasks with invalidated cache
1111
- Also uses `pkg-pr-new` to publish package previews and create links to our examples
12-
- `ci.yml`:
12+
- `release.yml`:
1313
- Runs tests for code merged into release branches
1414
- Runs `nx run-many`, which executes all tasks and ensures the outputs are present (necessary for publishing builds)
15-
- Uses [@tanstack/config/publish](./publish.md) to handle versioning and npm release
15+
- Uses [Changesets](https://github.com/changesets/changesets) to handle versioning and publishing
1616

1717
## Nx
1818

docs/eslint.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ This package unifies the shared ESLint config used across all TanStack projects.
1616
### eslint.config.js
1717

1818
```js
19+
import { tanstackConfig } from '@tanstack/eslint-config'
20+
// OR
1921
import { tanstackConfig } from '@tanstack/config/eslint'
2022

2123
export default [
@@ -31,8 +33,8 @@ export default [
3133
- [@eslint/js](https://github.com/eslint/eslint) - The core ESLint rules
3234
- [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint) - Enables TypeScript support
3335
- [eslint-plugin-import-x](https://github.com/un-ts/eslint-plugin-import-x) - Lints imports and exports
34-
- [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) - Miscellaneous useful rules
36+
- [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) - Useful rules for Node.js
3537

3638
## Rules
3739

38-
You can inspect the enabled rules by running `pnpm dlx @eslint/config-inspector`, or by browsing the source [here](https://github.com/TanStack/config/tree/main/packages/config/src/eslint). Each rule has a comment explaining why it is included in the shared config.
40+
You can inspect the enabled rules by running `pnpm dlx @eslint/config-inspector`, or by browsing the source [here](https://github.com/TanStack/config/tree/main/packages/eslint-config). Each rule has a comment explaining why it is included in the shared config.

docs/overview.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,20 @@ The following tools are required to use this package:
2121
To install the package, run the following command:
2222

2323
```bash
24+
# AIO
2425
pnpm add -D @tanstack/config
26+
27+
# ESLint
28+
pnpm add -D @tanstack/eslint-config
29+
30+
# Publish
31+
pnpm add -D @tanstack/publish-config
32+
33+
# Typedoc
34+
pnpm add -D @tanstack/typedoc-config
35+
36+
# Vite
37+
pnpm add -D @tanstack/vite-config
2538
```
2639

2740
## Utilities

docs/publish.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,12 @@ title: Publish
55

66
## Usage
77

8-
You have two options for using TanStack Config to publish:
9-
10-
- [CLI Usage](#cli-usage)
11-
- [Programmatic Usage](#programmatic-usage)
12-
13-
### CLI Usage
14-
15-
To run the publish script for your package, run the following command:
16-
17-
```bash
18-
pnpm run tanstack-config publish
19-
```
20-
21-
### Programmatic Usage
22-
238
To use the TanStack Config programmatically, you can import the `publish` function:
249

2510
```ts
2611
import { publish } from '@tanstack/config/publish'
12+
// OR
13+
import { publish } from '@tanstack/publish-config'
2714

2815
publish({
2916
branchConfigs: configOpts.branchConfigs,

docs/vite.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ The build config is quite opinionated, as it is designed to work with our intern
5252

5353
```ts
5454
import { defineConfig, mergeConfig } from 'vite'
55+
5556
import { tanstackViteConfig } from '@tanstack/config/vite'
57+
// OR
58+
import { tanstackViteConfig } from '@tanstack/vite-config'
5659

5760
const config = defineConfig({
5861
// Framework plugins, vitest config, etc.

integrations/react/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"dist"
2424
],
2525
"scripts": {
26-
"test:build": "vite build && vitest && publint --strict"
26+
"build": "vite build",
27+
"test:build": "vitest && publint --strict"
2728
},
2829
"dependencies": {
2930
"@tanstack/query-core": "catalog:",

integrations/vanilla/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"dist"
2424
],
2525
"scripts": {
26-
"test:build": "vite build && vitest && publint --strict"
26+
"build": "vite build",
27+
"test:build": "vitest && publint --strict"
2728
},
2829
"devDependencies": {
2930
"@tanstack/config": "workspace:*",

integrations/vue/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"dist"
2424
],
2525
"scripts": {
26-
"test:build": "vite build && vitest && publint --strict"
26+
"build": "vite build",
27+
"test:build": "vitest && publint --strict"
2728
},
2829
"dependencies": {
2930
"vue": "catalog:"

0 commit comments

Comments
 (0)