Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .changeset/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion .changeset/long-apples-fix.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@tanstack/typedoc-config': minor
---

feat: release @tanstack/typedoc-config
Release @tanstack/typedoc-config
5 changes: 5 additions & 0 deletions .changeset/thin-carrots-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tanstack/eslint-config': minor
---

Release @tanstack/eslint-config
11 changes: 3 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: ci
name: release

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

Expand All @@ -22,8 +17,8 @@ permissions:
pull-requests: write

jobs:
test-and-publish:
name: Test & Publish
release:
name: Release
if: github.repository_owner == 'TanStack'
runs-on: ubuntu-latest
steps:
Expand Down
78 changes: 3 additions & 75 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,81 +108,9 @@ You can use Gitpod (An Online Open Source VS Code like IDE which is free for Ope

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/TanStack/config)

## Commit message conventions
## Changesets

`TanStack/config` is using [Angular Commit Message Conventions](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines).

We have very precise rules over how our git commit messages can be formatted. This leads to **more readable messages** that are easy to follow when looking through the **project history**.

### Commit Message Format

Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
format that includes a **type**, a **scope** and a **subject**:

```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```

The **header** is mandatory and the **scope** of the header is optional.

Any line of the commit message cannot be longer than 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.

### Type

Must be one of the following:

- **feat**: A new feature
- **fix**: A bug fix
- **docs**: Documentation only changes
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing
semi-colons, etc)
- **refactor**: A code change that neither fixes a bug nor adds a feature
- **perf**: A code change that improves performance
- **test**: Adding missing or correcting existing tests
- **chore**: Changes to the build process or auxiliary tools and libraries such as documentation
generation

### Scope

The scope could be anything specifying place of the commit change. For example `useForm`, `useMutation` etc...

You can use `*` when the change affects more than a single scope.

### Subject

The subject contains succinct description of the change:

- use the imperative, present tense: "change" not "changed" nor "changes"
- don't capitalize first letter
- no dot (.) at the end

### Body

Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.

### Footer

The footer should contain any information about **Breaking Changes** and is also the place to [reference GitHub issues that this commit closes](https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue).

**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.

### Example

Here is an example of the release type that will be done based on a commit messages:

| Commit message | Release type |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- |
| `fix(pencil): stop graphite breaking when too much pressure applied` | Patch Release |
| `feat(pencil): add 'graphiteWidth' option` | ~~Minor~~ Feature Release |
| `perf(pencil): remove graphiteWidth option`<br><br>`BREAKING CHANGE: The graphiteWidth option has been removed.`<br>`The default graphite width of 10mm is always used for performance reasons.` | ~~Major~~ Breaking Release |

### Revert

