Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
package: publish v0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
boywithkeyboard committed Jun 14, 2023
1 parent 1936b16 commit e68c0a6
Show file tree
Hide file tree
Showing 16 changed files with 67 additions and 34 deletions.
33 changes: 33 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
## [v0.11.0](https://github.com/azurystudio/cheetah/releases/tag/v0.11.0)

- **Bug Fixes**

- Decode query parameters.

- **New Features**

- **Preflight Mode.**

If enabled, cheetah will attempt to find the matching `.get()` handler for an incoming HEAD request. Your existing `.head()` handlers won't be impacted.

```ts
new cheetah({
preflight: true
})
```

- You can now configure the `cache` or `cors` option for an entire collection of routes.

```ts
new Collection({
cache: false,
cors: '*'
})
```

*These won't overwrite the options set for individual routes.*

- **Revisions**

- The `cache.duration` option has been deprecated. Please use the `cache.maxAge` option instead.

## [v0.10.0](https://github.com/azurystudio/cheetah/releases/tag/v0.10.0)

- **New Features**
Expand Down
4 changes: 2 additions & 2 deletions guide/accessories/jwt.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## jwt (JSON Web Token)

```ts
import { jwt } from 'https://deno.land/x/cheetah@v0.10.0/x/mod.ts'
import { jwt } from 'https://deno.land/x/cheetah@v0.11.0/x/mod.ts'
```

