nitropack
Advanced tools
Comparing version 2.3.1 to 2.3.2
@@ -22,23 +22,2 @@ import { RouterMethod, App, Router, H3Event, EventHandler, H3Error, ProxyOptions } from 'h3'; | ||
/** | ||
* @link https://github.com/remix-run/remix/blob/2248669ed59fd716e267ea41df5d665d4781f4a9/packages/remix-server-runtime/serialize.ts | ||
*/ | ||
type JsonPrimitive = string | number | boolean | String | Number | Boolean | null; | ||
type NonJsonPrimitive = undefined | Function | symbol; | ||
type IsAny<T> = 0 extends 1 & T ? true : false; | ||
type FilterKeys<TObj extends object, TFilter> = { | ||
[TKey in keyof TObj]: TObj[TKey] extends TFilter ? TKey : never; | ||
}[keyof TObj]; | ||
type Serialize<T> = IsAny<T> extends true ? any : T extends JsonPrimitive ? T : T extends Map<any, any> | Set<any> ? Record<string, never> : T extends NonJsonPrimitive ? never : T extends { | ||
toJSON(): infer U; | ||
} ? U : T extends [] ? [] : T extends [unknown, ...unknown[]] ? SerializeTuple<T> : T extends ReadonlyArray<infer U> ? (U extends NonJsonPrimitive ? null : Serialize<U>)[] : T extends object ? SerializeObject<T> : never; | ||
/** JSON serialize [tuples](https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types) */ | ||
type SerializeTuple<T extends [unknown, ...unknown[]]> = { | ||
[k in keyof T]: T[k] extends NonJsonPrimitive ? null : Serialize<T[k]>; | ||
}; | ||
/** JSON serialize objects (not including arrays) and classes */ | ||
type SerializeObject<T extends object> = { | ||
[k in keyof Omit<T, FilterKeys<T, NonJsonPrimitive>>]: Serialize<T[k]>; | ||
}; | ||
type MatchResult<Key extends string, Exact extends boolean = false, Score extends any[] = [], catchAll extends boolean = false> = { | ||
@@ -79,3 +58,3 @@ [k in Key]: { | ||
type NitroFetchRequest = Exclude<keyof InternalApi, `/_${string}` | `/api/_${string}`> | Exclude<FetchRequest, string> | (string & {}); | ||
type MiddlewareOf<Route extends string, Method extends RouterMethod | "default"> = Method extends keyof InternalApi[MatchedRoutes<Route>] ? Exclude<Serialize<InternalApi[MatchedRoutes<Route>][Method]>, Error | void> : never; | ||
type MiddlewareOf<Route extends string, Method extends RouterMethod | "default"> = Method extends keyof InternalApi[MatchedRoutes<Route>] ? Exclude<InternalApi[MatchedRoutes<Route>][Method], Error | void> : never; | ||
type TypedInternalResponse<Route, Default = unknown, Method extends RouterMethod = RouterMethod> = Default extends string | boolean | number | null | void | object ? Default : Route extends string ? MiddlewareOf<Route, Method> extends never ? MiddlewareOf<Route, "default"> extends never ? Default : MiddlewareOf<Route, "default"> : MiddlewareOf<Route, Method> : Default; | ||
@@ -101,2 +80,29 @@ type AvailableRouterMethod<R extends NitroFetchRequest> = R extends string ? keyof InternalApi[MatchedRoutes<R>] extends undefined ? RouterMethod : Extract<keyof InternalApi[MatchedRoutes<R>], "default"> extends undefined ? Extract<RouterMethod, keyof InternalApi[MatchedRoutes<R>]> : RouterMethod : RouterMethod; | ||
/** | ||
* @link https://github.com/remix-run/remix/blob/2248669ed59fd716e267ea41df5d665d4781f4a9/packages/remix-server-runtime/serialize.ts | ||
*/ | ||
type JsonPrimitive = string | number | boolean | String | Number | Boolean | null; | ||
type NonJsonPrimitive = undefined | Function | symbol; | ||
type IsAny<T> = 0 extends 1 & T ? true : false; | ||
type FilterKeys<TObj extends object, TFilter> = { | ||
[TKey in keyof TObj]: TObj[TKey] extends TFilter ? TKey : never; | ||
}[keyof TObj]; | ||
type Serialize<T> = IsAny<T> extends true ? any : T extends JsonPrimitive ? T : T extends Map<any, any> | Set<any> ? Record<string, never> : T extends NonJsonPrimitive ? never : T extends { | ||
toJSON(): infer U; | ||
} ? U : T extends [] ? [] : T extends [unknown, ...unknown[]] ? SerializeTuple<T> : T extends ReadonlyArray<infer U> ? (U extends NonJsonPrimitive ? null : Serialize<U>)[] : T extends object ? SerializeObject<T> : never; | ||
/** JSON serialize [tuples](https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types) */ | ||
type SerializeTuple<T extends [unknown, ...unknown[]]> = { | ||
[k in keyof T]: T[k] extends NonJsonPrimitive ? null : Serialize<T[k]>; | ||
}; | ||
/** JSON serialize objects (not including arrays) and classes */ | ||
type SerializeObject<T extends object> = { | ||
[k in keyof Omit<T, FilterKeys<T, NonJsonPrimitive>>]: Serialize<T[k]>; | ||
}; | ||
/** | ||
* @see https://github.com/ianstormtaylor/superstruct/blob/7973400cd04d8ad92bbdc2b6f35acbfb3c934079/src/utils.ts#L323-L325 | ||
*/ | ||
type Simplify<TType> = TType extends any[] | Date ? TType : { | ||
[K in keyof TType]: TType[K]; | ||
}; | ||
interface NodeExternalsOptions { | ||
@@ -387,2 +393,8 @@ inline?: string[]; | ||
domains: string[]; | ||
remotePatterns?: { | ||
protocol?: "http" | "https"; | ||
hostname: string; | ||
port?: string; | ||
pathname?: string; | ||
}[]; | ||
minimumCacheTTL?: number; | ||
@@ -402,2 +414,6 @@ formats?: ("image/avif" | "image/webp")[]; | ||
cache?: string[]; | ||
crons?: { | ||
path: string; | ||
schedule: string; | ||
}[]; | ||
} | ||
@@ -546,3 +562,3 @@ interface PresetOptions { | ||
timing: boolean; | ||
renderer: string; | ||
renderer?: string; | ||
serveStatic: boolean | "node" | "deno"; | ||
@@ -662,2 +678,2 @@ noPublicDir: boolean; | ||
export { $Fetch, AppConfig, AvailableRouterMethod, CacheEntry, CacheOptions, CachedEventHandlerOptions, CompressOptions, DevServerOptions, ExtractedRouteMethod, GLOB_SCAN_PATTERN, InternalApi, KebabCase, MatchedRoutes, MiddlewareOf, Nitro, NitroApp, NitroAppPlugin, NitroConfig, NitroDevEventHandler, NitroDevServer, NitroErrorHandler, NitroEventHandler, NitroFetchOptions, NitroFetchRequest, NitroHooks, NitroOptions, NitroPreset, NitroRouteConfig, NitroRouteRules, NitroWorker, PrerenderGenerateRoute, PrerenderRoute, PublicAssetDir, RenderHandler, RenderResponse, ResponseCacheEntry, ServerAssetDir, StorageMounts, TypedInternalResponse, build, copyPublicAssets, createDevServer, createNitro, defineNitroConfig, defineNitroPreset, loadOptions, prepare, prerender, scanHandlers, scanMiddleware, scanPlugins, scanRoutes, writeTypes }; | ||
export { $Fetch, AppConfig, AvailableRouterMethod, CacheEntry, CacheOptions, CachedEventHandlerOptions, CompressOptions, DevServerOptions, ExtractedRouteMethod, GLOB_SCAN_PATTERN, InternalApi, KebabCase, MatchedRoutes, MiddlewareOf, Nitro, NitroApp, NitroAppPlugin, NitroConfig, NitroDevEventHandler, NitroDevServer, NitroErrorHandler, NitroEventHandler, NitroFetchOptions, NitroFetchRequest, NitroHooks, NitroOptions, NitroPreset, NitroRouteConfig, NitroRouteRules, NitroWorker, PrerenderGenerateRoute, PrerenderRoute, PublicAssetDir, RenderHandler, RenderResponse, ResponseCacheEntry, Serialize, ServerAssetDir, Simplify, StorageMounts, TypedInternalResponse, build, copyPublicAssets, createDevServer, createNitro, defineNitroConfig, defineNitroPreset, loadOptions, prepare, prerender, scanHandlers, scanMiddleware, scanPlugins, scanRoutes, writeTypes }; |
{ | ||
"name": "nitropack", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"description": "Build and Deploy Universal JavaScript Servers", | ||
@@ -53,13 +53,13 @@ "repository": "unjs/nitro", | ||
"dot-prop": "^7.2.0", | ||
"esbuild": "^0.17.11", | ||
"esbuild": "^0.17.12", | ||
"escape-string-regexp": "^5.0.0", | ||
"etag": "^1.8.1", | ||
"fs-extra": "^11.1.0", | ||
"fs-extra": "^11.1.1", | ||
"globby": "^13.1.3", | ||
"gzip-size": "^7.0.0", | ||
"h3": "^1.6.0", | ||
"h3": "^1.6.2", | ||
"hookable": "^5.5.1", | ||
"http-proxy": "^1.18.1", | ||
"is-primitive": "^3.0.1", | ||
"jiti": "^1.17.2", | ||
"jiti": "^1.18.2", | ||
"klona": "^2.0.6", | ||
@@ -79,3 +79,3 @@ "knitwork": "^1.0.0", | ||
"radix3": "^1.0.0", | ||
"rollup": "^3.19.1", | ||
"rollup": "^3.20.0", | ||
"rollup-plugin-visualizer": "^5.9.0", | ||
@@ -90,8 +90,8 @@ "scule": "^1.0.0", | ||
"unenv": "^1.2.2", | ||
"unimport": "^3.0.2", | ||
"unstorage": "^1.4.0" | ||
"unimport": "^3.0.3", | ||
"unstorage": "^1.4.1" | ||
}, | ||
"devDependencies": { | ||
"@cloudflare/workers-types": "^4.20230307.0", | ||
"@types/aws-lambda": "^8.10.111", | ||
"@cloudflare/workers-types": "^4.20230321.0", | ||
"@types/aws-lambda": "^8.10.114", | ||
"@types/etag": "^1.8.1", | ||
@@ -103,3 +103,3 @@ "@types/fs-extra": "^11.0.1", | ||
"@types/serve-static": "^1.15.1", | ||
"@vitest/coverage-c8": "^0.29.2", | ||
"@vitest/coverage-c8": "^0.29.7", | ||
"changelogen": "^0.5.1", | ||
@@ -109,12 +109,12 @@ "edge-runtime": "^2.1.2", | ||
"eslint-config-unjs": "^0.1.0", | ||
"execa": "^7.1.0", | ||
"execa": "^7.1.1", | ||
"expect-type": "^0.15.0", | ||
"miniflare": "^2.12.1", | ||
"prettier": "^2.8.4", | ||
"typescript": "^4.9.5", | ||
"miniflare": "^2.12.2", | ||
"prettier": "^2.8.6", | ||
"typescript": "^5.0.2", | ||
"unbuild": "^1.1.2", | ||
"undici": "^5.21.0", | ||
"vitest": "^0.29.2" | ||
"vitest": "^0.29.7" | ||
}, | ||
"packageManager": "pnpm@7.29.1", | ||
"packageManager": "pnpm@7.30.0", | ||
"engines": { | ||
@@ -121,0 +121,0 @@ "node": "^14.16.0 || ^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
218728
6660
6
Updatedesbuild@^0.17.12
Updatedfs-extra@^11.1.1
Updatedh3@^1.6.2
Updatedjiti@^1.18.2
Updatedrollup@^3.20.0
Updatedunimport@^3.0.3
Updatedunstorage@^1.4.1