Skip to content
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changelog

- **Added** `vp run --filter` supports pnpm's changed-since selector: `--filter "[<since>]"` selects the packages with a file changed since the git revision `<since>`, and combines with the other selector parts, as in `...[origin/main]` (plus their dependents), `[origin/main]...` (plus their dependencies), `foo[origin/main]` or `{packages/*}[origin/main]` (only those that changed) and `!...[origin/main]`. As in pnpm, changes are counted from the commit where the current branch forked from `<since>`, uncommitted changes to tracked files count, and a package that takes a changed catalog entry in `pnpm-workspace.yaml` counts as changed. An unknown revision, a workspace outside a git repository, or a `<since>` with no common history with `HEAD` (as in a shallow clone) is an error instead of an empty match. A trailing `[...]` in a filter is now always the revision, so a filter like `foo[ab]` no longer matches `fooa` and `foob` ([vite-plus#2903](https://github.com/voidzero-dev/vite-plus/issues/2903), [#1009](https://github.com/voidzero-dev/vite-task/pull/1009)).
- **Fixed** On Windows, tasks with automatic file-access tracking can now run Git Bash's `sh` and other MSYS2 or Cygwin programs, which aborted with `fatal error - MapViewOfFileEx 'shared.5'(…) Win32 error 487` ([#830](https://github.com/voidzero-dev/vite-task/issues/830), [#952](https://github.com/voidzero-dev/vite-task/pull/952)).
- **Fixed** On Linux, cached tasks no longer fail to spawn child processes in restricted sandboxes, for example rootless bubblewrap that denies the `seccomp` syscall. When the `seccomp` filter for file-access tracking cannot be installed, the process runs untracked instead and the run is reported as not cached. The not-cached message now reads "automatic file tracking couldn't record everything this task did", which fits both this case and a full tracking channel ([#700](https://github.com/voidzero-dev/vite-task/issues/700), [#701](https://github.com/voidzero-dev/vite-task/pull/701)).
- **Fixed** `vp run <task>` in a package that doesn't define the task now reports `Task "<task>" not found` when another package's `vite.config.*` fails to load, instead of failing with that package's error. Showing the tasks to choose from loads every package's config, so the task selector or task list is skipped then ([#987](https://github.com/voidzero-dev/vite-task/pull/987)).
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "filter-changed-since-test",
"private": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "@test/app",
"scripts": {
"build": "vtt print built-app"
},
"dependencies": {
"@test/lib": "workspace:*",
"react": "catalog:"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "@test/lib",
"scripts": {
"build": "vtt print built-lib"
},
"dependencies": {
"@test/utils": "workspace:*"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@test/utils",
"scripts": {
"build": "vtt print built-utils"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
packages:
- packages/*
catalog:
react: ^18.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
# pnpm's changed-since `--filter "[<since>]"` selector, against a real git
# repository created in the staged fixture. Dependencies: app -> lib -> utils.

[[e2e]]
name = "changed_leaf_selects_it_and_its_dependents"
comment = """
A commit changes only the leaf `@test/utils`. `...[HEAD~1]` selects it and every package that depends on it, and builds them in dependency order.
"""
steps = [
[
"git",
"-c",
"init.defaultBranch=main",
"init",
"-q",
],
[
"git",
"-c",
"core.autocrlf=false",
"add",
"-A",
],
[
"git",
"-c",
"user.name=test",
"-c",
"[email protected]",
"-c",
"commit.gpgsign=false",
"commit",
"-q",
"--no-verify",
"-m",
"init",
],
[
"vtt",
"replace-file-content",
"packages/utils/src/index.js",
"export {};",
"export const changed = 1;",
],
[
"git",
"-c",
"core.autocrlf=false",
"add",
"-A",
],
[
"git",
"-c",
"user.name=test",
"-c",
"[email protected]",
"-c",
"commit.gpgsign=false",
"commit",
"-q",
"--no-verify",
"-m",
"change",
],
[
"vt",
"run",
"--filter",
"...[HEAD~1]",
"build",
],
[
"vt",
"run",
"--filter",
"[HEAD~1]",
"build",
],
]

[[e2e]]
name = "uncommitted_change_counts"
comment = """
An uncommitted change to a tracked file counts as a change since `HEAD`.
"""
steps = [
[
"git",
"-c",
"init.defaultBranch=main",
"init",
"-q",
],
[
"git",
"-c",
"core.autocrlf=false",
"add",
"-A",
],
[
"git",
"-c",
"user.name=test",
"-c",
"[email protected]",
"-c",
"commit.gpgsign=false",
"commit",
"-q",
"--no-verify",
"-m",
"init",
],
[
"vtt",
"replace-file-content",
"packages/lib/src/index.js",
"export {};",
"export const changed = 1;",
],
[
"vt",
"run",
"--filter",
"[HEAD]",
"build",
],
]

[[e2e]]
name = "catalog_change_selects_its_users"
comment = """
A commit changes only the default catalog's `react` in `pnpm-workspace.yaml`. `@test/app`, which takes `react: catalog:`, counts as changed, and so does the root package that holds the file (it has no `build`).
"""
steps = [
[
"git",
"-c",
"init.defaultBranch=main",
"init",
"-q",
],
[
"git",
"-c",
"core.autocrlf=false",
"add",
"-A",
],
[
"git",
"-c",
"user.name=test",
"-c",
"[email protected]",
"-c",
"commit.gpgsign=false",
"commit",
"-q",
"--no-verify",
"-m",
"init",
],
[
"vtt",
"replace-file-content",
"pnpm-workspace.yaml",
"react: ^18.0.0",
"react: ^19.0.0",
],
[
"git",
"-c",
"core.autocrlf=false",
"add",
"-A",
],
[
"git",
"-c",
"user.name=test",
"-c",
"[email protected]",
"-c",
"commit.gpgsign=false",
"commit",
"-q",
"--no-verify",
"-m",
"change",
],
[
"vt",
"run",
"--filter",
"[HEAD~1]",
"build",
],
]

[[e2e]]
name = "unknown_revision_errors"
comment = """
A revision git doesn't know is an error, not an empty match that exits 0.
"""
steps = [
[
"git",
"-c",
"init.defaultBranch=main",
"init",
"-q",
],
[
"git",
"-c",
"core.autocrlf=false",
"add",
"-A",
],
[
"git",
"-c",
"user.name=test",
"-c",
"[email protected]",
"-c",
"commit.gpgsign=false",
"commit",
"-q",
"--no-verify",
"-m",
"init",
],
[
"vt",
"run",
"--filter",
"...[no-such-branch]",
"build",
],
]

[[e2e]]
name = "outside_git_repository_errors"
comment = """
Outside a git repository, `[<since>]` is an error, not an empty match that exits 0.
"""
steps = [["vt", "run", "--filter", "...[HEAD~1]", "build"]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# catalog_change_selects_its_users

A commit changes only the default catalog's `react` in `pnpm-workspace.yaml`. `@test/app`, which takes `react: catalog:`, counts as changed, and so does the root package that holds the file (it has no `build`).

## `git -c init.defaultBranch=main init -q`

```
```

## `git -c core.autocrlf=false add -A`

```
```

## `git -c user.name=test -c [email protected] -c commit.gpgsign=false commit -q --no-verify -m init`

```
```

## `vtt replace-file-content pnpm-workspace.yaml 'react: ^18.0.0' 'react: ^19.0.0'`

```
```

## `git -c core.autocrlf=false add -A`

```
```

## `git -c user.name=test -c [email protected] -c commit.gpgsign=false commit -q --no-verify -m change`

```
```

## `vt run --filter [HEAD~1] build`

```
~/packages/app$ vtt print built-app ⊘ cache disabled
built-app
```
Loading