Skip to content

Commit 1add34e

Browse files
initial commit
0 parents  commit 1add34e

21 files changed

+566
-0
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
9+
indent_style = space
10+
indent_size = 2
11+
12+
end_of_line = lf
13+
charset = utf-8
14+
trim_trailing_whitespace = true
15+
insert_final_newline = true

.eslintrc.cjs

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/** @type {import('eslint').Linter.Config} */
2+
const config = {
3+
root: true,
4+
parser: '@typescript-eslint/parser',
5+
plugins: ['@typescript-eslint', 'unicorn', 'import'],
6+
extends: ['eslint:recommended'],
7+
env: {
8+
node: true,
9+
es6: true,
10+
},
11+
parserOptions: {
12+
ecmaVersion: 2020,
13+
sourceType: 'module',
14+
},
15+
rules: {
16+
quotes: ['error', 'single', { avoidEscape: true }],
17+
camelcase: ['error', { properties: 'never' }],
18+
semi: ['error', 'never'],
19+
indent: [2, 2],
20+
eqeqeq: ['error', 'always'],
21+
22+
'prefer-const': 'error',
23+
'no-multiple-empty-lines': [2, { max: 1, maxEOF: 1 }],
24+
'array-bracket-spacing': ['error', 'never'],
25+
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
26+
'comma-spacing': ['error', { before: false, after: true }],
27+
'no-lonely-if': 'error',
28+
'dot-notation': 'error',
29+
'no-else-return': 'error',
30+
'no-tabs': 'error',
31+
'no-trailing-spaces': [
32+
'error',
33+
{
34+
skipBlankLines: false,
35+
ignoreComments: false,
36+
},
37+
],
38+
'no-var': 'error',
39+
'unicode-bom': ['error', 'never'],
40+
curly: ['error', 'all'],
41+
'object-curly-spacing': ['error', 'always'],
42+
'keyword-spacing': ['error'],
43+
'require-atomic-updates': 0,
44+
'linebreak-style': ['error', 'unix'],
45+
'unicorn/prefer-node-protocol': ['error'],
46+
'import/extensions': ['error', 'ignorePackages'],
47+
'no-restricted-syntax': [
48+
'error',
49+
'IfStatement > ExpressionStatement > AssignmentExpression',
50+
],
51+
'unicorn/prefer-ternary': 'error',
52+
},
53+
overrides: [
54+
{
55+
files: ['*.ts'],
56+
rules: {
57+
// see https://stackoverflow.com/questions/55280555/typescript-eslint-eslint-plugin-error-route-is-defined-but-never-used-no-un
58+
'no-unused-vars': 'off',
59+
'@typescript-eslint/no-unused-vars': 'error',
60+
'@typescript-eslint/consistent-type-imports': 'error',
61+
'no-undef': 'off',
62+
// allow overloads
63+
'no-redeclare': 'off',
64+
},
65+
},
66+
{
67+
files: ['*.test.ts'],
68+
rules: {
69+
'dot-notation': 'off',
70+
},
71+
},
72+
],
73+
}
74+
75+
module.exports = config

.gitattributes

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
*.sln merge=union
7+
*.csproj merge=union
8+
*.vbproj merge=union
9+
*.fsproj merge=union
10+
*.dbproj merge=union
11+
12+
# Standard to msysgit
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain

.github/FUNDING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tidelift: npm/webdriverio
2+
open_collective: webdriverio
3+
github: [christian-bromann,webdriverio]

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 10

.github/workflows/audit.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Audit
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths-ignore:
7+
- '**.md'
8+
pull_request:
9+
paths-ignore:
10+
- '**.md'
11+
12+
jobs:
13+
14+
build:
15+
name: Audit
16+
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
23+
- name: Set Node.js 20.x
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: 20.x
27+
28+
- name: npm install
29+
run: npm install
30+
31+
- name: Build
32+
run: npm run build
33+
34+
- name: Audit
35+
run: npm audit --audit-level=moderate --omit=dev

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- v[0-9]+.[0-9]+.[0-9]+*
9+
pull_request:
10+
11+
jobs:
12+
build:
13+
strategy:
14+
matrix:
15+
os: [macos-13, ubuntu-latest, windows-latest]
16+
runs-on: ${{ matrix.os }}
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: 💚 Use Node.js
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: 20
24+
25+
- name: 🚧 Install Dependencies
26+
run: npm ci
27+
28+
- name: 📦 Build
29+
run: npm run build
30+
31+
- name: 🧪 Run Tests
32+
uses: GabrielBB/xvfb-action@v1
33+
with:
34+
run: npm test

