Skip to content

Commit f8c79dd

Browse files
committed
Hotfix 4.3.2
Signed-off-by: paulober <[email protected]>
1 parent 9aa67f8 commit f8c79dd

File tree

7 files changed

+274
-214
lines changed

7 files changed

+274
-214
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ All notable changes to the "MicroPico" extension will be documented in this file
1010

1111
---
1212

13+
## [4.3.2] - 2025-09-24
14+
15+
### Changed
16+
- Updated dependencies
17+
- Add support for Pico 2 W auto firmeware install
18+
19+
## [4.3.1] - 2025-09-24
1320
## [4.3.0] - 2025-09-06
1421

1522
### Added

package-lock.json

Lines changed: 195 additions & 188 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "pico-w-go",
33
"displayName": "MicroPico",
44
"description": "Auto-completion, remote workspace and a REPL console integration for the Raspberry Pi Pico boards running MicroPython firmware.",
5-
"version": "4.3.1",
5+
"version": "4.3.2",
66
"publisher": "paulober",
77
"license": "MPL-2.0",
88
"homepage": "https://github.com/paulober/MicroPico#readme",
@@ -646,8 +646,8 @@
646646
"scripts": {
647647
"vscode:uninstall": "node ./dist/vscodeUninstall.mjs",
648648
"vscode:prepublish": "npm run package",
649-
"postinstall": "patch-package && python3 -m pip install -U micropython-rp2-rpi_pico2_w-stubs==1.26.* --target ./mpy_stubs --no-user",
650-
"cp-prebuilds": "cp -r node_modules/@serialport/bindings-cpp/prebuilds ./prebuilds",
649+
"postinstall": "patch-package && node ./scripts/postinstall.js",
650+
"cp-prebuilds": "node -e \"const fs=require('fs');fs.rmSync('prebuilds',{recursive:true,force:true});fs.cpSync('node_modules/@serialport/bindings-cpp/prebuilds','prebuilds',{recursive:true});\"",
651651
"compile-uninstaller": "rollup -c uninstall.rollup.config.mjs --environment BUILD:production",
652652
"compile": "rollup -c && npm run compile-uninstaller",
653653
"watch": "npm run cp-prebuilds && rollup -cw",
@@ -660,7 +660,7 @@
660660
"test": "node ./out/test/runTest.js"
661661
},
662662
"devDependencies": {
663-
"@eslint/js": "^9.35.0",
663+
"@eslint/js": "^9.36.0",
664664
"@rollup/plugin-commonjs": "^28.0.6",
665665
"@rollup/plugin-json": "^6.1.0",
666666
"@rollup/plugin-node-resolve": "^16.0.1",
@@ -671,29 +671,28 @@
671671
"@types/fs-extra": "^11.0.4",
672672
"@types/lodash": "^4.17.20",
673673
"@types/node": "^20.19",
674-
"@types/uuid": "^10.0.0",
675674
"@types/vscode": "^1.99.1",
676675
"@types/which": "^3.0.4",
677676
"@vscode/test-electron": "^2.5.2",
678-
"eslint": "^9.35.0",
677+
"eslint": "^9.36.0",
679678
"eslint-config-prettier": "^10.1.8",
680679
"patch-package": "^8.0.0",
681-
"rollup": "^4.50.0",
680+
"rollup": "^4.52.2",
682681
"rollup-plugin-copy": "^3.5.0",
683682
"tslib": "^2.8.1",
684683
"typescript": "^5.9.2",
685-
"typescript-eslint": "^8.42.0"
684+
"typescript-eslint": "^8.44.1"
686685
},
687686
"dependencies": {
688687
"@paulober/pico-mpy-com": "^1.0.23",
689688
"@vscode/python-extension": "^1.0.6",
690-
"axios": "^1.12.0",
691-
"fs-extra": "^11.3.1",
689+
"axios": "^1.12.2",
690+
"fs-extra": "^11.3.2",
692691
"lodash": "^4.17.21",
693692
"rimraf": "^6.0.1",
694-
"undici": "^6.21.1",
695-
"uuid": "^11.1.0",
693+
"undici": "^7.16.0",
694+
"uuid": "^13.0.0",
696695
"which": "^5.0.0"
697696
},
698-
"packageManager": "npm@10.8.3+sha512.d08425c8062f56d43bb8e84315864218af2492eb769e1f1ca40740f44e85bd148969382d651660363942e5909cb7ffcbef7ca0ae963ddc2c57a51243b4da8f56"
697+
"packageManager": "npm@11.6.0+sha512.77f3fb0dbbd881835d7bd1217deabdf7ed77fc4ec4f363df64fc3cb986404abf6c437661041080f5c5d225103508e7c9ea30cb2742b7e942675d05a10af2d7b9"
699698
}

scripts/package.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# Define an array of platforms
4-
platforms=("win32-x64" "darwin-x64+arm64" "linux-arm64" "linux-arm" "linux-x64" "universal")
4+
platforms=("win32-x64" "win32-arm64" "darwin-x64+arm64" "linux-arm64" "linux-arm" "linux-x64" "universal")
55
rm -rf dist
66

