feat(aklive2d): add ability to read and increase version number
This commit is contained in:
@@ -11,3 +11,4 @@ color: rgba(14, 126, 239, 0.85)
|
||||
codename:
|
||||
zh-CN: 假日威龙陈
|
||||
en-US: Ch'en/Chen the Holungday
|
||||
portrait: null
|
||||
@@ -11,3 +11,4 @@ color: rgb(255, 133, 34)
|
||||
codename:
|
||||
zh-CN: 重岳
|
||||
en-US: Chongyue
|
||||
portrait: null
|
||||
@@ -11,3 +11,4 @@ color: rgb(9, 212, 208)
|
||||
codename:
|
||||
zh-CN: 夕
|
||||
en-US: Dusk
|
||||
portrait: null
|
||||
@@ -11,3 +11,4 @@ color: rgb(29, 185, 53)
|
||||
codename:
|
||||
zh-CN: 百练嘉维尔
|
||||
en-US: Gavial the Invincible
|
||||
portrait: null
|
||||
@@ -11,3 +11,4 @@ color: rgb(15, 206, 216)
|
||||
codename:
|
||||
zh-CN: 令
|
||||
en-US: Ling
|
||||
portrait: null
|
||||
@@ -11,3 +11,4 @@ color: rgb(156, 210, 246)
|
||||
codename:
|
||||
zh-CN: 夏日餮宴 · 水月
|
||||
en-US: Summer Feast / Mizuki
|
||||
portrait: null
|
||||
@@ -11,3 +11,4 @@ color: rgba(253, 236, 189, 0.95)
|
||||
codename:
|
||||
zh-CN: 耀骑士临光
|
||||
en-US: Nearl the Radiant Knight
|
||||
portrait: null
|
||||
@@ -11,3 +11,4 @@ color: rgb(255, 48, 0)
|
||||
codename:
|
||||
zh-CN: 年
|
||||
en-US: Nian
|
||||
portrait: null
|
||||
@@ -11,3 +11,4 @@ color: rgb(158, 2, 2)
|
||||
codename:
|
||||
zh-CN: 焦点 · 傀影
|
||||
en-US: Focus / Phatom
|
||||
portrait: null
|
||||
@@ -11,3 +11,4 @@ color: rgb(23, 210, 236)
|
||||
codename:
|
||||
zh-CN: 迷迭香
|
||||
en-US: Rosmontis
|
||||
portrait: null
|
||||
@@ -11,3 +11,4 @@ color: rgb(226, 96, 96)
|
||||
codename:
|
||||
zh-CN: 浊心斯卡蒂
|
||||
en-US: Skadi the Corrupting Heart
|
||||
portrait: null
|
||||
@@ -11,3 +11,4 @@ color: rgba(14, 124, 203, 0.86)
|
||||
codename:
|
||||
zh-CN: 归溟幽灵鲨
|
||||
en-US: Specter the Unchained
|
||||
portrait: null
|
||||
@@ -11,3 +11,4 @@ color: rgba(34, 37, 255, 0.9)
|
||||
codename:
|
||||
zh-CN: 缄默德克萨斯
|
||||
en-US: Texas the Omertosa
|
||||
portrait: null
|
||||
@@ -11,3 +11,4 @@ color: rgb(228, 54, 56)
|
||||
codename:
|
||||
zh-CN: W
|
||||
en-US: W
|
||||
portrait: null
|
||||
@@ -1,5 +1,6 @@
|
||||
import path from 'path'
|
||||
import { read } from './yaml.js'
|
||||
import { read as readVersion } from './version.js'
|
||||
|
||||
export default function () {
|
||||
return process(read(path.join(__projetRoot, 'config.yaml')))
|
||||
@@ -16,5 +17,11 @@ function process(config) {
|
||||
operator.link = operatorName
|
||||
}
|
||||
|
||||
// version
|
||||
config.version = {
|
||||
showcase: readVersion(path.join(__projetRoot)),
|
||||
directory: readVersion(path.join(__projetRoot, 'directory')),
|
||||
}
|
||||
|
||||
return config
|
||||
}
|
||||
@@ -49,7 +49,7 @@ class Evalable {
|
||||
}
|
||||
|
||||
version(prefix, suffix) {
|
||||
return `${prefix}${__config.version}${suffix}`
|
||||
return `${prefix}${__config.version.showcase}${suffix}`
|
||||
}
|
||||
|
||||
#step(location, varName) {
|
||||
|
||||
@@ -10,11 +10,20 @@ export default function () {
|
||||
const targetFolder = path.join(__projetRoot, __config.folder.release, __config.folder.directory);
|
||||
const sourceFolder = path.join(__projetRoot, __config.folder.operator);
|
||||
rmdir(targetFolder);
|
||||
const filesToCopy = [];
|
||||
const directoryJson = []
|
||||
for (const [key, value] of Object.entries(__config.operators)) {
|
||||
filesToCopy.push(key);
|
||||
directoryJson.push(value);
|
||||
const filesToCopy = Object.keys(__config.operators)
|
||||
const directoryJson = {
|
||||
operators: Object.values(
|
||||
Object.values(__config.operators)
|
||||
.reduce((acc, cur) => {
|
||||
const date = cur.date
|
||||
if (acc[date]) {
|
||||
acc[date].push(cur)
|
||||
} else {
|
||||
acc[date] = [cur]
|
||||
}
|
||||
return acc
|
||||
}, {}))
|
||||
.sort((a, b) => Date.parse(b[0].date) - Date.parse(a[0].date)),
|
||||
}
|
||||
writeSync(JSON.stringify(directoryJson, null), path.join(targetFolder, "directory.json"))
|
||||
filesToCopy.forEach((key) => {
|
||||
|
||||
13
libs/version.js
Normal file
13
libs/version.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import path from 'path'
|
||||
import { readSync, writeSync } from './file.js'
|
||||
|
||||
export function read (dir) {
|
||||
return readSync(path.join(dir, 'Version'))
|
||||
}
|
||||
|
||||
export function increase(dir) {
|
||||
// release version will be lagged by 0.0.1
|
||||
const version = read(dir)
|
||||
const [major, minor, patch] = version.split('.')
|
||||
writeSync(`${major}.${minor}.${+patch + 1}`, path.join(dir, 'Version'))
|
||||
}
|
||||
@@ -364,7 +364,7 @@ export default class Voice {
|
||||
#insertHTML() {
|
||||
this.#el.innerHTML = `
|
||||
<audio id="${this.#audioElId}" autoplay>
|
||||
<source type="audio/wav">
|
||||
<source type="audio/ogg" />
|
||||
</audio>
|
||||
<div class="voice-wrapper" id="voice_wrapper">
|
||||
<div class="voice-title" id="voice_title"></div>
|
||||
|
||||
Reference in New Issue
Block a user