2022-05-03 10:57:20 +00:00
|
|
|
|
import esbuild from 'esbuild'
|
|
|
|
|
import exec from 'shelljs.exec'
|
|
|
|
|
|
|
|
|
|
const productionVersion = "1.0"
|
|
|
|
|
|
2022-05-04 13:04:44 +00:00
|
|
|
|
const build = exec('git log -n 1 --pretty=format:"%h-%GK"', { async: false }).stdout
|
|
|
|
|
const type = exec('git log -n 1 --pretty=format:"%D"', { async: false }).stdout
|
2022-05-03 10:57:20 +00:00
|
|
|
|
const buildDate = new Date().toTimeString()
|
|
|
|
|
|
2022-05-04 13:04:44 +00:00
|
|
|
|
|
2022-05-03 10:57:20 +00:00
|
|
|
|
const banner = `
|
|
|
|
|
==========================================================================
|
|
|
|
|
__ _____ ______ __ __ _ __
|
|
|
|
|
/ / / ___// __ \\ \\/ /___ _____ _____/ /________ ______(_) /
|
|
|
|
|
/ / \\__ \\/ /_/ /\\ / __ \`/ __ \`/ __ / ___/ __ \`/ ___/ / /
|
|
|
|
|
/ /______/ / ____/ / / /_/ / /_/ / /_/ / / / /_/ (__ ) / /
|
|
|
|
|
/_____/____/_/ /_/\\__, /\\__, /\\__,_/_/ \\__,_/____/_/_/
|
|
|
|
|
/____//____/
|
|
|
|
|
A high performance mojang yggdrasil and authlib-injector implmentation
|
|
|
|
|
Version ${productionVersion} ${build}
|
|
|
|
|
Build on ${buildDate}
|
|
|
|
|
|
|
|
|
|
THIS PROGRAM IS FREE AND OPENSOURCE UNDER THE Anti-996 LICENSE (996.icu)
|
|
|
|
|
Copyright (c) 2022-present, Qumolama.d
|
|
|
|
|
==========================================================================
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
console.log(banner)
|
2022-05-04 13:04:44 +00:00
|
|
|
|
|
|
|
|
|
if(type.indexOf('stable') === -1) {
|
|
|
|
|
console.warn("⚠ 警告: 此版本不是正式版,运行可能会存在性能、安全、稳定度等严重风险,请谨慎使用!\n")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log("正在创建运行时文件...")
|
2022-05-03 10:57:20 +00:00
|
|
|
|
|
|
|
|
|
esbuild.build({
|
|
|
|
|
entryPoints: ['./src/index.js'],
|
2022-05-04 13:04:44 +00:00
|
|
|
|
outfile: './production/lsp-yggdrasil.full.cjs',
|
2022-05-03 10:57:20 +00:00
|
|
|
|
bundle: true,
|
|
|
|
|
platform: 'node',
|
|
|
|
|
target: 'es2018',
|
|
|
|
|
banner: {
|
2022-05-04 13:04:44 +00:00
|
|
|
|
js: `/*\n${banner}\n*/;const PROGRAM_PRODUCTION = true;`
|
2022-05-03 10:57:20 +00:00
|
|
|
|
},
|
|
|
|
|
}).then(() => {
|
2022-05-04 13:04:44 +00:00
|
|
|
|
console.log("一份运行时文件已保存在 production/lsp-yggdrasil.full.js,您可以尽情的体验和LSP一样快的世界树服务器了!")
|
2022-05-03 10:57:20 +00:00
|
|
|
|
})
|