Refactor routing in App component to enhance navigation and improve error handling by integrating dynamic routes and updating the NotFound route.
This commit is contained in:
4
node_modules/@shikijs/engine-javascript/dist/engine-compile.d.mts
generated
vendored
Normal file
4
node_modules/@shikijs/engine-javascript/dist/engine-compile.d.mts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import '@shikijs/types';
|
||||
import 'oniguruma-to-es';
|
||||
export { J as JavaScriptRegexEngineOptions, c as createJavaScriptRegexEngine, d as defaultJavaScriptRegexConstructor } from './shared/engine-javascript.DoNZS58X.mjs';
|
||||
import '@shikijs/vscode-textmate';
|
4
node_modules/@shikijs/engine-javascript/dist/engine-compile.d.ts
generated
vendored
Normal file
4
node_modules/@shikijs/engine-javascript/dist/engine-compile.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import '@shikijs/types';
|
||||
import 'oniguruma-to-es';
|
||||
export { J as JavaScriptRegexEngineOptions, c as createJavaScriptRegexEngine, d as defaultJavaScriptRegexConstructor } from './shared/engine-javascript.DoNZS58X.js';
|
||||
import '@shikijs/vscode-textmate';
|
49
node_modules/@shikijs/engine-javascript/dist/engine-compile.mjs
generated
vendored
Normal file
49
node_modules/@shikijs/engine-javascript/dist/engine-compile.mjs
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
import { toRegExp } from 'oniguruma-to-es';
|
||||
import { J as JavaScriptScanner } from './shared/engine-javascript.hzpS1_41.mjs';
|
||||
|
||||
function defaultJavaScriptRegexConstructor(pattern, options) {
|
||||
return toRegExp(
|
||||
pattern,
|
||||
{
|
||||
global: true,
|
||||
hasIndices: true,
|
||||
rules: {
|
||||
// Needed since TextMate grammars merge backrefs across patterns
|
||||
allowOrphanBackrefs: true,
|
||||
// Improves search performance for generated regexes
|
||||
asciiWordBoundaries: true,
|
||||
// Follow `vscode-oniguruma` which enables this Oniguruma option by default
|
||||
captureGroup: true,
|
||||
// Oniguruma uses depth limit `20`; lowered here to keep regexes shorter and maybe
|
||||
// sometimes faster, but can be increased if issues reported due to low limit
|
||||
recursionLimit: 5,
|
||||
// Oniguruma option for `^`->`\A`, `$`->`\Z`; improves search performance without any
|
||||
// change in meaning since TM grammars search line by line
|
||||
singleline: true
|
||||
},
|
||||
...options
|
||||
}
|
||||
);
|
||||
}
|
||||
function createJavaScriptRegexEngine(options = {}) {
|
||||
const _options = Object.assign(
|
||||
{
|
||||
target: "auto",
|
||||
cache: /* @__PURE__ */ new Map()
|
||||
},
|
||||
options
|
||||
);
|
||||
_options.regexConstructor ||= (pattern) => defaultJavaScriptRegexConstructor(pattern, { target: _options.target });
|
||||
return {
|
||||
createScanner(patterns) {
|
||||
return new JavaScriptScanner(patterns, _options);
|
||||
},
|
||||
createString(s) {
|
||||
return {
|
||||
content: s
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export { createJavaScriptRegexEngine, defaultJavaScriptRegexConstructor };
|
12
node_modules/@shikijs/engine-javascript/dist/engine-raw.d.mts
generated
vendored
Normal file
12
node_modules/@shikijs/engine-javascript/dist/engine-raw.d.mts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { RegexEngine } from '@shikijs/types';
|
||||
|
||||
/**
|
||||
* Raw JavaScript regex engine that only supports precompiled grammars.
|
||||
*
|
||||
* This further simplifies the engine by excluding the regex compilation step.
|
||||
*
|
||||
* Zero dependencies.
|
||||
*/
|
||||
declare function createJavaScriptRawEngine(): RegexEngine;
|
||||
|
||||
export { createJavaScriptRawEngine };
|
12
node_modules/@shikijs/engine-javascript/dist/engine-raw.d.ts
generated
vendored
Normal file
12
node_modules/@shikijs/engine-javascript/dist/engine-raw.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { RegexEngine } from '@shikijs/types';
|
||||
|
||||
/**
|
||||
* Raw JavaScript regex engine that only supports precompiled grammars.
|
||||
*
|
||||
* This further simplifies the engine by excluding the regex compilation step.
|
||||
*
|
||||
* Zero dependencies.
|
||||
*/
|
||||
declare function createJavaScriptRawEngine(): RegexEngine;
|
||||
|
||||
export { createJavaScriptRawEngine };
|
22
node_modules/@shikijs/engine-javascript/dist/engine-raw.mjs
generated
vendored
Normal file
22
node_modules/@shikijs/engine-javascript/dist/engine-raw.mjs
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import { J as JavaScriptScanner } from './shared/engine-javascript.hzpS1_41.mjs';
|
||||
|
||||
function createJavaScriptRawEngine() {
|
||||
const options = {
|
||||
cache: /* @__PURE__ */ new Map(),
|
||||
regexConstructor: () => {
|
||||
throw new Error("JavaScriptRawEngine: only support precompiled grammar");
|
||||
}
|
||||
};
|
||||
return {
|
||||
createScanner(patterns) {
|
||||
return new JavaScriptScanner(patterns, options);
|
||||
},
|
||||
createString(s) {
|
||||
return {
|
||||
content: s
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export { createJavaScriptRawEngine };
|
5
node_modules/@shikijs/engine-javascript/dist/index.d.mts
generated
vendored
Normal file
5
node_modules/@shikijs/engine-javascript/dist/index.d.mts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export { J as JavaScriptRegexEngineOptions, a as JavaScriptRegexScannerOptions, b as JavaScriptScanner, c as createJavaScriptRegexEngine, d as defaultJavaScriptRegexConstructor } from './shared/engine-javascript.DoNZS58X.mjs';
|
||||
export { createJavaScriptRawEngine } from './engine-raw.mjs';
|
||||
import '@shikijs/types';
|
||||
import 'oniguruma-to-es';
|
||||
import '@shikijs/vscode-textmate';
|
5
node_modules/@shikijs/engine-javascript/dist/index.d.ts
generated
vendored
Normal file
5
node_modules/@shikijs/engine-javascript/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export { J as JavaScriptRegexEngineOptions, a as JavaScriptRegexScannerOptions, b as JavaScriptScanner, c as createJavaScriptRegexEngine, d as defaultJavaScriptRegexConstructor } from './shared/engine-javascript.DoNZS58X.js';
|
||||
export { createJavaScriptRawEngine } from './engine-raw.js';
|
||||
import '@shikijs/types';
|
||||
import 'oniguruma-to-es';
|
||||
import '@shikijs/vscode-textmate';
|
4
node_modules/@shikijs/engine-javascript/dist/index.mjs
generated
vendored
Normal file
4
node_modules/@shikijs/engine-javascript/dist/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export { createJavaScriptRegexEngine, defaultJavaScriptRegexConstructor } from './engine-compile.mjs';
|
||||
export { createJavaScriptRawEngine } from './engine-raw.mjs';
|
||||
export { J as JavaScriptScanner } from './shared/engine-javascript.hzpS1_41.mjs';
|
||||
import 'oniguruma-to-es';
|
62
node_modules/@shikijs/engine-javascript/dist/shared/engine-javascript.DoNZS58X.d.mts
generated
vendored
Normal file
62
node_modules/@shikijs/engine-javascript/dist/shared/engine-javascript.DoNZS58X.d.mts
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
import { PatternScanner, RegexEngineString, RegexEngine } from '@shikijs/types';
|
||||
import { OnigurumaToEsOptions } from 'oniguruma-to-es';
|
||||
import { IOnigMatch } from '@shikijs/vscode-textmate';
|
||||
|
||||
interface JavaScriptRegexScannerOptions {
|
||||
/**
|
||||
* Whether to allow invalid regex patterns.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
forgiving?: boolean;
|
||||
/**
|
||||
* Cache for regex patterns.
|
||||
*/
|
||||
cache?: Map<string, RegExp | Error> | null;
|
||||
/**
|
||||
* Custom pattern to RegExp constructor.
|
||||
*
|
||||
* By default `oniguruma-to-es` is used.
|
||||
*/
|
||||
regexConstructor?: (pattern: string) => RegExp;
|
||||
}
|
||||
declare class JavaScriptScanner implements PatternScanner {
|
||||
patterns: (string | RegExp)[];
|
||||
options: JavaScriptRegexScannerOptions;
|
||||
regexps: (RegExp | null)[];
|
||||
constructor(patterns: (string | RegExp)[], options?: JavaScriptRegexScannerOptions);
|
||||
findNextMatchSync(string: string | RegexEngineString, startPosition: number, _options: number): IOnigMatch | null;
|
||||
}
|
||||
|
||||
interface JavaScriptRegexEngineOptions extends JavaScriptRegexScannerOptions {
|
||||
/**
|
||||
* The target ECMAScript version.
|
||||
*
|
||||
* Oniguruma-To-ES uses RegExp features from later versions of ECMAScript to add support for a
|
||||
* few more grammars. If using target `ES2024` or later, the RegExp `v` flag is used which
|
||||
* requires Node.js 20+ or Chrome 112+.
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicodeSets
|
||||
*
|
||||
* For maximum compatibility, you can set it to `ES2018` which uses the RegExp `u` flag.
|
||||
*
|
||||
* Set to `auto` to automatically detect the latest version supported by the environment.
|
||||
*
|
||||
* @default 'auto'
|
||||
*/
|
||||
target?: 'auto' | 'ES2025' | 'ES2024' | 'ES2018';
|
||||
}
|
||||
/**
|
||||
* The default regex constructor for the JavaScript RegExp engine.
|
||||
*/
|
||||
declare function defaultJavaScriptRegexConstructor(pattern: string, options?: OnigurumaToEsOptions): RegExp;
|
||||
/**
|
||||
* Use the modern JavaScript RegExp engine to implement the OnigScanner.
|
||||
*
|
||||
* As Oniguruma supports some features that can't be emulated using native JavaScript regexes, some
|
||||
* patterns are not supported. Errors will be thrown when parsing TextMate grammars with
|
||||
* unsupported patterns, and when the grammar includes patterns that use invalid Oniguruma syntax.
|
||||
* Set `forgiving` to `true` to ignore these errors and skip any unsupported or invalid patterns.
|
||||
*/
|
||||
declare function createJavaScriptRegexEngine(options?: JavaScriptRegexEngineOptions): RegexEngine;
|
||||
|
||||
export { type JavaScriptRegexEngineOptions as J, type JavaScriptRegexScannerOptions as a, JavaScriptScanner as b, createJavaScriptRegexEngine as c, defaultJavaScriptRegexConstructor as d };
|
62
node_modules/@shikijs/engine-javascript/dist/shared/engine-javascript.DoNZS58X.d.ts
generated
vendored
Normal file
62
node_modules/@shikijs/engine-javascript/dist/shared/engine-javascript.DoNZS58X.d.ts
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
import { PatternScanner, RegexEngineString, RegexEngine } from '@shikijs/types';
|
||||
import { OnigurumaToEsOptions } from 'oniguruma-to-es';
|
||||
import { IOnigMatch } from '@shikijs/vscode-textmate';
|
||||
|
||||
interface JavaScriptRegexScannerOptions {
|
||||
/**
|
||||
* Whether to allow invalid regex patterns.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
forgiving?: boolean;
|
||||
/**
|
||||
* Cache for regex patterns.
|
||||
*/
|
||||
cache?: Map<string, RegExp | Error> | null;
|
||||
/**
|
||||
* Custom pattern to RegExp constructor.
|
||||
*
|
||||
* By default `oniguruma-to-es` is used.
|
||||
*/
|
||||
regexConstructor?: (pattern: string) => RegExp;
|
||||
}
|
||||
declare class JavaScriptScanner implements PatternScanner {
|
||||
patterns: (string | RegExp)[];
|
||||
options: JavaScriptRegexScannerOptions;
|
||||
regexps: (RegExp | null)[];
|
||||
constructor(patterns: (string | RegExp)[], options?: JavaScriptRegexScannerOptions);
|
||||
findNextMatchSync(string: string | RegexEngineString, startPosition: number, _options: number): IOnigMatch | null;
|
||||
}
|
||||
|
||||
interface JavaScriptRegexEngineOptions extends JavaScriptRegexScannerOptions {
|
||||
/**
|
||||
* The target ECMAScript version.
|
||||
*
|
||||
* Oniguruma-To-ES uses RegExp features from later versions of ECMAScript to add support for a
|
||||
* few more grammars. If using target `ES2024` or later, the RegExp `v` flag is used which
|
||||
* requires Node.js 20+ or Chrome 112+.
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicodeSets
|
||||
*
|
||||
* For maximum compatibility, you can set it to `ES2018` which uses the RegExp `u` flag.
|
||||
*
|
||||
* Set to `auto` to automatically detect the latest version supported by the environment.
|
||||
*
|
||||
* @default 'auto'
|
||||
*/
|
||||
target?: 'auto' | 'ES2025' | 'ES2024' | 'ES2018';
|
||||
}
|
||||
/**
|
||||
* The default regex constructor for the JavaScript RegExp engine.
|
||||
*/
|
||||
declare function defaultJavaScriptRegexConstructor(pattern: string, options?: OnigurumaToEsOptions): RegExp;
|
||||
/**
|
||||
* Use the modern JavaScript RegExp engine to implement the OnigScanner.
|
||||
*
|
||||
* As Oniguruma supports some features that can't be emulated using native JavaScript regexes, some
|
||||
* patterns are not supported. Errors will be thrown when parsing TextMate grammars with
|
||||
* unsupported patterns, and when the grammar includes patterns that use invalid Oniguruma syntax.
|
||||
* Set `forgiving` to `true` to ignore these errors and skip any unsupported or invalid patterns.
|
||||
*/
|
||||
declare function createJavaScriptRegexEngine(options?: JavaScriptRegexEngineOptions): RegexEngine;
|
||||
|
||||
export { type JavaScriptRegexEngineOptions as J, type JavaScriptRegexScannerOptions as a, JavaScriptScanner as b, createJavaScriptRegexEngine as c, defaultJavaScriptRegexConstructor as d };
|
93
node_modules/@shikijs/engine-javascript/dist/shared/engine-javascript.hzpS1_41.mjs
generated
vendored
Normal file
93
node_modules/@shikijs/engine-javascript/dist/shared/engine-javascript.hzpS1_41.mjs
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
const MAX = 4294967295;
|
||||
class JavaScriptScanner {
|
||||
constructor(patterns, options = {}) {
|
||||
this.patterns = patterns;
|
||||
this.options = options;
|
||||
const {
|
||||
forgiving = false,
|
||||
cache,
|
||||
regexConstructor
|
||||
} = options;
|
||||
if (!regexConstructor) {
|
||||
throw new Error("Option `regexConstructor` is not provided");
|
||||
}
|
||||
this.regexps = patterns.map((p) => {
|
||||
if (typeof p !== "string") {
|
||||
return p;
|
||||
}
|
||||
const cached = cache?.get(p);
|
||||
if (cached) {
|
||||
if (cached instanceof RegExp) {
|
||||
return cached;
|
||||
}
|
||||
if (forgiving)
|
||||
return null;
|
||||
throw cached;
|
||||
}
|
||||
try {
|
||||
const regex = regexConstructor(p);
|
||||
cache?.set(p, regex);
|
||||
return regex;
|
||||
} catch (e) {
|
||||
cache?.set(p, e);
|
||||
if (forgiving)
|
||||
return null;
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
}
|
||||
regexps;
|
||||
findNextMatchSync(string, startPosition, _options) {
|
||||
const str = typeof string === "string" ? string : string.content;
|
||||
const pending = [];
|
||||
function toResult(index, match, offset = 0) {
|
||||
return {
|
||||
index,
|
||||
captureIndices: match.indices.map((indice) => {
|
||||
if (indice == null) {
|
||||
return {
|
||||
start: MAX,
|
||||
end: MAX,
|
||||
length: 0
|
||||
};
|
||||
}
|
||||
return {
|
||||
start: indice[0] + offset,
|
||||
end: indice[1] + offset,
|
||||
length: indice[1] - indice[0]
|
||||
};
|
||||
})
|
||||
};
|
||||
}
|
||||
for (let i = 0; i < this.regexps.length; i++) {
|
||||
const regexp = this.regexps[i];
|
||||
if (!regexp)
|
||||
continue;
|
||||
try {
|
||||
regexp.lastIndex = startPosition;
|
||||
const match = regexp.exec(str);
|
||||
if (!match)
|
||||
continue;
|
||||
if (match.index === startPosition) {
|
||||
return toResult(i, match, 0);
|
||||
}
|
||||
pending.push([i, match, 0]);
|
||||
} catch (e) {
|
||||
if (this.options.forgiving)
|
||||
continue;
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
if (pending.length) {
|
||||
const minIndex = Math.min(...pending.map((m) => m[1].index));
|
||||
for (const [i, match, offset] of pending) {
|
||||
if (match.index === minIndex) {
|
||||
return toResult(i, match, offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export { JavaScriptScanner as J };
|
Reference in New Issue
Block a user