wikiparser-node 1.37.1 → 1.39.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.
Files changed (49) hide show
  1. package/README.md +8 -8
  2. package/bundle/bundle-es8.min.js +23 -23
  3. package/bundle/bundle-lsp.min.js +26 -26
  4. package/bundle/bundle.min.js +21 -21
  5. package/dist/addon/attribute.js +2 -2
  6. package/dist/addon/link.js +3 -4
  7. package/dist/addon/table.js +2 -2
  8. package/dist/base.d.mts +4 -3
  9. package/dist/base.d.ts +4 -3
  10. package/dist/base.js +1 -0
  11. package/dist/base.mjs +1 -0
  12. package/dist/bin/config.js +5 -4
  13. package/{extensions → dist/extensions}/typings.d.ts +2 -1
  14. package/dist/index.js +8 -7
  15. package/dist/lib/lintConfig.js +6 -3
  16. package/dist/lib/lsp.d.ts +3 -1
  17. package/dist/lib/lsp.js +24 -17
  18. package/dist/lib/ranges.js +3 -0
  19. package/dist/lib/title.d.ts +9 -2
  20. package/dist/lib/title.js +32 -14
  21. package/dist/mixin/elementLike.d.ts +2 -2
  22. package/dist/parser/hrAndDoubleUnderscore.js +1 -1
  23. package/dist/parser/table.js +1 -1
  24. package/dist/render/magicWords.js +14 -10
  25. package/dist/render/syntaxhighlight.js +12 -8
  26. package/dist/src/attribute.js +1 -1
  27. package/dist/src/index.js +3 -3
  28. package/dist/src/link/base.d.ts +3 -2
  29. package/dist/src/link/base.js +3 -4
  30. package/dist/src/link/file.js +12 -0
  31. package/dist/src/link/redirectTarget.js +1 -1
  32. package/dist/src/nowiki/doubleUnderscore.js +1 -1
  33. package/dist/src/nowiki/index.js +1 -0
  34. package/dist/src/nowiki/listBase.js +1 -1
  35. package/dist/src/table/base.d.ts +5 -0
  36. package/dist/src/table/base.js +3 -10
  37. package/dist/src/table/index.d.ts +2 -2
  38. package/dist/src/table/td.js +8 -5
  39. package/dist/src/tagPair/translate.js +2 -2
  40. package/dist/src/transclude.js +4 -0
  41. package/dist/util/sharable.js +1 -1
  42. package/dist/util/sharable.mjs +2 -2
  43. package/dist/util/string.js +3 -2
  44. package/extensions/dist/base.js +1 -1
  45. package/extensions/dist/lsp.js +3 -2
  46. package/i18n/en.json +1 -0
  47. package/i18n/zh-hans.json +1 -0
  48. package/i18n/zh-hant.json +1 -0
  49. package/package.json +25 -21
package/dist/src/index.js CHANGED
@@ -103,11 +103,11 @@ const lintSelectors = ['category', 'html-attr#id,ext-attr#id,table-attr#id'];
103
103
  */
