Skip to content

Commit

Permalink
add Node 22 support
Browse files Browse the repository at this point in the history
  • Loading branch information
xan105 committed Apr 26, 2024
1 parent a886342 commit 3b9c745
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xan105/nodert",
"version": "2.0.2",
"version": "3.0.0",
"description": "NodeRT but precompiled (use WinRT API directly from node)",
"type": "module",
"exports": {
Expand Down Expand Up @@ -1320,10 +1320,6 @@
"node": ">=20.12.2",
"npm": "^10.2.4"
},
"cpu": [
"x64",
"arm64"
],
"scripts": {
"install": "node \"./install.js\"",
"lint": "eslint \"./lib/**/*.{js,mjs}\" \"./types/**/*.d.ts\"",
Expand All @@ -1333,7 +1329,11 @@
"fetch:manual": "powershell -NoProfile -ExecutionPolicy Bypass -File ./fetch.ps1 && patch-package",
"fetch:auto": "npm ci --ignore-scripts && patch-package",
"diff": "powershell -NoProfile -ExecutionPolicy Bypass -File ./diff.ps1",
"build:abi93": "powershell -NoProfile -ExecutionPolicy Bypass -File ./build.ps1 -target 16.0.0 -abi abi93 -skip",
"build:abi108": "powershell -NoProfile -ExecutionPolicy Bypass -File ./build.ps1 -target 18.0.0 -abi abi108 -skip",
"build:abi115": "powershell -NoProfile -ExecutionPolicy Bypass -File ./build.ps1 -target 20.0.0 -abi abi115 -skip",
"build:abi127": "powershell -NoProfile -ExecutionPolicy Bypass -File ./build.ps1 -target 22.0.0 -abi 127 -skip",
"build:electron:abi119": "powershell -NoProfile -ExecutionPolicy Bypass -File ./build.ps1 -target 28.0.0 -abi abi119 -runtime electron -skip",
"build:electron:abi121": "powershell -NoProfile -ExecutionPolicy Bypass -File ./build.ps1 -target 29.0.0 -abi abi121 -runtime electron -skip",
"build:electron:abi123": "powershell -NoProfile -ExecutionPolicy Bypass -File ./build.ps1 -target 30.0.0 -abi abi123 -runtime electron -skip"
},
Expand Down
29 changes: 29 additions & 0 deletions updateCompilerFlags.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
Copyright (c) Anthony Beaumont
This source code is licensed under the Apache 2.0 License
found in the LICENSE file in the root directory of this source tree.
*/

//Mass edit compiler flags/args in binding.gyp
//NB: Make sure binding.gyp is valid JSON (eg: ' -> ")

import { join } from "node:path";
import { readJSON, writeJSON, ls } from "@xan105/fs";

const scopes = await ls("./node_modules", { pattern: /^@nodert-.*$/ })
for (const scope of scopes)
{
const namespaces = await ls(join("./node_modules", scope));
for (const namespace of namespaces)
{
console.log(scope + "/" + namespace);

const binding = join("./node_modules", scope, namespace, "binding.gyp");
const gyp = await readJSON(binding);

gyp.targets.at(0).msvs_settings.VCCLCompilerTool.AdditionalOptions = ["/std:c++17", "/ZW"];
gyp.targets.at(0).msvs_settings.VCCLCompilerTool.DisableSpecificWarnings = [4609];

await writeJSON(binding, gyp);
}
}

0 comments on commit 3b9c745

Please # to comment.