Skip to content

Commit

Permalink
Merge pull request #496 from nttld/revamp
Browse files Browse the repository at this point in the history
Big revamp
  • Loading branch information
raftario authored Aug 26, 2023
2 parents d09408f + 1f13387 commit ec9f304
Show file tree
Hide file tree
Showing 18 changed files with 594 additions and 3,611 deletions.
3 changes: 1 addition & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
dist/
lib/
node_modules/
dist/
63 changes: 12 additions & 51 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,60 +1,21 @@
{
"plugins": ["@typescript-eslint"],
"extends": ["plugin:github/recommended"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module",
"project": "./tsconfig.json"
"project": true
},
"plugins": ["simple-import-sort"],
"root": true,
"rules": {
"i18n-text/no-en": "off",
"eslint-comments/no-use": "off",
"import/no-namespace": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/explicit-member-accessibility": [
"error",
{"accessibility": "no-public"}
],
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-comment": "error",
"camelcase": "off",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/explicit-function-return-type": [
"error",
{"allowExpressions": true}
],
"@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"semi": "off",
"@typescript-eslint/semi": ["error", "never"],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "error"
},
"env": {
"node": true,
"es6": true
"@typescript-eslint/no-non-null-assertion": "off",
"simple-import-sort/imports": "warn",
"simple-import-sort/exports": "warn"
}
}
19 changes: 15 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
version: 2
updates:
- package-ecosystem: github-actions
- package-ecosystem: npm
directory: /
schedule:
interval: daily
interval: weekly
groups:
dependencies:
dependency-type: production
update-types:
- minor
- patch
dev-dependencies:
dependency-type: development
update-types:
- minor
- patch

- package-ecosystem: npm
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
interval: weekly
37 changes: 0 additions & 37 deletions .github/workflows/dist.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 16
- name: configure git
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
Expand Down
26 changes: 20 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,31 @@ on:
push:
branches:
- main
- 'releases/*'
- "releases/*"

jobs:
build:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
- run: npm ci
- run: npm run all

- run: npm run lint
- run: npm run build

- run: git diff -aw --exit-code dist/index.js

test-single:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
ndk-version: [r21e, r25b]
local-cache: [true, false]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -27,13 +37,16 @@ jobs:
with:
ndk-version: ${{ matrix.ndk-version }}
local-cache: ${{ matrix.local-cache }}

- run: ndk-build --version
- run: ${{ steps.install-ndk.outputs.ndk-path }}/ndk-build --version

test-multiple:
runs-on: ubuntu-latest
strategy:
matrix:
local-cache: [true, false]

steps:
- uses: actions/checkout@v3
- uses: ./
Expand All @@ -43,11 +56,12 @@ jobs:
add-to-path: false
local-cache: ${{ matrix.local-cache }}
- uses: ./
id: install-ndk-23
id: install-ndk-25
with:
ndk-version: r25b
add-to-path: false
local-cache: ${{ matrix.local-cache }}
- run: '! which ndk-build'

- run: "! which ndk-build"
- run: ${{ steps.install-ndk-21.outputs.ndk-path }}/ndk-build --version
- run: ${{ steps.install-ndk-23.outputs.ndk-path }}/ndk-build --version
- run: ${{ steps.install-ndk-25.outputs.ndk-path }}/ndk-build --version
100 changes: 1 addition & 99 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,99 +1 @@
# Dependency directory
node_modules

# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# OS metadata
.DS_Store
Thumbs.db

# Ignore built ts files
__tests__/runner/*
lib/**/*
node_modules/
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 && npm run build && git add dist
3 changes: 1 addition & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
dist/
lib/
node_modules/
dist/
12 changes: 7 additions & 5 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"arrowParens": "avoid"
"singleQuote": false,
"quoteProps": "as-needed",
"trailingComma": "all",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "always",
"endOfLine": "lf"
}
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ inputs:
add-to-path:
description: Add installation directory to the PATH
required: false
default: 'true'
default: "true"
local-cache:
description: Use the local job cache on top of the runner tool cache
required: false
default: 'false'
default: "false"
outputs:
ndk-path:
description: Installation path
Expand Down
Loading

0 comments on commit ec9f304

Please sign in to comment.