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