Skip to content

Commit

Permalink
Merge branch 'main' into mp/set-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
erickzhao authored Nov 7, 2023
2 parents 8f11bec + 4663859 commit 645c794
Show file tree
Hide file tree
Showing 36 changed files with 1,952 additions and 4,686 deletions.
136 changes: 50 additions & 86 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,98 +1,62 @@
step-restore-cache: &step-restore-cache
restore_cache:
keys:
- v1-dependencies-{{ arch }}-{{ checksum "yarn.lock" }}

steps-test: &steps-test
steps:
- checkout
- *step-restore-cache
- run:
name: Install Node
command: |
case "$(uname -s)" in
Darwin)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install 12
nvm alias default 12
echo 'export NVM_DIR=${HOME}/.nvm' >> $BASH_ENV
echo "[ -s '${NVM_DIR}/nvm.sh' ] && . '${NVM_DIR}/nvm.sh'" >> $BASH_ENV
;;
Windows*|CYGWIN*|MINGW*|MSYS*)
nvm install 12.22.4
nvm use 12.22.4
;;
esac
- run: yarn install --frozen-lockfile
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ arch }}-{{ checksum "yarn.lock" }}
- run: yarn run lint
- run:
name: Tests with code coverage
command: yarn run coverage
environment:
DEBUG: electron-rebuild
- run: yarn run codecov


version: 2.1

orbs:
win: circleci/windows@1.0.0
jobs:
test-linux-12:
docker:
- image: circleci/node:12-buster
<<: *steps-test
test-linux-14:
docker:
- image: circleci/node:14-buster
<<: *steps-test
test-linux-16:
docker:
- image: circleci/node:16-buster
<<: *steps-test
test-mac:
macos:
xcode: "12.2.0"
<<: *steps-test
test-windows:
executor:
name: win/vs2019
shell: bash.exe
cfa: continuousauth/npm@1.0.2
node: electronjs/node@1.2.0

executors:
windows:
environment:
GYP_MSVS_VERSION: '2019'
<<: *steps-test
GYP_MSVS_VERSION: '2022'
machine:
image: windows-server-2022-gui:stable
resource_class: windows.medium
shell: bash.exe

release:
docker:
- image: circleci/node:16
steps:
- checkout
- *step-restore-cache
- run: yarn install --frozen-lockfile
- run: npx semantic-release
workflows:
version: 2
test_and_release:
# Run the test jobs first, then the release only when all the test jobs are successful
jobs:
- test-linux-16
- test-linux-12
- test-linux-14
- test-mac
- test-windows
- release:
- node/test:
name: test-<< matrix.executor >>-<< matrix.node-version >>
override-ci-command: yarn install --frozen-lockfile --ignore-engines
pre-steps:
- run: git config --global core.autocrlf input
- when:
condition:
equal: [ windows, << matrix.executor >> ]
steps:
- run:
name: Enable Long Paths
command: New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
shell: powershell.exe
test-steps:
- run: yarn run lint
- run:
name: Tests with code coverage
command: yarn run coverage
environment:
DEBUG: electron-rebuild
- run: yarn run codecov
use-test-steps: true
matrix:
alias: test
parameters:
executor:
- node/linux
- node/macos
- windows
node-version:
- 20.2.0
- 18.16.0
- 16.20.0
- 14.21.3
- 12.22.12
- cfa/release:
requires:
- test-linux-16
- test-linux-12
- test-linux-14
- test-mac
- test-windows
- test
filters:
branches:
only:
- master
- main
context: cfa-release
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @electron/wg-ecosystem
6 changes: 0 additions & 6 deletions .github/dependabot.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/add-to-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Add to Ecosystem WG Project

on:
issues:
types:
- opened
pull_request_target:
types:
- opened

permissions: {}

jobs:
add-to-project:
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App token
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
id: generate-token
with:
creds: ${{ secrets.ECOSYSTEM_ISSUE_TRIAGE_GH_APP_CREDS }}
org: electron
- name: Add to Project
uses: dsanders11/project-actions/add-item@3a81985616963f32fae17d1d1b406c631f3201a1 # v1.1.0
with:
field: Opened
field-value: ${{ github.event.pull_request.created_at || github.event.issue.created_at }}
project-number: 89
token: ${{ steps.generate-token.outputs.token }}
26 changes: 26 additions & 0 deletions .github/workflows/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Check Semantic Commit"

on:
pull_request:
types:
- opened
- edited
- synchronize

permissions:
contents: read

