node $(bun ./pnpm-where.ts panda)node --cpu-prof $(bun ./pnpm-where.ts panda) | import { exec } from 'node:child_process'; | |
| import fs from 'node:fs/promises'; | |
| import path from 'node:path'; | |
| import { promisify } from 'node:util'; | |
| import { Project } from 'ts-morph'; | |
| const execPromise = promisify(exec); | |
| async function generateHonoDtsFile() { |
| import type { SqlError } from "@effect/sql"; | |
| import { Cause, Effect, Either } from "effect"; | |
| import type { ParseError } from "effect/ParseResult"; | |
| import { QueryError } from "./create-query.ts"; | |
| type PossibleError = SqlError.SqlError | ParseError; | |
| interface PersistQueryConfig<Input, Output, FE, LE, PA, PE> { | |
| name: string; | |
| fetch: (input: Input) => Effect.Effect<Output, PossibleError | FE>; |
| import path from 'node:path'; | |
| import { Project } from 'ts-morph'; | |
| const __dirname = path.dirname(new URL(import.meta.url).pathname); | |
| async function main() { | |
| console.log('Rewritings imports start'); | |
| const onDone = '✅ Rewriting imports'; | |
| console.time(onDone); |
| // port of https://github.com/chakra-ui/panda/blob/f58f6df22d7cfc0163296bc86a811da64e74977a/sandbox/vite-ts/remove-unused-css-vars.ts | |
| // with lightningcss | |
| // doesn't seem much faster, probably because of the `Stylesheet` visitor | |
| // `transform` is lightningcss fn | |
| /* | |
| // using this lightningcss plugin | |
| ❯ pnpm panda cssgen --lightningcss -o oui.css | |
| traverse: 3.357ms | |
| transform: 18.327ms |
| /** | |
| https://github.com/chakra-ui/chakra-ui/blob/768aea0f0eb55af9d2e13d7568d92b0b995a0699/packages/components/src/css-reset/css-reset.tsx | |
| */ | |
| const css = String.raw; | |
| const vhPolyfill = css` | |
| :root, | |
| :host { | |
| --chakra-vh: 100vh; |
| import { PandaContext, loadConfigAndCreateContext } from '@pandacss/node' | |
| import { createCss } from '@pandacss/shared' | |
| import { isAbsolute, resolve } from 'path' | |
| import { PluginOption, ResolvedConfig, createFilter } from 'vite' | |
| import MagicString from 'magic-string' | |
| const ensureAbsolute = (path: string, root: string) => (path ? (isAbsolute(path) ? path : resolve(root, path)) : root) | |
| const pandaVite = (): PluginOption => { | |
| let config: ResolvedConfig | |
| let root: string |
node $(bun ./pnpm-where.ts panda)node --cpu-prof $(bun ./pnpm-where.ts panda) | import { NonUndefined } from 'pastable'; | |
| import { defineProperties } from '@vanilla-extract/sprinkles'; | |
| import tb from 'ts-toolbelt'; | |
| import { vtmnPreset } from './vtmn-preset'; | |
| const colors = mapTailwindColorsToTheme(vtmnPreset.theme.colors); | |
| export const colorStyles = defineProperties({ | |
| conditions: { | |
| lightMode: {}, |
| const PascalCase = /from "(\.\/)*([A-Z])+([A-Za-z0-9]*)+";/; | |
| /* | |
| Find these, starting at "from" ending at ";" | |
| export * from "./Reader"; | |
| export * from "./AliasHandler"; | |
| export * from "./EntityGroupsMetadata"; | |
| export * from "./SuchNameShouldNotExist"; | |
| */ | |
| const wait = (duration, callback) => new Promise((resolve) => setTimeout(() => resolve(callback?.()), duration)) |