File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 130130 }
131131 },
132132 "scripts" : {
133- "vscode:prepublish" : " pnpm run bundle-deps && pnpm run package" ,
133+ "vscode:prepublish" : " pnpm run sync-node-deps && pnpm run bundle-deps && pnpm run package" ,
134134 "compile" : " pnpm run check-types && node build.js" ,
135135 "watch" : " concurrently \" pnpm run watch:esbuild\" \" pnpm run watch:tsc\" " ,
136136 "watch:esbuild" : " node build.js --watch" ,
139139 "vsix" : " pnpm run vscode:prepublish && npx @vscode/vsce package --no-dependencies" ,
140140 "check-types" : " tsc --noEmit -p ./" ,
141141 "bundle-deps" : " ./scripts/bundle-deps" ,
142+ "sync-node-deps" : " ./scripts/sync-node-deps" ,
142143 "lint" : " eslint ." ,
143144 "lint:fix" : " eslint . --fix" ,
144145 "format" : " prettier --write ." ,
163164 "dependencies" : {
164165 "@wasm-fmt/ruff_fmt" : " ^0.9.0" ,
165166 "prettier" : " ^3.6.2" ,
166- "prettier-plugin-pywire" : " git+https:// github.com/ pywire/prettier-plugin-pywire.git " ,
167+ "prettier-plugin-pywire" : " github: pywire/prettier-plugin-pywire#main " ,
167168 "vscode-languageclient" : " ^9.0.1" ,
168169 "web-tree-sitter" : " ^0.26.3"
169170 }
Original file line number Diff line number Diff line change 1+ #! /bin/sh -e
2+
3+ # This script ensures that prettier-plugin-pywire is pinned to the correct version
4+ # (tag for release, main for development/nightly).
5+
6+ REPO_URL=" https://github.com/pywire/prettier-plugin-pywire.git"
7+
8+ get_latest_tag () {
9+ # Get the latest tag matching v* sorted by version number
10+ TAG=$( git ls-remote --tags --sort=' v:refname' " $REPO_URL " ' refs/tags/v*' | tail -n1 | sed ' s|.*refs/tags/||' )
11+ if [ -z " $TAG " ]; then
12+ echo " main"
13+ else
14+ echo " $TAG "
15+ fi
16+ }
17+
18+ if [ " $PYWIRE_RELEASE " = " 1" ]; then
19+ echo " Release mode detected for Node dependencies. Fetching latest tag..."
20+ REF=$( get_latest_tag)
21+ echo " Using prettier-plugin-pywire@$REF "
22+ else
23+ REF=" main"
24+ echo " Dev/CI mode. Using prettier-plugin-pywire@main"
25+ fi
26+
27+ # Check current version in package.json to avoid unnecessary pnpm add
28+ CURRENT=$( grep -o " prettier-plugin-pywire\" : \" git+$REPO_URL #[^\" ]*" package.json | sed " s|.*#||" || echo " " )
29+
30+ if [ " $CURRENT " != " $REF " ]; then
31+ echo " Updating prettier-plugin-pywire dependency to #$REF ..."
32+ # We use pnpm add to update package.json and pnpm-lock.yaml
33+ pnpm add " git+$REPO_URL #$REF "
34+ else
35+ echo " prettier-plugin-pywire is already at #$REF ."
36+ fi
You can’t perform that action at this time.
0 commit comments