Refresh wp-asciiplayer with native block editor playback (#36)
Build and WordPress integration / PHP 7.4 syntax and regression tests (push) Canceled after 0s
Build and WordPress integration / PHP 8.3 syntax and regression tests (push) Canceled after 0s
Build and WordPress integration / WordPress 6.3 / PHP 7.4 (push) Canceled after 0s
Build and WordPress integration / WordPress latest / PHP 8.2 (push) Canceled after 0s

* Refresh player with native block editor preview and local assets

Preserve shortcode rendering, normalize options, bundle the player locally,
and add reproducible packaging and WordPress integration tests.

* Fix emitted frontend boot and verify bundled runtime initialization

* Record verified WordPress 7.1.3 compatibility

* Use WordPress readme major-version compatibility format

* Add responsive player layout, captions and native terminal sizing

* Keep editor caption geometry stable during block selection

* Respect WordPress editor gutters with border-box sizing

* Improve automatic previews and toolbar terminal sizing (1.2.1)

* Show native cast dimensions and add Media Library recordings (1.2.2)

* Fix Media Library test storage and scope sidebar selectors

* Document bounded temporary-upload stream exceptions

* Move block explanations into collapsed sidebar help (1.2.3)

* Add bundled English and Simplified Chinese UI translations (1.1.0-dev)

* Use native RichText labels and supported Chinese HTML language tags in locale tests
This commit is contained in:
2026-10-14 15:56:05 +08:00
committed by GitHub
parent 40e2bf0733
commit 85e5ffa0ec
109 changed files with 32680 additions and 2090 deletions
+39
View File
@@ -0,0 +1,39 @@
import { cp, mkdir, mkdtemp, readdir, readFile, rm, stat, utimes } from 'node:fs/promises';
import { execFileSync } from 'node:child_process';
import path from 'node:path';
import os from 'node:os';
const root = path.resolve(import.meta.dirname, '..');
execFileSync(process.execPath, ['scripts/i18n.mjs', '--check'], { cwd: root, stdio: 'inherit' });
const required = ['build/block.json', 'build/index.js', 'build/index.asset.php', 'build/view.js', 'build/view.asset.php', 'build/player.js', 'build/player.css', 'build/runtime.asset.php', 'languages/wp-asciiplayer-zh_CN.mo', 'languages/wp-asciiplayer-zh_CN-lamgc-asciiplayer-editor.json', 'languages/wp-asciiplayer-zh_CN-lamgc-asciiplayer-view.json'];
for (const file of required) await stat(path.join(root, file));
const pkg = JSON.parse(await readFile(path.join(root, 'package.json'), 'utf8'));
const php = await readFile(path.join(root, 'asciicast-player.php'), 'utf8');
const readme = await readFile(path.join(root, 'readme.txt'), 'utf8');
if (!php.includes(`Version: ${pkg.version}`) || !readme.includes(`Stable tag: ${pkg.version}`)) throw new Error('Version headers disagree.');
const temp = await mkdtemp(path.join(os.tmpdir(), 'wp-asciiplayer-package-'));
const target = path.join(temp, 'wp-asciiplayer');
const inputs = ['asciicast-player.php', 'includes', 'build', 'languages', 'LICENSE', 'licenses', 'THIRD-PARTY-NOTICES.md', 'README.md', 'README-zh.md', 'readme.txt', 'SOURCE.md', 'src', 'block.json', 'package.json', 'package-lock.json', 'webpack.config.cjs', 'babel.config.json', 'scripts'];
try {
await mkdir(target);
for (const file of inputs) await cp(path.join(root, file), path.join(target, file), { recursive: true });
const files = [];
async function walk(dir) {
for (const entry of (await readdir(dir, { withFileTypes: true })).sort((a,b) => a.name.localeCompare(b.name, 'en'))) {
const full = path.join(dir, entry.name);
if (entry.isDirectory()) await walk(full);
else if (entry.isFile()) {
await utimes(full, new Date('2026-01-01T00:00:00Z'), new Date('2026-01-01T00:00:00Z'));
files.push(path.relative(temp, full));
} else throw new Error(`Unexpected non-regular archive entry: ${full}`);
}
}
await walk(target);
await mkdir(path.join(root, 'dist'), { recursive: true });
const zip = path.join(root, 'dist/wp-asciiplayer.zip');
await rm(zip, { force: true });
execFileSync('zip', ['-X', '-q', zip, ...files], { cwd: temp, env: { ...process.env, TZ: 'UTC' } });
console.log(`Created ${zip} (${files.length} files), version ${pkg.version}.`);
} finally {
await rm(temp, { recursive: true, force: true });
}