Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor #754

Merged
merged 16 commits into from
Jul 18, 2024
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
78 changes: 0 additions & 78 deletions .eslintrc.cjs

This file was deleted.

3 changes: 2 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"config:js-lib",
"github>maxmilton/renovate-config",
"github>maxmilton/renovate-config:monthly"
]
],
"enabled": false
}
49 changes: 26 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,45 @@ on:
paths-ignore: ['**.md']
pull_request: {}
workflow_dispatch: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: oven-sh/setup-bun@v2
with:
node-version: 21
- run: npm install --global pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run build
- run: pnpm run test
bun-version: latest
- run: bun install --frozen-lockfile
- run: bun run build
- run: bun run test
- name: Report coverage
if: ${{ github.repository_owner == 'maxmilton' }}
run: |
curl -Lo ./cc-test-reporter https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
chmod +x ./cc-test-reporter
./cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.json coverage/lcov.info
./cc-test-reporter upload-coverage
curl -LO https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 \
-LO https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64.sha256
grep test-reporter-latest-linux-amd64 test-reporter-latest-linux-amd64.sha256 | shasum -a 256 -c -
mv test-reporter-latest-linux-amd64 test-reporter
chmod +x ./test-reporter
./test-reporter format-coverage -t lcov -o coverage/codeclimate.json coverage/lcov.info
./test-reporter upload-coverage
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
e2e:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: oven-sh/setup-bun@v2
with:
node-version: 21
- run: npm install --global pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm playwright install chromium
- run: pnpm run build
- run: pnpm run test:e2e --reporter=dot,html
bun-version: latest
- run: bun install --frozen-lockfile
- run: bun playwright install chromium
- run: bun run build
- run: bun run test:e2e --reporter=github,html
- uses: actions/upload-artifact@v4
if: always()
with:
Expand All @@ -51,10 +55,9 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: oven-sh/setup-bun@v2
with:
node-version: 21
- run: npm install --global pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run build
- run: pnpm run lint
bun-version: latest
- run: bun install --frozen-lockfile
- run: bun run build
- run: bun run lint
3 changes: 3 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
workflow_dispatch: {}
schedule:
- cron: '28 6 * * 4'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
analyze:
runs-on: ubuntu-latest
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: publish
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
id-token: write
steps:
- name: Check valid version tag
run: |
[[ "${{ github.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)? ]] || exit 1
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun install --frozen-lockfile
- run: bun run lint
- run: bun run test
- uses: actions/setup-node@v4
with:
node-version: latest
registry-url: 'https://registry.npmjs.org'
- name: Extract npm tag
run: |
TAG=${{ github.ref }}
if [[ "$TAG" =~ v[0-9]+\.[0-9]+\.[0-9]+- ]]; then
NPM_TAG=${TAG#*v[0-9].[0-9].[0-9]-}; NPM_TAG=${NPM_TAG%%.*}
else
NPM_TAG=latest
fi
echo "NPM_TAG=$NPM_TAG" >> $GITHUB_ENV
- run: npm publish --provenance --access public --tag ${{ env.NPM_TAG }}
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: release
on:
push:
tags: [v*.*.*]
jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun install --frozen-lockfile
- run: bun run lint
- run: bun run test
- run: gh release create "${{ github.ref_name }}" --draft --generate-notes
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 4 additions & 1 deletion .github/workflows/semgrep-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ on:
workflow_dispatch: {}
schedule:
- cron: '28 6 * * 4'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
analyze:
runs-on: ubuntu-latest
timeout-minutes: 5
container:
image: returntocorp/semgrep
image: semgrep/semgrep
permissions:
actions: read
contents: read
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: typos
on:
push:
branches: [master]
pull_request: {}
workflow_dispatch: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
typos:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@master
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
*-lock.json*
*-lock.yaml
*.bak
*.lock
*.log
/bun.lockb
/coverage/
/playwright-report/
/test-results/
Expand Down
22 changes: 0 additions & 22 deletions .prettierrc

This file was deleted.

7 changes: 6 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
"recommendations": [
"biomejs.biome",
"dbaeumer.vscode-eslint",
"oven.bun-vscode",
"tekumara.typos-vscode"
]
}
32 changes: 22 additions & 10 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": false,
"eslint.lintTask.options": "--ignore-path .gitignore",
"eslint.format.enable": false,
"eslint.useFlatConfig": true,
"git.branchProtection": ["master"],
"js/ts.implicitProjectConfig.checkJs": true,
"prettier.ignorePath": ".gitignore",
"prettier.enable": false, // use biome instead
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.format.enable": false,
"typescript.tsdk": "node_modules/typescript/lib",
"[javascript][typescript]": {

"[css][html][json][jsonc][markdown][scss][xml]": {
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"quickfix.biome": "explicit"
},
"editor.defaultFormatter": "biomejs.biome"
},
"[javascript][javascriptreact][typescript][typescriptreact]": {
"editor.codeActionsOnSave": {
"source.sortImports": "explicit",
"source.fixAll": "explicit"
}
"source.sortImports": "never",
"source.organizeImports": "never",
"source.organizeImports.biome": "explicit",
"source.fixAll": "never",
"source.fixAll.eslint": "never",
"quickfix.biome": "explicit"
},
"editor.defaultFormatter": "biomejs.biome"
}
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Max Milton
Copyright (c) 2024 Max Milton

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,4 @@ MIT license. See [LICENSE](https://github.com/maxmilton/solid-router/blob/master

---

© 2022 [Max Milton](https://maxmilton.com)
© 2024 [Max Milton](https://maxmilton.com)
Loading
Loading