Closed adam-lynch closed 7 years ago
Thanks Adam. Yes we should provide it.
Adam Lynch notifications@github.com于2015年12月6日周日 上午9:19写道:
@rogerwang https://github.com/rogerwang, I could've sworn we spoke somewhere about this before but I can't find it in my email. Hmm, anyway...
The idea is that a JSON file would be hosted somewhere and would contain a list of all available versions, whether it's an alpha build or not, and paths to the platform-specific files.
I'm open to helping in any way I can. Todo
- Agree on a format.
- Publish it somewhere.
- Should be updated when a new version is released. I'm not sure what the release process is like right now but it should be possible to add in this step I'm guessing.
- Document it. This would be nice so others could easily use it.
Why bother?
This would make it a lot easier for other modules to build on top of this. Especially nw-builder https://github.com/nwjs/nw-builder which has been getting a few complaints related to this. This is how nw-builder figures out which versions are available right now (roughly, from memory):
- Scrapes http://dl.nwjs.io/ (or somewhere similar) to get a list of versions.
- Sends a HEAD request to where it exists the Windows 32 ZIP to validate that this version is usable (i.e. isn't an alpha build). This is done because nw-builder's version option defaults to latest.
Issues which arise from this
- Some people want to build with the alpha build, even if it doesn't have a Windows 32 ZIP.
- The alpha build has a Windows 32 build which gives a false positive validation and builds might fail then if a different platform's ZIP doesn't exist.
- The ZIPs filename patterns can change between versions and break nw-builder. This would be fixed by this because each version would have to explicitly point to where each platform's own ZIP is located at.
- Other issues I can't remember right now.
— Reply to this email directly or view it on GitHub https://github.com/nwjs/nw.js/issues/4037.
Great @rogerwang.
Looking at http://dl.nwjs.io/v0.12.3/), should we include everything here in the manifest? Is it all needed?
Another thing I realised, it would also be good if each versions specified which files its ZIP contains which are required to run it. It would save nw-builder from doing stuff like this.
The header file and the libraries files are not needed. Maybe we need to split them into build flavors starting from 0.13. And yes, it's good to include the list of contents.
Now there is : http://nwjs.io/versions.json
@rogerwang Thanks! I've a few small comments:
versions.json
? People definitely use nw-builder with older versions. Or if not all versions then maybe we could agree that the last N versions would always be in there? Then nw-builder could limit support to that many versions back.2. Would it better to specify the URL to the ZIP? The way it is now, the consumer needs to make assumptions. This way if you guys ever decide to change the name format of the ZIPs (intentionally or accidentally) then no one else's parsing would break. Another option would be to supply a template like https://github.com/nwjs/nw-builder/blob/master/lib/platforms.js#L12. If you were to give older versions (like I ask in point number 1), then this would help with older versions as they might have node-webkit
instead of nwjs
.
Nevermind, because there are different flavours now, this is too complicated to be worth it.
The header file and the libraries files are not needed. Maybe we need to split them into build flavors starting from 0.13. And yes, it's good to include the list of contents.
I just want to confirm this, to be extra safe. We've had a good few PRs, etc. in nw-builder (& grunt-nw-builder) to alter our handling of the contents inside the ZIPs.
As you can see, this is especially important if versions.json were to contain older versions.
So, if they are needed, then I guess we would need something like this:
files: {
"win-x64": {
"url": "http://dl.nwjs.io/v0.12.3/nwjs-v0.12.3-win-x64.zip",
"files": ["nw.exe", "exampleA", "exampleB"]
},
...
}
CC @ghostoy who built this file for the official website.
@adam-lynch
Following is how to interpret versions.json
:
latest
: latest versionstable
: stable versionversions
: list of published versions. Following is the detailed information about each item:
version
: versionfiles
: list of downloadable files. Each item is <os>-<arch>
in lower case. e.g. linux-ia32
means there are downloadable files for Linux IA32.flavors
: build flavors, valid items are normal
, sdk
, nacl
and macappstore
. Currently macappstore
is only available for 0.12.3 OSX X64.You can composite the URL of NW packages, headers, libs, chromedrivers and symbols from each item listed in versions
field.
I think it's ok to reuse it for legacy versions since 0.8.0. However some tricks based on the version should be done when composing the URLs. For example, since 0.12.0, node-webkit
is renamed to nwjs
. And macappstore
flavor is currently only available for 0.12.3 x64 build.
@adam-lynch As for the list of files in ZIPs, it's version specific. You can hard code as a list.
@adam-lynch For 0.13.0 or later, all files are needed to be redistributed with the app except followings for SDK flavour:
I think it's better to list excluded files instead of included files. What do you think?
Hello, nice idea :)
Why this issue not closedif it was done?
@rogerwang, I could've sworn we spoke somewhere about this before but I can't find it in my email. Hmm, anyway...
The idea is that a JSON file would be hosted somewhere and would contain a list of all available versions, whether it's an alpha build or not, and paths to the platform-specific files.
I'm open to helping in any way I can.
Todo
Why bother?
This would make it a lot easier for other modules to build on top of this. Especially nw-builder which has been getting a few complaints related to this. This is how nw-builder figures out which versions are available right now (roughly, from memory):
version
option defaults tolatest
.Issues which arise from this
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.