mediawiki-projects-list 2.0.0 → 2.1.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/index.d.ts +28 -0
- package/index.js +6 -2
- package/package.json +1 -1
- package/projects-schema.json +6 -1
- package/projects.json +6 -3
package/index.d.ts
CHANGED
|
@@ -35,9 +35,28 @@ declare module 'mediawiki-projects-list' {
|
|
|
35
35
|
note: string | null;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
+
/** A frontend proxy */
|
|
39
|
+
export type FrontendProxy = {
|
|
40
|
+
/** Hostname of the proxy */
|
|
41
|
+
name: string;
|
|
42
|
+
/** Regex to match the proxy url */
|
|
43
|
+
regex: string;
|
|
44
|
+
/** Name path of the proxy */
|
|
45
|
+
namePath: string;
|
|
46
|
+
/** Article path of the proxy */
|
|
47
|
+
articlePath: string;
|
|
48
|
+
/** Script path of the proxy */
|
|
49
|
+
scriptPath: string;
|
|
50
|
+
/** Note about the specific proxy */
|
|
51
|
+
note: string | null;
|
|
52
|
+
};
|
|
53
|
+
|
|
38
54
|
/** List of MediaWiki projects */
|
|
39
55
|
export const wikiProjects: WikiProject[];
|
|
40
56
|
|
|
57
|
+
/** List of frontend proxies */
|
|
58
|
+
export const frontendProxies: FrontendProxy[];
|
|
59
|
+
|
|
41
60
|
export function inputToWikiProject(input: string): {
|
|
42
61
|
fullArticlePath: string;
|
|
43
62
|
fullScriptPath: string;
|
|
@@ -48,4 +67,13 @@ declare module 'mediawiki-projects-list' {
|
|
|
48
67
|
|
|
49
68
|
export function idStringToUrl(idString: string, projectName: string): URL | null;
|
|
50
69
|
|
|
70
|
+
export function inputToWikiProject(input: string): {
|
|
71
|
+
fullNamePath: string;
|
|
72
|
+
fullArticlePath: string;
|
|
73
|
+
fullScriptPath: string;
|
|
74
|
+
frontendProxy: FrontendProxy;
|
|
75
|
+
} | null;
|
|
76
|
+
|
|
77
|
+
export function urlToFix(url: string): ((href: string, pagelink: string) => string) | null;
|
|
78
|
+
|
|
51
79
|
}
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const {properties: {wikiProjects: {items: {properties: wikiProjectSchema}}}} = require('./projects-schema.json');
|
|
1
|
+
const {properties: {wikiProjects: {items: {properties: wikiProjectSchema}}, frontendProxies: {items: {properties: frontendProxySchema}}}} = require('./projects-schema.json');
|
|
2
2
|
const PROJECTS = require('./projects.json');
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -29,6 +29,7 @@ const PROJECTS = require('./projects.json');
|
|
|
29
29
|
* @property {string} namePath - Name path of the proxy
|
|
30
30
|
* @property {string} articlePath - Article path of the proxy
|
|
31
31
|
* @property {string} scriptPath - Script path of the proxy
|
|
32
|
+
* @property {?string} note - Note about the specific proxy
|
|
32
33
|
*/
|
|
33
34
|
|
|
34
35
|
/**
|
|
@@ -69,7 +70,10 @@ const wikiProjects = PROJECTS.wikiProjects.map( wikiProject => {
|
|
|
69
70
|
* List of frontend proxies
|
|
70
71
|
* @type {FrontendProxy[]}
|
|
71
72
|
*/
|
|
72
|
-
const frontendProxies = PROJECTS.frontendProxies
|
|
73
|
+
const frontendProxies = PROJECTS.frontendProxies.map( frontendProxy => {
|
|
74
|
+
frontendProxy.note ??= frontendProxySchema.note.default;
|
|
75
|
+
return frontendProxy;
|
|
76
|
+
} );
|
|
73
77
|
|
|
74
78
|
/**
|
|
75
79
|
*
|
package/package.json
CHANGED
package/projects-schema.json
CHANGED
|
@@ -34,7 +34,12 @@
|
|
|
34
34
|
},
|
|
35
35
|
"scriptPath": {
|
|
36
36
|
"type": "string",
|
|
37
|
-
"description": "Script path of the
|
|
37
|
+
"description": "Script path of the proxy"
|
|
38
|
+
},
|
|
39
|
+
"note": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "Note about the specific proxy",
|
|
42
|
+
"default": null
|
|
38
43
|
}
|
|
39
44
|
},
|
|
40
45
|
"required": [
|
package/projects.json
CHANGED
|
@@ -13,21 +13,24 @@
|
|
|
13
13
|
"regex": "([a-z\\d-]{1,50})\\.breezewiki\\.com(?:/wiki/|/?$)",
|
|
14
14
|
"namePath": "https://breezewiki.com/$1/",
|
|
15
15
|
"articlePath": "https://breezewiki.com/$1/wiki/",
|
|
16
|
-
"scriptPath": "https://$1.fandom.com/"
|
|
16
|
+
"scriptPath": "https://$1.fandom.com/",
|
|
17
|
+
"note": "Missing language support."
|
|
17
18
|
},
|
|
18
19
|
{
|
|
19
20
|
"name": "breezewiki.com",
|
|
20
21
|
"regex": "breezewiki\\.com/([a-z\\d-]{1,50})(?:/wiki/|/?$)",
|
|
21
22
|
"namePath": "https://breezewiki.com/$1/",
|
|
22
23
|
"articlePath": "https://breezewiki.com/$1/wiki/",
|
|
23
|
-
"scriptPath": "https://$1.fandom.com/"
|
|
24
|
+
"scriptPath": "https://$1.fandom.com/",
|
|
25
|
+
"note": "Missing language support."
|
|
24
26
|
},
|
|
25
27
|
{
|
|
26
28
|
"name": "breezewiki.pussthecat.org",
|
|
27
29
|
"regex": "breezewiki\\.pussthecat\\.org/([a-z\\d-]{1,50})(?:/wiki/|/?$)",
|
|
28
30
|
"namePath": "https://breezewiki.pussthecat.org/$1/",
|
|
29
31
|
"articlePath": "https://breezewiki.pussthecat.org/$1/wiki/",
|
|
30
|
-
"scriptPath": "https://$1.fandom.com/"
|
|
32
|
+
"scriptPath": "https://$1.fandom.com/",
|
|
33
|
+
"note": "Missing language support."
|
|
31
34
|
}
|
|
32
35
|
],
|
|
33
36
|
"wikiProjects": [
|