Skip to content

Commit e5e7603

Browse files
Tooling config files
1 parent bdbe4dd commit e5e7603

16 files changed

+13559
-0
lines changed

.editorconfig

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Editor config
2+
# http://EditorConfig.org
3+
4+
# This EditorConfig overrides any parent EditorConfigs
5+
root = true
6+
7+
# Default rules applied to all file types
8+
[*]
9+
10+
# No trailing spaces, newline at EOF
11+
charset = utf-8
12+
trim_trailing_whitespace = true
13+
insert_final_newline = true
14+
end_of_line = lf
15+
16+
# 2 space indentation
17+
indent_style = space
18+
indent_size = 2
19+
20+
# JavaScript-specific settings
21+
[*.{js,ts}]
22+
quote_type = double
23+
continuation_indent_size = 2
24+
curly_bracket_next_line = false
25+
indent_brace_style = BSD
26+
spaces_around_operators = true
27+
spaces_around_brackets = none

.eslintrc.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# ESLint config
2+
# http://eslint.org/docs/user-guide/configuring
3+
# https://jstools.dev/eslint-config/
4+
5+
root: true
6+
extends: "@jsdevtools"

.gitattributes

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Git attributes
2+
# https://git-scm.com/docs/gitattributes
3+
# https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes
4+
5+
# Normalize line endings for all files that git determines to be text.
6+
# https://git-scm.com/docs/gitattributes#gitattributes-Settostringvalueauto
7+
* text=auto
8+
9+
# Normalize line endings to LF on checkin, and do NOT convert to CRLF when checking-out on Windows.
10+
# https://git-scm.com/docs/gitattributes#gitattributes-Settostringvaluelf
11+
*.txt text eol=lf
12+
*.html text eol=lf
13+
*.md text eol=lf
14+
*.css text eol=lf
15+
*.scss text eol=lf
16+
*.map text eol=lf
17+
*.js text eol=lf
18+
*.jsx text eol=lf
19+
*.ts text eol=lf
20+
*.tsx text eol=lf
21+
*.json text eol=lf
22+
*.yml text eol=lf
23+
*.yaml text eol=lf
24+
*.xml text eol=lf
25+
*.svg text eol=lf

.github/workflows/CI-CD.yaml

+147
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# GitHub Actions workflow
2+
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions
3+
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
4+
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions
5+
6+
name: CI-CD
7+
8+
on:
9+
push:
10+
branches:
11+
- "*"
12+
tags-ignore:
13+
- "*"
14+
15+
schedule:
16+
- cron: "0 0 1 * *"
17+
18+
jobs:
19+
node_tests:
20+
name: Node ${{ matrix.node }} on ${{ matrix.os }}
21+
runs-on: ${{ matrix.os }}
22+
timeout-minutes: 10
23+
strategy:
24+
fail-fast: true
25+
matrix:
26+
os:
27+
- ubuntu-latest
28+
- macos-latest
29+
- windows-latest
30+
node:
31+
- 10
32+
- 12
33+
- 14
34+
35+
steps:
36+
- name: Checkout source
37+
uses: actions/checkout@v2
38+
39+
- name: Install Node ${{ matrix.node }}
40+
uses: actions/setup-node@v1
41+
with:
42+
node-version: ${{ matrix.node }}
43+
44+
- name: Install dependencies
45+
run: npm ci
46+
47+
- name: Run linter
48+
run: npm run lint
49+
50+
- name: Build the code
51+
run: npm run build
52+
53+
- name: Run tests
54+
run: npm run coverage:node
55+
56+
- name: Send code coverage results to Coveralls
57+
uses: coverallsapp/[email protected]
58+
with:
59+
github-token: ${{ secrets.GITHUB_TOKEN }}
60+
parallel: true
61+
62+
browser_tests:
63+
name: Browser Tests
64+
runs-on: ${{ matrix.os }}
65+
timeout-minutes: 10
66+
strategy:
67+
fail-fast: true
68+
matrix:
69+
os:
70+
- ubuntu-latest # Chrome, Firefox, Safari (via SauceLabs), Edge (via SauceLabs)
71+
- windows-latest # Internet Explorer
72+
73+
steps:
74+
- name: Checkout source
75+
uses: actions/checkout@v2
76+
77+
- name: Install Node
78+
uses: actions/setup-node@v1
79+
with:
80+
node-version: 12
81+
82+
- name: Install dependencies
83+
run: npm ci
84+
85+
- name: Build the code
86+
run: npm run build
87+
88+
- name: Run tests
89+
run: npm run coverage:browser
90+
env:
91+
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
92+
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
93+
94+
- name: Combine code coverage data into a single file
95+
shell: bash
96+
run: |
97+
ls -Rlh coverage/*/lcov.info
98+
cat coverage/*/lcov.info > ./coverage/lcov.info
99+
100+
- name: Send code coverage results to Coveralls
101+
uses: coverallsapp/[email protected]
102+
with:
103+
github-token: ${{ secrets.GITHUB_TOKEN }}
104+
parallel: true
105+
106+
coverage:
107+
name: Code Coverage
108+
runs-on: ubuntu-latest
109+
timeout-minutes: 10
110+
needs:
111+
- node_tests
112+
- browser_tests
113+
steps:
114+
- name: Let Coveralls know that all tests have finished
115+
uses: coverallsapp/[email protected]
116+
with:
117+
github-token: ${{ secrets.GITHUB_TOKEN }}
118+
parallel-finished: true
119+
120+
deploy:
121+
name: Publish to NPM
122+
if: github.ref == 'refs/heads/master'
123+
runs-on: ubuntu-latest
124+
timeout-minutes: 10
125+
needs:
126+
- node_tests
127+
- browser_tests
128+
129+
steps:
130+
- name: Checkout source
131+
uses: actions/checkout@v2
132+
133+
- name: Install Node
134+
uses: actions/setup-node@v1
135+
136+
- name: Install dependencies
137+
run: npm ci
138+
139+
- name: Build the code
140+
run: npm run build
141+
142+
- name: Publish to NPM
143+
uses: JS-DevTools/npm-publish@v1
144+
with:
145+
token: ${{ secrets.NPM_TOKEN }}
146+
access: public
147+
tag: alpha