77
# Loop through the platforms
@@ -20,6 +20,8 @@ for platform in "${platforms[@]}"; do
2020
# Package the VSCode extension for the platform
2121
if [ "$platform" == "win32-x64" ]; then
2222
npx @vscode/vsce package --no-yarn --target "win32-x64" -o "micropico-$RELEASE_TAG_NAME-$platform.vsix"
23+
elif [ "$platform" == "win32-arm64" ]; then
24+
npx @vscode/vsce package --no-yarn --target "win32-arm64" -o "micropico-$RELEASE_TAG_NAME-$platform.vsix"
2325
elif [ "$platform" == "darwin-x64+arm64" ]; then
2426
npx @vscode/vsce package --no-yarn -o "micropico-$RELEASE_TAG_NAME-$platform.vsix"
2527
elif [ "$platform" == "linux-arm64" ]; then

scripts/postinstall.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env node
2+
import { spawnSync } from "node:child_process";
3+
import { existsSync, mkdirSync } from "node:fs";
4+
5+
const PKG = "micropython-rp2-rpi_pico2_w-stubs==1.26.*";
6+
const TARGET = "./mpy_stubs";
7+
8+
if (!existsSync(TARGET)) mkdirSync(TARGET, { recursive: true });
9+
10+
const candidates = [];
11+
if (process.env.PYTHON) candidates.push(process.env.PYTHON);
12+
if (process.platform === "win32") {
13+
candidates.push("py -3", "py", "python", "python3");
14+
} else {
15+
candidates.push("python3", "python");
16+
}
17+
18+
function findPython() {
19+
for (const c of candidates) {
20+
const [exe, ...pre] = c.split(" ");
21+
// has pip?
22+
let r = spawnSync(exe, [...pre, "-m", "pip", "--version"], { encoding: "utf8" });
23+
if (r.status !== 0) continue;
24+
// is Python 3?
25+
r = spawnSync(exe, [...pre, "-c", "import sys; print(sys.version_info.major)"], { encoding: "utf8" });
26+
if (r.status !== 0 || String(r.stdout).trim() !== "3") continue;
27+
return { exe, pre };
28+
}
29+
return null;
30+
}
31+
32+
const py = findPython();
33+
if (!py) {
34+
console.warn("[postinstall] No usable Python 3 with pip found. Tried:", candidates.join(", "));
35+
console.warn('Install Python 3 and ensure it is on PATH (Windows: the "py" launcher is recommended).');
36+
process.exit(0); // change to 1 if you want to fail the install
37+
}
38+
39+
const args = [...py.pre, "-m", "pip", "install", "-U", PKG, "--target", TARGET, "--no-user"];
40+
const run = spawnSync(py.exe, args, { stdio: "inherit" });
41+
if (run.status !== 0) {
42+
console.error("[postinstall] pip install failed.");
43+
process.exit(run.status ?? 1);
44+
}

src/downloadFirmware.mts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export enum SupportedFirmwareTypes {
77
pico,
88
picow,
99
pico2,
10+
pico2w,
1011
}
1112

1213
function firmwareTypeToDownloadURL(
@@ -19,6 +20,8 @@ function firmwareTypeToDownloadURL(
1920
return "https://micropython.org/download/RPI_PICO_W/";
2021
case SupportedFirmwareTypes.pico2:
2122
return "https://micropython.org/download/RPI_PICO2/";
23+
case SupportedFirmwareTypes.pico2w:
24+
return "https://micropython.org/download/RPI_PICO2_W/";
2225
}
2326
}
2427

src/flash.mts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -218,18 +218,14 @@ export async function flashPicoInteractively(
218218

219219
let wirelessFirmware = false;
220220

221-
// if the type is RP2040 ask if the user wants to flash Wireless firmware or not
222-
// else just flash the non wireless firmware for the other boards
223-
if (device?.is2040) {
224-
const flashWireless = await window.showInformationMessage(
225-
"Do you want to flash the Wireless firmware?",
226-
"Yes",
227-
"No"
228-
);
221+
const flashWireless = await window.showInformationMessage(
222+
"Do you want to flash the Wireless firmware?",
223+
"Yes",
224+
"No"
225+
);
229226

230-
if (flashWireless === "Yes") {
231-
wirelessFirmware = true;
232-
}
227+
if (flashWireless === "Yes") {
228+
wirelessFirmware = true;
233229
}
234230

235231
let firmwareType: SupportedFirmwareTypes | undefined;
@@ -242,7 +238,9 @@ export async function flashPicoInteractively(
242238
break;
243239

244240
case "RP2350":
245-
firmwareType = SupportedFirmwareTypes.pico2;
241+
firmwareType = wirelessFirmware
242+
? SupportedFirmwareTypes.pico2w
243+
: SupportedFirmwareTypes.pico2;
246244
break;
247245
}
248246

0 commit comments

Comments
 (0)