mirror of
https://github.com/ragestudio/linebridge.git
synced 2025-06-09 10:34:17 +00:00
Refactors internal loading of the library package.json
This commit is contained in:
parent
1449695714
commit
bc9b82dab1
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "linebridge",
|
||||
"version": "1.0.0-a3",
|
||||
"version": "1.0.0-alpha.2",
|
||||
"description": "Multiproposal framework to build fast, scalable, and secure servers.",
|
||||
"author": "RageStudio <support@ragestudio.net>",
|
||||
"bugs": {
|
||||
@ -37,7 +37,7 @@
|
||||
"sucrase": "^3.35.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ragestudio/hermes": "^1.0.0",
|
||||
"@ragestudio/hermes": "^1.0.1",
|
||||
"mocha": "^11.1.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
import path from "node:path"
|
||||
|
||||
import Route from "../classes/Route"
|
||||
import Vars from "../vars"
|
||||
|
||||
@ -10,7 +8,7 @@ export default class MainRoute extends Route {
|
||||
get = async (req, res, ctx) => {
|
||||
return {
|
||||
name: ctx.server.params.refName ?? "unknown",
|
||||
version: Vars.projectPkg.version ?? "unknown",
|
||||
version: Vars.projectPkg.version,
|
||||
engine: ctx.server.params.useEngine ?? "unknown",
|
||||
lb_version: Vars.libPkg.version ?? "unknown",
|
||||
experimental: ctx.server.isExperimental ?? "unknown",
|
||||
|
@ -1,14 +1,13 @@
|
||||
import path from "node:path"
|
||||
|
||||
const rootLibPath = path.resolve(__dirname, "../")
|
||||
const packageJSON = require(rootLibPath, "../package.json")
|
||||
const libPkg = require(path.resolve(rootLibPath, "package.json"))
|
||||
const projectPkg = require(path.resolve(process.cwd(), "package.json"))
|
||||
|
||||
export default {
|
||||
libPath: __dirname,
|
||||
rootLibPath: rootLibPath,
|
||||
libPkg: packageJSON,
|
||||
projectCwd: process.cwd(),
|
||||
libPath: __dirname,
|
||||
libPkg: libPkg,
|
||||
projectPkg: projectPkg,
|
||||
defaultParams: {
|
||||
refName: "linebridge",
|
||||
@ -37,7 +36,7 @@ export default {
|
||||
},
|
||||
baseHeaders: {
|
||||
server: "linebridge",
|
||||
"lb-version": packageJSON.version,
|
||||
"lb-version": libPkg.version,
|
||||
},
|
||||
baseMiddlewares: {
|
||||
logs: require("./middlewares/logger").default,
|
||||
|
Loading…
x
Reference in New Issue
Block a user