yarn create vite
This file contains hidden or 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 React from "react"; | |
| import { Link } from "react-router-dom"; | |
| export function createResource(getPromise) { | |
| let cache = {}; | |
| let inflight = {}; | |
| let errors = {}; | |
| function load(key) { | |
| inflight[key] = getPromise(key) |
This file contains hidden or 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 * as React from 'react' | |
| import {useLocation} from 'react-router-dom' | |
| import {useTransition} from '@remix-run/react' | |
| import {useBeforeUnload} from 'remix' | |
| import {useSSRLayoutEffect} from './misc' | |
| let firstRender = true | |
| let positions: {[key: string]: number} = {} | |
| const SESSION_STORAGE_KEY = 'kody_scroll_positions' |
This file contains hidden or 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 Cell({ | |
| value, | |
| row: {values: user}, | |
| column: {id: propertyName}, | |
| }: { | |
| value: string | |
| row: {values: User} | |
| column: {id: string} | |
| }) { |
This file contains hidden or 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 * as bcrypt from "bcrypt"; | |
| import { createCookieSessionStorage, redirect } from "remix"; | |
| import { db } from "./db.server"; | |
| export type LoginForm = { | |
| username: string; | |
| password: string; | |
| }; |
This file contains hidden or 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
| type CacheMetadata = { | |
| createdTime: number | |
| maxAge: number | null | |
| expires: number | null | |
| } | |
| function shouldRefresh(metadata: CacheMetadata) { | |
| if (metadata.maxAge) { | |
| return Date.now() > metadata.createdTime + metadata.maxAge | |
| } |
This file contains hidden or 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
| .next | |
| __generated__ |
This file contains hidden or 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
| module.exports = { | |
| parser: "@typescript-eslint/parser", | |
| parserOptions: { | |
| project: "./tsconfig.json", | |
| ecmaVersion: 2018, | |
| sourceType: "module", | |
| }, | |
| extends: [ | |
| "typed-fp", | |
| "plugin:sonarjs/recommended", |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| generate_file() { | |
| if [ ! -f "$1" ]; then | |
| echo "$2" > "$1" | |
| fi | |
| } | |
| # --- | |
| # package.json |