Skip to content
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

Few extension improvments and fix #41

Merged
merged 12 commits into from
May 30, 2024
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
69 changes: 69 additions & 0 deletions .github/workflows/build_and_functional_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Build, Lint and run functional tests

# This workflow will Lint, Build and then Run tests.

on:
workflow_dispatch:
push:
branches:
- main
pull_request:

jobs:
Build:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Install dependencies
run: sudo apt update && sudo apt install -qy eslint
if: runner.os == 'Linux'

- name: Clone
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: node

- name: Packages installation
run: npm install

- name: Compile
run: npm run compile

- name: Linter
if: runner.os == 'Linux'
run: npm run lint

- name: Test
if: runner.os == 'Linux'
run: xvfb-run -a npm test

- name: Test
if: runner.os != 'Linux'
run: npm test

Build_Windows:
runs-on: windows-latest

steps:
- name: Clone
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: node

- name: Packages installation
run: cmd.exe /c npm.cmd install

- name: Compile
run: cmd.exe /c npm.cmd run compile

- name: Test
run: cmd.exe /c npm.cmd test
25 changes: 25 additions & 0 deletions .github/workflows/misspellings_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Misspellings checks

# This workflow performs some misspelling checks on the repository

on:
workflow_dispatch:
push:
branches:
- main
pull_request:

jobs:
misspell:
name: Check misspellings
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v4

- name: Check misspellings
uses: codespell-project/actions-codespell@v2
with:
builtin: clear,rare
check_filenames: true
skip: package-lock.json
64 changes: 64 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Publish Extension

# This workflow publish the extension when a new tag is pushed

on:
push:
tags:
- '*'

jobs:
check_tag:
name: Check triggering tag
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Clone
uses: actions/checkout@v4

- name: Verify the tag
run: |
git fetch -aptf
git tag -v ${{ github.ref_name }}

check_changelog:
name: Check changelog versions
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Clone
uses: actions/checkout@v4

- name: Get CHANGELOG version
run: |
echo "CHANGELOG_VERSION=$(grep -Po '(?<=## \[)(\d\.)+[^\]]' CHANGELOG.md | head -n 1)" >> "$GITHUB_ENV"

- name: Check tag version against CHANGELOG version
if: startsWith(github.ref, 'refs/tags/')
run: |
if [ "${{ github.ref_name }}" != "${CHANGELOG_VERSION}" ]; then
echo "Tag '${{ github.ref_name }}' and CHANGELOG '${CHANGELOG_VERSION}' versions mismatch!"
exit 1
fi

publish:
name: Publish the extension
runs-on: ubuntu-latest
needs: [check_tag, check_changelog]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Clone
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: node

- name: Packages installation
run: npm install @vscode/vsce --save-dev

- name: Publish to Visual Studio Marketplace
run: npm deploy
env:
pat: ${{ secrets.VSCE_PAT }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules/
dist/
dist/
11 changes: 11 additions & 0 deletions .mdl.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Style file for mdl
# https://github.com/markdownlint/markdownlint/blob/main/docs/creating_styles.md

# Include all rules
all

# Disable specific rules
#exclude_rule 'MD012'

# Update rules configuration
rule 'MD013', :line_length => 120
15 changes: 15 additions & 0 deletions .mdlrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# markdownlint config file

# Use custom style file
style "#{File.dirname(__FILE__)}/.mdl.rb"

# MD002 - First header in file should be a top level header
# MD005 - Inconsistent indentation for list items at the same level
# MD007 - Unordered list indentation
# MD014 - Dollar signs used before commands without showing output
# MD024 - Multiple headers with the same content
# MD029 - Ordered list item prefix
# MD033 - Inline HTML
# MD041 - First line in file should be a top level header
# MD046 - Code block style
rules "~MD002,~MD005,~MD007,~MD014,~MD024,~MD029,~MD033,~MD041,~MD046"
44 changes: 44 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# To install hooks, run:
# pre-commit install --hook-type pre-commit
# pre-commit install --hook-type commit-msg

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
- id: check-added-large-files
- id: check-merge-conflict
- id: check-case-conflict

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
# args: ['--ignore-words-list', 'ontop,shft,hte', '--skip', 'makefile_conf/chain/*,tests/ragger/eip712_input_files/*']
args: ['--skip', 'package-lock.json']

- repo: https://github.com/Mateusz-Grzelinski/actionlint-py
rev: v1.6.27.13
hooks:
- id: actionlint
types_or: [yaml]
args: [-shellcheck='' -pyflakes='']

- repo: https://github.com/markdownlint/markdownlint
rev: v0.12.0
hooks:
- id: markdownlint
types_or: [markdown]

- repo: https://github.com/pre-commit/mirrors-eslint
rev: v9.2.0
hooks:
- id: eslint
types_or: [javascript, jsx, ts, tsx]
args: ['--config=./.eslintrc.json']
additional_dependencies: [
'[email protected]'
]
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
}
}
32 changes: 29 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.7.0]

