Skip to content

Commit

Permalink
Merge pull request #148 from paulober/develop
Browse files Browse the repository at this point in the history
Patch v3.4.0
  • Loading branch information
paulober authored Oct 18, 2023
2 parents 9a222c5 + 96e389d commit 93ad410
Show file tree
Hide file tree
Showing 103 changed files with 184 additions and 12,483 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
paths-ignore:
- ".idea/**"
- ".vscode/**"
- "scripts/**"
- "**/*.md"
- ".prettierrc.json"
- "LICENSE"
Expand All @@ -24,17 +25,22 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

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

- name: Setup Python v3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install Dependencies
- name: Install NPM Dependencies And Download Stubs
shell: bash
run: |
sed -i '1i//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}' .npmrc
Expand All @@ -43,4 +49,4 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Package Extension
run: npx @vscode/vsce package --no-yarn -o pico-w-go-${{ github.sha }}.vsix
run: npx @vscode/vsce package --no-yarn -o micropico-${{ github.sha }}.vsix
25 changes: 14 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,41 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4

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

- name: NPM install
- name: Setup Python v3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install NPM dependencies And Download Stubs
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 }}

# not needed because of publish
- name: Package
run: npx @vscode/vsce package --no-yarn

- run: npx @vscode/vsce publish --no-yarn --target win32-x64 linux-x64 linux-arm64 darwin-x64 darwin-arm64
name: Publish
- name: Publish
run: ./scripts/publish.sh
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}

- name: Upload artifact
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: Visual Studio Code extension package
path: pico-w-go-*.vsix

- name: Upload artifact to release
- name: Upload Artifact To Release
#gh api --method POST -H "Accept: application/vnd.github+json" /repos/paulober/Pico-W-Go/releases/$RELEASE_ID/assets
run: gh release upload $RELEASE_TAG_NAME pico-w-go-*.vsix
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -478,3 +478,4 @@ fabric.properties
# End of https://www.toptal.com/developers/gitignore/api/node,python,webstorm,visualstudiocode,macos

*.zip
mpy_stubs/
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ azure-pipelines.yml
!dist/*.cjs
!dist/scripts/*.py
dist/scripts/__pycache__
!mpy_stubs/
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ All notable changes to the "MicroPico" extension will be documented in this file

---

## [3.4.0] - 2023-10-18

# Changed
- Reduced extension size on some platforms
- Upgraded to `pyboard-serial-com` `v2.0.2`
- Replaced `Pico-W-Stub` with [micropython-stubs](https://github.com/Josverl/micropython-stubs) for MicroPython v1.20.0 (Thanks to @Josverl)
- Added `.ls` and `.help` custom commands to vREPL

## [3.3.3] - 2023-10-16

# Changed
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

"MicroPico" is a Visual Studio Code extension designed to simplify and accelerate the development of MicroPython projects for the Raspberry Pi Pico and Pico W boards. This tool streamlines the coding process, providing code highlighting, auto-completion, code snippets, and project management features, all tailored for the seamless development experience with MicroPython on Raspberry Pi Pico and Pico W microcontrollers.

> __Auto-completion based on Raspberry Pi Pico W MicroPython firmware: [RPI_PICO_W-20231005-v1.21.0.uf2](https://micropython.org/resources/firmware/RPI_PICO_W-20231005-v1.21.0.uf2)__
> __Auto-completion based on Raspberry Pi Pico W MicroPython firmware: [RPI_PICO_W-20230426-v1.20.0.uf2](https://micropython.org/resources/firmware/RPI_PICO_W-20230426-v1.20.0.uf2) from the [micropython-stubs project](https://github.com/Josverl/micropython-stubs)__
> NOTE: Support for MPY v1.21.0 will be added in the next few days.
Works with:
| Platform | x64 | arm64 |
Expand All @@ -13,7 +14,7 @@ Works with:

## Features

- Auto-completion and docs
- Auto-completion with docs
- Pseudo terminal integration for communication with MicroPython REPL on a Pico (w) board (with support for tab-completion)
- Running / Transferring files to / from your board
- Built-in virtual-workspace provider for Raspberry Pi Pico (W) boards
Expand Down
19 changes: 10 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pico-w-go",
"displayName": "MicroPico",
"description": "Auto-completion, remote workspace and a REPL console integration for the Raspberry Pi Pico (W) with MicroPython firmware.",
"version": "3.3.3",
"version": "3.4.0",
"publisher": "paulober",
"license": "MPL-2.0",
"homepage": "https://github.com/paulober/MicroPico/blob/main/README.md",
Expand Down Expand Up @@ -493,6 +493,7 @@
"scripts": {
"vscode:uninstall": "node ./dist/vscodeUninstall.mjs",
"vscode:prepublish": "npm run package",
"postinstall": "python3 -m pip install -U micropython-rp2-pico_w-stubs --target ./mpy_stubs --no-user",
"compile-uninstaller": "rollup -c uninstall.rollup.config.mjs",
"compile": "rollup -c && npm run compile-uninstaller",
"watch": "rollup -cw",
Expand Down Expand Up @@ -526,7 +527,7 @@
"typescript": "^5.2.2"
},
"dependencies": {
"@paulober/pyboard-serial-com": "^2.0.1",
"@paulober/pyboard-serial-com": "^2.0.2",
"fs-extra": "^11.1.1",
"lodash": "^4.17.21",
"rimraf": "^5.0.5",
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default {
'vscode',
],
plugins: [
copy({
!isProduction && copy({
targets: [
{
src: 'node_modules/@paulober/pyboard-serial-com/scripts',
Expand Down
41 changes: 41 additions & 0 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

# This script's purpose is to publish the VSCode extension to the VSCode Marketplace
# and package binaries for each platform to reduced vsix size

# Run npm run package
npm run package

# Create a folder dist/scripts if it doesn't exist
mkdir -p dist/scripts

# Define an array of platforms
platforms=("win32" "macOS_arm64" "macOS_amd64" "linux_arm64" "linux_amd64")

# Loop through the platforms
for platform in "${platforms[@]}"; do
# Copy the scripts to dist/scripts for each platform
cp -r "node_modules/@paulober/pyboard-serial-com/scripts/wrapper_$platform" "dist/scripts"

# Package the VSCode extension for the platform
if [ "$platform" == "win32" ]; then
npx @vscode/vsce package --no-yarn --target "win32-x64"
elif [ "$platform" == "macOS_arm64" ]; then
npx @vscode/vsce package --no-yarn --target "darwin-arm64"
elif [ "$platform" == "macOS_amd64" ]; then
npx @vscode/vsce package --no-yarn --target "darwin-x64"
elif [ "$platform" == "linux_arm64" ]; then
npx @vscode/vsce package --no-yarn --target "linux-arm64"
elif [ "$platform" == "linux_amd64" ]; then
npx @vscode/vsce package --no-yarn --target "linux-x64"
fi

# Remove the copied scripts for the current platform
rm -r "dist/scripts/wrapper_$platform"
done

# Find all .vsix files and join them into a space-separated string
package_paths=$(find . -name "*.vsix" -type f -exec echo -n "{} " \;)

# Publish the packages
npx @vscode/vsce publish --packagePath "$package_paths"
2 changes: 1 addition & 1 deletion src/activator.mts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default class Activator {
(result as PyOutCommandWithResponse).response +
"\x1b[0m" +
'Type "help()" for more information or ' +
".cls/.clear to clear the terminal." +
".help for custom vREPL commands." +
"\r\n".repeat(2)
);
}
Expand Down
Loading

0 comments on commit 93ad410

Please sign in to comment.