Skip to content
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
27 changes: 15 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@ jobs:
- name: Checkout code
uses: actions/checkout@v6

- name: Setup Bun (for WASM build on host)
uses: oven-sh/setup-bun@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
bun-version: latest
node-version: '22'
cache: 'npm'

- name: Build WASM
run: |
bun --bun install
bun --bun run build:wasm
npm install
npm run build:wasm

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -47,14 +48,16 @@ jobs:
cache-to: type=gha,mode=max

- name: Build extension in Docker
env:
HOME: /tmp
run: |
docker run --rm -v "$PWD":/app -w /app vscode-qml-builder:latest bash -c '
docker run --rm -v "$PWD":/app -w /app -e HOME=/tmp vscode-qml-builder:latest bash -c '
set -euo pipefail
bun --bun install
cd node_modules/@vscode/sqlite3 && bunx --bun node-gyp rebuild && cd /app
bun --bun run compile
bunx --bun tsc --noEmit
bunx --bun @vscode/vsce package --pre-release --allow-missing-repository
npm install
cd node_modules/@vscode/sqlite3 && npx node-gyp rebuild && cd /app
npm run compile
npx tsc --noEmit
npx @vscode/vsce package --pre-release --allow-missing-repository
'

- name: Upload artifact
Expand All @@ -64,4 +67,4 @@ jobs:
path: '*.vsix'
retention-days: 7
if-no-files-found: error
compression-level: 0
compression-level: 0
25 changes: 14 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ jobs:
- name: Checkout code
uses: actions/checkout@v6

- name: Setup Bun (for WASM build on host)
uses: oven-sh/setup-bun@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
bun-version: latest
node-version: '22'
cache: 'npm'

- name: Build WASM
run: |
bun --bun install
bun --bun run build:wasm
npm install
npm run build:wasm

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -43,13 +44,15 @@ jobs:
cache-to: type=gha,mode=max

- name: Build extension in Docker
env:
HOME: /tmp
run: |
docker run --rm -v "$PWD":/app -w /app vscode-qml-builder:latest bash -c '
docker run --rm -v "$PWD":/app -w /app -e HOME=/tmp vscode-qml-builder:latest bash -c '
set -euo pipefail
bun --bun install
cd node_modules/@vscode/sqlite3 && bunx --bun node-gyp rebuild && cd /app
bun --bun run compile
bunx --bun @vscode/vsce package --pre-release --allow-missing-repository
npm install
cd node_modules/@vscode/sqlite3 && npx node-gyp rebuild && cd /app
npm run compile
npx @vscode/vsce package --pre-release --allow-missing-repository
'

- name: Create GitHub Release
Expand All @@ -63,4 +66,4 @@ jobs:

# - name: Publish to VS Code Marketplace
# if: ${{ !contains(github.ref, '-') }}
# run: bunx --bun ovsx publish -p ${{ secrets.OVSX_PAT }}
# run: npx ovsx publish -p ${{ secrets.OVSX_PAT }}
12 changes: 5 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ RUN apt-get update && apt-get install -y \
python3 \
make \
g++ \
curl \
unzip \
&& rm -rf /var/lib/apt/lists/*

RUN curl -fsSL https://bun.sh/install | bash && \
cp /root/.bun/bin/bun /usr/local/bin/bun && \
chmod +x /usr/local/bin/bun && \
ln -s /usr/local/bin/bun /usr/local/bin/bunx
# Create cache directory for node-gyp with proper permissions
RUN mkdir -p /tmp/.cache/node-gyp && chmod -R 777 /tmp/.cache

ENV npm_config_cache=/tmp/.cache

WORKDIR /app

CMD ["/bin/bash"]
CMD ["/bin/bash"]
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,21 @@ Use a .vsix file from GitHub release. VSCode Marketplace is coming soon.

Any help (bug reporting or PRs) is very welcome!

To build an extension, use `build.sh` script. You'll need Docker, [bun](https://bun.com/) or other nodejs package manager - for the later you'll have to update the script.
To build an extension, use `build.sh` script. You'll need Docker and npm (or other Node.js package manager).
```sh
$ ./build.py
$ ./build.sh
```

This measure is needed to ensure sqlite uses supported glibc version.

To have project set up just use
To have project set up for local development:
```sh
$ bun --bun install
$ bun --bun run compile
$ npm install
$ npm run compile
```

You can use `F5` in Visual Studio Code to debug the extension.

## License

The software is licensed under GPLv3.
The software is licensed under GPLv3.
21 changes: 14 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,37 @@
set -euo pipefail

echo "Building WASM file locally..."
bun --bun install
bun --bun run build:wasm
npm install
npm run build:wasm

echo "Building Docker image..."
docker build -t vscode-qml-builder .

echo "Running build inside Docker container..."
docker run --rm -v "$(pwd)":/app -w /app --user "$(id -u):$(id -g)" vscode-qml-builder bash -c '
docker run --rm -v "$(pwd)":/app -w /app -e HOME=/tmp vscode-qml-builder bash -c '
set -euo pipefail
echo "==============================="
echo "Building inside Docker container"
echo "==============================="
bun --bun install

npm install

echo "Rebuilding native modules..."
cd node_modules/@vscode/sqlite3 && bunx --bun node-gyp rebuild && cd /app
npm rebuild --build-from-source @vscode/sqlite3
echo "Packaging VSCode extension..."
bunx --bun @vscode/vsce package --pre-release --allow-missing-repository
npx @vscode/vsce package --pre-release --allow-missing-repository
mkdir -p build
mv *.vsix build/

# Fix permissions for output files
chown -R $(id -u):$(id -g) build/ || true
chown $(id -u):$(id -g) *.vsix 2>/dev/null || true

echo "==============================="
echo "Docker build completed"
echo "==============================="
'

echo ""
echo "✓ Build completed successfully!"
echo "✓ Packaged extension is in the build/ directory."
echo "✓ Packaged extension is in the build/ directory."
61 changes: 0 additions & 61 deletions bun.lock

This file was deleted.

Binary file added bun.lockb
Binary file not shown.
Loading