### Changed

* Update `webpack` and `electron` versions and dependencies
* Update `KeepTerminal` to also include `Load app on device` and `Delete app from device`

### Added

* Start `Update Container` task in background
* 1st CI workflows to perform:
* Spelling check
* Build / Lint / Test (Fix _Add CI with some checks and publishing mechanism_ [#10](https://github.com/LedgerHQ/ledger-vscode-extension/issues/10))
* Deploy (when a new tag is pushed)
* Export the chosen device when opening the terminal (Fix _Export currently chosen device when opening the terminal_ [#15](https://github.com/LedgerHQ/ledger-vscode-extension/issues/15))
* Add function to properly retrieve the `APPNAME`, using `make listinfo` (Fix Improve App detection [#40](https://github.com/LedgerHQ/ledger-vscode-extension/issues/40))
* Add _build use case_ feature, allowing to build selecting a use case defined in the manifest
(Fix _Add an easy way to build with flags_ [#14](https://github.com/LedgerHQ/ledger-vscode-extension/issues/14))
* Add _build variant_ feature, allowing to build a specific **variant**
(Fix _Add an easy way to build with flags_ [#14](https://github.com/LedgerHQ/ledger-vscode-extension/issues/14))
* Save the selected target device in settings (Fix _Memorize target device when VS Code is quit_ [#39](https://github.com/LedgerHQ/ledger-vscode-extension/issues/39))

## [0.6.1]

### Fixed
Expand Down Expand Up @@ -41,7 +63,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

* New setting to allow / deny device operations on Nano X (denied by default).
* Support parsing of `test.dependencies` fields from the [app manifest specification](https://github.com/LedgerHQ/ledgered/blob/master/doc/utils/manifest.md). Speed up the setup for running functional tests by automating the clone/build of tests dependencies when needed.
* Support parsing of `test.dependencies` fields from the [app manifest specification](https://github.com/LedgerHQ/ledgered/blob/master/doc/utils/manifest.md).
Speed up the setup for running functional tests by automating the clone/build of tests dependencies when needed.
* Add button to rebuild test dependencies (if any) in treeview.

### Changed
Expand All @@ -51,7 +74,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

* Replace TOML parsing package (previous one couldn't parse 1.0.0 TOML)
* Update Udev rules for sideloading following hidapi python package update. Display warning message when rules need to be updated.
* Update Udev rules for sideloading following hidapi python package update.
Display warning message when rules need to be updated.
* Wording in some tree view items.

## [0.4.0]
Expand Down Expand Up @@ -121,7 +145,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* Add support for Rust apps (no sideloading yet).
* Add welcome view when no app folder is detected in the workspace.
* Dynamic tasks list : disable functional tests tasks when no `conftest.py` file is found or if task is not defined for app language.
* Dynamic tasks list : disable functional tests tasks when no `conftest.py` file is found
or if task is not defined for app language.

### Fixed

Expand Down Expand Up @@ -200,6 +225,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Add multi-folder workspace support. User can now choose which app to build from a quickpick menu.

## [0.0.4] - 2023-07-04

### Added
Expand Down
Loading
Loading