Skip to content

Commit

Permalink
feat: update workflow & build system
Browse files Browse the repository at this point in the history
This PR:

- Removes Babel, `pre-commit`
- Replaces with TypeScript and `husky`, respectively
- Disables dependabot in lieu of renovate
- Ships type definitions
- Updates dependencies and commits `package-lock.json`
- Update eslint config (and a small bit of linting)
  • Loading branch information
boneskull committed Apr 18, 2023
1 parent 95c75c9 commit de359bd
Show file tree
Hide file tree
Showing 22 changed files with 16,876 additions and 275 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
8 changes: 7 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
{
"extends": "@appium/eslint-config-appium",
"extends": "@appium/eslint-config-appium-ts",
"overrides": [
{
"files": "test/**/*.js",
"rules": {
"func-names": "off"
}
},
{
"files": "scripts/**/*",
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
}
]
}
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* text=auto eol=lf

# Handle as a text file but merge as binary.
package-lock.json merge=binary
8 changes: 0 additions & 8 deletions .github/dependabot.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
package-lock.json*
build
.idea/
uiautomator2/
Expand Down
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint:commit -- --edit ${1}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint:staged
5 changes: 3 additions & 2 deletions .mocharc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
require: ['@babel/register'],
forbidOnly: Boolean(process.env.CI)
require: ['ts-node/register'],
forbidOnly: Boolean(process.env.CI),
color: true,
};
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
package-lock=false
save-exact=true
6 changes: 6 additions & 0 deletions .renovaterc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>appium/appium//renovate/default"],
"schedule": ["after 10pm and before 5:00am"],
"timezone": "America/Vancouver"
}
42 changes: 42 additions & 0 deletions .wallaby.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
'use strict';

module.exports = (wallaby) => {
return {
compilers: {
'**/*.js': wallaby.compilers.typeScript({
allowJs: true,
allowSyntheticDefaultImports: true,
resolveJsonModule: true,
isolatedModules: true,
}),
'**/*.ts?(x)': wallaby.compilers.typeScript(),
},
debug: true,
env: {
type: 'node',
},
files: ['package.json', 'lib/**/*'],
testFramework: 'mocha',
tests: ['test/unit/**/*-specs.js'],
workers: {
// restart: true,
},
setup(wallaby) {
// copied out of `./test/setup.js`

const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');

// The `chai` global is set if a test needs something special.
// Most tests won't need this.
global.chai = chai.use(chaiAsPromised);

// `should()` is only necessary when working with some `null` or `undefined` values.
global.should = chai.should();

const mocha = wallaby.testFramework;
mocha.timeout(10000);
},
runMode: 'onsave',
};
};
25 changes: 0 additions & 25 deletions babel.config.json

This file was deleted.

11 changes: 11 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'body-leading-blank': [0],
'body-max-line-length': [0],
'footer-max-line-length': [0],
'header-max-length': [0],
'subject-case': [0],
'subject-full-stop': [0],
},
};
6 changes: 0 additions & 6 deletions index.js

This file was deleted.

Loading

0 comments on commit de359bd

Please sign in to comment.