@cccteam/ccc-lib

中文文档
0.0.47发布于 2026/10/25TypeScriptES Module构建来源已验证近 30 天下载 5934

ccc-lib is a comprehensive Angular library developed by the cccteam. It is designed to provide a consistent and configurable foundation for building enterprise-level data-driven applications. By defining a con

原始使用文档
文档目录8 节
  1. Core Features
  2. Getting Started
  3. Core Concepts
  4. Modules Overview
  5. Development
  6. Building the Library
  7. Running Tests
  8. Known Issues

ccc-lib

ccc-lib is a comprehensive Angular library developed by the cccteam. It is designed to provide a consistent and configurable foundation for building enterprise-level data-driven applications. By defining a configuration, you can dynamically generate entire application pages.

Core Features

  • Dynamic Page Generation: Define a resourceConfig to dynamically render components and build complex layouts. For example, the resource-resolver can switch between components based on your data.
  • Authentication & Authorization: A set of services and guards for managing user authentication and permissions.
  • Utility Functions: A set of helper functions for various tasks, such as data manipulation and request customization. Also included are tools for handling PATCH requests per the JSON Patch standard RFC 6902.

Getting Started

To install ccc-lib in your project, run the following command:

npm install ccc-lib

Core Concepts

The central concept of ccc-lib is the resourceConfig. This configuration object defines the structure and behavior of a page or a part of a page. It specifies which components to render, how they are connected, and how they interact with data.

The compound-component component is the engine that brings the resourceConfig to life. It dynamically creates and configures components based on the provided configuration, allowing for highly flexible and data-driven UIs.

Modules Overview

  • ccc-resource: The core module of the library. It contains the components and services related to dynamic page generation and data management.
  • auth: This module provides authentication and authorization, including login forms, route guards, and permission directives.
  • ui: This module contains UI components and services, such as alerts, notifications, and sidenav components.
  • utils: A collection of utility pipes and functions for various purposes.

Development

Building the Library

To build the library locally, use the Angular CLI:

ng build ccc-lib

Running Tests

To run the library's tests, use the following command:

ng test ccc-lib

Known Issues

  • Contentful Dependency: The library currently has a hard dependency on @contentful/rich-text-types due to the CustomTypes.ContentfulDocument type definition in the resource metadata. This means consumers of the library must have this package installed, even if they are not using this custom type.

版本与发布记录

@cccteam/ccc-lib 共发布 38 个版本,首次发布于 2024/12/06;过去 12 个月发布了 32 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.0.47latest2026/10/2515 天前
0.0.462026/10/2020 天前
0.0.452026/09/241 个月前
0.0.442026/07/303 个月前
0.0.432026/07/293 个月前
0.0.422026/07/293 个月前

关于 @cccteam/ccc-lib 的常见问题

@cccteam/ccc-lib 是什么?

ccc-lib is a comprehensive Angular library developed by the cccteam. It is designed to provide a consistent and configurable foundation for building enterprise-level data-driven applications. By defining a con

如何安装 @cccteam/ccc-lib?

在项目目录运行 npm install @cccteam/ccc-lib,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@angular/core(^21.0.0)、@angular/common(^21.0.0)、@contentful/rich-text-types(^17.2.5)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@cccteam/ccc-lib 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@cccteam/ccc-lib 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@cccteam/ccc-lib 可以商用吗?

@cccteam/ccc-lib 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@cccteam/ccc-lib 的下载量有多少?

根据 npm 官方下载统计,@cccteam/ccc-lib 在 2026/10/10 – 2026/11/08 这 30 天内被下载 5,934 次,日均约 198 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cccteam/ccc-lib 还在维护吗?

最新版本 0.0.47 发布于 2026/10/25(15 天前);至今共发布 38 个版本,其中过去 12 个月发布了 32 个;首次发布于 2024/12/06。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。