Skip to content

Commit 5baa2df

Browse files
committed
fix: housekeeping
- add lint-staged, husky, commitlint, semantic-release - joi does not bring me joi because it is so large, moving to superstruct BREAKING CHANGES: move to glob
1 parent acdfd26 commit 5baa2df

File tree

17 files changed

+22861
-6550
lines changed

17 files changed

+22861
-6550
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ root = true
22

33
[*]
44
indent_style = space
5-
indent_size = 4
5+
indent_size = 2
66
charset = utf-8
77
trim_trailing_whitespace = true
88
insert_final_newline = true

.eslintrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": [
3+
"@djthoms/eslint-config",
4+
"@djthoms/eslint-config/esmodules",
5+
"@djthoms/eslint-config/typescript"
6+
]
7+
}

.github/workflows/on_push.yml

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
1-
on: [push, pull_request]
2-
name: Build PR & Push
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- main
36
jobs:
4-
build:
5-
runs-on: ubuntu-latest
6-
strategy:
7-
matrix:
8-
node-version: [12.x, 14.x]
9-
steps:
10-
- uses: actions/checkout@v1
11-
- name: Use Node.js ${{ matrix.node-version }}
12-
uses: actions/setup-node@v1
13-
with:
14-
node-version: ${{ matrix.node-version }}
15-
- name: npm install, lint, and build
16-
run: |
17-
npm i
18-
npm run lint
19-
npm run build
7+
release:
8+
name: Release
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 16
19+
- name: Install dependencies
20+
run: npm ci
21+
- name: Release
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
25+
run: npx semantic-release

.github/workflows/on_release.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,2 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
lerna-debug.log*
8-
9-
# Diagnostic reports (https://nodejs.org/api/report.html)
10-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11-
12-
# Runtime data
13-
pids
14-
*.pid
15-
*.seed
16-
*.pid.lock
17-
18-
# Directory for instrumented libs generated by jscoverage/JSCover
19-
lib-cov
20-
21-
# Coverage directory used by tools like istanbul
22-
coverage
23-
*.lcov
24-
25-
# nyc test coverage
26-
.nyc_output
27-
28-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29-
.grunt
30-
31-
# Bower dependency directory (https://bower.io/)
32-
bower_components
33-
34-
# node-waf configuration
35-
.lock-wscript
36-
37-
# Compiled binary addons (https://nodejs.org/api/addons.html)
38-
build/Release
39-
40-
# Dependency directories
41-
node_modules/
42-
jspm_packages/
43-
44-
# TypeScript v1 declaration files
45-
typings/
46-
47-
# TypeScript cache
48-
*.tsbuildinfo
49-
50-
# Optional npm cache directory
51-
.npm
52-
53-
# Optional eslint cache
54-
.eslintcache
55-
56-
# Microbundle cache
57-
.rpt2_cache/
58-
.rts2_cache_cjs/
59-
.rts2_cache_es/
60-
.rts2_cache_umd/
61-
62-
# Optional REPL history
63-
.node_repl_history
64-
65-
# Output of 'npm pack'
66-
*.tgz
67-
68-
# Yarn Integrity file
69-
.yarn-integrity
70-
71-
# dotenv environment variables file
72-
.env
73-
.env.test
74-
75-
# parcel-bundler cache (https://parceljs.org/)
76-
.cache
77-
78-
# Next.js build output
79-
.next
80-
81-
# Nuxt.js build / generate output
82-
.nuxt
1+
node_modules
832
dist
84-
85-
# Gatsby files
86-
.cache/
87-
# Comment in the public line in if your project uses Gatsby and *not* Next.js
88-
# https://nextjs.org/blog/next-9-1#public-directory-support
89-
# public
90-
91-
# vuepress build output
92-
.vuepress/dist
93-
94-
# Serverless directories
95-
.serverless/
96-
97-
# FuseBox cache
98-
.fusebox/
99-
100-
# DynamoDB Local files
101-
.dynamodb/
102-
103-
# TernJS port file
104-
.tern-port
105-
106-
# Pika
107-
pkg/

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no -- commitlint --edit "${1}"

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no-install lint-staged

.releaserc.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"branches": ["main"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
[
6+
"@semantic-release/release-notes-generator",
7+
{
8+
"preset": "conventionalcommits",
9+
"parserOpts": {
10+
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"]
11+
},
12+
"writerOpts": {
13+
"commitsSort": ["subject", "scope"]
14+
}
15+
}
16+
],
17+
[
18+
"@semantic-release/changelog",
19+
{
20+
"changelogFile": "CHANGELOG.md"
21+
}
22+
],
23+
"@semantic-release/github",
24+
"@semantic-release/npm",
25+
[
26+
"@semantic-release/git",
27+
{
28+
"assets": ["package.json", "package-lock.json", "CHANGELOG.md"],
29+
"message": "chore(release): ${nextRelease.version} [skip ci]"
30+
}
31+
]
32+
]
33+
}

.swcrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "https://json.schemastore.org/swcrc",
3+
"sourceMaps": true,
4+
"module": {
5+
"type": "es6"
6+
},
7+
"jsc": {
8+
"target": "es2019",
9+
"parser": {
10+
"syntax": "typescript",
11+
"tsx": true
12+
},
13+
"transform": {
14+
"react": {
15+
"runtime": "automatic"
16+
}
17+
}
18+
}
19+
}

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,30 @@ yarn add docusaurus-plugin-react-docgen react-docgen
1313

1414
## Usage
1515

16-
Inside your `docusaurus.config.js` add to the `plugins` field and configure with the `src` option with full glob support :+1:
16+
Inside your `docusaurus.config.js` add to the `plugins` field and configure with the `src` option
17+
with full glob support :+1:
1718

1819
```js
1920
module.exports = {
20-
plugins: [
21-
[
22-
'docusaurus-plugin-react-docgen',
23-
{
24-
// pass in a single string or an array of strings
25-
src: ['path/to/**/*.tsx', '!path/to/**/*test.*'],
26-
route: {
27-
path: '/docs/api',
28-
component: require.resolve('./src/components/MyDataHandler.js'),
29-
exact: true,
30-
},
31-
},
32-
],
21+
plugins: [
22+
[
23+
'docusaurus-plugin-react-docgen',
24+
{
25+
// pass in a single string or an array of strings
26+
src: ['path/to/**/*.tsx', '!path/to/**/*test.*'],
27+
route: {
28+
path: '/docs/api',
29+
component: require.resolve('./src/components/MyDataHandler.js'),
30+
exact: true,
31+
},
32+
},
3333
],
34+
],
3435
};
3536
```
3637

37-
Any pattern supported by [`fast-glob`](https://github.com/mrmlnc/fast-glob) is allowed here (including negations)
38+
Any pattern supported by [`fast-glob`](https://github.com/mrmlnc/fast-glob) is allowed here
39+
(including negations)
3840

3941
## Options
4042

0 commit comments

Comments
 (0)