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:
becarta
2025-05-23 12:43:00 +02:00
parent f40db0f5c9
commit a544759a3b
11127 changed files with 1647032 additions and 0 deletions

1
node_modules/@astrojs/compiler/dist/shared/ast.cjs generated vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";var r=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var p=(t,e,d,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of i(e))!N.call(t,o)&&o!==d&&r(t,o,{get:()=>e[o],enumerable:!(n=a(e,o))||n.enumerable});return t};var s=t=>p(r({},"__esModule",{value:!0}),t);var m={};module.exports=s(m);

74
node_modules/@astrojs/compiler/dist/shared/ast.d.ts generated vendored Normal file
View File

@@ -0,0 +1,74 @@
type ParentNode = RootNode | ElementNode | ComponentNode | CustomElementNode | FragmentNode | ExpressionNode;
type LiteralNode = TextNode | DoctypeNode | CommentNode | FrontmatterNode;
type Node = RootNode | ElementNode | ComponentNode | CustomElementNode | FragmentNode | ExpressionNode | TextNode | FrontmatterNode | DoctypeNode | CommentNode;
interface Position {
start: Point;
end?: Point;
}
interface Point {
/** 1-based line number */
line: number;
/** 1-based column number, per-line */
column: number;
/** 0-based byte offset */
offset: number;
}
interface BaseNode {
type: string;
position?: Position;
}
interface ParentLikeNode extends BaseNode {
type: 'element' | 'component' | 'custom-element' | 'fragment' | 'expression' | 'root';
children: Node[];
}
interface ValueNode extends BaseNode {
value: string;
}
interface RootNode extends ParentLikeNode {
type: 'root';
}
interface AttributeNode extends BaseNode {
type: 'attribute';
kind: 'quoted' | 'empty' | 'expression' | 'spread' | 'shorthand' | 'template-literal';
name: string;
value: string;
raw?: string;
}
interface TextNode extends ValueNode {
type: 'text';
}
interface ElementNode extends ParentLikeNode {
type: 'element';
name: string;
attributes: AttributeNode[];
}
interface FragmentNode extends ParentLikeNode {
type: 'fragment';
name: string;
attributes: AttributeNode[];
}
interface ComponentNode extends ParentLikeNode {
type: 'component';
name: string;
attributes: AttributeNode[];
}
interface CustomElementNode extends ParentLikeNode {
type: 'custom-element';
name: string;
attributes: AttributeNode[];
}
type TagLikeNode = ElementNode | FragmentNode | ComponentNode | CustomElementNode;
interface DoctypeNode extends ValueNode {
type: 'doctype';
}
interface CommentNode extends ValueNode {
type: 'comment';
}
interface FrontmatterNode extends ValueNode {
type: 'frontmatter';
}
interface ExpressionNode extends ParentLikeNode {
type: 'expression';
}
export { AttributeNode, BaseNode, CommentNode, ComponentNode, CustomElementNode, DoctypeNode, ElementNode, ExpressionNode, FragmentNode, FrontmatterNode, LiteralNode, Node, ParentLikeNode, ParentNode, Point, Position, RootNode, TagLikeNode, TextNode, ValueNode };

0
node_modules/@astrojs/compiler/dist/shared/ast.js generated vendored Normal file
View File

View File

@@ -0,0 +1 @@
"use strict";var I=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var U=(E,N)=>{for(var _ in N)I(E,_,{get:N[_],enumerable:!0})},H=(E,N,_,A)=>{if(N&&typeof N=="object"||typeof N=="function")for(let T of G(N))!S.call(E,T)&&T!==_&&I(E,T,{get:()=>N[T],enumerable:!(A=M(N,T))||A.enumerable});return E};var W=E=>H(I({},"__esModule",{value:!0}),E);var P={};U(P,{DiagnosticCode:()=>O});module.exports=W(P);var O=(R=>(R[R.ERROR=1e3]="ERROR",R[R.ERROR_UNTERMINATED_JS_COMMENT=1001]="ERROR_UNTERMINATED_JS_COMMENT",R[R.ERROR_FRAGMENT_SHORTHAND_ATTRS=1002]="ERROR_FRAGMENT_SHORTHAND_ATTRS",R[R.ERROR_UNMATCHED_IMPORT=1003]="ERROR_UNMATCHED_IMPORT",R[R.ERROR_UNSUPPORTED_SLOT_ATTRIBUTE=1004]="ERROR_UNSUPPORTED_SLOT_ATTRIBUTE",R[R.WARNING=2e3]="WARNING",R[R.WARNING_UNTERMINATED_HTML_COMMENT=2001]="WARNING_UNTERMINATED_HTML_COMMENT",R[R.WARNING_UNCLOSED_HTML_TAG=2002]="WARNING_UNCLOSED_HTML_TAG",R[R.WARNING_DEPRECATED_DIRECTIVE=2003]="WARNING_DEPRECATED_DIRECTIVE",R[R.WARNING_IGNORED_DIRECTIVE=2004]="WARNING_IGNORED_DIRECTIVE",R[R.WARNING_UNSUPPORTED_EXPRESSION=2005]="WARNING_UNSUPPORTED_EXPRESSION",R[R.WARNING_SET_WITH_CHILDREN=2006]="WARNING_SET_WITH_CHILDREN",R[R.INFO=3e3]="INFO",R[R.HINT=4e3]="HINT",R))(O||{});0&&(module.exports={DiagnosticCode});

