nodegui/svelte-nodegui

Documentation

shirakaba opened this issue Β· 29 comments

Svelte NodeGUI literally uses React NodeGUI under-the-hood so I'm somewhat tempted to just point users at that docs site and call it a job done; but at the same time, people like things in one place. Wondering whether there's a low-effort way to move forwards on this?

CC @a7ul

a7ul commented

I am thinking there should be at least the guide docs like here for Svelte nodegui. https://react.nodegui.org/docs/guides/getting-started/
You could just copy paste them and make changes to suite svelte instead ?

a7ul commented

Rest of it you can link to react nodegui / nodegui.

The reason is that people do ask for docs and its easier to get started that way.

Work underway on the docs branch! Hopefully should be able to finish it off over the next week.

Docs now completely ported, having merged this PR: #27 πŸŽ‰

@a7ul What would I need to do to publish these docs such that they'd appear with the URL https://svelte.nodegui.org? Is it as simple as npm run deploy? How exactly are you hosting yours, and do I need any new permissions if I'm to do the same?

Note: I've renamed the contents of website/static/CNAME from react.nodegui.org to svelte.nodegui.org.

It would just be a npm run deploy from your website folder. However, before that, I think atul may have to create a new sub-domain for svelte

a7ul commented

Yep just added it to the DNS settings

Thanks, @shubhamzanwar and @a7ul!

For my own notes:

https://v2.docusaurus.io/docs/deployment/

# "shirakaba" is the user who has access to the org and project that we configured
# in docusaurus.config.js: `organizationName: "nodegui", projectName: "svelte-nodegui"`
# We use the "main" branch rather than master
GIT_USER=shirakaba CURRENT_BRANCH=main npm run deploy

... However, I'm getting this when it prompts me for GitHub password (which is the correct username and password, as I've just successfully logged into GitHub with them):

