Skip to content

Commit 4c224e3

Browse files
🤖 chore: Setup repository.
0 parents  commit 4c224e3

31 files changed

+1461
-0
lines changed

.codeclimate.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
exclude_patterns:
2+
- doc/**
3+
- dist/**
4+
- test/**

.commitlintrc.cjs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@js-library']
3+
};

.esdoc.json

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"source": "./src",
3+
"destination": "./gh-pages",
4+
"debug": false,
5+
"index": "./README.md",
6+
"package": "./package.json",
7+
"plugins": [
8+
{
9+
"name": "esdoc-standard-plugin",
10+
"option": {
11+
"accessor": {
12+
"access": [
13+
"public",
14+
"protected",
15+
"private"
16+
],
17+
"autoPrivate": true
18+
},
19+
"brand": {
20+
"title": "@string-hashing/md5"
21+
},
22+
"test": {
23+
"type": "ava",
24+
"source": "./test/src"
25+
},
26+
"manual": {
27+
"files": [
28+
"./doc/manual/overview.md",
29+
"./doc/manual/installation.md",
30+
"./doc/manual/usage.md",
31+
"./doc/manual/example.md"
32+
]
33+
}
34+
}
35+
},
36+
{
37+
"name": "esdoc-inject-style-plugin",
38+
"option": {
39+
"enable": true,
40+
"styles": [
41+
"./doc/css/style.css"
42+
]
43+
}
44+
},
45+
{
46+
"name": "esdoc-inject-script-plugin",
47+
"option": {
48+
"enable": true,
49+
"scripts": [
50+
"./doc/scripts/header.js"
51+
]
52+
}
53+
},
54+
{
55+
"name": "esdoc-ecmascript-proposal-plugin",
56+
"option": {
57+
"all": true
58+
}
59+
}
60+
]
61+
}

.fixpackrc

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"files": [
3+
"package.json"
4+
],
5+
"quiet": false,
6+
"required": [
7+
"name",
8+
"version"
9+
],
10+
"requiredOnPrivate": [],
11+
"sortToTop": [
12+
"name",
13+
"description",
14+
"version",
15+
"license",
16+
"author",
17+
"homepage",
18+
"repository",
19+
"bugs",
20+
"keywords",
21+
"sideEffects",
22+
"type",
23+
"source",
24+
"main",
25+
"module",
26+
"esmodule",
27+
"umd:main",
28+
"unpkg",
29+
"exports",
30+
"files",
31+
"publishConfig",
32+
"scripts",
33+
"bundledDependencies",
34+
"dependencies",
35+
"optionalDependencies",
36+
"peerDependencies",
37+
"peerDependenciesMeta",
38+
"devDependencies"
39+
],
40+
"sortedSubItems": [
41+
"keywords",
42+
"exports",
43+
"files",
44+
"scripts",
45+
"bundledDependencies",
46+
"dependencies",
47+
"optionalDependencies",
48+
"peerDependencies",
49+
"peerDependenciesMeta",
50+
"devDependencies"
51+
],
52+
"warn": [
53+
"description",
54+
"author",
55+
"repository",
56+
"keywords",
57+
"main",
58+
"bugs",
59+
"homepage",
60+
"license",
61+
"files"
62+
],
63+
"warnOnPrivate": [
64+
"name",
65+
"version",
66+
"description",
67+
"main"
68+
],
69+
"dryRun": false,
70+
"wipe": false,
71+
"indent": null,
72+
"newLine": null,
73+
"finalNewLine": null
74+
}

.github/workflows/ci.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: ci
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
9+
build:
10+
name: Continuous integration (build)
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout 🛎️
14+
uses: actions/checkout@v3
15+
16+
- name: Install 📦
17+
uses: bahmutov/npm-install@v1
18+
with:
19+
install-command: yarn --frozen-lockfile --ignore-scripts
20+
useRollingCache: true
21+
22+
- name: Build 🏗️
23+
run: yarn build
24+
25+
- name: Archive build 💽
26+
uses: actions/upload-artifact@v3
27+
with:
28+
name: dist
29+
path: dist
30+
retention-days: 1
31+
32+
test:
33+
needs: ["build"]
34+
name: Continuous integration (tests)
35+
runs-on: ubuntu-latest
36+
strategy:
37+
matrix:
38+
bundle: ["modern", "module", "cjs"]
39+
steps:
40+
- name: Checkout 🛎️
41+
uses: actions/checkout@v3
42+
43+
- name: Install 📦
44+
uses: bahmutov/npm-install@v1
45+
with:
46+
install-command: yarn --frozen-lockfile --ignore-scripts
47+
useRollingCache: true
48+
49+
- name: Load build 💽
50+
uses: actions/download-artifact@v3
51+
with:
52+
name: dist
53+
path: dist
54+
55+
- name: Test 🔬
56+
run: yarn test:${{ matrix.bundle }}

.github/workflows/ci:cover.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: ci:cover
2+
on:
3+
- push
4+
- pull_request
5+
jobs:
6+
cover:
7+
name: Continuous integration (code coverage)
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout 🛎️
11+
uses: actions/checkout@v3
12+
13+
- name: Install 📦
14+
uses: bahmutov/npm-install@v1
15+
with:
16+
install-command: yarn --frozen-lockfile --ignore-scripts
17+
useRollingCache: true
18+
19+
- name: Test and record coverage 🔬
20+
run: yarn cover
21+
22+
- name: Publish coverage report 📃
23+
uses: codecov/codecov-action@v3
24+
with:
25+
fail_ci_if_error: true

.github/workflows/ci:lint-config.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: ci:lint-config
2+
on:
3+
- push
4+
- pull_request
5+
jobs:
6+
cover:
7+
name: Continuous integration (config linting)
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout 🛎️
11+
uses: actions/checkout@v3
12+
13+
- name: Install 📦
14+
uses: bahmutov/npm-install@v1
15+
with:
16+
install-command: yarn --frozen-lockfile --ignore-scripts
17+
useRollingCache: true
18+
19+
- name: Lint config 👕
20+
run: yarn lint-config

.github/workflows/ci:lint.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: ci:lint
2+
on:
3+
- push
4+
- pull_request
5+
jobs:
6+
cover:
7+
name: Continuous integration (code linting)
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout 🛎️
11+
uses: actions/checkout@v3
12+
13+
- name: Install 📦
14+
uses: bahmutov/npm-install@v1
15+
with:
16+
install-command: yarn --frozen-lockfile --ignore-scripts
17+
useRollingCache: true
18+
19+
- name: Lint 👕
20+
run: yarn lint

.github/workflows/gh-pages.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Build and Deploy GitHub pages
2+
on:
3+
release:
4+
types:
5+
- created
6+
jobs:
7+
build-and-deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout 🛎️
11+
uses: actions/checkout@v3
12+
13+
- name: Install 🔧
14+
run: npm install
15+
16+
- name: Build 🏗️
17+
run: npm run build-gh-pages
18+
19+
- name: Deploy 🚀
20+
uses: JamesIves/[email protected]
21+
with:
22+
branch: gh-pages
23+
folder: gh-pages

.gitignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# lock file
2+
!yarn.lock
3+
4+
# Generated files
5+
/dist
6+
7+
# Dependency directory
8+
node_modules
9+
jspm_packages
10+
11+
# Coverage directory used by nyc
12+
/coverage
13+
/.nyc_output
14+
15+
# Documentation
16+
/gh-pages

.husky/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/commit-msg

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
function ask () {
5+
6+
# This is a general-purpose function to ask Yes/No questions in Bash, either
7+
# with or without a default answer. It keeps repeating the question until it
8+
# gets a valid answer.
9+
10+
# http://djm.me/ask
11+
12+
if [ "${2:-}" = "Y" ]; then
13+
prompt="Y/n"
14+
default=Y
15+
elif [ "${2:-}" = "N" ]; then
16+
prompt="y/N"
17+
default=N
18+
else
19+
prompt="y/n"
20+
default=
21+
fi
22+
23+
while true; do
24+
25+
# Ask the question (not using "read -p" as it uses stderr not stdout)
26+
echo -n "$1 [$prompt] "
27+
28+
# Read the answer (use /dev/tty in case stdin is redirected from somewhere else)
29+
read REPLY </dev/tty
30+
31+
# Default?
32+
if [ -z "$REPLY" ]; then
33+
REPLY=$default
34+
fi
35+
36+
# Check if the reply is valid
37+
case "$REPLY" in
38+
Y*|y*) return 0 ;;
39+
N*|n*) return 1 ;;
40+
esac
41+
42+
done
43+
44+
}
45+
46+
while ! npm run commit-msg -- "$1" ; do
47+
if [ -t 1 ] && ask 'There was an error. Do you wish to amend your commit message?' Y ; then
48+
${GIT_EDITOR:-$EDITOR} "$1" < /dev/tty
49+
else
50+
exit 1
51+
fi
52+
done

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm run precommit

0 commit comments

Comments
 (0)