Skip to content

Commit

Permalink
Merge pull request #57 from paulober/develop
Browse files Browse the repository at this point in the history
Major update v3
  • Loading branch information
paulober authored Apr 10, 2023
2 parents 9ee2de1 + 3ee1ca6 commit 59c5981
Show file tree
Hide file tree
Showing 78 changed files with 15,134 additions and 11,572 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
tab_width = 2
indent_style = space
indent_size = 2
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
24 changes: 21 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 11,
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/array-type": ["error", { "default": "array-simple" }],
"@typescript-eslint/consistent-type-imports": ["error", { "prefer": "type-imports" }],
"@typescript-eslint/explicit-function-return-type": ["error", { "allowExpressions": true }],
"@typescript-eslint/consistent-type-exports": "error",
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
Expand All @@ -18,7 +24,13 @@
"no-mixed-requires":"error",
"no-this-before-super": "warn",
"no-unreachable": "warn",
"no-unused-vars": "warn"
"no-unused-vars": "off",
"max-len": ["warn", { "code": 80, "comments": 100, "ignoreComments": false }],
"no-fallthrough": "warn",
"newline-before-return": "warn",
"no-return-await": "warn",
"arrow-body-style": ["error", "as-needed"],
"no-unexpected-multiline": "error"
},
"ignorePatterns": [
"out",
Expand All @@ -30,5 +42,11 @@
"es6": true,
"commonjs": true,
"browser": false
}
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier"
]
}
23 changes: 20 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
# Contributing

When contributing to this repository, please first discuss the change you wish to make via an issue, email, or any other method with the owners of this repository before making a change.
When contributing to this repository, please first discuss the change you wish to make via an issue with the owners of this repository before making a change.

::Please note we have a Code of Conduct, please follow it in all your interactions with the project.::

## Pull Request Process

1. Update the `README.md` with details of changes to the interface, this includes new environment variables, useful file locations and container parameters.
2. Increase the version numbers in any examples files and the `README.md` to the new version that this Pull Request would represent. The versioning scheme we use is [SemVer](https://semver.org).
### - NPM setup
In order to install `paulober/pyboard-serial-com` sub-package you first have configure npm. See ["Configuring npm for use with GitHub Package Registry."](https://help.github.com/en/articles/configuring-npm-for-use-with-github-package-registry#authenticating-to-github-package-registry)

### Repository setup
1. Fork the repository into your private account
2. Create a branch with following naming scheeme `fix-<issue-id>-<short-title-of-the-issue>`
3. Download your fork of the repository (Github.cli recommended)
4. `cd Pico-W-Go`
5. Switch to your newly created branch (`git checkout <branch-name>` for example)
6. `npm install`

Do changes and commits...

After the fix is complete DO some extensive testing if all what could be affected works without problems.

7. Now squash all your commits and name the final commit something like `Fix #<issue-id>, <Short title of the issue>`
- The description of the squash commit should contain a list (description) of all the changes you've made

8. Push and create a pull request to the develop branch of paulober/Pico-W-Go

## Code of Conduct

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,21 @@ jobs:
permissions:
actions: read
contents: read
packages: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript']
language: [ 'typescript', 'javascript']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

- run: sed -i '1i//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}' .npmrc

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
38 changes: 22 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,41 @@ on:
branches-ignore:
- "dependabot/**"
paths-ignore:
- "doc/**"
- ".idea/**"
- ".vscode/**"
- "**/*.md"
- ".prettierrc.json"
- "LICENSE"
- ".editorconfig"
- ".eslintrc.json"

permissions:
contents: read
packages: read

jobs:
build:
name: "Build ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
name: "Build ubuntu-latest"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "16.14.x"
registry-url: "https://npm.pkg.github.com"
scope: "@paulober"
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install Dependencies
shell: bash
run: |
npm install --no-audit
sed -i '1i//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}' .npmrc
npm ci --no-audit
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Package Extension
run: npx vsce package --no-yarn --dependencies -o picowgo-${{ github.sha }}.vsix

# Stop uploading artifacts for the basic build process
# - name: Upload VSIX
# #if: github.event_name == 'schedule'
# uses: actions/upload-artifact@v3
# with:
# name: picowgo-nightly.vsix
# path: ./picowgo-${{ github.sha }}.vsix
run: npx @vscode/vsce package --no-yarn -o picowgo-${{ github.sha }}.vsix
21 changes: 17 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
release:
types: [published]

permissions:
contents: read
deployments: write
packages: read

jobs:
release:
runs-on: ubuntu-22.04
Expand All @@ -13,14 +18,22 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: '16.14.x'
registry-url: "https://npm.pkg.github.com"
scope: "@paulober"
token: ${{ secrets.GITHUB_TOKEN }}

- run: npm install
name: NPM install
- name: NPM install
shell: bash
run: |
sed -i '1i//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}' .npmrc
npm ci --no-audit
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Package
run: npx vsce package --no-yarn --dependencies
run: npx @vscode/vsce package --no-yarn

- run: npx vsce publish --no-yarn --dependencies --target win32-x64 linux-x64 linux-arm64 linux-armhf darwin-x64 darwin-arm64
- run: npx @vscode/vsce publish --no-yarn --target win32-x64 win32-arm64 linux-x64 linux-arm64 linux-armhf darwin-x64 darwin-arm64
name: Publish
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# no compiled
out
dist
out/
dist/
# no dependencies
node_modules
.vscode-test/
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@paulober:registry=https://npm.pkg.github.com
10 changes: 10 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"semi": true,
"tabWidth": 2,
"useTabs": false,
"printWidth": 80,
"parser": "typescript",
"singleQuote": false,
"arrowParens": "avoid",
"bracketSameLine": true
}
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
"${workspaceFolder}/dist/**/*.cjs"
],
"preLaunchTask": "${defaultBuildTask}"
},
Expand Down
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@

