Skip to content
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

Make the publish command update the site #177

Open
1 task done
kkomelin opened this issue Aug 21, 2024 · 3 comments
Open
1 task done

Make the publish command update the site #177

kkomelin opened this issue Aug 21, 2024 · 3 comments
Labels
enhancement New feature or request site-builder

Comments

@kkomelin
Copy link

kkomelin commented Aug 21, 2024

Description

The question here is do we really need a separate update command?

The only difference between publish and update is that update needs the published site object ID. Can we automate it so that the update command is not needed at all?

For example, we could store the site object ID in .walrus-site.yaml after publishing the site the first time and read it on publishing the site the second time. Actually, Walrus config already has system_object field which could be used for that purpose.

This change could simplify things and consequently improve DX.

Component

site-builder

Code of Conduct

  • I agree to follow this project's Code of Conduct.
@kkomelin kkomelin added the enhancement New feature or request label Aug 21, 2024
@giac-mysten
Copy link
Collaborator

Hey @kkomelin , thanks for the feature request!

Actually, Walrus config already has system_object field which could be used for that purpose.

the system_object in the walrus config is Walrus's system object, which is required to look up committee information, so we could not use that. In general, the Walrus config is required to configure the Walrus CLI, and therefore is separate from Walrus Sites.

For example, we could store the site object ID in .walrus-site.yaml after publishing the site the first time and read it on publishing the site the second time

this could work. I like the separation between publish and update, but we can add something along these lines at some point. Just FYI, at the moment we are working on higher priority issues unfortunately, so it may take a while.

One minor problem I see is that we are introducing a Walrus-Sites-specific "magic" file, which is not produced by the framework that built the site, and therefore may be wrongly interpreted by other tooling (for example, if you publish both to walrus sites and to a conventional server, the .walrus-site.yaml will be included in the latter).

@kkomelin
Copy link
Author

kkomelin commented Aug 22, 2024

@giac-mysten Thank you for clarifying stuff.

I try to make the user experience similar to what they see on other static hosting providers. With Firebase, Vercel, etc., you can deploy a site with one commend - no difference between publishing or updating.

As for .walrus-site.yaml, it can be Git-ignored if necessary. We can also come up with a better name, better folder or another place to store the site object ID. I provided it just for example.

Sure, no rush. We can come back to this topic whenever you guys have time.

@kkomelin
Copy link
Author

kkomelin commented Aug 25, 2024

For now, I've developed a custom script which publishes the app on the first run, sores the site object ID in .env.local and updates the app on subsequent runs https://github.com/kkomelin/sui-dapp-starter/blob/main/packages/frontend/scripts/walrus-site-deploy.cjs

@Tzal3x Tzal3x changed the title [Feature]: Make the publish command update the site Make the publish command update the site Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request site-builder
Projects
None yet
Development

No branches or pull requests

3 participants