104
104
  const getAcceptable = (value) => {
105
105
  const acceptable = {};
106
- for (const [k, v] of Object.entries(value)) {
106
+ for (const k in value) {
107
107
  if (k.startsWith('Stage-')) {
108
108
  for (let i = 0; i <= Number(k.slice(6)); i++) {
109
109
  for (const type of constants_1.aliases[i]) {
110
- acceptable[type] = new ranges_1.Ranges(v);
110
+ acceptable[type] = new ranges_1.Ranges(value[k]);
111
111
  }
112
112
  }
113
113
  }
@@ -115,7 +115,7 @@ const getAcceptable = (value) => {
115
115
  delete acceptable[k.slice(1)];
116
116
  }
117
117
  else {
118
- acceptable[k] = new ranges_1.Ranges(v);
118
+ acceptable[k] = new ranges_1.Ranges(value[k]);
119
119
  }
120
120
  }
121
121
  return acceptable;
@@ -1,6 +1,7 @@
1
+ import Parser from '../../index';
1
2
  import { Token } from '../index';
2
3
  import { AtomToken } from '../atom';
3
- import type { Config, LintError, AST } from '../../base';
4
+ import type { LintError, AST } from '../../base';
4
5
  import type { Title } from '../../lib/title';
5
6
  /**
6
7
  * internal link
@@ -33,7 +34,7 @@ export declare abstract class LinkBaseToken extends Token {
33
34
  * @param linkText 链接显示文字
34
35
  * @param delimiter `|`
35
36
  */
36
- constructor(link: string, linkText?: string, config?: Config, accum?: Token[], delimiter?: string);
37
+ constructor(link: string, linkText?: string, config?: Parser.Config, accum?: Token[], delimiter?: string);
37
38
  cloneNode(): this;
38
39
  /**
39
40
  * Set the link target
@@ -78,6 +78,7 @@ let LinkBaseToken = (() => {
78
78
  }
79
79
  #bracket = (__runInitializers(this, _instanceExtraInitializers), true);
80
80
  #delimiter;
81
+ // @ts-expect-error lazy initialization
81
82
  #title;
82
83
  /* NOT FOR BROWSER END */
83
84
  /** full link / 完整链接 */
@@ -118,7 +119,7 @@ let LinkBaseToken = (() => {
118
119
  * @param linkText 链接显示文字
119
120
  * @param delimiter `|`
120
121
  */
121
- constructor(link, linkText, config, accum = [], delimiter = '|') {
122
+ constructor(link, linkText, config = index_1.default.getConfig(), accum = [], delimiter = '|') {
122
123
  super(undefined, config, accum, {
123
124
  AtomToken: 0, Token: 1,
124
125
  });
@@ -126,9 +127,7 @@ let LinkBaseToken = (() => {
126
127
  'Stage-2': ':', '!ExtToken': '', '!HeadingToken': '',
127
128
  }));
128
129
  if (linkText !== undefined) {
129
- const inner = new index_2.Token(linkText, config, accum, {
130
- 'Stage-5': ':', QuoteToken: ':', ConverterToken: ':',
131
- });
130
+ const inner = new index_2.Token(linkText, { ...config, excludes: [...config.excludes, 'list'] }, accum, { 'Stage-5': ':', QuoteToken: ':', ConverterToken: ':' });
132
131
  inner.type = 'link-text';
133
132
  inner.setAttribute('stage', constants_1.MAX_STAGE - 1);
134
133
  this.insertAt(inner);
@@ -231,6 +231,18 @@ let FileToken = (() => {
231
231
  errors.push(e);
232
232
  }
233
233
  }
234
+ rule = 'blank-alt';
235
+ s = lintConfig.getSeverity(rule);
236
+ if (s) {
237
+ const alt = this.getArg('alt');
238
+ if (alt?.getValue() === '') {
239
+ const e = (0, lint_1.generateForChild)(alt, rect, rule, 'blank-alt', s);
240
+ if (computeEditInfo || fix) {
241
+ e.fix = (0, lint_1.fixByRemove)(e, -1);
242
+ }
243
+ errors.push(e);
244
+ }
245
+ }
234
246
  if (args.length === keys.length
235
247
  && frameKeys.length < 2
236
248
  && horizAlignKeys.length < 2
@@ -30,7 +30,7 @@ class RedirectTargetToken extends base_1.LinkBaseToken {
30
30
  * @since v1.10.0
31
31
  */
32
32
  get innerText() {
33
- return this.link.toString(true);
33
+ return this.link.toString(true, false);
34
34
  }
35
35
  /* NOT FOR BROWSER END */
36
36
  /**
@@ -78,7 +78,7 @@ let DoubleUnderscoreToken = (() => {
78
78
  constructor(word, sensitive, fullWidth, config, accum) {
79
79
  super(word, config, accum);
80
80
  const lc = word.toLowerCase(), [, , iAlias, sAlias] = config.doubleUnderscore;
81
- this.setAttribute('name', (sensitive ? sAlias?.[word]?.toLowerCase() : iAlias?.[lc]) ?? lc);
81
+ this.setAttribute('name', (sensitive ? sAlias[word]?.toLowerCase() : iAlias[lc]) ?? lc);
82
82
  this.#fullWidth = fullWidth;
83
83
  /* NOT FOR BROWSER */
84
84
  this.#sensitive = sensitive;
@@ -114,6 +114,7 @@ class NowikiToken extends base_1.NowikiBaseToken {
114
114
  }
115
115
  const e = (0, lint_1.generateForSelf)(this, { start }, rule, 'chem-required', s);
116
116
  if (result.status !== 'C') {
117
+ /** @todo native MathML supports more macros than texvcjs */
117
118
  const { message, location } = result.error, [endIndex, endLine, endCol] = updateLocation(e, location.end, n);
118
119
  [e.startIndex, e.startLine, e.startCol] = updateLocation(e, location.start, n);
119
120
  Object.assign(e, { endIndex, endLine, endCol, message });
@@ -24,7 +24,7 @@ class ListBaseToken extends base_1.NowikiBaseToken {
24
24
  /* NOT FOR BROWSER */
25
25
  /** @throws `Error` not `<dd>` only */
26
26
  set indent(indent) {
27
- if (/[^:]/u.test(this.innerText)) {
27
+ if (/[^:\s]/u.test(this.innerText)) {
28
28
  throw new Error('The token is not <dd>!');
29
29
  }
30
30
  this.setText(':'.repeat(indent));
@@ -6,6 +6,11 @@ import type { AttributesParentBase } from '../../mixin/attributesParent';
6
6
  declare type TableTypes = 'table' | 'tr' | 'td';
7
7
  export interface TableBaseToken extends AttributesParentBase {
8
8
  }
9
+ /**
10
+ * 转义表格语法
11
+ * @param syntax 表格语法节点
12
+ */
13
+ export declare const escapeTable: (syntax: SyntaxToken) => void;
9
14
  /**
10
15
  * table row that contains the newline at the beginning but not at the end
11
16
  *
@@ -37,7 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
38
38
  };
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.TableBaseToken = void 0;
40
+ exports.TableBaseToken = exports.escapeTable = void 0;
41
41
  const debug_1 = require("../../util/debug");
42
42
  const attributesParent_1 = require("../../mixin/attributesParent");
43
43
  const index_1 = __importDefault(require("../../index"));
@@ -58,6 +58,7 @@ const escapeTable = (syntax) => {
58
58
  syntax.safeReplaceChildren(childNodes);
59
59
  });
60
60
  };
61
+ exports.escapeTable = escapeTable;
61
62
  /**
62
63
  * table row that contains the newline at the beginning but not at the end
63
64
  *
@@ -98,7 +99,7 @@ let TableBaseToken = (() => {
98
99
  escape() {
99
100
  LSP: for (const child of this.childNodes) {
100
101
  if (child instanceof syntax_1.SyntaxToken) {
101
- escapeTable(child);
102
+ (0, exports.escapeTable)(child);
102
103
  }
103
104
  else {
104
105
  child.escape();
@@ -121,14 +122,6 @@ let TableBaseToken = (() => {
121
122
  return token;
122
123
  });
123
124
  }
124
- /** @private */
125
- setSyntax(syntax, esc) {
126
- const { firstChild } = this;
127
- firstChild.replaceChildren(syntax);
128
- if (esc) {
129
- escapeTable(firstChild);
130
- }
131
- }
132
125
  };
133
126
  return TableBaseToken = _classThis;
134
127
  })();
@@ -143,7 +143,7 @@ export declare abstract class TableToken extends TrBaseToken {
143
143
  * @param attr table attribute / 表格属性
144
144
  * @param multiRow whether to format multi-row cells / 是否对所有单元格设置,或是仅对行首单元格设置
145
145
  */
146
- formatTableRow(y: number, attr?: TdAttrs | string, multiRow?: boolean): void;
146
+ formatTableRow(y: number, attr?: TdAttrs | TdSubtypes, multiRow?: boolean): void;
147
147
  /**
148
148
  * Format the column
149
149
  *
@@ -152,7 +152,7 @@ export declare abstract class TableToken extends TrBaseToken {
152
152
  * @param attr table attribute / 表格属性
153
153
  * @param multiCol whether to format multi-column cells / 是否对所有单元格设置,或是仅对行首单元格设置
154
154
  */
155
- formatTableCol(x: number, attr?: TdAttrs | string, multiCol?: boolean): void;
155
+ formatTableCol(x: number, attr?: TdAttrs | TdSubtypes, multiCol?: boolean): void;
156
156
  /**
157
157
  * Fill the table row
158
158
  *
@@ -304,9 +304,12 @@ let TdToken = (() => {
304
304
  }
305
305
  }
306
306
  /** @private */
307
- setSyntax(syntax, esc) {
308
- const aliases = { td: '\n|', th: '\n!', caption: '\n|+' };
309
- super.setSyntax(aliases[syntax] ?? syntax, esc);
307
+ setSyntax(subtype, esc) {
308
+ const aliases = { td: '\n|', th: '\n!', caption: '\n|+' }, { firstChild } = this;
309
+ firstChild.replaceChildren(aliases[subtype]);
310
+ if (esc) {
311
+ (0, base_1.escapeTable)(firstChild);
312
+ }
310
313
  }
311
314
  /** 修复\<td\>语法 */
312
315
  #correct() {
@@ -341,8 +344,8 @@ let TdToken = (() => {
341
344
  }
342
345
  setAttr(keyOrProp, value) {
343
346
  if (typeof keyOrProp !== 'string') {
344
- for (const [key, val] of Object.entries(keyOrProp)) {
345
- this.setAttr(key, val);
347
+ for (const key in keyOrProp) {
348
+ this.setAttr(key, keyOrProp[key]);
346
349
  }
347
350
  return;
348
351
  }
@@ -134,8 +134,8 @@ let TranslateToken = (() => {
134
134
  /** @implements */
135
135
  setAttr(keyOrProp, value) {
136
136
  if (typeof keyOrProp === 'object') {
137
- for (const [key, val] of Object.entries(keyOrProp)) {
138
- this.setAttr(key, val);
137
+ for (const key in keyOrProp) {
138
+ this.setAttr(key, keyOrProp[key]);
139
139
  }
140
140
  }
141
141
  else if ((0, string_1.trimLc)(keyOrProp) === 'nowrap') {
@@ -84,6 +84,7 @@ let TranscludeToken = (() => {
84
84
  #raw = false;
85
85
  #args = new Map();
86
86
  #anonCount = 0;
87
+ // @ts-expect-error lazy initialization
87
88
  #title;
88
89
  /* NOT FOR BROWSER */
89
90
  #keys = new Set();
@@ -681,6 +682,9 @@ let TranscludeToken = (() => {
681
682
  removeArg(key, exact) {
682
683
  debug_1.Shadow.run(() => {
683
684
  for (const token of this.getArgs(key, exact, false)) {
685
+ if (token.anon) {
686
+ this.anonToNamed();
687
+ }
684
688
  this.removeChild(token);
685
689
  }
686
690
  });
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.extParams = exports.obsoleteAttrs = exports.extAttrs = exports.htmlAttrs = exports.commonHtmlAttrs = void 0;
4
4
  /* eslint-disable unicorn/no-unreadable-iife */
5
- const blockAttrs = new Set(['align']), citeAttrs = new Set(['cite']), citeAndAttrs = new Set(['cite', 'datetime']), widthAttrs = new Set(['width']), obsoleteTdAttrs = new Set(['axis', 'align', 'bgcolor', 'height', 'width', 'valign']), tdAttrs = new Set([...obsoleteTdAttrs, 'abbr', 'headers', 'scope', 'rowspan', 'colspan']), typeAttrs = new Set(['type']), obsoleteTableAttrs = new Set(['summary', 'align', 'bgcolor', 'cellpadding', 'cellspacing', 'frame', 'rules', 'width']), brAttrs = new Set(['clear']), trAttrs = new Set(['bgcolor', 'align', 'valign']), chemAttrs = new Set(['id', 'qid', 'forcemathmode', 'type', 'display']), syntaxHighlightAttrs = new Set([
5
+ const blockAttrs = new Set(['align']), citeAttrs = new Set(['cite']), citeAndAttrs = new Set(['cite', 'datetime']), widthAttrs = new Set(['width']), trAttrs = new Set(['bgcolor', 'align', 'valign']), obsoleteTdAttrs = new Set([...trAttrs, 'axis', 'height', 'nowrap', 'width']), tdAttrs = new Set([...obsoleteTdAttrs, 'abbr', 'headers', 'scope', 'rowspan', 'colspan']), typeAttrs = new Set(['type']), obsoleteTableAttrs = new Set(['summary', 'align', 'bgcolor', 'cellpadding', 'cellspacing', 'frame', 'rules', 'width']), brAttrs = new Set(['clear']), chemAttrs = new Set(['id', 'qid', 'forcemathmode', 'type', 'display']), syntaxHighlightAttrs = new Set([
6
6
  'enclose',
7
7
  'inline',
8
8
  'lang',
@@ -1,6 +1,6 @@
1
- const blockAttrs = /* @__PURE__ */ new Set(["align"]), citeAttrs = /* @__PURE__ */ new Set(["cite"]), citeAndAttrs = /* @__PURE__ */ new Set(["cite", "datetime"]), widthAttrs = /* @__PURE__ */ new Set(["width"]), obsoleteTdAttrs = /* @__PURE__ */ new Set(["axis", "align", "bgcolor", "height", "width", "valign"]), tdAttrs = /* @__PURE__ */ new Set([...obsoleteTdAttrs, "abbr", "headers", "scope", "rowspan", "colspan"]), typeAttrs = /* @__PURE__ */ new Set(["type"]), obsoleteTableAttrs = /* @__PURE__ */ new Set(
1
+ const blockAttrs = /* @__PURE__ */ new Set(["align"]), citeAttrs = /* @__PURE__ */ new Set(["cite"]), citeAndAttrs = /* @__PURE__ */ new Set(["cite", "datetime"]), widthAttrs = /* @__PURE__ */ new Set(["width"]), trAttrs = /* @__PURE__ */ new Set(["bgcolor", "align", "valign"]), obsoleteTdAttrs = /* @__PURE__ */ new Set([...trAttrs, "axis", "height", "nowrap", "width"]), tdAttrs = /* @__PURE__ */ new Set([...obsoleteTdAttrs, "abbr", "headers", "scope", "rowspan", "colspan"]), typeAttrs = /* @__PURE__ */ new Set(["type"]), obsoleteTableAttrs = /* @__PURE__ */ new Set(
2
2
  ["summary", "align", "bgcolor", "cellpadding", "cellspacing", "frame", "rules", "width"]
3
- ), brAttrs = /* @__PURE__ */ new Set(["clear"]), trAttrs = /* @__PURE__ */ new Set(["bgcolor", "align", "valign"]), chemAttrs = /* @__PURE__ */ new Set(["id", "qid", "forcemathmode", "type", "display"]), syntaxHighlightAttrs = /* @__PURE__ */ new Set([
3
+ ), brAttrs = /* @__PURE__ */ new Set(["clear"]), chemAttrs = /* @__PURE__ */ new Set(["id", "qid", "forcemathmode", "type", "display"]), syntaxHighlightAttrs = /* @__PURE__ */ new Set([
4
4
  "enclose",
5
5
  "inline",
6
6
  "lang",
@@ -58,7 +58,7 @@ const decodeHtml = (str) => {
58
58
  if (typeof process === 'object' && typeof process.versions?.node === 'string') {
59
59
  try {
60
60
  const { decodeHTMLStrict } = require('entities');
61
- return (s) => decodeHTMLStrict(s).replace(/\xA0/gu, ' ');
61
+ return (s) => decodeHTMLStrict(s).replaceAll('\xA0', ' ');
62
62
  }
63
63
  catch /* c8 ignore next */ { }
64
64
  }
@@ -106,7 +106,8 @@ exports.print = print;
106
106
  /* PRINT ONLY END */
107
107
  /* NOT FOR BROWSER */
108
108
  /** escape special chars for RegExp constructor */
109
- exports.escapeRegExp = factory(/[\\{}()|.?*+^$[\]]/gu, String.raw `\$&`);
109
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
110
+ exports.escapeRegExp = RegExp.escape || factory(/[\\{}()|.?*+^$[\]]/gu, String.raw `\$&`);
110
111
  /** escape newlines */
111
112
  exports.noWrap = factory(/\n/gu, String.raw `\n`);
112
113
  /** encode URI */
@@ -1,6 +1,6 @@
1
1
  (() => {
2
2
  var _a;
3
- const version = '1.37.1', src = (_a = document.currentScript) === null || _a === void 0 ? void 0 : _a.src, file = /\/extensions\/dist\/base\.(?:min\.)?js$/u, CDN = src && file.test(src)
3
+ const version = '1.39.0', src = (_a = document.currentScript) === null || _a === void 0 ? void 0 : _a.src, file = /\/extensions\/dist\/base\.(?:min\.)?js$/u, CDN = src && file.test(src)
4
4
  ? src.replace(file, '')
5
5
  : `https://fastly.jsdelivr.net/npm/wikiparser-node@${version}`;
6
6
  const workerJS = () => {
@@ -24,7 +24,7 @@ class LanguageService {
24
24
  __classPrivateFieldSet(this, _LanguageService_id, wikiparse.id++, "f");
25
25
  __classPrivateFieldSet(this, _LanguageService_include, include, "f");
26
26
  }
27
- destroy() {
27
+ async destroy() {
28
28
  wikiparse.provide('destroy', __classPrivateFieldGet(this, _LanguageService_id, "f"));
29
29
  }
30
30
  provideColorPresentations(color) {
@@ -88,7 +88,8 @@ _LanguageService_id = new WeakMap(), _LanguageService_include = new WeakMap(), _
88
88
  if (!__classPrivateFieldGet(this, _LanguageService_hasData, "f")) {
89
89
  __classPrivateFieldSet(this, _LanguageService_hasData, true, "f");
90
90
  data !== null && data !== void 0 ? data : (data = (async () => (await fetch(`${wikiparse.CDN}/data/signatures.json`)).json())());
91
- wikiparse.provide('data', __classPrivateFieldGet(this, _LanguageService_id, "f"), await data, __classPrivateFieldGet(this, _LanguageService_include, "f"));
91
+ this.data = await data;
92
+ wikiparse.provide('data', __classPrivateFieldGet(this, _LanguageService_id, "f"), this.data, __classPrivateFieldGet(this, _LanguageService_include, "f"));
92
93
  }
93
94
  };
94
95
  wikiparse.LanguageService = LanguageService;
package/i18n/en.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "argument-in-ext": "template argument inside an extension tag",
3
3
  "attributes-of-closing-tag": "attributes of a closing tag",
4
+ "blank-alt": "blank alt attribute",
4
5
  "bold-apostrophes": "bold apostrophes",
5
6
  "bold-in-header": "bold text in a section header",
6
7
  "chem-required": "chem attribute required",
package/i18n/zh-hans.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "argument-in-ext": "扩展标签内的模板参数",
3
3
  "attributes-of-closing-tag": "结束标签的属性",
4
+ "blank-alt": "空的alt属性",
4
5
  "bold-apostrophes": "粗体撇号",
5
6
  "bold-in-header": "章节标题中的加粗文本",
6
7
  "chem-required": "需要chem属性",
package/i18n/zh-hant.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "argument-in-ext": "擴充標籤內的模板參數",
3
3
  "attributes-of-closing-tag": "結束標籤的屬性",
4
+ "blank-alt": "空的alt屬性",
4
5
  "bold-apostrophes": "粗體撇號",
5
6
  "bold-in-header": "章節標題中的粗體文字",
6
7
  "chem-required": "需要chem屬性",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wikiparser-node",
3
- "version": "1.37.1",
3
+ "version": "1.39.0",
4
4
  "description": "A Node.js parser for MediaWiki markup with AST",
5
5
  "keywords": [
6
6
  "mediawiki",
@@ -16,7 +16,6 @@
16
16
  "author": "Bhsd",
17
17
  "files": [
18
18
  "/bundle/bundle*.js",
19
- "/extensions/typings.d.ts",
20
19
  "/extensions/dist/*.js",
21
20
  "/extensions/*.css",
22
21
  "!/extensions/dist/*-page*.js",
@@ -46,6 +45,7 @@
46
45
  "url": "git+https://github.com/bhsd-harry/wikiparser-node.git"
47
46
  },
48
47
  "scripts": {
48
+ "ls": "npm i --package-lock-only && npm ls --package-lock-only --all --omit=dev",
49
49
  "toc": "node dist/script/toc.js",
50
50
  "prepublishOnly": "npm run build:core",
51
51
  "build:core": "bash build.sh",
@@ -53,7 +53,7 @@
53
53
  "build": "npm run build:core && LC_ALL=en.UTF-8 node dist/script/parserTests.js",
54
54
  "diff": "bash diff.sh",
55
55
  "diff:stat": "f() { git diff --stat --ignore-all-space --color=always $1 $2 -- . | grep '\\.ts'; }; f",
56
- "lint:ts": "tsc --noEmit && eslint --cache . && eslint --no-config-lookup -c wiki/eslint.config.mjs wiki/*.md",
56
+ "lint:ts": "tsc --noEmit && eslint --cache .",
57
57
  "lint:json": "v8r -s config/.schema.json config/*.json && v8r -s data/.schema.json data/*.json && mocha dist/test/json.js",
58
58
  "lint:md": "markdownlint-cli2 '**/*.md'",
59
59
  "lint": "npm run lint:ts && npm run lint:json && npm run lint:md",
@@ -61,7 +61,7 @@
61
61
  "coverage": "tsc --declaration false --target es2024 && npm run build:define && c8 npm run test:ci && node dist/script/coverage.js && open coverage/index.html",
62
62
  "test:unit": "mocha dist/test/test.js",
63
63
  "test:math": "mocha dist/test/math.js",
64
- "test:clonenode": "CLONENODE=1 npm run test:unit",
64
+ "test:clonenode": "CLONENODE=1 mocha --require dist/test/env.js dist/test/test.js",
65
65
  "test:parser": "LC_ALL=en.UTF-8 mocha dist/test/parserTests.js",
66
66
  "test:perf": "mocha --reporter spec dist/test/perf.js",
67
67
  "test": "npm run test:unit && npm run test:clonenode && npm run test:parser",
@@ -85,7 +85,8 @@
85
85
  "dependencies": {
86
86
  "@bhsd/cm-util": "^1.0.0",
87
87
  "@bhsd/common": "^2.0.0",
88
- "@bhsd/stylelint-util": "^1.0.1",
88
+ "@bhsd/nodejs": "^1.0.0",
89
+ "@bhsd/stylelint-util": "^1.0.2",
89
90
  "binary-search": "^1.3.6",
90
91
  "vscode-languageserver-types": "^3.17.5"
91
92
  },
@@ -93,47 +94,50 @@
93
94
  "color-name": "^2.0.0",
94
95
  "entities": "^8.0.0",
95
96
  "mathoid-texvcjs": "^0.6.0",
96
- "prism-wiki": "^2.0.0",
97
+ "prism-wiki": "^2.1.0",
97
98
  "prismjs": "^1.30.0",
98
- "stylelint": "^17.6.0",
99
+ "stylelint": "^17.9.0",
99
100
  "vscode-css-languageservice": "^6.3.10",
100
101
  "vscode-html-languageservice": "^5.6.2",
101
102
  "vscode-json-languageservice": "^5.7.2"
102
103
  },
103
104
  "devDependencies": {
104
- "@bhsd/code-standard": "^2.1.1",
105
- "@bhsd/nodejs": "^1.0.0",
106
- "@bhsd/test-util": "^0.4.0",
105
+ "@bhsd/code-standard": "^2.2.0",
106
+ "@bhsd/test-util": "^1.1.0",
107
107
  "@codemirror/lint": "^6.9.5",
108
- "@eslint/markdown": "^7.5.1",
108
+ "@eslint/markdown": "^8.0.1",
109
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.7.1",
109
110
  "@stylistic/eslint-plugin": "^5.10.0",
110
111
  "@types/color-name": "^2.0.0",
111
112
  "@types/color-rgba": "^2.1.3",
112
113
  "@types/mocha": "^10.0.10",
113
114
  "@types/node": "^24.11.0",
114
115
  "@types/prismjs": "^1.26.6",
115
- "@typescript-eslint/eslint-plugin": "^8.57.0",
116
- "@typescript-eslint/parser": "^8.57.0",
116
+ "@typescript-eslint/eslint-plugin": "^8.59.0",
117
+ "@typescript-eslint/parser": "^8.59.0",
117
118
  "c8": "^11.0.0",
118
119
  "codejar-async": "^4.3.0",
119
120
  "color-rgba": "^3.0.0",
120
121
  "diff2html-cli": "^5.2.15",
121
- "esbuild": "^0.27.4",
122
- "eslint": "^9.39.4",
123
- "eslint-plugin-eslint-comments": "^3.2.0",
124
- "eslint-plugin-jsdoc": "^62.7.1",
125
- "eslint-plugin-jsonc": "^3.1.1",
122
+ "esbuild": "^0.28.0",
123
+ "eslint": "^10.2.1",
124
+ "eslint-plugin-jsdoc": "^62.9.0",
125
+ "eslint-plugin-jsonc": "^3.1.2",
126
126
  "eslint-plugin-n": "^17.24.0",
127
127
  "eslint-plugin-promise": "^7.2.1",
128
128
  "eslint-plugin-regexp": "^3.1.0",
129
- "eslint-plugin-unicorn": "^63.0.0",
130
- "markdownlint-cli2": "^0.21.0",
129
+ "eslint-plugin-unicorn": "^64.0.0",
130
+ "markdownlint-cli2": "^0.22.1",
131
131
  "mocha": "^11.7.5",
132
132
  "monaco-editor": "~0.53.0",
133
- "typescript": "^5.9.3",
133
+ "tsx": "^4.21.0",
134
+ "typescript": "^6.0.3",
134
135
  "v8r": "^6.0.0",
135
136
  "vscode-languageserver-textdocument": "^1.0.12"
136
137
  },
138
+ "overrides": {
139
+ "eslint": "^10.2.1"
140
+ },
137
141
  "engines": {
138
142
  "node": "^20.19.0 || ^22.13.0 || >=24.11.0"
139
143
  }