Skip to content

Commit 062f747

Browse files
authored
Rewrite action to typescript (#24)
* Migrate to compose action * Migrate to compose action * Migrate to typescript * Migrate to typescript * Migrate to typescript * Migrate to typescript * Migrate to typescript * Added added typescript implementation * Added added typescript implementation * Added added typescript implementation * Fix query typing * Drop docker code * Added tests
1 parent 4252b52 commit 062f747

39 files changed

+43734
-56
lines changed

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
lib/
2+
dist/
3+
node_modules/
4+
coverage/

.eslintrc.json

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"plugins": ["jest", "@typescript-eslint"],
3+
"extends": [
4+
"plugin:github/recommended",
5+
"plugin:import/errors",
6+
"plugin:import/warnings",
7+
"plugin:import/typescript"
8+
],
9+
"parser": "@typescript-eslint/parser",
10+
"parserOptions": {
11+
"ecmaVersion": 9,
12+
"sourceType": "module",
13+
"project": ["./tsconfig.json", "./__tests__/tsconfig.json"]
14+
},
15+
"rules": {
16+
"i18n-text/no-en": "off",
17+
"eslint-comments/no-use": "off",
18+
"import/no-namespace": "off",
19+
"no-unused-vars": "off",
20+
"@typescript-eslint/no-unused-vars": "error",
21+
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
22+
"@typescript-eslint/no-require-imports": "error",
23+
"@typescript-eslint/array-type": "error",
24+
"@typescript-eslint/await-thenable": "error",
25+
"@typescript-eslint/ban-ts-comment": "error",
26+
"camelcase": "off",
27+
"@typescript-eslint/consistent-type-assertions": "error",
28+
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
29+
"@typescript-eslint/func-call-spacing": ["error", "never"],
30+
"@typescript-eslint/no-array-constructor": "error",
31+
"@typescript-eslint/no-empty-interface": "error",
32+
"@typescript-eslint/no-explicit-any": "error",
33+
"@typescript-eslint/no-extraneous-class": "error",
34+
"@typescript-eslint/no-for-in-array": "error",
35+
"@typescript-eslint/no-inferrable-types": "error",
36+
"@typescript-eslint/no-misused-new": "error",
37+
"@typescript-eslint/no-namespace": "error",
38+
"@typescript-eslint/no-non-null-assertion": "warn",
39+
"@typescript-eslint/no-unnecessary-qualifier": "error",
40+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
41+
"@typescript-eslint/no-useless-constructor": "error",
42+
"@typescript-eslint/no-var-requires": "error",
43+
"@typescript-eslint/prefer-for-of": "warn",
44+
"@typescript-eslint/prefer-function-type": "warn",
45+
"@typescript-eslint/prefer-includes": "error",
46+
"@typescript-eslint/prefer-string-starts-ends-with": "error",
47+
"@typescript-eslint/promise-function-async": "error",
48+
"@typescript-eslint/require-array-sort-compare": "error",
49+
"@typescript-eslint/restrict-plus-operands": "error",
50+
"semi": "off",
51+
"@typescript-eslint/semi": ["error", "never"],
52+
"@typescript-eslint/type-annotation-spacing": "error",
53+
"@typescript-eslint/unbound-method": "error"
54+
},
55+
"env": {
56+
"node": true,
57+
"es6": true
58+
},
59+
"settings": {
60+
"import/resolver": {
61+
"node": {
62+
"extensions": [".js", ".jsx", ".ts", ".tsx"],
63+
"moduleDirectory": ["node_modules", "src/"]
64+
}
65+
}
66+
}
67+
}

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto eol=lf
2+
3+
dist/** -diff linguist-generated=true

.github/banner.png

955 KB
Loading

.github/codeql/codeql-config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: "CodeQL config"
2+
3+
paths-ignore:
4+
- dist
5+

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
8+
- package-ecosystem: npm
9+
directory: /
10+
schedule:
11+
interval: weekly

.github/mergify.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extends: .github

.github/workflows/build-and-test.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: build-and-test
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
types: [opened, synchronize, reopened]
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
check-dist:
13+
name: "check-dist matches source"
14+
uses: cloudposse/github-actions-workflows/.github/workflows/ci-typescript-app-check-dist.yml@main
15+
with:
16+
node-version: 20.x
17+
18+
unit-test:
19+
name: "unit tests"
20+
runs-on: ubuntu-latest
21+
needs: check-dist
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
ref: ${{ github.event.pull_request.head.ref }}
26+
27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version-file: package.json
30+
cache: yarn
31+
32+
- name: install dependencies
33+
run: yarn add ci
34+
35+
- name: run unit tests
36+
run: yarn test

.github/workflows/codeql.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "master" ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ "master" ]
20+
schedule:
21+
- cron: '32 8 * * 6'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'javascript' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v3
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v2
46+
with:
47+
languages: ${{ matrix.language }}
48+
config-file: ./.github/codeql/codeql-config.yml
49+
# If you wish to specify custom queries, you can do so here or in a config file.
50+
# By default, queries listed here will override any specified in a config file.
51+
# Prefix the list here with "+" to use these queries and those in the config file.
52+
53+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
54+
# queries: security-extended,security-and-quality
55+
56+
57+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
58+
# If this step fails, then you should remove it and run the build manually (see below)
59+
- name: Autobuild
60+
uses: github/codeql-action/autobuild@v2
61+
62+
# ℹ️ Command-line programs to run using the OS shell.
63+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
64+
65+
# If the Autobuild fails above, remove it and uncomment the following three lines.
66+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
67+
68+
# - run: |
69+
# echo "Run, Build Application using script"
70+
# ./location_of_script_within_repo/buildscript.sh
71+
72+
- name: Perform CodeQL Analysis
73+
uses: github/codeql-action/analyze@v2

.github/workflows/test-multiline.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ jobs:
2222
- name: Checkout
2323
uses: actions/checkout@v4
2424

25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version-file: package.json
28+
cache: yarn
29+
30+
- name: install dependencies
31+
run: |-
32+
yarn add ci
33+
yarn build
34+
2535
- uses: ./
2636
id: current
2737
with:

0 commit comments

Comments
 (0)