.gitignore

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Git ignore
2+
# https://git-scm.com/docs/gitignore
3+
4+
# Private files
5+
.env
6+
7+
# Miscellaneous
8+
*~
9+
*#
10+
.DS_STORE
11+
Thumbs.db
12+
.netbeans
13+
nbproject
14+
.node_history
15+
16+
# IDEs & Text Editors
17+
.idea
18+
.sublime-*
19+
.vscode/settings.json
20+
.netbeans
21+
nbproject
22+
23+
# Temporary files
24+
.tmp
25+
.temp
26+
.grunt
27+
.lock-wscript
28+
29+
# Logs
30+
/logs
31+
*.log
32+
33+
# Runtime data
34+
pids
35+
*.pid
36+
*.seed
37+
38+
# Dependencies
39+
node_modules
40+
41+
# Build output
42+
/cjs
43+
/esm
44+
45+
# Test output
46+
/.nyc_output
47+
/coverage

.mocharc.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Mocha options
2+
# https://mochajs.org/#configuring-mocha-nodejs
3+
# https://github.com/mochajs/mocha/blob/master/example/config/.mocharc.yml
4+
5+
spec:
6+
- test/specs/*.spec.js # Run the tests in the root folder first
7+
- test/specs/**/*.spec.js # ...then run the tests in subfolders
8+
bail: true
9+
recursive: true
10+
require: source-map-support/register

.nycrc.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# NYC config
2+
# https://github.com/istanbuljs/nyc#configuration-files
3+
4+
extension:
5+
- .js
6+
- .ts
7+
8+
reporter:
9+
- text
10+
- lcov

.vscode/launch.json

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// VSCode Launch Configuration
2+
// https://code.visualstudio.com/docs/editor/debugging#_launch-configurations
3+
4+
// Available variables which can be used inside of strings.
5+
// ${workspaceRoot}: the root folder of the team
6+
// ${file}: the current opened file
7+
// ${fileBasename}: the current opened file's basename
8+
// ${fileDirname}: the current opened file's dirname
9+
// ${fileExtname}: the current opened file's extension
10+
// ${cwd}: the current working directory of the spawned process
11+
12+
{
13+
"version": "0.2.0",
14+
"configurations": [
15+
{
16+
"name": "Run Mocha",
17+
"type": "node",
18+
"runtimeArgs": [
19+
"--nolazy"
20+
],
21+
"request": "launch",
22+
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
23+
"stopOnEntry": false,
24+
"args": [
25+
"--quick-test",
26+
"--timeout=600000",
27+
"--retries=0",
28+
],
29+
"env": {
30+
"NODE_ENV": "test"
31+
},
32+
"cwd": "${workspaceRoot}",
33+
"console": "internalConsole",
34+
"sourceMaps": true,
35+
"outFiles": [
36+
"${workspaceRoot}/cjs/**/*.js",
37+
],
38+
"smartStep": true,
39+
"skipFiles": [
40+
"<node_internals>/**/*.js"
41+
],
42+
},
43+
44+
{
45+
"name": "Run Karma",
46+
"type": "node",
47+
"runtimeArgs": [
48+
"--nolazy"
49+
],
50+
"request": "launch",
51+
"program": "${workspaceRoot}/node_modules/karma/bin/karma",
52+
"stopOnEntry": false,
53+
"args": [
54+
"start",
55+
"--single-run"
56+
],
57+
"env": {
58+
"NODE_ENV": "test"
59+
},
60+
"cwd": "${workspaceRoot}",
61+
"console": "internalConsole",
62+
"outputCapture": "std",
63+
"sourceMaps": false,
64+
"outFiles": [
65+
"${workspaceRoot}/esm/**/*.js",
66+
],
67+
"smartStep": true,
68+
"skipFiles": [
69+
"<node_internals>/**/*.js"
70+
],
71+
}
72+
]
73+
}

.vscode/tasks.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// VSCode Tasks
2+
// https://code.visualstudio.com/docs/editor/tasks
3+
4+
// Available variables which can be used inside of strings.
5+
// ${workspaceRoot}: the root folder of the team
6+
// ${file}: the current opened file
7+
// ${fileBasename}: the current opened file's basename
8+
// ${fileDirname}: the current opened file's dirname
9+
// ${fileExtname}: the current opened file's extension
10+
// ${cwd}: the current working directory of the spawned process
11+
12+
{
13+
"version": "2.0.0",
14+
"command": "npm",
15+
"tasks": [
16+
{
17+
"type": "npm",
18+
"script": "build",
19+
"group": {
20+
"kind": "build",
21+
"isDefault": true
22+
},
23+
"problemMatcher": "$tsc"
24+
},
25+
26+
27+
{
28+
"type": "npm",
29+
"script": "test:node",
30+
"group": {
31+
"kind": "test",
32+
"isDefault": true
33+
},
34+
},
35+
]
36+
}

404.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
layout: 404
3+
---

0 commit comments

Comments
 (0)