If the commit reverts a previous commit, it should begin with `revert:`, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
This repo uses [Changesets](https://github.com/changesets/changesets) to automate releases. If your PR should release a new package version (patch, minor, or major), please run run `pnpm changeset` and commit the file. If needed, changeset descriptions can be more descriptive, and will be included in the changelog. If your PR affects docs, examples, styles, etc., you probably don't need to generate a changeset.

## Pull requests

Expand All @@ -192,4 +120,4 @@ Use an appropriate commit type. Be especially careful with breaking changes.

## Releases

For each new commit added to `main` with `git push` or by merging a pull request or merging from another branch, a GitHub action is triggered and runs the `semantic-release` command to make a release if there are codebase changes since the last release that affect the package functionalities.
For each new commit added to `main`, a GitHub Workflow is triggered which runs the [Changesets Action](https://github.com/changesets/action). This generates a preview PR showing the impact of all changesets. When this PR is merged, the package will be published to NPM.
2 changes: 1 addition & 1 deletion packages/config/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-check

import { tanstackConfig } from './src/eslint/index.js'
import { tanstackConfig } from '../eslint-config/src/index.js'

export default [...tanstackConfig]
11 changes: 2 additions & 9 deletions packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,30 +60,23 @@
},
"dependencies": {
"@commitlint/parse": "catalog:",
"@eslint/js": "catalog:",
"@stylistic/eslint-plugin-js": "catalog:",
"@tanstack/eslint-config": "workspace:*",
"@tanstack/typedoc-config": "workspace:*",
"commander": "catalog:",
"esbuild-register": "catalog:",
"eslint-plugin-import-x": "catalog:",
"eslint-plugin-n": "catalog:",
"globals": "catalog:",
"interpret": "catalog:",
"jsonfile": "catalog:",
"liftoff": "catalog:",
"minimist": "catalog:",
"rollup-plugin-preserve-directives": "catalog:",
"semver": "catalog:",
"simple-git": "catalog:",
"typescript-eslint": "catalog:",
"v8flags": "catalog:",
"vite-plugin-dts": "catalog:",
"vite-plugin-externalize-deps": "catalog:",
"vite-tsconfig-paths": "catalog:",
"vue-eslint-parser": "catalog:"
"vite-tsconfig-paths": "catalog:"
},
"devDependencies": {
"@types/eslint": "catalog:",
"@types/interpret": "catalog:",
"@types/jsonfile": "catalog:",
"@types/liftoff": "catalog:",
Expand Down
88 changes: 1 addition & 87 deletions packages/config/src/eslint/index.js
Original file line number Diff line number Diff line change
@@ -1,87 +1 @@
import tseslint from 'typescript-eslint'
import vueparser from 'vue-eslint-parser'
import stylisticJs from '@stylistic/eslint-plugin-js'
import pluginImport from 'eslint-plugin-import-x'
import pluginNode from 'eslint-plugin-n'
import globals from 'globals'
import { javascriptRules } from './javascript.js'
import { importRules } from './import.js'
import { typescriptRules } from './typescript.js'
import { nodeRules } from './node.js'
import { stylisticRules } from './stylistic.js'

const JS_GLOB_INCLUDE = ['**/*.{js,ts,tsx}']
const VUE_GLOB_INCLUDE = ['**/*.vue']

const GLOB_EXCLUDE = [
'**/.nx/**',
'**/.svelte-kit/**',
'**/build/**',
'**/coverage/**',
'**/dist/**',
'**/snap/**',
'**/vite.config.*.timestamp-*.*',
]

const jsRules = {
...javascriptRules,
...typescriptRules,
...importRules,
...nodeRules,
...stylisticRules,
}

const jsPlugins = {
'@stylistic/js': stylisticJs,
'@typescript-eslint': tseslint.plugin,
import: pluginImport,
node: pluginNode,
}

/** @type {import('eslint').Linter.Config[]} */
export const tanstackConfig = [
{
name: 'tanstack/ignores',
ignores: GLOB_EXCLUDE,
},
{
name: 'tanstack/setup',
files: JS_GLOB_INCLUDE,
languageOptions: {
sourceType: 'module',
ecmaVersion: 2020,
// @ts-expect-error
parser: tseslint.parser,
parserOptions: {
project: true,
parser: tseslint.parser,
},
globals: {
...globals.browser,
},
},
// @ts-expect-error
plugins: jsPlugins,
rules: jsRules,
},
{
name: 'tanstack/vue',
files: VUE_GLOB_INCLUDE,
languageOptions: {
parser: vueparser,
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
parser: tseslint.parser,
project: true,
extraFileExtensions: ['.vue'],
},
globals: {
...globals.browser,
},
},
// @ts-expect-error
plugins: jsPlugins,
rules: jsRules,
},
]
export { tanstackConfig } from '@tanstack/eslint-config'
5 changes: 5 additions & 0 deletions packages/eslint-config/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// @ts-check

import { tanstackConfig } from '../eslint-config/src/index.js'

export default [...tanstackConfig]
53 changes: 53 additions & 0 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "@tanstack/eslint-config",
"version": "0.0.0",
"description": "Configuration and tools for publishing and maintaining TanStack projects.",
"author": "tannerlinsley",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/TanStack/config.git",
"directory": "packages/eslint-config"
},
"homepage": "https://tanstack.com/config",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"scripts": {
"test:types": "tsc",
"test:eslint": "eslint ./src",
"test:build": "publint --strict"
},
"type": "module",
"exports": {
".": {
"import": {
"default": "./src/index.js"
}
},
"./package.json": "./package.json"
},
"preferGlobal": false,
"sideEffects": false,
"files": [
"src"
],
"engines": {
"node": ">=18"
},
"dependencies": {
"@eslint/js": "catalog:",
"@stylistic/eslint-plugin-js": "catalog:",
"esbuild-register": "catalog:",
"eslint-plugin-import-x": "catalog:",
"eslint-plugin-n": "catalog:",
"globals": "catalog:",
"typescript-eslint": "catalog:",
"vue-eslint-parser": "catalog:"
},
"devDependencies": {
"@types/eslint": "catalog:",
"eslint": "catalog:"
}
}
Loading
Loading