#### Generating a Secret
Expand All @@ -13,7 +13,7 @@ You can parse either a [CryptoKey](https://developer.mozilla.org/en-US/docs/Web/
This key can then be parsed to the functions.

```ts
import { createKey } from 'https://deno.land/x/cheetah@v0.10.0/x/mod.ts'
import { createKey } from 'https://deno.land/x/cheetah@v0.11.0/x/mod.ts'

const key = await createKey()
```
Expand Down
2 changes: 1 addition & 1 deletion guide/accessories/otp.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## otp (One Time Password)

```ts
import { otp } from 'https://deno.land/x/cheetah@v0.10.0/x/mod.ts'
import { otp } from 'https://deno.land/x/cheetah@v0.11.0/x/mod.ts'
```

### Usage
Expand Down
2 changes: 1 addition & 1 deletion guide/accessories/sendMail.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
> **Note**: This module is specifically designed for Cloudflare Workers as it uses [mailchannels](https://blog.cloudflare.com/sending-email-from-workers-with-mailchannels) under the hood, which is free if you deploy your app to Cloudflare Workers.
```ts
import { sendMail } from 'https://deno.land/x/cheetah@v0.10.0/x/mod.ts'
import { sendMail } from 'https://deno.land/x/cheetah@v0.11.0/x/mod.ts'

await sendMail({
subject: 'Example',
Expand Down
8 changes: 4 additions & 4 deletions guide/deploying.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cheetah can run on [Cloudflare Workers](https://workers.cloudflare.com) as well
> **Note**: This example uses the [Module Worker](https://blog.cloudflare.com/workers-javascript-modules) syntax.
```ts
import cheetah from 'https://deno.land/x/cheetah@v0.10.0/mod.ts'
import cheetah from 'https://deno.land/x/cheetah@v0.11.0/mod.ts'

const app = new cheetah()
.get('/', () => 'Hello World')
Expand All @@ -22,14 +22,14 @@ export default app // or: export default { fetch: app.fetch }
To compile your application into a single JavaScript file that you can deploy to Cloudflare Workers, run the following command:

```bash
# deno run -A https://deno.land/x/cheetah@v0.10.0/build.ts <input> <output>
deno run -A https://deno.land/x/cheetah@v0.10.0/build.ts mod.ts mod.js
# deno run -A https://deno.land/x/cheetah@v0.11.0/build.ts <input> <output>
deno run -A https://deno.land/x/cheetah@v0.11.0/build.ts mod.ts mod.js
```

### Deno (Deploy)

```ts
import cheetah from 'https://deno.land/x/cheetah@v0.10.0/mod.ts'
import cheetah from 'https://deno.land/x/cheetah@v0.11.0/mod.ts'
import { serve } from 'https://deno.land/std@0.191.0/http/server.ts'

const app = new cheetah()
Expand Down
4 changes: 2 additions & 2 deletions guide/get_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
#### Deno

```bash
deno run --allow-read=. --allow-write=. --allow-net https://deno.land/x/cheetah@v0.10.0/new.ts --template deno
deno run --allow-read=. --allow-write=. --allow-net https://deno.land/x/cheetah@v0.11.0/new.ts --template deno
```

#### Cloudflare

```bash
deno run --allow-read=. --allow-write=. --allow-net https://deno.land/x/cheetah@v0.10.0/new.ts --template cloudflare
deno run --allow-read=. --allow-write=. --allow-net https://deno.land/x/cheetah@v0.11.0/new.ts --template cloudflare
```

- Now you should have a basic app with good default preferences. **Make sure to read the `readme.md` file in your project root to learn more.**
2 changes: 1 addition & 1 deletion guide/nesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
You can split your app into multiple files using **collections**. Creating a new collection is also quite simple:

```ts
import cheetah, { Collection } from 'https://deno.land/x/cheetah@v0.10.0/mod.ts'
import cheetah, { Collection } from 'https://deno.land/x/cheetah@v0.11.0/mod.ts'

const collection = new Collection()
.get('/example', () => 'Hello World')
Expand Down
12 changes: 6 additions & 6 deletions guide/parsing_and_validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
This enables the conversion of a FormData request body into a JSON object *(if the request body has the MIME type `multipart/form-data`)*.

```ts
import cheetah from 'https://deno.land/x/cheetah@v0.10.0/mod.ts'
import zod, { z } from 'https://deno.land/x/cheetah@v0.10.0/validator/zod.ts'
import cheetah from 'https://deno.land/x/cheetah@v0.11.0/mod.ts'
import zod, { z } from 'https://deno.land/x/cheetah@v0.11.0/validator/zod.ts'

const app = new cheetah({
validator: zod
Expand All @@ -30,8 +30,8 @@ app.get('/example', {
- #### Setup

```ts
import cheetah from 'https://deno.land/x/cheetah@v0.10.0/mod.ts'
import typebox, { Type } from 'https://deno.land/x/cheetah@v0.10.0/validator/typebox.ts'
import cheetah from 'https://deno.land/x/cheetah@v0.11.0/mod.ts'
import typebox, { Type } from 'https://deno.land/x/cheetah@v0.11.0/validator/typebox.ts'

const app = new cheetah({
validator: typebox
Expand Down Expand Up @@ -103,8 +103,8 @@ app.get('/example', {
- #### Setup

```ts
import cheetah from 'https://deno.land/x/cheetah@v0.10.0/mod.ts'
import zod, { z } from 'https://deno.land/x/cheetah@v0.10.0/validator/zod.ts'
import cheetah from 'https://deno.land/x/cheetah@v0.11.0/mod.ts'
import zod, { z } from 'https://deno.land/x/cheetah@v0.11.0/validator/zod.ts'
const app = new cheetah({
validator: zod
Expand Down
4 changes: 2 additions & 2 deletions guide/plugins/helmet.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
> This plugin is based on [express.js' helmet](https://github.com/helmetjs/helmet).
```ts
import cheetah from 'https://deno.land/x/cheetah@v0.10.0/mod.ts'
import helmet from 'https://deno.land/x/cheetah@v0.10.0/plugins/helmet.ts'
import cheetah from 'https://deno.land/x/cheetah@v0.11.0/mod.ts'
import helmet from 'https://deno.land/x/cheetah@v0.11.0/plugins/helmet.ts'

const app = new cheetah()
.use(helmet())
Expand Down
4 changes: 2 additions & 2 deletions guide/plugins/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If you want to add additional functionality to your application on a global, per
Plugins let you create and publish reusable functions for your own and open source purposes.

```ts
import cheetah, { createPlugin } from 'https://deno.land/x/cheetah@v0.10.0/mod.ts'
import cheetah, { createPlugin } from 'https://deno.land/x/cheetah@v0.11.0/mod.ts'

export const myPlugin = createPlugin<{
option: string // < settings the user can pass to the plugin
Expand All @@ -42,7 +42,7 @@ const app = new cheetah()
Alternatively, you can create one without settings:

```ts
import cheetah, { createPlugin } from 'https://deno.land/x/cheetah@v0.10.0/mod.ts'
import cheetah, { createPlugin } from 'https://deno.land/x/cheetah@v0.11.0/mod.ts'

export const myPlugin = createPlugin({
beforeParsing(c) { // access context to modify request/response
Expand Down
4 changes: 2 additions & 2 deletions guide/reasons/chaining_and_nesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## 🔗 Chaining

```ts
import cheetah from 'https://deno.land/x/cheetah@v0.10.0/mod.ts'
import cheetah from 'https://deno.land/x/cheetah@v0.11.0/mod.ts'

const app = new cheetah()
.get('/cake', () => '🎂') // GET '/cake'
Expand All @@ -16,7 +16,7 @@ const app = new cheetah()
## 🪹 Nesting

```ts
import cheetah, { Collection } from 'https://deno.land/x/cheetah@v0.10.0/mod.ts'
import cheetah, { Collection } from 'https://deno.land/x/cheetah@v0.11.0/mod.ts'

const fastFood = new Collection()
.get('/burger', () => '🍔') // GET '/fast-food/burger'
Expand Down
4 changes: 2 additions & 2 deletions guide/reasons/light.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

| Module | Size |
| --- | --- |
| Core | 10.84 KB |
| Validator (TypeBox) | 120.48 KB |
| Core | 11.75 KB |
| Validator (TypeBox) | 119.7 KB |
| Validator (Zod) | 52.91 KB |
| Accessories | 36.04 KB |
4 changes: 2 additions & 2 deletions guide/reasons/schema_validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ When building a large API with cheetah, you probably want some sort of validatio
With cheetah, this is fairly straightforward. The following example uses [Zod](https://github.com/colinhacks/zod) as the validator and verifies that the body of the incoming request is of the type string and has the format of an emoji.

```ts
import cheetah from 'https://deno.land/x/cheetah@v0.10.0/mod.ts'
import zod, { z } from 'https://deno.land/x/cheetah@v0.10.0/validator/zod.ts'
import cheetah from 'https://deno.land/x/cheetah@v0.11.0/mod.ts'
import zod, { z } from 'https://deno.land/x/cheetah@v0.11.0/validator/zod.ts'

const app = new cheetah({
validator: zod
Expand Down
6 changes: 3 additions & 3 deletions guide/reasons/simple.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
cheetah has built-in support for [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS). You can configure it according to the [specification](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin) of the `Access-Control-Allow-Origin` header.

```ts
import cheetah from 'https://deno.land/x/cheetah@v0.10.0/mod.ts'
import cheetah from 'https://deno.land/x/cheetah@v0.11.0/mod.ts'

const app = new cheetah({
cors: '*'
Expand All @@ -19,7 +19,7 @@ const app = new cheetah({
cheetah has out-of-the-box support for caching using the [Cache API](https://developer.mozilla.org/en-US/docs/Web/API/Cache).

```ts
import cheetah from 'https://deno.land/x/cheetah@v0.10.0/mod.ts'
import cheetah from 'https://deno.land/x/cheetah@v0.11.0/mod.ts'

const app = new cheetah({
cache: {
Expand All @@ -36,7 +36,7 @@ const app = new cheetah({
cheetah prints out all incoming requests and the status code of their corresponding response to the console when you enable debug mode.

```ts
import cheetah from 'https://deno.land/x/cheetah@v0.10.0/mod.ts'
import cheetah from 'https://deno.land/x/cheetah@v0.11.0/mod.ts'

const app = new cheetah({
debug: true
Expand Down
6 changes: 3 additions & 3 deletions guide/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### Suggested

```ts
import cheetah from 'https://deno.land/x/cheetah@v0.10.0/mod.ts'
import cheetah from 'https://deno.land/x/cheetah@v0.11.0/mod.ts'

// #1
const app = new cheetah()
Expand All @@ -32,7 +32,7 @@ const app = new cheetah()
[Express.js](https://github.com/expressjs/express)ish

```ts
import cheetah from 'https://deno.land/x/cheetah@v0.10.0/mod.ts'
import cheetah from 'https://deno.land/x/cheetah@v0.11.0/mod.ts'

const app = new cheetah()

Expand All @@ -48,7 +48,7 @@ app.get('/b', c => {
[Hono](https://github.com/honojs/hono)ish

```ts
import cheetah from 'https://deno.land/x/cheetah@v0.10.0/mod.ts'
import cheetah from 'https://deno.land/x/cheetah@v0.11.0/mod.ts'

const app = new cheetah()
.get('/a', c => c.text('Hello World'))
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
### Sneak Peek

```ts
import cheetah from 'https://deno.land/x/cheetah@v0.10.0/mod.ts'
import cheetah from 'https://deno.land/x/cheetah@v0.11.0/mod.ts'
import { serve } from 'https://deno.land/std@0.191.0/http/server.ts'

const app = new cheetah()
Expand Down

0 comments on commit e68c0a6

Please sign in to comment.