Cloning into 'svelte-nodegui-gh-pages'...
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/nodegui/svelte-nodegui.git/'
Error: Error: git clone failed
    at runDeploy (/Users/jamie/Documents/git/svelte-nodegui/website/node_modules/@docusaurus/core/lib/commands/deploy.js:79:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! svelte-nodegui@0.0.0 deploy: `docusaurus deploy`
npm ERR! Exit status 1

Maybe it's failing due to 2FA..? When I log into the website via a web browser, there is an additional 2FA step. But when running this in the terminal in VS Code, it didn't present me with one.

The only other explanation I can think of is that it doesn't like working with private repositories. But I think that's probably not the case. I'll look into Docusaurus issues regarding GitHub authentication.

Maybe it's failing due to 2FA..? When I log into the website via a web browser, there is an additional 2FA step. But when running this in the terminal in VS Code, it didn't present me with one.

I think that must've been the problem. I followed these steps to generate a Personal Access Token, and chose the scopes repo and admin:org. Maybe one or the other scope alone would have sufficed; but either way, this worked. I still used the command:

# In the end, it still prompted me for the password (token) interactively,
# so I think that it's best to not bother passing in the GIT_PASS arg at all.
GIT_USER=shirakaba CURRENT_BRANCH=main GIT_PASS=<password> npm run deploy

Some excerpts of the resulting terminal output (my password is not "main", of course – that was the moment that the terminal prompted for secure input, so it skips that line):

Cloning into 'svelte-nodegui-gh-pages'...
Password for 'https://shirakaba@github.com': 
main
error: pathspec 'origin/gh-pages' did not match any file(s) known to git
Switched to a new branch 'gh-pages'

...

remote: 
remote: Create a pull request for 'gh-pages' on GitHub by visiting:        
remote:      https://github.com/nodegui/svelte-nodegui/pull/new/gh-pages        
remote: 
To https://github.com/nodegui/svelte-nodegui.git
 * [new branch]      gh-pages -> gh-pages
Website is live at https://nodegui.github.io/svelte-nodegui/

Visiting https://nodegui.github.io/svelte-nodegui/ now, I just get a 404, but maybe it needs a few more minutes to appear. I've frequently experienced GitHub Pages being slow at updating, so I'm not worried just yet.

As a sanity check, the source for the website is visible on the branch gh-pages for this repo: https://github.com/nodegui/svelte-nodegui/blob/gh-pages/index.html

So I guess GitHub Pages is just being really slow..?

Ah, it looks like GitHub Pages isn't merely being slow – it's not enabled, because the repo is private.

In the GitHub settings for this repo:

image

Relevant GitHub official docs here.

@a7ul Is GitHub Pages enabled for this repo? What are our options with regards to the site visibility and the repo visibility?

a7ul commented

Hey @shirakaba arent you able to see the settings?
i think you have admin rights πŸ€”

I think you'll be able to enable pages once you make the repo public, @shirakaba
image

You can change visibility when you're ready

@a7ul That screenshot saying to contact the owner of the repository is what I see in the settings for this repo.

@shubhamzanwar we may be overthinking this, yeah – I’ll be making the repo public within the next 7 days, probably. Need to add typings for event handlers (ideally) and make the starter app first, but after that, we’re ready for a public alpha (beta?) fairly soon. I need to look into @mrsauravsahu’s issue about the phin package, which I’ll do as part of making the starter template.

a7ul commented

yeah i think gh pages on private repo is only available in paid plans

Maybe you can make it public but not post anywhere.

@a7ul Is this alert (seen in macOS Safari) expected when visiting https://svelte.nodegui.org (disregarding the fact that it'll be pointing to a GitHub 404 page until we make the repo public)?

image

Certificate details:

image

a7ul commented

Yes this is expected. Github will create a valid ssl certificate once we enable gh pages.

a7ul commented

Could you make the repo public and we could give it a try ?

@a7ul Okay, I'll make it public in a second to get this ball rolling. Would help sign up for Algolia, for example.

Though let's not announce any news about it just yet – we need to check that the docs look okay and that the starter template works, and then coordinate the best time to announce for maximum visibility.

Sometime within the next 7 days would be my plan, though!

a7ul commented

Sure πŸ‘πŸ½

a7ul commented

@a7ul I'm still getting that "This connection is not private" message, even on a browser that won't have cached it yet – I'll wait for a bit and see if it self-resolves.

@a7ul It's working on my end now, too!

a7ul commented
a7ul commented

Might have missed this πŸ™ˆ on the home page. The image has react code
image

@a7ul Ah, good catch! I may well have missed mentions of React if they were invisible to text search πŸ˜…

I'll be taking a break for now. If anyone finds further glaring issues with the docs, let's just collect them in this thread and I can address them in one go.

Woop woop πŸš€
Super cool work!

Might have missed this πŸ™ˆ on the home page. The image has react code

Fixed in #33!

@shubhamzanwar we may be overthinking this, yeah – I’ll be making the repo public within the next 7 days, probably. Need to add typings for event handlers (ideally) and make the starter app first, but after that, we’re ready for a public alpha (beta?) fairly soon. I need to look into @mrsauravsahu’s issue about the phin package, which I’ll do as part of making the starter template.

An update on these blockers:

  1. I've made a makeshift fix for the phin issue (#26, solved by commit a62490e). We can revisit it later to find a cleaner fix than exposing it as a peerDependency.
  2. I've been looking into typings for event handlers on branch https://github.com/nodegui/svelte-nodegui/tree/feat/event-handler-typings. I've not had any luck, unfortunately. I'd rather not burn the weekend on it, so won't hold up the release on it (it's a nice-to-have but doesn't block the minimum viable product).
  3. The starter template is ready for use at https://github.com/nodegui/svelte-nodegui-starter.

It would be extremely nice to have @mrsauravsahu's preprocessor integrated, but it's also not technically a release-blocker, as users can manually write in <svelte:options namespace="foreign"/> in the meantime.

So we could technically make a release announcement any time from now. I'm just thinking of the best time to maximise impact.

I happen to be doing an episode of Svelte Radio to talk about it on Tuesday – but that episode won't be released for 3-4 weeks (and I'm too impatient to wait that long). If we made the official announcement before then, the main benefit is that the hosts would have a chance to read up on it if they wanted to.

That said, my original tweet about the proof-of-concept, posted at 2:49 pm (unclear whether GMT or BST) on Sunday Oct 25th did very well. Which is either 30m or 1h30m from now!

My only other thought is that Tauri (a very similar project) recently made the front page of Hacker News by announcing on a Friday at 8 pm GMT. But I have historically had very poor success on Hacker News. But I've never had any luck on Hacker News anyway, so...

I'll close this issue in favour of more specific ones, now that we have a docs site up.

I'll announce the project on Twitter, Hacker News, and Reddit sometime between 8-9 pm GMT on Friday! Will share the link to the GitHub repo rather than the docs website.