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 { App } from '@tinyhttp/app' | |
import cors from 'cors' | |
import * as fs from 'fs/promises' | |
import * as prettier from 'prettier' | |
import * as codemod from '@codemod/core' | |
const app = new App() | |
const plugin = () => { | |
return { |
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, { useState } from 'react'; | |
import { Box, Text } from 'ink'; | |
import TextInput from 'ink-text-input'; | |
import Spinner from 'ink-spinner'; | |
import Table from 'ink-table'; | |
import type { ExportedDeclarations, ImportDeclaration } from 'ts-morph'; | |
import { Project, SourceFile, ts } from 'ts-morph'; | |
import { resolve } from 'node:path'; | |
import { promises } from 'node:fs'; |
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
export function usePointer({ | |
onStart, | |
onMove, | |
onEnd, | |
}: { | |
onStart: () => void | |
onMove: () => void | |
onEnd: () => void | |
}) { | |
const pressed = useSignal(false) |
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 { useSnapshot } from "valtio" | |
import { TreeStateContext, TreeMapContext, createInitialTreeState } from "./contexts" | |
import { useServerComputedData } from "./server" | |
import { useIndex, useIndexedChildren } from "./use-indexed-children" | |
import { isServer, useIsomorphicLayoutEffect } from "./utils" | |
export function useTreeSnapshot<ComputedData extends any>( | |
computeData?: (treeMap: Map<string, any>) => ComputedData, |
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 { atom, useAtom, useAtomValue } from "jotai" | |
import "./styles.css" | |
const isServer = typeof window === "undefined" | |
const useIsomorphicLayoutEffect = isServer | |
? React.useEffect | |
: React.useLayoutEffect |
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 { suspend } from 'suspend-react' | |
import { useIndexedChildren, useIndex } from 'use-indexed-children' | |
import mitt from 'mitt' | |
type EmitterContextValue = ReturnType<typeof mitt> | null | |
const EmitterContext = React.createContext<EmitterContextValue>(null) | |
type ChildrenMapContextValue = Map<string, any> | null |
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 * as Yoga from 'yoga-layout-prebuilt' | |
import { useIndexedChildren, useIndexPath } from 'use-indexed-children' | |
import useConstant from 'use-constant' | |
type Node = ReturnType<typeof Yoga.Node.create> | |
const LayoutContext = React.createContext<{ root: Node; node: Node } | null>( | |
null | |
) |
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 Node = { | |
type: 'grid' | 'row' | 'column' | 'space' | 'node' | |
parentType?: 'grid' | 'row' | 'column' | |
columns?: number | |
rows?: number | |
column?: number | |
columnOffset?: number | |
row?: number | |
rowOffset?: number | |
width: number | 'fill' | 'auto' |
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
const layout = { | |
type: 'grid', | |
columns: 24, | |
rows: 18, | |
children: [ | |
{ | |
type: 'row', | |
width: 'auto', | |
height: 'auto', | |
children: [ |
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
export type EditorLinkOptions = { | |
/** Path of the file to be opened. */ | |
path: string | |
/** Line to be focused. */ | |
line?: number | |
/** Column to be focused. */ | |
column?: number |