chore(media): add build scripts

This commit is contained in:
Il Harper 2024-09-07 14:05:45 +08:00
parent 3f2c972001
commit c56844a5b4
No known key found for this signature in database
GPG Key ID: 4B71FCA698E7E8EC
4 changed files with 79 additions and 72 deletions

View File

@ -14,7 +14,7 @@
],
"scripts": {
"clean": "node -r esbuild-register scripts/clean.cts",
"build": "concurrently -n red \"yarn workspace @chronocat/red build\" && concurrently -n shell \"yarn workspace @chronocat/shell build\" && concurrently -n api,event \"yarn workspace @chronocat/engine-chronocat-api build\" \"yarn workspace @chronocat/engine-chronocat-event build\" && concurrently -n llqqnt,iife \"yarn workspace @chronocat/plugin-llqqnt build\" \"yarn workspace @chronocat/plugin-iife build\" && concurrently -n packengine,packllqqntengine yarn:packengine yarn:packllqqntengine",
"build": "concurrently -n red \"yarn workspace @chronocat/red build\" && concurrently -n shell \"yarn workspace @chronocat/shell build\" && concurrently -n api,event,media \"yarn workspace @chronocat/engine-chronocat-api build\" \"yarn workspace @chronocat/engine-chronocat-event build\" \"yarn workspace @chronocat/engine-media build\" && concurrently -n llqqnt,iife \"yarn workspace @chronocat/plugin-llqqnt build\" \"yarn workspace @chronocat/plugin-iife build\" && concurrently -n packengine,packllqqntengine yarn:packengine yarn:packllqqntengine",
"packengine": "node -r esbuild-register scripts/packengine.cts",
"packllqqntengine": "node -r esbuild-register scripts/packllqqntengine.cts",
"lint": "eslint --ignore-path .gitignore --ignore-pattern '**/*.d.ts' .",

View File

@ -17,6 +17,9 @@ void Promise.all(
'../packages/engine-chronocat-event/src/.runOnChanged.hashes.json',
'../packages/engine-chronocat-event/lib',
'../packages/engine-chronocat-event/tsconfig.tsbuildinfo',
'../packages/engine-media/src/.runOnChanged.hashes.json',
'../packages/engine-media/lib',
'../packages/engine-media/tsconfig.tsbuildinfo',
'../packages/iife/lib',
'../packages/llqqnt/lib',
'../packages/docs/static/config-v0.schema.json',

View File

@ -2,7 +2,8 @@ import { cp, mkdir } from 'node:fs/promises'
import { join, resolve } from 'node:path'
void Promise.all(
['engine-chronocat-api', 'engine-chronocat-event'].map(async (x) => {
['engine-chronocat-api', 'engine-chronocat-event', 'engine-media'].map(
async (x) => {
const srcPath = resolve(__dirname, `../packages/${x}/lib/index.js`)
const distDir = resolve(__dirname, `../build/dist/${x}`)
@ -24,5 +25,6 @@ void Promise.all(
// `../build/dist/llqqnt/LiteLoaderQQNT-Plugin-Chronocat/src/${filename}`,
// ),
// )
}),
},
),
)

View File

@ -2,7 +2,8 @@ import { cp, mkdir, writeFile } from 'node:fs/promises'
import { join, resolve } from 'node:path'
void Promise.all(
['engine-chronocat-api', 'engine-chronocat-event'].map(async (x) => {
['engine-chronocat-api', 'engine-chronocat-event', 'engine-media'].map(
async (x) => {
const upper = `${x[0]!.toUpperCase()}${x.slice(1, 7)}${x[7]!.toUpperCase()}${x.slice(8, 17)}${x[17]!.toUpperCase()}${x.slice(18)}`
const distName = `LiteLoaderQQNT-Plugin-Chronocat-${upper}`
@ -65,5 +66,6 @@ void Promise.all(
resolve(__dirname, '../packages/docs/static/chronocat.png'),
join(distPath, 'chronocat.png'),
)
}),
},
),
)