jobs:
main:
permissions:
pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR
name: Validate PR Title
runs-on: ubuntu-latest
steps:
- name: semantic-pull-request
uses: amannn/action-semantic-pull-request@c3cd5d1ea3580753008872425915e343e351ab54 # v5.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
validateSingleCommit: false
2 changes: 0 additions & 2 deletions .npmignore

This file was deleted.

3 changes: 2 additions & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"@semantic-release/release-notes-generator",
"@continuous-auth/semantic-release-npm",
"@semantic-release/github"
]
],
"branches": [ "main" ]
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Contributors to the Electron project

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Electron Rebuild

[![CircleCI](https://circleci.com/gh/electron/electron-rebuild.svg?style=svg)](https://circleci.com/gh/electron/electron-rebuild)
[![NPM](https://img.shields.io/npm/v/electron-rebuild.svg?style=flat)](https://npm.im/electron-rebuild)
[![Coverage Status](https://codecov.io/gh/electron/electron-rebuild/branch/master/graph/badge.svg)](https://codecov.io/gh/electron/electron-rebuild)
[![CircleCI](https://circleci.com/gh/electron/rebuild.svg?style=svg)](https://circleci.com/gh/electron/rebuild)
[![NPM](https://img.shields.io/npm/v/@electron/rebuild.svg?style=flat)](https://npm.im/@electron/rebuild)
[![Coverage Status](https://codecov.io/gh/electron/rebuild/branch/main/graph/badge.svg)](https://codecov.io/gh/electron/rebuild)

This executable rebuilds native Node.js modules against the version of Node.js
that your Electron project is using. This allows you to use native Node.js
Expand All @@ -14,7 +14,7 @@ modules in Electron apps without your system version of Node.js matching exactly
Install the package with `--save-dev`:

```sh
npm install --save-dev electron-rebuild
npm install --save-dev @electron/rebuild
```

Then, whenever you install a new npm package, rerun electron-rebuild:
Expand Down Expand Up @@ -83,7 +83,7 @@ Options:
Copyright 2016
```

### How can I use this with [Electron Forge](https://github.com/electron-userland/electron-forge)?
### How can I use this with [Electron Forge](https://github.com/electron/forge)?

This package is automatically used with Electron Forge when packaging an Electron app.

Expand All @@ -94,7 +94,7 @@ for Electron Packager. For example:

```javascript
import packager from 'electron-packager';
import rebuild from 'electron-rebuild';
import rebuild from '@electron/rebuild';

packager({
// … other options
Expand All @@ -120,7 +120,7 @@ electron-rebuild is also a library that you can require into your app or
build process. It has a very simple API:

```javascript
import rebuild from 'electron-rebuild';
import rebuild from '@electron/rebuild';

// Public: Rebuilds a node_modules directory with the given Electron version.
//
Expand Down Expand Up @@ -156,7 +156,3 @@ const pathToElectron = require('electron');
console.error(e);
});
```

### Alternatives

- [require-rebuild](https://github.com/juliangruber/require-rebuild) patches `require()` to rebuild native node modules on the fly
10 changes: 5 additions & 5 deletions contributing.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# Contributing to electron-rebuild
# Contributing to @electron/rebuild

:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:

This project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDUCT.md).
By participating, you are expected to uphold this code. Please report unacceptable
behavior to electron@github.com.

The following is a set of guidelines for contributing to electron-rebuild.
The following is a set of guidelines for contributing to @electron/rebuild.
These are just guidelines, not rules, use your best judgment and feel free to
propose changes to this document in a pull request.

## Submitting Issues

* You can create an issue [here](https://github.com/electron/electron-rebuild/issues/new),
* You can create an issue [here](https://github.com/electron/rebuild/issues/new),
but before doing that please read the notes below and include as many details as
possible with your report. If you can, please include:
* The version of electron and electron-rebuild you are using
* The version of electron and @electron/rebuild you are using
* The operating system you are using
* If applicable, what you were doing when the issue arose and what you
expected to happen
* Other things that will help resolve your issue:
* Screenshots and animated GIFs
* Error output that appears in your terminal, dev tools or as an alert
* Perform a [cursory search](https://github.com/electron/electron-rebuild/issues?utf8=✓&q=is%3Aissue+)
* Perform a [cursory search](https://github.com/electron/rebuild/issues?utf8=✓&q=is%3Aissue+)
to see if a similar issue has already been submitted

## Submitting Pull Requests
Expand Down
Loading

0 comments on commit 645c794

Please sign in to comment.