.github/workflows/expense.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Expense Contribution
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
prNumber:
7+
description: "Number of the PR (without #)"
8+
required: true
9+
amount:
10+
description: "The expense amount you like to grant for the contribution in $"
11+
required: true
12+
type: choice
13+
options:
14+
- 15
15+
- 25
16+
- 35
17+
- 50
18+
- 100
19+
- 150
20+
- 200
21+
- 250
22+
- 300
23+
- 350
24+
- 400
25+
- 450
26+
- 500
27+
- 550
28+
- 600
29+
- 650
30+
- 700
31+
- 750
32+
- 800
33+
- 850
34+
- 900
35+
- 950
36+
- 1000
37+
38+
jobs:
39+
authorize:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: octokit/[email protected]
43+
with:
44+
route: GET /orgs/:organisation/teams/:team/memberships/${{ github.actor }}
45+
team: technical-steering-committee
46+
organisation: webdriverio
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.WDIO_BOT_GITHUB_TOKEN }}
49+
expense:
50+
permissions:
51+
contents: write
52+
id-token: write
53+
needs: [authorize]
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: Run Expense Flow
57+
uses: webdriverio/expense-action@v1
58+
with:
59+
prNumber: ${{ github.event.inputs.prNumber }}
60+
amount: ${{ github.event.inputs.amount }}
61+
env:
62+
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}
63+
GH_TOKEN: ${{ secrets.WDIO_BOT_GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Manual NPM Publish
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
releaseType:
7+
description: "Release type - major, minor or patch"
8+
required: true
9+
type: choice
10+
default: "patch"
11+
options:
12+
- patch
13+
- minor
14+
- major
15+
distTag:
16+
description: 'NPM tag (e.g. use "next" to release a test version)'
17+
required: true
18+
default: 'latest'
19+
preRelease:
20+
description: If latest release was a pre-release (e.g. X.X.X-alpha.0) and you want to push another one, pick "yes"
21+
required: true
22+
type: choice
23+
default: "no"
24+
options:
25+
- "yes"
26+
- "no"
27+
28+
env:
29+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
30+
NPM_CONFIG_PROVENANCE: true
31+
32+
jobs:
33+
release:
34+
runs-on: ubuntu-latest
35+
permissions:
36+
contents: write
37+
id-token: write
38+
steps:
39+
- uses: actions/checkout@v3
40+
with:
41+
ref: 'main'
42+
fetch-depth: 0
43+
- uses: actions/setup-node@v3
44+
with:
45+
node-version: 20
46+
- name: NPM Setup
47+
run: |
48+
npm set registry "https://registry.npmjs.org/"
49+
npm set //registry.npmjs.org/:_authToken $NPM_TOKEN
50+
npm whoami
51+
- name: Git Setup
52+
run: |
53+
git config --global user.email "[email protected]"
54+
git config --global user.name "WebdriverIO Release Bot"
55+
- name: Install Dependencies
56+
run: npm ci
57+
- name: Build
58+
run: npm run build
59+
- name: Release
60+
run: npx release-it ${{github.event.inputs.releaseType}} --github.release --ci --npm.skipChecks --no-git.requireCleanWorkingDir --npm.tag=${{github.event.inputs.distTag}}
61+
env:
62+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
if: ${{ github.event.inputs.preRelease == 'no' }}
65+
- name: Pre-Release
66+
run: npx release-it ${{github.event.inputs.releaseType}} --github.release --ci --npm.skipChecks --no-git.requireCleanWorkingDir --preRelease=alpha --github.preRelease --npm.tag=next
67+
env:
68+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
if: ${{ github.event.inputs.preRelease == 'yes' }}

.github/workflows/update.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# this workflow merges requests from Dependabot if tests are passing
2+
# ref https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions
3+
# and https://github.com/dependabot/fetch-metadata
4+
name: Auto-merge
5+
6+
# `pull_request_target` means this uses code in the base branch, not the PR.
7+
on: pull_request_target
8+
9+
# Dependabot PRs' tokens have read permissions by default and thus we must enable write permissions.
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
14+
jobs:
15+
dependencies:
16+
runs-on: ubuntu-latest
17+
if: github.actor == 'dependabot[bot]'
18+
19+
steps:
20+
- name: Fetch PR metadata
21+
id: metadata
22+
uses: dependabot/[email protected]
23+
with:
24+
github-token: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Wait for PR CI
27+
# Don't merge updates to GitHub Actions versions automatically.
28+
# (Some repos may wish to limit by version range (major/minor/patch), or scope (dep vs dev-dep), too.)
29+
if: contains(steps.metadata.outputs.package-ecosystem, 'npm')
30+
uses: lewagon/[email protected]
31+
with:
32+
ref: ${{ github.event.pull_request.head.sha }}
33+
repo-token: ${{ secrets.GITHUB_TOKEN }}
34+
wait-interval: 30 # seconds
35+
running-workflow-name: dependencies # wait for all checks except this one
36+
allowed-conclusions: success # all other checks must pass, being skipped or cancelled is not sufficient
37+
38+
- name: Auto-merge dependabot PRs
39+
# Don't merge updates to GitHub Actions versions automatically.
40+
# (Some repos may wish to limit by version range (major/minor/patch), or scope (dep vs dev-dep), too.)
41+
if: contains(steps.metadata.outputs.package-ecosystem, 'npm')
42+
env:
43+
PR_URL: ${{ github.event.pull_request.html_url }}
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
# The "auto" flag will only merge once all of the target branch's required checks
46+
# are met. Configure those in the "branch protection" settings for each repo.
47+
run: gh pr merge --auto --squash "$PR_URL"

0 commit comments

Comments
 (0)