├── .github ├── CODEOWNERS ├── dependabot.yml └── workflows │ ├── check-electron-abi.yml │ ├── release.yml │ ├── semantic.yml │ ├── test.yml │ └── update-abi.yml ├── .gitignore ├── .nvmrc ├── .releaserc.json ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── abi_registry.json ├── getNextTarget.js ├── index.js ├── package.json ├── scripts └── update-abi-registry.js ├── test └── index.js └── yarn.lock /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @electron/wg-ecosystem @electron/wg-releases @electron/wg-upgrades 2 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "monthly" 7 | -------------------------------------------------------------------------------- /.github/workflows/check-electron-abi.yml: -------------------------------------------------------------------------------- 1 | name: Check ABI for Electron Version 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | electron-version: 7 | type: string 8 | description: Electron version to check (e.g. 26.0.0) 9 | required: true 10 | expected-abi: 11 | type: string 12 | description: Expected ABI number (e.g. 117) 13 | required: true 14 | 15 | permissions: {} 16 | 17 | jobs: 18 | build: 19 | runs-on: ubuntu-latest 20 | steps: 21 | - name: Setup Node.js 22 | uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 23 | with: 24 | node-version: lts/* 25 | - name: Create a Temporary package.json 26 | run: npm init --yes 27 | - name: Install latest node-abi 28 | run: npm install --save-dev node-abi 29 | - name: Check ABI for Electron version 30 | uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 31 | with: 32 | script: | 33 | const { getAbi } = await import('${{ github.workspace }}/node_modules/node-abi/index.js'); 34 | 35 | const abi = getAbi('${{ github.event.inputs.electron-version }}', 'electron'); 36 | 37 | if (abi !== '${{ github.event.inputs.expected-abi }}') { 38 | core.error(`Got ABI ${abi}, expected ${{ github.event.inputs.expected-abi }}`); 39 | process.exitCode = 1; 40 | } else { 41 | core.info(`Got expected ABI ${abi}`); 42 | } 43 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | test: 10 | uses: ./.github/workflows/test.yml 11 | 12 | release: 13 | name: Release 14 | runs-on: ubuntu-latest 15 | needs: test 16 | environment: npm 17 | permissions: 18 | id-token: write # for CFA and npm provenance 19 | steps: 20 | - name: Checkout 21 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 22 | with: 23 | persist-credentials: false 24 | - name: Setup Node.js 25 | uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 26 | with: 27 | node-version-file: '.nvmrc' 28 | cache: 'yarn' 29 | - name: Install 30 | run: yarn install --frozen-lockfile 31 | - uses: continuousauth/action@4e8a2573eeb706f6d7300d6a9f3ca6322740b72d # v1.0.5 32 | timeout-minutes: 60 33 | with: 34 | project-id: ${{ secrets.CFA_PROJECT_ID }} 35 | secret: ${{ secrets.CFA_SECRET }} 36 | npm-token: ${{ secrets.NPM_TOKEN }} 37 | -------------------------------------------------------------------------------- /.github/workflows/semantic.yml: -------------------------------------------------------------------------------- 1 | name: "Check Semantic Commit" 2 | 3 | on: 4 | pull_request: 5 | types: 6 | - opened 7 | - edited 8 | - synchronize 9 | 10 | permissions: 11 | contents: read 12 | 13 | jobs: 14 | main: 15 | permissions: 16 | pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs 17 | statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR 18 | name: Validate PR Title 19 | runs-on: ubuntu-latest 20 | steps: 21 | - name: semantic-pull-request 22 | uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3 23 | env: 24 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 25 | with: 26 | validateSingleCommit: false 27 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - main 7 | schedule: 8 | - cron: '0 22 * * 3' 9 | workflow_call: 10 | 11 | permissions: 12 | contents: read 13 | 14 | jobs: 15 | test: 16 | name: Test 17 | strategy: 18 | matrix: 19 | node-version: 20 | - 22.12.x 21 | os: 22 | - macos-latest 23 | - ubuntu-latest 24 | - windows-latest 25 | runs-on: "${{ matrix.os }}" 26 | steps: 27 | - name: Checkout 28 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 29 | - name: Setup Node.js 30 | uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 31 | with: 32 | node-version: "${{ matrix.node-version }}" 33 | cache: 'yarn' 34 | - name: Install 35 | run: yarn install --frozen-lockfile 36 | - name: Test 37 | run: yarn test 38 | -------------------------------------------------------------------------------- /.github/workflows/update-abi.yml: -------------------------------------------------------------------------------- 1 | name: Auto-update ABI JSON file 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: '0 15-23,0-3 * * 1-5' 7 | 8 | jobs: 9 | autoupdate: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Generate GitHub App token 13 | uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1 14 | id: generate-token 15 | with: 16 | creds: ${{ secrets.GH_APP_CREDS }} 17 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 18 | with: 19 | token: ${{ steps.generate-token.outputs.token }} 20 | - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 21 | with: 22 | node-version-file: '.nvmrc' 23 | - name: Get npm cache directory 24 | id: npm-cache 25 | run: | 26 | echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT 27 | - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 28 | with: 29 | path: ${{ steps.npm-cache.outputs.dir }} 30 | key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }} 31 | restore-keys: | 32 | ${{ runner.os }}-node- 33 | - run: npm install --no-package-lock 34 | - name: Update ABI registry 35 | run: | 36 | npm run update-abi-registry 37 | git add abi_registry.json 38 | - name: Commit Changes to ABI registry 39 | uses: dsanders11/github-app-commit-action@43de6da2f4d927e997c0784c7a0b61bd19ad6aac # v1.5.0 40 | with: 41 | fail-on-no-changes: false 42 | message: 'feat: update ABI registry' 43 | token: ${{ steps.generate-token.outputs.token }} 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # nyc test coverage 18 | .nyc_output 19 | 20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 21 | .grunt 22 | 23 | # node-waf configuration 24 | .lock-wscript 25 | 26 | # Compiled binary addons (http://nodejs.org/api/addons.html) 27 | build/Release 28 | 29 | # Dependency directories 30 | node_modules 31 | jspm_packages 32 | 33 | # Optional npm cache directory 34 | .npm 35 | 36 | # Optional REPL history 37 | .node_repl_history 38 | 39 | # lock files 40 | package-lock.json 41 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 22.12 2 | -------------------------------------------------------------------------------- /.releaserc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "@semantic-release/commit-analyzer", 4 | "@semantic-release/release-notes-generator", 5 | "@continuous-auth/semantic-release-npm", 6 | "@semantic-release/github" 7 | ], 8 | "branches": [ "main" ] 9 | } -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to `node-abi` 2 | 3 | :+1::tada: First off, thanks for taking the time to contribute to `node-abi`! :tada::+1: 4 | 5 | ## Commit Message Guidelines 6 | 7 | This module uses [`semantic-release`](https://github.com/semantic-release/semantic-release) to automatically release new versions via [Continuous Auth](https://continuousauth.dev/). 8 | Therefor we have very precise rules over how our git commit messages can be formatted. 9 | 10 | Each commit message consists of a **header**, a **body** and a **footer**. The header has a special 11 | format that includes a **type**, a **scope** and a **subject** ([full explanation](https://github.com/stevemao/conventional-changelog-angular/blob/master/convention.md)): 12 | 13 | ``` 14 | (): 15 | 16 | 17 | 18 |