@@ -10,7 +10,7 @@ import * as express from "express"
10
10
* The homepage of code-server will launch into VS Code. However, there will be an overlay
11
11
* button that when clicked, will show all available applications with their names,
12
12
* icons and provider plugins. When one clicks on an app's icon, they will be directed
13
- * to <code-server-root>/<plugin-name >/<app-name > to access the application.
13
+ * to <code-server-root>/<plugin-path >/<app-path > to access the application.
14
14
*/
15
15
16
16
/**
@@ -51,18 +51,44 @@ import * as express from "express"
51
51
/**
52
52
* Your plugin module must implement this interface.
53
53
*
54
- * The plugin's name, description and version are fetched from its module's package.json
55
- *
56
- * The plugin's router will be mounted at <code-sever-root>/<plugin-name>
54
+ * The plugin's router will be mounted at <code-sever-root>/<plugin-path>
57
55
*/
58
56
export interface Plugin {
57
+ /**
58
+ * name is used as the plugin's unique identifier.
59
+ * No two plugins may share the same name.
60
+ *
61
+ * Fetched from package.json.
62
+ */
63
+ name ?: string
64
+
65
+ /**
66
+ * The version for the plugin in the overlay.
67
+ *
68
+ * Fetched from package.json.
69
+ */
70
+ version ?: string
71
+
72
+ /**
73
+ * These two are used in the overlay.
74
+ */
75
+ displayName : string
76
+ description : string
77
+
78
+ /**
79
+ * The path at which the plugin router is to be registered.
80
+ */
81
+ path : string
82
+
59
83
/**
60
84
* init is called so that the plugin may initialize itself with the config.
61
85
*/
62
86
init ( config : PluginConfig ) : void
63
87
64
88
/**
65
89
* Returns the plugin's router.
90
+ *
91
+ * Mounted at <code-sever-root>/<plugin-path>
66
92
*/
67
93
router ( ) : express . Router
68
94
@@ -90,21 +116,25 @@ export interface PluginConfig {
90
116
91
117
/**
92
118
* Application represents a user accessible application.
93
- *
94
- * When the user clicks on the icon in the overlay, they will be
95
- * redirected to <code-server-root>/<plugin-name>/<app-name>
96
- * where the application should be accessible.
97
- *
98
- * If the app's name is the same as the plugin's name then
99
- * <code-server-root>/<plugin-name> will be used instead.
100
119
*/
101
120
export interface Application {
102
121
readonly name : string
103
122
readonly version : string
104
123
124
+ /**
125
+ * When the user clicks on the icon in the overlay, they will be
126
+ * redirected to <code-server-root>/<plugin-path>/<app-path>
127
+ * where the application should be accessible.
128
+ *
129
+ * If undefined, then <code-server-root>/<plugin-path> is used.
130
+ */
131
+ readonly path ?: string
132
+
133
+ readonly description ?: string
134
+
105
135
/**
106
136
* The path at which the icon for this application can be accessed.
107
- * <code-server-root>/<plugin-name >/<app-name >/<icon-path>
137
+ * <code-server-root>/<plugin-path >/<app-path >/<icon-path>
108
138
*/
109
139
readonly iconPath : string
110
140
}
0 commit comments