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
2 changes: 1 addition & 1 deletion .github/actions/setup-pnpm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ runs:
run: dpkg -s libatomic1 >/dev/null 2>&1 || (sudo apt-get update && sudo apt-get install -y libatomic1)

- name: Install pnpm and Node.js
uses: pnpm/setup@v2.0.2
uses: pnpm/setup@v3.2.0
with:
cache: true
install: false
26 changes: 14 additions & 12 deletions .github/workflows/publish-vortex-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ on:
description: "Build and pack without publishing."
type: boolean
default: true
ref:
description: "Branch or commit to build instead of the tag, for dry runs of an unreleased branch. The tag still sets the version."
required: false
type: string

concurrency:
group: publish-vortex-api-${{ github.event.release.tag_name || inputs.tag }}
Expand All @@ -44,27 +48,25 @@ jobs:
# The API bundle never loads Electron, so skip the native rebuild the app needs.
VORTEX_ELECTRON_REBUILD: "skip"
steps:
- name: Refuse to publish a ref other than the tag
if: ${{ inputs.ref != '' && env.DRY_RUN != 'true' }}
run: |
echo "::error::The ref input is for dry runs only. Publishing must build the release tag."
exit 1

- uses: actions/checkout@v7
with:
ref: ${{ github.event.release.tag_name || inputs.tag }}

- name: Read Node.js version from package.json
id: node-version
run: echo "NODE_VERSION=$(jq -r .engines.node package.json)" >> "$GITHUB_OUTPUT"
ref: ${{ github.event.release.tag_name || inputs.ref || inputs.tag }}

- name: Install pnpm
uses: pnpm/action-setup@v6
uses: ./.github/actions/setup-pnpm

- name: Use Node.js
# Only writes the registry .npmrc; Node.js itself comes from setup-pnpm.
- name: Configure npm registry
uses: actions/setup-node@v7
with:
node-version: ${{ steps.node-version.outputs.NODE_VERSION }}
cache: "pnpm"
registry-url: "https://registry.npmjs.org"

- name: Fix pnpm node-gyp permissions
run: find "$PNPM_HOME" -path '*/node-gyp/gyp/gyp_main.py' -exec chmod +x {} \;

# NOTE(erri120): fontconfig required by font-scanner required by theme-switcher
- name: Install fontconfig
run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev
Expand Down
1 change: 0 additions & 1 deletion .node-version

This file was deleted.

9 changes: 7 additions & 2 deletions docs/install-instructions/shared.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ The version you installed in step 2 only bootstraps the process. `pnpm` reads
downloads the pinned `node.js` runtime declared in `devEngines.runtime`. Building
the native modules is the slow part of this step.

The repository pins pnpm 12. A pnpm 11 install (11.10 or newer) still switches to
it, so you do not need to upgrade your global `pnpm` first. To upgrade it anyway,
run `pnpm self-update` outside the repository. If `pnpm --version` still reports
an older version afterwards, an older `pnpm` is earlier on `PATH`: find it with
`where.exe pnpm` on Windows or `which -a pnpm` on Linux.

This also installs the git pre-commit hook for auto-formatting. If the hook is
missing, install it by hand:

Expand All @@ -88,8 +94,7 @@ which is not necessarily the one on your `PATH`.
## Notes

- Corepack, `npm` and a global `node.js` are not required. The `node.js` version
is pinned by `devEngines.runtime` in `package.json` and by the `node`
runtime entry in the `pnpm-workspace.yaml` catalog.
is pinned by `devEngines.runtime` in `package.json`.
- `nx` is a dev dependency of the repository. Always run it as `pnpm nx <target>`;
do not install it globally.
- If you want `node` and `npm` on `PATH` for unrelated projects, install `node.js`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "1.0.0",
"private": true,
"type": "commonjs",
"packageManager": "pnpm@11.10.0+sha512.0b7f8b98060031904c017e3a41eb187a16d40eeb829b95c4f8cb03681761fc4ab53dd219115b9b447f4dce1a05a214764461e7d3703392a9f32f9511ce8c86c8",
"packageManager": "pnpm@12.21.0",
"engines": {
"node": "24.22.3",
"runtime": {
Expand Down
33 changes: 12 additions & 21 deletions packages/exe-version/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as fs from "fs";
import { createRequire } from "module";
import * as path from "path";

import { describe, it, expect } from "vitest";
Expand Down Expand Up @@ -98,25 +99,17 @@ describeOnWindows("public API", () => {
});

describeOnWindows("cross-validation with native module", () => {
let nativeGetInfo:
| ((filePath: string) => {
fileVersion: number[];
productVersion: number[];
fileVersionString: string;
productVersionString: string;
})
| undefined;

try {
const winapiPath = path.resolve(
__dirname,
"../../../node_modules/.pnpm/winapi-bindings@https+++cod_133dce9c747207ea117c57c1f8ca67ef/node_modules/winapi-bindings",
);
// eslint-disable-next-line @typescript-eslint/no-var-requires
nativeGetInfo = require(winapiPath).GetFileVersionInfo;
} catch {
nativeGetInfo = undefined;
}
// Resolved through @vortex/main, which depends on winapi-bindings, rather than
// a hard-coded node_modules/.pnpm path: pnpm's store folder names are not
// stable across pnpm versions. A failed resolve fails the suite instead of
// skipping it.
const mainRequire = createRequire(
path.resolve(import.meta.dirname, "../../../src/main/package.json"),
);
const nativeGetInfo: (filePath: string) => {
fileVersion: number[];
productVersion: number[];
} = mainRequire("winapi-bindings").GetFileVersionInfo;

const testFiles = [
"C:\\Windows\\System32\\notepad.exe",
Expand All @@ -128,8 +121,6 @@ describeOnWindows("cross-validation with native module", () => {
if (!fs.existsSync(file)) continue;

it(`matches native output for ${path.basename(file)}`, () => {
if (nativeGetInfo === undefined) return; // skip if native not available

const tsInfo = readVersionInfo(file)!;
const native = nativeGetInfo(file);

Expand Down
2 changes: 1 addition & 1 deletion packages/vortex-api/docs/MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ In your `package.json`, replace:

```diff
- "packageManager": "yarn@1.22.19"
+ "packageManager": "pnpm@10.31.0"
+ "packageManager": "pnpm@12.21.0"
```

### 1b. Generate `pnpm-lock.yaml`
Expand Down
Loading
Loading