Skip to content

Commit

Permalink
refactored package linting, formatting, and publishing process
Browse files Browse the repository at this point in the history
  • Loading branch information
friedemannsommer committed Apr 19, 2024
1 parent 9f985f4 commit 5570b53
Show file tree
Hide file tree
Showing 31 changed files with 3,309 additions and 1,711 deletions.
9 changes: 9 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"access": "public",
"baseBranch": "main",
"changelog": ["@changesets/changelog-github", { "repo": "friedemannsommer/lcov-parser" }],
"commit": false,
"ignore": [],
"linked": [],
"updateInternalDependencies": "patch"
}
34 changes: 0 additions & 34 deletions .eslintrc.cjs

This file was deleted.

1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @friedemannsommer
71 changes: 48 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,79 @@ name: CI
on:
push:
branches:
- '*'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request: null
- main
pull_request:
branches:
- main

permissions:
contents: read

jobs:
compat:
name: Check compatibility
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node_version:
- 16
- 18
- 20
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
cache: 'npm'
node-version: ${{ matrix.node_version }}
- run: npm ci --no-fund --no-audit
- name: Run tests
run: npm run test

check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v4.1.1
- uses: actions/setup-node@v4.0.2
with:
cache: 'npm'
node-version: 20
- run: npm ci --no-fund --no-audit
- name: formatting
run: npm run fmt
- name: lint
run: npm run lint
- name: typescript check
run: npm run check
- name: collect coverage
- name: Run checks
run: npm run check:ci
- name: Collect coverage
run: npm run coverage
- name: upload coverage reports to Codecov
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

publish:
permissions:
contents: read
id-token: write
release:
name: Release
needs:
- check
permissions:
contents: write
id-token: write
pull-requests: write
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/')
if: github.repository_owner == 'friedemannsommer' && github.ref_name == 'main'
concurrency: '${{ github.workflow }}-${{ github.ref }}'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v4.1.1
- uses: actions/setup-node@v4.0.2
with:
cache: 'npm'
node-version: 20
registry-url: 'https://registry.npmjs.org'
- run: npm ci --no-fund --no-audit
- run: npm run build:dist
- run: npm publish --access public --verbose --provenance
- name: Create release PR or publish
uses: changesets/[email protected]
with:
title: 'ci(changesets): package release'
commit: 'ci(changesets): version package'
publish: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
43 changes: 0 additions & 43 deletions .github/workflows/codeql.yml

This file was deleted.

19 changes: 10 additions & 9 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- 'main'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:

permissions:
contents: read
Expand All @@ -20,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout "gh-pages" branch
uses: actions/checkout@v4
uses: actions/checkout@v4.1.1
with:
ref: gh-pages

Expand All @@ -31,7 +32,7 @@ jobs:
fi
- name: upload current docs
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4.3.2
with:
if-no-files-found: error
name: current_documentation
Expand All @@ -42,9 +43,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout source
uses: actions/checkout@v4
uses: actions/checkout@v4.1.1

- uses: actions/setup-node@v4
- uses: actions/setup-node@v4.0.2
with:
cache: 'npm'
node-version: 20
Expand All @@ -60,7 +61,7 @@ jobs:
run: npm run docs

- name: upload generated docs
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4.3.2
with:
if-no-files-found: error
name: generated_documentation
Expand All @@ -75,16 +76,16 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.1

- name: download current docs
uses: actions/download-artifact@v4
uses: actions/download-artifact@v4.1.5
with:
name: current_documentation
path: new_documentation

- name: download new docs
uses: actions/download-artifact@v4
uses: actions/download-artifact@v4.1.5
with:
name: generated_documentation
path: generated_documentation
Expand Down Expand Up @@ -116,7 +117,7 @@ jobs:
rsync -ac --delete generated_documentation/ "new_documentation/development"
- name: publish to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
uses: JamesIves/github-pages-deploy-action@v4.6.0
with:
branch: gh-pages
clean: true
Expand Down
20 changes: 0 additions & 20 deletions .prettierrc

This file was deleted.

39 changes: 39 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.0/schema.json",
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 4,
"lineEnding": "lf",
"lineWidth": 120,
"attributePosition": "auto"
},
"javascript": {
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingComma": "none",
"semicolons": "asNeeded",
"arrowParentheses": "always",
"bracketSpacing": true,
"bracketSameLine": false,
"quoteStyle": "single",
"attributePosition": "auto"
}
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"organizeImports": {
"enabled": true
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
}
}
8 changes: 0 additions & 8 deletions build.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@ import { defineBuildConfig } from 'unbuild'
export default defineBuildConfig({
clean: true,
declaration: true,
entries: [
'./src/index.ts',
'./src/constants.ts',
'./src/lib/field-variant.ts',
'./src/parser.ts',
'./src/promise/index.ts',
'./src/stream/index.ts'
],
outDir: 'dist',
rollup: {
emitCJS: true,
Expand Down
Loading

0 comments on commit 5570b53

Please sign in to comment.