No description
Find a file
RavenHogWarts 358da40a8d
ci: 更新贡献和发版流程 (#29)
* feat(ci): 添加 PR 专用构工作流并增加安全检查

新增 .github/workflows/pr-build.yml,提供 PR 提交时的专用构建流程,
并在工作流中加入严格的安全检查逻辑以防止来自外部仓库的任意构建。

主要变更:
- 新增 PR Build 工作流(name: PR Build),在 pull_request_target 触发
 (types: opened, synchronize, reopened, labeled)。
- 增加权限配置(contents/read, pull-requests/write, checks/write,
  statuses/write)并设置 PLUGIN_ID 环境变量。
- 添加 security-check 作业:
  - 判断事件类型并检测 PR 来源(内部仓库或外部仓库)。
  - 对 labeled 事件仅在加入 safe-to-build 标签时允许构建。
  - 输出两个标志:is-safe 和 should-build,控制后续是否构建。
- 添加 build 作业(依赖 security-check):
  - 仅在 should-build == 'true' 时运行。
  - 检出 PR 分支代码(ref 为 PR head sha),设置 Node.js,安装依赖并执行构建。
  - 打包构建产物为 zip 并上传为 artifact(保留 7 天)。
  - 在 PR 上发表评论,包含构建信息、触发原因及下载链接(根据事件类型区分
    labeled 与其他触发)。

变更原因:
- 避免直接对外部 PR 自动构建可能带来的安全风险,通过 safe-to-build
  标签和来源检测来显式授权构建。
- 为 PR 提供可下载的构建产物与构建通知,方便审查与测试。

* feat(ci):除自动生成 Changelog 的Hub Action 步骤删除 release workflow 中 "Generate Changelog 步骤,除针对

中两版 CHANGE 的提取、标题级别判断awk 提取逻以及安装
的拼接。这样做是因为该步骤过于复杂且在当前流程中不再需要,
减少 CI 配置复杂度并避免在发布流程中因 changelog 提取失败导致
构建中断。

* chore(scripts): 移除中文 changelog 脚本调用并同步脚本路径

- 从 package.json 中移除对 CHANGELOG-zh.md 的 conventional-changelog
  命令调用,合并只生成英文 CHANGELOG。
- 更新 changelog:u 与 changelog:all 脚本,去掉对中文选项脚本的依赖,
  避免在无中文文件或脚本时导致发布流程失败。
- 同步变更记录语言为简体中文格式(仅修改 CHANGELOG.md 内容为中文翻译),
  以便发布说明更适配中文用户阅读。

这样做可以简化发布脚本依赖,减少发布时因缺少中文文件或脚本
引发的错误,同时保证主要 changelog 正常生成。

* feat(release): 增强发布脚本的健壮性与交互选项

- scripts/release-tag.mjs:
  - 添加 safeExec 封装执行命令并提供重试/跳过逻辑,
    避免重复执行导致脚本中断。
  - 添加 hasUncommittedChanges、tagExists、remoteTagExists
    等辅助函数,用于在提交、打标签和推送前做检查。
  - 在无变更时跳过 commit;在本地/远程已存在标签时跳过
    创建或推送标签;对 push 操作允许可跳过错误。
  - 发布失败时打印重试提示,整体输出更友好并更具容错性。
- scripts/version-bump.mjs:
  - 修复 parseVersion 返回对象的格式(补上逗号)并去掉多余空白。
  - 添加对“第一次发布 (1.0.0)”的特殊处理,调整交互选项
    显示顺序与编号;根据是否为第一次发布或 beta 状态
    动态显示可选项数量(1-5 或 1-6),并正确显示 beta
    的下一个编号。

这些改动提升了发布流程的安全性与可用性,减少手动
干预并避免重复操作带来的失败。
2025-08-13 00:11:24 +08:00
.github ci: 更新贡献和发版流程 (#29) 2025-08-13 00:11:24 +08:00
assets docs: 更新 README 图片路径及新增功能截图 2025-06-16 18:56:55 +08:00
scripts ci: 更新贡献和发版流程 (#29) 2025-08-13 00:11:24 +08:00
src feat: 增加配置项,优化设置界面布局 (#28) 2025-08-13 00:03:20 +08:00
style feat: 增加配置项,优化设置界面布局 (#28) 2025-08-13 00:03:20 +08:00
.editorconfig Initial commit 2025-05-04 12:05:18 +08:00
.eslintignore Initial commit 2025-05-04 12:05:18 +08:00
.eslintrc feat: 新增设置视图并优化代码嵌入初始化逻辑 (#20) 2025-07-17 00:29:16 +08:00
.gitignore Initial commit 2025-05-04 12:05:18 +08:00
.npmrc Initial commit 2025-05-04 12:05:18 +08:00
CHANGELOG.md ci: 更新贡献和发版流程 (#29) 2025-08-13 00:11:24 +08:00
CONTRIBUTING.md docs: 更新贡献指南并修正插件名称引用 2025-05-06 22:57:06 +08:00
LICENSE feat: 从 obsidian-ravenhogwarts-toolkit 插件中拆分移植 (#1) 2025-05-05 05:00:02 +08:00
MAKEFILE Initial commit 2025-05-04 12:05:18 +08:00
manifest-beta.json Revert "build: 1.2.0-beta.1" 2025-06-22 21:31:43 +08:00
manifest.json build: 1.2.2 2025-07-17 19:20:24 +08:00
package-lock.json feat: 增加配置项,优化设置界面布局 (#28) 2025-08-13 00:03:20 +08:00
package.json ci: 更新贡献和发版流程 (#29) 2025-08-13 00:11:24 +08:00
README-zh.md docs: 添加最新版下载量徽章显示下载统计信息 (#22) 2025-07-18 12:51:08 +08:00
README.md docs: 添加最新版下载量徽章显示下载统计信息 (#22) 2025-07-18 12:51:08 +08:00
tsconfig.json Initial commit 2025-05-04 12:05:18 +08:00
versions.json build: 1.2.2 2025-07-17 19:20:24 +08:00

English | 中文

ACE CODE EDITOR

An enhanced code editor using Ace editor, providing syntax highlighting, code folding, and other advanced editing features.

GitHub stars Total Downloads Latest Downloads GitHub License GitHub Issues GitHub Last Commit

Features

  • Edit code directly in Obsidian

  • Manage CSS snippets

  • Edit code blocks

  • Code file preview

Installation

Manual Installation

  1. Download the latest release
  2. Copy main.js, styles.css, and manifest.json to your vault's plugins folder: <vault>/.obsidian/plugins/obsidian-ace-code-editor/
  3. Reload Obsidian
  4. Enable the plugin in Settings → Community Plugins
  1. Install BRAT plugin
  2. Click "Add Beta plugin" in BRAT settings
  3. Enter RavenHogWarts/obsidian-ace-code-editor
  4. Enable the plugin

Development

  • Clone this repo
  • Make sure your NodeJS is at least v16 (node --version)
  • npm i or yarn to install dependencies
  • npm run dev to start compilation in watch mode
  • npm run build to build the plugin
  • npm run build:local to build the plugin and copy it to your vault's plugins folder(need create a .env file in the project root and add the line: VAULT_PATH=/path/to/your/vault)
  • npm run version to bump the version number and update the manifest.json, version.json, package.json
  • npm run release to build the plugin and bump the version number

Support

If you encounter any issues or have suggestions:

If you find this plugin helpful, you can support the development through:

License

This project is licensed under the MIT LICENSE - see the LICENSE file for details.

Star History

Star History Chart