Comparing version 0.1.2 to 0.2.0
@@ -1,71 +0,7 @@ | ||
import * as h3 from 'h3'; | ||
import { Handle, LazyHandle, Middleware, HTTPMethod } from 'h3'; | ||
export { appendHeader, assertMethod, defaultContentType, isMethod, send, sendRedirect, setCookie, useBase, useCookie, useCookies, useMethod, useQuery, useRawBody } from 'h3'; | ||
import { ServerResponse, IncomingMessage } from 'http'; | ||
import { Hookable } from 'hookable'; | ||
import * as _unrouted_core from '@unrouted/core'; | ||
import { PresetUnroutedOptions } from '@unrouted/preset-unrouted'; | ||
export * from '@unrouted/preset-unrouted'; | ||
declare type RouteMethod = (route: string, handle: Handle | LazyHandle | string | object) => UnroutedRouter; | ||
declare function createUnrouted(config?: Partial<PresetUnroutedOptions>): Promise<_unrouted_core.UnroutedContext>; | ||
declare type UnroutedPlugin = (router: UnroutedRouter) => void; | ||
declare type Hook = `serve:before-route:${string | ''}` | 'serve:before-route'; | ||
interface UnroutedResolvedConfig { | ||
debug: boolean; | ||
cors: boolean; | ||
handle404: boolean; | ||
plugins: UnroutedPlugin[]; | ||
middleware: Middleware[] | Handle[]; | ||
prefix: string; | ||
hooks: Record<Hook, () => Promise<void> | void>; | ||
} | ||
declare type DeepPartial<T> = T extends Function ? T : (T extends object ? { | ||
[P in keyof T]?: DeepPartial<T[P]>; | ||
} : T); | ||
declare type UnroutedUserConfig = DeepPartial<UnroutedResolvedConfig>; | ||
interface UnroutedRouter { | ||
config: UnroutedResolvedConfig; | ||
use: (method: HttpMethodInput, urlPattern: string, handle: Handle | Middleware, options?: Record<string, any>) => UnroutedRouter; | ||
prefix: string; | ||
handle: (req: AbstractIncomingMessage | any, res: ServerResponse | any) => Promise<unknown>; | ||
hooks: Hookable; | ||
serve: (path: string, dirname: string) => UnroutedRouter; | ||
group: (prefix: string, cb: (router: UnroutedRouter) => void) => void; | ||
match: (methods: HttpMethodInput, route: string, action: Function | string | object) => void; | ||
any: RouteMethod; | ||
get: RouteMethod; | ||
post: RouteMethod; | ||
put: RouteMethod; | ||
del: RouteMethod; | ||
head: RouteMethod; | ||
options: RouteMethod; | ||
redirect: (route: string, location: string, code?: 301 | 302 | 307 | 410 | 451) => void; | ||
permanentRedirect: (route: string, location: string) => void; | ||
} | ||
declare type HttpMethod = HTTPMethod | '*'; | ||
declare type HttpMethodInput = HttpMethod | HttpMethod[]; | ||
interface AbstractIncomingMessage extends IncomingMessage { | ||
protocol?: string; | ||
originalUrl?: string; | ||
} | ||
interface UnroutedRouteDefinition { | ||
path: string; | ||
handle: Handle; | ||
match?: (req: IncomingMessage) => boolean; | ||
options?: Record<string, any>; | ||
} | ||
declare const useParams: <T>() => T; | ||
declare const useBody: <T>() => T; | ||
declare function createUnrouted(config?: { | ||
debug?: boolean | undefined; | ||
cors?: boolean | undefined; | ||
handle404?: boolean | undefined; | ||
plugins?: (UnroutedPlugin | undefined)[] | undefined; | ||
middleware?: (h3.Middleware | undefined)[] | (Handle<any> | undefined)[] | undefined; | ||
prefix?: string | undefined; | ||
hooks?: { | ||
[x: `serve:before-route:${string}`]: (() => void | Promise<void>) | undefined; | ||
"serve:before-route"?: (() => void | Promise<void>) | undefined; | ||
} | undefined; | ||
}): UnroutedRouter; | ||
export { AbstractIncomingMessage, DeepPartial, Hook, HttpMethod, HttpMethodInput, UnroutedPlugin, UnroutedResolvedConfig, UnroutedRouteDefinition, UnroutedRouter, UnroutedUserConfig, createUnrouted, useBody, useParams }; | ||
export { createUnrouted }; |
{ | ||
"name": "unrouted", | ||
"version": "0.1.2", | ||
"description": "Expressive Universal Router", | ||
"repository": "harlan-zw/unrouted", | ||
"version": "0.2.0", | ||
"homepage": "https://github.com/harlan-zw/unrouted#readme", | ||
"bugs": { | ||
"url": "https://github.com/harlan-zw/unrouted/issues" | ||
}, | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/harlan-zw/unlighthouse.git", | ||
"directory": "packages/unrouted" | ||
}, | ||
"funding": "https://github.com/sponsors/harlan-zw", | ||
"author": "Harlan Wilton <harlan@harlanzw.com>", | ||
"sideEffects": false, | ||
"type": "module", | ||
"files": [ | ||
"dist", | ||
"*.d.ts" | ||
], | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.cjs" | ||
} | ||
"require": "./dist/index.cjs", | ||
"import": "./dist/index.mjs" | ||
}, | ||
"./*": "./*" | ||
}, | ||
@@ -17,58 +32,11 @@ "main": "dist/index.cjs", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"build": "siroc build", | ||
"dev": "jiti test/playground", | ||
"lint": "eslint --fix --ext ts .", | ||
"profile": "0x -o -D .profile -P 'autocannon -c 100 -p 10 -d 40 http://localhost:$PORT' ./hello.js", | ||
"release": "yarn test && yarn build && standard-version && npm publish && git push --follow-tags", | ||
"test": "jest" | ||
}, | ||
"dependencies": { | ||
"defu": "^5.0.0", | ||
"h3": "^0.3.8", | ||
"hookable": "^5.0.0", | ||
"radix3": "^0.1.0", | ||
"sirv": "^1.0.19", | ||
"ufo": "^0.7.9", | ||
"unctx": "^1.0.2" | ||
"@unrouted/core": "0.2.0", | ||
"@unrouted/preset-unrouted": "0.2.0", | ||
"h3": "^0.3.9" | ||
}, | ||
"devDependencies": { | ||
"0x": "latest", | ||
"@antfu/eslint-config": "^0.12.1", | ||
"@babel/preset-env": "^7.16.4", | ||
"@types/benchmark": "^2.1.1", | ||
"@types/cookie": "latest", | ||
"@types/cors": "^2.8.12", | ||
"@types/express": "latest", | ||
"@types/jest": "27.0.3", | ||
"@types/koa": "^2.13.4", | ||
"@types/node": "16.11.11", | ||
"@types/supertest": "latest", | ||
"autocannon": "7.5.0", | ||
"babel-jest": "^27.4.2", | ||
"benchmark": "^2.1.4", | ||
"connect": "latest", | ||
"cookie": "latest", | ||
"cors": "^2.8.5", | ||
"destr": "latest", | ||
"eslint": "latest", | ||
"eslint-plugin-jest": "^25.3.0", | ||
"express": "latest", | ||
"get-port": "latest", | ||
"jest": "27.4.3", | ||
"jiti": "1.12.9", | ||
"koa": "^2.13.4", | ||
"listhen": "0.2.5", | ||
"release-it": "^14.11.8", | ||
"siroc": "latest", | ||
"standard-version": "9.3.2", | ||
"supertest": "latest", | ||
"ts-jest": "27.1.0", | ||
"typescript": "4.5.2", | ||
"unbuild": "^0.6.3", | ||
"vite": "^2.6.14" | ||
"scripts": { | ||
"build": "unbuild", | ||
"stub": "unbuild --stub" | ||
} | ||
} | ||
} |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
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
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
3
0
0
1
0
Yes
2112
4
33
2
0
1
+ Added@unrouted/core@0.2.0
+ Added@antfu/utils@0.3.0(transitive)
+ Added@types/throttle-debounce@2.1.0(transitive)
+ Added@unrouted/core@0.2.0(transitive)
+ Added@unrouted/preset-unrouted@0.2.0(transitive)
+ Addedcors@2.8.5(transitive)
+ Addedfs-extra@10.1.0(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedjiti@1.21.6(transitive)
+ Addedjsonfile@6.1.0(transitive)
+ Addedmrmime@2.0.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedsirv@2.0.4(transitive)
+ Addedtotalist@3.0.1(transitive)
+ Addedunconfig@0.2.2(transitive)
+ Addeduniversalify@2.0.1(transitive)
+ Addeduntyped@0.3.0(transitive)
+ Addedvary@1.1.2(transitive)
- Removeddefu@^5.0.0
- Removedhookable@^5.0.0
- Removedradix3@^0.1.0
- Removedsirv@^1.0.19
- Removedufo@^0.7.9
- Removedunctx@^1.0.2
- Removedmrmime@1.0.1(transitive)
- Removedsirv@1.0.19(transitive)
- Removedtotalist@1.1.0(transitive)
Updatedh3@^0.3.9