generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
24,453 additions
and
10,792 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
dist/ | ||
lib/ | ||
node_modules/ | ||
jest.config.js | ||
dist/ | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
const github = { | ||
name: 'github', | ||
// the `plugin:github/recommended` preset configures 4 ESlint plugins. | ||
// https://github.com/github/eslint-plugin-github/blob/main/lib/configs/recommended.js | ||
// 1. https://github.com/github/eslint-plugin-github | ||
// 2. https://github.com/prettier/eslint-plugin-prettier | ||
// 3. https://github.com/mysticatea/eslint-plugin-eslint-comments | ||
// 4. https://github.com/benmosher/eslint-plugin-import | ||
extends: ['plugin:github/recommended'], | ||
// additional rules and preset overrides | ||
rules: { | ||
// in rare occasions I want to disable ESlint with eslint-disable, but I | ||
// definitely want to be reminded where this occurs. | ||
'eslint-comments/no-use': 'warn', | ||
'import/no-namespace': 'off' | ||
} | ||
} | ||
|
||
const jest = { | ||
name: 'jest', | ||
// https://github.com/jest-community/eslint-plugin-jest#rules | ||
extends: ['plugin:jest/recommended'], | ||
// additional rules and preset overrides | ||
rules: { | ||
// I quite like todos in tests. I wonder why this is not a default. | ||
'jest/prefer-todo': 'warn' | ||
} | ||
} | ||
|
||
const typescript = { | ||
name: '@typescript-eslint', | ||
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#recommended-configs | ||
extends: [ | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:@typescript-eslint/recommended-requiring-type-checking' | ||
], | ||
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser | ||
parser: '@typescript-eslint/parser', | ||
// additional rules and preset overrides. Many of these look like false | ||
// positives to me. | ||
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#supported-rules | ||
rules: { | ||
'@typescript-eslint/no-unsafe-assignment': 'warn', | ||
'@typescript-eslint/no-unsafe-member-access': 'warn', | ||
'@typescript-eslint/no-unused-vars': 'off', | ||
'@typescript-eslint/restrict-template-expressions': 'warn' | ||
} | ||
} | ||
|
||
const config = { | ||
// https://eslint.org/docs/user-guide/configuring/language-options#specifying-environments | ||
env: { | ||
es6: true, | ||
node: true | ||
}, | ||
|
||
extends: [ | ||
// the `eslint:recommended` preset configure many rules | ||
// https://eslint.org/docs/rules/ | ||
'eslint:recommended', | ||
...github.extends, | ||
...jest.extends, | ||
...typescript.extends | ||
], | ||
|
||
parser: typescript.parser, | ||
parserOptions: { | ||
project: ['./tsconfig.eslint.json'] | ||
}, | ||
|
||
plugins: [github.name, jest.name, typescript.name], | ||
|
||
rules: { | ||
...github.rules, | ||
...jest.rules, | ||
...typescript.rules, | ||
'no-console': 'warn' | ||
} | ||
} | ||
|
||
module.exports = config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: 'CI' | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- '**.md' | ||
push: | ||
branches: | ||
- main | ||
- 'releases/*' | ||
paths-ignore: | ||
- '**.md' | ||
|
||
jobs: | ||
build-and-test: | ||
name: 📦 Bundle action on [${{ matrix.os }}, Node ${{ matrix.node }}] | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: ['12.x'] | ||
steps: | ||
- name: 🛎️ Checkout repo | ||
uses: actions/checkout@v2 | ||
- name: 🖥️ Setup Node.js ${{ matrix.node }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- name: 👨💻 Install dependencies | ||
run: npm ci | ||
- name: 🔍 Test | ||
env: | ||
INPUT_ENDPOINT: ${{ secrets.INPUT_ENDPOINT }} | ||
INPUT_USERNAME: ${{ secrets.INPUT_USERNAME }} | ||
INPUT_PASSWORD: ${{ secrets.INPUT_PASSWORD }} | ||
INPUT_DOMAIN_ID: ${{ secrets.INPUT_DOMAIN_ID }} | ||
run: npm run test:ci | ||
- name: ⬆️ Upload coverage report to Coveralls | ||
# https://github.com/coverallsapp/github-action | ||
uses: coverallsapp/github-action@v1.1.2 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
integration-test: | ||
name: 📈 Run action without building | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 🛎️ Checkout repo | ||
uses: actions/checkout@v2 | ||
- name: ⬇️ Fetch data from Ackee | ||
id: ackee | ||
uses: ./ # TODO: replace con jackdbd/ackee-action@v1 when published | ||
with: | ||
endpoint: ${{ secrets.INPUT_ENDPOINT }} | ||
username: ${{ secrets.INPUT_USERNAME }} | ||
password: ${{ secrets.INPUT_PASSWORD }} | ||
domain_id: ${{ secrets.INPUT_DOMAIN_ID }} | ||
num_top_pages: '5' | ||
- name: Dump data | ||
run: echo "${{ steps.ackee.outputs.data }}" | ||
- name: 📨 Send report to Telegram | ||
uses: appleboy/telegram-action@master | ||
env: | ||
ACKEE_REPORT: ${{ steps.ackee.outputs.data }} | ||
with: | ||
to: ${{ secrets.TELEGRAM_TO }} | ||
token: ${{ secrets.TELEGRAM_TOKEN }} | ||
message: | | ||
🚀 Ackee report! | ||
${{ env.ACKEE_REPORT }} | ||
- name: 📨 Send report to Slack | ||
uses: pullreminders/slack-action@master | ||
env: | ||
ACKEE_REPORT: ${{ steps.ackee.outputs.data }} | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }} | ||
with: | ||
args: '{\"channel\":\"${{ env.SLACK_CHANNEL_ID }}\",\"text\":\"${{ env.ACKEE_REPORT }}\"}' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,99 +1,15 @@ | ||
# Dependency directory | ||
node_modules | ||
# dependencies | ||
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 | ||
# Test coverage | ||
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/**/* | ||
# environment variables | ||
.envrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
echo "PRE PUSH HOOK [destination remote: $1] [location remote: $2]" | ||
|
||
# get the total-1 commits (to exclude the first, Initial commit) | ||
n=$(git rev-list --count HEAD) | ||
# echo "n ${n} n-1 $(expr $n - 1)" | ||
from=$(printf HEAD~$(expr $n - 1)) | ||
|
||
echo "Run commitlint --from ${from} --to HEAD" | ||
npx commitlint --from ${from} --to HEAD --verbose | ||
# npx commitlint --print-config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
{ | ||
"arrowParens": "always", | ||
"bracketSpacing": true, | ||
"endOfLine": "lf", | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"semi": false, | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"trailingComma": "none", | ||
"bracketSpacing": false, | ||
"arrowParens": "avoid" | ||
"useTabs": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"recommendations": [ | ||
"cschleiden.vscode-github-actions", | ||
"eg2.vscode-npm-script", | ||
"esbenp.prettier-vscode", | ||
"graphql.vscode-graphql", | ||
"pflannery.vscode-versionlens" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"files.exclude": { | ||
"**/node_modules/": true | ||
}, | ||
|
||
"[javascript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true | ||
}, | ||
"[json]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true | ||
}, | ||
"[markdown]": { | ||
"editor.suggestOnTriggerCharacters": false | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true | ||
} | ||
} |
Oops, something went wrong.