Skip to content

Commit

Permalink
feat: bootstrap release please (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
KexyBiscuit authored Jan 3, 2025
1 parent a8ebeb1 commit db0dc10
Show file tree
Hide file tree
Showing 16 changed files with 119 additions and 27 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
command: manifest-release
token: ${{secrets.GITHUB_TOKEN}}

# The logic below handles the npm publication:
- uses: actions/checkout@v4
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{steps.release.outputs['packages/eslint-config--release_created'] || steps.release.outputs['packages/eslint-parser-plain--release_created'] || steps.release.outputs['packages/eslint-plugin-format--release_created']}}

- name: Setup target Node.js to enable Corepack
uses: actions/setup-node@v4
with:
node-version-file: .node-version
if: ${{steps.release.outputs['packages/eslint-config--release_created'] || steps.release.outputs['packages/eslint-parser-plain--release_created'] || steps.release.outputs['packages/eslint-plugin-format--release_created']}}

- name: Enable Corepack
run: corepack enable
if: ${{steps.release.outputs['packages/eslint-config--release_created'] || steps.release.outputs['packages/eslint-parser-plain--release_created'] || steps.release.outputs['packages/eslint-plugin-format--release_created']}}

- uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: pnpm
registry-url: 'https://registry.npmjs.org'
if: ${{steps.release.outputs['packages/eslint-config--release_created'] || steps.release.outputs['packages/eslint-parser-plain--release_created'] || steps.release.outputs['packages/eslint-plugin-format--release_created']}}

- run: pnpm install --frozen-lockfile
if: ${{steps.release.outputs['packages/eslint-config--release_created'] || steps.release.outputs['packages/eslint-parser-plain--release_created'] || steps.release.outputs['packages/eslint-plugin-format--release_created']}}

- run: pnpm typegen
if: ${{steps.release.outputs['packages/eslint-config--release_created'] || steps.release.outputs['packages/eslint-parser-plain--release_created'] || steps.release.outputs['packages/eslint-plugin-format--release_created']}}

- run: pnpm build
if: ${{steps.release.outputs['packages/eslint-config--release_created'] || steps.release.outputs['packages/eslint-parser-plain--release_created'] || steps.release.outputs['packages/eslint-plugin-format--release_created']}}

- run: pnpm exec jiek publish --no-bumper --filter @biscuittin/eslint-config
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{steps.release.outputs['packages/eslint-config--release_created']}}

- run: pnpm exec jiek publish --no-bumper --filter @biscuittin/eslint-parser-plain
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{steps.release.outputs['packages/eslint-parser-plain--release_created']}}

- run: pnpm exec jiek publish --no-bumper --filter @biscuittin/eslint-plugin-format
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{steps.release.outputs['packages/eslint-plugin-format--release_created']}}
5 changes: 5 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"packages/eslint-config": "0.0.1",
"packages/eslint-parser-plain": "0.0.1",
"packages/eslint-plugin-format": "0.0.1"
}
2 changes: 1 addition & 1 deletion eslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import config from '@bttin/eslint-config'
import config from '@biscuittin/eslint-config'

