diff --git a/.circleci/config.yml b/.circleci/config.yml index d24af046..5e25c505 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -108,6 +108,6 @@ workflows: matrix: parameters: # os: ['linux', 'linux-arm', 'macos'] - os: ['linux-arm'] + os: ['linux', 'linux-arm'] node-version: ['14', '16' ,'18', '20', '22', '23'] diff --git a/.github/actions/build-node/action.yml b/.github/actions/build-node/action.yml index 8dce0772..039e7f1e 100644 --- a/.github/actions/build-node/action.yml +++ b/.github/actions/build-node/action.yml @@ -17,7 +17,7 @@ runs: uses: ./.github/actions/setup-env with: node: 20 - os: windows-2022 + os: ${{ inputs.os }} - name: Get latest Node.js version for v${{ inputs.node }} id: node-test-version @@ -37,12 +37,18 @@ runs: script: | try { const fs = require('fs') - if(${{ inputs.node }} <23){ - fs.mkdirSync('release/ia32/${{ inputs.node }}', { recursive: true }); + if('${{ runner.os }}' == 'Windows'){ + if(${{ inputs.node }} <23){ + fs.mkdirSync('release/win32/ia32/${{ inputs.node }}', { recursive: true }); + } + fs.mkdirSync('release/win32/x64/${{ inputs.node }}', { recursive: true }); + if(${{ inputs.node }} >=20){ + fs.mkdirSync('release/win32/arm64/${{ inputs.node }}', { recursive: true }); + } } - fs.mkdirSync('release/x64/${{ inputs.node }}', { recursive: true }); - if(${{ inputs.node }} >=20){ - fs.mkdirSync('release/arm64/${{ inputs.node }}', { recursive: true }); + else if('${{ runner.os }}' == 'macOS'){ + fs.mkdirSync(`release/${process.platform}/x64/${{ inputs.node }}`, { recursive: true }); + fs.mkdirSync(`release/${process.platform}/arm64/${{ inputs.node }}`, { recursive: true }); } } catch(err) { core.error("Error creating release directory") @@ -56,19 +62,26 @@ runs: script: | try { const fs = require('fs') - if(${{ inputs.node }} <23){ - fs.writeFileSync('release/ia32/${{ inputs.node }}/node.version', '${{ steps.node-test-version.outputs.node-version }}'); + if('${{ runner.os }}' == 'Windows'){ + if(${{ inputs.node }} <23){ + fs.writeFileSync('release/win32/ia32/${{ inputs.node }}/node.version', '${{ steps.node-test-version.outputs.node-version }}'); + } + fs.writeFileSync('release/win32/x64/${{ inputs.node }}/node.version', '${{ steps.node-test-version.outputs.node-version }}'); + if(${{ inputs.node }} >=20){ + fs.writeFileSync('release/win32/arm64/${{ inputs.node }}/node.version', '${{ steps.node-test-version.outputs.node-version }}'); + } } - fs.writeFileSync('release/x64/${{ inputs.node }}/node.version', '${{ steps.node-test-version.outputs.node-version }}'); - if(${{ inputs.node }} >=20){ - fs.writeFileSync('release/arm64/${{ inputs.node }}/node.version', '${{ steps.node-test-version.outputs.node-version }}'); + else if('${{ runner.os }}' == 'macOS'){ + fs.writeFileSync(`release/${process.platform}/x64/${{ inputs.node }}/node.version`, '${{ steps.node-test-version.outputs.node-version }}'); + fs.writeFileSync(`release/${process.platform}/arm64/${{ inputs.node }}/node.version`, '${{ steps.node-test-version.outputs.node-version }}'); } } catch(err) { core.error("Error writing node.version file") core.setFailed(err) } - - name: Cache node-gyp + - name: Cache node-gyp Windows + if: runner.os == 'Windows' uses: actions/cache@v4 env: cache-name: cache-node-gyp @@ -76,8 +89,17 @@ runs: path: ~\AppData\Local\node-gyp\Cache key: ${{ steps.node-test-version.outputs.node-version }} + - name: Cache node-gyp macOS + if: runner.os == 'macOS' + uses: actions/cache@v4 + env: + cache-name: cache-node-gyp + with: + path: ~/Library/Caches/node-gyp + key: '${{ inputs.os }}-${{ inputs.node}}' + - name: Build ia32 - if: ${{ inputs.node <23 }} + if: (runner.os == 'Windows') && (inputs.node <23) uses: ./.github/actions/build with: node: ${{ steps.node-test-version.outputs.node-version }} @@ -92,7 +114,7 @@ runs: arch: 'x64' - name: Build arm64 - if: ${{ inputs.node >=20 }} + if: (inputs.node >=20) || (runner.os == 'macOS') uses: ./.github/actions/build with: node: ${{ steps.node-test-version.outputs.node-version }} @@ -101,8 +123,17 @@ runs: - name: Upload artifacts uses: actions/upload-artifact@v4 - if: success() + if: runner.os == 'Windows' && success() + with: + name: win32-edge-js-${{ inputs.node }} + path: | + release + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + if: runner.os == 'macOS' && success() with: - name: edge-js-${{ inputs.node }} + name: darwin-edge-js-${{ inputs.node }} path: | release + diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index ac655c41..8642d1d5 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -20,12 +20,19 @@ runs: run: | node-gyp configure --target=${{ inputs.node }} --runtime=node --release --arch=${{ inputs.arch }} - if ( '${{ inputs.arch }}' -eq 'arm64'){ + if ( '${{ inputs.arch }}' -eq 'arm64' -And '${{ runner.os }}' -eq 'Windows'){ (Get-Content -Raw build/build_managed.vcxproj) -replace 'Strict', '' | Out-File -Encoding Utf8 build/build_managed.vcxproj (Get-Content -Raw build/edge_coreclr.vcxproj) -replace 'Strict', '' | Out-File -Encoding Utf8 build/edge_coreclr.vcxproj (Get-Content -Raw build/edge_nativeclr.vcxproj) -replace 'Strict', '' | Out-File -Encoding Utf8 build/edge_nativeclr.vcxproj } node-gyp build - cmd /c copy /y build\Release\edge_*.node release\${{ inputs.arch }}\${{ inputs.node-major }} - cmd /c rmdir /S /Q build + if ( '${{ runner.os }}' -eq 'Windows'){ + cmd /c copy /y build\Release\edge_*.node release\win32\${{ inputs.arch }}\${{ inputs.node-major }} + cmd /c rmdir /S /Q build + } + + if ( '${{ runner.os }}' -eq 'macOS'){ + Copy-Item "build/Release/edge_coreclr.node" -Destination "release/darwin/${{ inputs.arch }}/${{ inputs.node-major }}" + node-gyp clean + } diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml index 72d0c588..b3347e27 100644 --- a/.github/actions/setup-env/action.yml +++ b/.github/actions/setup-env/action.yml @@ -28,16 +28,16 @@ runs: path: ~/.cache/node-gyp key: '${{ inputs.os }}-${{ inputs.node}}' - - name: Cache node-gyp macOs - if: runner.os == 'macOS' - uses: actions/cache@v4 - env: - cache-name: cache-node-gyp - with: - path: ~/Library/Caches/node-gyp - key: '${{ inputs.os }}-${{ inputs.node}}' + # - name: Cache node-gyp macOs + # if: runner.os == 'macOS' + # uses: actions/cache@v4 + # env: + # cache-name: cache-node-gyp + # with: + # path: ~/Library/Caches/node-gyp + # key: '${{ inputs.os }}-${{ inputs.node}}' + - - name: Cache node modules id: cache-nodemodules uses: actions/cache@v4 @@ -57,6 +57,12 @@ runs: run: | node -v && npm -v && dotnet --version && node -p process.platform && node -p process.arch + - if: runner.os == 'macOS' && inputs.node <= 16 + shell: bash + name: Add missing packages for macOS NodeJs 16 + run: | + pip install setuptools + - name: npm install shell: bash run: npm i diff --git a/.github/actions/test-build/action.yml b/.github/actions/test-build/action.yml index 18f85b5f..a8564ca8 100644 --- a/.github/actions/test-build/action.yml +++ b/.github/actions/test-build/action.yml @@ -13,43 +13,120 @@ runs: using: "composite" steps: - - name: Setup env - uses: ./.github/actions/setup-env - with: - node: ${{ inputs.node }} - os: ${{ inputs.os }} - - name: Create release folder + if: runner.os == 'Windows' shell: pwsh run: | cmd /c if not exist "lib\native\win32\ia32\${{ inputs.node }}" mkdir "lib\native\win32\ia32\${{ inputs.node }}" cmd /c if not exist "lib\native\win32\x64\${{ inputs.node }}" mkdir "lib\native\win32\x64\${{ inputs.node }}" cmd /c if not exist "lib\native\win32\arm64\${{ inputs.node }}" mkdir "lib\native\win32\arm64\${{ inputs.node }}" + - name: Create release folder + if: runner.os == 'macOS' + uses: actions/github-script@v7 + with: + result-encoding: string + script: | + try { + const fs = require('fs') + fs.mkdirSync('lib/native/darwin/x64/${{ inputs.node }}', { recursive: true }); + fs.mkdirSync('lib/native/darwin/arm64/${{ inputs.node }}', { recursive: true }); + } catch(err) { + core.error("Error creating release directory") + core.setFailed(err) + } + + - name: Download artifacts + if: runner.os == 'Windows' + uses: actions/download-artifact@v4 + with: + path: release + pattern: win32-edge-js-${{ inputs.node }}* + - name: Download artifacts + if: runner.os == 'macOS' uses: actions/download-artifact@v4 with: path: release - pattern: edge-js-${{ inputs.node }}* + pattern: darwin-edge-js-${{ inputs.node }}* - name: List artifacts shell: bash run: ls -R release - name: Copy artifacts + if: runner.os == 'Windows' shell: pwsh run: | - cmd /c copy /y release\edge-js-${{ inputs.node }}\x64\${{ inputs.node }}\edge_*.node lib\native\win32\x64\${{ inputs.node }} + cmd /c copy /y release\win32-edge-js-${{ inputs.node }}\win32\x64\${{ inputs.node }}\edge_*.node lib\native\win32\x64\${{ inputs.node }} + + - name: Copy artifacts + if: runner.os == 'macOS' + uses: actions/github-script@v7 + with: + result-encoding: string + script: | + try { + const fs = require('fs') + fs.copyFileSync('release/darwin-edge-js-${{ inputs.node }}/darwin/x64/${{ inputs.node }}/edge_coreclr.node', 'lib/native/darwin/x64/${{ inputs.node }}/edge_coreclr.node'); + fs.copyFileSync('release/darwin-edge-js-${{ inputs.node }}/darwin/arm64/${{ inputs.node }}/edge_coreclr.node', 'lib/native/darwin/arm64/${{ inputs.node }}/edge_coreclr.node'); + } catch(err) { + core.error("Error creating release directory") + core.setFailed(err) + } - - name: Test - uses: ./.github/actions/test-windows + - name: Setup env + uses: ./.github/actions/setup-env with: node: ${{ inputs.node }} - + os: ${{ inputs.os }} + + - name: Check edge-js Windows pre-built files + if: runner.os == 'Windows' + uses: andstor/file-existence-action@v3 + with: + files: "lib/native/win32/${{ runner.arch }}/${{ inputs.node }}/edge_coreclr.node, lib/native/win32/${{ runner.arch }}/${{ inputs.node }}/edge_nativeclr.node" + fail: true + ignore_case: true + + - name: Check edge-js macOS pre-built files + if: runner.os == 'macOS' + uses: andstor/file-existence-action@v3 + with: + files: "lib/native/darwin/${{ runner.arch }}/${{ inputs.node }}/edge_coreclr.node" + fail: true + ignore_case: true + + - name: Run .NET 4.5 tests + if: runner.os == 'Windows' + shell: bash + run: node tools/test.js CI + + - name: "Run .net core tests" + shell: bash + run: node tools/test.js CI + env: + EDGE_USE_CORECLR: 1 + - name: Test report uses: ./.github/actions/create-test-report with: node: ${{ inputs.node }} os: ${{ inputs.os }} name: 'build-tests' - \ No newline at end of file + + - name: publish test-summary nacOS + if: runner.os == 'macOS' + uses: EnricoMi/publish-unit-test-result-action/macos@v2 + with: + check_run_annotations: 'none' + check_name: 'test-summary node-${{ inputs.node }} ${{ inputs.os }}' + files: "test-results.xml" + + - name: publish test-summary Windows + if: runner.os == 'Windows' + uses: EnricoMi/publish-unit-test-result-action/windows@v2 + with: + check_run_annotations: 'none' + check_name: 'test-summary node-${{ inputs.node }} ${{ inputs.os }}' + files: "test-results.xml" diff --git a/.github/actions/test-windows/action.yml b/.github/actions/test-windows/action.yml deleted file mode 100644 index 24ee053b..00000000 --- a/.github/actions/test-windows/action.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: 'Test Windows' -description: 'Runs Windows tests' -inputs: - node: - description: 'Node.js version' - required: true - -runs: - using: "composite" - steps: - - uses: agracio/github-substring-action@v1.0.0 - id: node_version - with: - value: "${{ inputs.node }}" - length_from_start: 2 - - - name: Check edge-js Windows pre-built files - uses: andstor/file-existence-action@v3 - with: - files: "lib/native/win32/${{ runner.arch }}/${{ steps.node_version.outputs.substring }}/edge_coreclr.node, lib/native/win32/${{ runner.arch }}/${{ steps.node_version.outputs.substring }}/edge_nativeclr.node" - fail: true - ignore_case: true - - - name: Run .NET 4.5 tests - shell: bash - run: node tools/test.js CI - - - name: "Run .net core tests" - shell: bash - run: node tools/test.js CI - env: - EDGE_USE_CORECLR: 1 - diff --git a/.github/workflows/build-all.yml b/.github/workflows/build-all.yml index cd740ebd..55b22f05 100644 --- a/.github/workflows/build-all.yml +++ b/.github/workflows/build-all.yml @@ -11,11 +11,13 @@ env: jobs: build-16: - runs-on: windows-2022 timeout-minutes: 20 strategy: - fail-fast: false - name: build node-16 + fail-fast: false + matrix: + os: [windows-2022, macos-15] + runs-on: ${{ matrix.os }} + name: build node-16 ${{ matrix.os }} steps: - name: Checkout code @@ -25,14 +27,16 @@ jobs: uses: ./.github/actions/build-node with: node: 16 - os: ${{ runner.os }} + os: ${{ matrix.os }} build-18: - runs-on: windows-2022 timeout-minutes: 20 strategy: - fail-fast: false - name: build node-18 + fail-fast: false + matrix: + os: [windows-2022, macos-15] + runs-on: ${{ matrix.os }} + name: build node-18 ${{ matrix.os }} steps: - name: Checkout code @@ -42,14 +46,16 @@ jobs: uses: ./.github/actions/build-node with: node: 18 - os: ${{ runner.os }} + os: ${{ matrix.os }} build-20: - runs-on: windows-2022 timeout-minutes: 20 strategy: - fail-fast: false - name: build node-20 + fail-fast: false + matrix: + os: [windows-2022, macos-15] + runs-on: ${{ matrix.os }} + name: build node-20 ${{ matrix.os }} steps: - name: Checkout code @@ -59,14 +65,16 @@ jobs: uses: ./.github/actions/build-node with: node: 20 - os: ${{ runner.os }} + os: ${{ matrix.os }} build-22: - runs-on: windows-2022 timeout-minutes: 20 strategy: fail-fast: false - name: build node-22 + matrix: + os: [windows-2022, macos-15] + runs-on: ${{ matrix.os }} + name: build node-22 ${{ matrix.os }} steps: - name: Checkout code @@ -76,14 +84,15 @@ jobs: uses: ./.github/actions/build-node with: node: 22 - os: ${{ runner.os }} + os: ${{ matrix.os }} build-23: - runs-on: windows-2022 - timeout-minutes: 20 strategy: - fail-fast: false - name: build node-23 + fail-fast: false + matrix: + os: [windows-2022, macos-15] + runs-on: ${{ matrix.os }} + name: build node-23 ${{ matrix.os }} steps: - name: Checkout code @@ -93,17 +102,17 @@ jobs: uses: ./.github/actions/build-node with: node: 23 - os: ${{ runner.os }} + os: ${{ matrix.os }} test-16: strategy: fail-fast: false matrix: - os: [windows-2022] + os: [windows-2022, macos-13, macos-15] runs-on: ${{ matrix.os }} needs: build-16 - name: test ${{ matrix.os }}-node-16 + name: test node-16 ${{ matrix.os }} steps: - name: Checkout code @@ -119,11 +128,11 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2022] + os: [windows-2022, macos-13, macos-15] runs-on: ${{ matrix.os }} needs: build-18 - name: test ${{ matrix.os }}-node-18 + name: test node-18 ${{ matrix.os }} steps: - name: Checkout code @@ -139,11 +148,11 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2022] + os: [windows-2022, macos-13, macos-15] runs-on: ${{ matrix.os }} needs: build-20 - name: test ${{ matrix.os }}-node-20 + name: test node-20 ${{ matrix.os }} steps: - name: Checkout code @@ -159,11 +168,11 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2022] + os: [windows-2022, macos-13, macos-15] runs-on: ${{ matrix.os }} needs: build-22 - name: test ${{ matrix.os }}-node-22 + name: test node-22 ${{ matrix.os }} steps: - name: Checkout code @@ -179,11 +188,11 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2022] + os: [windows-2022, macos-13, macos-15] runs-on: ${{ matrix.os }} needs: build-23 - name: test ${{ matrix.os }}-node-23 + name: test node-23 ${{ matrix.os }} steps: - name: Checkout code diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c5f5aded..f2e8a3d8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,7 @@ on: - 20 - 22 - 23 + - 24 env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 @@ -21,13 +22,16 @@ env: jobs: build: - runs-on: windows-2022 + runs-on: ${{ matrix.os }} # outputs: # node-version: ${{ steps.node-test-version.outputs.node-version }} strategy: + matrix: + # os: [windows-2022, macos-14] + os: [windows-2022, macos-15] fail-fast: true - name: build node-${{ inputs.build-version }} + name: build node-${{ inputs.build-version }} ${{ matrix.os }} steps: - name: Checkout code @@ -37,17 +41,18 @@ jobs: uses: ./.github/actions/build-node with: node: ${{ inputs.build-version }} - os: ${{ runner.os }} + os: ${{ matrix.os }} test: runs-on: ${{ matrix.os }} needs: build strategy: matrix: - os: [windows-2022] - # fail-fast: false + # os: [windows-2022] + os: [windows-2022, macos-13, macos-15] + fail-fast: false - name: test ${{ matrix.os }}-node-${{ inputs.build-version }} + name: test node-${{ inputs.build-version }} ${{ matrix.os }} steps: - name: Checkout code diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7a0ab933..3047b19c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -71,7 +71,6 @@ on: - '*.sln' - '*.vcxproj' - env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true # required to setup CSC DOTNET_CLI_TELEMETRY_OPTOUT: 1 @@ -84,10 +83,10 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-13, macos-14, ubuntu-22.04, ubuntu-22.04-arm, windows-2022] - # os: [macos-14, windows-2022] + os: [macos-13, macos-15, ubuntu-24.04, ubuntu-24.04-arm, windows-2022] + # os: [macos-13, macos-15] + # node: [18, 20, 22, 23] node: [18, 20, 22, 23] - steps: - name: Checkout code @@ -104,14 +103,13 @@ jobs: # run: | # pip install setuptools - - if: runner.os == 'Windows' - name: Run Windows tests - uses: ./.github/actions/test-windows - with: - node: ${{ matrix.node }} + - if: runner.os == 'Windows' + name: Run .NET 4.5 tests + shell: bash + run: node tools/test.js CI - if: runner.os == 'macOS' || runner.os == 'Linux' - name: "Run macOS|Linux tests" + name: "Run .net core tests" run: node tools/test.js CI env: EDGE_USE_CORECLR: 1 diff --git a/lib/edge.js b/lib/edge.js index 36db3e18..dd84b5fe 100644 --- a/lib/edge.js +++ b/lib/edge.js @@ -27,6 +27,15 @@ else if (fs.existsSync(builtEdge)) { else if (process.platform === 'win32') { edgeNative = path.resolve(__dirname, './native/' + process.platform + '/' + process.arch + '/' + determineVersion() + '/' + (process.env.EDGE_USE_CORECLR ? 'edge_coreclr' : 'edge_nativeclr')); } +else if(process.platform === 'darwin'){ + edgeNative = path.resolve(__dirname, './native/' + process.platform + '/' + process.arch + '/' + nodeVersion + '/' + 'edge_coreclr.node'); + if(!fs.existsSync(edgeNative)){ + edgeNative = builtEdge; + if(!fs.existsSync(edgeNative)){ + throw new Error(`Failed to build edge-js for `+ process.platform + '-' + process.arch + ' v' + process.versions.node); + } + } +} else { throw new Error('The edge native module is not available at ' + builtEdge + '. You can use EDGE_NATIVE environment variable to provide alternate location of edge.node. ' @@ -45,7 +54,7 @@ if (process.env.EDGE_USE_CORECLR && !process.env.EDGE_BOOTSTRAP_DIR && fs.exists } process.env.EDGE_NATIVE = edgeNative; - +//console.log('edgeNative', edgeNative) edge = require(edgeNative); exports.func = function(language, options) { diff --git a/lib/native/darwin/arm64/16/edge_coreclr.node b/lib/native/darwin/arm64/16/edge_coreclr.node new file mode 100644 index 00000000..8cee8ef4 Binary files /dev/null and b/lib/native/darwin/arm64/16/edge_coreclr.node differ diff --git a/lib/native/darwin/arm64/16/node.version b/lib/native/darwin/arm64/16/node.version new file mode 100644 index 00000000..1b497a7b --- /dev/null +++ b/lib/native/darwin/arm64/16/node.version @@ -0,0 +1 @@ +16.20.2 \ No newline at end of file diff --git a/lib/native/darwin/arm64/18/edge_coreclr.node b/lib/native/darwin/arm64/18/edge_coreclr.node new file mode 100644 index 00000000..c84b8728 Binary files /dev/null and b/lib/native/darwin/arm64/18/edge_coreclr.node differ diff --git a/lib/native/darwin/arm64/18/node.version b/lib/native/darwin/arm64/18/node.version new file mode 100644 index 00000000..df99549c --- /dev/null +++ b/lib/native/darwin/arm64/18/node.version @@ -0,0 +1 @@ +18.20.7 \ No newline at end of file diff --git a/lib/native/darwin/arm64/20/edge_coreclr.node b/lib/native/darwin/arm64/20/edge_coreclr.node new file mode 100644 index 00000000..5b3fb3d2 Binary files /dev/null and b/lib/native/darwin/arm64/20/edge_coreclr.node differ diff --git a/lib/native/darwin/arm64/20/node.version b/lib/native/darwin/arm64/20/node.version new file mode 100644 index 00000000..b3e86173 --- /dev/null +++ b/lib/native/darwin/arm64/20/node.version @@ -0,0 +1 @@ +20.18.3 \ No newline at end of file diff --git a/lib/native/darwin/arm64/22/edge_coreclr.node b/lib/native/darwin/arm64/22/edge_coreclr.node new file mode 100644 index 00000000..a680b717 Binary files /dev/null and b/lib/native/darwin/arm64/22/edge_coreclr.node differ diff --git a/lib/native/darwin/arm64/22/node.version b/lib/native/darwin/arm64/22/node.version new file mode 100644 index 00000000..adb55585 --- /dev/null +++ b/lib/native/darwin/arm64/22/node.version @@ -0,0 +1 @@ +22.14.0 \ No newline at end of file diff --git a/lib/native/darwin/x64/16/edge_coreclr.node b/lib/native/darwin/x64/16/edge_coreclr.node new file mode 100644 index 00000000..01df610e Binary files /dev/null and b/lib/native/darwin/x64/16/edge_coreclr.node differ diff --git a/lib/native/darwin/x64/16/node.version b/lib/native/darwin/x64/16/node.version new file mode 100644 index 00000000..1b497a7b --- /dev/null +++ b/lib/native/darwin/x64/16/node.version @@ -0,0 +1 @@ +16.20.2 \ No newline at end of file diff --git a/lib/native/darwin/x64/18/edge_coreclr.node b/lib/native/darwin/x64/18/edge_coreclr.node new file mode 100644 index 00000000..a5831a88 Binary files /dev/null and b/lib/native/darwin/x64/18/edge_coreclr.node differ diff --git a/lib/native/darwin/x64/18/node.version b/lib/native/darwin/x64/18/node.version new file mode 100644 index 00000000..df99549c --- /dev/null +++ b/lib/native/darwin/x64/18/node.version @@ -0,0 +1 @@ +18.20.7 \ No newline at end of file diff --git a/lib/native/darwin/x64/20/edge_coreclr.node b/lib/native/darwin/x64/20/edge_coreclr.node new file mode 100644 index 00000000..be01b242 Binary files /dev/null and b/lib/native/darwin/x64/20/edge_coreclr.node differ diff --git a/lib/native/darwin/x64/20/node.version b/lib/native/darwin/x64/20/node.version new file mode 100644 index 00000000..b3e86173 --- /dev/null +++ b/lib/native/darwin/x64/20/node.version @@ -0,0 +1 @@ +20.18.3 \ No newline at end of file diff --git a/lib/native/darwin/x64/22/edge_coreclr.node b/lib/native/darwin/x64/22/edge_coreclr.node new file mode 100644 index 00000000..f9ce5498 Binary files /dev/null and b/lib/native/darwin/x64/22/edge_coreclr.node differ diff --git a/lib/native/darwin/x64/22/node.version b/lib/native/darwin/x64/22/node.version new file mode 100644 index 00000000..adb55585 --- /dev/null +++ b/lib/native/darwin/x64/22/node.version @@ -0,0 +1 @@ +22.14.0 \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 624740a5..855c0857 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "edge-js", - "version": "23.1.5", + "version": "23.1.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "edge-js", - "version": "23.1.5", + "version": "23.1.6", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index a150695a..6bf76fa8 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "url": "http://tomasz.janczuk.org", "twitter": "tjanczuk" }, - "version": "23.1.5", + "version": "23.1.6", "description": "Edge.js: run .NET and Node.js in-process on Windows, Mac OS, and Linux", "tags": [ "owin", diff --git a/tools/checkplatform.js b/tools/checkplatform.js index 8fcbb51b..93210ecf 100644 --- a/tools/checkplatform.js +++ b/tools/checkplatform.js @@ -7,4 +7,4 @@ catch (e) { console.log('***************************************'); } -console.log('Success: platform check for edge.js: node.js ' + process.arch + ' v' + process.versions.node); +console.log('Success: platform check for edge.js: ' + process.platform + '-' + process.arch + ' v' + process.versions.node); diff --git a/tools/install.js b/tools/install.js index 930b817c..0f6747f2 100644 --- a/tools/install.js +++ b/tools/install.js @@ -1,10 +1,10 @@ -var fs = require('fs') +const fs = require('fs') , path = require('path') , spawn = require('child_process').spawn , whereis = require('./whereis'); if (process.platform === 'win32') { - var libroot = path.resolve(__dirname, '../lib/native/win32') + const libroot = path.resolve(__dirname, '../lib/native/win32') , lib32bit = path.resolve(libroot, 'ia32') , lib64bit = path.resolve(libroot, 'x64') , libarm64 = path.resolve(libroot, 'arm64'); @@ -47,16 +47,16 @@ if (process.platform === 'win32') { .map(getPath); } - var redist = [ + const redist = [ 'concrt140.dll', 'msvcp140.dll', 'vccorlib140.dll', 'vcruntime140.dll', ]; - var dest32dirs = getDestDirs(lib32bit); - var dest64dirs = getDestDirs(lib64bit); - var destarmdirs = getDestDirs(libarm64); + const dest32dirs = getDestDirs(lib32bit); + const dest64dirs = getDestDirs(lib64bit); + const destarmdirs = getDestDirs(libarm64); function copyRedist(lib, destDirs){ redist.forEach(function (dllname) { @@ -69,7 +69,7 @@ if (process.platform === 'win32') { copyRedist(lib64bit, dest64dirs); copyRedist(libarm64, destarmdirs); - var dotnetPath = whereis('dotnet', 'dotnet.exe'); + const dotnetPath = whereis('dotnet', 'dotnet.exe'); if (dotnetPath) { spawn(dotnetPath, ['restore'], { stdio: 'inherit', cwd: path.resolve(__dirname, '..', 'lib', 'bootstrap') }) @@ -87,5 +87,22 @@ if (process.platform === 'win32') { } else { - spawn('node-gyp', ['configure', 'build'], { stdio: 'inherit' }); + if(process.platform === 'darwin'){ + + const nodeVersion = process.versions.node.split(".")[0] + const edjeNative = path.resolve(__dirname, '../lib/native/' + process.platform + '/' + process.arch + '/' + nodeVersion + '/' + 'edge_coreclr.node'); + + if(fs.existsSync(edjeNative)){ + spawn('dotnet', ['build', '--configuration', 'Release'], { stdio: 'inherit', cwd: path.resolve(__dirname, '..', 'lib', 'bootstrap') }) + .on('close', function() { + require('./checkplatform'); + }); + } + else{ + spawn('node-gyp', ['configure', 'build'], { stdio: 'inherit' }); + } + } + else{ + spawn('node-gyp', ['configure', 'build'], { stdio: 'inherit' }); + } }