-
-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finish Electron Support #271
Closed
Closed
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
6aae9d0
Always download node headers on all platforms
adumbidiot cdccd3b
Use rustls in ureq to avoid depending on OpenSSL on Linux
adumbidiot 9974398
Always download node headers on all platforms
adumbidiot 1625ac5
Use rustls in ureq to avoid depending on OpenSSL on Linux
adumbidiot b208d25
Merge branch 'electron' of https://github.com/adumbidiot/napi-rs into…
adumbidiot 0ac73d8
Require users to set minimum napi version
adumbidiot 8e24635
Merge remote-tracking branch 'upstream/master' into electron
adumbidiot 52cade2
Add ci-script to simplify testing
adumbidiot 4db3ae4
Fix pre-commit hook on windows
adumbidiot b502337
Merge remote-tracking branch 'upstream/master' into electron
adumbidiot 770c14b
Fix bad napi feature flag in js_value object
adumbidiot b378453
Fix `yarn-lint` on windows
adumbidiot e521728
Remove `--all` flag from napi3 `cargo check`
adumbidiot 787fdd6
Add `--no-default-features` to napi3 napi crate build
adumbidiot c964aab
Set napi feature correctly in `napi-derive-example`
adumbidiot dcc22ad
Refactor napi3 ci to use utilize ci helper script to run `cargo check`
adumbidiot 8639d43
Fix linux napi3 ci
adumbidiot 936bb76
Update yarn.lock
adumbidiot ec7912b
Copy changes from napi3 to test workflow
adumbidiot 3952c12
Fallback to local napi version on ci for test_module
adumbidiot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
const childProcess = require('child_process') | ||
const yargs = require('yargs') | ||
const toml = require('toml') | ||
const fs = require('fs') | ||
|
||
let napiVersion = process.env['USE_NAPI_VERSION'] || process.versions.napi | ||
|
||
const argv = yargs | ||
.command('build', 'Builds a module', {}, build) | ||
.command( | ||
'cargo-check-all', | ||
'Runs cargo check on all crates', | ||
{}, | ||
cargoCheckAll, | ||
).argv | ||
|
||
function build(args) { | ||
childProcess.execSync(`cargo build --features=napi${napiVersion}`) | ||
} | ||
|
||
function cargoCheckAll(args) { | ||
let topLevelTomlString = fs.readFileSync('./Cargo.toml') | ||
let topLevelToml = toml.parse(topLevelTomlString) | ||
let workspaceMembers = topLevelToml.workspace.members | ||
|
||
for (let i = 0; i < workspaceMembers.length; i++) { | ||
let member = workspaceMembers[i] | ||
let command = `cargo check --manifest-path ${member}/Cargo.toml --bins --examples --tests -vvv` | ||
|
||
if (member === './napi') | ||
command += ` --no-default-features --features=napi${napiVersion}` | ||
|
||
console.log('Running: ' + command) | ||
|
||
childProcess.execSync(command) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if add a feature
system-napi
to compatible with the previous behavior? So that you don't need to change the build scripts on CI and people have more choice.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to avoid that that since thats probably not what most people want, but I agree that it would simplify everything greatly and provide backwards compatibility. I'll make that change and document these features on the readme.