npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@c-time/frelio-types

v1.4.1

Published

Frelio CMS の共有型定義パッケージ。コンテンツ、スキーマ、ユーザー権限、ビルドレシピなど、全パッケージで共通の型を提供する。

Readme

@c-time/frelio-types

Frelio CMS の共有型定義パッケージ。コンテンツ、スキーマ、ユーザー権限、ビルドレシピなど、全パッケージで共通の型を提供する。


概要

Frelio エコシステム全体で使用される TypeScript 型定義の中心パッケージ。3つのエントリポイントを提供する:

  • メインエントリ — 型定義の re-export
  • /schemas — Zod ベースのバリデーションスキーマと検証関数
  • /guards — 軽量な型ガード関数(Zod 不要)

インストール

npm install @c-time/frelio-types

# スキーマバリデーションを使う場合
npm install zod

使用例

// 型定義
import type { ContentType, Content, User, Permissions } from '@c-time/frelio-types'

// バリデーション(Zod 必要)
import { validateContentType, validateSiteRecipe } from '@c-time/frelio-types/schemas'

// 型ガード(Zod 不要)
import { isContentType, isContent, isUser } from '@c-time/frelio-types/guards'

// コンテンツタイプのバリデーション
const result = validateContentType(jsonData)
if (!result.success) {
  console.error(result.errors)
}

// 型ガードによる判定
if (isContent(data)) {
  console.log(data.status) // 'published' | 'draft' | 'unpublished'
}

主な型

コンテンツ

| 型 | 説明 | |----|------| | ContentType | コンテンツタイプのスキーマ定義(フィールド定義の配列) | | FieldDefinition | フィールド定義(型、オプション、バリデーション) | | FieldType | フィールド型(text, html, markdown, number, boolean, date, image, file, select, relation, array, label) | | Content | コンテンツデータ(ID、ステータス、データ、タイムスタンプ、著者) | | ContentStatus | 'published' \| 'draft' \| 'unpublished' |

UI メタデータ

| 型 | 説明 | |----|------| | ContentTypeUi | コンテンツタイプの UI 設定(ラベル、フィールド UI、グループ) | | UiFieldDefinition | フィールドの UI 設定(表示幅、フォーマット、色など) | | FieldGroupDefinition | フィールドのグループ化定義 |

ビュー

| 型 | 説明 | |----|------| | ContentTypeViews | テーブルビューの定義(カラム、ソート、フィルタ) | | ViewDefinition | ビュー定義 | | ViewColumn / ViewFilter / ViewSort | ビューの構成要素 |

ユーザー・権限

| 型 | 説明 | |----|------| | User | ユーザー(GitHub ユーザー名、表示名、権限) | | Permissions | 18 種の細粒度権限フラグ | | RoleTemplate | 'owner' \| 'admin' \| 'developer' \| 'editor' \| 'viewer' \| 'custom' |

ビルド・デプロイ

| 型 | 説明 | |----|------| | BuildTarget | 'production' \| 'staging' \| 'preview-tmpl' | | StagingBranch | ステージングブランチ定義 | | FrelioBuildDataRecipe | ビルドレシピ(@c-time/frelio-data-json-recipe から re-export) | | FrelioDependencyMap | 依存マップ(@c-time/frelio-dependency-map から re-export) |


バリデーション (/schemas)

Zod ベースのバリデーション関数。zod がピア依存。

| 関数 | 説明 | |------|------| | validateContentType(data) | ContentType JSON のバリデーション | | validateContentTypeUi(data) | ContentTypeUi JSON のバリデーション | | validateContentTypeViews(data) | Views JSON のバリデーション | | validateSiteRecipe(data) | ビルドレシピのバリデーション | | formatZodErrors(errors) | エラーメッセージの整形 |


型ガード (/guards)

Zod 不要の軽量な型ガード。

| 関数 | 説明 | |------|------| | isFieldType(value) | 有効な FieldType か判定 | | isContentType(value) | 有効な ContentType か判定 | | isContentTypeUi(value) | 有効な ContentTypeUi か判定 | | isContent(value) | 有効な Content か判定 | | isUser(value) | 有効な User か判定 | | isContentTypeViews(value) | 有効な Views か判定 | | isDashboardMetadata(value) | 有効な DashboardMetadata か判定 |


ライセンス

MIT