Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
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 1 .github/workflows/sync-headers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
VERSION=${COMMIT_MESSAGE##* }
echo $COMMIT_MESSAGE
npm run --silent write-symbols
npm run --silent write-win32-def
CHANGED_FILES=$(git diff --name-only)
BRANCH_NAME="update-headers/${VERSION}"
if [ -z "$CHANGED_FILES" ]; then
Expand Down
4 changes: 2 additions & 2 deletions 4 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
},
"scripts": {
"update-headers": "node --no-warnings scripts/update-headers.js",
"write-symbols": "node --no-warnings scripts/write-symbols.js"
"write-symbols": "node --no-warnings scripts/write-symbols.js",
"write-win32-def": "node --no-warnings scripts/write-win32-def.js"
},
"version": "0.0.4",
"support": true
}

43 changes: 43 additions & 0 deletions 43 scripts/write-win32-def.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
'use strict';

const { resolve: resolvePath } = require('path');
const { writeFile } = require('fs/promises');
const { symbols } = require('..');

function getNodeApiDef() {
const symbolsSet = new Set();
for (const ver of Object.values(symbols)) {
for (const sym of ver.node_api_symbols) {
symbolsSet.add(sym);
}
for (const sym of ver.js_native_api_symbols) {
symbolsSet.add(sym);
}
}
return 'NAME NODE.EXE\nEXPORTS\n' + Array.from(symbolsSet).join('\n');
}

function getJsNativeApiDef() {
const symbolsSet = new Set();
for (const ver of Object.values(symbols)) {
for (const sym of ver.js_native_api_symbols) {
symbolsSet.add(sym);
}
}
return 'NAME NODE.EXE\nEXPORTS\n' + Array.from(symbolsSet).join('\n');
}

async function main() {
const nodeApiDefPath = resolvePath(__dirname, '../node_api.def');
console.log(`Writing Windows .def file to ${nodeApiDefPath}`);
await writeFile(nodeApiDefPath, getNodeApiDef());

const jsNativeApiDefPath = resolvePath(__dirname, '../js_native_api.def');
console.log(`Writing Windows .def file to ${jsNativeApiDefPath}`);
await writeFile(jsNativeApiDefPath, getJsNativeApiDef());
}

main().catch(e => {
console.error(e);
process.exitCode = 1;
});
Morty Proxy This is a proxified and sanitized view of the page, visit original site.