itty-router 2.6.4 → 2.6.6
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/CHANGELOG.md +42 -0
- package/README.md +2 -1
- package/package.json +7 -23
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
## Changelog
|
|
2
|
+
Until this library makes it to a production release of v1.x, **minor versions may contain breaking changes to the API**. After v1.x, semantic versioning will be honored, and breaking changes will only occur under the umbrella of a major version bump.
|
|
3
|
+
|
|
4
|
+
[@SupremeTechnopriest)(https://github.com/SupremeTechnopriest) - improved TypeScript support and documentation! :D\
|
|
5
|
+
|
|
6
|
+
- **v2.6.4** - merely a republish, attempting to solve NPM test scores vs CI/CD
|
|
7
|
+
- **v2.6.2** - fixes issue with using base path of "/" with route definitions starting with "/" (creating double slash)
|
|
8
|
+
- **v2.6.1** - fixes named export in ESM/mjs export
|
|
9
|
+
- **v2.6.0** - package now is hybrid export, supporting both ESM (.mjs) and CJS (.js) minified versions
|
|
10
|
+
- **v2.5.3** - corrects type for router.handle to return Promise<any>
|
|
11
|
+
- **v2.5.2** - fixes issue with arrow functions in CommonJS named exports (rare issue)
|
|
12
|
+
- **v2.5.1** - added context to Cloudflare ES module syntax example (credit [@jcapogna](https://github.com/jcapogna))
|
|
13
|
+
- **v2.5.0** - improved TypeScript docs/types (thanks [@SupremeTechnopriest](https://github.com/SupremeTechnopriest)!)
|
|
14
|
+
- **v2.4.9** - fixed the cursed "optional" file format capturing bug - RIP all the bytes lost
|
|
15
|
+
- **v2.4.6** - fixed README issues
|
|
16
|
+
- **v2.4.1** - fixed type errors introduced with 2.4.0
|
|
17
|
+
- **v2.4.0** - HUGE internal code-golfing refactor thanks to [@taralx](https://github.com/taralx)! Super cool work on this!!!
|
|
18
|
+
- **v2.3.10** - fix: dots now properly escaped (e.g. /image.jpg should not match /imageXjpg)
|
|
19
|
+
- **v2.3.9** - dev fixes: [@taralx](https://github.com/taralx) improved QOL issues for test writers and dev installers
|
|
20
|
+
- **v2.3.7** - fix: :id.:format not resolving (only conditional format would match)
|
|
21
|
+
- **v2.3.0** - feature: request handler will be passed request.proxy (if found) or request (if not) - allowing for middleware magic downstream...
|
|
22
|
+
- **v2.2.0** - feature: base path (option) is now included in the route param parsing...
|
|
23
|
+
- **v2.1.1** - fix: should now be strict-mode compatible
|
|
24
|
+
- **v2.1.0** - now handles the problematic . character within a param (e.g. /:url/action with /google.com/action)
|
|
25
|
+
- **v2.0.7** - shaved a few more characters in the regex
|
|
26
|
+
- **v2.0.0** - API break: `Router({ else: missingHandler })` has been replaced with `router.all('*', missingHandler)`, and now "all" channel respects order of entry
|
|
27
|
+
- **v1.6.0** - added { else: missingHandler } to options for 404 catch-alls (thanks to the discussion with [@martinffx](https://github.com/martinffx))
|
|
28
|
+
- **v1.5.0** - added '.all(route, handler)' handling for passthrough middleware
|
|
29
|
+
- **v1.4.3** - fixed nested routers using simple "/" routes
|
|
30
|
+
- **v1.4.1** - fixed typings for extra args (thanks [@rodrigoaddor](https://github.com/rodrigoaddor))
|
|
31
|
+
- **v1.4.0** - adds support for optional format params (e.g. "/:id.:format?" --> { params: { id: '13', format: 'jpg' }})
|
|
32
|
+
- **v1.3.0** - adds support for multiple args to handle(request, ...args) method (@hunterloftis)
|
|
33
|
+
- **v1.2.2** - fix: require verify/build pass before publishing and fixed README badges (should point to v1.x branch)
|
|
34
|
+
- **v1.2.0** - feature: chainable route declarations (with test)... that didn't take long...
|
|
35
|
+
- **v1.1.1** - updated README to reflect that chaining actually never was working... (not a breaking change, as no code could have been using it)
|
|
36
|
+
- **v1.1.0** - feature: added single option `{ base: '/some/path' }` to `Router` for route prefixing, fix: trailing wildcard issue (e.g. `/foo/*` should match `/foo`)
|
|
37
|
+
- **v1.0.0** - production release, stamped into gold from x0.9.7
|
|
38
|
+
- **v0.9.0** - added support for multiple handlers (middleware)
|
|
39
|
+
- **v0.8.0** - deep minification pass and build steps for final module
|
|
40
|
+
- **v0.7.0** - removed { path } from request handler context, travis build fixed, added coveralls, improved README docs
|
|
41
|
+
- **v0.6.0** - added types to project for vscode intellisense (thanks [@mvasigh](https://github.com/mvasigh))
|
|
42
|
+
- **v0.5.4** - fix: wildcard routes properly supported
|
package/README.md
CHANGED
|
@@ -15,7 +15,8 @@ Tiny, zero-dependency router with route param and query parsing - built for [Clo
|
|
|
15
15
|
|
|
16
16
|
### Addons & Related Libraries
|
|
17
17
|
1. [itty-router-extras](https://www.npmjs.com/package/itty-router-extras) - adds quality-of-life improvements and utility functions for simplifying request/response code (e.g. middleware, cookies, body parsing, json handling, errors, and an itty version with automatic exception handling)!
|
|
18
|
-
2. [itty-
|
|
18
|
+
2. [itty-cors](https://www.npmjs.com/package/itty-cors) (early access/alpha) - Easy CORS handling for itty APIs.
|
|
19
|
+
2. [itty-durable](https://www.npmjs.com/package/itty-durable) - creates a more direct object-like API for interacting with [Cloudflare Durable Objects](https://developers.cloudflare.com/workers/learning/using-durable-objects).
|
|
19
20
|
|
|
20
21
|
## Features
|
|
21
22
|
- [x] Tiny ([~500 bytes](https://bundlephobia.com/package/itty-router) compressed), with zero dependencies.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "itty-router",
|
|
3
|
-
"version": "2.6.
|
|
4
|
-
"description": "Tiny, zero-dependency router
|
|
3
|
+
"version": "2.6.6",
|
|
4
|
+
"description": "Tiny, zero-dependency API router - built for Cloudflare Workers, but works everywhere!",
|
|
5
5
|
"sourceType": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist/itty-router.min.js",
|
|
@@ -19,31 +19,15 @@
|
|
|
19
19
|
},
|
|
20
20
|
"types": "./dist/itty-router.d.ts",
|
|
21
21
|
"keywords": [
|
|
22
|
+
"api",
|
|
22
23
|
"router",
|
|
23
24
|
"cloudflare",
|
|
24
|
-
"worker",
|
|
25
25
|
"workers",
|
|
26
|
+
"worker",
|
|
26
27
|
"serverless",
|
|
27
|
-
"api",
|
|
28
|
-
"express",
|
|
29
|
-
"regex",
|
|
30
|
-
"routing",
|
|
31
|
-
"handler",
|
|
32
|
-
"params",
|
|
33
|
-
"request",
|
|
34
|
-
"response",
|
|
35
|
-
"service worker",
|
|
36
|
-
"sw",
|
|
37
|
-
"cf",
|
|
38
|
-
"optional",
|
|
39
|
-
"middleware",
|
|
40
|
-
"nested",
|
|
41
28
|
"rest",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"parameters",
|
|
45
|
-
"durable",
|
|
46
|
-
"objects"
|
|
29
|
+
"serviceworker",
|
|
30
|
+
"nested"
|
|
47
31
|
],
|
|
48
32
|
"scripts": {
|
|
49
33
|
"docs:dev": "cp README.md ./docs/pages/README.md && vite",
|
|
@@ -63,7 +47,7 @@
|
|
|
63
47
|
"uglify:cjs": "uglifyjs src/itty-router.js -c -m --toplevel > dist/itty-router.min.js",
|
|
64
48
|
"build:esm": "esbuild src/itty-router.js --format=esm --outfile=./dist/itty-router.mjs",
|
|
65
49
|
"postbuild": "node check-size.js",
|
|
66
|
-
"release": "release --tag --push"
|
|
50
|
+
"release": "release --tag --push --patch"
|
|
67
51
|
},
|
|
68
52
|
"repository": {
|
|
69
53
|
"type": "git",
|