View File

@@ -0,0 +1,18 @@
declare enum DiagnosticCode {
ERROR = 1000,
ERROR_UNTERMINATED_JS_COMMENT = 1001,
ERROR_FRAGMENT_SHORTHAND_ATTRS = 1002,
ERROR_UNMATCHED_IMPORT = 1003,
ERROR_UNSUPPORTED_SLOT_ATTRIBUTE = 1004,
WARNING = 2000,
WARNING_UNTERMINATED_HTML_COMMENT = 2001,
WARNING_UNCLOSED_HTML_TAG = 2002,
WARNING_DEPRECATED_DIRECTIVE = 2003,
WARNING_IGNORED_DIRECTIVE = 2004,
WARNING_UNSUPPORTED_EXPRESSION = 2005,
WARNING_SET_WITH_CHILDREN = 2006,
INFO = 3000,
HINT = 4000
}
export { DiagnosticCode };

View File

@@ -0,0 +1 @@
var N=(R=>(R[R.ERROR=1e3]="ERROR",R[R.ERROR_UNTERMINATED_JS_COMMENT=1001]="ERROR_UNTERMINATED_JS_COMMENT",R[R.ERROR_FRAGMENT_SHORTHAND_ATTRS=1002]="ERROR_FRAGMENT_SHORTHAND_ATTRS",R[R.ERROR_UNMATCHED_IMPORT=1003]="ERROR_UNMATCHED_IMPORT",R[R.ERROR_UNSUPPORTED_SLOT_ATTRIBUTE=1004]="ERROR_UNSUPPORTED_SLOT_ATTRIBUTE",R[R.WARNING=2e3]="WARNING",R[R.WARNING_UNTERMINATED_HTML_COMMENT=2001]="WARNING_UNTERMINATED_HTML_COMMENT",R[R.WARNING_UNCLOSED_HTML_TAG=2002]="WARNING_UNCLOSED_HTML_TAG",R[R.WARNING_DEPRECATED_DIRECTIVE=2003]="WARNING_DEPRECATED_DIRECTIVE",R[R.WARNING_IGNORED_DIRECTIVE=2004]="WARNING_IGNORED_DIRECTIVE",R[R.WARNING_UNSUPPORTED_EXPRESSION=2005]="WARNING_UNSUPPORTED_EXPRESSION",R[R.WARNING_SET_WITH_CHILDREN=2006]="WARNING_SET_WITH_CHILDREN",R[R.INFO=3e3]="INFO",R[R.HINT=4e3]="HINT",R))(N||{});export{N as DiagnosticCode};

1
node_modules/@astrojs/compiler/dist/shared/types.cjs generated vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(r,t)=>{for(var n in t)o(r,n,{get:t[n],enumerable:!0})},g=(r,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of p(t))!c.call(r,e)&&e!==n&&o(r,e,{get:()=>t[e],enumerable:!(s=a(t,e))||s.enumerable});return r};var d=r=>g(o({},"__esModule",{value:!0}),r);var m={};l(m,{DiagnosticSeverity:()=>i});module.exports=d(m);var i=(e=>(e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Information=3]="Information",e[e.Hint=4]="Hint",e))(i||{});0&&(module.exports={DiagnosticSeverity});

