更新打包逻辑
This commit is contained in:
parent
860d5df52a
commit
0d13fefed5
@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.readVcdFile = async () => {
|
window.readVcdFile = async () => {
|
||||||
let inputVcdFile = 'Tb_Sync_FIFO.vcd';
|
let inputVcdFile = 'test.vcd';
|
||||||
let inputViewFile = 'Tb_Sync_FIFO.view';
|
let inputViewFile = 'test.view';
|
||||||
const response = await fetch(inputVcdFile);
|
const response = await fetch(inputVcdFile);
|
||||||
const arrayBuffer = await response.arrayBuffer();
|
const arrayBuffer = await response.arrayBuffer();
|
||||||
return [arrayBuffer, inputVcdFile, inputViewFile];
|
return [arrayBuffer, inputVcdFile, inputViewFile];
|
||||||
|
BIN
public/test.view
BIN
public/test.view
Binary file not shown.
File diff suppressed because one or more lines are too long
BIN
public/vcd.wasm
BIN
public/vcd.wasm
Binary file not shown.
@ -1,27 +0,0 @@
|
|||||||
import requests as r
|
|
||||||
import os
|
|
||||||
import shutil
|
|
||||||
import zipfile
|
|
||||||
|
|
||||||
res = r.get('https://kirigaya.cn/files/links/tmp.zip')
|
|
||||||
|
|
||||||
# 解压文件
|
|
||||||
with zipfile.ZipFile('./scripts/tmp.zip', 'r') as zipf:
|
|
||||||
zipf.extractall('./scripts/tmp')
|
|
||||||
|
|
||||||
# 将文件搬运至工作区,我的 css 全放在 public 下面了,你的视情况而定
|
|
||||||
for parent, _, files in os.walk('./scripts/tmp'):
|
|
||||||
for file in files:
|
|
||||||
filepath = os.path.join(parent, file)
|
|
||||||
if file.startswith('demo'):
|
|
||||||
continue
|
|
||||||
if file.endswith('.css'):
|
|
||||||
content = open(filepath, 'r', encoding='utf-8').read().replace('font-size: 16px;', '')
|
|
||||||
open(filepath, 'w', encoding='utf-8').write(content)
|
|
||||||
shutil.move(filepath, os.path.join('./public', file))
|
|
||||||
elif file.endswith('.woff2'):
|
|
||||||
shutil.move(filepath, os.path.join('./public', file))
|
|
||||||
|
|
||||||
# 删除压缩包和解压区域
|
|
||||||
os.remove('./scripts/tmp.zip')
|
|
||||||
shutil.rmtree('./scripts/tmp')
|
|
@ -1,14 +1,19 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
|
exclude_files = [
|
||||||
|
'onedark.css',
|
||||||
|
'onelight.css',
|
||||||
|
'default-dark.css',
|
||||||
|
'default-light.css'
|
||||||
|
]
|
||||||
|
|
||||||
os.system('npm run build')
|
os.system('npm run build')
|
||||||
for file in os.listdir('dist'):
|
for file in os.listdir('dist'):
|
||||||
if file.endswith('.vcd') or file.endswith('.view'):
|
if file.endswith('.vcd') or file.endswith('.view') or file in exclude_files:
|
||||||
os.remove('dist/' + file)
|
os.remove('dist/' + file)
|
||||||
|
|
||||||
with open('./dist/index.html', 'r', encoding='utf-8') as fp:
|
with open('./dist/index.html', 'r', encoding='utf-8') as fp:
|
||||||
html = fp.read()
|
html = fp.read()
|
||||||
|
|
||||||
html = html.replace("''", "'<root>'")
|
|
||||||
|
|
||||||
with open('./dist/index.html', 'w', encoding='utf-8') as fp:
|
with open('./dist/index.html', 'w', encoding='utf-8') as fp:
|
||||||
fp.write(html)
|
fp.write(html)
|
@ -88,6 +88,9 @@ onMounted(async () => {
|
|||||||
const vcdInfo = workerVars.vcdInfo;
|
const vcdInfo = workerVars.vcdInfo;
|
||||||
const signalValues = workerVars.signalValues;
|
const signalValues = workerVars.signalValues;
|
||||||
|
|
||||||
|
// console.log(vcdInfo);
|
||||||
|
// console.log(signalValues);
|
||||||
|
|
||||||
for (const topModule of vcdInfo.wires.body) {
|
for (const topModule of vcdInfo.wires.body) {
|
||||||
VcdInfo.topModules.push(topModule);
|
VcdInfo.topModules.push(topModule);
|
||||||
}
|
}
|
||||||
@ -110,7 +113,6 @@ onMounted(async () => {
|
|||||||
emitter.emit('meta-ready', null);
|
emitter.emit('meta-ready', null);
|
||||||
|
|
||||||
// 这一步时,已经加载完成
|
// 这一步时,已经加载完成
|
||||||
|
|
||||||
// 初始化右侧的模型 treeview 面板
|
// 初始化右侧的模型 treeview 面板
|
||||||
// 默认第一个模块被选中
|
// 默认第一个模块被选中
|
||||||
if (VcdInfo.topModules.length > 0) {
|
if (VcdInfo.topModules.length > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user