File tree 4 files changed +20
-5
lines changed
4 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,13 @@ export class PluginAPI {
110
110
await this . _loadPlugins ( path . join ( __dirname , "../../plugins" ) )
111
111
}
112
112
113
+ /**
114
+ * _loadPlugins is the counterpart to loadPlugins.
115
+ *
116
+ * It differs in that it loads all plugins in a single
117
+ * directory whereas loadPlugins uses all available directories
118
+ * as documented.
119
+ */
113
120
private async _loadPlugins ( dir : string ) : Promise < void > {
114
121
try {
115
122
const entries = await fsp . readdir ( dir , { withFileTypes : true } )
@@ -149,6 +156,11 @@ export class PluginAPI {
149
156
}
150
157
}
151
158
159
+ /**
160
+ * _loadPlugin is the counterpart to loadPlugin and actually
161
+ * loads the plugin now that we know there is no duplicate
162
+ * and that the package.json has been read.
163
+ */
152
164
private _loadPlugin ( dir : string , packageJSON : PackageJSON ) : Plugin {
153
165
dir = path . resolve ( dir )
154
166
Original file line number Diff line number Diff line change 1
1
import * as express from "express"
2
2
import { PluginAPI } from "../plugin"
3
3
4
+ /**
5
+ * Implements the /api/applications endpoint
6
+ */
4
7
export function router ( papi : PluginAPI ) : express . Router {
5
8
const router = express . Router ( )
6
9
Original file line number Diff line number Diff line change @@ -17,19 +17,19 @@ describe("plugin", () => {
17
17
assert . deepEqual (
18
18
[
19
19
{
20
- name : "test app " ,
20
+ name : "Test App " ,
21
21
version : "4.0.0" ,
22
22
23
- description : "my description " ,
23
+ description : "This app does XYZ. " ,
24
24
iconPath : "/icon.svg" ,
25
25
26
26
plugin : {
27
27
name : "test-plugin" ,
28
28
version : "1.0.0" ,
29
29
modulePath : path . join ( __dirname , "test-plugin" ) ,
30
30
31
- description : "Plugin used in code-server tests." ,
32
31
displayName : "Test Plugin" ,
32
+ description : "Plugin used in code-server tests." ,
33
33
path : "/test-plugin" ,
34
34
} ,
35
35
} ,
Original file line number Diff line number Diff line change @@ -21,11 +21,11 @@ export function router(): express.Router {
21
21
export function applications ( ) : pluginapi . Application [ ] {
22
22
return [
23
23
{
24
- name : "test app " ,
24
+ name : "Test App " ,
25
25
version : "4.0.0" ,
26
26
iconPath : "/icon.svg" ,
27
27
28
- description : "my description " ,
28
+ description : "This app does XYZ. " ,
29
29
} ,
30
30
]
31
31
}
You can’t perform that action at this time.
0 commit comments