@vercube/core 0.0.43 → 0.0.46
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/dist/index.d.mts +266 -95
- package/dist/index.mjs +5 -73
- package/package.json +7 -7
package/dist/index.d.mts
CHANGED
|
@@ -21,7 +21,7 @@ declare class BasePlugin<T = unknown> {
|
|
|
21
21
|
use(app: App, options?: T): void | Promise<void>;
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
24
|
-
//#region ../../node_modules/.pnpm/rolldown@1.0.0-rc.
|
|
24
|
+
//#region ../../node_modules/.pnpm/rolldown@1.0.0-rc.12_@emnapi+core@1.9.0_@emnapi+runtime@1.9.0/node_modules/rolldown/dist/shared/logging-C6h4g8dA.d.mts
|
|
25
25
|
//#region src/log/logging.d.ts
|
|
26
26
|
/** @inline */
|
|
27
27
|
type LogLevel = "info" | "debug" | "warn";
|
|
@@ -71,7 +71,7 @@ interface RolldownError extends RolldownLog {
|
|
|
71
71
|
}
|
|
72
72
|
type LogOrStringHandler = (level: LogLevelWithError, log: RolldownLogWithString) => void; //#endregion
|
|
73
73
|
//#endregion
|
|
74
|
-
//#region ../../node_modules/.pnpm/@oxc-project+types@0.
|
|
74
|
+
//#region ../../node_modules/.pnpm/@oxc-project+types@0.122.0/node_modules/@oxc-project/types/types.d.ts
|
|
75
75
|
// Auto-generated code, DO NOT EDIT DIRECTLY!
|
|
76
76
|
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/typescript.rs`.
|
|
77
77
|
interface Program extends Span {
|
|
@@ -1357,20 +1357,20 @@ interface JSDocUnknownType extends Span {
|
|
|
1357
1357
|
type: "TSJSDocUnknownType";
|
|
1358
1358
|
parent?: Node;
|
|
1359
1359
|
}
|
|
1360
|
-
type
|
|
1361
|
-
type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "+" | "-" | "*" | "/" | "%" | "**" | "<<" | ">>" | ">>>" | "|" | "^" | "&" | "in" | "instanceof";
|
|
1362
|
-
type LogicalOperator = "||" | "&&" | "??";
|
|
1363
|
-
type UnaryOperator = "+" | "-" | "!" | "~" | "typeof" | "void" | "delete";
|
|
1364
|
-
type UpdateOperator = "++" | "--";
|
|
1360
|
+
type ModuleKind = "script" | "module" | "commonjs";
|
|
1365
1361
|
interface Span {
|
|
1366
1362
|
start: number;
|
|
1367
1363
|
end: number;
|
|
1368
1364
|
range?: [number, number];
|
|
1369
1365
|
}
|
|
1370
|
-
type
|
|
1366
|
+
type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "||=" | "&&=" | "??=";
|
|
1367
|
+
type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "+" | "-" | "*" | "/" | "%" | "**" | "<<" | ">>" | ">>>" | "|" | "^" | "&" | "in" | "instanceof";
|
|
1368
|
+
type LogicalOperator = "||" | "&&" | "??";
|
|
1369
|
+
type UnaryOperator = "+" | "-" | "!" | "~" | "typeof" | "void" | "delete";
|
|
1370
|
+
type UpdateOperator = "++" | "--";
|
|
1371
1371
|
type Node = Program | IdentifierName | IdentifierReference | BindingIdentifier | LabelIdentifier | ThisExpression | ArrayExpression | ObjectExpression | ObjectProperty | TemplateLiteral | TaggedTemplateExpression | TemplateElement | ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression | CallExpression | NewExpression | MetaProperty | SpreadElement | UpdateExpression | UnaryExpression | BinaryExpression | PrivateInExpression | LogicalExpression | ConditionalExpression | AssignmentExpression | ArrayAssignmentTarget | ObjectAssignmentTarget | AssignmentTargetRest | AssignmentTargetWithDefault | AssignmentTargetPropertyIdentifier | AssignmentTargetPropertyProperty | SequenceExpression | Super | AwaitExpression | ChainExpression | ParenthesizedExpression | Directive | Hashbang | BlockStatement | VariableDeclaration | VariableDeclarator | EmptyStatement | ExpressionStatement | IfStatement | DoWhileStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | ContinueStatement | BreakStatement | ReturnStatement | WithStatement | SwitchStatement | SwitchCase | LabeledStatement | ThrowStatement | TryStatement | CatchClause | DebuggerStatement | AssignmentPattern | ObjectPattern | BindingProperty | ArrayPattern | BindingRestElement | Function$1 | FunctionBody | ArrowFunctionExpression | YieldExpression | Class | ClassBody | MethodDefinition | PropertyDefinition | PrivateIdentifier | StaticBlock | AccessorProperty | ImportExpression | ImportDeclaration | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportAttribute | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration | ExportSpecifier | V8IntrinsicExpression | BooleanLiteral | NullLiteral | NumericLiteral | StringLiteral | BigIntLiteral | RegExpLiteral | JSXElement | JSXOpeningElement | JSXClosingElement | JSXFragment | JSXOpeningFragment | JSXClosingFragment | JSXNamespacedName | JSXMemberExpression | JSXExpressionContainer | JSXEmptyExpression | JSXAttribute | JSXSpreadAttribute | JSXIdentifier | JSXSpreadChild | JSXText | TSThisParameter | TSEnumDeclaration | TSEnumBody | TSEnumMember | TSTypeAnnotation | TSLiteralType | TSConditionalType | TSUnionType | TSIntersectionType | TSParenthesizedType | TSTypeOperator | TSArrayType | TSIndexedAccessType | TSTupleType | TSNamedTupleMember | TSOptionalType | TSRestType | TSAnyKeyword | TSStringKeyword | TSBooleanKeyword | TSNumberKeyword | TSNeverKeyword | TSIntrinsicKeyword | TSUnknownKeyword | TSNullKeyword | TSUndefinedKeyword | TSVoidKeyword | TSSymbolKeyword | TSThisType | TSObjectKeyword | TSBigIntKeyword | TSTypeReference | TSQualifiedName | TSTypeParameterInstantiation | TSTypeParameter | TSTypeParameterDeclaration | TSTypeAliasDeclaration | TSClassImplements | TSInterfaceDeclaration | TSInterfaceBody | TSPropertySignature | TSIndexSignature | TSCallSignatureDeclaration | TSMethodSignature | TSConstructSignatureDeclaration | TSIndexSignatureName | TSInterfaceHeritage | TSTypePredicate | TSModuleDeclaration | TSGlobalDeclaration | TSModuleBlock | TSTypeLiteral | TSInferType | TSTypeQuery | TSImportType | TSImportTypeQualifiedName | TSFunctionType | TSConstructorType | TSMappedType | TSTemplateLiteralType | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSImportEqualsDeclaration | TSExternalModuleReference | TSNonNullExpression | Decorator | TSExportAssignment | TSNamespaceExportDeclaration | TSInstantiationExpression | JSDocNullableType | JSDocNonNullableType | JSDocUnknownType | ParamPattern;
|
|
1372
1372
|
//#endregion
|
|
1373
|
-
//#region ../../node_modules/.pnpm/rolldown@1.0.0-rc.
|
|
1373
|
+
//#region ../../node_modules/.pnpm/rolldown@1.0.0-rc.12_@emnapi+core@1.9.0_@emnapi+runtime@1.9.0/node_modules/rolldown/dist/shared/binding-CYVfiOV3.d.mts
|
|
1374
1374
|
interface CodegenOptions {
|
|
1375
1375
|
/**
|
|
1376
1376
|
* Remove whitespace.
|
|
@@ -1465,7 +1465,7 @@ interface MangleOptions {
|
|
|
1465
1465
|
/**
|
|
1466
1466
|
* Pass `true` to mangle names declared in the top level scope.
|
|
1467
1467
|
*
|
|
1468
|
-
* @default false
|
|
1468
|
+
* @default true for modules and commonjs, otherwise false
|
|
1469
1469
|
*/
|
|
1470
1470
|
toplevel?: boolean;
|
|
1471
1471
|
/**
|
|
@@ -1876,20 +1876,6 @@ interface StyledComponentsOptions {
|
|
|
1876
1876
|
*/
|
|
1877
1877
|
topLevelImportPaths?: Array<string>;
|
|
1878
1878
|
}
|
|
1879
|
-
/**
|
|
1880
|
-
* Transpile a JavaScript or TypeScript into a target ECMAScript version, asynchronously.
|
|
1881
|
-
*
|
|
1882
|
-
* Note: This function can be slower than `transform` due to the overhead of spawning a thread.
|
|
1883
|
-
*
|
|
1884
|
-
* @param filename The name of the file being transformed. If this is a
|
|
1885
|
-
* relative path, consider setting the {@link TransformOptions#cwd} option.
|
|
1886
|
-
* @param sourceText the source code itself
|
|
1887
|
-
* @param options The options for the transformation. See {@link
|
|
1888
|
-
* TransformOptions} for more information.
|
|
1889
|
-
*
|
|
1890
|
-
* @returns a promise that resolves to an object containing the transformed code,
|
|
1891
|
-
* source maps, and any errors that occurred during parsing or transformation.
|
|
1892
|
-
*/
|
|
1893
1879
|
/**
|
|
1894
1880
|
* Options for transforming a JavaScript or TypeScript file.
|
|
1895
1881
|
*
|
|
@@ -2050,12 +2036,25 @@ declare class BindingDecodedMap {
|
|
|
2050
2036
|
* Each line is an array of segments, where each segment is [generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex?].
|
|
2051
2037
|
*/
|
|
2052
2038
|
get mappings(): Array<Array<Array<number>>>;
|
|
2039
|
+
/** The list of source indices that should be excluded from debugging. */
|
|
2040
|
+
get x_google_ignoreList(): Array<number> | null;
|
|
2053
2041
|
}
|
|
2054
2042
|
declare class BindingMagicString {
|
|
2055
2043
|
constructor(source: string, options?: BindingMagicStringOptions | undefined | null);
|
|
2044
|
+
get original(): string;
|
|
2056
2045
|
get filename(): string | null;
|
|
2046
|
+
get indentExclusionRanges(): Array<Array<number>> | Array<number> | null;
|
|
2047
|
+
get ignoreList(): boolean;
|
|
2048
|
+
get offset(): number;
|
|
2049
|
+
set offset(offset: number);
|
|
2057
2050
|
replace(from: string, to: string): this;
|
|
2058
2051
|
replaceAll(from: string, to: string): this;
|
|
2052
|
+
/**
|
|
2053
|
+
* Returns the UTF-16 offset past the last match, or -1 if no match was found.
|
|
2054
|
+
* The JS wrapper uses this to update `lastIndex` on the caller's RegExp.
|
|
2055
|
+
* Global/sticky behavior is derived from the regex's own flags.
|
|
2056
|
+
*/
|
|
2057
|
+
replaceRegex(from: RegExp, to: string): number;
|
|
2059
2058
|
prepend(content: string): this;
|
|
2060
2059
|
append(content: string): this;
|
|
2061
2060
|
prependLeft(index: number, content: string): this;
|
|
@@ -2076,7 +2075,7 @@ declare class BindingMagicString {
|
|
|
2076
2075
|
* Returns `this` for method chaining.
|
|
2077
2076
|
*/
|
|
2078
2077
|
move(start: number, end: number, index: number): this;
|
|
2079
|
-
indent(indentor?: string | undefined | null): this;
|
|
2078
|
+
indent(indentor?: string | undefined | null, options?: BindingIndentOptions | undefined | null): this;
|
|
2080
2079
|
/** Trims whitespace or specified characters from the start and end. */
|
|
2081
2080
|
trim(charType?: string | undefined | null): this;
|
|
2082
2081
|
/** Trims whitespace or specified characters from the start. */
|
|
@@ -2096,6 +2095,8 @@ declare class BindingMagicString {
|
|
|
2096
2095
|
lastChar(): string;
|
|
2097
2096
|
/** Returns the content after the last newline in the generated string. */
|
|
2098
2097
|
lastLine(): string;
|
|
2098
|
+
/** Returns the guessed indentation string, or `\t` if none is found. */
|
|
2099
|
+
getIndentString(): string;
|
|
2099
2100
|
/** Returns a clone with content outside the specified range removed. */
|
|
2100
2101
|
snip(start: number, end: number): BindingMagicString;
|
|
2101
2102
|
/**
|
|
@@ -2105,8 +2106,12 @@ declare class BindingMagicString {
|
|
|
2105
2106
|
*/
|
|
2106
2107
|
reset(start: number, end: number): this;
|
|
2107
2108
|
/**
|
|
2108
|
-
* Returns the content between the specified
|
|
2109
|
+
* Returns the content between the specified UTF-16 code unit positions (JS string indices).
|
|
2109
2110
|
* Supports negative indices (counting from the end).
|
|
2111
|
+
*
|
|
2112
|
+
* When an index falls in the middle of a surrogate pair, the lone surrogate is
|
|
2113
|
+
* included in the result (matching the original magic-string / JS behavior).
|
|
2114
|
+
* This is done by returning a UTF-16 encoded JS string via `napi_create_string_utf16`.
|
|
2110
2115
|
*/
|
|
2111
2116
|
slice(start?: number | undefined | null, end?: number | undefined | null): string;
|
|
2112
2117
|
/**
|
|
@@ -2150,16 +2155,18 @@ declare class BindingSourceMap {
|
|
|
2150
2155
|
get names(): Array<string>;
|
|
2151
2156
|
/** The VLQ-encoded mappings string. */
|
|
2152
2157
|
get mappings(): string;
|
|
2158
|
+
/** The list of source indices that should be excluded from debugging. */
|
|
2159
|
+
get x_google_ignoreList(): Array<number> | null;
|
|
2153
2160
|
/** Returns the source map as a JSON string. */
|
|
2154
2161
|
toString(): string;
|
|
2155
2162
|
/** Returns the source map as a base64-encoded data URL. */
|
|
2156
2163
|
toUrl(): string;
|
|
2157
2164
|
}
|
|
2158
2165
|
/**
|
|
2159
|
-
* Minimal wrapper around
|
|
2160
|
-
* This is returned from watcher event data to allow
|
|
2166
|
+
* Minimal wrapper around a `BundleHandle` for watcher events.
|
|
2167
|
+
* This is returned from watcher event data to allow calling `result.close()`.
|
|
2161
2168
|
*/
|
|
2162
|
-
type BindingBuiltinPluginName = 'builtin:esm-external-require' | 'builtin:isolated-declaration' | 'builtin:replace' | 'builtin:vite-alias' | 'builtin:vite-build-import-analysis' | 'builtin:vite-dynamic-import-vars' | 'builtin:vite-import-glob' | 'builtin:vite-json' | 'builtin:vite-load-fallback' | 'builtin:vite-manifest' | 'builtin:vite-module-preload-polyfill' | 'builtin:vite-react-refresh-wrapper' | 'builtin:vite-reporter' | 'builtin:vite-resolve' | 'builtin:vite-transform' | 'builtin:vite-wasm-fallback' | 'builtin:vite-
|
|
2169
|
+
type BindingBuiltinPluginName = 'builtin:bundle-analyzer' | 'builtin:esm-external-require' | 'builtin:isolated-declaration' | 'builtin:replace' | 'builtin:vite-alias' | 'builtin:vite-build-import-analysis' | 'builtin:vite-dynamic-import-vars' | 'builtin:vite-import-glob' | 'builtin:vite-json' | 'builtin:vite-load-fallback' | 'builtin:vite-manifest' | 'builtin:vite-module-preload-polyfill' | 'builtin:vite-react-refresh-wrapper' | 'builtin:vite-reporter' | 'builtin:vite-resolve' | 'builtin:vite-transform' | 'builtin:vite-wasm-fallback' | 'builtin:vite-web-worker-post' | 'builtin:oxc-runtime';
|
|
2163
2170
|
interface BindingHookResolveIdExtraArgs {
|
|
2164
2171
|
custom?: number;
|
|
2165
2172
|
isEntry: boolean;
|
|
@@ -2174,8 +2181,14 @@ interface BindingHookResolveIdExtraArgs {
|
|
|
2174
2181
|
*/
|
|
2175
2182
|
kind: 'import-statement' | 'dynamic-import' | 'require-call' | 'import-rule' | 'url-token' | 'new-url' | 'hot-accept';
|
|
2176
2183
|
}
|
|
2184
|
+
interface BindingIndentOptions {
|
|
2185
|
+
exclude?: Array<Array<number>> | Array<number>;
|
|
2186
|
+
}
|
|
2177
2187
|
interface BindingMagicStringOptions {
|
|
2178
2188
|
filename?: string;
|
|
2189
|
+
offset?: number;
|
|
2190
|
+
indentExclusionRanges?: Array<Array<number>> | Array<number>;
|
|
2191
|
+
ignoreList?: boolean;
|
|
2179
2192
|
}
|
|
2180
2193
|
interface BindingModules {
|
|
2181
2194
|
values: Array<BindingRenderedModule>;
|
|
@@ -2221,6 +2234,7 @@ interface ExternalMemoryStatus {
|
|
|
2221
2234
|
freed: boolean;
|
|
2222
2235
|
reason?: string;
|
|
2223
2236
|
}
|
|
2237
|
+
/** Error emitted from native side, it only contains kind and message, no stack trace. */
|
|
2224
2238
|
interface PreRenderedChunk {
|
|
2225
2239
|
/** The name of this chunk, which is used in naming patterns. */
|
|
2226
2240
|
name: string;
|
|
@@ -2239,7 +2253,7 @@ interface ViteImportGlobMeta {
|
|
|
2239
2253
|
isSubImportsPattern?: boolean;
|
|
2240
2254
|
} //#endregion
|
|
2241
2255
|
//#endregion
|
|
2242
|
-
//#region ../../node_modules/.pnpm/@rolldown+pluginutils@1.0.0-rc.
|
|
2256
|
+
//#region ../../node_modules/.pnpm/@rolldown+pluginutils@1.0.0-rc.12/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.d.ts
|
|
2243
2257
|
type StringOrRegExp$1 = string | RegExp;
|
|
2244
2258
|
type PluginModuleType = 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | (string & {});
|
|
2245
2259
|
type FilterExpression = And | Or | Not | Id | ImporterId | ModuleType$1 | Code | Query;
|
|
@@ -2301,7 +2315,7 @@ declare class Exclude$1 {
|
|
|
2301
2315
|
constructor(expr: FilterExpression);
|
|
2302
2316
|
}
|
|
2303
2317
|
//#endregion
|
|
2304
|
-
//#region ../../node_modules/.pnpm/rolldown@1.0.0-rc.
|
|
2318
|
+
//#region ../../node_modules/.pnpm/rolldown@1.0.0-rc.12_@emnapi+core@1.9.0_@emnapi+runtime@1.9.0/node_modules/rolldown/dist/shared/define-config-BkRKRADp.d.mts
|
|
2305
2319
|
//#region src/types/misc.d.ts
|
|
2306
2320
|
/** @inline */
|
|
2307
2321
|
type SourcemapPathTransformOption = (relativeSourcePath: string, sourcemapPath: string) => string;
|
|
@@ -2348,6 +2362,16 @@ interface ModuleInfo extends ModuleOptions {
|
|
|
2348
2362
|
* Whether this module is a user- or plugin-defined entry point.
|
|
2349
2363
|
*/
|
|
2350
2364
|
isEntry: boolean;
|
|
2365
|
+
/**
|
|
2366
|
+
* The detected format of the module, based on both its syntax and module definition
|
|
2367
|
+
* metadata (such as `package.json` `type` and file extensions like `.mjs`/`.cjs`/`.mts`/`.cts`).
|
|
2368
|
+
* - "esm" for ES modules (has `import`/`export` statements or is defined as ESM by module metadata)
|
|
2369
|
+
* - "cjs" for CommonJS modules (uses `module.exports`, `exports`, top-level `return`, or is defined as CommonJS by module metadata)
|
|
2370
|
+
* - "unknown" when the format could not be determined from either syntax or module definition metadata
|
|
2371
|
+
*
|
|
2372
|
+
* @experimental
|
|
2373
|
+
*/
|
|
2374
|
+
inputFormat: "es" | "cjs" | "unknown";
|
|
2351
2375
|
} //#endregion
|
|
2352
2376
|
//#region src/utils/asset-source.d.ts
|
|
2353
2377
|
/** @inline */
|
|
@@ -2598,6 +2622,20 @@ type CodeSplittingNameFunction = (moduleId: string, ctx: ChunkingContext) => str
|
|
|
2598
2622
|
/** @inline */
|
|
2599
2623
|
type CodeSplittingTestFunction = (id: string) => boolean | undefined | void;
|
|
2600
2624
|
type MinifyOptions = Omit<MinifyOptions$1, "module" | "sourcemap">;
|
|
2625
|
+
interface CommentsOptions {
|
|
2626
|
+
/**
|
|
2627
|
+
* Comments that contain `@license`, `@preserve` or start with `//!` or `/*!`
|
|
2628
|
+
*/
|
|
2629
|
+
legal?: boolean;
|
|
2630
|
+
/**
|
|
2631
|
+
* Comments that contain `@__PURE__`, `@__NO_SIDE_EFFECTS__` or `@vite-ignore`
|
|
2632
|
+
*/
|
|
2633
|
+
annotation?: boolean;
|
|
2634
|
+
/**
|
|
2635
|
+
* JSDoc comments
|
|
2636
|
+
*/
|
|
2637
|
+
jsdoc?: boolean;
|
|
2638
|
+
}
|
|
2601
2639
|
/** @inline */
|
|
2602
2640
|
interface ChunkingContext {
|
|
2603
2641
|
getModuleInfo(moduleId: string): ModuleInfo | null;
|
|
@@ -2645,7 +2683,7 @@ interface OutputOptions {
|
|
|
2645
2683
|
* - `'iife'` stands for [Immediately Invoked Function Expression](https://developer.mozilla.org/en-US/docs/Glossary/IIFE).
|
|
2646
2684
|
* - `'umd'` stands for [Universal Module Definition](https://github.com/umdjs/umd).
|
|
2647
2685
|
*
|
|
2648
|
-
* @default '
|
|
2686
|
+
* @default 'es'
|
|
2649
2687
|
*
|
|
2650
2688
|
*
|
|
2651
2689
|
*/
|
|
@@ -2726,6 +2764,16 @@ interface OutputOptions {
|
|
|
2726
2764
|
*/
|
|
2727
2765
|
sourcemapPathTransform?: SourcemapPathTransformOption;
|
|
2728
2766
|
/**
|
|
2767
|
+
* Whether to exclude the original source code from sourcemaps.
|
|
2768
|
+
*
|
|
2769
|
+
* When `true`, the `sourcesContent` field is omitted from the generated sourcemap,
|
|
2770
|
+
* reducing the sourcemap file size. The sourcemap will still contain source file paths
|
|
2771
|
+
* and mappings, so debugging works if the original files are available.
|
|
2772
|
+
*
|
|
2773
|
+
* @default false
|
|
2774
|
+
*/
|
|
2775
|
+
sourcemapExcludeSources?: boolean;
|
|
2776
|
+
/**
|
|
2729
2777
|
* A string to prepend to the bundle before {@linkcode Plugin.renderChunk | renderChunk} hook.
|
|
2730
2778
|
*
|
|
2731
2779
|
* See {@linkcode intro | output.intro}, {@linkcode postBanner | output.postBanner} as well.
|
|
@@ -2843,18 +2891,6 @@ interface OutputOptions {
|
|
|
2843
2891
|
*/
|
|
2844
2892
|
chunkFileNames?: string | ChunkFileNamesFunction;
|
|
2845
2893
|
/**
|
|
2846
|
-
* @default '[name].css'
|
|
2847
|
-
* @experimental
|
|
2848
|
-
* @hidden not ready for public usage yet
|
|
2849
|
-
*/
|
|
2850
|
-
cssEntryFileNames?: string | ChunkFileNamesFunction;
|
|
2851
|
-
/**
|
|
2852
|
-
* @default '[name]-[hash].css'
|
|
2853
|
-
* @experimental
|
|
2854
|
-
* @hidden not ready for public usage yet
|
|
2855
|
-
*/
|
|
2856
|
-
cssChunkFileNames?: string | ChunkFileNamesFunction;
|
|
2857
|
-
/**
|
|
2858
2894
|
* Whether to enable chunk name sanitization (removal of non-URL-safe characters like `\0`, `?` and `*`).
|
|
2859
2895
|
*
|
|
2860
2896
|
* Set `false` to disable the sanitization. You can also provide a custom sanitization function.
|
|
@@ -2868,11 +2904,11 @@ interface OutputOptions {
|
|
|
2868
2904
|
* Rolldown uses Oxc Minifier under the hood. See Oxc's [minification documentation](https://oxc.rs/docs/guide/usage/minifier#features) for more details.
|
|
2869
2905
|
*
|
|
2870
2906
|
* - `true`: Enable full minification including code compression and dead code elimination
|
|
2871
|
-
* - `false`: Disable minification
|
|
2872
|
-
* - `'dce-only'`: Only perform dead code elimination without code compression
|
|
2907
|
+
* - `false`: Disable minification
|
|
2908
|
+
* - `'dce-only'`: Only perform dead code elimination without code compression (default)
|
|
2873
2909
|
* - `MinifyOptions`: Fine-grained control over minification settings
|
|
2874
2910
|
*
|
|
2875
|
-
* @default
|
|
2911
|
+
* @default 'dce-only'
|
|
2876
2912
|
*/
|
|
2877
2913
|
minify?: boolean | "dce-only" | MinifyOptions;
|
|
2878
2914
|
/**
|
|
@@ -3048,6 +3084,8 @@ interface OutputOptions {
|
|
|
3048
3084
|
*
|
|
3049
3085
|
* For deeper understanding, please refer to the in-depth [documentation](https://rolldown.rs/in-depth/manual-code-splitting).
|
|
3050
3086
|
*
|
|
3087
|
+
*
|
|
3088
|
+
*
|
|
3051
3089
|
* @example
|
|
3052
3090
|
* **Basic vendor chunk**
|
|
3053
3091
|
* ```js
|
|
@@ -3089,13 +3127,32 @@ interface OutputOptions {
|
|
|
3089
3127
|
groups?: CodeSplittingGroup[];
|
|
3090
3128
|
};
|
|
3091
3129
|
/**
|
|
3092
|
-
*
|
|
3130
|
+
* Controls how legal comments are preserved in the output.
|
|
3093
3131
|
*
|
|
3094
|
-
* - `none`: no comments
|
|
3095
|
-
* - `inline`: preserve comments that contain `@license`, `@preserve` or starts with `//!` `/*!`
|
|
3132
|
+
* - `none`: no legal comments
|
|
3133
|
+
* - `inline`: preserve legal comments that contain `@license`, `@preserve` or starts with `//!` `/*!`
|
|
3134
|
+
*
|
|
3135
|
+
* @deprecated Use `comments.legal` instead. When both `legalComments` and `comments.legal` are set, `comments.legal` takes priority.
|
|
3096
3136
|
*/
|
|
3097
3137
|
legalComments?: "none" | "inline";
|
|
3098
3138
|
/**
|
|
3139
|
+
* Control which comments are preserved in the output.
|
|
3140
|
+
*
|
|
3141
|
+
* - `true`: Preserve legal, annotation, and JSDoc comments (default)
|
|
3142
|
+
* - `false`: Strip all comments
|
|
3143
|
+
* - Object: Granular control over comment categories
|
|
3144
|
+
*
|
|
3145
|
+
* Note: Regular line and block comments without these markers
|
|
3146
|
+
* are always removed regardless of this option.
|
|
3147
|
+
*
|
|
3148
|
+
* When both `legalComments` and `comments.legal` are set, `comments.legal` takes priority.
|
|
3149
|
+
*
|
|
3150
|
+
*
|
|
3151
|
+
*
|
|
3152
|
+
* @default true
|
|
3153
|
+
*/
|
|
3154
|
+
comments?: boolean | CommentsOptions;
|
|
3155
|
+
/**
|
|
3099
3156
|
* The list of plugins to use only for this output.
|
|
3100
3157
|
*
|
|
3101
3158
|
* @see {@linkcode InputOptions.plugins | plugins}
|
|
@@ -3183,6 +3240,18 @@ interface OutputOptions {
|
|
|
3183
3240
|
* @default false
|
|
3184
3241
|
*/
|
|
3185
3242
|
strictExecutionOrder?: boolean;
|
|
3243
|
+
/**
|
|
3244
|
+
* Whether to always output `"use strict"` directive in non-ES module outputs.
|
|
3245
|
+
*
|
|
3246
|
+
* - `true` - Always emit `"use strict"` at the top of the output (not applicable for ESM format since ESM is always strict).
|
|
3247
|
+
* - `false` - Never emit `"use strict"` in the output.
|
|
3248
|
+
* - `'auto'` - Respect the `"use strict"` directives from the source code.
|
|
3249
|
+
*
|
|
3250
|
+
* See [In-depth directive guide](https://rolldown.rs/in-depth/directives) for more details.
|
|
3251
|
+
*
|
|
3252
|
+
* @default 'auto'
|
|
3253
|
+
*/
|
|
3254
|
+
strict?: boolean | "auto";
|
|
3186
3255
|
}
|
|
3187
3256
|
type CodeSplittingGroup = {
|
|
3188
3257
|
/**
|
|
@@ -3317,6 +3386,36 @@ type CodeSplittingGroup = {
|
|
|
3317
3386
|
* @default 0
|
|
3318
3387
|
*/
|
|
3319
3388
|
minModuleSize?: number;
|
|
3389
|
+
/**
|
|
3390
|
+
* When `false` (default), all matching modules are merged into a single chunk.
|
|
3391
|
+
* Every entry that uses any of these modules must load the entire chunk — even
|
|
3392
|
+
* modules it doesn't need.
|
|
3393
|
+
*
|
|
3394
|
+
* When `true`, matching modules are grouped by which entries actually import them.
|
|
3395
|
+
* Modules shared by the same set of entries go into the same chunk, while modules
|
|
3396
|
+
* shared by a different set go into a separate chunk. This way, each entry only
|
|
3397
|
+
* loads the code it actually uses.
|
|
3398
|
+
*
|
|
3399
|
+
* Example: entries A, B, C all match a `"vendor"` group.
|
|
3400
|
+
* - `moduleX` is used by A, B, C
|
|
3401
|
+
* - `moduleY` is used by A, B only
|
|
3402
|
+
*
|
|
3403
|
+
* With `entriesAware: false` → one `vendor.js` chunk with both modules; C loads `moduleY` unnecessarily.
|
|
3404
|
+
* With `entriesAware: true` → `vendor.js` (moduleX, loaded by all) + `vendor2.js` (moduleY, loaded by A and B only).
|
|
3405
|
+
*
|
|
3406
|
+
* @default false
|
|
3407
|
+
*/
|
|
3408
|
+
entriesAware?: boolean;
|
|
3409
|
+
/**
|
|
3410
|
+
* Size threshold in bytes for merging small `entriesAware` subgroups into the
|
|
3411
|
+
* closest neighboring subgroup.
|
|
3412
|
+
*
|
|
3413
|
+
* This option only works when {@linkcode CodeSplittingGroup.entriesAware | entriesAware}
|
|
3414
|
+
* is `true`. Set to `0` to disable subgroup merging.
|
|
3415
|
+
*
|
|
3416
|
+
* @default 0
|
|
3417
|
+
*/
|
|
3418
|
+
entriesAwareMergeThreshold?: number;
|
|
3320
3419
|
};
|
|
3321
3420
|
/**
|
|
3322
3421
|
* Alias for {@linkcode CodeSplittingGroup}. Use this type for the `codeSplitting.groups` option.
|
|
@@ -3370,6 +3469,24 @@ type CodeSplittingOptions = {
|
|
|
3370
3469
|
* @deprecated Please use {@linkcode CodeSplittingOptions} instead.
|
|
3371
3470
|
*/
|
|
3372
3471
|
//#endregion
|
|
3472
|
+
//#region src/binding-magic-string.d.ts
|
|
3473
|
+
interface RolldownMagicString extends BindingMagicString {
|
|
3474
|
+
readonly isRolldownMagicString: true;
|
|
3475
|
+
/** Accepts a string or RegExp pattern. RegExp supports `$&`, `$$`, and `$N` substitutions. */
|
|
3476
|
+
replace(from: string | RegExp, to: string): this;
|
|
3477
|
+
/** Accepts a string or RegExp pattern. RegExp must have the global (`g`) flag. */
|
|
3478
|
+
replaceAll(from: string | RegExp, to: string): this;
|
|
3479
|
+
}
|
|
3480
|
+
type RolldownMagicStringConstructor = Omit<typeof BindingMagicString, "prototype"> & {
|
|
3481
|
+
new (...args: ConstructorParameters<typeof BindingMagicString>): RolldownMagicString;
|
|
3482
|
+
prototype: RolldownMagicString;
|
|
3483
|
+
};
|
|
3484
|
+
/**
|
|
3485
|
+
* A native MagicString implementation powered by Rust.
|
|
3486
|
+
*
|
|
3487
|
+
* @experimental
|
|
3488
|
+
*/
|
|
3489
|
+
declare const RolldownMagicString: RolldownMagicStringConstructor; //#endregion
|
|
3373
3490
|
//#region src/log/log-handler.d.ts
|
|
3374
3491
|
type LoggingFunction = (log: RolldownLog | string | (() => RolldownLog | string)) => void;
|
|
3375
3492
|
type LoggingFunctionWithPosition = (log: RolldownLog | string | (() => RolldownLog | string), pos?: number | {
|
|
@@ -3512,6 +3629,11 @@ interface ChecksOptions {
|
|
|
3512
3629
|
* @default true
|
|
3513
3630
|
* */
|
|
3514
3631
|
unsupportedTsconfigOption?: boolean;
|
|
3632
|
+
/**
|
|
3633
|
+
* Whether to emit warnings when a module is dynamically imported but also statically imported, making the dynamic import ineffective for code splitting.
|
|
3634
|
+
* @default true
|
|
3635
|
+
* */
|
|
3636
|
+
ineffectiveDynamicImport?: boolean;
|
|
3515
3637
|
} //#endregion
|
|
3516
3638
|
//#region src/options/transform-options.d.ts
|
|
3517
3639
|
interface TransformOptions extends Omit<TransformOptions$1, "sourceType" | "lang" | "cwd" | "sourcemap" | "define" | "inject" | "jsx"> {
|
|
@@ -3638,6 +3760,8 @@ interface NormalizedInputOptions {
|
|
|
3638
3760
|
shimMissingExports: boolean;
|
|
3639
3761
|
/** @see {@linkcode InputOptions.context | context} */
|
|
3640
3762
|
context: string;
|
|
3763
|
+
/** @see {@linkcode InputOptions.plugins | plugins} */
|
|
3764
|
+
plugins: RolldownPlugin[];
|
|
3641
3765
|
} //#endregion
|
|
3642
3766
|
//#region src/options/normalized-output-options.d.ts
|
|
3643
3767
|
type PathsFunction = (id: string) => string;
|
|
@@ -3668,10 +3792,6 @@ interface NormalizedOutputOptions {
|
|
|
3668
3792
|
sourcemap: boolean | "inline" | "hidden";
|
|
3669
3793
|
/** @see {@linkcode OutputOptions.sourcemapBaseUrl | sourcemapBaseUrl} */
|
|
3670
3794
|
sourcemapBaseUrl: string | undefined;
|
|
3671
|
-
/** @see {@linkcode OutputOptions.cssEntryFileNames | cssEntryFileNames} */
|
|
3672
|
-
cssEntryFileNames: string | ChunkFileNamesFunction;
|
|
3673
|
-
/** @see {@linkcode OutputOptions.cssChunkFileNames | cssChunkFileNames} */
|
|
3674
|
-
cssChunkFileNames: string | ChunkFileNamesFunction;
|
|
3675
3795
|
/** @see {@linkcode OutputOptions.codeSplitting | codeSplitting} */
|
|
3676
3796
|
codeSplitting: boolean;
|
|
3677
3797
|
/** @deprecated Use `codeSplitting` instead. */
|
|
@@ -3704,14 +3824,21 @@ interface NormalizedOutputOptions {
|
|
|
3704
3824
|
hashCharacters: "base64" | "base36" | "hex";
|
|
3705
3825
|
/** @see {@linkcode OutputOptions.sourcemapDebugIds | sourcemapDebugIds} */
|
|
3706
3826
|
sourcemapDebugIds: boolean;
|
|
3827
|
+
/** @see {@linkcode OutputOptions.sourcemapExcludeSources | sourcemapExcludeSources} */
|
|
3828
|
+
sourcemapExcludeSources: boolean;
|
|
3707
3829
|
/** @see {@linkcode OutputOptions.sourcemapIgnoreList | sourcemapIgnoreList} */
|
|
3708
3830
|
sourcemapIgnoreList: boolean | SourcemapIgnoreListOption | StringOrRegExp | undefined;
|
|
3709
3831
|
/** @see {@linkcode OutputOptions.sourcemapPathTransform | sourcemapPathTransform} */
|
|
3710
3832
|
sourcemapPathTransform: SourcemapPathTransformOption | undefined;
|
|
3711
3833
|
/** @see {@linkcode OutputOptions.minify | minify} */
|
|
3712
3834
|
minify: false | MinifyOptions | "dce-only";
|
|
3713
|
-
/**
|
|
3835
|
+
/**
|
|
3836
|
+
* @deprecated Use `comments.legal` instead.
|
|
3837
|
+
* @see {@linkcode OutputOptions.legalComments | legalComments}
|
|
3838
|
+
*/
|
|
3714
3839
|
legalComments: "none" | "inline";
|
|
3840
|
+
/** @see {@linkcode OutputOptions.comments | comments} */
|
|
3841
|
+
comments: Required<CommentsOptions>;
|
|
3715
3842
|
/** @see {@linkcode OutputOptions.polyfillRequire | polyfillRequire} */
|
|
3716
3843
|
polyfillRequire: boolean;
|
|
3717
3844
|
/** @see {@linkcode OutputOptions.plugins | plugins} */
|
|
@@ -3880,8 +4007,6 @@ interface PluginContextMeta {
|
|
|
3880
4007
|
}
|
|
3881
4008
|
/** @category Plugin APIs */
|
|
3882
4009
|
interface MinimalPluginContext {
|
|
3883
|
-
/** @hidden */
|
|
3884
|
-
readonly pluginName: string;
|
|
3885
4010
|
/**
|
|
3886
4011
|
* Similar to {@linkcode warn | this.warn}, except that it will also abort
|
|
3887
4012
|
* the bundling process with an error.
|
|
@@ -4328,7 +4453,7 @@ type TreeshakingOptions = {
|
|
|
4328
4453
|
*
|
|
4329
4454
|
* See [related Oxc documentation](https://oxc.rs/docs/guide/usage/minifier/dead-code-elimination#ignoring-invalid-import-statement-side-effects) for more details.
|
|
4330
4455
|
*
|
|
4331
|
-
* @default
|
|
4456
|
+
* @default false
|
|
4332
4457
|
*/
|
|
4333
4458
|
invalidImportSideEffects?: boolean;
|
|
4334
4459
|
/**
|
|
@@ -4388,12 +4513,9 @@ interface ExistingRawSourceMap {
|
|
|
4388
4513
|
}
|
|
4389
4514
|
/** @inline @category Plugin APIs */
|
|
4390
4515
|
type SourceMapInput = ExistingRawSourceMap | string | null; //#endregion
|
|
4391
|
-
//#region src/
|
|
4516
|
+
//#region src/utils/error.d.ts
|
|
4392
4517
|
/**
|
|
4393
|
-
* The
|
|
4394
|
-
* @example `'1.0.0'`
|
|
4395
|
-
*
|
|
4396
|
-
* @category Plugin APIs
|
|
4518
|
+
* The error type that is thrown by Rolldown for the whole build.
|
|
4397
4519
|
*/
|
|
4398
4520
|
//#endregion
|
|
4399
4521
|
//#region src/builtin-plugin/utils.d.ts
|
|
@@ -4536,7 +4658,7 @@ type ResolveIdResult = string | NullValue | false | PartialResolvedId;
|
|
|
4536
4658
|
type LoadResult = NullValue | string | SourceDescription;
|
|
4537
4659
|
/** @inline @category Plugin APIs */
|
|
4538
4660
|
type TransformResult = NullValue | string | (Omit<SourceDescription, "code"> & {
|
|
4539
|
-
code?: string |
|
|
4661
|
+
code?: string | RolldownMagicString;
|
|
4540
4662
|
});
|
|
4541
4663
|
type RenderedChunkMeta = {
|
|
4542
4664
|
/**
|
|
@@ -4549,7 +4671,7 @@ type RenderedChunkMeta = {
|
|
|
4549
4671
|
* Use this to perform string transformations with automatic source map support.
|
|
4550
4672
|
* This is only available when `experimental.nativeMagicString` is enabled.
|
|
4551
4673
|
*/
|
|
4552
|
-
magicString?:
|
|
4674
|
+
magicString?: RolldownMagicString;
|
|
4553
4675
|
};
|
|
4554
4676
|
/** @category Plugin APIs */
|
|
4555
4677
|
interface FunctionPluginHooks {
|
|
@@ -4650,11 +4772,13 @@ interface FunctionPluginHooks {
|
|
|
4650
4772
|
*
|
|
4651
4773
|
* You can use {@linkcode PluginContext.getModuleInfo | this.getModuleInfo()} to find out the previous values of `meta`, `moduleSideEffects` inside this hook.
|
|
4652
4774
|
*
|
|
4775
|
+
*
|
|
4776
|
+
*
|
|
4653
4777
|
* @group Build Hooks
|
|
4654
4778
|
*/
|
|
4655
4779
|
[DEFINED_HOOK_NAMES.transform]: (this: TransformPluginContext, code: string, id: string, meta: BindingTransformHookExtraArgs & {
|
|
4656
4780
|
moduleType: ModuleType;
|
|
4657
|
-
magicString?:
|
|
4781
|
+
magicString?: RolldownMagicString;
|
|
4658
4782
|
ast?: Program;
|
|
4659
4783
|
}) => TransformResult;
|
|
4660
4784
|
/**
|
|
@@ -4707,8 +4831,8 @@ interface FunctionPluginHooks {
|
|
|
4707
4831
|
*
|
|
4708
4832
|
* @group Output Generation Hooks
|
|
4709
4833
|
*/
|
|
4710
|
-
[DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions, meta: RenderedChunkMeta) => NullValue | string |
|
|
4711
|
-
code: string |
|
|
4834
|
+
[DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions, meta: RenderedChunkMeta) => NullValue | string | RolldownMagicString | {
|
|
4835
|
+
code: string | RolldownMagicString;
|
|
4712
4836
|
map?: SourceMapInput;
|
|
4713
4837
|
};
|
|
4714
4838
|
/**
|
|
@@ -4910,7 +5034,53 @@ type InputOption = string | string[] | Record<string, string>;
|
|
|
4910
5034
|
type ExternalOptionFunction = (id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>;
|
|
4911
5035
|
/** @inline */
|
|
4912
5036
|
type ExternalOption = StringOrRegExp | StringOrRegExp[] | ExternalOptionFunction;
|
|
4913
|
-
type ModuleTypes = Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css" | "asset">;
|
|
5037
|
+
type ModuleTypes = Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css" | "asset" | "copy">;
|
|
5038
|
+
interface WatcherFileWatcherOptions {
|
|
5039
|
+
/**
|
|
5040
|
+
* Whether to use polling-based file watching instead of native OS events.
|
|
5041
|
+
*
|
|
5042
|
+
* Polling is useful for environments where native FS events are unreliable,
|
|
5043
|
+
* such as network mounts, Docker volumes, or WSL2.
|
|
5044
|
+
*
|
|
5045
|
+
* @default false
|
|
5046
|
+
*/
|
|
5047
|
+
usePolling?: boolean;
|
|
5048
|
+
/**
|
|
5049
|
+
* Interval between each poll in milliseconds.
|
|
5050
|
+
*
|
|
5051
|
+
* This option is only used when {@linkcode usePolling} is `true`.
|
|
5052
|
+
*
|
|
5053
|
+
* @default 100
|
|
5054
|
+
*/
|
|
5055
|
+
pollInterval?: number;
|
|
5056
|
+
/**
|
|
5057
|
+
* Whether to compare file contents for poll-based watchers.
|
|
5058
|
+
* When enabled, poll watchers will check file contents to determine if they actually changed.
|
|
5059
|
+
*
|
|
5060
|
+
* This option is only used when {@linkcode usePolling} is `true`.
|
|
5061
|
+
*
|
|
5062
|
+
* @default false
|
|
5063
|
+
*/
|
|
5064
|
+
compareContentsForPolling?: boolean;
|
|
5065
|
+
/**
|
|
5066
|
+
* Whether to use debounced event delivery at the filesystem level.
|
|
5067
|
+
* This coalesces rapid filesystem events before they reach the build coordinator.
|
|
5068
|
+
* @default false
|
|
5069
|
+
*/
|
|
5070
|
+
useDebounce?: boolean;
|
|
5071
|
+
/**
|
|
5072
|
+
* Debounce delay in milliseconds for fs-level debounced watchers.
|
|
5073
|
+
* Only used when {@linkcode useDebounce} is `true`.
|
|
5074
|
+
* @default 10
|
|
5075
|
+
*/
|
|
5076
|
+
debounceDelay?: number;
|
|
5077
|
+
/**
|
|
5078
|
+
* Tick rate in milliseconds for the debouncer's internal polling.
|
|
5079
|
+
* Only used when {@linkcode useDebounce} is `true`.
|
|
5080
|
+
* When undefined, auto-selects 1/4 of debounceDelay.
|
|
5081
|
+
*/
|
|
5082
|
+
debounceTickRate?: number;
|
|
5083
|
+
}
|
|
4914
5084
|
interface WatcherOptions {
|
|
4915
5085
|
/**
|
|
4916
5086
|
* Whether to skip the {@linkcode RolldownBuild.write | bundle.write()} step when a rebuild is triggered.
|
|
@@ -4936,32 +5106,13 @@ interface WatcherOptions {
|
|
|
4936
5106
|
*/
|
|
4937
5107
|
buildDelay?: number;
|
|
4938
5108
|
/**
|
|
4939
|
-
*
|
|
5109
|
+
* File watcher options for configuring how file changes are detected.
|
|
4940
5110
|
*/
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
*
|
|
4947
|
-
* @default 30_000
|
|
4948
|
-
*/
|
|
4949
|
-
pollInterval?: number;
|
|
4950
|
-
/**
|
|
4951
|
-
* Whether to compare file contents when checking for changes.
|
|
4952
|
-
*
|
|
4953
|
-
* This is especially important for pseudo filesystems like those on Linux
|
|
4954
|
-
* under `/sys` and `/proc` which are not obligated to respect any other
|
|
4955
|
-
* filesystem norms such as modification timestamps, file sizes, etc. By
|
|
4956
|
-
* enabling this feature, performance will be significantly impacted as
|
|
4957
|
-
* all files will need to be read and hashed at each interval.
|
|
4958
|
-
*
|
|
4959
|
-
* This option is only used when polling backend is used.
|
|
4960
|
-
*
|
|
4961
|
-
* @default false
|
|
4962
|
-
*/
|
|
4963
|
-
compareContents?: boolean;
|
|
4964
|
-
};
|
|
5111
|
+
watcher?: WatcherFileWatcherOptions;
|
|
5112
|
+
/**
|
|
5113
|
+
* @deprecated Use {@linkcode watcher} instead.
|
|
5114
|
+
*/
|
|
5115
|
+
notify?: WatcherFileWatcherOptions;
|
|
4965
5116
|
/**
|
|
4966
5117
|
* Filter to limit the file-watching to certain files.
|
|
4967
5118
|
*
|
|
@@ -5063,7 +5214,7 @@ type OptimizationOptions = {
|
|
|
5063
5214
|
* console.log(API_URL);
|
|
5064
5215
|
* ```
|
|
5065
5216
|
*
|
|
5066
|
-
* @default
|
|
5217
|
+
* @default { mode: 'smart', pass: 1 }
|
|
5067
5218
|
*/
|
|
5068
5219
|
inlineConst?: boolean | {
|
|
5069
5220
|
mode?: "all" | "smart";
|
|
@@ -5533,6 +5684,8 @@ interface InputOptions {
|
|
|
5533
5684
|
*
|
|
5534
5685
|
* These options only take effect when running with the [`--watch`](/apis/cli#w-watch) flag, or using {@linkcode watch | watch()} API.
|
|
5535
5686
|
*
|
|
5687
|
+
*
|
|
5688
|
+
*
|
|
5536
5689
|
* @experimental
|
|
5537
5690
|
*/
|
|
5538
5691
|
watch?: WatcherOptions | false;
|
|
@@ -5592,6 +5745,14 @@ interface InputOptions {
|
|
|
5592
5745
|
tsconfig?: boolean | string;
|
|
5593
5746
|
} //#endregion
|
|
5594
5747
|
//#region src/types/rolldown-options.d.ts
|
|
5748
|
+
interface RolldownOptions extends InputOptions {
|
|
5749
|
+
output?: OutputOptions | OutputOptions[];
|
|
5750
|
+
} //#endregion
|
|
5751
|
+
//#region src/utils/define-config.d.ts
|
|
5752
|
+
/**
|
|
5753
|
+
* Type for `default export` of `rolldown.config.js` file.
|
|
5754
|
+
* @category Config
|
|
5755
|
+
*/
|
|
5595
5756
|
//#endregion
|
|
5596
5757
|
//#region src/Types/ConfigTypes.d.ts
|
|
5597
5758
|
/**
|
|
@@ -5627,6 +5788,8 @@ declare namespace ConfigTypes {
|
|
|
5627
5788
|
entry?: string | string[];
|
|
5628
5789
|
/**
|
|
5629
5790
|
* Defines to pass to the build.
|
|
5791
|
+
* @deprecated Use `rolldownConfig.transform.define` instead.
|
|
5792
|
+
* This field is still applied via the base config but will be removed in a future release.
|
|
5630
5793
|
*/
|
|
5631
5794
|
define?: Record<string, string>;
|
|
5632
5795
|
/**
|
|
@@ -5639,6 +5802,8 @@ declare namespace ConfigTypes {
|
|
|
5639
5802
|
dts?: boolean;
|
|
5640
5803
|
/**
|
|
5641
5804
|
* Additional plugins to use in the bundler.
|
|
5805
|
+
* @deprecated Use `rolldownConfig.plugins` instead.
|
|
5806
|
+
* This field is still applied via the base config but will be removed in a future release.
|
|
5642
5807
|
*/
|
|
5643
5808
|
plugins?: RolldownPluginOption[];
|
|
5644
5809
|
/**
|
|
@@ -5658,6 +5823,12 @@ declare namespace ConfigTypes {
|
|
|
5658
5823
|
* The bundler to use for the application build.
|
|
5659
5824
|
*/
|
|
5660
5825
|
bundler?: 'rolldown';
|
|
5826
|
+
/**
|
|
5827
|
+
* Additional options passed directly to the rolldown bundler.
|
|
5828
|
+
* These options are deep-merged with the base config using `defu`, meaning values provided here take precedence over the defaults.
|
|
5829
|
+
* The `input`, `output`, and `onwarn` fields are managed internally and cannot be overridden here.
|
|
5830
|
+
*/
|
|
5831
|
+
rolldownConfig?: Omit<RolldownOptions, 'input' | 'output' | 'onwarn'>;
|
|
5661
5832
|
}
|
|
5662
5833
|
/**
|
|
5663
5834
|
* Server configuration options for the application.
|
package/dist/index.mjs
CHANGED
|
@@ -9,7 +9,6 @@ import { BaseLogger, Logger } from "@vercube/logger";
|
|
|
9
9
|
import { ConsoleProvider } from "@vercube/logger/drivers/ConsoleProvider";
|
|
10
10
|
import { loadConfig, setupDotenv } from "c12";
|
|
11
11
|
import { defu } from "defu";
|
|
12
|
-
|
|
13
12
|
//#region src/Services/Config/RuntimeConfig.ts
|
|
14
13
|
/**
|
|
15
14
|
* RuntimeConfig class manages the runtime configuration for the Vercube application.
|
|
@@ -36,7 +35,6 @@ var RuntimeConfig = class {
|
|
|
36
35
|
this.fRuntimeConfig = value;
|
|
37
36
|
}
|
|
38
37
|
};
|
|
39
|
-
|
|
40
38
|
//#endregion
|
|
41
39
|
//#region src/Errors/HttpError.ts
|
|
42
40
|
/**
|
|
@@ -62,7 +60,6 @@ var HttpError = class HttpError extends Error {
|
|
|
62
60
|
this.stack = (/* @__PURE__ */ new Error()).stack;
|
|
63
61
|
}
|
|
64
62
|
};
|
|
65
|
-
|
|
66
63
|
//#endregion
|
|
67
64
|
//#region src/Errors/Http/NotFoundError.ts
|
|
68
65
|
/**
|
|
@@ -85,7 +82,6 @@ var NotFoundError = class NotFoundError extends HttpError {
|
|
|
85
82
|
if (message) this.message = message;
|
|
86
83
|
}
|
|
87
84
|
};
|
|
88
|
-
|
|
89
85
|
//#endregion
|
|
90
86
|
//#region src/Services/ErrorHandler/ErrorHandlerProvider.ts
|
|
91
87
|
/**
|
|
@@ -96,7 +92,6 @@ var NotFoundError = class NotFoundError extends HttpError {
|
|
|
96
92
|
* @class ErrorHandlerProvider
|
|
97
93
|
*/
|
|
98
94
|
var ErrorHandlerProvider = class {};
|
|
99
|
-
|
|
100
95
|
//#endregion
|
|
101
96
|
//#region src/Errors/Http/BadRequestError.ts
|
|
102
97
|
/**
|
|
@@ -120,7 +115,6 @@ var BadRequestError = class BadRequestError extends HttpError {
|
|
|
120
115
|
if (errors) this.errors = errors;
|
|
121
116
|
}
|
|
122
117
|
};
|
|
123
|
-
|
|
124
118
|
//#endregion
|
|
125
119
|
//#region src/Utils/Security.ts
|
|
126
120
|
/**
|
|
@@ -223,7 +217,6 @@ function sanitizeObject(obj) {
|
|
|
223
217
|
function safeAssign(target, source) {
|
|
224
218
|
for (const key of Object.keys(source)) if (isSafeProperty(key) && Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
225
219
|
}
|
|
226
|
-
|
|
227
220
|
//#endregion
|
|
228
221
|
//#region src/Resolvers/Body.ts
|
|
229
222
|
/**
|
|
@@ -255,7 +248,6 @@ async function resolveRequestBody(event) {
|
|
|
255
248
|
throw new BadRequestError("Invalid JSON body");
|
|
256
249
|
}
|
|
257
250
|
}
|
|
258
|
-
|
|
259
251
|
//#endregion
|
|
260
252
|
//#region src/Resolvers/Headers.ts
|
|
261
253
|
/**
|
|
@@ -275,7 +267,6 @@ function getRequestHeader(header, event) {
|
|
|
275
267
|
function getRequestHeaders(event) {
|
|
276
268
|
return event.request.headers;
|
|
277
269
|
}
|
|
278
|
-
|
|
279
270
|
//#endregion
|
|
280
271
|
//#region src/Resolvers/Query.ts
|
|
281
272
|
/**
|
|
@@ -298,7 +289,6 @@ function resolveQueryParams(event) {
|
|
|
298
289
|
for (const [key, value] of url.searchParams) params[key] = value;
|
|
299
290
|
return params;
|
|
300
291
|
}
|
|
301
|
-
|
|
302
292
|
//#endregion
|
|
303
293
|
//#region src/Resolvers/RouterParam.ts
|
|
304
294
|
/**
|
|
@@ -315,7 +305,6 @@ function resolveQueryParams(event) {
|
|
|
315
305
|
function resolveRouterParam(param, event) {
|
|
316
306
|
return event.params?.[param] ?? null;
|
|
317
307
|
}
|
|
318
|
-
|
|
319
308
|
//#endregion
|
|
320
309
|
//#region src/Services/Metadata/MetadataResolver.ts
|
|
321
310
|
/**
|
|
@@ -390,14 +379,12 @@ var MetadataResolver = class {
|
|
|
390
379
|
return (ctx?.__metadata?.__middlewares?.filter((m) => m.target === "__global__" || m.target === propertyName) ?? []).sort((a) => a.target === "__global__" ? -1 : 1);
|
|
391
380
|
}
|
|
392
381
|
};
|
|
393
|
-
|
|
394
382
|
//#endregion
|
|
395
383
|
//#region src/Services/Middleware/BaseMiddleware.ts
|
|
396
384
|
/**
|
|
397
385
|
* BaseMiddleware class that serves as a base for all middleware implementations.
|
|
398
386
|
*/
|
|
399
387
|
var BaseMiddleware = class {};
|
|
400
|
-
|
|
401
388
|
//#endregion
|
|
402
389
|
//#region src/Services/Middleware/GlobalMiddlewareRegistry.ts
|
|
403
390
|
/**
|
|
@@ -435,7 +422,6 @@ var GlobalMiddlewareRegistry = class {
|
|
|
435
422
|
});
|
|
436
423
|
}
|
|
437
424
|
};
|
|
438
|
-
|
|
439
425
|
//#endregion
|
|
440
426
|
//#region src/Services/Router/RequestContext.ts
|
|
441
427
|
/**
|
|
@@ -536,16 +522,14 @@ var RequestContext = class {
|
|
|
536
522
|
return new Map(context);
|
|
537
523
|
}
|
|
538
524
|
};
|
|
539
|
-
|
|
540
525
|
//#endregion
|
|
541
|
-
//#region \0@oxc-project+runtime@0.
|
|
526
|
+
//#region \0@oxc-project+runtime@0.122.0/helpers/decorate.js
|
|
542
527
|
function __decorate(decorators, target, key, desc) {
|
|
543
528
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
544
529
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
545
530
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
546
531
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
547
532
|
}
|
|
548
|
-
|
|
549
533
|
//#endregion
|
|
550
534
|
//#region src/Services/Router/RequestHandler.ts
|
|
551
535
|
/**
|
|
@@ -873,15 +857,12 @@ var RequestHandler = class {
|
|
|
873
857
|
__decorate([Inject(MetadataResolver)], RequestHandler.prototype, "gMetadataResolver", void 0);
|
|
874
858
|
__decorate([Inject(Container)], RequestHandler.prototype, "gContainer", void 0);
|
|
875
859
|
__decorate([Inject(GlobalMiddlewareRegistry)], RequestHandler.prototype, "gGlobalMiddlewareRegistry", void 0);
|
|
876
|
-
|
|
877
860
|
//#endregion
|
|
878
861
|
//#region src/Hooks/Router/RouterAfterInitHook.ts
|
|
879
862
|
var RouterAfterInitHook = class {};
|
|
880
|
-
|
|
881
863
|
//#endregion
|
|
882
864
|
//#region src/Hooks/Router/RouterBeforeInitHook.ts
|
|
883
865
|
var RouterBeforeInitHook = class {};
|
|
884
|
-
|
|
885
866
|
//#endregion
|
|
886
867
|
//#region src/Services/Hooks/HooksService.ts
|
|
887
868
|
/**
|
|
@@ -1010,7 +991,6 @@ var HooksService = class {
|
|
|
1010
991
|
return instance;
|
|
1011
992
|
}
|
|
1012
993
|
};
|
|
1013
|
-
|
|
1014
994
|
//#endregion
|
|
1015
995
|
//#region src/Services/Router/Router.ts
|
|
1016
996
|
/**
|
|
@@ -1066,7 +1046,6 @@ var Router = class {
|
|
|
1066
1046
|
}
|
|
1067
1047
|
};
|
|
1068
1048
|
__decorate([Inject(HooksService)], Router.prototype, "gHooksService", void 0);
|
|
1069
|
-
|
|
1070
1049
|
//#endregion
|
|
1071
1050
|
//#region src/Utils/Mine.ts
|
|
1072
1051
|
const mime = { getType(ext) {
|
|
@@ -1083,7 +1062,6 @@ const mime = { getType(ext) {
|
|
|
1083
1062
|
".ico": "image/x-icon"
|
|
1084
1063
|
}[ext] || null;
|
|
1085
1064
|
} };
|
|
1086
|
-
|
|
1087
1065
|
//#endregion
|
|
1088
1066
|
//#region src/Services/Router/StaticRequestHandler.ts
|
|
1089
1067
|
/**
|
|
@@ -1155,7 +1133,6 @@ var StaticRequestHandler = class {
|
|
|
1155
1133
|
return new Response(stream, { headers });
|
|
1156
1134
|
}
|
|
1157
1135
|
};
|
|
1158
|
-
|
|
1159
1136
|
//#endregion
|
|
1160
1137
|
//#region src/Services/HttpServer/HttpServer.ts
|
|
1161
1138
|
/**
|
|
@@ -1259,7 +1236,7 @@ var HttpServer = class {
|
|
|
1259
1236
|
}
|
|
1260
1237
|
return this.gRequestHandler.handleRequest(request, route);
|
|
1261
1238
|
} catch (error) {
|
|
1262
|
-
return this.gContainer.get(ErrorHandlerProvider).handleError(error);
|
|
1239
|
+
return this.gContainer.get(ErrorHandlerProvider).handleError(error instanceof Error ? error : new Error(String(error)));
|
|
1263
1240
|
}
|
|
1264
1241
|
}
|
|
1265
1242
|
};
|
|
@@ -1267,7 +1244,6 @@ __decorate([Inject(Container)], HttpServer.prototype, "gContainer", void 0);
|
|
|
1267
1244
|
__decorate([Inject(Router)], HttpServer.prototype, "gRouter", void 0);
|
|
1268
1245
|
__decorate([Inject(RequestHandler)], HttpServer.prototype, "gRequestHandler", void 0);
|
|
1269
1246
|
__decorate([Inject(StaticRequestHandler)], HttpServer.prototype, "gStaticRequestHandler", void 0);
|
|
1270
|
-
|
|
1271
1247
|
//#endregion
|
|
1272
1248
|
//#region src/Services/Plugins/BasePlugin.ts
|
|
1273
1249
|
/**
|
|
@@ -1285,7 +1261,6 @@ var BasePlugin = class {
|
|
|
1285
1261
|
*/
|
|
1286
1262
|
use(app, options) {}
|
|
1287
1263
|
};
|
|
1288
|
-
|
|
1289
1264
|
//#endregion
|
|
1290
1265
|
//#region src/Services/Plugins/PluginsRegistry.ts
|
|
1291
1266
|
var PluginsRegistry = class {
|
|
@@ -1324,7 +1299,6 @@ var PluginsRegistry = class {
|
|
|
1324
1299
|
}
|
|
1325
1300
|
};
|
|
1326
1301
|
__decorate([Inject(Container)], PluginsRegistry.prototype, "gContainer", void 0);
|
|
1327
|
-
|
|
1328
1302
|
//#endregion
|
|
1329
1303
|
//#region src/Common/App.ts
|
|
1330
1304
|
/**
|
|
@@ -1427,7 +1401,6 @@ __decorate([Inject(PluginsRegistry)], App.prototype, "gPluginsRegistry", void 0)
|
|
|
1427
1401
|
__decorate([Inject(HttpServer)], App.prototype, "gHttpServer", void 0);
|
|
1428
1402
|
__decorate([Inject(StaticRequestHandler)], App.prototype, "gStaticRequestHandler", void 0);
|
|
1429
1403
|
__decorate([Inject(RuntimeConfig)], App.prototype, "gRuntimeConfig", void 0);
|
|
1430
|
-
|
|
1431
1404
|
//#endregion
|
|
1432
1405
|
//#region src/Errors/Http/InternalServerError.ts
|
|
1433
1406
|
/**
|
|
@@ -1450,7 +1423,6 @@ var InternalServerError = class InternalServerError extends HttpError {
|
|
|
1450
1423
|
if (message) this.message = message;
|
|
1451
1424
|
}
|
|
1452
1425
|
};
|
|
1453
|
-
|
|
1454
1426
|
//#endregion
|
|
1455
1427
|
//#region src/Services/ErrorHandler/DefaultErrorHandlerProvider.ts
|
|
1456
1428
|
/**
|
|
@@ -1475,7 +1447,6 @@ var DefaultErrorHandlerProvider = class extends ErrorHandlerProvider {
|
|
|
1475
1447
|
}
|
|
1476
1448
|
};
|
|
1477
1449
|
__decorate([Inject(Logger)], DefaultErrorHandlerProvider.prototype, "gLogger", void 0);
|
|
1478
|
-
|
|
1479
1450
|
//#endregion
|
|
1480
1451
|
//#region src/Services/Validation/ValidationProvider.ts
|
|
1481
1452
|
/**
|
|
@@ -1486,7 +1457,6 @@ __decorate([Inject(Logger)], DefaultErrorHandlerProvider.prototype, "gLogger", v
|
|
|
1486
1457
|
* @class ValidationProvider
|
|
1487
1458
|
*/
|
|
1488
1459
|
var ValidationProvider = class {};
|
|
1489
|
-
|
|
1490
1460
|
//#endregion
|
|
1491
1461
|
//#region src/Services/Validation/StandardSchemaValidationProvider.ts
|
|
1492
1462
|
/**
|
|
@@ -1506,7 +1476,6 @@ var StandardSchemaValidationProvider = class {
|
|
|
1506
1476
|
return schema["~standard"].validate(data);
|
|
1507
1477
|
}
|
|
1508
1478
|
};
|
|
1509
|
-
|
|
1510
1479
|
//#endregion
|
|
1511
1480
|
//#region src/Common/Container.ts
|
|
1512
1481
|
/**
|
|
@@ -1539,7 +1508,6 @@ function createContainer(config) {
|
|
|
1539
1508
|
container.bind(ValidationProvider, StandardSchemaValidationProvider);
|
|
1540
1509
|
return container;
|
|
1541
1510
|
}
|
|
1542
|
-
|
|
1543
1511
|
//#endregion
|
|
1544
1512
|
//#region src/Config/DefaultConfig.ts
|
|
1545
1513
|
/**
|
|
@@ -1569,7 +1537,6 @@ const defaultConfig = {
|
|
|
1569
1537
|
experimental: {},
|
|
1570
1538
|
runtime: {}
|
|
1571
1539
|
};
|
|
1572
|
-
|
|
1573
1540
|
//#endregion
|
|
1574
1541
|
//#region src/Config/Loader.ts
|
|
1575
1542
|
/**
|
|
@@ -1588,7 +1555,6 @@ async function loadVercubeConfig(overrides) {
|
|
|
1588
1555
|
if (config?.config?.c12?.dotenv && typeof config?.config?.c12?.dotenv === "object") await setupDotenv(config.config.c12.dotenv);
|
|
1589
1556
|
return defu(overrides ?? {}, config?.config ?? {});
|
|
1590
1557
|
}
|
|
1591
|
-
|
|
1592
1558
|
//#endregion
|
|
1593
1559
|
//#region src/Common/CreateApp.ts
|
|
1594
1560
|
/**
|
|
@@ -1607,7 +1573,6 @@ async function createApp({ cfg = {}, setup = void 0 } = {}) {
|
|
|
1607
1573
|
initializeContainer(container);
|
|
1608
1574
|
return app;
|
|
1609
1575
|
}
|
|
1610
|
-
|
|
1611
1576
|
//#endregion
|
|
1612
1577
|
//#region src/Config/Config.ts
|
|
1613
1578
|
/**
|
|
@@ -1618,7 +1583,6 @@ async function createApp({ cfg = {}, setup = void 0 } = {}) {
|
|
|
1618
1583
|
function defineConfig(config) {
|
|
1619
1584
|
return config;
|
|
1620
1585
|
}
|
|
1621
|
-
|
|
1622
1586
|
//#endregion
|
|
1623
1587
|
//#region src/Middleware/ValidationMiddleware.ts
|
|
1624
1588
|
/**
|
|
@@ -1655,7 +1619,6 @@ var ValidationMiddleware = class {
|
|
|
1655
1619
|
};
|
|
1656
1620
|
__decorate([InjectOptional(Logger)], ValidationMiddleware.prototype, "gLogger", void 0);
|
|
1657
1621
|
__decorate([InjectOptional(ValidationProvider)], ValidationMiddleware.prototype, "gValidationProvider", void 0);
|
|
1658
|
-
|
|
1659
1622
|
//#endregion
|
|
1660
1623
|
//#region src/Utils/Utils.ts
|
|
1661
1624
|
/**
|
|
@@ -1703,7 +1666,6 @@ function initializeMetadata(target) {
|
|
|
1703
1666
|
if (!target.__metadata.__middlewares) target.__metadata.__middlewares = [];
|
|
1704
1667
|
return target.__metadata;
|
|
1705
1668
|
}
|
|
1706
|
-
|
|
1707
1669
|
//#endregion
|
|
1708
1670
|
//#region src/Decorators/Http/Body.ts
|
|
1709
1671
|
/**
|
|
@@ -1746,7 +1708,6 @@ var BodyDecorator = class extends BaseDecorator {
|
|
|
1746
1708
|
function Body(options) {
|
|
1747
1709
|
return createDecorator(BodyDecorator, options);
|
|
1748
1710
|
}
|
|
1749
|
-
|
|
1750
1711
|
//#endregion
|
|
1751
1712
|
//#region src/Decorators/Http/Connect.ts
|
|
1752
1713
|
/**
|
|
@@ -1802,7 +1763,6 @@ __decorate([Inject(MetadataResolver)], ConnectDecorator.prototype, "gMetadataRes
|
|
|
1802
1763
|
function Connect(path) {
|
|
1803
1764
|
return createDecorator(ConnectDecorator, { path });
|
|
1804
1765
|
}
|
|
1805
|
-
|
|
1806
1766
|
//#endregion
|
|
1807
1767
|
//#region src/Decorators/Http/Controller.ts
|
|
1808
1768
|
/**
|
|
@@ -1823,7 +1783,6 @@ function Controller(path) {
|
|
|
1823
1783
|
};
|
|
1824
1784
|
};
|
|
1825
1785
|
}
|
|
1826
|
-
|
|
1827
1786
|
//#endregion
|
|
1828
1787
|
//#region src/Decorators/Http/Delete.ts
|
|
1829
1788
|
/**
|
|
@@ -1879,7 +1838,6 @@ __decorate([Inject(MetadataResolver)], DeleteDecorator.prototype, "gMetadataReso
|
|
|
1879
1838
|
function Delete(path) {
|
|
1880
1839
|
return createDecorator(DeleteDecorator, { path });
|
|
1881
1840
|
}
|
|
1882
|
-
|
|
1883
1841
|
//#endregion
|
|
1884
1842
|
//#region src/Decorators/Http/Get.ts
|
|
1885
1843
|
/**
|
|
@@ -1910,9 +1868,9 @@ var GetDecorator = class extends BaseDecorator {
|
|
|
1910
1868
|
path: this.options.path,
|
|
1911
1869
|
propertyName: this.propertyName
|
|
1912
1870
|
});
|
|
1913
|
-
this.gRouter.addRoute({
|
|
1871
|
+
for (const method of ["GET", "HEAD"]) this.gRouter.addRoute({
|
|
1914
1872
|
path: this.options.path,
|
|
1915
|
-
method
|
|
1873
|
+
method,
|
|
1916
1874
|
handler: this.gRequestHandler.prepareHandler({
|
|
1917
1875
|
instance: this.instance,
|
|
1918
1876
|
propertyName: this.propertyName
|
|
@@ -1935,7 +1893,6 @@ __decorate([Inject(MetadataResolver)], GetDecorator.prototype, "gMetadataResolve
|
|
|
1935
1893
|
function Get(path) {
|
|
1936
1894
|
return createDecorator(GetDecorator, { path });
|
|
1937
1895
|
}
|
|
1938
|
-
|
|
1939
1896
|
//#endregion
|
|
1940
1897
|
//#region src/Decorators/Http/Head.ts
|
|
1941
1898
|
/**
|
|
@@ -1991,7 +1948,6 @@ __decorate([Inject(MetadataResolver)], HeadDecorator.prototype, "gMetadataResolv
|
|
|
1991
1948
|
function Head(path) {
|
|
1992
1949
|
return createDecorator(HeadDecorator, { path });
|
|
1993
1950
|
}
|
|
1994
|
-
|
|
1995
1951
|
//#endregion
|
|
1996
1952
|
//#region src/Decorators/Http/Header.ts
|
|
1997
1953
|
/**
|
|
@@ -2032,7 +1988,6 @@ var HeaderDecorator = class extends BaseDecorator {
|
|
|
2032
1988
|
function Header(name) {
|
|
2033
1989
|
return createDecorator(HeaderDecorator, { name });
|
|
2034
1990
|
}
|
|
2035
|
-
|
|
2036
1991
|
//#endregion
|
|
2037
1992
|
//#region src/Decorators/Http/Headers.ts
|
|
2038
1993
|
/**
|
|
@@ -2070,7 +2025,6 @@ var HeadersDecorator = class extends BaseDecorator {
|
|
|
2070
2025
|
function Headers$1() {
|
|
2071
2026
|
return createDecorator(HeadersDecorator, {});
|
|
2072
2027
|
}
|
|
2073
|
-
|
|
2074
2028
|
//#endregion
|
|
2075
2029
|
//#region src/Decorators/Http/Options.ts
|
|
2076
2030
|
/**
|
|
@@ -2126,7 +2080,6 @@ __decorate([Inject(MetadataResolver)], OptionsDecorator.prototype, "gMetadataRes
|
|
|
2126
2080
|
function Options(path) {
|
|
2127
2081
|
return createDecorator(OptionsDecorator, { path });
|
|
2128
2082
|
}
|
|
2129
|
-
|
|
2130
2083
|
//#endregion
|
|
2131
2084
|
//#region src/Decorators/Http/Param.ts
|
|
2132
2085
|
/**
|
|
@@ -2170,7 +2123,6 @@ __decorate([Inject(MetadataResolver)], ParamDecorator.prototype, "gMetadataResol
|
|
|
2170
2123
|
function Param(name) {
|
|
2171
2124
|
return createDecorator(ParamDecorator, { name });
|
|
2172
2125
|
}
|
|
2173
|
-
|
|
2174
2126
|
//#endregion
|
|
2175
2127
|
//#region src/Decorators/Http/Patch.ts
|
|
2176
2128
|
/**
|
|
@@ -2226,7 +2178,6 @@ __decorate([Inject(MetadataResolver)], PatchDecorator.prototype, "gMetadataResol
|
|
|
2226
2178
|
function Patch(path) {
|
|
2227
2179
|
return createDecorator(PatchDecorator, { path });
|
|
2228
2180
|
}
|
|
2229
|
-
|
|
2230
2181
|
//#endregion
|
|
2231
2182
|
//#region src/Decorators/Http/Post.ts
|
|
2232
2183
|
/**
|
|
@@ -2282,7 +2233,6 @@ __decorate([Inject(RequestHandler)], PostDecorator.prototype, "gRequestHandler",
|
|
|
2282
2233
|
function Post(path) {
|
|
2283
2234
|
return createDecorator(PostDecorator, { path });
|
|
2284
2235
|
}
|
|
2285
|
-
|
|
2286
2236
|
//#endregion
|
|
2287
2237
|
//#region src/Decorators/Http/Put.ts
|
|
2288
2238
|
/**
|
|
@@ -2338,7 +2288,6 @@ __decorate([Inject(MetadataResolver)], PutDecorator.prototype, "gMetadataResolve
|
|
|
2338
2288
|
function Put(path) {
|
|
2339
2289
|
return createDecorator(PutDecorator, { path });
|
|
2340
2290
|
}
|
|
2341
|
-
|
|
2342
2291
|
//#endregion
|
|
2343
2292
|
//#region src/Decorators/Http/QueryParam.ts
|
|
2344
2293
|
/**
|
|
@@ -2386,7 +2335,6 @@ var QueryParamDecorator = class extends BaseDecorator {
|
|
|
2386
2335
|
function QueryParam(options) {
|
|
2387
2336
|
return createDecorator(QueryParamDecorator, options);
|
|
2388
2337
|
}
|
|
2389
|
-
|
|
2390
2338
|
//#endregion
|
|
2391
2339
|
//#region src/Decorators/Http/QueryParams.ts
|
|
2392
2340
|
/**
|
|
@@ -2434,7 +2382,6 @@ var QueryParamsDecorator = class extends BaseDecorator {
|
|
|
2434
2382
|
function QueryParams(options) {
|
|
2435
2383
|
return createDecorator(QueryParamsDecorator, options);
|
|
2436
2384
|
}
|
|
2437
|
-
|
|
2438
2385
|
//#endregion
|
|
2439
2386
|
//#region src/Decorators/Http/Request.ts
|
|
2440
2387
|
/**
|
|
@@ -2472,7 +2419,6 @@ var RequestDecorator = class extends BaseDecorator {
|
|
|
2472
2419
|
function Request() {
|
|
2473
2420
|
return createDecorator(RequestDecorator, {});
|
|
2474
2421
|
}
|
|
2475
|
-
|
|
2476
2422
|
//#endregion
|
|
2477
2423
|
//#region src/Decorators/Http/Response.ts
|
|
2478
2424
|
/**
|
|
@@ -2510,7 +2456,6 @@ var ResponseDecorator = class extends BaseDecorator {
|
|
|
2510
2456
|
function Response$1() {
|
|
2511
2457
|
return createDecorator(ResponseDecorator, {});
|
|
2512
2458
|
}
|
|
2513
|
-
|
|
2514
2459
|
//#endregion
|
|
2515
2460
|
//#region src/Decorators/Http/Trace.ts
|
|
2516
2461
|
/**
|
|
@@ -2566,7 +2511,6 @@ __decorate([Inject(MetadataResolver)], TraceDecorator.prototype, "gMetadataResol
|
|
|
2566
2511
|
function Trace(path) {
|
|
2567
2512
|
return createDecorator(TraceDecorator, { path });
|
|
2568
2513
|
}
|
|
2569
|
-
|
|
2570
2514
|
//#endregion
|
|
2571
2515
|
//#region src/Decorators/Http/SetHeader.ts
|
|
2572
2516
|
/**
|
|
@@ -2600,7 +2544,6 @@ function SetHeader(key, value) {
|
|
|
2600
2544
|
value
|
|
2601
2545
|
});
|
|
2602
2546
|
}
|
|
2603
|
-
|
|
2604
2547
|
//#endregion
|
|
2605
2548
|
//#region src/Types/HttpTypes.ts
|
|
2606
2549
|
let HTTPStatus = /* @__PURE__ */ function(HTTPStatus) {
|
|
@@ -2667,7 +2610,6 @@ let HTTPStatus = /* @__PURE__ */ function(HTTPStatus) {
|
|
|
2667
2610
|
HTTPStatus[HTTPStatus["NETWORK_AUTHENTICATION_REQUIRED"] = 511] = "NETWORK_AUTHENTICATION_REQUIRED";
|
|
2668
2611
|
return HTTPStatus;
|
|
2669
2612
|
}({});
|
|
2670
|
-
|
|
2671
2613
|
//#endregion
|
|
2672
2614
|
//#region src/Decorators/Http/Status.ts
|
|
2673
2615
|
/**
|
|
@@ -2693,7 +2635,6 @@ var StatusDecorator = class extends BaseDecorator {
|
|
|
2693
2635
|
function Status(code) {
|
|
2694
2636
|
return createDecorator(StatusDecorator, { code });
|
|
2695
2637
|
}
|
|
2696
|
-
|
|
2697
2638
|
//#endregion
|
|
2698
2639
|
//#region src/Decorators/Http/Redirect.ts
|
|
2699
2640
|
var RedirectDecorator = class extends BaseDecorator {
|
|
@@ -2725,7 +2666,6 @@ function Redirect(location, code = 301) {
|
|
|
2725
2666
|
code
|
|
2726
2667
|
});
|
|
2727
2668
|
}
|
|
2728
|
-
|
|
2729
2669
|
//#endregion
|
|
2730
2670
|
//#region src/Decorators/Http/Middleware.ts
|
|
2731
2671
|
/**
|
|
@@ -2759,7 +2699,6 @@ function Middleware(middleware, opts) {
|
|
|
2759
2699
|
});
|
|
2760
2700
|
};
|
|
2761
2701
|
}
|
|
2762
|
-
|
|
2763
2702
|
//#endregion
|
|
2764
2703
|
//#region src/Decorators/Http/MultipartFormData.ts
|
|
2765
2704
|
/**
|
|
@@ -2799,7 +2738,6 @@ var MultipartFormDataDecorator = class extends BaseDecorator {
|
|
|
2799
2738
|
function MultipartFormData() {
|
|
2800
2739
|
return createDecorator(MultipartFormDataDecorator, {});
|
|
2801
2740
|
}
|
|
2802
|
-
|
|
2803
2741
|
//#endregion
|
|
2804
2742
|
//#region src/Decorators/Hooks/Listen.ts
|
|
2805
2743
|
/**
|
|
@@ -2833,7 +2771,6 @@ __decorate([Inject(HooksService)], ListenDecorator.prototype, "gHooksService", v
|
|
|
2833
2771
|
function Listen(hookType) {
|
|
2834
2772
|
return createDecorator(ListenDecorator, { hookType });
|
|
2835
2773
|
}
|
|
2836
|
-
|
|
2837
2774
|
//#endregion
|
|
2838
2775
|
//#region src/Errors/Http/ForbiddenError.ts
|
|
2839
2776
|
/**
|
|
@@ -2856,7 +2793,6 @@ var ForbiddenError = class ForbiddenError extends HttpError {
|
|
|
2856
2793
|
if (message) this.message = message;
|
|
2857
2794
|
}
|
|
2858
2795
|
};
|
|
2859
|
-
|
|
2860
2796
|
//#endregion
|
|
2861
2797
|
//#region src/Errors/Http/MethodNotAllowedError.ts
|
|
2862
2798
|
/**
|
|
@@ -2879,7 +2815,6 @@ var MethodNotAllowedError = class MethodNotAllowedError extends HttpError {
|
|
|
2879
2815
|
if (message) this.message = message;
|
|
2880
2816
|
}
|
|
2881
2817
|
};
|
|
2882
|
-
|
|
2883
2818
|
//#endregion
|
|
2884
2819
|
//#region src/Errors/Http/NotAcceptableError.ts
|
|
2885
2820
|
/**
|
|
@@ -2902,7 +2837,6 @@ var NotAcceptableError = class NotAcceptableError extends HttpError {
|
|
|
2902
2837
|
if (message) this.message = message;
|
|
2903
2838
|
}
|
|
2904
2839
|
};
|
|
2905
|
-
|
|
2906
2840
|
//#endregion
|
|
2907
2841
|
//#region src/Errors/Http/UnauthorizedError.ts
|
|
2908
2842
|
/**
|
|
@@ -2925,7 +2859,6 @@ var UnauthorizedError = class UnauthorizedError extends HttpError {
|
|
|
2925
2859
|
if (message) this.message = message;
|
|
2926
2860
|
}
|
|
2927
2861
|
};
|
|
2928
|
-
|
|
2929
2862
|
//#endregion
|
|
2930
2863
|
//#region src/Types/HttpCodes.ts
|
|
2931
2864
|
/**
|
|
@@ -3255,6 +3188,5 @@ let HttpStatusCode = /* @__PURE__ */ function(HttpStatusCode) {
|
|
|
3255
3188
|
HttpStatusCode[HttpStatusCode["NETWORK_AUTHENTICATION_REQUIRED"] = 511] = "NETWORK_AUTHENTICATION_REQUIRED";
|
|
3256
3189
|
return HttpStatusCode;
|
|
3257
3190
|
}({});
|
|
3258
|
-
|
|
3259
3191
|
//#endregion
|
|
3260
|
-
export { App, BadRequestError, BaseMiddleware, BasePlugin, Body, Connect, Controller, DANGEROUS_PROPERTIES, Delete, ErrorHandlerProvider, FastResponse, ForbiddenError, Get, GlobalMiddlewareRegistry, HTTPStatus, Head, Header, Headers$1 as Headers, HooksService, HttpError, HttpServer, HttpStatusCode, InternalServerError, Listen, MetadataResolver, MethodNotAllowedError, Middleware, MultipartFormData, NotAcceptableError, NotFoundError, Options, Param, Patch, Post, Put, QueryParam, QueryParams, Redirect, Request, RequestContext, Response$1 as Response, Router, RuntimeConfig, SetHeader, StandardSchemaValidationProvider, Status, Trace, UnauthorizedError, ValidationProvider, createApp, createMetadataCtx, createMetadataMethod, defineConfig, initializeMetadata, initializeMetadataMethod, isSafeProperty, loadVercubeConfig, safeAssign, safeJsonParse, sanitizeObject, secureReviver };
|
|
3192
|
+
export { App, BadRequestError, BaseMiddleware, BasePlugin, Body, Connect, Controller, DANGEROUS_PROPERTIES, Delete, ErrorHandlerProvider, FastResponse, ForbiddenError, Get, GlobalMiddlewareRegistry, HTTPStatus, Head, Header, Headers$1 as Headers, HooksService, HttpError, HttpServer, HttpStatusCode, InternalServerError, Listen, MetadataResolver, MethodNotAllowedError, Middleware, MultipartFormData, NotAcceptableError, NotFoundError, Options, Param, Patch, Post, Put, QueryParam, QueryParams, Redirect, Request, RequestContext, Response$1 as Response, Router, RuntimeConfig, SetHeader, StandardSchemaValidationProvider, Status, Trace, UnauthorizedError, ValidationProvider, createApp, createMetadataCtx, createMetadataMethod, defineConfig, initializeMetadata, initializeMetadataMethod, isSafeProperty, loadVercubeConfig, safeAssign, safeJsonParse, sanitizeObject, secureReviver };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercube/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.46",
|
|
4
4
|
"description": "Core module for Vercube framework",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@standard-schema/spec": "1.1.0",
|
|
26
|
-
"c12": "
|
|
26
|
+
"c12": "4.0.0-beta.4",
|
|
27
27
|
"defu": "6.1.4",
|
|
28
28
|
"pathe": "2.0.3",
|
|
29
|
-
"rou3": "0.
|
|
30
|
-
"srvx": "0.11.
|
|
31
|
-
"@vercube/di": "0.0.
|
|
32
|
-
"@vercube/logger": "0.0.
|
|
29
|
+
"rou3": "0.8.1",
|
|
30
|
+
"srvx": "0.11.13",
|
|
31
|
+
"@vercube/di": "0.0.46",
|
|
32
|
+
"@vercube/logger": "0.0.46"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"rolldown": "1.0.0-rc.
|
|
35
|
+
"rolldown": "1.0.0-rc.12",
|
|
36
36
|
"zod": "4.3.6"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|