@bhsd/codemirror-mediawiki 3.0.2 → 3.0.3
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/dist/codemirror.js +2 -7
- package/dist/main.min.js +10 -10
- package/dist/mw.min.js +11 -11
- package/dist/wiki.min.js +4 -4
- package/i18n/en.json +1 -1
- package/i18n/zh-hans.json +1 -1
- package/i18n/zh-hant.json +1 -1
- package/package.json +6 -7
- package/dist/lsp.d.ts +0 -3
- package/dist/lsp.js +0 -34
package/i18n/en.json
CHANGED
package/i18n/zh-hans.json
CHANGED
package/i18n/zh-hant.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bhsd/codemirror-mediawiki",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "Modified CodeMirror mode based on wikimedia/mediawiki-extensions-CodeMirror",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mediawiki",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"prepublishOnly": "npm run build",
|
|
34
34
|
"bundle:core": "node build.mjs",
|
|
35
35
|
"bundle:wiki": "MODE=wiki node build.mjs",
|
|
36
|
-
"bundle:unused": "esbuild ./test/bundle.ts --charset=utf8 --bundle --
|
|
36
|
+
"bundle:unused": "esbuild ./test/bundle.ts --charset=utf8 --bundle --format=esm --outfile=build/unused.js",
|
|
37
37
|
"build:css": "esbuild ./css/index.css --bundle --minify --outfile=mediawiki.css",
|
|
38
38
|
"build:core": "npm run bundle:core && esbuild ./build/main.js --charset=utf8 --minify --target=es2019 --format=esm --sourcemap --outfile=dist/main.min.js && tsc && esbuild src/config.ts --bundle --format=esm --external:@lezer/highlight --outfile=dist/config.js --legal-comments=inline && rm dist/*-page.{js,d.ts}",
|
|
39
39
|
"build:mw": "esbuild ./build/wiki.js --charset=utf8 --minify --target=es2019 --format=esm --outfile=dist/mw.min.js && esbuild ./mw/config.ts --charset=utf8 --bundle --target=es2019 --format=esm --outfile=dist/mwConfig.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"lint:css": "stylelint **/*.css",
|
|
46
46
|
"lint": "npm run lint:ts && npm run lint:css",
|
|
47
47
|
"prof": "node --prof test/dist/test/prof.js && node --prof-process isolate-0x*-v8.log > test/prof.txt && gsed -i '0,/Bottom up/d' test/prof.txt && rm isolate-0x*-v8.log",
|
|
48
|
-
"server": "
|
|
48
|
+
"server": "npm run test:end; http-server .. -c-1 --cors -s &",
|
|
49
49
|
"test": "mocha test/dist/test/*.test.js && mocha --reporter=progress test/dist/test/test.js",
|
|
50
50
|
"test:end": "pkill -x http-server",
|
|
51
51
|
"test:real": "node test/dist/test/real.js"
|
|
@@ -65,10 +65,9 @@
|
|
|
65
65
|
"@codemirror/lang-vue": "^0.1.3",
|
|
66
66
|
"@codemirror/legacy-modes": "^6.4.2",
|
|
67
67
|
"@codemirror/lint": "^6.8.5",
|
|
68
|
-
"@codemirror/lsp-client": "^6.0.0",
|
|
69
68
|
"@codemirror/search": "^6.5.11",
|
|
70
69
|
"@codemirror/state": "^6.5.2",
|
|
71
|
-
"@codemirror/view": "
|
|
70
|
+
"@codemirror/view": "6.38.0",
|
|
72
71
|
"@lezer/common": "^1.2.3",
|
|
73
72
|
"@lezer/highlight": "^1.2.1",
|
|
74
73
|
"wikiparser-node": "^1.23.0"
|
|
@@ -76,7 +75,7 @@
|
|
|
76
75
|
"devDependencies": {
|
|
77
76
|
"@bhsd/cm-util": "^0.0.0",
|
|
78
77
|
"@bhsd/code-standard": "^1.0.0",
|
|
79
|
-
"@bhsd/stylelint-util": "^0.
|
|
78
|
+
"@bhsd/stylelint-util": "^0.1.0",
|
|
80
79
|
"@stylistic/eslint-plugin": "^3.1.0",
|
|
81
80
|
"@stylistic/stylelint-plugin": "^4.0.0",
|
|
82
81
|
"@types/eslint": "^8.56.10",
|
|
@@ -96,7 +95,7 @@
|
|
|
96
95
|
"eslint-plugin-regexp": "^2.9.0",
|
|
97
96
|
"eslint-plugin-unicorn": "^56.0.1",
|
|
98
97
|
"http-server": "^14.1.1",
|
|
99
|
-
"luacheck-browserify": "^0.
|
|
98
|
+
"luacheck-browserify": "^0.8.0",
|
|
100
99
|
"mocha": "^11.7.1",
|
|
101
100
|
"monaco-editor": "^0.52.2",
|
|
102
101
|
"stylelint": "^16.23.1",
|
package/dist/lsp.d.ts
DELETED
package/dist/lsp.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { LSPClient, languageServerSupport } from '@codemirror/lsp-client';
|
|
2
|
-
let promise, file = 0;
|
|
3
|
-
export default async () => {
|
|
4
|
-
if (location.hostname !== 'localhost') {
|
|
5
|
-
return [];
|
|
6
|
-
}
|
|
7
|
-
promise ??= new Promise(resolve => {
|
|
8
|
-
let handlers = [];
|
|
9
|
-
const ws = new WebSocket('ws://localhost:3000/wikitext');
|
|
10
|
-
ws.onmessage = ({ data }) => {
|
|
11
|
-
for (const handler of handlers) {
|
|
12
|
-
handler(String(data));
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
ws.onopen = () => {
|
|
16
|
-
resolve({
|
|
17
|
-
send(message) {
|
|
18
|
-
ws.send(message);
|
|
19
|
-
},
|
|
20
|
-
subscribe(handler) {
|
|
21
|
-
handlers.push(handler);
|
|
22
|
-
},
|
|
23
|
-
unsubscribe(handler) {
|
|
24
|
-
handlers = handlers.filter(h => h !== handler);
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
ws.onerror = () => {
|
|
29
|
-
resolve(null);
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
const transport = await promise;
|
|
33
|
-
return transport ? languageServerSupport(new LSPClient().connect(transport), `file:///${file++}.wiki`) : [];
|
|
34
|
-
};
|