-
Notifications
You must be signed in to change notification settings - Fork 1
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
[Feat] Add folder uploading #33
Conversation
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.
Going to start testing now 👌
src/commands/publish.ts
Outdated
@@ -70,7 +70,7 @@ export default class Publish extends Command { | |||
if (!config.platforms) this.error('no platforms configured'); | |||
|
|||
for (const [key, value] of Object.entries(config.platforms)) { | |||
if (!value.executable) this.error(`No executable path found for platform ${key}`) | |||
if (!value.executable && key !== "webgl") this.error(`No executable path found for platform ${key}`) |
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.
we need to be able to support web as well in the platform keys in the hyperplay.yml file
i.e. a hyperplay.yml file like
account: game_dev_account
project: game
release: 0.1.0
description: Release notes go here.
platforms:
webgl:
path: dist/webgl/
zip: false
web:
external_url: https://hyperplay.xyz
windows_amd64:
path: dist/windows/amd64/
zip: true
executable: Game\\Game.exe
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.
might make sense to add an override variable in the platform config as well like ignoreExecutableCheck
for a platform so this check is opt-out and a general solution
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.
Re: my below message, I think ignoreExecutableCheck
is a good to have but if it's not expected for a web or a webgl build, I don't believe the user should have to add it. I worry that the config is already getting a bit verbose, would a user have to do?
webgl:
path: dist/webgl
ignoreExecutableCheck: false
isFolderUpload: false
Also as another thought, it may be bad to enable certain things as general solutions, for all of the native fields we want to enforce the executable, and it would actually cause a lot of problems for them to skip the check.
const isWebGL = platformKey === 'webgl'; | ||
const files = isWebGL ? await getFolderFiles(platformPath) : await getSingleFile(platformPath); |
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.
We should try to avoid adding if statements throughout the code for various platform key specific scenarios. It keeps us from making more general interfaces and the code is harder to read/more complicated
Could we add a field on the config hyperplay.yml file for isFolderUpload
or something like that?
Then we would get its value here like
const isFolderUpload = config.platforms[platformKey].isFolderUpload
const files = isFolderUpload ? await getFolderFiles(platformPath) : await getSingleFile(platformPath);
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 generally agree, though I still think it's a balance between clean code and developer experience, realistically we only are going to support a very small set of platforms for the foreseeable future, I think it's way more worth it to provide as minimal a configuration and as good of a developer experience before purity of interfaces, or future state code complexity.
I think isFolderUpload is a great idea but if the intended purpose of the webgl builds is for it to upload a folder of webgl assets it seems like it only creates more friction to make the publisher configure additional fields.
Either way it's a good to have config, just wanted to express some thought's around dev ux vs code purity.
CliUx.ux.action.stop(); | ||
|
||
for (const url of urls) { | ||
const fileData = isWebGL ? files.find(f => f.fileName === url.fileName)?.filePath : platformPath; |
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.
we could replace isWebGL
by isFolderUpload
here too
Uploaded phantom galaxies and it worked! the logs were
could we remove the this url is also not working so should we remove that from the logs? |
When uploading using this hyperplay.yml file
I get
because path is not set for "web" but web platform should not have a path. |
uploading an uncompressed folder for webgl seemed to work with
|
Co-authored-by: Brett <[email protected]>
Really not trying to be contrarian but I have similar feedback to this as above, I think it's quicker, and better Dev UX in the short term to just provide reasonable defaults for each platform that require the minimal amount of config. I just don't think it makes sense for the user to have to put things like I also think it's a lot simpler to just do something like below , where we manually check if it's a web platform with an externalUrl and just skip the rest of the logic. A user should not have to set Conversely I think we'd want to lock down the
|
I agree with this statement |
This yml file
is giving this error
|
@jiyuu-jin I tried then adding the path for the web platform to see if that would fix This yml file
is giving this error
|
Description
Adds folder uploading via the new HP uploads API.
Adds the webgl platform with a path which (webgl does not require the executable, zip or any other fields).
Testing
You can test by adding a webgl field with a folder path to a
hyperplay.yml
platforms: