This is English text version trnslated by openai (image links are broken. I'll fix it later...)
https://mizchi-20241123-jsconfjp.pages.dev/
@mizchi at JSConfJP 2024
This is English text version trnslated by openai (image links are broken. I'll fix it later...)
https://mizchi-20241123-jsconfjp.pages.dev/
@mizchi at JSConfJP 2024
// .storybook/main.ts | |
// Replace your-framework with the framework you are using (e.g., react-vite, vue3-vite) | |
import type { StorybookConfig } from "@storybook/react-vite"; | |
const config: StorybookConfig = { | |
framework: "@storybook/react-vite", | |
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(ts|tsx)"], | |
async viteFinal(config, options) { | |
// Add your configuration here | |
return config; |
//https://gist.github.com/mizchi/24ac021b8d59755599860c785526f955 | |
import { google } from "npm:@ai-sdk/[email protected]"; | |
import { streamText } from "npm:[email protected]"; | |
import { parseArgs } from "node:util"; | |
import path from "node:path"; | |
import { $ } from "jsr:@david/[email protected]"; | |
async function getFilesContent(basePath: string) { | |
const filesContent: { | |
[key: string]: string; |
/* # Lighthouse performance testing with n times by deno | |
$ deno run -A src/lhs.ts https://www.npmjs.com/package/puppeteer --times 3 | |
{ | |
avg: 0.45999999999999996, | |
times: 3, | |
scores: { | |
"first-contentful-paint": 0.03, | |
"first-meaningful-paint": 0.12, |
/** | |
[[durable_objects.bindings]] | |
name = "MyDurableObject" | |
class_name = "MyDurableObject" | |
[[migrations]] | |
tag = "v1" # Should be unique for each entry | |
new_sqlite_classes = ["MyDurableObject"] # Array of new classes | |
*/ | |
import { DurableObject } from "cloudflare:workers"; |
/* | |
事前に unicode-range が判明しているフォントから、unicode-range を抜き出して専用の woff2 を作成するテスト | |
ブラウザでこれを実行 | |
[...new Set(Array.from(document.body.textContent).map(t => t.codePointAt(0)))].sort() | |
$ ls | |
╭───┬─────────────────────────┬──────┬──────────┬────────────────╮ | |
│ # │ name │ type │ size │ modified │ |
import { PrismaClient } from "@prisma/client"; | |
import { PrismaPg as PrismaPgWorker } from "@prisma/adapter-pg-worker"; | |
import { Pool } from "@prisma/pg-worker"; | |
let _db: PrismaClient | null = null; | |
export async function getPrismaClient(env: Env): Promise<PrismaClient> { | |
if (_db) return _db; | |
if (import.meta.env.DEV) { | |
const { default: pg } = await import("pg"); |
playwright を読んだメモ
"ctest": "playwright test --config=tests/library/playwright.config.ts --project=chromium-*",
"ftest": "playwright test --config=tests/library/playwright.config.ts --project=firefox-*",
"wtest": "playwright test --config=tests/library/playwright.config.ts --project=webkit-*",
"atest": "playwright test --config=tests/android/playwright.config.ts",
"etest": "playwright test --config=tests/electron/playwright.config.ts",
// It does not work. | |
/* | |
$ deno run -A vai-claude-tools.ts | |
Certainly! I can help you get the current weather information for San Francisco. To do this, I'll use the weather function to retrieve the data. Let me make the call for you.error: Uncaught (in promise) AI_TypeValidationError: Type validation failed: Value: {"type":"content_block_start","index":1,"content_block":{"type":"tool_use","id":"toolu_01S1YL68SUTQiQhfMrF8ENNr","name":"weather","input":{}}}. | |
Error message: [ | |
{ | |
"received": "tool_use", | |
"code": "invalid_literal", | |
"expected": "text", |
前提
koka言語について説明して