// custom
"prettier.tabWidth": 2,
"prettier.singleQuote": true,
"prettier.singleQuote": false,
"prettier.useTabs": false,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"typescript.tsdk": "node_modules\\typescript\\lib"
}
1 change: 0 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
{
"type": "npm",
"script": "watch",
"problemMatcher": "$ts-webpack-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
Expand Down
12 changes: 7 additions & 5 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
.vscode/**
.vscode-test/**
.idea/**
out/**
# have to include node_modules because of external webpackmodules to
# be added by vsce package --dependencies
#node_modules/**
node_modules/**
src/**
.gitignore
.yarnrc
webpack.config.js
rollup.config.mjs
**/tsconfig.json
**/.eslintrc.json
**/*.map
**/*.ts

.github/**
patches/**
scripts/**

# instance files
Expand All @@ -23,3 +21,7 @@ azure-pipelines.yml

# other
*.vsix

!dist/*.cjs
!dist/scripts/*.py
dist/scripts/__pycache__
32 changes: 27 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,37 @@ All notable changes to the "pico-w-go" extension will be documented in this file
## Known issues
- Run current file does not include modules that are localy imported and in current workspace, unless you upload the python file containing the module via the upload file or project feature first. (since ever)
- CtrlCOnConnect settings does no rerender "Pico Disconnect" button correctly. Also does not enter repl correctly. Not impact on functionality just UI! (since v2.1.0)
- Some users have problems with stubs not linking into workspace after running "Configure Project". Maybe related to permission errors for symlink creation on these systems. As a workaround you can find a PowerShell script [here](https://github.com/paulober/Pico-W-Go/files/9651807/Configure-Project.zip) or in the repository contained folder called "scripts" named "Configure-Project.ps1". As an alternative often it does fix the issue by just running VS Code as an administrator (just to run the initial configure project command).
- Mounting virtual workspace causes existing vREPLs to freeze so they need to be disposed manually for some reason. (maybe cauaused by vscode)

---

## [Unreleased]
## [3.0.0] - 2023-04-10

- Remove telnet and unix socket interfaces as they are never used and unable to connect to any plain MicroPython Raspberry Pi Pico (W) board
- Mounting the MicroPython filesystem into VS Code as a remote workspace.
# Added
- Remote filesystem/workspace integration of the Pico (W) filesystem.
- A contributed/integrated __terminal profile__ for the Pico (W) REPL (open and closing does not affect the connection as long as you don't duplicated or open multiple vREPLs)

- `picowgo.switchPico` command to be able to chose between ports without having to deal with any config
- `picowgo.gcBeforeUpload` runs garbage collector before uploading files to free some memory for more stable uploads

# Changed
- `picowgo.syncFileTypes` settings datatype changed to `array`
- `picowgo.safeBootOnUpload` was renamed to `picowgo.gcBeforeUpload`
- NEW REQUIREMENT: [`pyserial`Python Pip package](https://pypi.org/project/pyserial/)
- Terminal behaviour is now a virtual REPL which can execute commands on the remote Pico (W) MicroPython REPL
- To enable the new remote workspace feature, a new queuing system between the serial port and the VSCode inputs had to be developed
to cope with the bottleneck of a *serial* connection. For stability reasons, I therefore do **not** recommend excessive multitasking with the features of the extension in conjunction with the Pico. It should work fine and also handle a large load, but you don't need to overuse it.
- Better detection for OS and hardware
- Improved stability for file transfers
- Updated stubs for 'Firmware v1.19.1-1009 nightly'
- Shrunk extension file size because it's not required to bundle serialport package anymore within the extn

# Removed
- `ctrlCOnConnect` setting, because its now the default
- FTP-Server, it was deprecated had security vulnarabilities and some users reported problems using it
- Cut many other dependencies

---

## [2.1.8] - 2023-03-04

Expand Down
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Contributing

## Install and setup

### - NPM setup
In order to install `paulober/pyboard-serial-com` sub-package you first have configure npm. See ["Configuring npm for use with GitHub Package Registry."](https://help.github.com/en/articles/configuring-npm-for-use-with-github-package-registry#authenticating-to-github-package-registry)

### - Project setup
- Fork the repository into your private account
- Create a branch with following naming scheeme `fix-<issue-id>-<short-title-of-the-issue>`
- Download your fork of the repository (Github.cli recommended)
- `cd Pico-W-Go`
- Switch to your newly created branch (`git checkout <branch-name>` for example)
- `npm install`

Do changes and commits...

After the fix is complete do some extensive testing if all what could be affected works without problems.

- Now squash all your commits and name the final commit something like `Fix #<issue-id>, <Short title of the issue>`
- The description of the squash commit should contain a list (description) of all the changes you've made

- Push and create a pull request to the develop branch of paulober/Pico-W-Go
Loading

0 comments on commit 59c5981

Please sign in to comment.