Skip to content

Commit

Permalink
style: format all repo with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 8, 2023
1 parent 383ea43 commit ffab809
Show file tree
Hide file tree
Showing 7 changed files with 4,172 additions and 1,659 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: autofix.ci # needed to securely identify the workflow
name: autofix.ci # needed to securely identify the workflow

on:
pull_request:
push:
branches: [ "main" ]
branches: ["main"]

permissions:
contents: read
Expand All @@ -23,4 +23,4 @@ jobs:
run: pnpm run lint:fix
- uses: autofix-ci/action@8caa572fd27b0019a65e4c695447089c8d3138b9
with:
commit-message: 'chore: apply automated lint fixes'
commit-message: "chore: apply automated lint fixes"
98 changes: 46 additions & 52 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ All notable changes to this project will be documented in this file. See [standa

- Format with prettier v3 ([da225b9](https://github.com/unjs/h3/commit/da225b9))

### ❤️ Contributors
### ❤️ Contributors

- Pooya Parsa ([@pi0](http://github.com/pi0))
- Daniel Roe <daniel@roe.dev>
Expand Down Expand Up @@ -79,7 +79,7 @@ All notable changes to this project will be documented in this file. See [standa
- **proxy:** Remove external request to speedup ([d4f5440](https://github.com/unjs/h3/commit/d4f5440))
- Add evetHandler wrapper ([d351ba9](https://github.com/unjs/h3/commit/d351ba9))

### ❤️ Contributors
### ❤️ Contributors

- Pooya Parsa ([@pi0](http://github.com/pi0))

Expand All @@ -96,7 +96,7 @@ All notable changes to this project will be documented in this file. See [standa
- Add `release-rc` script ([98d2fa5](https://github.com/unjs/h3/commit/98d2fa5))
- Fix rc release script ([551987a](https://github.com/unjs/h3/commit/551987a))

### ❤️ Contributors
### ❤️ Contributors

- Pooya Parsa ([@pi0](http://github.com/pi0))

Expand Down Expand Up @@ -167,14 +167,14 @@ All notable changes to this project will be documented in this file. See [standa

- Use conventional commits for autofix ([#470](https://github.com/unjs/h3/pull/470))

### ❤️ Contributors
### ❤️ Contributors

- Pooya Parsa ([@pi0](http://github.com/pi0))
- Daniel Roe <daniel@roe.dev>
- Heb ([@Hebilicious](http://github.com/Hebilicious))
- Arkadiusz Sygulski <arkadiusz@sygulski.pl>
- Iain Sproat
- Zhiyuanzmj
- Iain Sproat
- Zhiyuanzmj
- Ngob <ngobenoit@gmail.com>
- Emīls Gulbis ([@emilsgulbis](http://github.com/emilsgulbis))
- Tobias Diez <code@tobiasdiez.com>
Expand All @@ -186,26 +186,25 @@ All notable changes to this project will be documented in this file. See [standa

[compare changes](https://github.com/unjs/h3/compare/v1.7.0...v1.7.1)


### 🩹 Fixes

- **fetchWithEvent:** Allow customizing fetch impl type ([#414](https://github.com/unjs/h3/pull/414))
- **fetchWithEvent:** Allow customizing fetch impl type ([#414](https://github.com/unjs/h3/pull/414))

### 💅 Refactors

- Improve `H3Error` ([#415](https://github.com/unjs/h3/pull/415))
- Improve `H3Error` ([#415](https://github.com/unjs/h3/pull/415))

### 📖 Documentation

- Update link to how it works ([3dd2376](https://github.com/unjs/h3/commit/3dd2376))
- Update link to how it works ([3dd2376](https://github.com/unjs/h3/commit/3dd2376))

### 🏡 Chore

- **release:** V1.7.0 ([709708f](https://github.com/unjs/h3/commit/709708f))
- Add codecov.yml ([33f434f](https://github.com/unjs/h3/commit/33f434f))
- Ignore eslint warning ([4c609b2](https://github.com/unjs/h3/commit/4c609b2))
- **release:** V1.7.0 ([709708f](https://github.com/unjs/h3/commit/709708f))
- Add codecov.yml ([33f434f](https://github.com/unjs/h3/commit/33f434f))
- Ignore eslint warning ([4c609b2](https://github.com/unjs/h3/commit/4c609b2))

### ❤️ Contributors
### ❤️ Contributors

- Pooya Parsa ([@pi0](http://github.com/pi0))
- Daniel Roe <daniel@roe.dev>
Expand All @@ -215,36 +214,35 @@ All notable changes to this project will be documented in this file. See [standa

[compare changes](https://github.com/unjs/h3/compare/v1.6.6...v1.7.0)


### 🚀 Enhancements

- **proxy:** Support `onResponse` callback ([#368](https://github.com/unjs/h3/pull/368))
- **useSession:** Support custom session id generator ([#390](https://github.com/unjs/h3/pull/390))
- `event.handled` flag ([#410](https://github.com/unjs/h3/pull/410))
- **proxy:** Support `onResponse` callback ([#368](https://github.com/unjs/h3/pull/368))
- **useSession:** Support custom session id generator ([#390](https://github.com/unjs/h3/pull/390))
- `event.handled` flag ([#410](https://github.com/unjs/h3/pull/410))

### 🩹 Fixes

- **types:** Type for get router parameter utils ([#400](https://github.com/unjs/h3/pull/400))
- **proxy:** Split cookie headers properly with native node fetch ([#408](https://github.com/unjs/h3/pull/408))
- **readRawBody:** Handle body as object ([#403](https://github.com/unjs/h3/pull/403))
- **router:** Send 204 with empty string in preemptive mode instead of 404 ([#409](https://github.com/unjs/h3/pull/409))
- **cache, proxy, response:** Avoid sending handled events ([#411](https://github.com/unjs/h3/pull/411))
- **types:** Type for get router parameter utils ([#400](https://github.com/unjs/h3/pull/400))
- **proxy:** Split cookie headers properly with native node fetch ([#408](https://github.com/unjs/h3/pull/408))
- **readRawBody:** Handle body as object ([#403](https://github.com/unjs/h3/pull/403))
- **router:** Send 204 with empty string in preemptive mode instead of 404 ([#409](https://github.com/unjs/h3/pull/409))
- **cache, proxy, response:** Avoid sending handled events ([#411](https://github.com/unjs/h3/pull/411))

### 📖 Documentation

- Add event as first arg for proxyRequest ([3e5f427](https://github.com/unjs/h3/commit/3e5f427))
- Add event as first arg for proxyRequest ([3e5f427](https://github.com/unjs/h3/commit/3e5f427))

### 🏡 Chore

- Update dependencies ([8468b90](https://github.com/unjs/h3/commit/8468b90))
- Lint ([3494084](https://github.com/unjs/h3/commit/3494084))
- Update destr to v2 ([bb59c69](https://github.com/unjs/h3/commit/bb59c69))
- Update dependencies ([8468b90](https://github.com/unjs/h3/commit/8468b90))
- Lint ([3494084](https://github.com/unjs/h3/commit/3494084))
- Update destr to v2 ([bb59c69](https://github.com/unjs/h3/commit/bb59c69))

### ❤️ Contributors
### ❤️ Contributors

- Pooya Parsa ([@pi0](http://github.com/pi0))
- 魔王少年 ([@maou-shonen](http://github.com/maou-shonen))
- Ígor Jacaúna
- Ígor Jacaúna
- Enkot ([@enkot](http://github.com/enkot))
- Cerino Ligutom III ([@zeferinix](http://github.com/zeferinix))
- Sébastien Chopin <seb@nuxtjs.com>
Expand All @@ -253,79 +251,75 @@ All notable changes to this project will be documented in this file. See [standa

[compare changes](https://github.com/unjs/h3/compare/v1.6.5...v1.6.6)


### 🩹 Fixes

- **getRequestURL:** Normalize double slashes ([b5d2972](https://github.com/unjs/h3/commit/b5d2972))
- **getRequestURL:** Make `x-forwarded-host` support opt-in ([2fce169](https://github.com/unjs/h3/commit/2fce169))
- **event:** Normalize `event.path` ([981c89f](https://github.com/unjs/h3/commit/981c89f))
- **getRequestURL:** Normalize double slashes ([b5d2972](https://github.com/unjs/h3/commit/b5d2972))
- **getRequestURL:** Make `x-forwarded-host` support opt-in ([2fce169](https://github.com/unjs/h3/commit/2fce169))
- **event:** Normalize `event.path` ([981c89f](https://github.com/unjs/h3/commit/981c89f))

### 🏡 Chore

- Fix eslint issue ([9b968ba](https://github.com/unjs/h3/commit/9b968ba))
- Update dependencies ([b7126b8](https://github.com/unjs/h3/commit/b7126b8))
- Remove unused interface ([aadec3d](https://github.com/unjs/h3/commit/aadec3d))
- Fix eslint issue ([9b968ba](https://github.com/unjs/h3/commit/9b968ba))
- Update dependencies ([b7126b8](https://github.com/unjs/h3/commit/b7126b8))
- Remove unused interface ([aadec3d](https://github.com/unjs/h3/commit/aadec3d))

### ✅ Tests

- Add tests for `getRequestURL` ([d510483](https://github.com/unjs/h3/commit/d510483))
- Add tests for `getRequestURL` ([d510483](https://github.com/unjs/h3/commit/d510483))

### ❤️ Contributors
### ❤️ Contributors

- Pooya Parsa ([@pi0](http://github.com/pi0))

## v1.6.5

[compare changes](https://github.com/unjs/h3/compare/v1.6.4...v1.6.5)


### 🩹 Fixes

- **readRawBody:** Resolve cached promise before normalizing buffer ([2e472e8](https://github.com/unjs/h3/commit/2e472e8))
- **readRawBody:** Resolve cached promise before normalizing buffer ([2e472e8](https://github.com/unjs/h3/commit/2e472e8))

### 🏡 Chore

- Update dependencies ([a6ccd2c](https://github.com/unjs/h3/commit/a6ccd2c))
- Lint ([e437f55](https://github.com/unjs/h3/commit/e437f55))
- Update dependencies ([a6ccd2c](https://github.com/unjs/h3/commit/a6ccd2c))
- Lint ([e437f55](https://github.com/unjs/h3/commit/e437f55))

### ❤️ Contributors
### ❤️ Contributors

- Pooya Parsa ([@pi0](http://github.com/pi0))

## v1.6.4

[compare changes](https://github.com/unjs/h3/compare/v1.6.3...v1.6.4)


### 🩹 Fixes

- **readRawBody:** Always return buffer without encoding ([19d133d](https://github.com/unjs/h3/commit/19d133d))
- **readRawBody:** Always return buffer without encoding ([19d133d](https://github.com/unjs/h3/commit/19d133d))

### ❤️ Contributors
### ❤️ Contributors

- Pooya Parsa ([@pi0](http://github.com/pi0))

## v1.6.3

[compare changes](https://github.com/unjs/h3/compare/v1.6.2...v1.6.3)


### 🩹 Fixes

- **readBody, readRawBody:** Handle raw body as buffer ([#366](https://github.com/unjs/h3/pull/366))
- **readBody, readRawBody:** Handle raw body as buffer ([#366](https://github.com/unjs/h3/pull/366))

### 📖 Documentation

- Missing parentheses ([#362](https://github.com/unjs/h3/pull/362))
- Missing parentheses ([#362](https://github.com/unjs/h3/pull/362))

### 🏡 Chore

- Update changelog ([e199df3](https://github.com/unjs/h3/commit/e199df3))
- Update changelog ([e199df3](https://github.com/unjs/h3/commit/e199df3))

### ❤️ Contributors
### ❤️ Contributors

- Johann Schopplich ([@johannschopplich](http://github.com/johannschopplich))
- Roger!
- Roger!
- Pooya Parsa ([@pi0](http://github.com/pi0))

## v1.6.2
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ import { createApp, eventHandler, toNodeListener } from "h3";
const app = createApp();
app.use(
"/",
eventHandler(() => "Hello world!")
eventHandler(() => "Hello world!"),
);

createServer(toNodeListener(app)).listen(process.env.PORT || 3000);
Expand All @@ -101,7 +101,7 @@ import { listen } from "listhen";
const app = createApp();
app.use(
"/",
eventHandler(() => "Hello world!")
eventHandler(() => "Hello world!"),
);

listen(toNodeListener(app));
Expand All @@ -121,11 +121,11 @@ const app = createApp();
const router = createRouter()
.get(
"/",
eventHandler(() => "Hello World!")
eventHandler(() => "Hello World!"),
)
.get(
"/hello/:name",
eventHandler((event) => `Hello ${event.context.params.name}!`)
eventHandler((event) => `Hello ${event.context.params.name}!`),
);

app.use(router);
Expand All @@ -143,14 +143,14 @@ For using nested routers, see [this example](https://stackblitz.com/edit/github-
// Handle can directly return object or Promise<object> for JSON response
app.use(
"/api",
eventHandler((event) => ({ url: event.node.req.url }))
eventHandler((event) => ({ url: event.node.req.url })),
);

// We can have better matching other than quick prefix match
app.use(
"/odd",
eventHandler(() => "Is odd!"),
{ match: (url) => url.substr(1) % 2 }
{ match: (url) => url.substr(1) % 2 },
);

// Handle can directly return string for HTML response
Expand All @@ -160,11 +160,11 @@ app.use(eventHandler(() => "<h1>Hello world!</h1>"));
app
.use(
"/1",
eventHandler(() => "<h1>Hello world!</h1>")
eventHandler(() => "<h1>Hello world!</h1>"),
)
.use(
"/2",
eventHandler(() => "<h1>Goodbye!</h1>")
eventHandler(() => "<h1>Goodbye!</h1>"),
);

// We can proxy requests and rewrite cookie's domain and path
Expand All @@ -181,16 +181,16 @@ app.use(
cookiePathRewrite: {
"/": "/api",
},
})
)
}),
),
);

// Legacy middleware with 3rd argument are automatically promisified
app.use(
fromNodeMiddleware((req, res, next) => {
req.setHeader("x-foo", "bar");
next();
})
}),
);

// Lazy loaded routes using { lazy: true }
Expand Down Expand Up @@ -311,7 +311,7 @@ PRs are welcome to add your packages.
- [h3-valibot](https://github.com/intevel/h3-valibot)
- `useValidateBody(event, schema)`
- `useValidateParams(event, schema)`

## License

MIT
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@
"zod": "^3.21.4"
},
"packageManager": "pnpm@8.6.12"
}
}
Loading

0 comments on commit ffab809

Please sign in to comment.