By using ReturnType
we don't have to manually write type for Context
See also gist for SolidJS https://gist.github.com/JLarky/a46055f673a2cb021db1a34449e3be07
And original tweet https://twitter.com/JLarky/status/1554152932425117697
By using ReturnType
we don't have to manually write type for Context
See also gist for SolidJS https://gist.github.com/JLarky/a46055f673a2cb021db1a34449e3be07
And original tweet https://twitter.com/JLarky/status/1554152932425117697
#!/bin/sh | |
/*/.this-doesnt-exist 2>/dev/null | |
## Please do not edit this part of the script, this is a loader created by "npx bun-self" | |
if ! [ -x "$(command -v bun)" ]; then | |
## it's possible that bun is installed but not in the PATH, let's check if BUN_INSTALL is set | |
if [ -z "$BUN_INSTALL" ]; then | |
export BUN_INSTALL="$HOME/.bun" | |
export PATH="$BUN_INSTALL/bin:$PATH" | |
fi |
By using ReturnType
we don't have to manually write ContextType
See React gist for more examples https://gist.github.com/JLarky/5a1642abd8741f2683a817f36dd48e78
And original tweet https://twitter.com/JLarky/status/1554157252856033280
/** | |
* @type {import('prettier').Options} | |
*/ | |
module.exports = { | |
plugins: [require.resolve('prettier-plugin-astro')], | |
overrides: [ | |
{ | |
files: '**/*.astro', | |
options: { parser: 'astro' } |
<div | |
class="builder-component builder-component-b86c37dbf5a74f00b1140749e979b128_e3b7b83ba76d4b1b859cda06103cf240" | |
data-name="global-nav" | |
data-source="Rendered by Builder.io" | |
> | |
<template | |
data-template-variant-id="63f38278c320405da7a63b8d358c1172" | |
><div | |
class="builder-content" | |
builder-content-id="63f38278c320405da7a63b8d358c1172" |
// @ts-check | |
function runOnSchedule() { | |
declineEventsForDate(); | |
} | |
function declineEventsForDate() { | |
var calendar = CalendarApp.getDefaultCalendar(); // Gets your default calendar | |
var now = new Date(); | |
var sevenDaysFromNow = new Date(now.getTime() + 7 * 24 * 60 * 60 * 1000); |
curl https://gist.githubusercontent.com/JLarky/4317558672148b2446861f8bb56c4f03/raw/4f6f3cd346cdcdf176ac1ac86b1049f503f6a4e5/script.ts > script.ts
bash script.ts
This is a small home grown version of t3-env but with much smaller set of features and example is written using Remix (v1) and Valibot
Big limitations compared to t3-env is that it doesn't enforce client prefix
Also there are some random bits like importing .server
files from client, that will probably require you to use vite-env-only
, I will try to update this gist once I migrate to Vite :)
How to use environment variables in Remix, tiny version, see full version: