Skip to content

Commit 2c19ae6

Browse files
Copilottheoephraim
andauthored
Merge remote-tracking branch 'origin/main' into copilot/fix-vitest-environment-variables
# Conflicts: # packages/varlock/src/lib/exec-sync-varlock.ts Co-authored-by: theoephraim <1158956+theoephraim@users.noreply.github.com>
2 parents 2a984ff + 74752a3 commit 2c19ae6

31 files changed

Lines changed: 388 additions & 60 deletions
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"varlock": patch
3+
---
4+
5+
Add version mismatch detection between standalone binary and local node_modules install
6+
7+
When running the standalone binary (installed via homebrew/curl), varlock now checks if a different version is installed in the project's node_modules. If a version mismatch is detected, a warning is displayed suggesting users update the binary or use the locally installed version instead. This helps prevent confusing errors caused by running mismatched versions.

.changeset/bright-astro-tests.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"varlock": patch
3+
---
4+
5+
Fix plugin resolution failure in monorepo workspaces where `.git` and the lockfile coexist in the same directory.
6+
7+
`detectWorkspaceInfo()` was checking for a `.git` directory **after** moving to the parent, so in the standard monorepo layout (`monorepo-root/.git` + `monorepo-root/bun.lock`) the root was never scanned and the lockfile was never found. Moving the `.git` boundary check to **before** moving up ensures the git-root directory is always scanned first.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"varlock": patch
3+
---
4+
5+
Fix binary resolution in monorepos when `cwd` differs from the package root.
6+
7+
When importing `varlock/auto-load` (e.g. from a `playwright.config.ts` in a monorepo sub-package), VS Code and similar tools may set `process.cwd()` to the workspace root rather than the sub-package directory. This caused `execSyncVarlock` to search for the `varlock` binary starting at the workspace root and fail to find it when it was only installed in a sub-package's `node_modules/.bin`.
8+
9+
Two fixes are applied:
10+
11+
1. `execSyncVarlock` now accepts a `callerDir` option. When provided, the binary search walks up from `callerDir` before falling back to `process.cwd()`. `auto-load.ts` passes `import.meta.dirname` so the search always starts from inside the varlock package itself, which is already in the correct sub-package's `node_modules`.
12+
13+
2. The walk-up logic no longer throws immediately when it finds a `node_modules/.bin` directory that does not contain varlock. It now continues walking up, allowing the search to find varlock installed at a higher or lower level of a monorepo.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"varlock": patch
3+
---
4+
5+
Fix `@generateTypes` not creating variables when using a custom path with `varlock typegen --path <file>`
6+
7+
When a schema file with an environment-qualifier-like name (e.g. `.env.infra.schema`) was passed as the explicit entry point via `--path`, its variables were being excluded from type generation. The filename was parsed such that `infra` was treated as an environment name (`applyForEnv='infra'`), causing the data source to be marked as environment-specific and all its variables to be filtered out.
8+
9+
The fix ensures that a file loaded as the root entry point (no parent data source) is never treated as environment-specific, even if its filename contains an environment qualifier.

.changeset/ninety-birds-kick.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/workflows/binary-release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ jobs:
3939
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
4040
restore-keys: |
4141
bun-${{ runner.os }}-
42-
- name: Use Node.js 22.x
42+
- name: Use Node.js 24.x
4343
uses: actions/setup-node@v6
4444
with:
45-
node-version: "22.x"
45+
node-version: "24.x"
4646
- name: Install node deps
4747
run: bun install
4848
- name: Enable turborepo build cache

.github/workflows/framework-tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- name: Setup Node.js
6161
uses: actions/setup-node@v6
6262
with:
63-
node-version: '22.x'
63+
node-version: '24.x'
6464

6565
- name: Install dependencies
6666
run: bun install
@@ -106,7 +106,7 @@ jobs:
106106
- name: Setup Node.js
107107
uses: actions/setup-node@v6
108108
with:
109-
node-version: '22.x'
109+
node-version: '24.x'
110110

111111
- name: Setup pnpm
112112
uses: pnpm/action-setup@v5

.github/workflows/release-preview.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
2727
restore-keys: |
2828
bun-${{ runner.os }}-
29-
- name: Use Node.js 22.x
29+
- name: Use Node.js 24.x
3030
uses: actions/setup-node@v6
3131
with:
32-
node-version: "22.x"
32+
node-version: "24.x"
3333
- name: Install node deps
3434
run: bun install
3535
- name: Enable turborepo build cache

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ jobs:
3232
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
3333
restore-keys: |
3434
bun-${{ runner.os }}-
35-
- name: Use Node.js 22.x
35+
- name: Use Node.js 24.x
3636
uses: actions/setup-node@v6
3737
with:
38-
node-version: "22.x"
38+
node-version: "24.x"
3939
- name: Install node deps
4040
run: bun install
4141
- name: Enable turborepo build cache

0 commit comments

Comments
 (0)