@shikijs/engine-javascript 1.26.0 → 1.26.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.
@@ -1,4 +1,4 @@
1
1
  import '@shikijs/types';
2
2
  import 'oniguruma-to-es';
3
- export { J as JavaScriptRegexEngineOptions, c as createJavaScriptRegexEngine, d as defaultJavaScriptRegexConstructor } from './shared/engine-javascript.DCvMc5Xx.mjs';
3
+ export { J as JavaScriptRegexEngineOptions, c as createJavaScriptRegexEngine, d as defaultJavaScriptRegexConstructor } from './shared/engine-javascript.DoNZS58X.mjs';
4
4
  import '@shikijs/vscode-textmate';
@@ -1,4 +1,4 @@
1
1
  import '@shikijs/types';
2
2
  import 'oniguruma-to-es';
3
- export { J as JavaScriptRegexEngineOptions, c as createJavaScriptRegexEngine, d as defaultJavaScriptRegexConstructor } from './shared/engine-javascript.DCvMc5Xx.js';
3
+ export { J as JavaScriptRegexEngineOptions, c as createJavaScriptRegexEngine, d as defaultJavaScriptRegexConstructor } from './shared/engine-javascript.DoNZS58X.js';
4
4
  import '@shikijs/vscode-textmate';
@@ -16,7 +16,10 @@ function defaultJavaScriptRegexConstructor(pattern, options) {
16
16
  captureGroup: true,
17
17
  // Removing `\G` anchors in cases when they're not supported for emulation allows
18
18
  // supporting more grammars, but also allows some mismatches
19
- ignoreUnsupportedGAnchors: true
19
+ ignoreUnsupportedGAnchors: true,
20
+ // Oniguruma uses depth limit `20`; lowered here to keep regexes shorter and maybe
21
+ // sometimes faster, but can be increased if issues reported due to low limit
22
+ recursionLimit: 5
20
23
  },
21
24
  ...options
22
25
  }
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { J as JavaScriptRegexEngineOptions, a as JavaScriptRegexScannerOptions, b as JavaScriptScanner, c as createJavaScriptRegexEngine, d as defaultJavaScriptRegexConstructor } from './shared/engine-javascript.DCvMc5Xx.mjs';
1
+ export { J as JavaScriptRegexEngineOptions, a as JavaScriptRegexScannerOptions, b as JavaScriptScanner, c as createJavaScriptRegexEngine, d as defaultJavaScriptRegexConstructor } from './shared/engine-javascript.DoNZS58X.mjs';
2
2
  export { createJavaScriptRawEngine } from './engine-raw.mjs';
3
3
  import '@shikijs/types';
4
4
  import 'oniguruma-to-es';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { J as JavaScriptRegexEngineOptions, a as JavaScriptRegexScannerOptions, b as JavaScriptScanner, c as createJavaScriptRegexEngine, d as defaultJavaScriptRegexConstructor } from './shared/engine-javascript.DCvMc5Xx.js';
1
+ export { J as JavaScriptRegexEngineOptions, a as JavaScriptRegexScannerOptions, b as JavaScriptScanner, c as createJavaScriptRegexEngine, d as defaultJavaScriptRegexConstructor } from './shared/engine-javascript.DoNZS58X.js';
2
2
  export { createJavaScriptRawEngine } from './engine-raw.js';
3
3
  import '@shikijs/types';
4
4
  import 'oniguruma-to-es';
@@ -32,13 +32,12 @@ interface JavaScriptRegexEngineOptions extends JavaScriptRegexScannerOptions {
32
32
  /**
33
33
  * The target ECMAScript version.
34
34
  *
35
- * Oniguruma-To-ES uses RegExp features from later versions of ECMAScript to provide improved
36
- * accuracy and add support for more grammars. If using target `ES2024` or later, the RegExp `v`
37
- * flag is used which requires Node.js 20+ or Chrome 112+.
35
+ * Oniguruma-To-ES uses RegExp features from later versions of ECMAScript to add support for a
36
+ * few more grammars. If using target `ES2024` or later, the RegExp `v` flag is used which
37
+ * requires Node.js 20+ or Chrome 112+.
38
38
  * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicodeSets
39
39
  *
40
- * For maximum compatibility, you can set it to `ES2018` which uses the RegExp `u` flag but
41
- * supports a few less grammars.
40
+ * For maximum compatibility, you can set it to `ES2018` which uses the RegExp `u` flag.
42
41
  *
43
42
  * Set to `auto` to automatically detect the latest version supported by the environment.
44
43
  *
@@ -47,7 +46,7 @@ interface JavaScriptRegexEngineOptions extends JavaScriptRegexScannerOptions {
47
46
  target?: 'auto' | 'ES2025' | 'ES2024' | 'ES2018';
48
47
  }
49
48
  /**
50
- * The default RegExp constructor for JavaScript regex engine.
49
+ * The default regex constructor for the JavaScript RegExp engine.
51
50
  */
52
51
  declare function defaultJavaScriptRegexConstructor(pattern: string, options?: OnigurumaToEsOptions): RegExp;
53
52
  /**
@@ -32,13 +32,12 @@ interface JavaScriptRegexEngineOptions extends JavaScriptRegexScannerOptions {
32
32
  /**
33
33
  * The target ECMAScript version.
34
34
  *
35
- * Oniguruma-To-ES uses RegExp features from later versions of ECMAScript to provide improved
36
- * accuracy and add support for more grammars. If using target `ES2024` or later, the RegExp `v`
37
- * flag is used which requires Node.js 20+ or Chrome 112+.
35
+ * Oniguruma-To-ES uses RegExp features from later versions of ECMAScript to add support for a
36
+ * few more grammars. If using target `ES2024` or later, the RegExp `v` flag is used which
37
+ * requires Node.js 20+ or Chrome 112+.
38
38
  * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicodeSets
39
39
  *
40
- * For maximum compatibility, you can set it to `ES2018` which uses the RegExp `u` flag but
41
- * supports a few less grammars.
40
+ * For maximum compatibility, you can set it to `ES2018` which uses the RegExp `u` flag.
42
41
  *
43
42
  * Set to `auto` to automatically detect the latest version supported by the environment.
44
43
  *
@@ -47,7 +46,7 @@ interface JavaScriptRegexEngineOptions extends JavaScriptRegexScannerOptions {
47
46
  target?: 'auto' | 'ES2025' | 'ES2024' | 'ES2018';
48
47
  }
49
48
  /**
50
- * The default RegExp constructor for JavaScript regex engine.
49
+ * The default regex constructor for the JavaScript RegExp engine.
51
50
  */
52
51
  declare function defaultJavaScriptRegexConstructor(pattern: string, options?: OnigurumaToEsOptions): RegExp;
53
52
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shikijs/engine-javascript",
3
3
  "type": "module",
4
- "version": "1.26.0",
4
+ "version": "1.26.2",
5
5
  "description": "Engine for Shiki using JavaScript's native RegExp",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -35,8 +35,8 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@shikijs/vscode-textmate": "^10.0.1",
38
- "oniguruma-to-es": "0.10.0",
39
- "@shikijs/types": "1.26.0"
38
+ "oniguruma-to-es": "^1.0.0",
39
+ "@shikijs/types": "1.26.2"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "unbuild",