ci: [CI-01] verify identical tarballs on three Node runtimes

This commit is contained in:
Harvey Zhao committed 2026-09-13 13:21:17 +08:00
1 parent 585e11c53c
commit 38355ae4cf
21 files changed
+839 -27

No files matched your search

+2 -7
View File
@@ -9,6 +9,8 @@ import ts from 'typescript'
import compat from 'typescript-compat'
import runtimeCompat from 'typescript-runtime-compat'
export { runtimeConsumer } from './package-runtime.mjs'
export const workspace = fileURLToPath(new URL('../', import.meta.url))
export const names = ['artplayer', 'artplayer-plugin-chapter']
export const readJson = file => JSON.parse(fs.readFileSync(file, 'utf8'))
@@ -27,13 +29,6 @@ export function removeConsumer(dir) {
fs.rmSync(dir, { recursive: true, force: true })
}
export function runtimeConsumer(dir, { baseline = false } = {}) {
fs.copyFileSync(path.join(workspace, 'test/package/runtime.cjs'), path.join(dir, 'runtime.cjs'))
fs.copyFileSync(path.join(workspace, 'test/contracts/emitter.js'), path.join(dir, 'emitter.mjs'))
writeJson(path.join(dir, 'expected.json'), { version: readJson(path.join(dir, 'node_modules/artplayer/package.json')).version, baseline })
return JSON.parse(run(['runtime.cjs'], dir))
}
export function typeConsumers(dir, { precise = false } = {}) {
const results = []
const matrix = precise