Skip to content
Closed
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
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: weekly

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
36 changes: 21 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Install Nodejs
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24

- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Install Nodejs
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: .nvmrc
cache: npm

- name: Install dependencies
run: npm ci

Expand All @@ -37,6 +38,9 @@ jobs:
- name: Build extension
run: npm run compile

- name: Run tests
run: xvfb-run -a npm test

- name: Package extension
run: npx vsce package

Expand All @@ -46,16 +50,17 @@ jobs:
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Install Nodejs
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24

- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Install Nodejs
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: .nvmrc
cache: npm

- run: npm ci

- name: Set pre-release version
Expand All @@ -72,16 +77,17 @@ jobs:
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Install Nodejs
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24

- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Install Nodejs
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: .nvmrc
cache: npm

- run: npm ci

- name: Set pre-release version
Expand Down
33 changes: 18 additions & 15 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ jobs:
name: 'Check version'
runs-on: ubuntu-latest
steps:
- name: Install Nodejs
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24

- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: ${{ env.FETCH_DEPTH }}

- name: Install Nodejs
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: .nvmrc
cache: npm

- name: Validate package version matches git tag
run: |
TAG_VERSION=${GITHUB_REF#refs/tags/v}
Expand All @@ -34,16 +35,17 @@ jobs:
runs-on: ubuntu-latest
needs: check-version
steps:
- name: Install Nodejs
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24

- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Install Nodejs
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: .nvmrc
cache: npm

# Install Node dependencies.
- run: npm ci

Expand All @@ -56,16 +58,17 @@ jobs:
runs-on: ubuntu-latest
needs: check-version
steps:
- name: Install Nodejs
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24

- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Install Nodejs
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: .nvmrc
cache: npm

# Install Node dependencies.
- run: npm ci

Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/security-audit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Dependency security audit

on:
schedule:
- cron: '23 4 * * 1'
workflow_dispatch:

permissions:
contents: read

jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: .nvmrc
cache: npm

- run: npm ci
- run: npm audit --audit-level=high
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ dist
node_modules
.vscode-test/
*.vsix

# Pixi environments in test fixtures and projects
**/.pixi/*
!**/.pixi/config.toml
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged --concurrent false
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24.21.0
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/pixi.lock
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"printWidth": 120,
"tabWidth": 4,
"useTabs": false,
"endOfLine": "auto",
"overrides": [
{
"files": ["*.yml", "*.yaml"],
Expand Down
12 changes: 12 additions & 0 deletions .vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from '@vscode/test-cli';
import { fileURLToPath } from 'node:url';

export default defineConfig({
files: 'out/test/**/*.vscode.test.js',
version: 'stable',
workspaceFolder: fileURLToPath(new URL('./test/fixtures/pixi-project/', import.meta.url)),
mocha: {
ui: 'tdd',
timeout: 20_000,
},
});
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"args": ["${workspaceFolder}/test/fixtures/pixi-project", "--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
}
Expand Down
12 changes: 10 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "compile",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "watch",
Expand All @@ -11,8 +20,7 @@
"group": "watchers"
},
"group": {
"kind": "build",
"isDefault": true
"kind": "build"
}
},
{
Expand Down
43 changes: 19 additions & 24 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,32 @@ Code extension that integrates Pixi environments with the Python Environments ex
```

3. **Development workflow**

```bash
npm run compile # Build the extension
npm run watch # Watch for changes during development
npm run watch # Rebuild while you edit
npm test # Run the full validation suite before submitting
```

Press `F5` in VS Code to launch an Extension Development Host, then open a project containing `pixi.toml` or a
`pyproject.toml` with a `[tool.pixi]` table.

## Code style and quality

This project maintains strict code quality standards using TypeScript, ESLint, and Prettier. All code must pass these
quality checks before being merged.
This project uses TypeScript, ESLint, and Prettier. `npm test` runs the required checks before its unit and extension
tests. Husky formats and fixes staged files at commit time.

```bash
npm run lint # Check for linting issues
npm run format:check # Check code formatting
npm run compile # Build and verify compilation
```
### Tests

Fixing issues:
Use unit tests for pure TypeScript logic, such as Pixi command construction and parsing. They run directly in Node.js and
must not import the `vscode` runtime module.

```bash
npm run format # Auto-fix formatting issues
npm run lint -- --fix # Auto-fix linting issues where possible
```
Use VS Code extension-host tests for interactions with the `vscode` API, extension activation, and extension
contributions. The first run downloads an isolated VS Code instance into `.vscode-test/`; later runs reuse it.

For focused work, run `npm run test:unit` or `npm run test:vscode` individually. `npm run typecheck` is available when
you only need TypeScript validation.

The CI `test` job runs `npm test` before either pre-release publishing job is allowed to start.

## Making a contribution

Expand All @@ -60,16 +64,7 @@ git checkout -b feature/your-feature-name
- **Code formatting**: Use Prettier to format your code
- **Logging**: Use the provided logging utilities in `src/common/logging.ts`

### 3. Extension testing

Test the extension functionality:

1. Press `F5` in launch VS Code in debug mode
2. Open a project containing `pixi.toml` or `pyproject.toml`
3. Verify Pixi environments are discovered and functional
4. Test environment switching and terminal activation

### 4. Commit and submit
### 3. Commit and submit

- Reference any related issues
- Submit a pull request with detailed description
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ Check the "Pixi Environment Manager" output channel:
- Verify `pixi.toml` or `pyproject.toml` exists in project root
- Run `pixi install` to ensure environments are set up

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and workflow details.

## License

MIT
Loading