mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 19:06:15 -08:00
refactor(core): [CORE-20] type entry and converge initialization
This commit is contained in:
1 parent
ccf77c4ed2
commit
ee895a558f
100 files changed
+33854
-839
No files matched your search
@@ -87,7 +87,7 @@ export async function checkPackages({ release = false } = {}) {
|
||||
const baseline = await publishedConsumer()
|
||||
const installed = consumerDirectory()
|
||||
try {
|
||||
const oldRuntime = runtimeConsumer(baseline.dir)
|
||||
const oldRuntime = runtimeConsumer(baseline.dir, { baseline: true })
|
||||
const packages = []
|
||||
for (const name of names) {
|
||||
const archive = path.join(output, `${name}.tgz`)
|
||||
|
||||
@@ -26,10 +26,10 @@ export function removeConsumer(dir) {
|
||||
fs.rmSync(dir, { recursive: true, force: true })
|
||||
}
|
||||
|
||||
export function runtimeConsumer(dir) {
|
||||
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 })
|
||||
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))
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user