//dev 前端调试端口 import crypt.bin; import wsock.tcp.client; import fsys; namespace chrome; class dev{ ctor( theApp,url,devPort,timeout ){ theApp.httpHandler["/aardio.dev" ] = function(response,request){ response.contentType = "text/html"; response.write(..string.replace(self.html,"@${DEV_PORT}",tostring(devPort)),) } if(!theApp.external){ theApp.external = {}; } theApp.external.____devSrc_aardio____ = function(){ import nodeJs; import process.code; nodeJs.install(); process.code.install(); ..fsys.enum( "/", "*.*", function(dir,filename,fullpath,findData){ if(!filename) { if(..io.exist(..io.joinpath(fullpath,"package.json")) ){ var editPath = ..io.exist("~\extensions\trigger\edit.aardio") || ..io.exist("~\extensions\trigger\edit-default.aardio"); loadcodex(editPath,fullpath); return false; } } } ,false ); } theApp.external.____devSrc_aardio2____ = function(){ import nodeJs; import process.code; nodeJs.install(); process.code.install(); ..fsys.enum( "/", "*.*", function(dir,filename,fullpath,findData){ if(!filename) { if(..io.exist(..io.joinpath(fullpath,"package.json")) ){ import process.code; if(process.code.install()){ process.code(fullpath); } return false; } } } ,false ); } timeout = timeout : 0.5; var tcp = ..wsock.tcp.client(); if( tcp.connectTimeout("127.0.0.1",devPort,timeout) ){ theApp.start("http://127.0.0.1:"+devPort) tcp.close(); }; else { theApp.start("/aardio.dev") var form = ..win.form().messageOnly() form.setInterval( function(){ if( tcp.connectTimeout("127.0.0.1",devPort,timeout) ){ theApp.publish("devServer.started","http://127.0.0.1:"+devPort); tcp.close(); form.close(); return false; }; },1000 ) } }; } dev.html = `

正在等待 http://127.0.0.1:${DEV_PORT} 启动……

点这里用 VS Code 打开前端工程源码,
也可右键点工程「网页源码」目录, 在弹出菜单中点击「用外部编辑器打开」。
然后按 Ctrl + `` 打开 VSCode 终端

调试步骤:
1、输入命令 npm install 安装依赖,
2、然后运行 npm run start 启动调试服务器。
3、点击『网页右键菜单 > 检查(Inspect)』可打开 DevTools 调试工具。

发布步骤:
1、运行 npm run build 发布前端代码。
2、在 aardio 中按 F7 生成 exe 文件。

`