Skip to content

Commit

Permalink
chore: mis cleanup
Browse files Browse the repository at this point in the history
- upgrade lots of dev dependencies
- upgrade linter + fix lint errors
- add typing to jest config
- setup semantic-release
  • Loading branch information
atomicpages committed Jun 19, 2022
1 parent f0762b4 commit 976e25e
Show file tree
Hide file tree
Showing 18 changed files with 25,804 additions and 15,336 deletions.
23 changes: 2 additions & 21 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
module.exports = {
env: {
browser: true,
node: true,
jest: true,
es6: true,
},
extends: [
'@djthoms/eslint-config',
'@djthoms/eslint-config/jest',
'@djthoms/eslint-config/typescript',
'@djthoms/eslint-config/react',
'@djthoms/eslint-config/react-typescript',
'@djthoms/eslint-config/typescript',
'plugin:react/jsx-runtime',
],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
overrides: [
{
files: ['*.js'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
'@djthoms/eslint-config/jest',
],
};
24 changes: 0 additions & 24 deletions .github/workflows/on_pre_release.yml

This file was deleted.

45 changes: 36 additions & 9 deletions .github/workflows/on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@ name: Build & Publish Docs
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
- uses: actions/checkout@v3
with:
node-version: ${{ matrix.node-version }}
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: npm install, build, and test
run: |
npm i
npm ci
npm t
npm run build
env:
Expand All @@ -24,12 +23,40 @@ jobs:
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifacts@master
with:
name: bundle
path: pkg
checkChangesInDocs:
name: Check changes in docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check changes in stories
uses: netlify/actions/diff-includes@master
with:
args: docs
release:
name: Release
runs-on: ubuntu-latest
if: github.ref === 'refs/heads/main'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
run: npm ci
- name: Release
uses: actions/download-artifact@master
with:
name: bundle
path: pkg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
22 changes: 0 additions & 22 deletions .github/workflows/on_release.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/stale@v1
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
Expand Down
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit "${1}"
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install lint-staged
npx --no lint-staged
38 changes: 38 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"parserOpts": {
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"]
},
"writerOpts": {
"commitsSort": ["subject", "scope"]
}
}
],
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
"@semantic-release/github",
[
"@semantic-release/npm",
{
"pkgRoot": "pkg"
}
],
[
"@semantic-release/git",
{
"assets": ["package.json", "package-lock.json", "CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]"
}
]
]
}
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"esbenp.prettier-vscode",
"christian-kohler.npm-intellisense",
"christian-kohler.path-intellisense",
"eg2.vscode-npm-script"
"eg2.vscode-npm-script",
"wix.vscode-import-cost"
]
}
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ Pretty Checkbox React uses github as its source of truth and all changes are
public from the beginning :+1. When a change is made, github actions will lint,
build, and test Pretty Checkbox React code.

### Commit Messages

Commits as of 06/19/2022 use
[conventional commit format](https://www.conventionalcommits.org/en/v1.0.0/) so
please be sure to follow the convention :smile:.

### Branch Organization

Pretty Checkbox React has one main branch: `master`. This is where the code
Expand Down
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
7 changes: 6 additions & 1 deletion jest.config.js → jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module.exports = {
// eslint-disable-next-line jest/no-jest-import
import type { Config } from 'jest';

const config: Config = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
collectCoverage: true,
Expand All @@ -13,3 +16,5 @@ module.exports = {
modulePathIgnorePatterns: ['pkg/', 'resources/', 'playground/', 'cypress/'],
testPathIgnorePatterns: ['<rootDir>/src/index.ts'],
};

export default config;
Loading

0 comments on commit 976e25e

Please sign in to comment.