Skip to content

Commit

Permalink
feat!: rework properties describing functionality and refactor intern…
Browse files Browse the repository at this point in the history
…als (#97)

Co-authored-by: William Viker <[email protected]>
  • Loading branch information
Julusian and willosof authored Aug 26, 2024
1 parent e0ac909 commit a78c87d
Show file tree
Hide file tree
Showing 99 changed files with 26,978 additions and 42,643 deletions.
20 changes: 0 additions & 20 deletions .eslintrc.js

This file was deleted.

5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn run g:lint-staged
lint-staged
10 changes: 9 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
"@sofie-automation/code-standard-preset/.prettierrc.json"
{
"arrowParens": "always",
"bracketSpacing": true,
"printWidth": 120,
"semi": false,
"singleQuote": true,
"useTabs": true,
"endOfLine": "lf"
}
39 changes: 39 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { generateEslintConfig } from '@companion-module/tools/eslint/config.mjs'

const baseConfig = await generateEslintConfig({
enableTypescript: true,
})

const customConfig = [
...baseConfig,

{
files: ['**/*.ts', '**/*.tsx'],
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
},
},

{
files: ['**/examples/*.js', '**/*.cjs'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
},
{
files: ['**/__tests__/**/*', '**/examples/**/*'],
rules: {
'n/no-extraneous-require': 'off',
'n/no-extraneous-import': 'off',
},
},
{
files: ['packages/webhid-demo/src/**/*'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
'n/no-missing-import': 'off',
},
},
]

export default customConfig
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ module.exports = {

moduleNameMapper: {
'@elgato-stream-deck/(.+)': '<rootDir>/packages/$1/src',
'^(..?/.+).js?$': '$1',
},
}
36 changes: 21 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"version": "0.0.0",
"private": true,
"scripts": {
"prepare": "run g:husky install",
"postinstall": "husky",
"dev": "run build:root --watch",
"dev:demo": "yarn workspace @elgato-stream-deck/webhid-demo start",
"build": "run build:root && yarn workspace @elgato-stream-deck/webhid-demo build",
"build:root": "(run g:rimraf packages/*/dist || true) && run g:tsc --build",
"build:root": "(run g:rimraf packages/*/dist || true) && run g:tsc --build tsconfig.build.json",
"test": "run lint && run unit",
"unit": "jest",
"lint:raw": "./node_modules/.bin/eslint --ext .ts --ext .js --ext .tsx --ext .jsx --ignore-pattern dist",
"lint:raw": "eslint",
"lint": "run lint:raw packages",
"lint-fix": "run lint --fix",
"bump": "lerna version --exact --conventional-commits --no-push -m \"chore(release): publish %s\"",
Expand All @@ -19,9 +19,7 @@
"validate:dependencies": "yarn npm audit && run license-validate",
"license-validate": "node ./scripts/license-check.mjs",
"g:tsc": "cd $INIT_CWD && tsc",
"g:rimraf": "cd $INIT_CWD && rimraf",
"g:husky": "./node_modules/.bin/husky",
"g:lint-staged": "./node_modules/.bin/lint-staged"
"g:rimraf": "cd $INIT_CWD && rimraf"
},
"lint-staged": {
"*.{css,json,md,scss}": [
Expand All @@ -32,20 +30,28 @@
]
},
"devDependencies": {
"@companion-module/tools": "^2.0.0",
"@julusian/jpeg-turbo": "^2.1.0",
"@sofie-automation/code-standard-preset": "^2.5.2",
"@tsconfig/node18": "^18.2.4",
"@types/jest": "^29.5.12",
"@types/node": "^18.19.39",
"@types/node": "^18.19.45",
"eslint": "^9.9.1",
"eslint-plugin-n": "^17.10.2",
"eslint-plugin-prettier": "^5.2.1",
"husky": "^9.1.5",
"jest": "^29.7.0",
"jest-mock": "^29.7.0",
"jimp": "^0.22.12",
"lerna": "^8.1.6",
"rimraf": "^5.0.9",
"sharp": "^0.33.4",
"snyk-nodejs-lockfile-parser": "^1.57.0",
"ts-jest": "^29.2.2",
"lerna": "^8.1.8",
"lint-staged": "^15.2.9",
"prettier": "^3.3.3",
"rimraf": "^5.0.10",
"sharp": "^0.33.5",
"snyk-nodejs-lockfile-parser": "^1.58.10",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"typescript": "~5.1.6",
"typescript": "~5.5.4",
"typescript-eslint": "^8.2.0",
"usb": "^2.13.0"
},
"workspaces": [
Expand All @@ -54,5 +60,5 @@
"packages/webhid",
"packages/webhid-demo"
],
"packageManager": "yarn@4.3.1"
"packageManager": "yarn@4.4.1"
}
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@
},
"dependencies": {
"eventemitter3": "^4.0.7",
"tslib": "^2.6.3"
"tslib": "^2.7.0"
}
}
Loading

0 comments on commit a78c87d

Please sign in to comment.