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
51 changes: 51 additions & 0 deletions .github/ISSUE_TEMPLATE/1-bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: '🐞 Bug Report'
description: Report a bug in the Rstack VS Code extension
title: '[Bug]: '
labels: ['🐞 bug']
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to report this issue! Before submitting, please note:

- Make sure you searched in the [Issues](https://github.com/rstackjs/rstack-editor/issues) and didn't find the same issue.
- If the problem reproduces with the CLI too (`rs lint` / `rs test` / `rs fmt`), it likely belongs to the tool's own repo — file it against [rslint](https://github.com/web-infra-dev/rslint), [rstest](https://github.com/web-infra-dev/rstest) or [rstack-cli](https://github.com/rstackjs/rstack-cli) instead.

- type: dropdown
id: area
attributes:
label: Affected area
options:
- Linting (Rslint)
- Testing (Rstest)
- Formatting
- Detection / status bar / settings
- Other
validations:
required: true

- type: textarea
id: versions
attributes:
label: Versions
description: |
Extension version, VS Code version + platform (Help → About), and the tool versions resolved from your project (`npm ls @rslint/core @rstest/core rstack`).
render: sh
validations:
required: true

- type: textarea
id: details
attributes:
label: Details
description: Describe the bug, including screenshots and relevant output-channel logs (Output panel → Rstack channels).
validations:
required: true

- type: textarea
id: reproduce-steps
attributes:
label: Reproduce steps
description: The simplest steps (ideally with a minimal repo link) so we can quickly reproduce the problem.
validations:
required: true
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/2-feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: '💡 Feature Request'
description: Suggest a feature for the Rstack VS Code extension
title: '[Feature]: '
labels: ['💡 feature']
body:
- type: textarea
id: problem
attributes:
label: What problem does this feature solve?
validations:
required: true

- type: textarea
id: solution
attributes:
label: What does the proposed API/UX look like?
validations:
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/rstackjs/rstack-editor/discussions
about: Ask a question about the Rstack editor extensions
12 changes: 12 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Summary

## Related Links

<!-- Provide links of related issues or pages -->

## Checklist

<!-- Check and mark with an "x" -->

- [ ] Tests updated (or not required).
- [ ] Documentation updated (or not required).
119 changes: 119 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: CI

on:
push:
branches: [main]

pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

permissions:
contents: read

jobs:
# ======== linux ========
test-linux:
name: Test (ubuntu-latest)
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 1

- name: Setup pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9

- name: Setup Node.js
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version: 22
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml

- name: Install Dependencies
run: pnpm install --frozen-lockfile --prefer-offline

- name: Build
run: pnpm run build

- name: Lint
run: pnpm run lint

- name: Format Check
run: pnpm run fmt:check

- name: Unit Test
run: pnpm run test:unit

# `@vscode/test-electron` downloads a full VS Code into
# `packages/vscode/.vscode-test`. Cache only the immutable distribution
# directories, keyed on the extension manifest (which carries
# `engines.vscode`); the restore-keys fallback keeps older downloads
# available while `version: 'stable'` moves forward.
- name: Cache VS Code Download
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: packages/vscode/.vscode-test/vscode-*
key: vscode-test-${{ runner.os }}-${{ hashFiles('packages/vscode/package.json') }}
restore-keys: |
vscode-test-${{ runner.os }}-

# The E2E fixtures install published npm packages at test time
# (tests/e2e/setupFixtures.mjs, invoked by test:e2e), so this step needs
# network access. The VS Code Extension Host needs a display on Linux,
# hence xvfb (preinstalled on GitHub-hosted Ubuntu runners).
- name: E2E Test
run: xvfb-run -a pnpm run test:e2e

# ======== windows ========
# A dedicated GitHub-hosted Windows job: upstream rslint notes the VS Code
# extension E2E suite is unreliable on self-hosted Windows runners.
test-windows:
name: Test (windows-latest)
runs-on: windows-latest
timeout-minutes: 40

steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 1

- name: Setup pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9

- name: Setup Node.js
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version: 22
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml

- name: Install Dependencies
run: pnpm install --frozen-lockfile --prefer-offline

- name: Build
run: pnpm run build

- name: Lint
run: pnpm run lint

- name: Unit Test
run: pnpm run test:unit

- name: Cache VS Code Download
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: packages/vscode/.vscode-test/vscode-*
key: vscode-test-${{ runner.os }}-${{ hashFiles('packages/vscode/package.json') }}
restore-keys: |
vscode-test-${{ runner.os }}-

- name: E2E Test
run: pnpm run test:e2e
102 changes: 102 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Release

on:
workflow_dispatch:
inputs:
dry_run:
description: 'Dry run: package and upload the VSIX artifacts only, skip publishing'
required: false
type: boolean
default: false

permissions:
contents: read

jobs:
release_vscode_extension:
name: Release VS Code Extension (${{ matrix.vsce-target }})
if: github.repository == 'rstackjs/rstack-editor' && github.event_name == 'workflow_dispatch'
runs-on: ${{ matrix.runner }}
environment: vscode-marketplace
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-latest
vsce-target: linux-x64
arch: x64
- runner: ubuntu-22.04
vsce-target: linux-arm64
arch: arm64
- runner: macos-15
vsce-target: darwin-x64
arch: x64
- runner: macos-15
vsce-target: darwin-arm64
arch: arm64
- runner: windows-2022
vsce-target: win32-x64
arch: x64
- runner: windows-latest
vsce-target: win32-arm64
arch: arm64
defaults:
run:
shell: bash
env:
# rslib.config.mts keys the staged `@yuku-parser/binding-*` napi payload
# off this variable (Linux targets get a `-gnu` suffix appended there).
VSCE_TARGET: ${{ matrix.vsce-target }}
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 1

- name: Setup pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9

- name: Setup Node.js
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version: 22
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml

# `supportedArchitectures` must be set BEFORE `pnpm install` so pnpm also
# fetches the cross-target optional `@yuku-parser/binding-*` package (the
# Linux runners' current libc is glibc, matching the `-gnu` bindings the
# linux-* VSIX targets need).
- name: Install Dependencies
run: |
pnpm config set --location=project --json supportedArchitectures '{"cpu":["current","${{ matrix.arch }}"]}'
pnpm install

- name: Build
run: pnpm run build

- name: Package VS Code Extension
working-directory: packages/vscode
run: pnpm exec vsce package --target ${{ matrix.vsce-target }} -o rstack-${{ matrix.vsce-target }}.vsix

- name: Upload VSIX Artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: rstack-${{ matrix.vsce-target }}
path: packages/vscode/rstack-${{ matrix.vsce-target }}.vsix
if-no-files-found: error

- name: Publish VS Code Extension
if: ${{ !inputs.dry_run }}
working-directory: packages/vscode
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: pnpm exec vsce publish --target ${{ matrix.vsce-target }} --skip-duplicate

- name: Publish OVSX Extension
if: ${{ !inputs.dry_run }}
working-directory: packages/vscode
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
run: pnpm exec ovsx publish --target ${{ matrix.vsce-target }} --skip-duplicate
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,24 @@ dist
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
.vite/

# rstack-editor
*.vsix
tests-dist/
.rsdoctor/

# E2E fixtures install published npm versions on demand; only
# their manifests and configs are tracked.
packages/vscode/tests/e2e/fixtures/*/node_modules/
packages/vscode/tests/e2e/fixtures/*/pnpm-lock.yaml
packages/vscode/tests/e2e/lint/fixtures/pnpm-lock.yaml
packages/vscode/tests/e2e/rstest/fixtures/*/pnpm-lock.yaml

# Build-time copy of the workspace root LICENSE (see rslib.config.mts)
packages/vscode/LICENSE

# Design documents are working notes, not part of the published repo
/DESIGN*.md

# Claude Code local worktrees
.claude/worktrees/
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
26
1 change: 1 addition & 0 deletions .rstack/hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rs staged
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
// Rslint powers `pnpm lint` in this repo; the extension surfaces the same
// diagnostics in the editor. To be replaced by `rstack.rstack` (this very
// extension) once it is published.
"recommendations": ["rstack.rslint"]
}
42 changes: 42 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"version": "0.2.0",
"configurations": [
{
// F5: pick a fixture from the dropdown, then an Extension Development
// Host opens on it. Fixtures are real projects on published
// `@rslint/core` / `@rstest/core` / `rstack` — run
// `pnpm test:e2e:fixtures` once first to install their dependencies.
"name": "Run Extension (playground)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/packages/vscode",
"--disable-extensions",
"${workspaceFolder}/packages/vscode/${input:playgroundTarget}"
],
"outFiles": ["${workspaceFolder}/packages/vscode/dist/**/*.js"],
"preLaunchTask": "extension watch",
// Off by default: attaching to every spawned worker slows runs down and
// child-process sourcemaps are unreliable (same setting upstream).
"autoAttachChildProcesses": false
}
],
"inputs": [
{
"id": "playgroundTarget",
"type": "pickString",
"description": "Which fixture should the dev host open?",
"default": "tests/e2e/fixtures/e2e.code-workspace",
"options": [
{
"label": "all three fixtures (multi-root)",
"value": "tests/e2e/fixtures/e2e.code-workspace"
},
{ "label": "rslint fixture", "value": "tests/e2e/fixtures/rslint" },
{ "label": "rstest fixture", "value": "tests/e2e/fixtures/rstest" },
{ "label": "rstack fixture", "value": "tests/e2e/fixtures/rstack" }
]
}
]
}
Loading