次のコマンドで、tj-actionsのリポジトリの一覧を取得できる。
$ gh repo list tj-actions --json "name,owner"
[
{
"name": "glob",
"owner": {
#!/usr/bin/env node --experimental-strip-types | |
// # npm/yarn を pnpm に移行するスクリプト | |
// ## 制限 | |
// Node.jsのコアパッケージのみを利用する | |
// - fsのglob | |
// https://nodejs.org/api/fs.html#fspromisesglobpattern-options | |
// - util.parseArgv | |
// https://nodejs.org/api/util.html#utilparseargsconfig | |
// ## 変更箇所 |
import * as ts from "typescript"; | |
const getLineTextFromFilePosition = ( | |
file: ts.SourceFile, | |
{ line, character }: ts.LineAndCharacter, | |
): string => { | |
const lines = file.getFullText().split("\n"); | |
return lines[line]?.slice(character) ?? ""; | |
}; |
export const requireComment = { | |
meta: { | |
type: "suggestion", | |
docs: { | |
description: "useEffectにはコメントでの説明が必須です。", | |
}, | |
schema: [], | |
messages: { | |
requireCommentOnUseEffect: `useEffectにはコメントでの説明が必須です。 |
# Update pnpm catalog with interactive | |
# pnpm catalog: https://pnpm.io/ja/catalogs | |
# fzf: https://github.com/junegunn/fzf | |
# yq: https://github.com/kislyuk/yq | |
selected_cataglogs=$(pnpm outdated --recursive --json | jq -r 'to_entries[] | .key + ": " + .value.current + " → " + .value.latest' | fzf --multi) | |
echo $selected_cataglogs | while read line ; do | |
pkg_name=$(echo "$line" | cut -d: -f1) | |
pkg_version=$(echo "$line" | cut -d' ' -f4) | |
echo "Update $pkg_name to $pkg_version" | |
yq -i ".catalog += {\"$pkg_name\": \"$pkg_version\"}" pnpm-workspace.yaml |
--only-changed
変更したテストだけ実行できる
next/font
の関数からパラメータを組み立てて https://fonts.googleapis.com/css2?family=xxx
に対してリクエストsrc: url(...)
を抜き出してwebfontファイルを保存src: url(...)
を保存したファイルパスへ書き換えNode.jsのTypeScriptサポートに関する議論を時系列でまとめたものです。
export type BaseEnvRecord = Record< | |
string, | |
{ | |
value: string | undefined; | |
required: boolean; | |
defaultValue?: string; | |
} | |
>; | |
export type ReturnTypeOfCreateEnv<T extends BaseEnvRecord> = { | |
// If the value is required, it should be a string, otherwise it should be a string or undefined |
{ | |
// ベースのtsconfigは決められたカテゴリのみを設定する | |
// それ以外は、プロジェクトごとに設定する | |
// https://www.typescriptlang.org/tsconfig/#compilerOptions | |
"compilerOptions": { | |
// incrementalビルドは特別にデフォルトで有効にする | |
"incremental": true, | |
// # JavaScript Support | |
"allowJs": false, | |
// # Type Checking |