Skip to content

Commit df687a7

Browse files
ci: Introduce changesets (#1)
1 parent f7026d6 commit df687a7

File tree

11 files changed

+717
-6
lines changed

11 files changed

+717
-6
lines changed

.changeset/config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": [
4+
"@svitejs/changesets-changelog-github-compact",
5+
{ "repo": "TanStack/optimistic" }
6+
],
7+
"commit": false,
8+
"access": "public",
9+
"baseBranch": "main",
10+
"updateInternalDependencies": "patch",
11+
"fixed": [],
12+
"linked": [],
13+
"ignore": []
14+
}

.changeset/grumpy-crews-tease.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tanstack/optimistic": minor
3+
---
4+
5+
feat: Initial release

.github/workflows/autofix.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: autofix.ci # needed to securely identify the workflow
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main, alpha, beta]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
autofix:
17+
name: autofix
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/[email protected]
22+
- name: Setup Tools
23+
uses: tanstack/config/.github/setup@main
24+
- name: Fix formatting
25+
run: pnpm prettier --ignore-unknown . --check
26+
- name: Apply fixes
27+
uses: autofix-ci/action@551dded8c6cc8a1054039c8bc0b8b48c51dfc6ef
28+
with:
29+
commit-message: "ci: apply automated fixes"

.github/workflows/pr.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: PR
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
8+
cancel-in-progress: true
9+
10+
env:
11+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
test:
18+
name: Test
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/[email protected]
23+
with:
24+
fetch-depth: 0
25+
- name: Setup Tools
26+
uses: tanstack/config/.github/setup@main
27+
- name: Get base and head commits for `nx affected`
28+
uses: nrwl/[email protected]
29+
with:
30+
main-branch-name: main
31+
- name: Run Checks
32+
run: pnpm run lint && pnpm run test && pnpm run build
33+
preview:
34+
name: Preview
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Checkout
38+
uses: actions/[email protected]
39+
with:
40+
fetch-depth: 0
41+
- name: Setup Tools
42+
uses: tanstack/config/.github/setup@main
43+
- name: Build Packages
44+
run: pnpm run build
45+
- name: Publish Previews
46+
run: pnpx pkg-pr-new publish --pnpm --compact './packages/*' --template './examples/*/*'

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main, alpha, beta]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
9+
cancel-in-progress: true
10+
11+
env:
12+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
13+
14+
permissions:
15+
contents: write
16+
id-token: write
17+
pull-requests: write
18+
19+
jobs:
20+
release:
21+
name: Release
22+
if: github.repository_owner == 'TanStack'
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/[email protected]
27+
with:
28+
fetch-depth: 0
29+
- name: Setup Tools
30+
uses: tanstack/config/.github/setup@main
31+
- name: Run Tests
32+
run: pnpm run lint && pnpm run test && pnpm run build
33+
- name: Run Changesets (version or publish)
34+
uses: changesets/[email protected]
35+
with:
36+
version: pnpm run changeset:version
37+
publish: pnpm run changeset:publish
38+
commit: "ci: Version Packages"
39+
title: "ci: Version Packages"
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
link-workspace-packages=true
2+
prefer-workspace-packages=true
3+
provenance=true

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.13.1

.prettierignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
**/.next
2+
**/.nx/cache
3+
**/.svelte-kit
4+
**/coverage
5+
**/dist
6+
**/docs
7+
**/snap
8+
pnpm-lock.yaml

eslint.config.mjs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
import js from "@eslint/js"
2-
import tsParser from "@typescript-eslint/parser"
3-
import tsPlugin from "@typescript-eslint/eslint-plugin"
4-
import reactPlugin from "eslint-plugin-react"
51
import prettierPlugin from "eslint-plugin-prettier"
62
import prettierConfig from "eslint-config-prettier"
7-
import globals from "globals"
83
import stylisticPlugin from "@stylistic/eslint-plugin"
94
import { tanstackConfig } from "@tanstack/config/eslint"
105

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "@tanstack/optimistic",
33
"version": "0.0.8",
44
"description": "Optimistic UI library for sync engines",
5+
"packageManager": "[email protected]",
56
"type": "module",
67
"exports": {
78
"./react-electric": {
@@ -20,7 +21,10 @@
2021
"prepack": "vite build",
2122
"test": "vitest --run",
2223
"lint": "eslint . --fix",
23-
"prepare": "husky"
24+
"prepare": "husky",
25+
"changeset": "changeset",
26+
"changeset:version": "changeset version && pnpm install --no-frozen-lockfile",
27+
"changeset:publish": "changeset publish"
2428
},
2529
"lint-staged": {
2630
"*.{ts,tsx}": [
@@ -32,8 +36,10 @@
3236
"author": "Kyle Mathews <[email protected]>",
3337
"license": "MIT",
3438
"devDependencies": {
39+
"@changesets/cli": "^2.28.1",
3540
"@eslint/js": "^9.20.0",
3641
"@stylistic/eslint-plugin": "^4.0.1",
42+
"@svitejs/changesets-changelog-github-compact": "^1.2.0",
3743
"@tanstack/config": "^0.17.1",
3844
"@testing-library/jest-dom": "^6.6.3",
3945
"@testing-library/react": "^16.2.0",

0 commit comments

Comments
 (0)