2020-10-30 14:18:59 +07:00
|
|
|
import * as express from "express"
|
2020-11-04 09:11:14 +07:00
|
|
|
import * as fspath from "path"
|
2020-11-04 05:13:21 +07:00
|
|
|
import * as pluginapi from "../../../typings/pluginapi"
|
2020-10-30 14:18:59 +07:00
|
|
|
|
2020-11-04 09:11:14 +07:00
|
|
|
export const displayName = "Test Plugin"
|
2020-11-04 09:42:21 +07:00
|
|
|
export const routerPath = "/test-plugin"
|
2020-11-04 09:11:14 +07:00
|
|
|
export const description = "Plugin used in code-server tests."
|
|
|
|
|
2020-10-30 14:18:59 +07:00
|
|
|
export function init(config: pluginapi.PluginConfig) {
|
|
|
|
config.logger.debug("test-plugin loaded!")
|
|
|
|
}
|
|
|
|
|
|
|
|
export function router(): express.Router {
|
|
|
|
const r = express.Router()
|
|
|
|
r.get("/goland/icon.svg", (req, res) => {
|
2020-11-04 09:11:14 +07:00
|
|
|
res.sendFile(fspath.resolve(__dirname, "../public/icon.svg"))
|
2020-10-30 14:18:59 +07:00
|
|
|
})
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
export function applications(): pluginapi.Application[] {
|
2020-10-30 14:26:30 +07:00
|
|
|
return [
|
|
|
|
{
|
2020-11-04 09:14:19 +07:00
|
|
|
name: "Test App",
|
2020-10-30 14:26:30 +07:00
|
|
|
version: "4.0.0",
|
2020-10-30 14:39:14 +07:00
|
|
|
iconPath: "/icon.svg",
|
2020-11-04 09:42:21 +07:00
|
|
|
path: "/test-app",
|
2020-11-04 09:11:14 +07:00
|
|
|
|
2020-11-04 09:14:19 +07:00
|
|
|
description: "This app does XYZ.",
|
2020-10-30 14:26:30 +07:00
|
|
|
},
|
|
|
|
]
|
2020-10-30 14:18:59 +07:00
|
|
|
}
|