zigzap / zap

blazingly fast backends in zig
MIT License
1.98k stars 71 forks source link

Zig as a starter #76

Closed Kinfe123 closed 4 months ago

Kinfe123 commented 5 months ago

Just simple zig build file that we can build an app on top of like the starter file which we could get zap on a fly for my project

renerocksai commented 5 months ago

Did you read the README?

There is a build.zig.zon and an example for what to do in your build.zig, after you have run zig init-exe.

I want to close but maybe I don't get your question. If so, please elaborate in full sentences.

Kinfe123 commented 5 months ago

Yeah yeeah there is man.. but it the reaadme is too much so that might not be cool on dx side.. thats why no worries man ;)

renerocksai commented 5 months ago

Please make a more concrete suggestion. Zig creates the build.zig for you, you only have to paste in 2 lines.

To be honest, I am thinking that if that's too much hassle, one is probably better off trying something else.

DX 🤣: "I want to dev but put ZERO effort into it"

Where would we even put the extra file and how should people looking for "DX" find it? Plus, they'd need the zon file, too. I might be stupid but if I even parse you correctly, what I think you want doesn't sound thought through well.

I value my time, too. Maybe the best way forward is you submit a PR.

Kinfe123 commented 5 months ago

hmm.. you got a point but the reason i raised is because of i just told my friend about this means zap for building web servers yeah but i really send the link to this github repo and he was confused to where it starts thats why i guess it needs a prior xp on setting up stuff for local dev and playing around with sys lang makes the hassle little bit less :) .... personally does not have a problem but he was kind of heck confused to start off but yeah what i suggested to paste the code from build.zig or build.zon.zig. .. You are absolutely correct but people get reffered to this might be interested on some mini things that they could narrow there scope like just fork and get to the point.. idk but for me it is fine .

renerocksai commented 5 months ago

Aaaaah, got you! Maybe point your friend further down in the readme: https://github.com/zigzap/zap#getting-started

Further down it shows how to create a zig project and add zap in easy steps.

The only easier alternative I can think of is creating a sample project that others can just fork. Updating that for every release is a bit of extra work. I have one for zig master, so yeah, maybe making an official one and linking to it in a prominent place would help.

Kinfe123 commented 5 months ago

yep man that is what i am saying... you got me...that would be too nice

Froxcey commented 4 months ago

I think it would be nice to have a template repo for creating a Zap application, many other backend projects has the same thing.

vibe
Kinfe123 commented 4 months ago

@renerocksai If you want zap starter template for custom or from scratch projects you can use my template here - https://github.com/Kinfe123/zap-zig-starter

Kinfe123 commented 4 months ago

@renerocksai shall i contribute this on main branch the above starter ... which can pushed on to branch

renerocksai commented 4 months ago

What do you mean by pushing to main repo branch? That doesn't make sense to me.

To be git-clonable, the "starter project" should be its own repo, e.g.: zigzap/hello.

I would clean up your template:

None of the above is hard. Creating such a starter template probably takes only a few minutes.

The more complicated part is: keeping it up-to-date with zap releases (build.zig.zon). Can that be done easily, ideally in a GH action when rolling a release? I guess the easiest option is to have a daily GH workflow that clones zap master, checks for zon changes in the README of zap, and commits a zon update to the starter. Then a second GH workflow that checks if it still builds with the latest zon update - so I get at least notified when the starter gets broken by a zap release.

Instead of parsing the README, I could also update zap's release workflow to update a json file that can easily be curled from the starter template workflow.

I don't have time ATM but that's what I'm thinking about.

Kinfe123 commented 4 months ago

yeah i am basing my thought based on the templating stuff that mention and yeah it was also thinking syncing up using GH that can checkout to the master ..

Kinfe123 commented 4 months ago

yeah got you on the clean up .. since i am introducing it to the public i just get the fresh copy of zig init and start adding necessary files to make sure it works but as you said it needs really a clean up that to make sure it actually makes sense

renerocksai commented 4 months ago

for now maybe https://github.com/zigzap/hello-world will do