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

app-cc3-lib

v1.5.3

Published

app-cc3-lib

Readme

app-cc3-lib

这是一个模块化、可扩展的跨游戏引擎开发框架,提供了一套完整的游戏开发基础设施和功能模块。框架采用TypeScript开发,支持多个游戏引擎,目前已实现Cocos Creator引擎的适配。

框架特性

  • 跨引擎支持:核心功能与引擎无关,可扩展支持不同游戏引擎
  • 模块化设计:功能模块独立,易于扩展和维护
  • TypeScript支持:完整的类型定义,提供更好的开发体验
  • 完整的游戏功能:从基础设施到高级功能的全面支持

框架结构

核心框架 (app/)

核心框架包含两个主要部分:

1. 基础设施 (app/base/)

  • 框架入口:base.ts
    • 应用生命周期管理
    • 启动次数统计
    • 安装时间追踪
    • 事件监听
  • 事件系统
  • 对象池
  • 工具类集合

2. 功能模块 (app/module/)

  • 网络通信(HTTP/Socket)
  • 实体组件系统(ECS)
  • 有限状态机(FSM)
  • 发布者系统(支持微信、头条等多平台)
  • 存储系统
  • 任务系统
  • 计时器
  • 视图管理
  • 更多功能模块...

引擎实现

目前提供了Cocos Creator引擎的完整实现:

  • cocos.ts: Cocos Creator适配器入口
    • 自动注入Cocos相关实现
    • 存储系统实现(CocosStorageUtils)
    • 计时器实现(TimerImpl)
    • 原生功能实现(CocosNativeHelper)
    • 视图管理实现(CocosViewManager)
  • view/: 视图管理实现
  • audio/: 音频系统
  • business/: 业务逻辑
  • native/: 原生功能
  • resource/: 资源管理
  • tick/: 心跳系统
  • utils/: 引擎相关工具

使用说明

1. 安装

npm install app-cc3-lib

2. 基础使用(Cocos Creator3.x)

// 初始化框架
import { App } from 'app-cc3-lib';

// 启动框架
await App.launch({
    injects: [], // 可选:注入自定义组件
    remoteConfig: true, // 可选:是否同步请求远程配置
    enableBidding: false // 可选:是否启用直投
});

// 使用功能模块
import { NetManager } from 'app-cc3-lib/module/net';
import { TaskQueue } from 'app-cc3-lib/module/task';

扩展开发

1. 添加新的功能模块

app/module 目录下创建新模块:

// app/module/newFeature/NewFeature.ts
export class NewFeature {
    // 实现你的功能
}

2. 支持新的游戏引擎

  1. 创建引擎适配器(参考 cocos.ts):
class NewEngineImpl implements IApplication {
    launch(): void {
        // 注入该引擎的具体实现
        this._injects();
    }

    private _injects() {
        // 注入存储实现
        Injector.inject(Storage.KEY, NewEngineStorage);
        // 注入计时器实现
        Injector.inject(Timer.KEY, NewEngineTimer);
        // 注入其他必要的实现...
    }

    // 实现其他必要的接口方法...
}

// 注入引擎实现
Injector.inject(Application.KEY, NewEngineImpl);
  1. 实现必要的系统适配:

    • 存储系统
    • 计时器系统
    • 视图管理
    • 资源加载
    • 音频系统
    • 原生接口
  2. 确保与核心框架的兼容性

3. 开发规范

  1. 模块开发

    • 保持模块独立性
    • 实现相关接口
    • 提供完整的类型定义
    • 编写单元测试
  2. 引擎适配

    • 遵循框架的抽象接口
    • 处理平台差异
    • 保持API一致性

注意事项

  1. 核心功能修改需要考虑跨引擎兼容性
  2. 引擎特定实现应该只依赖核心框架接口
  3. 保持良好的代码组织和文档维护
  4. 遵循TypeScript最佳实践

贡献指南

  1. Fork 项目
  2. 创建特性分支
  3. 提交变更
  4. 推送到分支
  5. 创建Pull Request

许可证

MIT License