160
node_modules/@astrojs/compiler/dist/shared/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,160 @@
import { RootNode } from './ast.js';
export { AttributeNode, BaseNode, CommentNode, ComponentNode, CustomElementNode, DoctypeNode, ElementNode, ExpressionNode, FragmentNode, FrontmatterNode, LiteralNode, Node, ParentLikeNode, ParentNode, Point, Position, TagLikeNode, TextNode, ValueNode } from './ast.js';
import { DiagnosticCode } from './diagnostics.js';
interface PreprocessorResult {
code: string;
map?: string;
}
interface PreprocessorError {
error: string;
}
interface ParseOptions {
position?: boolean;
}
declare enum DiagnosticSeverity {
Error = 1,
Warning = 2,
Information = 3,
Hint = 4
}
interface DiagnosticMessage {
severity: DiagnosticSeverity;
code: DiagnosticCode;
location: DiagnosticLocation;
hint?: string;
text: string;
}
interface DiagnosticLocation {
file: string;
line: number;
column: number;
length: number;
}
interface TransformOptions {
internalURL?: string;
filename?: string;
normalizedFilename?: string;
sourcemap?: boolean | 'inline' | 'external' | 'both';
astroGlobalArgs?: string;
compact?: boolean;
resultScopedSlot?: boolean;
scopedStyleStrategy?: 'where' | 'class' | 'attribute';
/**
* @deprecated "as" has been removed and no longer has any effect!
*/
as?: 'document' | 'fragment';
transitionsAnimationURL?: string;
resolvePath?: (specifier: string) => Promise<string> | string;
preprocessStyle?: (content: string, attrs: Record<string, string>) => null | Promise<PreprocessorResult | PreprocessorError>;
annotateSourceFile?: boolean;
/**
* Render script tags to be processed (e.g. script tags that have no attributes or only a `src` attribute)
* using a `renderScript` function from `internalURL`, instead of stripping the script entirely.
* @experimental
*/
renderScript?: boolean;
experimentalScriptOrder?: boolean;
}
type ConvertToTSXOptions = Pick<TransformOptions, 'filename' | 'normalizedFilename' | 'sourcemap'> & {
/** If set to true, script tags content will be included in the generated TSX
* Scripts will be wrapped in an arrow function to be compatible with JSX's spec
*/
includeScripts?: boolean;
/** If set to true, style tags content will be included in the generated TSX
* Styles will be wrapped in a template literal to be compatible with JSX's spec
*/
includeStyles?: boolean;
};
type HoistedScript = {
type: string;
} & ({
type: 'external';
src: string;
} | {
type: 'inline';
code: string;
map: string;
});
interface HydratedComponent {
exportName: string;
localName: string;
specifier: string;
resolvedPath: string;
}
interface TransformResult {
code: string;
map: string;
scope: string;
styleError: string[];
diagnostics: DiagnosticMessage[];
css: string[];
scripts: HoistedScript[];
hydratedComponents: HydratedComponent[];
clientOnlyComponents: HydratedComponent[];
serverComponents: HydratedComponent[];
containsHead: boolean;
propagation: boolean;
}
interface SourceMap {
file: string;
mappings: string;
names: string[];
sources: string[];
sourcesContent: string[];
version: number;
}
/**
* Represents a location in a TSX file.
* Both the `start` and `end` properties are 0-based, and are based off utf-16 code units. (i.e. JavaScript's `String.prototype.length`)
*/
interface TSXLocation {
start: number;
end: number;
}
interface TSXExtractedTag {
position: TSXLocation;
content: string;
}
interface TSXExtractedScript extends TSXExtractedTag {
type: 'processed-module' | 'module' | 'inline' | 'event-attribute' | 'json' | 'raw' | 'unknown';
}
interface TSXExtractedStyle extends TSXExtractedTag {
type: 'tag' | 'style-attribute';
lang: 'css' | 'scss' | 'sass' | 'less' | 'stylus' | 'styl' | 'postcss' | 'pcss' | 'unknown' | (string & {});
}
interface TSXResult {
code: string;
map: SourceMap;
diagnostics: DiagnosticMessage[];
metaRanges: {
frontmatter: TSXLocation;
body: TSXLocation;
scripts?: TSXExtractedScript[];
styles?: TSXExtractedStyle[];
};
}
interface ParseResult {
ast: RootNode;
diagnostics: DiagnosticMessage[];
}
declare function transform(input: string, options?: TransformOptions): Promise<TransformResult>;
declare function parse(input: string, options?: ParseOptions): Promise<ParseResult>;
declare function convertToTSX(input: string, options?: ConvertToTSXOptions): Promise<TSXResult>;
declare function initialize(options: InitializeOptions): Promise<void>;
/**
* When calling the core compiler APIs, e.g. `transform`, `parse`, etc, they
* would automatically instantiate a WASM instance to process the input. When
* done, you can call this to manually teardown the WASM instance.
*
* If the APIs are called again, they will automatically instantiate a new WASM
* instance. In browsers, you have to call `initialize()` again before using the APIs.
*
* Note: Calling teardown is optional and exists mostly as an optimization only.
*/
declare function teardown(): void;
interface InitializeOptions {
wasmURL?: string;
}
export { ConvertToTSXOptions, DiagnosticLocation, DiagnosticMessage, DiagnosticSeverity, HoistedScript, HydratedComponent, InitializeOptions, ParseOptions, ParseResult, PreprocessorError, PreprocessorResult, RootNode, SourceMap, TSXExtractedScript, TSXExtractedStyle, TSXExtractedTag, TSXLocation, TSXResult, TransformOptions, TransformResult, convertToTSX, initialize, parse, teardown, transform };

1
node_modules/@astrojs/compiler/dist/shared/types.js generated vendored Normal file
View File

@@ -0,0 +1 @@
var t=(e=>(e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Information=3]="Information",e[e.Hint=4]="Hint",e))(t||{});export{t as DiagnosticSeverity};