Electron.NET
Electron.NET copied to clipboard
electronize doesn't add `version` or `description` to the package.json it uses in a build.
Using the latest version (11.5.1)
This is causing a build error for linux targets with a message of Please specify 'version' in the package.json
and also causes a warning with message of description is missed in the package.json
Steps to Reproduce:
- add a version and description to the package.json in the application
- execute
electronize /target linux
on a linux system (other steps may need to be done here to get linux building correctly) - look at the package.json used during electronize call and notice its not there.
the file used during the electronize call is put in this general location ~/obj/desktop/-encodedCommand/package.json
Since version 8.31.1 we have a feature to set the name and author of the app in electron.manifest.json
.
Already tried?
that is set just fine, its not the name and the author that is causing any issues, its version/description.
I noticed that name/author was in the output package.json already but didn't comment on it. Honestly I think something changed upstream of us that is now causing electronize to fail on a linux target where it did not before. It exposed something electronize should probably do but isn't.
this is the output of the electronize package.json
something that stand out here... version, description, repository all should be overridable. possibly license as well.
{
"name":"prefix",
"version":"",
"description":"",
"repository":{
"url":"https://github.com/ElectronNET/Electron.NET"
},
"main":"main.js",
"author":{
"name":"Stackify",
"email":"[email protected]"
},
"license":"MIT",
"scripts":{
"start":"tsc -p ."
},
"dependencies":{
"dasherize":"^2.0.0",
"electron-updater":"^4.3.5",
"image-size":"^0.9.3",
"portscanner":"^2.2.0",
"socket.io":"^2.4.0"
},
"devDependencies":{
"@types/node":"^10.17.20",
"@types/socket.io":"^2.1.12",
"electron":"^11.1.1",
"tslint":"^6.1.3",
"typescript":"^4.1.3"
}
}
It seems that name, author and version are only written to package.json and package-lock.json, if the "buildVersion" value is set: https://github.com/ElectronNET/Electron.NET/blob/master/ElectronNET.Host/build-helper.js
electron.manifest.json:
{
"name": "Example-App",
"author": "The Author",
...
"build": {
"appId": "com.my.app",
...
"buildVersion": "1.0.0",
...
},
...
}
I need to add build version like "1.0.0.9" but shows 'Invalid version: "1.0.0.9" failedTask=build stackTrace=Error: Invalid version: "1.0.0.9"' But when i try "1.0.9" it's works fine
I need to add build version like "1.0.0.9" but shows 'Invalid version: "1.0.0.9" failedTask=build stackTrace=Error: Invalid version: "1.0.0.9"' But when i try "1.0.9" it's works fine
That error appears probably because the package.json version which is set by electron.net needs to be in semantic version format. You can find more about semantic versioning at semver and npmjs
🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉
With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!