mirror of
https://github.com/LamGC/wp-asciiplayer.git
synced 2026-11-27 05:05:50 +00:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff4bbbf32b | ||
|
|
7ab9fcf8d1 | ||
|
|
f6079d38fd | ||
|
|
1778044bd8 |
@@ -47,8 +47,10 @@ jobs:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
with:
|
||||
node-version: '24'
|
||||
node-version: '24.18.0'
|
||||
cache: npm
|
||||
- name: Use the documented npm toolchain
|
||||
run: npm install --global [email protected]
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
- run: npm test
|
||||
|
||||
+86
-50
@@ -1,76 +1,112 @@
|
||||
# wp-asciiplayer
|
||||
|
||||
为 WordPress 提供原生 Asciicast Player 区块,可在编辑器内真实播放终端录屏,
|
||||
同时兼容原有 `[asciiplayer]` shortcode。
|
||||
把终端录屏放进 WordPress 文章和页面。添加 **Asciicast Player** 区块,就能一边编辑一边预览录屏;
|
||||
旧文章里的 `[asciiplayer]` shortcode 也可以继续使用。
|
||||
|
||||
## 开发预览:1.1.0-dev
|
||||
[English documentation](README.md)
|
||||
|
||||
当前 PR 为尚未发布的开发预览。此前安装包的 1.1.0、1.2.0–1.2.3 仅为迭代标记,不代表正式发布。
|
||||
供测试的安装包使用 `wp-asciiplayer-1.1.0-dev-<提交号>.zip` 命名;不会自动创建发布标签或部署。
|
||||
## 安装
|
||||
|
||||
## 界面语言
|
||||
需要 **WordPress 6.3+** 和 **PHP 7.4+**。
|
||||
|
||||
插件自己的界面支持英文和简体中文(`zh_CN`)。编辑器跟随「用户 → 个人资料 → 语言」
|
||||
(未单独设置时跟随站点),前台跟随「设置 → 常规 → 站点语言」。翻译文件随安装包附带,可离线使用。
|
||||
英文为默认回退语言。不会把 `zh_TW` 等其他中文地区设置自动映射为简体中文。
|
||||
录屏中的终端内容和作者填写的说明文字不会被翻译。上游播放器自身的播放控件和帮助仍为英文,播放器文件保持原样。
|
||||
1. 在 **插件 → 安装插件 → 上传插件** 中上传构建好的 `wp-asciiplayer.zip`。
|
||||
2. 启用 **Asciicast Player**。
|
||||
|
||||
## 安装与使用
|
||||
GitHub 下载的源码 ZIP 需要先构建,不能直接安装,步骤见[构建说明](SOURCE.md)。
|
||||
[仓库 CI](.github/workflows/ci.yml) 列出了测试的环境组合;使用前也请检查与你的主题是否兼容。
|
||||
|
||||
将构建得到的 `wp-asciiplayer.zip` 上传到「插件 → 安装插件 → 上传插件」并启用。
|
||||
GitHub 源码 ZIP 需要先构建,不能直接当发行包安装。构建方法见 [SOURCE.md](SOURCE.md)。
|
||||
要求 WordPress 6.3+、PHP 7.4+;具体测试版本见仓库 CI。
|
||||
## 添加录屏
|
||||
|
||||
插入「Asciicast Player」区块,粘贴录制文件的 HTTP(S) URL,停止输入约半秒后会自动加载预览;也可以点击「Apply URL」立即加载。之后即可在编辑器内播放、
|
||||
暂停和拖动。「Display」面板提供展示宽度预设、自定义宽度(例如 `480px`、`65%`)以及左、中、右对齐;
|
||||
展示宽度会限制在当前页面可用空间内。点击播放器下方即可添加描述文字。
|
||||
1. 插入 **Asciicast Player** 区块。
|
||||
2. 粘贴录制文件的 URL,或点击 **选择录制文件(Choose recording)**,从媒体库选择或上传 `.cast` 文件。
|
||||
3. 停止输入约半秒后会自动加载预览。点击 **Apply URL** 可以立即加载,然后就能播放、暂停和拖动进度。
|
||||
4. 在 **Display** 中设置宽度和对齐方式。可以选择预设,也可以填写 `480px`、`65%` 等 CSS 长度。
|
||||
播放器下方可以添加说明文字。
|
||||
5. 在区块设置中调整主题、速度、循环、控制栏、适应方式、起始时间和空闲压缩,然后保存文章或页面。
|
||||
|
||||
在区块上方浮动工具栏点击「Terminal size」可快速调整终端行列数;侧边栏的同名折叠面板也保留,两处设置实时同步。
|
||||
终端尺寸与展示大小分别控制:Columns / Rows 留空时,使用 cast 文件记录的终端尺寸,
|
||||
并跟随录制中的 resize 事件。只有需要改变终端网格时才覆盖行列数,点击「Use recording size」可恢复。
|
||||
展示宽度与 `fit: width` 只缩放画面,不会修改终端行列数;覆盖网格可能影响录屏排版或裁切内容。
|
||||
主题、速度、循环、控制栏、起始时间和空闲压缩等选项仍在区块设置中调整。
|
||||
保存文章或页面后,前台使用同一播放器。重新打开已有区块时,只要已有有效 URL 就自动加载预览;
|
||||
编辑预览不会自动播放,前台自动播放设置仍会保留。区块插入器使用本地静态示例,不请求录制文件。
|
||||
播放器增加了局部样式隔离,避免常见主题的代码块边框、阴影和字体设置干扰终端;键盘焦点提示仍保留。
|
||||
重新打开文章时,已有有效 URL 的区块会自动加载录屏。编辑预览不会自动播放,即使你给前台启用了自动播放。
|
||||
空白或无效 URL 不会发起请求。区块插入器里的示例是静态的,也不会请求录制文件。
|
||||
|
||||
URL 必须指向录制文件(例如 `.cast`),不能直接使用分享页面地址。跨域文件需要允许
|
||||
来自你站点的 CORS 请求;HTTPS 页面上的 HTTP 文件可能被浏览器阻止。优先使用同源 HTTPS。
|
||||
本插件不提供远程文件代理、不扩大用户的上传权限,也不创建额外的录屏管理文章类型。
|
||||
### 展示宽度与终端尺寸
|
||||
|
||||
## 旧文章兼容
|
||||
展示宽度决定播放器在页面里占多大空间,并且不会超出可用宽度。
|
||||
调整宽度或使用 `fit: width` 只是缩放画面,不会改变终端的行列数。
|
||||
|
||||
原有 shortcode 继续有效,无须批量修改文章:
|
||||
**Columns** 和 **Rows** 留空时,会使用录屏本身的尺寸,并跟随录制中的尺寸变化。
|
||||
需要手动设置时,可以使用区块工具栏或侧栏里的 **Terminal size**,两处设置会同步。
|
||||
点击 **Use recording size** 可以清空手动设置,恢复录屏原有尺寸。
|
||||
|
||||
加载后,空白字段会显示录屏的原始行列数作为提示。换一个 URL 会刷新提示,但保留你手动填写的值。
|
||||
提示只读取同一次预览响应的前 **64 KiB**;读取不到时保留通用占位提示,不猜测尺寸。
|
||||
录制过程中后续的尺寸变化不会改变这组提示。
|
||||
|
||||
播放器自带样式,用来保持终端文字对齐和键盘焦点可见。部分主题可能仍需要调整 CSS。
|
||||
播放操作和录屏隐私说明可以在侧栏的 **帮助(Help)** 面板中找到。
|
||||
|
||||
### 录制文件地址
|
||||
|
||||
URL 要直接指向录制文件,例如 `.cast` 文件,而不是 asciinema 分享页面。
|
||||
其他域名上的文件需要允许来自你站点的 CORS 请求。HTTPS 页面可能无法加载 HTTP 文件,优先使用同站点的 HTTPS 地址。
|
||||
插件不会代理请求或复制远程文件。
|
||||
|
||||
## 旧文章与 shortcode
|
||||
|
||||
旧文章可以继续使用原有 shortcode,不需要批量修改:
|
||||
|
||||
```text
|
||||
[asciiplayer]https://example.org/demo.cast[/asciiplayer]
|
||||
[asciiplayer theme="monokai" speed="1.5" controls="false"]https://example.org/demo.cast[/asciiplayer]
|
||||
[asciiplayer startAt="2" idleTimeLimit="3" style="width: 80%;"]https://example.org/demo.cast[/asciiplayer]
|
||||
```
|
||||
|
||||
布尔值、数值和历史 camelCase 参数会归一化处理;自定义 style 经过 WordPress 安全 CSS 过滤。
|
||||
区块提供 shortcode 转换能力,转换后请检查设置再保存,不会自动重写旧文章。
|
||||
经典编辑器继续使用 shortcode,暂不增加 TinyMCE 自定义界面。
|
||||
布尔值、数值和旧的 camelCase 参数会自动处理。自定义 `style` 会经过 WordPress 的安全 CSS 过滤;
|
||||
不安全的 URL、标记,以及可执行或对象形式的选项不会被接受。
|
||||
|
||||
支持的 shortcode 可以转换成区块,保存前请检查设置。插件不会自动重写旧文章。
|
||||
经典编辑器仍可使用 shortcode,但没有专门的播放器编辑界面。
|
||||
|
||||
## 媒体库上传
|
||||
|
||||
已有 WordPress `upload_files` 权限的用户可以上传 `.cast` 文件。
|
||||
多站点还需要网络管理员允许 `cast` 扩展名。插件不会增加用户的上传权限,也不会另建录屏管理文章类型。
|
||||
|
||||
上传文件会完整校验,限制如下:
|
||||
|
||||
- 每个文件最多 **32 MiB**。
|
||||
- 最多 **100,000** 个事件或流内行。
|
||||
- 每条 JSONL 行最多 **256 KiB**。
|
||||
- 终端任一方向不超过 **1,000** 列或行。
|
||||
|
||||
旧的 asciicast v1 格式最多 **2 MiB**,需要格式化 JSON,并让起始 `{` 单独占一行;
|
||||
内置播放器无法读取压成一行的 v1 文件。Asciicast v2、v3 使用标准 JSONL。
|
||||
站点或服务器更低的上传限制仍然生效。无效录屏会被拒绝,也不会因此开放普通 JSON、HTML 或 SVG 上传。
|
||||
|
||||
## 界面语言
|
||||
|
||||
插件界面包含英文和简体中文(`zh_CN`):
|
||||
|
||||
- 编辑器跟随 **用户 → 个人资料 → 语言**;未单独设置时使用站点语言。
|
||||
- 前台跟随 **设置 → 常规 → 站点语言**。
|
||||
|
||||
翻译文件随 ZIP 附带,可离线使用。英文是默认回退语言,不需要单独的 `en_US` 翻译文件。
|
||||
`zh_TW` 等其他中文地区设置不会自动映射成简体中文。
|
||||
|
||||
录屏中的终端内容和你填写的说明文字不会被翻译。
|
||||
内置播放器自身的播放控件和帮助仍为英文,其文件保持上游原样。
|
||||
|
||||
## 资源与隐私
|
||||
|
||||
播放器 JavaScript、CSS、WebAssembly 全部本地附带,不再请求 jsDelivr,
|
||||
旧 `ap_use_local_resources` 开关不再使用。没有统计追踪或后台远程 API 请求。
|
||||
播放器的 JavaScript、CSS 和 WebAssembly 都在插件内,不会从 jsDelivr 加载。
|
||||
插件没有统计追踪,也不会在后台调用远程 API。旧的 `ap_use_local_resources` 选项不再使用。
|
||||
|
||||
你选择的录制文件会由读者浏览器直接请求;外部文件主机可能收到 IP、浏览器请求信息和
|
||||
依浏览器/站点策略发送的来源信息。编辑器存在有效 URL 时也会自动发起这类请求,包括重新打开已保存的区块。
|
||||
请使用可信主机,发布前检查录屏是否包含终端里的敏感信息。外部主机适用其自身隐私政策。
|
||||
录屏文件会由浏览器直接请求你填写的 URL。外部主机可能收到读者的 IP 地址、浏览器请求信息,
|
||||
以及浏览器和站点设置允许发送的来源信息。编辑预览也会发起同样的请求,包括重新打开已有录屏的文章时。
|
||||
|
||||
## 开发与许可
|
||||
请使用可信主机,发布前检查终端录屏是否含有敏感信息。
|
||||
外部主机适用自己的隐私政策,插件无法让外部录屏变成私有文件。
|
||||
|
||||
[构建与测试说明](SOURCE.md) · [第三方许可证](THIRD-PARTY-NOTICES.md)
|
||||
## 构建与许可
|
||||
|
||||
本插件保持 GPL-3.0-only,播放器及依赖保留各自的兼容许可证。
|
||||
构建、测试和 ZIP 打包步骤见 [SOURCE.md](SOURCE.md)。
|
||||
|
||||
### 媒体库与原始终端尺寸
|
||||
|
||||
点击区块中的 **选择录制文件(Choose recording)** 可通过 WordPress 媒体库选择或上传 `.cast` 录制文件。上传权限沿用 WordPress 的 `upload_files` 能力,不会为低权限用户开放上传。插件仅为经过格式校验的 `.cast` 文件添加支持,不放开任意 JSON、HTML 或 SVG。
|
||||
|
||||
浮动工具栏和折叠侧栏中的 Columns / Rows 留空时,会在录制加载后显示原始终端尺寸作为占位提示。更换 URL 会刷新提示,但保留你明确填写的覆盖值;恢复录制尺寸会清空覆盖值,继续尊重录制中的尺寸变化。未知或加载失败时不猜测尺寸。
|
||||
|
||||
上传文件会完整校验:最多 32 MiB、100,000 个事件或流内行、每条 JSONL 行 256 KiB、终端任一方向不超过 1,000。旧版 v1 最多 2 MiB,需使用起始 `{` 单独一行的格式化 JSON;内置播放器不支持压成一行的 v1。v2/v3 使用标准 JSONL。站点和服务器更低的上传限制仍生效,多站点还需网络允许 `cast` 扩展名。原始尺寸提示只检查同一次预览响应的前 64 KiB,无法读取时保留通用提示。
|
||||
|
||||
区块内常驻的录制/隐私说明和播放操作说明位于侧栏默认折叠的 **帮助(Help)** 面板,保留标题、错误提示和必要控件标签。
|
||||
插件使用 GPL-3.0-only。播放器和依赖保留各自的兼容许可证,详见[第三方许可证](THIRD-PARTY-NOTICES.md)。
|
||||
|
||||
@@ -1,119 +1,136 @@
|
||||
# wp-asciiplayer
|
||||
|
||||
An Asciicast Player block for WordPress, with real playback in the editor and
|
||||
backwards-compatible `[asciiplayer]` shortcodes. [中文说明](README-zh.md)
|
||||
Play terminal recordings in WordPress posts and pages. Add an **Asciicast Player**
|
||||
block to preview the recording while you edit, or keep using the `[asciiplayer]`
|
||||
shortcode in existing posts.
|
||||
|
||||
## Development preview: 1.1.0-dev
|
||||
|
||||
This PR is an unreleased development preview. Earlier draft ZIP labels 1.1.0 and
|
||||
1.2.0–1.2.3 were iteration labels, not published releases. Review packages use
|
||||
`wp-asciiplayer-1.1.0-dev-<commit>.zip`; no release tag or deployment is implied.
|
||||
|
||||
## Languages
|
||||
|
||||
Plugin-owned UI includes English and Simplified Chinese (`zh_CN`). The editor
|
||||
follows **Users → Profile → Language** (or the site default); public pages follow
|
||||
**Settings → General → Site Language**. Catalogs ship inside the ZIP and need no
|
||||
translation server at runtime. English is the source/fallback language, so a
|
||||
separate `en_US` catalog is unnecessary. `zh_TW` and other locales are not silently
|
||||
mapped to Simplified Chinese. Recorded terminal output and author captions stay
|
||||
unchanged. The bundled upstream player's own playback controls and help remain
|
||||
English; its vendor files are not modified.
|
||||
[中文说明](README-zh.md)
|
||||
|
||||
## Install
|
||||
|
||||
Install the built `wp-asciiplayer.zip` through **Plugins → Add New → Upload
|
||||
Plugin**, then activate **Asciicast Player**. A GitHub source ZIP must be built
|
||||
first; it does not contain generated assets. See [SOURCE.md](SOURCE.md).
|
||||
Requires **WordPress 6.3+** and **PHP 7.4+**.
|
||||
|
||||
Requires WordPress 6.3+ and PHP 7.4+. Compatibility must be checked against your
|
||||
site and theme; CI tests the versions listed in `.github/workflows/ci.yml`.
|
||||
1. Upload the built `wp-asciiplayer.zip` through **Plugins → Add New → Upload Plugin**.
|
||||
2. Activate **Asciicast Player**.
|
||||
|
||||
## Block editor
|
||||
A GitHub source ZIP needs to be built before you can install it. See the
|
||||
[build instructions](SOURCE.md). The [CI workflow](.github/workflows/ci.yml)
|
||||
lists the combinations we test; check the plugin with your own theme too.
|
||||
|
||||
1. Insert **Asciicast Player**.
|
||||
2. Paste an HTTP(S) recording-file URL (for example a `.cast` file), or use **Choose recording** to select/upload a `.cast` file in the WordPress Media Library. The preview loads after a short pause; **Apply URL** loads it immediately.
|
||||
3. Play, pause and seek in the editor. **Display** offers width presets or a custom
|
||||
CSS length (for example `480px` or `65%`), plus left/center/right alignment.
|
||||
The width stays within the available space. Add a caption below the player.
|
||||
4. Use **Terminal size** in the floating block toolbar for quick Columns/Rows
|
||||
edits, or expand the **Terminal size** sidebar panel. Both edit the same values.
|
||||
Empty fields show the recording’s original columns/rows as placeholders after
|
||||
loading. Changing the URL refreshes these hints without clearing your explicit
|
||||
overrides; reset clears overrides, so recorded resize events remain active.
|
||||
Terminal size is separate from display width: leave Columns and Rows blank to use the cast
|
||||
file's dimensions and recorded resize events. Override either axis only when
|
||||
intentional; use **Use recording size** to clear both. Display width and
|
||||
`fit: width` scale the existing grid without changing terminal columns.
|
||||
5. Change theme, speed, looping, controls, fit, start time and idle-time limit
|
||||
from the remaining block settings.
|
||||
6. Save the post or page; the same locally bundled player is used on the front end.
|
||||
## Add a recording
|
||||
|
||||
Existing saved blocks load their valid recording URL automatically on reopening
|
||||
the editor. Typed URL changes are debounced for 500ms; empty or invalid URLs do
|
||||
not start a recording request.
|
||||
Preview does not autoplay even when front-end autoplay is enabled.
|
||||
Recording/privacy and playback explanations are available in the collapsed
|
||||
**Help** sidebar panel, keeping the block canvas focused on editing.
|
||||
The inserter preview is a local static example and never loads a recording.
|
||||
1. Insert an **Asciicast Player** block.
|
||||
2. Paste a recording-file URL, or click **Choose recording** to select or upload a
|
||||
`.cast` file from the Media Library.
|
||||
3. The preview loads about half a second after you stop typing. Click **Apply URL**
|
||||
to load it immediately, then play, pause or seek through the recording.
|
||||
4. Use **Display** to set the width and alignment. You can choose a preset or enter
|
||||
a CSS length such as `480px` or `65%`. Add a caption below the player.
|
||||
5. Adjust the theme, speed, looping, controls, fit, start time and idle-time limit
|
||||
in the block settings, then save your post or page.
|
||||
|
||||
Terminal typography is scoped against common theme `pre`/`span` styles so
|
||||
character scaling stays aligned with the player grid. A theme with additional
|
||||
custom rules may still require compatibility testing; keyboard focus indicators
|
||||
remain visible.
|
||||
Saved recordings load again when you reopen the editor. Previews do not autoplay,
|
||||
even if you enable autoplay for the published page. Empty or invalid URLs do not
|
||||
start a request. The block inserter uses a static example, so it does not fetch a
|
||||
recording either.
|
||||
|
||||
The source must be a recording-file URL, not an asciinema share-page URL.
|
||||
A recording on another origin must allow CORS requests from your WordPress site.
|
||||
HTTP recordings on an HTTPS site may be blocked as mixed content. Use a same-site
|
||||
HTTPS URL when possible. The plugin does not proxy or copy remote files, grant
|
||||
new upload capabilities, or add a recording-management post type.
|
||||
### Display width and terminal size
|
||||
|
||||
The display width controls how much space the player takes on the page. It stays
|
||||
within the available width. Changing it, or using `fit: width`, scales the picture
|
||||
without changing the terminal's columns and rows.
|
||||
|
||||
Leave **Columns** and **Rows** empty to use the recording's dimensions and resize
|
||||
events. To override them, use **Terminal size** in the block toolbar or sidebar;
|
||||
both controls update the same settings. **Use recording size** clears the overrides.
|
||||
|
||||
After loading, the empty fields show the recording's original dimensions as hints.
|
||||
Changing the URL updates those hints but keeps any values you entered. The hints
|
||||
come from the first 64 KiB of the preview response; if they cannot be read, the
|
||||
fields keep a generic placeholder. Later resize events do not change the hints.
|
||||
|
||||
The player includes styles to keep terminal text aligned and keyboard focus
|
||||
visible. Some themes may still need CSS adjustments. Playback tips and recording
|
||||
privacy information are in the sidebar's **Help** panel.
|
||||
|
||||
### Recording URLs
|
||||
|
||||
Use an HTTP(S) URL that points to the recording file, not an asciinema share page.
|
||||
A file hosted on another domain must allow CORS requests from your site. Browsers
|
||||
may block HTTP recordings on HTTPS pages; a same-site HTTPS URL is the simplest
|
||||
option. The plugin does not proxy or copy remote files.
|
||||
|
||||
## Existing shortcodes
|
||||
|
||||
Old articles remain supported; no content migration is required:
|
||||
Existing posts keep working without a content migration:
|
||||
|
||||
```text
|
||||
[asciiplayer]https://example.org/demo.cast[/asciiplayer]
|
||||
[asciiplayer theme="monokai" speed="1.5" controls="false"]https://example.org/demo.cast[/asciiplayer]
|
||||
[asciiplayer startAt="2" idleTimeLimit="3" style="width: 80%;"]https://example.org/demo.cast[/asciiplayer]
|
||||
```
|
||||
|
||||
Boolean and numeric options are typed, and historical camelCase options are
|
||||
normalized after WordPress lowercases shortcode attribute names. Inline styles
|
||||
are filtered through WordPress safe-CSS handling; unsafe protocols and markup
|
||||
are rejected/escaped. Unsupported executable/object options are not accepted.
|
||||
The Classic Editor continues to support shortcodes; it has no custom visual UI.
|
||||
The block supports a shortcode-to-block transform for supported options. Review
|
||||
converted settings before saving; articles are never rewritten automatically.
|
||||
Boolean, numeric and older camelCase options are handled automatically. Inline
|
||||
styles go through WordPress's safe-CSS filter; unsafe URLs, markup and executable
|
||||
or object-valued options are not accepted.
|
||||
|
||||
## Local resources and privacy
|
||||
You can convert supported shortcodes into blocks. Check the settings before
|
||||
saving; the plugin never rewrites old posts automatically. The Classic Editor
|
||||
supports shortcodes, but has no custom player-editing interface.
|
||||
|
||||
All player JavaScript, CSS, and WebAssembly are included in the plugin. The old
|
||||
`ap_use_local_resources` switch is no longer used, and jsDelivr is not contacted.
|
||||
No analytics or background remote API calls are added.
|
||||
## Media Library uploads
|
||||
|
||||
A recording URL you choose is fetched directly by the visitor's browser. Its host
|
||||
can receive the visitor's IP address, browser request metadata and possibly a
|
||||
referrer, according to browser/site policy. Editor previews have the same effect
|
||||
automatically when a valid URL is present, including when reopening saved blocks. Choose a trusted host and review
|
||||
recordings for sensitive terminal output before publishing them. The host's own
|
||||
privacy policy applies; the plugin cannot make an external recording private.
|
||||
You can upload `.cast` files if your account already has WordPress's `upload_files`
|
||||
permission. Multisite networks must also allow the `cast` extension. The plugin
|
||||
does not grant extra upload permissions or add a separate recording-management
|
||||
post type.
|
||||
|
||||
## Development
|
||||
Uploads are checked against these limits:
|
||||
|
||||
See [SOURCE.md](SOURCE.md) for locked build and ZIP packaging commands. Source
|
||||
code is GPL-3.0-only. The player and its dependencies retain their own compatible
|
||||
licenses; see [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md).
|
||||
- **32 MiB** per file.
|
||||
- **100,000** events or stream lines.
|
||||
- **256 KiB** per JSONL line.
|
||||
- **1,000** columns or rows in either direction.
|
||||
|
||||
### Media Library upload limits
|
||||
The older asciicast v1 format is limited to **2 MiB**. Its JSON must be
|
||||
pretty-printed, with the opening `{` on a line of its own; the bundled player
|
||||
cannot read compact, single-line v1 files. Asciicast v2 and v3 use standard JSONL.
|
||||
Lower site or server upload limits still apply. Invalid recordings are rejected;
|
||||
this does not enable general JSON, HTML or SVG uploads.
|
||||
|
||||
The plugin adds only `.cast` uploads for users who already have WordPress
|
||||
`upload_files` permission. On multisite, the network must also allow the `cast`
|
||||
extension. Existing site/server upload limits still apply. Each upload is fully
|
||||
validated: at most 32 MiB, 100,000 events/stream lines, 256 KiB per JSONL line, and dimensions
|
||||
up to 1,000 columns/rows. Legacy v1 is limited to 2 MiB and must be pretty-printed
|
||||
with its opening JSON object on a separate line because the bundled player cannot
|
||||
read compact single-line v1. v2/v3 use their standard JSONL format. Invalid files
|
||||
are rejected; generic JSON, HTML and SVG uploads are not enabled.
|
||||
## Languages
|
||||
|
||||
Original-size hints inspect at most the first 64 KiB of the same preview response.
|
||||
If metadata is unavailable, the fields keep a generic placeholder rather than
|
||||
guessing dimensions. Recorded resize events do not replace the initial-size hint.
|
||||
The plugin's interface includes English and Simplified Chinese (`zh_CN`).
|
||||
|
||||
- In the editor, choose **Users → Profile → Language**, or use the site default.
|
||||
- On public pages, the language follows **Settings → General → Site Language**.
|
||||
|
||||
Translations are included in the ZIP and work offline. English is the fallback;
|
||||
there is no separate `en_US` catalog. Other Chinese locales, including `zh_TW`, are
|
||||
not automatically mapped to Simplified Chinese.
|
||||
|
||||
Recorded terminal output and your captions are unchanged. The bundled player's
|
||||
own playback controls and help remain in English; its files are kept as supplied
|
||||
by the upstream project.
|
||||
|
||||
## Resources and privacy
|
||||
|
||||
The player’s JavaScript, CSS and WebAssembly are bundled locally. The plugin does
|
||||
not contact jsDelivr, add analytics or make background remote API calls. The old
|
||||
`ap_use_local_resources` option is no longer used.
|
||||
|
||||
Recordings are different: visitors' browsers fetch the URL you choose directly.
|
||||
An external host may receive their IP address, browser request details and a
|
||||
referrer, depending on browser and site settings. Editor previews make the same
|
||||
request whenever a valid URL loads, including when you reopen a saved block.
|
||||
|
||||
Use a trusted host and check recordings for sensitive terminal output before
|
||||
publishing. The host's privacy policy applies; the plugin cannot make an external
|
||||
recording private.
|
||||
|
||||
## Build and license
|
||||
|
||||
See [SOURCE.md](SOURCE.md) for build, test and ZIP packaging commands.
|
||||
|
||||
The plugin is GPL-3.0-only. The player and its dependencies keep their own
|
||||
compatible licenses; see [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md).
|
||||
|
||||
@@ -4,12 +4,16 @@ This distribution contains the plugin's PHP and JavaScript source, block metadat
|
||||
build configuration, scripts, and npm lockfile. The development repository is
|
||||
https://github.com/LamGC/wp-asciiplayer .
|
||||
|
||||
Use Node.js 24 (24.15 or later), npm, and the standard `zip` command:
|
||||
Use Node.js 24.18+ (24.x) or 26+, npm 11.16+, and the standard `zip` command:
|
||||
|
||||
npm ci
|
||||
npm run build
|
||||
npm run package
|
||||
|
||||
Node.js 22 and 25 are not supported by the complete development toolchain.
|
||||
The Node requirement is for building/testing only; the plugin still supports
|
||||
WordPress 6.3 and PHP 7.4.
|
||||
|
||||
The installable output is `dist/wp-asciiplayer.zip`. Generated assets are never
|
||||
loaded from a CDN. `scripts/vendor.mjs` copies the pinned official npm
|
||||
`[email protected]` distribution, verified by package-lock integrity, into
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
# Dependency security review
|
||||
|
||||
Reviewed 2026-10-14 against the main-branch lockfile and fresh npm audit. Baseline: **44 affected package records (2 critical, 19 high, 20 moderate, 3 low), representing 15 distinct advisories**. The package-record count includes vulnerable packages and their affected parents; it is not 44 distinct security defects. All mapped paths originate in development dependencies. The final production-only root-lock audit reports zero findings; the separately vendored browser player is assessed in [player-bundle-review.md](player-bundle-review.md).
|
||||
|
||||
## Implemented narrow changes
|
||||
|
||||
Retain the current WordPress parent packages: npm registry reports `@wordpress/[email protected]` and `@wordpress/[email protected]` as current latest. This change uses scoped overrides:
|
||||
|
||||
```json
|
||||
{
|
||||
"copy-webpack-plugin": { "serialize-javascript": "7.0.5" },
|
||||
"markdownlint-cli": { "js-yaml": "5.4.3", "smol-toml": "1.9.1" },
|
||||
"simple-git": { "@simple-git/argv-parser": "2.0.1" }
|
||||
}
|
||||
```
|
||||
|
||||
- `serialize-javascript`: the current `[email protected]` calls the CommonJS serializer for cache keys. Version 7 retains that callable CommonJS API. Its major-version requirement is Node >=20, already satisfied by this project. Isolated serialization smoke tests passed. Upgrading the entire plugin to 14 would be a larger, unnecessary compatibility change. [v7 release](https://github.com/yahoo/serialize-javascript/releases/tag/v7.0.0)
|
||||
- `js-yaml`: 5.4.1 is the minimum patched version; 5.4.3 is the latest verified patch. Scope it to `markdownlint-cli`; that package pins `~5.2.1`. Do not override js-yaml globally: wp-env still calls `yaml.safeLoad`, which is unavailable in modern majors. The separate wp-env -> js-yaml 3 -> argparse 1 -> sprintf-js path remains.
|
||||
- `smol-toml`: 1.9.0 is the minimum patched version; 1.9.1 is the latest verified patch. Scope it to markdownlint-cli, which pins `~1.7.0`. The CommonJS parse API works and the null-prototype result matches the installed older version.
|
||||
- `qs`: 6.16.0 fixes both findings. **Prefer the in-range Express 4.22.2 -> 4.22.3 update**, because official metadata confirms 4.22.3 pins qs `~6.16.0`. If lockfile regeneration cannot resolve that parent update, a scoped `express -> qs: 6.16.0` override is a fallback. Avoid a disruptive Express 5 migration. The existing body-parser path already has 6.16.0.
|
||||
- `@simple-git/argv-parser`: the scoped 2.0.1 override is a partial mitigation only, with targeted no-execution tests. Preserve and document remaining simple-git alerts; details below.
|
||||
|
||||
These recommendations were based on official npm metadata, published tarballs, source inspection, and small isolated API smoke tests. Local build, 41 JS tests and packaging pass on Node 24.18.0. CI covers PHP 7.4/8.3 and real WordPress 6.3/PHP 7.4 and latest/PHP 8.2 integration.
|
||||
|
||||
## Critical simple-git findings: migration blocker
|
||||
|
||||
Path: `@wordpress/[email protected] -> [email protected] -> @simple-git/[email protected]`.
|
||||
|
||||
**Do not directly override simple-git to v4.** v4 removes the callable CommonJS default export and requires `const { simpleGit } = require('simple-git')`. wp-env currently uses `const SimpleGit = require('simple-git')` and then calls it in both `lib/download-sources.js` and `lib/runtime/docker/download-wp-phpunit.js`. A direct v4 override would fail during Git source/PHPUnit downloads. [Official v4 breaking changes](https://github.com/steveukx/git-js/releases/tag/[email protected])
|
||||
|
||||
The fully patched latest combination is simple-git **4.0.2**, which pins argv-parser **2.0.1**. Note that simple-git 4.0.1 pins parser 2.0.0, so it does not by itself clear the VISUAL finding.
|
||||
|
||||
A scoped parser-only override to 2.0.1 is included as a **partial mitigation**, with regression tests of the CommonJS API and rejected unsafe inputs. The `vulnerabilityCheck(tokens, env)` signature is unchanged, and isolated simple-git 3.36.0 with parser 2.0.1 passed read-only `checkIsRepo('root')`, `raw('rev-parse', '--show-toplevel')`, and `status()` checks. Parser checks rejected VISUAL, trailer command configuration, and include.path. However, `--receive-p` still produced no finding in that parser-only combination, and version-based simple-git advisories remain. This is not a complete fix and has not been validated through all wp-env Docker/download flows. It is reasonable to include the scoped parser override with the focused regressions while explicitly retaining the residual alerts; a full fix still needs a reviewed wp-env migration.
|
||||
|
||||
The examined wp-env call sites use clone/fetch/checkout/reset and fixed sparse-checkout commands; no commit, rebase, interpret-trailers, push, or explicit `.env()` calls were observed in these files. This reduces reachability of the reported flows for ordinary trusted wp-env use, but does not establish that the vulnerable dependency is harmless. Keep development configuration, Git arguments, environment values and source URLs trusted; do not run these tools on attacker-controlled configuration with privileged credentials.
|
||||
|
||||
## Advisory matrix
|
||||
|
||||
Ranges below are the audit's affected ranges and GitHub Advisory Database's patched versions. Registry availability was checked on the review date.
|
||||
|
||||
| Package / baseline | Advisory | Affected range | First patched version | Decision |
|
||||
|---|---|---|---|---|
|
||||
| @simple-git/argv-parser 1.1.1 | [VISUAL editor bypass](https://github.com/advisories/GHSA-v5rq-49vh-5v5c) | <2.0.1 | 2.0.1 | Parser 2.0.1 removes this finding; simple-git mitigation remains incomplete overall |
|
||||
| simple-git 3.36.0 | [Trailer command configuration](https://github.com/advisories/GHSA-x6jw-m9v5-85vh) | >=3.15.0 <4.0.1 | 4.0.1 | v4 is not drop-in for wp-env |
|
||||
| simple-git 3.36.0 | [Git configuration includes](https://github.com/advisories/GHSA-g4wm-2vf7-vfgr) | <=3.36.0 | 4.0.0 | Same migration blocker |
|
||||
| simple-git 3.36.0 | [Long-option abbreviation bypass](https://github.com/advisories/GHSA-858h-whjf-mvg5) | <=3.36.0 | 4.0.0 | Parser-only override does not fix this path |
|
||||
| serialize-javascript 6.0.2 | [RegExp/Date code injection](https://github.com/advisories/GHSA-5c6j-r48x-rmvq) | <=7.0.2 | 7.0.3 | Scoped 7.0.5 clears both findings |
|
||||
| serialize-javascript 6.0.2 | [Array-like object CPU exhaustion](https://github.com/advisories/GHSA-qj8w-gfj5-8c6v) | >=5.0.0 <7.0.5 | 7.0.5 | Scoped 7.0.5 |
|
||||
| braces 3.0.3 | [Deep nesting stack exhaustion](https://github.com/advisories/GHSA-vfj7-8cjw-p6xm) | <=3.0.3 | None | Latest published version still affected; trusted build globs only |
|
||||
| js-yaml 5.2.3 | [Empty merge source CPU exhaustion](https://github.com/advisories/GHSA-r3ph-w7gj-g6xm) | >=5.0.0 <=5.4.0 | 5.4.1 | Scoped 5.4.3 under markdownlint-cli |
|
||||
| smol-toml 1.7.2 | [Quadratic key parsing](https://github.com/advisories/GHSA-r4xh-jqrq-34v2) | <=1.8.0 | 1.9.0 | Scoped 1.9.1 |
|
||||
| sprintf-js 1.0.3 | [Unbounded precision DoS](https://github.com/advisories/GHSA-hp3w-g68c-fv3c) | <=1.1.3 | None | Latest published version still affected; wp-env parent migration needed |
|
||||
| qs 6.15.3 | [Array-limit bypass](https://github.com/advisories/GHSA-x5fp-wj9c-mxmx) | >=6.14.2 <=6.15.3 | 6.16.0 | Express 4.22.3 / qs 6.16.0 |
|
||||
| qs 6.15.3 | [Attacker-controlled isBuffer](https://github.com/advisories/GHSA-4mjr-xmp4-gh2g) | >=2.2.5 <6.16.0 | 6.16.0 | Scoped 6.16.0 |
|
||||
| postcss-selector-parser 6.1.4 | [Flat selector CPU exhaustion](https://github.com/advisories/GHSA-rj75-hqrm-r3gf) | <7.1.6 | 7.1.6 | Requires v6 -> v7 range override or parent migration; defer pending CSS-specific regression tests |
|
||||
| uuid 8.3.2 | [Missing output buffer checks](https://github.com/advisories/GHSA-w5hq-g745-h8pq) | <11.1.1 (installed line) | 11.1.1 | Cross-major candidate; sockjs only calls v4(), not the affected v3/v5/v6 APIs |
|
||||
| katex 0.16.47 | [Prototype pollution trust bypass](https://github.com/advisories/GHSA-238p-pmpm-9mq7) | >=0.11.0 <0.18.2 | 0.18.2 | 0.x minor-range migration; defer pending markdown math regression validation |
|
||||
|
||||
The KaTeX advisory range is from the fresh npm audit. Its GitHub advisory page could not be retrieved during this pass; registry 0.18.2 was downloaded and its rendering API smoke-tested. The fix boundary is inferred from the audit range rather than independently confirmed from that advisory page.
|
||||
|
||||
## Paths behind remaining package records
|
||||
|
||||
- braces: scripts -> fast-glob -> micromatch -> braces; also transitively affects copy-webpack-plugin, stylelint-family tooling, webpack-dev-server's chokidar and http-proxy-middleware paths. No patched braces release is available, despite some propagated `fixAvailable: true` flags in npm audit.
|
||||
- postcss-selector-parser: scripts -> cssnano 6.1.2 -> cssnano-preset-default 6.1.2 -> postcss-calc 9.0.1, postcss-merge-rules 6.1.1, postcss-minify-selectors 6.0.4, postcss-unique-selectors 6.0.4, or postcss-merge-longhand 6.0.5 -> stylehacks 6.1.1. Each currently resolves a nested parser 6.1.4. The hoisted parser 7.1.6 is already patched. v7's notable breaking behavior is safe insertion during iteration; avoid a blind global replacement. The advisory explicitly excludes ordinary build-time parsing of trusted source CSS from exposed request-path scenarios. [v7 release](https://github.com/postcss/postcss-selector-parser/releases/tag/v7.0.0)
|
||||
- sprintf-js: env -> js-yaml 3.15.2 -> argparse 1.0.10 -> sprintf-js 1.0.3. Updating sprintf-js to its latest 1.1.3 does not fix the advisory. Updating js-yaml globally breaks wp-env's safeLoad call.
|
||||
- uuid: scripts -> webpack-dev-server 5.2.6 -> sockjs 0.3.24 -> uuid 8.3.2. Source inspection finds `require('uuid').v4` and `uuidv4()` only. A scoped uuid11.1.1 override retains CommonJS and passed v4()/validate() smoke testing, but it remains outside sockjs's supported ^8 range. Do not choose uuid12+ blindly because of later module-format changes.
|
||||
- KaTeX: scripts -> markdownlint-cli 0.49.1 -> markdownlint 0.41.1 -> micromark-extension-math 3.1.0 -> katex 0.16.47. Minimum nonaffected release 0.18.2 exposes renderToString and passed a basic rendering smoke test, but is outside micromark's ^0.16 range.
|
||||
- qs (recommended fix): env -> @wp-playground/cli 3.1.57 -> express 4.22.2 -> qs 6.15.3; shared Express is also used by webpack-dev-server.
|
||||
- serialize-javascript (recommended fix): scripts -> copy-webpack-plugin 10.2.4 -> serialize-javascript 6.0.2.
|
||||
|
||||
## Engine consistency
|
||||
|
||||
The existing Playground/PHP-WASM 3.1.57 tree requires Node >=24.18.0 and npm >=11.16.0. `@wordpress/[email protected]` accepts Node `^22.22.2 || ^24.15.0 || >=26.0.0`, so the intersection is **`^24.18.0 || >=26.0.0`**, not plain >=24.18.0 (which would misleadingly include Node 25). Use npm >=11.16.0 and test the supported minimum in CI. The build and tests were rerun on Node 24.18.0 with npm 11.19.0. CI pins these versions. Node 26 is admitted by dependency engine declarations but has not been separately exercised here.
|
||||
|
||||
## Verification checklist
|
||||
|
||||
1. Regenerate the lockfile without force and inspect that only intended subtree changes occur.
|
||||
2. Run `npm ci`, build, JS tests, PHP tests where supported, and release packaging.
|
||||
3. Validate markdownlint YAML and TOML configuration loading after its minor-range overrides.
|
||||
4. Run final `npm audit --json` and `npm audit --omit=dev --json`; describe residuals honestly, including the critical simple-git findings.
|
||||
5. Track wp-env's simple-git v4 migration and braces/sprintf-js upstream releases. Do not suppress remaining advisories merely to make the report green.
|
||||
|
||||
## Final audit snapshot
|
||||
|
||||
After these changes, npm 11.19.0 reports **39 affected package records**
|
||||
(1 critical, 20 high, 14 moderate, 4 low), representing **8 distinct advisories**,
|
||||
versus 15 distinct advisories in the initial snapshot. Counts can change as the
|
||||
registry advisory database changes; do not equate affected parents with unique flaws.
|
||||
The remaining advisory packages are braces, KaTeX, postcss-selector-parser,
|
||||
simple-git (three advisories), sprintf-js and uuid. No advisory is suppressed.
|
||||
|
||||
`npm audit --omit=dev --json` reports zero findings for the root production lock.
|
||||
This does not certify arbitrary bundled code or establish a complete security audit.
|
||||
Do not run development servers or wp-env against untrusted configurations or
|
||||
source URLs, or expose development services publicly. A full simple-git fix
|
||||
needs a compatible wp-env migration; the parser override is not a complete fix.
|
||||
@@ -0,0 +1,62 @@
|
||||
# Prebuilt player dependency reachability review
|
||||
|
||||
Reviewed 2026-10-14 for `[email protected]`. This is a static review of
|
||||
specific published bytes, not an independent rebuild or a full security audit.
|
||||
|
||||
`scripts/vendor.mjs` copies the npm package's prebuilt browser bundle unchanged.
|
||||
The root lockfile therefore does not describe all components used to build it.
|
||||
The upstream dependency inventory is deliberately conservative: it includes
|
||||
Seroval 1.5.0 through Solid 1.9.6, including server-only dependency paths.
|
||||
|
||||
## Verified artifact
|
||||
|
||||
The official npm package integrity is recorded in package-lock.json.
|
||||
|
||||
- Minified bundle SHA-256: `a13c37632e1b5c49fe9128417b9319a9b5bc64cb457dd5ae52cbba8a3aceb880`
|
||||
- Readable bundle SHA-256: `4d63cfb88859f158d1eef5d8a5550861abcb7ec195fb5d684f35f6446a29fe11`
|
||||
|
||||
The minified hash also matches THIRD-PARTY-NOTICES.md and the installed package.
|
||||
|
||||
## Import and artifact evidence
|
||||
|
||||
1. [Player view.js](https://github.com/asciinema/asciinema-player/blob/v3.17.0/src/view.js)
|
||||
imports `render` from `solid-js/web`.
|
||||
2. Solid 1.9.6's package exports select `web/dist/web.js` for the browser/default
|
||||
import. Its only external import is `solid-js`; the client `dist/solid.js`
|
||||
has no imports. Neither imports Seroval.
|
||||
3. Seroval is imported by the separate `web/dist/server.js` SSR renderer,
|
||||
not the browser renderer.
|
||||
4. The [Rollup configuration](https://github.com/asciinema/asciinema-player/blob/v3.17.0/rollup.config.mjs)
|
||||
creates both readable and minified IIFEs from the same intermediate ESM bundle.
|
||||
The inspected readable IIFE contains the client renderer and does not contain
|
||||
Seroval deserialization implementations.
|
||||
5. Both bundles lack `Seroval`, `fromJSON`, `fromCrossJSON`, `deserialize`,
|
||||
`__SEROVAL_STREAM__`, and distinctive Seroval error/typed-array registry
|
||||
signatures. Name searches alone are not proof; they corroborate the import trace.
|
||||
6. Recording/live input paths use native `JSON.parse`/`response.json`, not
|
||||
Seroval decoding.
|
||||
|
||||
## Advisory-specific conclusion
|
||||
|
||||
No reachable affected Seroval decoder was found in these browser bundle bytes:
|
||||
|
||||
- [GHSA-mv8w-475r-vwqw](https://github.com/advisories/GHSA-mv8w-475r-vwqw):
|
||||
affected <=1.5.2, fixed 1.5.3; requires `fromJSON` Promise-control deserialization.
|
||||
- [GHSA-p6vx-979v-rg4c](https://github.com/advisories/GHSA-p6vx-979v-rg4c):
|
||||
affected >=0.12.0, <=1.6.0, fixed 1.6.2; requires `fromJSON` with plugin-produced
|
||||
callables and Promise assimilation.
|
||||
- [GHSA-jp82-f5mq-hwhp](https://github.com/advisories/GHSA-jp82-f5mq-hwhp):
|
||||
affected <=1.6.2, fixed 1.6.3; requires Seroval typed-array JSON deserialization.
|
||||
|
||||
Seroval 1.5.0 is inside these version ranges, but the necessary decoder is absent
|
||||
from this browser dependency path. Do not label the player vulnerable solely from
|
||||
that inventory, or claim the entire plugin safe from this limited review.
|
||||
Re-review after any player artifact or build-path change.
|
||||
|
||||
## Reproduction
|
||||
|
||||
Fetch official npm tarballs into separate directories using `npm pack --ignore-scripts`
|
||||
for `[email protected]`, `[email protected]`, and `[email protected]`.
|
||||
Verify both player hashes with `sha256sum`, inspect Solid's package exports and
|
||||
client/server imports, and compare the readable bundle implementation against
|
||||
those modules. Search both bundles for the decoder names/signatures above.
|
||||
Generated
+176
-58
@@ -12,14 +12,15 @@
|
||||
"asciinema-player": "3.17.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/parser": "7.29.9",
|
||||
"@babel/parser": "8.0.7",
|
||||
"@playwright/test": "1.64.0",
|
||||
"@wordpress/env": "11.17.0",
|
||||
"@wordpress/scripts": "36.1.0",
|
||||
"gettext-parser": "1.4.0"
|
||||
"gettext-parser": "9.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22.22.2"
|
||||
"node": "^24.18.0 || >=26.0.0",
|
||||
"npm": ">=11.16.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/code-frame": {
|
||||
@@ -78,6 +79,22 @@
|
||||
"url": "https://opencollective.com/babel"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/core/node_modules/@babel/parser": {
|
||||
"version": "7.29.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.9.tgz",
|
||||
"integrity": "sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.29.8"
|
||||
},
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/generator": {
|
||||
"version": "7.29.8",
|
||||
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.8.tgz",
|
||||
@@ -95,6 +112,22 @@
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/generator/node_modules/@babel/parser": {
|
||||
"version": "7.29.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.9.tgz",
|
||||
"integrity": "sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.29.8"
|
||||
},
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-annotate-as-pure": {
|
||||
"version": "7.29.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.29.7.tgz",
|
||||
@@ -371,19 +404,53 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/parser": {
|
||||
"version": "7.29.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.9.tgz",
|
||||
"integrity": "sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==",
|
||||
"version": "8.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-8.0.7.tgz",
|
||||
"integrity": "sha512-UkDwEbPO1px2JQSrdh4qIgaH1JgG7GO/pFeJkpxhDxIETkT/QvGpnigXIw75ViHYPtIgKITmVUJqLjiO+JuWjA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.29.8"
|
||||
"@babel/types": "^8.0.6"
|
||||
},
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
"node": "^22.18.0 || >=24.11.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/parser/node_modules/@babel/helper-string-parser": {
|
||||
"version": "8.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-8.0.6.tgz",
|
||||
"integrity": "sha512-+6HYEBnsDRZHJtUTAEfMQd0zMDqdFHS7C+5vAsEZqBUr3vEMWOWlHJ0Jz1gS8jJIlCvLsuA6ivmeoqzH936YcA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^22.18.0 || >=24.11.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/parser/node_modules/@babel/helper-validator-identifier": {
|
||||
"version": "8.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-8.0.6.tgz",
|
||||
"integrity": "sha512-HYx0YmuchRxRSpnjvcNffnPS8DCauKNmnumIuHG3jnQAVewRA7kfJGwF13ayEpSZs7s4R/oBH4eppuXcAQd5JQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^22.18.0 || >=24.11.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/parser/node_modules/@babel/types": {
|
||||
"version": "8.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-8.0.6.tgz",
|
||||
"integrity": "sha512-c+xgSWboV2pdwXP67BUWDVRHi2BO5Q3KwxyFVs7taVTY+fsK47/L51ZXQoV9rozHJDNHvJ4v4WEsI/IlxV2l2A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/helper-string-parser": "^8.0.6",
|
||||
"@babel/helper-validator-identifier": "^8.0.6"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^22.18.0 || >=24.11.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key": {
|
||||
@@ -1743,6 +1810,22 @@
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/template/node_modules/@babel/parser": {
|
||||
"version": "7.29.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.9.tgz",
|
||||
"integrity": "sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.29.8"
|
||||
},
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/traverse": {
|
||||
"version": "7.29.10",
|
||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.10.tgz",
|
||||
@@ -1762,6 +1845,22 @@
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/traverse/node_modules/@babel/parser": {
|
||||
"version": "7.29.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.9.tgz",
|
||||
"integrity": "sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.29.8"
|
||||
},
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/types": {
|
||||
"version": "7.29.8",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.8.tgz",
|
||||
@@ -5527,13 +5626,13 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@simple-git/argv-parser": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@simple-git/argv-parser/-/argv-parser-1.1.1.tgz",
|
||||
"integrity": "sha512-Q9lBcfQ+VQCpQqGJFHe5yooOS5hGdLFFbJ5R+R5aDsnkPCahtn1hSkMcORX65J2Z5lxSkD0lQorMsncuBQxYUw==",
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@simple-git/argv-parser/-/argv-parser-2.0.1.tgz",
|
||||
"integrity": "sha512-M++IaVWrN+vYalilOHfwvT2IL3wYZtVEBQpmX6DLSOJLtxbZ+SUeIDE3IiPogzhPACLajwtxfa5rp+ZX1FczzQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@simple-git/args-pathspec": "^1.0.3"
|
||||
"@simple-git/args-pathspec": "^1.0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@sindresorhus/base62": {
|
||||
@@ -7402,6 +7501,17 @@
|
||||
"node": ">=18.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@wordpress/i18n/node_modules/gettext-parser": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-1.4.0.tgz",
|
||||
"integrity": "sha512-sedZYLHlHeBop/gZ1jdg59hlUEcpcZJofLq2JFwJT1zTqAU3l2wFv6IsuwFHGqbiT9DWzMUW4/em2+hspnmMMA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"encoding": "^0.1.12",
|
||||
"safe-buffer": "^5.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@wordpress/is-shallow-equal": {
|
||||
"version": "5.57.0",
|
||||
"resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-5.57.0.tgz",
|
||||
@@ -7897,6 +8007,22 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@wordpress/theme/node_modules/@babel/parser": {
|
||||
"version": "7.29.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.9.tgz",
|
||||
"integrity": "sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.29.8"
|
||||
},
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@wordpress/undo-manager": {
|
||||
"version": "1.57.0",
|
||||
"resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-1.57.0.tgz",
|
||||
@@ -8909,23 +9035,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/body-parser/node_modules/qs": {
|
||||
"version": "6.16.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.16.0.tgz",
|
||||
"integrity": "sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"es-define-property": "^1.0.1",
|
||||
"side-channel": "^1.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/bonjour-service": {
|
||||
"version": "1.4.4",
|
||||
"resolved": "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.4.4.tgz",
|
||||
@@ -11852,6 +11961,22 @@
|
||||
"eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 || ^10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-react-hooks/node_modules/@babel/parser": {
|
||||
"version": "7.29.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.9.tgz",
|
||||
"integrity": "sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.29.8"
|
||||
},
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-react/node_modules/balanced-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
@@ -12842,14 +12967,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/gettext-parser": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-1.4.0.tgz",
|
||||
"integrity": "sha512-sedZYLHlHeBop/gZ1jdg59hlUEcpcZJofLq2JFwJT1zTqAU3l2wFv6IsuwFHGqbiT9DWzMUW4/em2+hspnmMMA==",
|
||||
"version": "9.1.1",
|
||||
"resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-9.1.1.tgz",
|
||||
"integrity": "sha512-ZLeqWPz9OMNrTgMuww0C22kkcNqis+e4059R94t7L7ERlZ2rUNpiDbaAUus+esBC6uBAQWbS9N+R5vJIJg//lw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"encoding": "^0.1.12",
|
||||
"safe-buffer": "^5.1.1"
|
||||
"content-type": "^1.0.5",
|
||||
"encoding": "^0.1.13"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
}
|
||||
},
|
||||
"node_modules/glob": {
|
||||
@@ -15442,9 +15570,9 @@
|
||||
"license": "Python-2.0"
|
||||
},
|
||||
"node_modules/markdownlint-cli/node_modules/js-yaml": {
|
||||
"version": "5.2.3",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.2.3.tgz",
|
||||
"integrity": "sha512-n+mUVyUX5bVv7G/G2zyIHOhdxfuU1dY2NOFzTQUWiMUbFss8b57NFlgCCaggU78wSw5KVS9cllzeLyzyR+n5nw==",
|
||||
"version": "5.4.3",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.4.3.tgz",
|
||||
"integrity": "sha512-yzzNtgczwgoVHNigCyKTXcQJU4Y8t/ikU4UxXW0BvrLfHTGWZhsNcOT2s/a7vn81/4KqVnNmHjaUEPlvWnNwVw==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -18719,9 +18847,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/qs": {
|
||||
"version": "6.15.3",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz",
|
||||
"integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==",
|
||||
"version": "6.16.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.16.0.tgz",
|
||||
"integrity": "sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
@@ -18769,16 +18897,6 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/randombytes": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
|
||||
"integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safe-buffer": "^5.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/range-parser": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
|
||||
@@ -19843,13 +19961,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/serialize-javascript": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz",
|
||||
"integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==",
|
||||
"version": "7.0.5",
|
||||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-7.0.5.tgz",
|
||||
"integrity": "sha512-F4LcB0UqUl1zErq+1nYEEzSHJnIwb3AF2XWB94b+afhrekOUijwooAYqFyRbjYkm2PAKBabx6oYv/xDxNi8IBw==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"randombytes": "^2.1.0"
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/seroval": {
|
||||
@@ -20293,9 +20411,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/smol-toml": {
|
||||
"version": "1.7.2",
|
||||
"resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.7.2.tgz",
|
||||
"integrity": "sha512-pXFZ9B2WinEPzxWkMmlYE/oYx2BP+qLrE95wP8tCuK901uLSMGdCb6QSr82z+wnhXkG4+cO+OMLbZB2Cn+97zw==",
|
||||
"version": "1.9.1",
|
||||
"resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.9.1.tgz",
|
||||
"integrity": "sha512-j7WyPdf0CJoutMzMoPLF/bVXHtKZIT9Rb4eGeEbWw8X2t5oirjPgpL+OpaENZrILYaXqYwnVH+qgUwVbl+pUJQ==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"engines": {
|
||||
|
||||
+19
-3
@@ -6,7 +6,8 @@
|
||||
"type": "module",
|
||||
"license": "GPL-3.0-only",
|
||||
"engines": {
|
||||
"node": ">=22.22.2"
|
||||
"node": "^24.18.0 || >=26.0.0",
|
||||
"npm": ">=11.16.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "wp-scripts build --config webpack.config.cjs && node scripts/vendor.mjs && npm run i18n && node scripts/verify-build.mjs",
|
||||
@@ -26,8 +27,8 @@
|
||||
"@playwright/test": "1.64.0",
|
||||
"@wordpress/env": "11.17.0",
|
||||
"@wordpress/scripts": "36.1.0",
|
||||
"@babel/parser": "7.29.9",
|
||||
"gettext-parser": "1.4.0"
|
||||
"@babel/parser": "8.0.7",
|
||||
"gettext-parser": "9.1.1"
|
||||
},
|
||||
"cssnano": {
|
||||
"preset": [
|
||||
@@ -38,5 +39,20 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"overrides": {
|
||||
"copy-webpack-plugin": {
|
||||
"serialize-javascript": "7.0.5"
|
||||
},
|
||||
"markdownlint-cli": {
|
||||
"js-yaml": "5.4.3",
|
||||
"smol-toml": "1.9.1"
|
||||
},
|
||||
"express": {
|
||||
"qs": "6.16.0"
|
||||
},
|
||||
"simple-git": {
|
||||
"@simple-git/argv-parser": "2.0.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-34
@@ -56,37 +56,3 @@ Existing shortcodes work in the Classic Editor. The new visual controls and inli
|
||||
= Which languages are included? =
|
||||
|
||||
English (en_US fallback) and Simplified Chinese (zh_CN) are bundled and work offline. Plugin-owned editor controls follow the WordPress user language; public pages follow the site language. Set these in Users > Profile and Settings > General. Other Chinese locales, including zh_TW, are not mapped to zh_CN. Recording output and author captions are never translated. The upstream player's own controls and help remain English.
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 1.1.0-dev (unreleased) =
|
||||
* Development preview only, not a tagged or published release. Earlier draft package labels 1.1.0 and 1.2.0–1.2.3 were internal iteration labels, not releases.
|
||||
* Bundle English/Simplified Chinese plugin UI translations using WordPress gettext, with reproducible PO/MO/JSON catalogs and real locale integration tests.
|
||||
* Use asset content hashes to prevent stale resources between development builds.
|
||||
* Move recording/privacy and playback explanations from the block canvas to a collapsed sidebar Help panel.
|
||||
|
||||
* Show original cast dimensions as toolbar/sidebar placeholders without forcing overrides.
|
||||
* Refresh recording metadata when the URL changes, reusing the preview request.
|
||||
* Select and upload validated .cast recordings through the native Media Library.
|
||||
|
||||
* Automatically load saved recording previews without enabling playback autoplay.
|
||||
* Debounce recording URL edits; retain immediate apply, retry and request cleanup.
|
||||
* Add terminal Columns/Rows and reset controls to the floating block toolbar, synchronized with the collapsed sidebar panel.
|
||||
|
||||
* Add responsive display-width presets/custom lengths, left/center/right placement and captions.
|
||||
* Preserve recorded terminal dimensions and resize events by default; expose optional row/column overrides.
|
||||
* Isolate terminal typography and frames from common host-theme code-block styles.
|
||||
* Add a local static block-inserter preview without recording requests.
|
||||
|
||||
* Add a native block with typed controls and interactive, iframe-aware preview.
|
||||
* Preserve shortcode support and normalize historical parameter names and types.
|
||||
* Escape output, constrain recording URLs, and filter custom styles.
|
||||
* Bundle player 3.17.0 locally and add reproducible build/install ZIP tooling.
|
||||
* Improve asset loading for posts, pages and render-time shortcode use.
|
||||
* Add unit and real WordPress browser integration tests.
|
||||
|
||||
= 1.0.0 =
|
||||
* Set the version attribute for resource files and add documentation.
|
||||
|
||||
= 0.1.0 =
|
||||
* First available version; asciinema-player 3.4.0.
|
||||
|
||||
+3
-3
@@ -51,7 +51,7 @@ const metadata = JSON.parse(fs.readFileSync('block.json'));
|
||||
for (const [field, context] of [['title', 'block title'], ['description', 'block description'], ['keywords', 'block keyword']]) {
|
||||
for (const value of [].concat(metadata[field])) add(value, context, 'block.json', 1);
|
||||
}
|
||||
const headers = { 'project-id-version': `${domain} ${version}`, 'mime-version': '1.0', 'content-type': 'text/plain; charset=UTF-8', 'content-transfer-encoding': '8bit', 'x-domain': domain };
|
||||
const headers = { 'Project-Id-Version': `${domain} ${version}`, 'MIME-Version': '1.0', 'Content-Type': 'text/plain; charset=UTF-8', 'Content-Transfer-Encoding': '8bit', 'X-Domain': domain };
|
||||
const pot = { charset: 'utf-8', headers, translations: { '': {} } };
|
||||
for (const entry of [...entries.values()].sort((a, b) => `${a.msgctxt || ''}\u0004${a.msgid}`.localeCompare(`${b.msgctxt || ''}\u0004${b.msgid}`, 'en'))) {
|
||||
const context = entry.msgctxt || '';
|
||||
@@ -61,8 +61,8 @@ fs.mkdirSync('languages', { recursive: true });
|
||||
const output = new Map([['languages/wp-asciiplayer.pot', gettext.po.compile(pot)]]);
|
||||
if (!process.argv.includes('--pot-only')) {
|
||||
const po = gettext.po.parse(fs.readFileSync('languages/wp-asciiplayer-zh_CN.po'));
|
||||
assert.equal(po.headers.language, 'zh_CN');
|
||||
assert.match(po.headers['plural-forms'], /^nplurals=1;\s*plural=0;$/);
|
||||
assert.equal(po.headers.Language, 'zh_CN');
|
||||
assert.match(po.headers['Plural-Forms'], /^nplurals=1;\s*plural=0;$/);
|
||||
const messages = { '': { domain, lang: 'zh_CN', 'plural-forms': 'nplurals=1; plural=0;' } };
|
||||
for (const entry of entries.values()) {
|
||||
const translation = po.translations[entry.msgctxt || '']?.[entry.msgid];
|
||||
|
||||
@@ -27,8 +27,12 @@ test('all extracted strings and gettext contexts round-trip through MO and both
|
||||
});
|
||||
|
||||
test('catalogs use Chinese plural rules, exact locale, and standard WordPress textdomain', () => {
|
||||
assert.equal(po.headers.language, 'zh_CN');
|
||||
assert.equal(mo.headers.language, 'zh_CN');
|
||||
assert.equal(po.headers.Language, 'zh_CN');
|
||||
assert.equal(mo.headers.Language, 'zh_CN');
|
||||
assert.equal(po.headers['Plural-Forms'], 'nplurals=1; plural=0;');
|
||||
assert.equal(mo.headers['Plural-Forms'], 'nplurals=1; plural=0;');
|
||||
assert.equal(pot.headers['Project-Id-Version'], `wp-asciiplayer ${JSON.parse(fs.readFileSync('package.json')).version}`);
|
||||
assert.equal(pot.headers['Content-Type'], 'text/plain; charset=utf-8');
|
||||
assert.equal(editor[''].lang, 'zh_CN');
|
||||
assert.equal(editor[''].domain, 'wp-asciiplayer');
|
||||
assert.equal(editor['']['plural-forms'], 'nplurals=1; plural=0;');
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { createRequire } from 'node:module';
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
const SimpleGit = require('simple-git');
|
||||
const requireFromGit = createRequire(require.resolve('simple-git'));
|
||||
const { vulnerabilityCheck } = requireFromGit('@simple-git/argv-parser');
|
||||
|
||||
test('wp-env CommonJS simple-git API remains callable with the scoped parser update', async () => {
|
||||
assert.equal(typeof SimpleGit, 'function');
|
||||
const git = SimpleGit({ baseDir: process.cwd() });
|
||||
assert.equal(await git.checkIsRepo(), true);
|
||||
assert.equal((await git.raw(['rev-parse', '--is-inside-work-tree'])).trim(), 'true');
|
||||
});
|
||||
|
||||
test('git argument parser rejects unsafe editor and configuration inputs without executing them', () => {
|
||||
assert.deepEqual(vulnerabilityCheck(['status'], {}), []);
|
||||
for (const [args, env, category] of [
|
||||
[['commit'], { VISUAL: 'untrusted-editor' }, 'allowUnsafeEditor'],
|
||||
[['-c', 'trailer.test.cmd=untrusted-command', 'log'], {}, 'allowUnsafeCommandBinaries'],
|
||||
[['-c', 'include.path=/untrusted/config', 'status'], {}, 'allowUnsafeInclude'],
|
||||
]) {
|
||||
assert.ok(vulnerabilityCheck(args, env).some((finding) => finding.category === category));
|
||||
}
|
||||
});
|
||||
|
||||
test('git argument parser accepts wp-env download command shapes', () => {
|
||||
// Validate parser inputs only; these commands are never executed by this test.
|
||||
for (const args of [
|
||||
['clone', 'https://github.com/WordPress/wordpress-develop.git', '/tmp/wp-example', '--depth', '1', '--filter', 'blob:none', '--no-checkout'],
|
||||
['fetch', 'origin', 'trunk', '--depth', '1'],
|
||||
['checkout', 'trunk'],
|
||||
['reset', '--hard', 'FETCH_HEAD'],
|
||||
['sparse-checkout', 'set', '--cone', 'tests/phpunit'],
|
||||
]) assert.deepEqual(vulnerabilityCheck(args, {}), []);
|
||||
});
|
||||
Reference in New Issue
Block a user