From bbebb2d37a311caba63e0f3b7a54e064c592f8f0 Mon Sep 17 00:00:00 2001 From: Scott M Anderson Date: Sat, 20 Sep 2025 10:04:24 -0600 Subject: [PATCH 1/9] git submodule add https://github.com/externpro/externpro .devcontainer --- .devcontainer | 1 + .gitmodules | 3 +++ 2 files changed, 4 insertions(+) create mode 160000 .devcontainer create mode 100644 .gitmodules diff --git a/.devcontainer b/.devcontainer new file mode 160000 index 000000000..57229e338 --- /dev/null +++ b/.devcontainer @@ -0,0 +1 @@ +Subproject commit 57229e33846c3e7a6551fc586caed80b8b213cb8 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..18932abfb --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule ".devcontainer"] + path = .devcontainer + url = https://github.com/externpro/externpro From 50392d75fe8ecba74a39e5d3a5366f529d2f2470 Mon Sep 17 00:00:00 2001 From: Scott M Anderson Date: Sat, 20 Sep 2025 10:05:41 -0600 Subject: [PATCH 2/9] docker-compose links --- docker-compose.sh | 1 + docker-compose.yml | 1 + 2 files changed, 2 insertions(+) create mode 120000 docker-compose.sh create mode 120000 docker-compose.yml diff --git a/docker-compose.sh b/docker-compose.sh new file mode 120000 index 000000000..85f182f0b --- /dev/null +++ b/docker-compose.sh @@ -0,0 +1 @@ +.devcontainer/compose.pro.sh \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 120000 index 000000000..46c1f8918 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1 @@ +.devcontainer/compose.bld.yml \ No newline at end of file From eaf2fe73fd01011a59bc5911c79e467408b41aa3 Mon Sep 17 00:00:00 2001 From: Scott M Anderson Date: Sat, 20 Sep 2025 10:06:36 -0600 Subject: [PATCH 3/9] cp .devcontainer/cmake/presets/CMakePresets* . --- CMakePresets.json | 8 ++++++++ CMakePresetsBase.json | 10 ++++++++++ 2 files changed, 18 insertions(+) create mode 100644 CMakePresets.json create mode 100644 CMakePresetsBase.json diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 000000000..f82cfdd2c --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,8 @@ +{ + "version": 8, + "include": [ + ".devcontainer/cmake/presets/xpLinuxNinja.json", + ".devcontainer/cmake/presets/xpDarwinNinja.json", + ".devcontainer/cmake/presets/xpWindowsVs2022.json" + ] +} diff --git a/CMakePresetsBase.json b/CMakePresetsBase.json new file mode 100644 index 000000000..09653d8ae --- /dev/null +++ b/CMakePresetsBase.json @@ -0,0 +1,10 @@ +{ + "version": 8, + "configurePresets": [ + { + "name": "config-base", + "hidden": true, + "binaryDir": "${sourceDir}/_bld-${presetName}" + } + ] +} From b91cf5ecf0af06141a9dc4bf55907bceac0ee869 Mon Sep 17 00:00:00 2001 From: Scott M Anderson Date: Sat, 20 Sep 2025 10:08:55 -0600 Subject: [PATCH 4/9] gitignore: add externpro ignores --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index a154db646..b28a7c62f 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,11 @@ /test/require_basic_finalizers/addons /.vscode +# externpro +.env +_bld*/ +docker-compose.override.yml + # ignore node-gyp generated files outside its build directory /test/*.Makefile /test/*.mk From e82d290958e82d8da9fb96a4e772f0567ec4d685 Mon Sep 17 00:00:00 2001 From: Scott M Anderson Date: Sat, 20 Sep 2025 10:10:34 -0600 Subject: [PATCH 5/9] externpro github/workflows @25.05.1 cp .devcontainer/.github/wf-templates/xp*.yml .github/workflows --- .github/workflows/xpbuild.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/xprelease.yml | 20 ++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/xpbuild.yml create mode 100644 .github/workflows/xprelease.yml diff --git a/.github/workflows/xpbuild.yml b/.github/workflows/xpbuild.yml new file mode 100644 index 000000000..151d481d2 --- /dev/null +++ b/.github/workflows/xpbuild.yml @@ -0,0 +1,30 @@ +name: Build +on: + push: + branches: [ "dev" ] + pull_request: + branches: [ "dev" ] + workflow_dispatch: +jobs: + linux: + uses: externpro/externpro/.github/workflows/build-linux.yml@25.05.1 + with: + cmake-workflow-preset: Linux + runon: ubuntu-latest + secrets: inherit + linux-arm64: + uses: externpro/externpro/.github/workflows/build-linux.yml@25.05.1 + with: + cmake-workflow-preset: Linux + runon: ubuntu-24.04-arm + secrets: inherit + macos: + uses: externpro/externpro/.github/workflows/build-macos.yml@25.05.1 + with: + cmake-workflow-preset: Darwin + secrets: inherit + windows: + uses: externpro/externpro/.github/workflows/build-windows.yml@25.05.1 + with: + cmake-workflow-preset: Windows + secrets: inherit diff --git a/.github/workflows/xprelease.yml b/.github/workflows/xprelease.yml new file mode 100644 index 000000000..f868a82e5 --- /dev/null +++ b/.github/workflows/xprelease.yml @@ -0,0 +1,20 @@ +name: Release +on: + workflow_dispatch: + inputs: + workflow_run_url: + description: 'URL of the workflow run containing artifacts to upload (e.g., https://github.com/owner/repo/actions/runs/123456789)' + required: true + type: string +jobs: + # Upload build artifacts as release assets + release-from-build: + uses: externpro/externpro/.github/workflows/release-from-build.yml@25.05.1 + with: + workflow_run_url: ${{ github.event.inputs.workflow_run_url }} + artifact_pattern: "*.tar.xz" + permissions: + contents: write + id-token: write + attestations: write + secrets: inherit From c5db9e06fbdf7959e9a65fbf66f7b27331278da5 Mon Sep 17 00:00:00 2001 From: Scott M Anderson Date: Sat, 20 Sep 2025 10:17:36 -0600 Subject: [PATCH 6/9] upstream github/workflows on: workflow_dispatch --- .github/workflows/ci-win.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/dependency-review.yml | 2 +- .github/workflows/linter.yml | 2 +- .github/workflows/node-api-headers.yml | 2 +- .github/workflows/stale.yml | 4 +--- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-win.yml b/.github/workflows/ci-win.yml index 9bdc87f5d..3a1e9f871 100644 --- a/.github/workflows/ci-win.yml +++ b/.github/workflows/ci-win.yml @@ -1,6 +1,6 @@ name: Node.js CI Windows Platform -on: [push, pull_request] +on: [workflow_dispatch] env: PYTHON_VERSION: '3.11' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93b3595a3..1d4b14729 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: Node.js CI Unix Platform -on: [push, pull_request] +on: [workflow_dispatch] env: PYTHON_VERSION: '3.11' diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index d0aa2289d..41ac6f31c 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -7,7 +7,7 @@ # # Source repository: https://github.com/actions/dependency-review-action name: 'Dependency Review' -on: [pull_request] +on: [workflow_dispatch] permissions: contents: read diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index e3f307c5f..ff0d27926 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -1,6 +1,6 @@ name: Style Checks -on: [push, pull_request] +on: [workflow_dispatch] permissions: contents: read diff --git a/.github/workflows/node-api-headers.yml b/.github/workflows/node-api-headers.yml index 5cc8bbdd8..5cee168a3 100644 --- a/.github/workflows/node-api-headers.yml +++ b/.github/workflows/node-api-headers.yml @@ -1,6 +1,6 @@ name: Node.js CI with node-api-headers -on: [push, pull_request] +on: [workflow_dispatch] env: PYTHON_VERSION: '3.11' diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 9efdeb9d3..a3cfd49bc 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,7 +1,5 @@ name: "Close stale issues" -on: - schedule: - - cron: "0 0 * * *" +on: [workflow_dispatch] permissions: contents: read From 0b035da9f1bc0e67b094525d643efff6a3874e35 Mon Sep 17 00:00:00 2001 From: Scott M Anderson Date: Sat, 20 Sep 2025 10:21:46 -0600 Subject: [PATCH 7/9] xpbuild: cmake-workflow-preset Release --- .github/workflows/xpbuild.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/xpbuild.yml b/.github/workflows/xpbuild.yml index 151d481d2..fb5575822 100644 --- a/.github/workflows/xpbuild.yml +++ b/.github/workflows/xpbuild.yml @@ -9,22 +9,22 @@ jobs: linux: uses: externpro/externpro/.github/workflows/build-linux.yml@25.05.1 with: - cmake-workflow-preset: Linux + cmake-workflow-preset: LinuxRelease runon: ubuntu-latest secrets: inherit linux-arm64: uses: externpro/externpro/.github/workflows/build-linux.yml@25.05.1 with: - cmake-workflow-preset: Linux + cmake-workflow-preset: LinuxRelease runon: ubuntu-24.04-arm secrets: inherit macos: uses: externpro/externpro/.github/workflows/build-macos.yml@25.05.1 with: - cmake-workflow-preset: Darwin + cmake-workflow-preset: DarwinRelease secrets: inherit windows: uses: externpro/externpro/.github/workflows/build-windows.yml@25.05.1 with: - cmake-workflow-preset: Windows + cmake-workflow-preset: WindowsRelease secrets: inherit From 009df8c5514c2f411c042437614b308e4ba9f1c3 Mon Sep 17 00:00:00 2001 From: Scott M Anderson Date: Sat, 20 Sep 2025 10:23:51 -0600 Subject: [PATCH 8/9] copy CMakeLists.txt from previous dev branch https://github.com/externpro/node-addon-api/blob/v3.0.2.3/CMakeLists.txt --- CMakeLists.txt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..0b7c172fa --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.31) +set(CMAKE_PROJECT_TOP_LEVEL_INCLUDES .devcontainer/cmake/xproinc.cmake) +project(node-addon-api VERSION 3.0.2) +include(xpflags) +include(GNUInstallDirs) +set(XP_INSTALL_CMAKEDIR ${CMAKE_INSTALL_DATADIR}/cmake) # xpPackageDevel +set(XP_NAMESPACE xpro) +set(targetsFile ${PROJECT_NAME}-targets) +set(lib_name ${PROJECT_NAME}) +xpFindPkg(PKGS nodexp) +xpPackageDevel(TARGETS_FILE ${targetsFile} DEPS nodexp LIBRARIES ${XP_NAMESPACE}::${lib_name}) +######################################## +set(libsrcs + napi-inl.deprecated.h + napi-inl.h + napi.h + ) +######################################## +add_library(${lib_name} INTERFACE ${libsrcs}) +target_include_directories(${lib_name} INTERFACE $) +target_compile_definitions(${lib_name} INTERFACE NODE_ADDON_API_DISABLE_DEPRECATED NAPI_CPP_EXCEPTIONS) +target_link_libraries(${lib_name} INTERFACE ${XP_NAMESPACE}::node) +######################################## +install(TARGETS ${lib_name} EXPORT ${targetsFile}) +install(FILES ${libsrcs} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}) +install(EXPORT ${targetsFile} DESTINATION ${XP_INSTALL_CMAKEDIR} NAMESPACE ${XP_NAMESPACE}::) +install(FILES CHANGELOG.md LICENSE.md README.md DESTINATION ${CMAKE_INSTALL_DATADIR}) +install(DIRECTORY doc DESTINATION ${CMAKE_INSTALL_DATADIR}) From 64babbfb43148963fb0ca9e38f6a7a15c9b53f71 Mon Sep 17 00:00:00 2001 From: Scott M Anderson Date: Sat, 20 Sep 2025 10:28:17 -0600 Subject: [PATCH 9/9] cmake: project() VERSION 8.5.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0b7c172fa..e76c68a25 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.31) set(CMAKE_PROJECT_TOP_LEVEL_INCLUDES .devcontainer/cmake/xproinc.cmake) -project(node-addon-api VERSION 3.0.2) +project(node-addon-api VERSION 8.5.0) include(xpflags) include(GNUInstallDirs) set(XP_INSTALL_CMAKEDIR ${CMAKE_INSTALL_DATADIR}/cmake) # xpPackageDevel