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

ci: split configs #276

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
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
9 changes: 9 additions & 0 deletions .babelrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"presets": [
"@babel/preset-env"
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-private-methods"
]
}
9 changes: 9 additions & 0 deletions .commitlintrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { RuleConfigSeverity } from '@commitlint/types';

export default {
extends: ["@commitlint/config-conventional"],
rules: {
'body-max-line-length': [RuleConfigSeverity.Disabled] as const,
'header-max-length': [RuleConfigSeverity.Disabled] as const,
}
};
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/**
tsup.config.ts
4 changes: 4 additions & 0 deletions .eslintirc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends:
- '@wfcd/eslint-config/typescript'
parserOptions:
project: tsconfig.json
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
node-version-file: '.nvmrc'
- run: npm ci
- run: npm run lint
- name: Validate with commitlint
run: npx commitlint --last --verbose
Comment on lines +20 to +21
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider validating all new commits instead of just the last one

The current configuration with --last only validates the most recent commit. In case of multiple commits being pushed, intermediate commits might bypass validation.

Consider validating all new commits:

-  run: npx commitlint --last --verbose
+  run: npx commitlint --from HEAD~$(git rev-list --count HEAD ^origin/development) --to HEAD --verbose
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Validate with commitlint
run: npx commitlint --last --verbose
- name: Validate with commitlint
run: npx commitlint --from HEAD~$(git rev-list --count HEAD ^origin/development) --to HEAD --verbose

- run: npm run validate
- run: npm test
- name: Semantic Release
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -17,6 +19,8 @@ jobs:
run: npm ci
- name: Run linters
run: npm run lint
- name: Validate with commitlint
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
- name: Run Build
run: npm run validate
- name: Test
Expand Down
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
9 changes: 9 additions & 0 deletions .lintstagedrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'*,!*.js,!package*.json':
- prettier --write
'src/*.ts':
- eslint --cache --fix
- npm test
package*.json:
- prettier --write
- npm dedupe
- npx sort-package-json
5 changes: 5 additions & 0 deletions .mocharc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
exit: true
spec: src/spec/**/*.spec.ts
timeout: 1000
loader: ts-node/esm
extension: ts
7 changes: 7 additions & 0 deletions .nycrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
exclude:
- src/spec/**
- dist/**
skip-full: true
reporter:
- lcov
- text
14 changes: 14 additions & 0 deletions .releaserc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
plugins:
- '@semantic-release/commit-analyzer'
- '@semantic-release/release-notes-generator'
- '@semantic-release/npm'
- '@semantic-release/github'
- - '@semantic-release/changelog'
- assets:
- CHANGELOG.md
- - '@semantic-release/git'
- assets:
- package.json
- package-lock.json
- CHANGELOG.md
branches: development
Loading
Loading