Skip to content

feat: adjust to new debug -I -P format in #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
ignorePatterns: ['node_modules/*', '.github/*', '**/lib/*', '**/dist/*'],
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'plugin:prettier/recommended',
'prettier', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
],
plugins: ['prettier', 'unused-imports'],
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-empty-interface': 'warn',
'no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
eqeqeq: ['error', 'smart'],
'guard-for-in': 'off',
'id-blacklist': 'off',
'id-match': 'off',
'no-underscore-dangle': 'off',
'no-unused-expressions': 'off',
'no-var': 'error',
radix: 'error',
'prettier/prettier': 'warn',
},
};
18 changes: 0 additions & 18 deletions .eslintrc.json

This file was deleted.

39 changes: 30 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,40 @@ on:
branches:
- main

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: '18.17'

jobs:
build:
runs-on: ubuntu-latest
name: Build (${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Node.js 12.x
uses: actions/setup-node@v1
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "12.x"
registry-url: "https://registry.npmjs.org"
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'

- name: Build VS Code Extension
run: |
yarn
- name: Install dependencies
run: yarn
# Fails if the generated schema is not under version control
- name: Check schema
run: yarn generate && git status -s && git diff --exit-code
# Linux tests need a DISPLAY
- name: Test
if: runner.os == 'Linux'
run: xvfb-run yarn test-all
- name: Test
if: runner.os != 'Linux'
run: yarn test-all
- name: Package
run: yarn package
32 changes: 20 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,35 @@ name: Deploy
on:
push:
tags:
- "*"
- '*'
workflow_dispatch:
branches:
- main

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: '18.17'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Node.js 12.x
uses: actions/setup-node@v1
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "12.x"
registry-url: "https://registry.npmjs.org"
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'

- name: Build VS Code Extension
run: |
yarn
- name: Install dependencies
run: yarn
- name: Test
run: yarn test
- name: Package
run: yarn package

- name: Upload VS Code Extension [GitHub Actions]
uses: actions/upload-artifact@v2
Expand All @@ -34,9 +42,9 @@ jobs:
- name: Upload VS Code Extension [S3]
uses: docker://plugins/s3
env:
PLUGIN_SOURCE: "build-artifacts/*"
PLUGIN_STRIP_PREFIX: "build-artifacts/"
PLUGIN_TARGET: "/vscode-arduino-tools"
PLUGIN_SOURCE: 'build-artifacts/*'
PLUGIN_STRIP_PREFIX: 'build-artifacts/'
PLUGIN_TARGET: '/vscode-arduino-tools'
PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
22 changes: 11 additions & 11 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ name: Sync Labels
on:
push:
paths:
- ".github/workflows/sync-labels.ya?ml"
- ".github/label-configuration-files/*.ya?ml"
- '.github/workflows/sync-labels.ya?ml'
- '.github/label-configuration-files/*.ya?ml'
pull_request:
paths:
- ".github/workflows/sync-labels.ya?ml"
- ".github/label-configuration-files/*.ya?ml"
- '.github/workflows/sync-labels.ya?ml'
- '.github/label-configuration-files/*.ya?ml'
schedule:
# Run daily at 8 AM UTC to sync with changes to shared label configurations.
- cron: "0 8 * * *"
- cron: '0 8 * * *'
workflow_dispatch:
repository_dispatch:

Expand All @@ -27,11 +27,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Download JSON schema for labels configuration file
id: download-schema
uses: carlosperate/download-file-action@v1
uses: carlosperate/download-file-action@v2
with:
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json
location: ${{ runner.temp }}/label-configuration-schema
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:

steps:
- name: Download
uses: carlosperate/download-file-action@v1
uses: carlosperate/download-file-action@v2
with:
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }}

Expand Down Expand Up @@ -106,16 +106,16 @@ jobs:
echo "::set-output name=flag::--dry-run"

- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Download configuration files artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
path: ${{ env.CONFIGURATIONS_FOLDER }}

- name: Remove unneeded artifact
uses: geekyeggo/delete-artifact@v1
uses: geekyeggo/delete-artifact@v2
with:
name: ${{ env.CONFIGURATIONS_ARTIFACT }}

Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.DS_Store
node_modules/
lib/
bin/
dist/
build-artifacts/
# build-artifacts/
.tests/
.vscode-test
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
lib
dist
.vscode-test
.tests
15 changes: 15 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"singleQuote": true,
"tabWidth": 2,
"useTabs": false,
"printWidth": 80,
"endOfLine": "auto",
"overrides": [
{
"files": "*.json",
"options": {
"tabWidth": 2
}
}
]
}
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"amodio.tsl-problem-matcher",
"streetsidesoftware.code-spell-checker"
]
}
42 changes: 35 additions & 7 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,47 @@
"version": "0.2.0",
"configurations": [
{
"name": "Launch Arduino Tools – VS Code Extension",
"name": "Run",
"type": "extensionHost",
"request": "launch",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
},
{
"name": "Tests",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/lib/test/suite/index"
],
"env": {
"NO_TEST_TIMEOUT": "true"
},
"outFiles": [
"${workspaceFolder}/lib/**/*.js",
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "tasks: watch-tests"
},
{
"name": "Slow Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}"
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/lib/test/suite/index"
],
"stopOnEntry": false,
"sourceMaps": true,
"env": {
"NO_TEST_TIMEOUT": "true",
"TEST_CONTEXT": "slow"
},
"outFiles": [
"${workspaceRoot}/lib/**/*.js"
"${workspaceFolder}/lib/**/*.js",
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "npm"
"preLaunchTask": "tasks: watch-tests"
}
]
}
19 changes: 5 additions & 14 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
{
"tslint.configFile": "./tslint.json",
"files.exclude": {
"**/lib": false
},
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"[typescript]": {
"editor.tabSize": 4
},
"[json]": {
"editor.tabSize": 2
},
"[jsonc]": {
"editor.tabSize": 2
},
"files.insertFinalNewline": true,
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsc.autoDetect": "off",
"typescript.tsdk": "node_modules/typescript/lib",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
39 changes: 32 additions & 7 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,35 @@
{
"version": "2.0.0",
"command": "npm",
"args": [
"run",
"compile"
],
"isBackground": true,
"problemMatcher": "$tsc-watch"
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$ts-webpack-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "watch-tests",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": "build"
},
{
"label": "tasks: watch-tests",
"dependsOn": ["npm: watch", "npm: watch-tests"],
"problemMatcher": []
}
]
}
Loading