Skip to content

Commit 227732e

Browse files
committed
feat: ESP exception decoder tool for Arduino IDE
Signed-off-by: dankeboy36 <dankeboy36@gmail.com>
1 parent e5b1ae4 commit 227732e

36 files changed

+23950
-129
lines changed

‎.eslintrc.json‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"ecmaVersion": 6,
6+
"sourceType": "module"
7+
},
8+
"extends": [
9+
"plugin:@typescript-eslint/recommended",
10+
"plugin:prettier/recommended",
11+
"prettier"
12+
],
13+
"plugins": ["@typescript-eslint", "prettier"],
14+
"rules": {
15+
"@typescript-eslint/naming-convention": "off",
16+
"@typescript-eslint/semi": "warn",
17+
"curly": "warn",
18+
"eqeqeq": "warn",
19+
"no-throw-literal": "warn",
20+
"semi": "off",
21+
"prettier/prettier": "warn"
22+
},
23+
"ignorePatterns": ["out", "dist", "**/*.d.ts"]
24+
}

‎.github/workflows/build.yml‎

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
name: test (${{ matrix.os }}, node-${{ matrix.node }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [windows-latest, ubuntu-latest, macos-latest]
18+
node: [18.x]
19+
runs-on: ${{ matrix.os }}
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
with:
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
- name: Use Node.js
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: ${{ matrix.config.node }}
29+
- name: Use Python
30+
uses: actions/setup-python@v4
31+
with:
32+
python-version: '3.x'
33+
- name: Restore CLI Binaries
34+
uses: actions/cache/restore@v3
35+
with:
36+
path: test-resources/cli-releases
37+
key: ${{ runner.os }}-cli-context-${{ hashFiles('src/test/cliContext.json') }}
38+
- name: Restore `directories.data` folder (CLI)
39+
uses: actions/cache/restore@v3
40+
with:
41+
path: test-resources/envs/cli
42+
key: ${{ runner.os }}-cli-env-${{ hashFiles('src/test/envs.cli.json') }}
43+
- name: Restore `directories.data` folder (Git)
44+
uses: actions/cache/restore@v3
45+
with:
46+
path: test-resources/envs/git
47+
key: ${{ runner.os }}-git-env-${{ hashFiles('src/test/envs.git.json') }}
48+
- name: Install Dependencies
49+
run: npm ci
50+
- name: Check Format
51+
run: npm run format && git diff --exit-code
52+
- name: Test
53+
uses: coactions/setup-xvfb@v1
54+
with:
55+
run: npm run test-all
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
- name: Store CLI Binaries
59+
uses: actions/cache/save@v3
60+
with:
61+
path: test-resources/cli-releases
62+
key: ${{ runner.os }}-cli-context-${{ hashFiles('src/test/cliContext.json') }}
63+
- name: Store `directories.data` folder (CLI)
64+
uses: actions/cache/save@v3
65+
with:
66+
path: test-resources/envs/cli
67+
key: ${{ runner.os }}-cli-env-${{ hashFiles('src/test/envs.cli.json') }}
68+
- name: Store `directories.data` folder (Git)
69+
uses: actions/cache/save@v3
70+
with:
71+
path: test-resources/envs/git
72+
key: ${{ runner.os }}-git-env-${{ hashFiles('src/test/envs.git.json') }}
73+
74+
release:
75+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
76+
runs-on: ubuntu-latest
77+
needs: [build]
78+
steps:
79+
- name: Checkout
80+
uses: actions/checkout@v3
81+
with:
82+
persist-credentials: false
83+
- name: Use Node.js
84+
uses: actions/setup-node@v1
85+
with:
86+
node-version: 18.x
87+
- name: Install Dependencies
88+
run: npm ci
89+
- name: Build
90+
run: npm run build
91+
- name: Release
92+
id: release
93+
run: npm run release
94+
env:
95+
GITHUB_TOKEN: ${{ secrets.ADMIN_TOKEN }}
96+
OVSX_PAT: ${{ secrets.OVSX_PAT }}
97+
outputs:
98+
release_version: ${{ steps.release.outputs.release_version }}

‎.github/workflows/pr-title.yml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Taken from stephenh/ts-proto. Thank you!
2+
# https://github.com/stephenh/ts-proto/blob/1f73bad91fe33c497d5168b9f0847ad596ffec39/.github/workflows/pr-title.yml
3+
name: PR Title
4+
5+
on:
6+
pull_request_target:
7+
types:
8+
- opened
9+
- reopened
10+
- edited
11+
- synchronize
12+
13+
jobs:
14+
validate:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: amannn/action-semantic-pull-request@v3.1.0
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎.gitignore‎

Lines changed: 4 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,7 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
lerna-debug.log*
8-
.pnpm-debug.log*
9-
10-
# Diagnostic reports (https://nodejs.org/api/report.html)
11-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12-
13-
# Runtime data
14-
pids
15-
*.pid
16-
*.seed
17-
*.pid.lock
18-
19-
# Directory for instrumented libs generated by jscoverage/JSCover
20-
lib-cov
21-
22-
# Coverage directory used by tools like istanbul
23-
coverage
24-
*.lcov
25-
26-
# nyc test coverage
27-
.nyc_output
28-
29-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30-
.grunt
31-
32-
# Bower dependency directory (https://bower.io/)
33-
bower_components
34-
35-
# node-waf configuration
36-
.lock-wscript
37-
38-
# Compiled binary addons (https://nodejs.org/api/addons.html)
39-
build/Release
40-
41-
# Dependency directories
42-
node_modules/
43-
jspm_packages/
44-
45-
# Snowpack dependency directory (https://snowpack.dev/)
46-
web_modules/
47-
48-
# TypeScript cache
49-
*.tsbuildinfo
50-
51-
# Optional npm cache directory
52-
.npm
53-
54-
# Optional eslint cache
55-
.eslintcache
56-
57-
# Optional stylelint cache
58-
.stylelintcache
59-
60-
# Microbundle cache
61-
.rpt2_cache/
62-
.rts2_cache_cjs/
63-
.rts2_cache_es/
64-
.rts2_cache_umd/
65-
66-
# Optional REPL history
67-
.node_repl_history
68-
69-
# Output of 'npm pack'
70-
*.tgz
71-
72-
# Yarn Integrity file
73-
.yarn-integrity
74-
75-
# dotenv environment variable files
76-
.env
77-
.env.development.local
78-
.env.test.local
79-
.env.production.local
80-
.env.local
81-
82-
# parcel-bundler cache (https://parceljs.org/)
83-
.cache
84-
.parcel-cache
85-
86-
# Next.js build output
87-
.next
881
out
89-
90-
# Nuxt.js build / generate output
91-
.nuxt
922
dist
93-
94-
# Gatsby files
95-
.cache/
96-
# Comment in the public line in if your project uses Gatsby and not Next.js
97-
# https://nextjs.org/blog/next-9-1#public-directory-support
98-
# public
99-
100-
# vuepress build output
101-
.vuepress/dist
102-
103-
# vuepress v2.x temp and cache directory
104-
.temp
105-
.cache
106-
107-
# Docusaurus cache and generated files
108-
.docusaurus
109-
110-
# Serverless directories
111-
.serverless/
112-
113-
# FuseBox cache
114-
.fusebox/
115-
116-
# DynamoDB Local files
117-
.dynamodb/
118-
119-
# TernJS port file
120-
.tern-port
121-
122-
# Stores VSCode versions used for testing VSCode extensions
3+
node_modules
1234
.vscode-test
124-
125-
# yarn v2
126-
.yarn/cache
127-
.yarn/unplugged
128-
.yarn/build-state.yml
129-
.yarn/install-state.gz
130-
.pnp.*
5+
*.vsix
6+
# binary releases of the Arduino CLI for testing and the `directories.data` folder for the tests
7+
test-resources

‎.prettierignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
out
2+
dist
3+
.vscode-test
4+
test-resources

‎.prettierrc.json‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"singleQuote": true,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"printWidth": 80,
6+
"endOfLine": "auto",
7+
"overrides": [
8+
{
9+
"files": "*.json",
10+
"options": {
11+
"tabWidth": 2
12+
}
13+
}
14+
]
15+
}

‎.vscode/extensions.json‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"dbaeumer.vscode-eslint",
4+
"amodio.tsl-problem-matcher",
5+
"streetsidesoftware.code-spell-checker"
6+
]
7+
}

