Skip to content

Commit 994e1ca

Browse files
committed
refactor: use new @aptre/common
Signed-off-by: Christian Stewart <[email protected]>
1 parent 818c103 commit 994e1ca

26 files changed

+1262
-1650
lines changed

.eslintrc.cjs

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.cjs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = {
2+
root: true,
3+
parser: '@typescript-eslint/parser',
4+
plugins: ['@typescript-eslint', 'unused-imports'],
5+
extends: [
6+
'eslint:recommended',
7+
'plugin:@typescript-eslint/recommended',
8+
'plugin:react-hooks/recommended',
9+
'prettier',
10+
],
11+
parserOptions: {
12+
project: './tsconfig.json',
13+
},
14+
rules: {
15+
'@typescript-eslint/explicit-module-boundary-types': 'off',
16+
'@typescript-eslint/no-non-null-assertion': 'off',
17+
},
18+
ignorePatterns: [
19+
"node_modules",
20+
"dist",
21+
"coverage",
22+
"bundle",
23+
"runtime",
24+
"vendor",
25+
".eslintrc.js",
26+
"wasm_exec.js"
27+
]
28+
}

.github/renovate.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
"workarounds:all"
88
],
99
"branchConcurrentLimit": 0,
10-
"ignorePaths": ["hack"],
1110
"packageRules": [
1211
{
1312
"matchManagers": ["gomod"],
14-
"matchDepTypes": ["replace", "toolchain"],
13+
"matchDepTypes": ["replace"],
1514
"enabled": false
1615
}
1716
]

.github/workflows/codeql-analysis.yml

Lines changed: 29 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: 'CodeQL'
1+
name: "CodeQL"
22

33
on:
44
push:
5-
branches: ['master']
5+
branches: [ "master" ]
66
pull_request:
77
# The branches below must be a subset of the branches above
8-
branches: ['master']
8+
branches: [ "master" ]
99
schedule:
1010
- cron: '41 13 * * 6'
1111

@@ -24,44 +24,34 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
language: ['go', 'javascript']
27+
language: [ 'go', 'javascript' ]
2828
go: ['1.22']
29-
node: [21.x]
29+
node: [22.x]
3030
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
3131
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
3232

3333
steps:
34-
- name: Checkout repository
35-
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
36-
37-
- name: Setup Go ${{ matrix.go }}
38-
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
39-
with:
40-
go-version: ${{ matrix.go }}
41-
42-
- name: Setup Node.JS ${{ matrix.node }}
43-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
44-
with:
45-
node-version: ${{ matrix.node }}
46-
cache: 'yarn'
47-
48-
- name: Initialize CodeQL
49-
uses: github/codeql-action/init@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
50-
with:
51-
languages: ${{ matrix.language }}
52-
53-
- name: Autobuild
54-
uses: github/codeql-action/autobuild@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
55-
56-
# ℹ️ Command-line programs to run using the OS shell.
57-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
58-
59-
# If the Autobuild fails above, remove it and uncomment the following three lines.
60-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
61-
62-
# - run: |
63-
# echo "Run, Build Application using script"
64-
# ./location_of_script_within_repo/buildscript.sh
65-
66-
- name: Perform CodeQL Analysis
67-
uses: github/codeql-action/analyze@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
34+
- name: Checkout repository
35+
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
36+
37+
- name: Setup Go ${{ matrix.go }}
38+
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
39+
with:
40+
go-version: ${{ matrix.go }}
41+
42+
- name: Setup Node.JS ${{ matrix.node }}
43+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
44+
with:
45+
node-version: ${{ matrix.node }}
46+
cache: 'yarn'
47+
48+
- name: Initialize CodeQL
49+
uses: github/codeql-action/init@b7cec7526559c32f1616476ff32d17ba4c59b2d6 # v3.25.5
50+
with:
51+
languages: ${{ matrix.language }}
52+
53+
- name: Autobuild
54+
uses: github/codeql-action/autobuild@b7cec7526559c32f1616476ff32d17ba4c59b2d6 # v3.25.5
55+
56+
- name: Perform CodeQL Analysis
57+
uses: github/codeql-action/analyze@b7cec7526559c32f1616476ff32d17ba4c59b2d6 # v3.25.5

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: 'Checkout Repository'
18-
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
18+
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
1919
- name: 'Dependency Review'
2020
uses: actions/dependency-review-action@0c155c5e8556a497adf53f2c18edabf945ed8e70 # v4.3.2

