electron-edge-js
Advanced tools
Comparing version 29.0.0 to 29.0.1
@@ -26,4 +26,14 @@ // Fix #176 for GUI applications on Windows | ||
var assemblyFile = __dirname + '\\..\\EdgeJs.dll'; | ||
const edgeSwitch = "-EdgeJs:"; | ||
process.argv.forEach(e => { | ||
if(e.startsWith(edgeSwitch)) { | ||
const path = e.substring(edgeSwitch.length); | ||
assemblyFile = path; | ||
} | ||
}) | ||
var initialize = edge.func({ | ||
assemblyFile: __dirname + '\\..\\EdgeJs.dll', | ||
assemblyFile, | ||
typeName: 'EdgeJs.Edge', | ||
@@ -30,0 +40,0 @@ methodName: 'InitializeInternal' |
@@ -8,3 +8,3 @@ var fs = require('fs') | ||
// check if we are running in Electron or in Node.js | ||
if (process.versions.electron) { | ||
if (process.versions.electron || process.env.ELECTRON_RUN_AS_NODE) { | ||
// we are running in Electron | ||
@@ -47,4 +47,4 @@ const version = `${process.versions.electron.split(".")[0]}.0.0`; | ||
} | ||
if (process.env.EDGE_USE_CORECLR && !process.env.EDGE_BOOTSTRAP_DIR && fs.existsSync(path.join(__dirname, 'bootstrap', 'bin', 'Release', 'netcoreapp1.1', 'bootstrap.dll'))) { | ||
process.env.EDGE_BOOTSTRAP_DIR = path.join(__dirname, 'bootstrap', 'bin', 'Release', 'netcoreapp1.1'); | ||
if (process.env.EDGE_USE_CORECLR && !process.env.EDGE_BOOTSTRAP_DIR && fs.existsSync(path.join(__dirname, 'bootstrap', 'bin', 'Release', 'netcoreapp3.1', 'bootstrap.dll'))) { | ||
process.env.EDGE_BOOTSTRAP_DIR = path.join(__dirname, 'bootstrap', 'bin', 'Release', 'netcoreapp3.1'); | ||
} | ||
@@ -118,3 +118,3 @@ | ||
if (process.env.EDGE_USE_CORECLR) { | ||
var defaultManifest = path.join(__dirname, 'bootstrap', 'bin', 'Release', 'netcoreapp1.1', 'bootstrap.deps.json'); | ||
var defaultManifest = path.join(__dirname, 'bootstrap', 'bin', 'Release', 'netcoreapp3.1', 'bootstrap.deps.json'); | ||
var compilerManifest; | ||
@@ -121,0 +121,0 @@ if (compiler.getBootstrapDependencyManifest) { |
@@ -5,6 +5,5 @@ { | ||
"name": "Tomasz Janczuk <tomasz@janczuk.org>", | ||
"url": "http://tomasz.janczuk.org", | ||
"twitter": "tjanczuk" | ||
"url": "http://tomasz.janczuk.org" | ||
}, | ||
"version": "29.0.0", | ||
"version": "29.0.1", | ||
"description": "Edge.js: run .NET and Node.js in-process on Electron", | ||
@@ -38,12 +37,13 @@ "tags": [ | ||
"engines": { | ||
"node": ">= 6" | ||
"node": ">= 16" | ||
}, | ||
"license": "Apache-2.0", | ||
"license": "MIT", | ||
"dependencies": { | ||
"edge-cs": "1.2.1", | ||
"nan": "^2.17.0" | ||
"nan": "^2.19.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "5.1.1", | ||
"mocha-junit-reporter": "^1.17.0" | ||
"electron": "^29.1.4", | ||
"mocha": "10.3.0", | ||
"mochawesome": "^7.1.3" | ||
}, | ||
@@ -50,0 +50,0 @@ "homepage": "https://github.com/agracio/electron-edge-js", |
@@ -5,20 +5,25 @@ # .NET and Node.js in-process on Electron | ||
Compatible with | ||
Windows binaries pre-compiled for | ||
- Electron 17.x - Node.js v16.13.0 | ||
- Electron 18.x - Node.js v16.13.2 | ||
- Electron 19.x - Node.js v16.14.2 | ||
- Electron 20.x - Node.js v16.15.0 | ||
- Electron 21.x - Node.js v16.16.0 | ||
- Electron 22.x - Node.js v16.17.1 | ||
- Electron 23.x - Node.js v18.12.1 | ||
- Electron 24.x - Node.js v18.14.0 | ||
- Electron 25.x - Node.js v18.15.0 | ||
- Electron 26.x - Node.js v18.16.1 | ||
- Electron 27.x - Node.js v18.17.1 | ||
- Electron 28.x - Node.js v18.18.2 | ||
- Electron 29.x - Node.js v20.9.0 | ||
| Electron | Node.Js Version | | ||
| ------------- | ---------------- | | ||
| Electron 17.x | v16.13.0 | | ||
| Electron 18.x | v16.13.2 | | ||
| Electron 19.x | v16.14.2 | | ||
| Electron 20.x | v16.15.0 | | ||
| Electron 21.x | v16.16.0 | | ||
| Electron 22.x | v16.17.1 | | ||
| Electron 23.x | v18.12.1 | | ||
| Electron 24.x | v18.14.0 | | ||
| Electron 25.x | v18.15.0 | | ||
| Electron 26.x | v18.16.1 | | ||
| Electron 27.x | v18.17.1 | | ||
| Electron 28.x | v18.18.2 | | ||
| Electron 29.x | v20.9.0 | | ||
Usage is the same as edge or edge-js, replace `require('edge-js')` with `require('electron-edge-js')`: | ||
- You do not need to use same version of Node.js in your project as Electron Node.js version | ||
- On Linux and MacOS `npm install` will compile binaries with correct Node.Js headers for given Electron version. | ||
#### Usage is the same as edge-js, replace `require('edge-js')` with `require('electron-edge-js')`: | ||
```bash | ||
@@ -51,3 +56,3 @@ npm install electron-edge-js | ||
Simple app that shows how to work with .NET Core using compiled C# libraries. | ||
Sample app that shows how to work with .NET Core using inline code and compiled C# libraries. | ||
https://github.com/agracio/electron-edge-js-quick-start | ||
@@ -58,10 +63,39 @@ | ||
`edge-js` and `electron-edge-js` will fail to build on MacOS if Visual Studion for mac is installed. | ||
VS installs Mono runtimes that `edge-js` fails to access durring `nmp install`. | ||
VS installs Mono runtimes that `edge-js` fails to access durring `nmp install`. | ||
Removing VS does not remove Mono fully and leaves behind incomplete Mono install. | ||
To remove Mono from macOS use this script | ||
```bash | ||
sudo rm -rf /Library/Frameworks/Mono.framework | ||
sudo pkgutil --forget com.xamarin.mono-MDK.pkg | ||
sudo rm /etc/paths.d/mono-commands | ||
``` | ||
## Packaging Electron application | ||
Packaging example based on the app above. | ||
https://github.com/zenb/electron-edge-js-quick-start | ||
'electron-edge-js' needs to be specified as external module, some examples<br/> | ||
``webpack.config.js `` | ||
```js | ||
externals: { | ||
'electron-edge-js': 'commonjs2 electron-edge-js', | ||
}, | ||
node: { | ||
__dirname: false, | ||
__filename: false, | ||
}, | ||
``` | ||
``vue.config.js`` | ||
```js | ||
module.export = { | ||
pluginOptions: { | ||
electronBuilder: { | ||
externals:["electron-edge-js"] | ||
} | ||
} | ||
``` | ||
Packaging example based on `electron-edge-js-quick-start`. | ||
https://github.com/zenb/electron-edge-js-quick-start | ||
Related issues to use for troubleshooting: | ||
https://github.com/agracio/electron-edge-js/issues/138 | ||
https://github.com/agracio/electron-edge-js/issues/39 | ||
@@ -71,2 +105,4 @@ https://github.com/agracio/electron-edge-js/issues/74 | ||
## Async execution | ||
@@ -79,3 +115,3 @@ | ||
For full documentation please see [edge-js](https://github.com/agracio/edge-js) repo. | ||
For full documentation see [edge-js](https://github.com/agracio/edge-js) repo. | ||
@@ -82,0 +118,0 @@ ## Build |
@@ -7,5 +7,5 @@ var spawn = require('child_process').spawn; | ||
var buildParameters = ['-target:library', '/debug', '-out:' + output, input]; | ||
var mocha = path.resolve(__dirname, '../node_modules/mocha/bin/mocha'); | ||
var fs = require('fs'); | ||
var electron = require('electron') | ||
if (!process.env.EDGE_USE_CORECLR) { | ||
@@ -16,18 +16,34 @@ if (process.platform !== 'win32') { | ||
spawn(process.platform === 'win32' ? 'csc' : 'mcs', buildParameters, { | ||
stdio: 'inherit' | ||
}).on('close', runOnSuccess); | ||
} | ||
run(process.platform === 'win32' ? 'csc' : 'mcs', buildParameters, runOnSuccess); | ||
} | ||
else { | ||
spawn(process.platform === 'win32' ? 'dotnet.exe' : 'dotnet', ['restore'], { | ||
stdio: 'inherit', | ||
cwd: testDir | ||
}).on('close', function(code, signal) { | ||
if (code === 0) { | ||
spawn(process.platform === 'win32' ? 'dotnet.exe' : 'dotnet', ['build'], { | ||
stdio: 'inherit', | ||
cwd: testDir | ||
}).on('close', runOnSuccess); | ||
} | ||
run(process.platform === 'win32' ? 'dotnet.exe' : 'dotnet', ['restore'], function(code, signal) { | ||
if (code === 0) { | ||
run(process.platform === 'win32' ? 'dotnet.exe' : 'dotnet', ['build'], runOnSuccess); | ||
} | ||
}); | ||
} | ||
function run(cmd, args, onClose){ | ||
var params = process.env.EDGE_USE_CORECLR ? {cwd: testDir} : {}; | ||
var command = spawn(cmd, args, params); | ||
var result = ''; | ||
var error = ''; | ||
command.stdout.on('data', function(data) { | ||
result += data.toString(); | ||
}); | ||
command.stderr.on('data', function(data) { | ||
error += data.toString(); | ||
}); | ||
command.on('error', function(err) { | ||
console.log(error); | ||
console.log(err); | ||
}); | ||
command.on('close', function(code){ | ||
console.log(result); | ||
onClose(code, ''); | ||
}); | ||
@@ -38,7 +54,7 @@ } | ||
if (code === 0) { | ||
process.env['EDGE_APP_ROOT'] = path.join(testDir, 'bin', 'Debug', 'netcoreapp1.1'); | ||
spawn('node', [mocha, testDir, '-R', 'spec', '-t', '10000', '-gc'], { | ||
process.env['EDGE_APP_ROOT'] = path.join(testDir, 'bin', 'Debug', 'netcoreapp3.1'); | ||
var electronPath = path.resolve(__dirname, '../test/main.js') | ||
spawn(electron, [electronPath], { | ||
stdio: 'inherit' | ||
}).on('error', function(err) { | ||
}).on('error', function(err) { | ||
console.log(err); | ||
@@ -45,0 +61,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
18780741
2417
116
24
3
197
3
57
Updatednan@^2.19.0