Skip to content

Commit

Permalink
Refactor to typescript (#158)
Browse files Browse the repository at this point in the history
* Refactor to typescript

* Fix platform and workflow

* Fix workflow and platform

* Update husky and image-tag

* Use 'yarn lint-staged' instead of 'npx lint-staged'
  • Loading branch information
davidmfinol authored Jan 11, 2022
1 parent 87b202c commit cdfccd0
Show file tree
Hide file tree
Showing 61 changed files with 24,771 additions and 3,193 deletions.
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
*

# Files required for the action
!entrypoint.sh
!action.yml
!dist/
6 changes: 4 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
**/node_modules/**
**/action/**
dist/
lib/
node_modules/
jest.config.js
27 changes: 15 additions & 12 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
{
"parser": "babel-eslint",
"plugins": ["jest", "@typescript-eslint", "prettier", "unicorn"],
"extends": ["plugin:unicorn/recommended", "plugin:github/recommended", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module"
},
"env": {
"node": true,
"es6": true,
"jest": true
},
"parserOptions": {
"ecmaVersion": 2020,
"ecmaFeatures": {
"impliedStrict": true
}
"jest/globals": true
},
"extends": ["airbnb", "plugin:unicorn/recommended", "prettier"],
"plugins": ["react", "jsx-a11y", "import", "prettier", "flowtype", "unicorn"],
"settings": { "react": { "version": "latest" } },
"rules": {
"prettier/prettier": "error",
"import/no-extraneous-dependencies": 0,
"no-underscore-dangle": 0
"import/no-namespace": "off",
"filenames/match-regex": "off",
"unicorn/prefer-node-protocol": "off",
"unicorn/prefer-module": "off",
"i18n-text/no-en": "off", // for results-check
"camelcase": "off", // for results-check
"import/no-unresolved": "off" // for results-check
}
}
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/index* -diff linguist-generated=true
dist/licenses* -diff linguist-generated=true
dist/sourcemap* -diff linguist-generated=true
10 changes: 5 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: daily
open-pull-requests-limit: 10
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- run: yarn lint
- run: yarn test
- run: yarn build || { echo "build command should always succeed" ; exit 61; }
- run: yarn build --quiet && git diff --quiet action || { echo "ERROR - index.js is different from repository version. Forgot to run `yarn build`?" ; exit 62; }
# - run: yarn build --quiet && git diff --quiet action || { echo "ERROR - index.js is different from repository version. Forgot to run `yarn build`?" ; exit 62; }

testAllModesLikeInTheReadme:
name: Test in ${{ matrix.testMode }} on version ${{ matrix.unityVersion }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.idea
node_modules
coverage/
lib/
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
11 changes: 11 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

if [ -t 1 ]; then
exec < /dev/tty
fi

yarn lint-staged
yarn lint
yarn test
yarn build
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
**/node_modules/**
**/action/**
**/dist/**
2 changes: 1 addition & 1 deletion .yarnrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
save-prefix ""
save-prefix "^"
--install.audit true
--add.audit true
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ branding:
color: 'gray-dark'
runs:
using: 'node12'
main: 'action/index.js'
main: 'dist/index.js'
1 change: 0 additions & 1 deletion action/index.js

This file was deleted.

17 changes: 0 additions & 17 deletions babel.config.js

This file was deleted.

File renamed without changes.
File renamed without changes.
Loading

0 comments on commit cdfccd0

Please sign in to comment.