Skip to content

Commit 9c57f22

Browse files
committed
Merge remote-tracking branch 'upstream/master' into feature/fail-fast
2 parents 5d1a1a1 + 4fa22bc commit 9c57f22

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+4076
-3908
lines changed

.editorconfig

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +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
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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
root: true
66

77
extends:
8-
- modular/best-practices
9-
- modular/style
10-
- modular/browser
11-
- modular/node
12-
- modular/es6
8+
- "@jsdevtools/modular/best-practices"
9+
- "@jsdevtools/modular/style"
10+
- "@jsdevtools/modular/browser"
11+
- "@jsdevtools/modular/node"
12+
- "@jsdevtools/modular/es6"
1313

1414
rules:
1515
# This rule erroneously flags functions that use the `arguments` object

.github/workflows/CI-CD.yaml

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
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+
34+
steps:
35+
- name: Checkout source
36+
uses: actions/checkout@v2
37+
38+
- name: Install Node ${{ matrix.node }}
39+
uses: actions/setup-node@v1
40+
with:
41+
node-version: ${{ matrix.node }}
42+
43+
- name: Install dependencies
44+
run: npm ci
45+
46+
- name: Run linter
47+
run: npm run lint
48+
49+
- name: Run TypeScript tests
50+
run: npm run test:typescript
51+
52+
- name: Run Node tests
53+
run: npm run coverage:node
54+
55+
- name: Send code coverage results to Coveralls
56+
uses: coverallsapp/[email protected]
57+
with:
58+
github-token: ${{ secrets.GITHUB_TOKEN }}
59+
parallel: true
60+
61+
browser_tests:
62+
name: Browser Tests
63+
runs-on: ${{ matrix.os }}
64+
timeout-minutes: 10
65+
strategy:
66+
fail-fast: true
67+
matrix:
68+
os:
69+
- ubuntu-latest # Chrome, Firefox, Safari (via SauceLabs), Edge (via SauceLabs)
70+
- windows-latest # Internet Explorer
71+
72+
steps:
73+
- name: Checkout source
74+
uses: actions/checkout@v2
75+
76+
- name: Install Node
77+
uses: actions/setup-node@v1
78+
with:
79+
node-version: 12
80+
81+
- name: Install dependencies
82+
run: npm ci
83+
84+
- name: Run tests
85+
run: npm run coverage:browser
86+
env:
87+
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
88+
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
89+
90+
- name: Combine code coverage data into a single file
91+
shell: bash
92+
run: |
93+
ls -Rlh coverage/*/lcov.info
94+
cat coverage/*/lcov.info > ./coverage/lcov.info
95+
96+
- name: Send code coverage results to Coveralls
97+
uses: coverallsapp/[email protected]
98+
with:
99+
github-token: ${{ secrets.GITHUB_TOKEN }}
100+
parallel: true
101+
102+
coverage:
103+
name: Code Coverage
104+
runs-on: ubuntu-latest
105+
timeout-minutes: 10
106+
needs:
107+
- node_tests
108+
- browser_tests
109+
steps:
110+
- name: Let Coveralls know that all tests have finished
111+
uses: coverallsapp/[email protected]
112+
with:
113+
github-token: ${{ secrets.GITHUB_TOKEN }}
114+
parallel-finished: true
115+
116+
deploy:
117+
name: Publish to NPM
118+
if: github.ref == 'refs/heads/master'
119+
runs-on: ubuntu-latest
120+
timeout-minutes: 10
121+
needs:
122+
- node_tests
123+
- browser_tests
124+
125+
steps:
126+
- name: Checkout source
127+
uses: actions/checkout@v2
128+
129+
- name: Install Node
130+
uses: actions/setup-node@v1
131+
132+
- name: Install dependencies
133+
run: npm ci
134+
135+
- name: Publish to NPM
136+
uses: JS-DevTools/npm-publish@v1
137+
with:
138+
token: ${{ secrets.NPM_TOKEN }}
139+
140+
- name: Prepare the non-scoped packaged
141+
run: |
142+
cp LICENSE *.md dist
143+
VERSION=$(node -e "console.log(require('./package.json').version)")
144+
sed -i "s/X.X.X/${VERSION}/g" dist/package.json
145+
146+
- name: Publish the non-scoped package to NPM
147+
uses: JS-DevTools/npm-publish@v1
148+
with:
149+
token: ${{ secrets.NPM_TOKEN }}
150+
package: dist/package.json

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ nbproject
1313
# IDEs & Text Editors
1414
.idea
1515
.sublime-*
16-
.vscode
16+
.vscode/settings.json
1717
.netbeans
1818
nbproject
1919

.nycrc.yml

Lines changed: 10 additions & 0 deletions
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

.travis.yml

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

.vscode/launch.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Run Mocha tests",
6+
"type": "node",
7+
"request": "launch",
8+
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
9+
"stopOnEntry": false,
10+
"args": ["--timeout=600000"],
11+
"cwd": "${workspaceRoot}",
12+
"preLaunchTask": null,
13+
"runtimeExecutable": null,
14+
"runtimeArgs": [
15+
"--nolazy"
16+
],
17+
"env": {
18+
"NODE_ENV": "development"
19+
},
20+
"console": "internalConsole",
21+
"sourceMaps": false
22+
},
23+
{
24+
"name": "Run TypeScript tests",
25+
"type": "node",
26+
"request": "launch",
27+
"program": "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js",
28+
"stopOnEntry": false,
29+
"args": [
30+
"run",
31+
"test:typescript"
32+
],
33+
"cwd": "${workspaceRoot}",
34+
"preLaunchTask": null,
35+
"runtimeExecutable": null,
36+
"runtimeArgs": [
37+
"--nolazy"
38+
],
39+
"env": {
40+
"NODE_ENV": "development"
41+
},
42+
"console": "internalConsole",
43+
"outputCapture": "std",
44+
"sourceMaps": false
45+
}
46+
]
47+
}

.vscode/tasks.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Available variables which can be used inside of strings.
2+
// ${workspaceRoot}: the root folder of the team
3+
// ${file}: the current opened file
4+
// ${fileBasename}: the current opened file's basename
5+
// ${fileDirname}: the current opened file's dirname
6+
// ${fileExtname}: the current opened file's extension
7+
// ${cwd}: the current working directory of the spawned process
8+
9+
{
10+
"version": "0.1.0",
11+
"command": "npm",
12+
"isShellCommand": true,
13+
"suppressTaskName": true,
14+
"tasks": [
15+
{
16+
"taskName": "lint",
17+
"args": ["run", "lint"],
18+
"showOutput": "always",
19+
"problemMatcher": "$eslint-stylish",
20+
"isBuildCommand": true
21+
},
22+
{
23+
"taskName": "test",
24+
"args": ["run", "mocha"],
25+
"showOutput": "always",
26+
"isTestCommand": true
27+
}
28+
]
29+
}

0 commit comments

Comments
 (0)