plugin.ts: Adjust to implement pluginapi.d.ts correctly
This commit is contained in:
@ -2,7 +2,6 @@
|
||||
"private": true,
|
||||
"name": "test-plugin",
|
||||
"version": "1.0.0",
|
||||
"description": "Fake plugin for testing code-server's plugin API",
|
||||
"engines": {
|
||||
"code-server": "^3.6.0"
|
||||
},
|
||||
|
@ -1,7 +1,11 @@
|
||||
import * as express from "express"
|
||||
import * as path from "path"
|
||||
import * as fspath from "path"
|
||||
import * as pluginapi from "../../../typings/pluginapi"
|
||||
|
||||
export const displayName = "Test Plugin"
|
||||
export const path = "/test-plugin"
|
||||
export const description = "Plugin used in code-server tests."
|
||||
|
||||
export function init(config: pluginapi.PluginConfig) {
|
||||
config.logger.debug("test-plugin loaded!")
|
||||
}
|
||||
@ -9,7 +13,7 @@ export function init(config: pluginapi.PluginConfig) {
|
||||
export function router(): express.Router {
|
||||
const r = express.Router()
|
||||
r.get("/goland/icon.svg", (req, res) => {
|
||||
res.sendFile(path.resolve(__dirname, "../public/icon.svg"))
|
||||
res.sendFile(fspath.resolve(__dirname, "../public/icon.svg"))
|
||||
})
|
||||
return r
|
||||
}
|
||||
@ -17,9 +21,11 @@ export function router(): express.Router {
|
||||
export function applications(): pluginapi.Application[] {
|
||||
return [
|
||||
{
|
||||
name: "goland",
|
||||
name: "test app",
|
||||
version: "4.0.0",
|
||||
iconPath: "/icon.svg",
|
||||
|
||||
description: "my description",
|
||||
},
|
||||
]
|
||||
}
|
||||
|
Reference in New Issue
Block a user