wikiparser-node 1.7.0-beta.0 → 1.7.0-beta.2
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/extensions/dist/base.js +1 -1
- package/extensions/dist/lint.js +12 -0
- package/package.json +5 -4
package/extensions/dist/base.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
const workerJS = () => {
|
|
3
|
-
importScripts('https://testingcf.jsdelivr.net/npm/wikiparser-node@1.7.0-beta.
|
|
3
|
+
importScripts('https://testingcf.jsdelivr.net/npm/wikiparser-node@1.7.0-beta.2/bundle/bundle.min.js');
|
|
4
4
|
const entities = { '&': 'amp', '<': 'lt', '>': 'gt' };
|
|
5
5
|
self.onmessage = ({ data }) => {
|
|
6
6
|
const [command, qid, wikitext, include, stage] = data;
|
package/extensions/dist/lint.js
CHANGED
|
@@ -46,6 +46,18 @@ class Linter {
|
|
|
46
46
|
})),
|
|
47
47
|
}));
|
|
48
48
|
}
|
|
49
|
+
async monaco(wikitext) {
|
|
50
|
+
return (await this.queue(wikitext)).map(({ startLine, startCol, endLine, endCol, severity, message, rule }) => ({
|
|
51
|
+
source: `WikiLint(${rule})`,
|
|
52
|
+
startLineNumber: startLine + 1,
|
|
53
|
+
startColumn: startCol + 1,
|
|
54
|
+
endLineNumber: endLine + 1,
|
|
55
|
+
endColumn: endCol + 1,
|
|
56
|
+
severity: severity === 'error' ? 8 : 4,
|
|
57
|
+
rule,
|
|
58
|
+
message,
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
49
61
|
}
|
|
50
62
|
_Linter_id = new WeakMap(), _Linter_wikitext = new WeakMap(), _Linter_running = new WeakMap(), _Linter_instances = new WeakSet(), _Linter_lint = async function _Linter_lint(wikitext) {
|
|
51
63
|
const { include } = this, errors = await wikiparse.lint(wikitext, include, __classPrivateFieldGet(this, _Linter_id, "f"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wikiparser-node",
|
|
3
|
-
"version": "1.7.0-beta.
|
|
3
|
+
"version": "1.7.0-beta.2",
|
|
4
4
|
"description": "A Node.js parser for MediaWiki markup with AST",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mediawiki",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"diff": "bash diff.sh",
|
|
42
42
|
"diff:stat": "f() { git diff --stat --ignore-all-space --color=always $1 $2 -- . ':!extensions/' ':!bin/' | grep '\\.ts'; }; f",
|
|
43
43
|
"lint:ts": "tsc --noEmit && tsc --noEmit --project extensions/tsconfig.json && eslint --cache .",
|
|
44
|
-
"lint:json": "
|
|
44
|
+
"lint:json": "v8r -s config/.schema.json config/*.json",
|
|
45
45
|
"lint:css": "stylelint extensions/*.css",
|
|
46
46
|
"lint": "npm run lint:ts && npm run lint:json && npm run lint:css",
|
|
47
47
|
"server": "npm run test:end; http-server .. -c-1 --cors &",
|
|
@@ -61,7 +61,6 @@
|
|
|
61
61
|
"@types/request": "^2.48.12",
|
|
62
62
|
"@typescript-eslint/eslint-plugin": "^7.1.0",
|
|
63
63
|
"@typescript-eslint/parser": "^7.1.0",
|
|
64
|
-
"ajv-cli": "^5.0.0",
|
|
65
64
|
"chalk": "^4.1.2",
|
|
66
65
|
"esbuild": "^0.19.12",
|
|
67
66
|
"eslint": "^8.56.0",
|
|
@@ -74,9 +73,11 @@
|
|
|
74
73
|
"eslint-plugin-regexp": "^2.2.0",
|
|
75
74
|
"eslint-plugin-unicorn": "^51.0.1",
|
|
76
75
|
"http-server": "^14.1.0",
|
|
76
|
+
"monaco-editor": "^0.47.0",
|
|
77
77
|
"stylelint": "^16.1.0",
|
|
78
78
|
"stylelint-config-recommended": "^14.0.0",
|
|
79
|
-
"typescript": "^5.3.3"
|
|
79
|
+
"typescript": "^5.3.3",
|
|
80
|
+
"v8r": "^3.0.0"
|
|
80
81
|
},
|
|
81
82
|
"engines": {
|
|
82
83
|
"node": "^20.9.0"
|