Skip to content

Commit 3af578e

Browse files
committed
feat: cleanup
1 parent 359f047 commit 3af578e

37 files changed

Lines changed: 3338 additions & 1439 deletions

.commitlintrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"@commitlint/config-conventional"
4+
]
5+
}

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[*.{js, ts}]
22
indent_style = space
3-
indent_size = 2
3+
indent_size = 4

.github/workflows/release-tag.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release tag
33
on:
44
push:
55
tags:
6-
- "v*"
6+
- v*
77

88
jobs:
99
build:

.husky/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.mocharc.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
2-
"diff": true,
3-
"opts": false,
4-
"package": "./package.json",
5-
"reporter": "spec",
6-
"slow": 75,
7-
"timeout": 0,
8-
"ui": "bdd",
9-
"require": "./test/register.cjs",
10-
"recursive": true,
11-
"watch-files": ["./src/**/*.ts"],
12-
"spec": "src/**/*.test.ts"
2+
"diff": true,
3+
"opts": false,
4+
"package": "./package.json",
5+
"reporter": "spec",
6+
"slow": 75,
7+
"timeout": 0,
8+
"ui": "bdd",
9+
"require": "./test/register.cjs",
10+
"recursive": true,
11+
"watch-files": [
12+
"./src/**/*.ts"
13+
],
14+
"spec": "src/**/*.test.ts"
1315
}

.ncurc.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
2-
"dep": "prod,dev,bundle,optional,peer",
3-
"upgrade": true,
4-
"interactive": true,
5-
"reject": ["@types/node", "@codemirror/language", "codemirror"]
2+
"dep": "prod,dev,bundle,optional,peer",
3+
"upgrade": true,
4+
"interactive": true,
5+
"reject": [
6+
"@types/node",
7+
"@codemirror/language",
8+
"codemirror"
9+
]
610
}

.prettierignore

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

.prettierrc.cjs

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

.versionrc.js

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
// see https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-angular/writer-opts.js
2+
3+
export default {
4+
writerOpts: {
5+
transform: (commit, context) => {
6+
const issues = []
7+
8+
commit.notes.forEach(note => {
9+
note.title = 'BREAKING CHANGES'
10+
})
11+
12+
if (commit.type === 'feat') {
13+
commit.type = 'Features'
14+
} else if (commit.type === 'fix') {
15+
commit.type = 'Bug Fixes'
16+
} else if (commit.type === 'perf') {
17+
commit.type = 'Performance Improvements'
18+
} else if (commit.type === 'revert' || commit.revert) {
19+
commit.type = 'Reverts'
20+
} else if (commit.type === 'docs') {
21+
commit.type = 'Documentation'
22+
} else if (commit.type === 'style') {
23+
commit.type = 'Styles'
24+
} else if (commit.type === 'refactor') {
25+
commit.type = 'Code Refactoring'
26+
} else if (commit.type === 'test') {
27+
commit.type = 'Tests'
28+
} else if (commit.type === 'build') {
29+
commit.type = 'Build System'
30+
} else if (commit.type === 'ci') {
31+
commit.type = 'Continuous Integration'
32+
} else {
33+
return
34+
}
35+
36+
if (commit.scope === '*') {
37+
commit.scope = ''
38+
}
39+
40+
if (typeof commit.hash === 'string') {
41+
commit.shortHash = commit.hash.substring(0, 7)
42+
}
43+
44+
if (typeof commit.subject === 'string') {
45+
let url = context.repository
46+
? `${context.host}/${context.owner}/${context.repository}`
47+
: context.repoUrl
48+
if (url) {
49+
url = `${url}/issues/`
50+
// Issue URLs.
51+
commit.subject = commit.subject.replace(/#([0-9]+)/g, (_, issue) => {
52+
issues.push(issue)
53+
return `[#${issue}](${url}${issue})`
54+
})
55+
}
56+
if (context.host) {
57+
// User URLs.
58+
commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, username) => {
59+
if (username.includes('/')) {
60+
return `@${username}`
61+
}
62+
63+
return `[@${username}](${context.host}/${username})`
64+
})
65+
}
66+
}
67+
68+
// remove references that already appear in the subject
69+
commit.references = commit.references.filter(reference => {
70+
if (issues.indexOf(reference.issue) === -1) {
71+
return true
72+
}
73+
74+
return false
75+
})
76+
77+
return commit
78+
},
79+
commitsSort: (a, b) => {
80+
if (a.scope == b.scope) {
81+
if (a.subject == b.subject)
82+
return 0
83+
if (!a.subject)
84+
return -1
85+
if (!b.subject)
86+
return 1
87+
return a.subject.toLowerCase().localeCompare(b.subject.toLowerCase())
88+
}
89+
if (!a.scope)
90+
return -1
91+
if (!b.scope)
92+
return 1
93+
return a.scope.toLowerCase().localeCompare(b.scope.toLowerCase())
94+
}
95+
}
96+
}

.vscode/settings.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"editor.insertSpaces": true,
3+
"editor.tabSize": 4,
4+
"editor.detectIndentation": false,
5+
"editor.formatOnSave": true,
6+
"editor.wordWrap": "on",
7+
"editor.codeActionsOnSave": {
8+
"source.fixAll": "explicit"
9+
},
10+
"files.autoSave": "off",
11+
"html.format.wrapAttributes": "force",
12+
"html.format.wrapLineLength": 0,
13+
"files.insertFinalNewline": true,
14+
"files.trimFinalNewlines": false,
15+
"typescript.tsdk": "node_modules/typescript/lib",
16+
"files.exclude": {
17+
"**/.git": true,
18+
"**/.svn": true,
19+
"**/.hg": true,
20+
"**/CVS": true,
21+
"**/.DS_Store": true
22+
},
23+
"[yaml]": {
24+
"editor.tabSize": 2
25+
},
26+
"[toml]": {
27+
"editor.tabSize": 2
28+
},
29+
"[html]": {
30+
"editor.defaultFormatter": "vscode.html-language-features"
31+
},
32+
"[md]": {
33+
"editor.defaultFormatter": "HitkoDev.vscode-remark-hugo"
34+
},
35+
"stylelint.validate": [
36+
"css",
37+
"less",
38+
"postcss",
39+
"scss"
40+
]
41+
}

0 commit comments

Comments
 (0)