Skip to content

Commit

Permalink
[Feature] 上传 shader graph、l10n 插件,添加批量工作流与文档 (#2)
Browse files Browse the repository at this point in the history
* 上传 localization-editor 插件

* 修改成不依赖编辑器的独立 localization-editor 插件

* 上传 creator-graph 插件

* 添加批量工作流以及文档

* 更新 creator-graph 文档与配图

* 完善文档,把 creator-graph 改成 shader-graph

* 更新文档与注释
  • Loading branch information
knoxHuang authored Nov 27, 2023
1 parent f6ae775 commit 7d190a6
Show file tree
Hide file tree
Showing 690 changed files with 44,461 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dist/
build/
.tmp/
.cache/
.history/

# 忽略日志文件
logs/
Expand All @@ -35,5 +36,4 @@ coverage/
*.swp

# 忽略自动生成的文档和注释
docs/
*.html
extensions/shader-graph/.npmrc
50 changes: 44 additions & 6 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,17 +1,55 @@
# Cocos Creator Extensions
# Cocos Creator Public Extension Plugin Library

Store some Creator extension plugins
[中文](./README.zh-CN.MD)

[![CI Status](https://github.com/cocos/cocos-creator-extensions/actions/workflows/ci.yaml/badge.svg)](https://github.com/cocos/cocos-creator-extensions/actions/workflows/ci.yaml)
For storing publicly available extension plugin libraries

## Install
Extension Plugin List:

Clone the code to your local machine
- [shader-graph](extensions/shader-graph/README.zh-CN.md)(Depends on the Cocos Creator editor version >= 3.8.2)
- [localization-editor](./extensions/localization-editor/README.zh-CN.md)(Depends on the Cocos Creator editor version >= 3.7.0)

## Download

Clone the code to your local computer

```bash
git clone https://github.com/cocos/cocos-creator-extensions.git
```

## Usage
### Initialisation

```bash
// Run the install command for initializing cocos-creator-extensions and all plugins in the extensions directory
npm install
```
### Compilation
```bash
// Run the build command for all plugins in the extensions directory
npm run build
```
### Packaging
```bash
// Run the packaging command for all plugins in the extensions directory
npm run pack
```
### Unit Testing
```bash
// Run the unit testing command for all plugins in the extensions directory
npm run test
```
### Executing a Command for a Single Plugin
Specify **--extension="PluginName"** or **--ext="PluginName"** after each specific command to individually execute a command for a certain plugin.
## Applying Modified Plugins to the Project
1. After modifying a plugin, use npm run pack to package it into a zip file.
2. In the Cocos Creator editor, open the panel by clicking on Extensions/Extension Manager in the main menu. Click to import the zip plugin.
57 changes: 57 additions & 0 deletions README.zh-CN.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Cocos Creator 公开扩展插件库

[English](./README.MD)

用于存储公开扩展插件库

插件列表:

- [shader-graph](extensions/shader-graph/README.zh-CN.md)(依赖 Cocos Creator 编辑器版本 >= 3.8.2)
- [localization-editor](./extensions/localization-editor/README.zh-CN.md)(依赖 Cocos Creator 编辑器版本 >= 3.7.0)

## 安装

将代码克隆到本地计算机

```bash
git clone https://github.com/cocos/cocos-creator-extensions.git
```

### 初始化

```bash
// 初始化 cocos-creator-extensions 以及 extensions 目录下的所有插件 install 指令
npm install
```

### 编译

```bash
// 启动 extensions 目录下的所有插件 build 指令
npm run build
```

### 打包

```bash
// 启动 extensions 目录下所有插件的打包指令
npm run pack
```

### 单元测试

```bash
// 启动 extensions 目录下的所有插件的单元测试指令
npm run test
```

### 单独执行某个插件指令

```bash
在上面每个指定后面指定 --extension="插件名" 或者 --ext="插件名" 即可单独启动某个插件的指令
```

## 插件修改后,应用到项目中

1. 修改插件以后,使用 **npm run pack** 打包成 zip 包。
2. 到 Creator Cocos 编辑器中主菜单点击 **扩展/扩展管理器** 打开面板,点击导入 zip 插件即可。
33 changes: 33 additions & 0 deletions extensions/localization-editor/.editor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
'use strict';

/**
* 打包的时候不需要打到 asar 的文件夹
* 如果不填,则所有的代码都会进入 asar
* @returns {{files: string[], folders: string[]}}
*/
exports.unpacked = function() {
return {
folders: [
'./static/assets',
'./node_modules'
]
};
};

exports.xxtea = function() {
return [
[
'panel-dist/**/*.js',
],
[
'dist/**/*.js',
],
];
};

exports.clearSource = function() {
return [
'./src',
'./panel',
];
}
6 changes: 6 additions & 0 deletions extensions/localization-editor/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@types
/*.json
*.config.ts
*.setup.ts
dist
panel-dist
Loading

0 comments on commit 7d190a6

Please sign in to comment.