.github/workflows/tests.yml

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: Tests
22

33
on:
44
push:
5-
branches: ['main', 'starpc', 'grpc', 'drpc', 'twirp']
5+
branches: [ "master" ]
66
pull_request:
77
# The branches below must be a subset of the branches above
8-
branches: ['main', 'starpc', 'grpc', 'drpc', 'twirp']
8+
branches: [ "master" ]
99

1010
# Builds images for target boards.
1111
permissions:
@@ -17,30 +17,48 @@ jobs:
1717
strategy:
1818
matrix:
1919
go: ['1.22']
20-
node: [21.x]
20+
node: [22.x]
2121
timeout-minutes: 10
2222
steps:
23-
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
23+
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
24+
2425
- name: Setup Go ${{ matrix.go }}
2526
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
2627
with:
2728
go-version: ${{ matrix.go }}
29+
2830
- name: Setup Node.JS ${{ matrix.node }}
2931
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
3032
with:
3133
node-version: ${{ matrix.node }}
3234
cache: 'yarn'
35+
3336
- name: Yarn install
3437
run: yarn install
35-
- name: Depcheck
36-
run: yarn run deps
38+
39+
- name: Cache tools
40+
uses: actions/cache@v4
41+
with:
42+
path: |
43+
./.tools
44+
key: ${{ runner.os }}-aptre-tools-${{ hashFiles('**/go.sum') }}
45+
restore-keys: |
46+
${{ runner.os }}-aptre-tools-
47+
3748
- name: Build Javascript
3849
run: yarn run build
39-
- name: Lint Javascript
40-
run: yarn run lint:js
50+
51+
- name: Test Go
52+
run: make test
53+
4154
- name: Test Js
4255
run: yarn test:js
56+
57+
- name: Lint Js
58+
run: yarn run lint:js
59+
4360
- name: Lint Go
4461
run: yarn run lint:go
45-
- name: Test Go
46-
run: make test
62+
63+
- name: Depcheck Js
64+
run: yarn run deps

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/coverage
33
/build
44
/.log
5+
/.tools
56
/.snowpack
67

78
# misc
@@ -23,4 +24,5 @@ yarn-error.log*
2324
!.vscode/launch.json
2425

2526
vendor/
26-
debug.test
27+
debug.test
28+
.aider*

.golangci.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,67 @@
1+
linters:
2+
enable:
3+
- depguard
4+
- goimports
5+
- gosec
6+
- gosimple
7+
- govet
8+
- importas
9+
- ineffassign
10+
- misspell
11+
- revive
12+
- staticcheck
13+
- typecheck
14+
- unconvert
15+
- unused
16+
17+
disable:
18+
- errcheck
19+
20+
run:
21+
concurrency: 4
22+
modules-download-mode: vendor
23+
24+
skip-dirs:
25+
- hack
26+
127
linters-settings:
228
staticcheck:
329
checks:
430
- all
531
- '-SA1012' # Allow passing nil contexts.
32+
33+
importas:
34+
# Do not allow unaliased imports of aliased packages.
35+
no-unaliased: true
36+
37+
maligned:
38+
suggest-new: true
39+
40+
depguard:
41+
rules:
42+
main:
43+
deny:
44+
- pkg: io/ioutil
45+
desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil
46+
- pkg: "github.com/stretchr/testify/assert"
47+
desc: Use "gotest.tools/v3/assert" instead
48+
- pkg: "github.com/stretchr/testify/require"
49+
desc: Use "gotest.tools/v3/assert" instead
50+
- pkg: "github.com/stretchr/testify/suite"
51+
desc: Do not use
52+
53+
revive:
54+
rules:
55+
- name: package-comments
56+
disabled: true
57+
58+
gosec:
59+
excludes:
60+
- G306 # Allow WriteFile permissions to be 0644.
61+
62+
issues:
63+
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
64+
max-issues-per-linter: 0
65+
66+
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
67+
max-same-issues: 0

.prettierrc.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
semi: false
2+
singleQuote: true
3+
experimentalTernaries: true

0 commit comments

Comments
 (0)