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

@gct-paas/schema

v6.1.2

Published

paas 平台 schema 架构包

Readme

@gct-paas/schema

PaaS 平台设计/渲染 Schema 契约层。集中定义 widget、modal、design 树节点、关系图配置等 TypeScript 类型,并提供 schema 工具函数与搜索/字段常量。被 design、render 及对应 *-web 层共同依赖,本身不挂载 UI 或 _gct。

本文档面向后续开发与 AI 模型阅读:说明类型契约、依赖用途及与 core 的分工。

包信息

| 项 | 值 | | --- | --- | | 包名 | @gct-paas/schema | | 入口 | es/index.mjs(类型:es/index.d.ts) | | 全局类型 | @gct-paas/schema/types → es/types/index.d.ts | | peer | @gct-paas/api、@gct-paas/core、vue>=3 |

import type { IModal, IWidgetInfo } from '@gct-paas/schema';
import { SEARCH_TYPE, formatFieldValue } from '@gct-paas/schema';

在 monorepo 中的位置

core
 └── schema(契约层:类型 + utils + constants)
       ├── design → design-web
       └── render → render-web

依赖说明

Peer Dependencies

| 依赖 | 用途 | | --- | --- | | @gct-paas/core | 复用 FIELD_TYPE、SEARCH_SERVICE、FormComponents 等枚举/常量 | | @gct-paas/api | 类型与 API 响应结构对齐 | | vue | 部分 props/组件类型引用 |

Runtime Dependencies

| 依赖 | 用途 | | --- | --- | | dayjs | 时间字段格式化 | | lodash-es | schema 工具辅助 |


源码结构

packages/schema/src/
├── interface/          # 类型定义(核心)
│   ├── design/         # 设计树节点、编辑器数据
│   ├── modal/          # 弹窗 schema
│   ├── schema/         # widget props 细分类型
│   ├── widget/         # 组件 props/events/styles
│   ├── widget-info/    # 设计器物料元信息
│   └── relationship-diagram-config/
├── constants/          # SEARCH_TYPE、DatepickerTypes 等
├── utils/              # formatFieldValue、schema 搜索/样式工具
└── index.ts            # export type + utils + constants;install 为 noop

与 _gct 的关系

仅消费,不挂载。 包内无 onInit(),不写入 window._gct。

  • 类型层与运行时解耦:design/render 在运行时通过 _gct 访问 store/API,schema 只定义数据结构
  • 常量如 SEARCH_TYPE 依赖 core 的 FIELD_TYPE,修改字段枚举时需同步检查本包

启动与用法

无独立 setupApp。作为纯模块引入:

// 类型(design / render 开发必备)
import type {
  IDesignNode,
  IModalBody,
  IWidgetSchemas,
} from '@gct-paas/schema';

// 工具
import {
  formatFieldValue,
  formatValueByTimeType,
  FieldEditorOverrideRegistry,
} from '@gct-paas/schema';

// 常量
import { SEARCH_TYPE, DatepickerTypes } from '@gct-paas/schema';

Vue 插件式 install() 为空操作,宿主无需 app.use(schema)。


主要导出速查

| 类别 | 示例 | | --- | --- | | 设计类型 | IDesignNode、IDesignEditorData、IDesignPageNodeData | | Widget | IWidgetSchemas、IWidgetProps、IWidgetEvents | | Modal | IModal、IModalBody、IModalFooter | | 工具 | formatFieldValue、formatValueByTimeType、schema utils | | 常量 | SEARCH_TYPE、DatepickerTypes、padVTableSupportEditFieldTypes |

完整列表以 src/interface/index.ts、src/utils/index.ts、src/constants/index.ts 为准。


给后续模型的约束

  1. 新增 widget/modal 类型应在本包 interface/ 定义,再由 design/render 实现,避免在业务包重复声明。
  2. 不要在本包引入 UI 组件或挂载 _gct。
  3. 字段搜索算子扩展:改 constants/index.ts 的 SEARCH_TYPE,并确保与 core FIELD_TYPE 一致。
  4. 本包配置了 vitest,改 utils 时可跑 npm run test:run。

本地命令

cd packages/schema
npm run dev
npm run build        # lint + vue-tsc + 双 Vite 构建
npm run test:run
npm run test:coverage