@cdubz/ckeditor5-source-editing-codemirror

中文文档
35.1.0发布于 2022/09/12GPL-2.0-or-laterCommonJS近 30 天下载 2.1万

CodeMiror 5 语法在 CKEditor 5 源编辑模式中突出显示.

中文使用文档
文档目录13 节
  1. 目录
  2. 开发软件包
  3. 可用的脚本
  4. start
  5. test
  6. lint
  7. stylelint
  8. dll:build
  9. dll:serve
  10. translations:collect
  11. translations:download
  12. translations:upload
  13. 许可证

CKEditor 5 代码密钥特性

npm version

提供源编辑格式,使用 代码 5。 。 。 .

此软件包是由 ckeditor5-包装-生成器 软件包.

目录

开发软件包

欲了解CKEditor 5框架,请访问 CKEditor5 文档。 。 。 .

可用的脚本

Npm脚本是工程中提供命令的方便方式. 定义载于 package.json 并与其他为该项目捐款的人分享。 它确保开发人员使用相同的命令,并有相同的选项(lags).

所有脚本都可以通过运行执行 npm run <script>。带有匹配名称的预和邮局命令也将为这些命令运行.

以下脚本可在包中找到.

start

启动一个 HTTP 服务器,其活重装机制允许预览和测试包中可用的插件.

服务器启动后,默认浏览器会打开开发者样本. 这可以通过通过 --no-open 选项.

您也可以通过指定 --language [LANG] 选项。 默认为 'en'。 。 。 .

实例:

# Starts the server and open the browser.
npm run start

# Disable auto-opening the browser.
npm run start -- --no-open

# Create the editor with the interface in German.
npm run start -- --language=de

test

允许对套件执行单位测试,在 tests/ 目录。 命令接受以下修改: 1

  • --coverage - 要创建代码覆盖报告,
  • --watch - 观察源文件(执行测试后命令不会结束),
  • --source-map - 生成来源图,
  • --verbose – 打印额外的网页包装日志.

实例:

# Execute tests.
npm run test

# Generate code coverage report after each change in the sources.
npm run test -- --coverage --test

lint

运行 ESLint,用于分析代码(全部) *.js 要快速查找问题.

实例:

# Execute eslint.
npm run lint

stylelint

类似于 lint 任务,样式lint分析 CSS 代码(*.css 文档中 theme/ 目录)在包中.

实例:

# Execute stylelint.
npm run stylelint

dll:build

创建一个 DLL 兼容的软件包构建, 可以使用此软件装入编辑器 DLL 构建。 。 。 .

实例:

# Build the DLL file that is ready to publish.
npm run dll:build

# Build the DLL file and listen to changes in its sources.
npm run dll:build -- --watch

dll:serve

创建一个简单的 HTTP 服务器( 没有活重装机制), 可以验证软件包的 DLL 构建是否兼容 CKEditor 5 DLL 构建。 。 。 .

实例:

# Starts the HTTP server and opens the browser.
npm run dll:serve

translations:collect

收集翻译信件( t() 函数)和上下文文件,然后验证所提供的值是否不影响 @ckeditor/ckeditor5-core 软件包.

如果满足以下条件之一,任务可能以出错而结束:

  • 发现 Unused context 错误 - 在 lang/contexts.json 文件不用于源文件。 应取出.
  • 发现 Context is duplicated for the id 出错 – 有些条目是重复的. 考虑把它们从 lang/contexts.json 文件,或重写它们.
  • 发现 Context for the message id is missing 错误 - 源文件中指定的条目不描述于 lang/contexts.json 文档。 应该加上这些内容.

实例:

npm run translations:collect

translations:download

从 Transifex 服务器下载翻译 。 根据项目中用户的活动,它创建用于构建编辑器的翻译文件.

任务需要将 URL 传递给 Transifex API 。 通常,它符合以下格式: https://www.transifex.com/api/2/project/[PROJECT_SLUG]。 。 。 .

为了避免通过 --transifex 选项每次调用命令时,都可以将其存储在 package.json,旁边 ckeditor5-package-tools translations:download 命令.

实例:

npm run translations:download -- --transifex [API URL]

translations:upload

将翻译信件上传到 Transifex 服务器上。 它允许用户使用Transifex平台创建其他语言的翻译.

任务需要将 URL 传递给 Transifex API 。 通常,它符合以下格式: https://www.transifex.com/api/2/project/[PROJECT_SLUG]。 。 。 .

为了避免通过 --transifex 选项每次调用命令时,都可以将其存储在 package.json,旁边 ckeditor5-package-tools translations:upload 命令.

实例:

npm run translations:upload -- --transifex [API URL]

许可证

根据下列规定获得许可证: GNU 通用公共许可证版本 2 或稍后版本。 。 。 .

版本与发布记录

@cdubz/ckeditor5-source-editing-codemirror 共发布 2 个版本,首次发布于 2022/09/12;过去 12 个月发布了 0 个版本。

版本发布日期距今
35.1.0latest2022/09/124 年前
0.9.02022/09/124 年前

关于 @cdubz/ckeditor5-source-editing-codemirror 的常见问题

@cdubz/ckeditor5-source-editing-codemirror 是什么?

CodeMiror 5 语法在 CKEditor 5 源编辑模式中突出显示.

如何安装 @cdubz/ckeditor5-source-editing-codemirror?

在项目目录运行 npm install @cdubz/ckeditor5-source-editing-codemirror,或使用 pnpm add / yarn add / bun add。

@cdubz/ckeditor5-source-editing-codemirror 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/cdubz__ckeditor5-source-editing-codemirror 是否存在。

@cdubz/ckeditor5-source-editing-codemirror 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@cdubz/ckeditor5-source-editing-codemirror 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=14.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@cdubz/ckeditor5-source-editing-codemirror 可以商用吗?

@cdubz/ckeditor5-source-editing-codemirror 使用 GPL-2.0-or-later 许可。强 Copyleft:分发包含该代码的软件时,整个作品需以兼容的 GPL 许可开源。仅在内部使用、不对外分发时不触发此义务。以上为概括,不构成法律意见,请以许可原文为准。

@cdubz/ckeditor5-source-editing-codemirror 的下载量有多少?

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

@cdubz/ckeditor5-source-editing-codemirror 还在维护吗?

最新版本 35.1.0 发布于 2022/09/12(4 年前);至今共发布 2 个版本,其中过去 12 个月发布了 0 个;首次发布于 2022/09/12。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。