‎.vscode/launch.json‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Run Extension",
6+
"type": "extensionHost",
7+
"request": "launch",
8+
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
9+
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
10+
"preLaunchTask": "${defaultBuildTask}"
11+
},
12+
{
13+
"name": "Extension Tests",
14+
"type": "extensionHost",
15+
"request": "launch",
16+
"args": [
17+
"--extensionDevelopmentPath=${workspaceFolder}",
18+
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
19+
],
20+
"env": {
21+
"NO_TEST_TIMEOUT": "true",
22+
"TEST_DEBUG": "espExceptionDecoder*"
23+
},
24+
"outFiles": [
25+
"${workspaceFolder}/out/**/*.js",
26+
"${workspaceFolder}/dist/**/*.js"
27+
],
28+
"preLaunchTask": "tasks: watch-tests"
29+
},
30+
{
31+
"name": "Extension Tests (Slow)",
32+
"type": "extensionHost",
33+
"request": "launch",
34+
"args": [
35+
"--extensionDevelopmentPath=${workspaceFolder}",
36+
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
37+
],
38+
"env": {
39+
"CLI_TEST_CONTEXT": "slow",
40+
"NO_TEST_TIMEOUT": "true",
41+
"TEST_DEBUG": "espExceptionDecoder*"
42+
},
43+
"outFiles": [
44+
"${workspaceFolder}/out/**/*.js",
45+
"${workspaceFolder}/dist/**/*.js"
46+
],
47+
"preLaunchTask": "tasks: watch-tests"
48+
}
49+
]
50+
}

‎.vscode/settings.json‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"files.exclude": {
3+
"out": false,
4+
"dist": false
5+
},
6+
"search.exclude": {
7+
"out": true,
8+
"dist": true
9+
},
10+
"typescript.tsc.autoDetect": "off",
11+
"typescript.tsdk": "./node_modules/typescript/lib",
12+
"editor.codeActionsOnSave": {
13+
"source.fixAll.eslint": true
14+
}
15+
}

0 commit comments

Comments
 (0)