-
Notifications
You must be signed in to change notification settings - Fork 259
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
Create Vercel app for onefetch with ASCII preview #701
Conversation
I think I'll end up using TypeScript for this (using Vite as a build tool). Before I set up the preview, @o2sh do you have a preference between vanilla JS, React, Vue.js, Svelte, or anything else? I've used Vue.js and Svelte before (and obviously vanilla JS 😆), but I'm happy to use any tool that you and the team feel most comfortable with. |
Also, if we ever want other serverless onefetch web services, maybe it makes more sense to make the root directory |
Codecov Report
@@ Coverage Diff @@
## main #701 +/- ##
==========================================
+ Coverage 13.36% 13.53% +0.17%
==========================================
Files 19 19
Lines 1160 1145 -15
==========================================
Hits 155 155
+ Misses 1005 990 -15
Continue to review full report at Codecov.
|
@@ -5,11 +5,13 @@ on: | |||
paths-ignore: | |||
- "docs/**" | |||
- "**.md" | |||
- "vercel/**" |
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.
This folder may need to be added to the exclude
section of the Cargo.toml
file.
Why the need of a front end framework/library for a serverless function?
Aren't Vercel's serverless functions supposed to be placed in the |
For ASCII previews itself, no big reason, just that it might be a bit easier to parse data into a template this way. Also, reactively changing the background from dark to light can be useful. While not impossible without a frontend framework, it's a bit easier, and also more readable for other potential contributors. Though if we decide to use any framework now, this simplifies adding anything else to a serverless web service. For example, #459 (comment) was suggesting moving the wiki to gh-pages, but something very similar can be accomplished using Vercel instead. Though I have no strong feelings, and would be happy to implement this with Vanilla JS (no frameworks/libraries).
Well, the serverless function don't need to be in Personally, I'd put machine-readable responses in I think I may have been incorrectly using the phrase "serverless function." I was using it as a catch-all for static sites as well. Sorry for the confusion. |
You're right about the need of being future proof.
If we're adding folders to the project's root, we should keep it to a minimum. For example, a single folder named |
Oh yeah, right now I'm planning on putting everything in |
Conditionally gets data based on environment. If in production, then it is gotten from the API, but if in development, it gets it from the local file.
So I may have gone overboard 😆 Preview is at https://onefetch-spenserblack.vercel.app/ |
I had that issue too, which is why I caved in and made the YAML -> JSON a build step. TypeScript natively supports importing JSON, but the YAML import is handled by a Vite plugin, so I'm not sure if the TypeScript compiler is aware of that. I think something like this might be necessary. // types.d.ts
declare module '*.yaml' {
const data: Record<string, any>;
export default data;
} |
c93ef82 Resolved the type errors for me (running |
If a user runs `npm run build` locally to build the Vite deployment, this folder will be generated with built assets. We probably don't want those assets to be tracked.
🤔 I wonder if running |
😢 Looks like nightly had a change that broke the CI. |
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 think the PR is ready to be merged 🎉
Maybe we can wait for gitoxide to fix the build issue 🤔 their CI is also failing
* ================ | ||
* Minimal css theme. | ||
* Project: https://github.com/oxalorg/sakura/ | ||
*/ |
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.
Since this has been modified by us, we might want to add a comment here just saying so. We don't need to, but it might be helpful for someone stumbling on this.
Sorry, ignore this, I didn't see 0179115 and thought that the colors were changed manually.
I think so, too! I'm fine to wait until the CI is fixed. Thanks for all your work updating the styling, simplifying the logic, etc.! |
- Add CI - Change label styling and usage
🤔 Maybe we should add |
Should onefetch.dev be listed as one of the sites using sakura.css? |
Sure! that's a good idea 👍 |
At the time of creation of this PR, there is absolutely nothing notable, hence why it is starting as a draft. I am creating this before any significant code is contributed so that I can document the steps as I go through them.
Setup
./
tovercel/ascii-preview
vercel/
Resolves #696