export default config(
{
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
"yarn": ">=999.0.0"
},
"scripts": {
"build": "jiek build --noMin --filter @bttin/*",
"build": "jiek build --noMin --filter @biscuittin/*",
"test": "vitest --run --logHeapUsage",
"coverage": "vitest run --coverage",
"typegen": "tsx scripts/typegen.ts",
"lint": "eslint --cache --flag unstable_ts_config .",
"prepare": "husky"
},
"devDependencies": {
"@bttin/eslint-config": "workspace:^",
"@biscuittin/eslint-config": "workspace:^",
"@commitlint/cli": "^19.6.1",
"@commitlint/config-conventional": "^19.6.0",
"@commitlint/types": "^19.5.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@bttin/eslint-config",
"name": "@biscuittin/eslint-config",
"type": "module",
"version": "0.1.0",
"version": "0.0.1",
"description": "A collection of ESLint configurations for Biscuit Tin projects.",
"author": "Biscuit Tin <[email protected]>",
"license": "MIT",
Expand Down
14 changes: 7 additions & 7 deletions packages/eslint-config/src/utils/get-flat-config-name.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export function getFlatConfigName<T extends string>(module: T) {
return {
base: `@bttin/eslint-config/${module}`,
setup: `@bttin/eslint-config/${module}/setup`,
rules: `@bttin/eslint-config/${module}/rules`,
stylistic: `@bttin/eslint-config/${module}/stylistic`,
commonjs: `@bttin/eslint-config/${module}/commonjs`,
module: `@bttin/eslint-config/${module}/module`,
script: `@bttin/eslint-config/${module}/script`,
base: `@biscuittin/eslint-config/${module}`,
setup: `@biscuittin/eslint-config/${module}/setup`,
rules: `@biscuittin/eslint-config/${module}/rules`,
stylistic: `@biscuittin/eslint-config/${module}/stylistic`,
commonjs: `@biscuittin/eslint-config/${module}/commonjs`,
module: `@biscuittin/eslint-config/${module}/module`,
script: `@biscuittin/eslint-config/${module}/script`,
} as const
}
10 changes: 5 additions & 5 deletions packages/eslint-parser-plain/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @bttin/eslint-parser-plain
# @biscuittin/eslint-parser-plain

Allow you to parse various types of files with ESLint, a fork of [Ray's](https://github.com/so1ve/eslint-parser-plain) ([@so1ve](https://github.com/so1ve)).

Expand All @@ -7,23 +7,23 @@ Allow you to parse various types of files with ESLint, a fork of [Ray's](https:/
### Install

```bash
npm install -D @bttin/eslint-parser-plain
npm install -D @biscuittin/eslint-parser-plain
```

```bash
yarn add -D @bttin/eslint-parser-plain
yarn add -D @biscuittin/eslint-parser-plain
```

```bash
pnpm add -D @bttin/eslint-parser-plain
pnpm add -D @biscuittin/eslint-parser-plain
```

### Configure

We recommend using [ESLint's Flat Config format](https://eslint.org/docs/latest/use/configure/configuration-files-new).

```typescript
import parserPlain from "@bttin/eslint-parser-plain"
import parserPlain from "@biscuittin/eslint-parser-plain"

export default [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-parser-plain/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@bttin/eslint-parser-plain",
"name": "@biscuittin/eslint-parser-plain",
"type": "module",
"version": "0.0.1",
"description": "Parse various types of files with ESLint, a fork of Ray's (@so1ve).",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-parser-plain/tests/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parseForESLint } from '@bttin/eslint-parser-plain'
import { parseForESLint } from '@biscuittin/eslint-parser-plain'
import { describe, expect, it } from 'vitest'

describe('should', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-format/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @bttin/eslint-plugin-format
# @biscuittin/eslint-plugin-format

Format various languages with formatters in ESLint. Supports [Prettier](https://prettier.io/) and [dprint](https://dprint.dev/).

Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin-format/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@bttin/eslint-plugin-format",
"name": "@biscuittin/eslint-plugin-format",
"type": "module",
"version": "0.0.1",
"description": "Format various languages with formatters in ESLint, a fork of Antfu's, with support for configuration files.",
Expand Down Expand Up @@ -48,7 +48,7 @@
}
},
"dependencies": {
"@bttin/eslint-parser-plain": "workspace:^",
"@biscuittin/eslint-parser-plain": "workspace:^",
"eslint-formatting-reporter": "^0.0.0",
"find-up-simple": "^1.0.0",
"micro-memoize": "^4.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-format/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ESLint, Linter } from 'eslint'

import parserPlain from '@bttin/eslint-parser-plain'
import parserPlain from '@biscuittin/eslint-parser-plain'

import packagePlugin from '../package.json'
import dprint from './rules/dprint.js'
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-format/tests/rules/prettier.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pluginFormat from '@bttin/eslint-plugin-format'
import pluginFormat from '@biscuittin/eslint-plugin-format'
import { fileURLToPath } from 'node:url'

import { ruleTester } from '../../../../tools/eslint-rule-tester.js'
Expand Down
4 changes: 2 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"release-type": "node",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"draft": false,
"prerelease": true,
"separate-pull-requests": true,
"packages": {
"packages/eslint-config": {
"changelog-path": "CHANGELOG.md"
},
"packages/eslint-parser-plain": {
"changelog-path": "CHANGELOG.md"
},
"packages/eslint-plugin-format": {
"changelog-path": "CHANGELOG.md"
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}
2 changes: 1 addition & 1 deletion scripts/typegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
tailwindcss,
typescript,
unicorn,
} from '@bttin/eslint-config'
} from '@biscuittin/eslint-config'
import { flatConfigsToRulesDTS } from 'eslint-typegen/core'
import { builtinRules } from 'eslint/use-at-your-own-risk'
import fs from 'node:fs/promises'
Expand Down

0 comments on commit db0dc10

Please sign in to comment.