@jupyterlab/extensionmanager 4.0.0-alpha.8 → 4.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/dialog.js +2 -2
- package/lib/dialog.js.map +1 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -2
- package/lib/index.js.map +1 -1
- package/lib/model.d.ts +90 -193
- package/lib/model.js +210 -451
- package/lib/model.js.map +1 -1
- package/lib/widget.d.ts +18 -207
- package/lib/widget.js +201 -317
- package/lib/widget.js.map +1 -1
- package/package.json +16 -15
- package/src/dialog.tsx +39 -0
- package/src/index.ts +9 -0
- package/src/model.ts +691 -0
- package/src/widget.tsx +760 -0
- package/style/base.css +59 -103
- package/style/index.css +1 -1
- package/style/index.js +1 -1
- package/lib/build-helper.d.ts +0 -9
- package/lib/build-helper.js +0 -60
- package/lib/build-helper.js.map +0 -1
- package/lib/companions.d.ts +0 -88
- package/lib/companions.js +0 -98
- package/lib/companions.js.map +0 -1
- package/lib/listings.d.ts +0 -50
- package/lib/listings.js +0 -80
- package/lib/listings.js.map +0 -1
- package/lib/npm.d.ts +0 -223
- package/lib/npm.js +0 -76
- package/lib/npm.js.map +0 -1
package/lib/npm.d.ts
DELETED
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import { IJupyterLabPackageData } from './companions';
|
|
2
|
-
/**
|
|
3
|
-
* Information about a person in search results.
|
|
4
|
-
*/
|
|
5
|
-
export interface IPerson {
|
|
6
|
-
/**
|
|
7
|
-
* The username of the person.
|
|
8
|
-
*/
|
|
9
|
-
username: string;
|
|
10
|
-
/**
|
|
11
|
-
* The email of the person.
|
|
12
|
-
*/
|
|
13
|
-
email: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* NPM registry search result structure (subset).
|
|
17
|
-
*
|
|
18
|
-
* See https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md
|
|
19
|
-
* for full specification.
|
|
20
|
-
*/
|
|
21
|
-
export interface ISearchResult {
|
|
22
|
-
/**
|
|
23
|
-
* A collection of search results.
|
|
24
|
-
*/
|
|
25
|
-
objects: {
|
|
26
|
-
/**
|
|
27
|
-
* Metadata about the found package.
|
|
28
|
-
*/
|
|
29
|
-
package: {
|
|
30
|
-
/**
|
|
31
|
-
* The package name.
|
|
32
|
-
*/
|
|
33
|
-
name: string;
|
|
34
|
-
/**
|
|
35
|
-
* The scope of the package (e.g. jupyterlab for @jupyterlab/services).
|
|
36
|
-
*/
|
|
37
|
-
scope: string;
|
|
38
|
-
/**
|
|
39
|
-
* Version number.
|
|
40
|
-
*/
|
|
41
|
-
version: string;
|
|
42
|
-
/**
|
|
43
|
-
* Description as listed in package.json.
|
|
44
|
-
*/
|
|
45
|
-
description: string;
|
|
46
|
-
/**
|
|
47
|
-
* Package keywords.
|
|
48
|
-
*/
|
|
49
|
-
keywords: string[];
|
|
50
|
-
/**
|
|
51
|
-
* Timestamp of release(?).
|
|
52
|
-
*/
|
|
53
|
-
date: string;
|
|
54
|
-
/**
|
|
55
|
-
* Various metadata links for the package.
|
|
56
|
-
*/
|
|
57
|
-
links: {
|
|
58
|
-
[key: string]: string;
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* Metadata about user who published the release.
|
|
62
|
-
*/
|
|
63
|
-
publisher: IPerson;
|
|
64
|
-
/**
|
|
65
|
-
* Maintainer list per package.json.
|
|
66
|
-
*/
|
|
67
|
-
maintainers: IPerson[];
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* Flags about the package.
|
|
71
|
-
*/
|
|
72
|
-
flags: {
|
|
73
|
-
/**
|
|
74
|
-
* Package is insecure or have vulnerable dependencies (based on the nsp registry).
|
|
75
|
-
*/
|
|
76
|
-
insecure: number;
|
|
77
|
-
/**
|
|
78
|
-
* Package has a version < 1.0.0.
|
|
79
|
-
*/
|
|
80
|
-
unstable: boolean;
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* Object detailing the normalized search score.
|
|
84
|
-
*/
|
|
85
|
-
score: {
|
|
86
|
-
/**
|
|
87
|
-
* The final normalized search score.
|
|
88
|
-
*/
|
|
89
|
-
final: number;
|
|
90
|
-
/**
|
|
91
|
-
* Break down of the search score.
|
|
92
|
-
*/
|
|
93
|
-
detail: {
|
|
94
|
-
/**
|
|
95
|
-
* The normalized quality score.
|
|
96
|
-
*/
|
|
97
|
-
quality: number;
|
|
98
|
-
/**
|
|
99
|
-
* The normalized popularity score.
|
|
100
|
-
*/
|
|
101
|
-
popularity: number;
|
|
102
|
-
/**
|
|
103
|
-
* The normalized maintenance score.
|
|
104
|
-
*/
|
|
105
|
-
maintenance: number;
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
/**
|
|
109
|
-
* The search score.
|
|
110
|
-
*/
|
|
111
|
-
searchScore: number;
|
|
112
|
-
}[];
|
|
113
|
-
/**
|
|
114
|
-
* The total number of objects found by the search.
|
|
115
|
-
*
|
|
116
|
-
* This can be greater than the number of objects due
|
|
117
|
-
* to pagination of the search results.
|
|
118
|
-
*/
|
|
119
|
-
total: number;
|
|
120
|
-
/**
|
|
121
|
-
* Timestamp of the search result creation.
|
|
122
|
-
*/
|
|
123
|
-
time: string;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* An interface for a subset of the keys known to be included for package metadata.
|
|
127
|
-
*
|
|
128
|
-
* See https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md
|
|
129
|
-
* for full specification.
|
|
130
|
-
*/
|
|
131
|
-
export interface IPackageMetadata {
|
|
132
|
-
/**
|
|
133
|
-
* The package name.
|
|
134
|
-
*/
|
|
135
|
-
name: string;
|
|
136
|
-
/**
|
|
137
|
-
* ISO string of the last time this package was modified.
|
|
138
|
-
*/
|
|
139
|
-
modified: string;
|
|
140
|
-
/**
|
|
141
|
-
* A mapping of dist tags to the versions they point to.
|
|
142
|
-
*/
|
|
143
|
-
'dist-tags': {
|
|
144
|
-
/**
|
|
145
|
-
* The version tagged as 'latest'.
|
|
146
|
-
*/
|
|
147
|
-
latest: string;
|
|
148
|
-
[key: string]: string;
|
|
149
|
-
};
|
|
150
|
-
/**
|
|
151
|
-
* A short description of the package.
|
|
152
|
-
*/
|
|
153
|
-
description: string;
|
|
154
|
-
/**
|
|
155
|
-
* A mapping of semver-compliant version numbers to version data.
|
|
156
|
-
*/
|
|
157
|
-
versions: {
|
|
158
|
-
[key: string]: {
|
|
159
|
-
/**
|
|
160
|
-
* The package name.
|
|
161
|
-
*/
|
|
162
|
-
name: string;
|
|
163
|
-
/**
|
|
164
|
-
* The version string for this version.
|
|
165
|
-
*/
|
|
166
|
-
version: string;
|
|
167
|
-
/**
|
|
168
|
-
* The deprecation warnings message of this version.
|
|
169
|
-
*/
|
|
170
|
-
deprecated?: string;
|
|
171
|
-
/**
|
|
172
|
-
* A short description of the package.
|
|
173
|
-
*/
|
|
174
|
-
description: string;
|
|
175
|
-
};
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* An object for searching an NPM registry.
|
|
180
|
-
*
|
|
181
|
-
* Searches the NPM registry via web API:
|
|
182
|
-
* https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md
|
|
183
|
-
*/
|
|
184
|
-
export declare class Searcher {
|
|
185
|
-
/**
|
|
186
|
-
* Create a Searcher object.
|
|
187
|
-
*
|
|
188
|
-
* @param repoUri The URI of the NPM registry to use.
|
|
189
|
-
* @param cdnUri The URI of the CDN to use for fetching full package data.
|
|
190
|
-
*/
|
|
191
|
-
constructor(repoUri?: string, cdnUri?: string, enableCdn?: boolean);
|
|
192
|
-
/**
|
|
193
|
-
* Search for a jupyterlab extension.
|
|
194
|
-
*
|
|
195
|
-
* @param query The query to send. `keywords:"jupyterlab-extension"` will be appended to the query.
|
|
196
|
-
* @param page The page of results to fetch.
|
|
197
|
-
* @param pageination The pagination size to use. See registry API documentation for acceptable values.
|
|
198
|
-
*/
|
|
199
|
-
searchExtensions(query: string, page?: number, pageination?: number): Promise<ISearchResult>;
|
|
200
|
-
/**
|
|
201
|
-
* Fetch package.json of a package
|
|
202
|
-
*
|
|
203
|
-
* @param name The package name.
|
|
204
|
-
* @param version The version of the package to fetch.
|
|
205
|
-
*/
|
|
206
|
-
fetchPackageData(name: string, version: string): Promise<IJupyterLabPackageData | null>;
|
|
207
|
-
/**
|
|
208
|
-
* The URI of the NPM registry to use.
|
|
209
|
-
*/
|
|
210
|
-
repoUri: string;
|
|
211
|
-
/**
|
|
212
|
-
* The URI of the CDN to use for fetching full package data.
|
|
213
|
-
*/
|
|
214
|
-
cdnUri: string;
|
|
215
|
-
/**
|
|
216
|
-
* Whether to use the CDN for fetching full package data. Otherwise, the NPM registry is used.
|
|
217
|
-
*/
|
|
218
|
-
enableCdn: boolean;
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Check whether the NPM org is a Jupyter one.
|
|
222
|
-
*/
|
|
223
|
-
export declare function isJupyterOrg(name: string): boolean;
|
package/lib/npm.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Jupyter Development Team.
|
|
2
|
-
// Distributed under the terms of the Modified BSD License.
|
|
3
|
-
/**
|
|
4
|
-
* An object for searching an NPM registry.
|
|
5
|
-
*
|
|
6
|
-
* Searches the NPM registry via web API:
|
|
7
|
-
* https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md
|
|
8
|
-
*/
|
|
9
|
-
export class Searcher {
|
|
10
|
-
/**
|
|
11
|
-
* Create a Searcher object.
|
|
12
|
-
*
|
|
13
|
-
* @param repoUri The URI of the NPM registry to use.
|
|
14
|
-
* @param cdnUri The URI of the CDN to use for fetching full package data.
|
|
15
|
-
*/
|
|
16
|
-
constructor(repoUri = 'https://registry.npmjs.org/-/v1/', cdnUri = 'https://unpkg.com', enableCdn = true) {
|
|
17
|
-
this.repoUri = repoUri;
|
|
18
|
-
this.cdnUri = cdnUri;
|
|
19
|
-
this.enableCdn = enableCdn;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Search for a jupyterlab extension.
|
|
23
|
-
*
|
|
24
|
-
* @param query The query to send. `keywords:"jupyterlab-extension"` will be appended to the query.
|
|
25
|
-
* @param page The page of results to fetch.
|
|
26
|
-
* @param pageination The pagination size to use. See registry API documentation for acceptable values.
|
|
27
|
-
*/
|
|
28
|
-
searchExtensions(query, page = 0, pageination = 250) {
|
|
29
|
-
const uri = new URL('search', this.repoUri);
|
|
30
|
-
// Note: Spaces are encoded to '+' signs!
|
|
31
|
-
const text = `${query} keywords:"jupyterlab-extension"`;
|
|
32
|
-
uri.searchParams.append('text', text);
|
|
33
|
-
uri.searchParams.append('size', pageination.toString());
|
|
34
|
-
uri.searchParams.append('from', (pageination * page).toString());
|
|
35
|
-
return fetch(uri.toString()).then((response) => {
|
|
36
|
-
if (response.ok) {
|
|
37
|
-
return response.json();
|
|
38
|
-
}
|
|
39
|
-
return [];
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Fetch package.json of a package
|
|
44
|
-
*
|
|
45
|
-
* @param name The package name.
|
|
46
|
-
* @param version The version of the package to fetch.
|
|
47
|
-
*/
|
|
48
|
-
fetchPackageData(name, version) {
|
|
49
|
-
const uri = this.enableCdn
|
|
50
|
-
? new URL(`/${name}@${version}/package.json`, this.cdnUri)
|
|
51
|
-
: new URL(`/${name}/${version}`, this.repoUri);
|
|
52
|
-
return fetch(uri.toString()).then((response) => {
|
|
53
|
-
if (response.ok) {
|
|
54
|
-
return response.json();
|
|
55
|
-
}
|
|
56
|
-
return null;
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Check whether the NPM org is a Jupyter one.
|
|
62
|
-
*/
|
|
63
|
-
export function isJupyterOrg(name) {
|
|
64
|
-
/**
|
|
65
|
-
* A list of jupyterlab NPM orgs.
|
|
66
|
-
*/
|
|
67
|
-
const jupyterOrg = ['jupyterlab', 'jupyter-widgets'];
|
|
68
|
-
const parts = name.split('/');
|
|
69
|
-
const first = parts[0];
|
|
70
|
-
return (parts.length > 1 && // Has a first part
|
|
71
|
-
!!first && // with a finite length
|
|
72
|
-
first[0] === '@' && // corresponding to an org name
|
|
73
|
-
jupyterOrg.indexOf(first.slice(1)) !== -1 // in the org allowedExtensions.
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
//# sourceMappingURL=npm.js.map
|
package/lib/npm.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"npm.js","sourceRoot":"","sources":["../src/npm.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AA+M3D;;;;;GAKG;AACH,MAAM,OAAO,QAAQ;IACnB;;;;;OAKG;IACH,YACE,OAAO,GAAG,kCAAkC,EAC5C,MAAM,GAAG,mBAAmB,EAC5B,SAAS,GAAG,IAAI;QAEhB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED;;;;;;OAMG;IACH,gBAAgB,CACd,KAAa,EACb,IAAI,GAAG,CAAC,EACR,WAAW,GAAG,GAAG;QAEjB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,yCAAyC;QACzC,MAAM,IAAI,GAAG,GAAG,KAAK,kCAAkC,CAAC;QACxD,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACtC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxD,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QACjE,OAAO,KAAK,CAAC,G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