This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// has to be exported - triggers should be stored in the same folder as table schemas | |
export const insertTrigger = new Trigger({ | |
name: "update_product_meta_on_new_review", | |
type: "INSERT", | |
on: review, | |
when: ({ newRow }) => eq(newRow.isPrivate, false), | |
do: ({ newRow }) => | |
db | |
.insert(productMeta) | |
.values({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"liveServer.settings.donotShowInfoMsg": true, | |
"explorer.confirmDelete": false, | |
"sass.format.convert": false, | |
"sass.disableUnitCompletion": false, | |
"git.autofetch": true, | |
"git.confirmSync": false, | |
"git.suggestSmartCommit": false, | |
"python.analysis.autoImportCompletions": true, | |
"python.analysis.completeFunctionParens": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"name":"default","settings":"{\"settings\":\"{\\r\\n \\\"liveServer.settings.donotShowInfoMsg\\\": true,\\r\\n \\\"explorer.confirmDelete\\\": false,\\r\\n \\\"sass.format.convert\\\": false,\\r\\n \\\"sass.disableUnitCompletion\\\": false,\\r\\n \\\"git.autofetch\\\": true,\\r\\n \\\"git.confirmSync\\\": false,\\r\\n \\\"git.suggestSmartCommit\\\": false,\\r\\n \\\"python.analysis.autoImportCompletions\\\": true,\\r\\n \\\"python.analysis.completeFunctionParens\\\": true,\\r\\n \\\"python.analysis.diagnosticMode\\\": \\\"workspace\\\",\\r\\n \\\"python.analysis.inlayHints.functionReturnTypes\\\": true,\\r\\n \\\"javascript.updateImportsOnFileMove.enabled\\\": \\\"always\\\",\\r\\n \\\"editor.unicodeHighlight.allowedLocales\\\": {\\r\\n \\\"ru\\\": true\\r\\n },\\r\\n \\\"editor.accessibilitySupport\\\": \\\"off\\\",\\r\\n \\\"emojisense.languages\\\": {\\r\\n \\\"javascript\\\": true,\\r\\n \\\"javascriptreact\\\": true,\\r\\n \\\"typescript\\\": true,\\r\\n \\\"typescriptreac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"name":"Svelte","settings":"{\"settings\":\"{\\r\\n \\\"liveServer.settings.donotShowInfoMsg\\\": true,\\r\\n \\\"explorer.confirmDelete\\\": false,\\r\\n \\\"sass.format.convert\\\": false,\\r\\n \\\"sass.disableUnitCompletion\\\": false,\\r\\n \\\"git.autofetch\\\": true,\\r\\n \\\"git.confirmSync\\\": false,\\r\\n \\\"git.suggestSmartCommit\\\": false,\\r\\n \\\"python.analysis.autoImportCompletions\\\": true,\\r\\n \\\"python.analysis.completeFunctionParens\\\": true,\\r\\n \\\"python.analysis.diagnosticMode\\\": \\\"workspace\\\",\\r\\n \\\"python.analysis.inlayHints.functionReturnTypes\\\": true,\\r\\n \\\"javascript.updateImportsOnFileMove.enabled\\\": \\\"always\\\",\\r\\n \\\"editor.unicodeHighlight.allowedLocales\\\": {\\r\\n \\\"ru\\\": true\\r\\n },\\r\\n \\\"editor.accessibilitySupport\\\": \\\"off\\\",\\r\\n \\\"emojisense.languages\\\": {\\r\\n \\\"javascript\\\": true,\\r\\n \\\"javascriptreact\\\": true,\\r\\n \\\"typescript\\\": true,\\r\\n \\\"typescriptreact |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { browser } from '$app/environment'; | |
import { PUBLIC_EXTERNAL_URL, PUBLIC_INTERNAL_URL, PUBLIC_IS_DOCKER } from '$env/static/public'; | |
import type { paths } from '$lib/openapi'; // generated from openapi-typescript | |
import type { StrictOmit, StrictPick } from '$lib/utils/types'; // these are just Omit|Pick but with autocomplete | |
import createClient, { type FetchOptions } from 'openapi-fetch'; | |
const baseUrl = browser ? undefined : PUBLIC_IS_DOCKER ? PUBLIC_INTERNAL_URL : PUBLIC_EXTERNAL_URL; | |
export const api = createClient<paths>({ baseUrl }); | |
type Api = typeof api; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { watch } from 'chokidar'; | |
import { writeFile } from 'fs/promises'; | |
import { glob } from 'glob'; | |
import { format } from 'prettier'; | |
const pageGlobMatcher = './src/routes/**/+page?(@)*.svelte'; | |
export default async function generateRoutes() { | |
const paths = await getPaths(); | |
const routes = paths.map(parsePath); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Page() { | |
return ( | |
<div className="flex"> | |
<div>Page</div> | |
<Component /> | |
</div> | |
); | |
} | |
function Component() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { contentStackAtom } from "@/hooks/useHeader"; | |
import { useAtomValue } from "jotai"; | |
export default function Header() { | |
const stack = useAtomValue(contentStackAtom).filter((node) => !!node.content); | |
return ( | |
<header> | |
{stack.at(-1)?.content ?? "App Title"} | |
</header> |