Skip to content

Commit

Permalink
feat: 0.21.0
Browse files Browse the repository at this point in the history
  • Loading branch information
asos-craigmorten committed Aug 17, 2020
1 parent a85c562 commit 0f490c5
Show file tree
Hide file tree
Showing 20 changed files with 145 additions and 255 deletions.
12 changes: 6 additions & 6 deletions .github/API/application.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Adapted from the [ExpressJS API Docs](https://expressjs.com/en/4x/api.html).
The `app` object conventionally denotes the Opine application. Create it by calling the top-level `opine()` function exported by the Opine module:

```ts
import opine from "https://deno.land/x/opine@main/mod.ts";
import opine from "https://deno.land/x/opine@0.21.0/mod.ts";

const app = opine();

Expand Down Expand Up @@ -59,7 +59,7 @@ The `app.mountpath` property contains one or more path patterns on which a sub-a
> A sub-app is an instance of `opine` that may be used for handling the request to a route.
```ts
import opine from "https://deno.land/x/opine@main/mod.ts";
import opine from "https://deno.land/x/opine@0.21.0/mod.ts";

const app = opine(); // the main app
const admin = opine(); // the sub app
Expand Down Expand Up @@ -447,7 +447,7 @@ app.get("/", function (req, res) {
Binds and listens for connections on the specified address. This method is nearly identical to Deno's [http.listenAndServe()](https://doc.deno.land/https/deno.land/std/http/server.ts#listenAndServe). An optional callback can be provided which will be executed after the server starts listening for requests - this is provided for legacy reasons to aid in transitions from Express on Node.

```ts
import opine from "https://deno.land/x/opine@main/mod.ts";
import opine from "https://deno.land/x/opine@0.21.0/mod.ts";

const app = opine();

Expand Down Expand Up @@ -477,7 +477,7 @@ Binds and listens for connections on the specified numerical port. If no port is
This method is supported for legacy reasons to aid in transitions from Express on Node.

```ts
import opine from "https://deno.land/x/opine@main/mod.ts";
import opine from "https://deno.land/x/opine@0.21.0/mod.ts";

const app = opine();
const PORT = 3000;
Expand All @@ -490,7 +490,7 @@ app.listen(PORT, () => console.log(`Server started on port ${PORT}`));
Binds and listens for connections using the specified [http.HTTPOptions](https://doc.deno.land/https/deno.land/std/http/server.ts#HTTPOptions). This method is nearly identical to Deno's [http.listenAndServe()](https://doc.deno.land/https/deno.land/std/http/server.ts#listenAndServe). An optional callback can be provided which will be executed after the server starts listening for requests - this is provided for legacy reasons to aid in transitions from Express on Node.

```ts
import opine from "https://deno.land/x/opine@main/mod.ts";
import opine from "https://deno.land/x/opine@0.21.0/mod.ts";

const app = opine();

Expand All @@ -502,7 +502,7 @@ app.listen({ port: 3000 });
Binds and listens for connections using the specified [http.HTTPSOptions](https://doc.deno.land/https/deno.land/std/http/server.ts#HTTPSOptions). This method is nearly identical to Deno's [http.listenAndServeTLS()](https://doc.deno.land/https/deno.land/std/http/server.ts#listenAndServeTLS). An optional callback can be provided which will be executed after the server starts listening for requests - this is provided for legacy reasons to aid in transitions from Express on Node.

```ts
import opine from "https://deno.land/x/opine@main/mod.ts";
import opine from "https://deno.land/x/opine@0.21.0/mod.ts";

const app = opine();

Expand Down
8 changes: 4 additions & 4 deletions .github/API/middlewares.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A new `parsedBody` object containing the parsed data is populated on the `reques
> As `req.parsedBody`'s shape is based on user-controlled input, all properties and values in this object are untrusted and should be validated before trusting. For example, `req.parsedBody.foo.toString()` may fail in multiple ways, for example `foo` may not be there or may not be a string, and `toString` may not be a function and instead a string or other user-input.
```ts
import { opine, json } from "https://deno.land/x/opine@main/mod.ts";
import { opine, json } from "https://deno.land/x/opine@0.21.0/mod.ts";

const app = opine();

Expand Down Expand Up @@ -46,7 +46,7 @@ A new `parsedBody` `Buffer` containing the parsed data is populated on the `requ
> As `req.parsedBody`'s shape is based on user-controlled input, all properties and values in this object are untrusted and should be validated before trusting. For example, `req.parsedBody.toString()` may fail in multiple ways, for example stacking multiple parsers `req.parsedBody` may be from a different parser. Testing that `req.parsedBody` is a `Buffer` before calling buffer methods is recommended.
```ts
import { opine, raw } from "https://deno.land/x/opine@main/mod.ts";
import { opine, raw } from "https://deno.land/x/opine@0.21.0/mod.ts";

const app = opine();

Expand Down Expand Up @@ -142,7 +142,7 @@ A new `parsedBody` string containing the parsed data is populated on the `reques
> As `req.parsedBody`'s shape is based on user-controlled input, all properties and values in this object are untrusted and should be validated before trusting. For example, `req.parsedBody.trim()` may fail in multiple ways, for example stacking multiple parsers `req.parsedBody` may be from a different parser. Testing that `req.parsedBody` is a string before calling string methods is recommended.
```ts
import { opine, text } from "https://deno.land/x/opine@main/mod.ts";
import { opine, text } from "https://deno.land/x/opine@0.21.0/mod.ts";

const app = opine();

Expand Down Expand Up @@ -173,7 +173,7 @@ A new `parsedBody` object containing the parsed data is populated on the `reques
> As `req.parsedBody`'s shape is based on user-controlled input, all properties and values in this object are untrusted and should be validated before trusting. For example, `req.parsedBody.foo.toString()` may fail in multiple ways, for example `foo` may not be there or may not be a string, and `toString` may not be a function and instead a string or other user-input.
```ts
import { opine, urlencoded } from "https://deno.land/x/opine@main/mod.ts";
import { opine, urlencoded } from "https://deno.land/x/opine@0.21.0/mod.ts";

const app = opine();

Expand Down
4 changes: 2 additions & 2 deletions .github/API/opine.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ Adapted from the [ExpressJS API Docs](https://expressjs.com/en/4x/api.html).
Creates an Opine application. The `opine()` function is a top-level function exported by the Opine module:

```ts
import opine from "https://deno.land/x/opine@main/mod.ts";
import opine from "https://deno.land/x/opine@0.21.0/mod.ts";

const app = opine();
```

The `opine()` function is also exported as a named export:

```ts
import { opine } from "https://deno.land/x/opine@main/mod.ts";
import { opine } from "https://deno.land/x/opine@0.21.0/mod.ts";

const app = opine();
```
4 changes: 2 additions & 2 deletions .github/API/request.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ import {
opine,
json,
urlencoded,
} from "https://deno.land/x/opine@main/mod.ts";
} from "https://deno.land/x/opine@0.21.0/mod.ts";

const app = opine();

Expand All @@ -100,7 +100,7 @@ app.post("/profile", function (req, res, next) {
The following example shows how to implement your own simple body-parsing middleware to transform `req.parsedBody` into a raw string:
```ts
import opine from "https://deno.land/x/opine@main/mod.ts";
import opine from "https://deno.land/x/opine@0.21.0/mod.ts";

const app = opine();

Expand Down
4 changes: 2 additions & 2 deletions .github/API/router.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A router behaves like middleware itself, so you can use it as an argument to [ap
Opine has a top-level named function export `Router()` that creates a new `router` object.

```ts
import { Router } from "https://deno.land/x/opine@main/mod.ts";
import { Router } from "https://deno.land/x/opine@0.21.0/mod.ts";

const router = Router(options);
```
Expand Down Expand Up @@ -210,7 +210,7 @@ This method is similar to [app.use()](./application#appusepath-callback--callbac
Middleware is like a plumbing pipe: requests start at the first middleware function defined and work their way "down" the middleware stack processing for each path they match.

```ts
import opine, { Router } from "https://deno.land/x/opine@main/mod.ts";
import opine, { Router } from "https://deno.land/x/opine@0.21.0/mod.ts";

const app = opine();
const router = Router();
Expand Down
10 changes: 10 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# ChangeLog

## [0.21.0] - 17-08-2020

- chore: upgrade supported Deno and std module versions to `1.3.0` and `0.65.0`.
- chore: upgrade deps with non-breaking minor / patch upgrades available.
- docs: remove references to importing by branch name.
- fix: React SSR example types after removal from deno.land/x
- [NO-ISSUE] Fixed typo in readme example (#57)
- [#50] Add app param docs (#55)
- chore: fix workflow step name

## [0.20.2] - 05-08-2020

- docs: remove reference to importing commit or branch from readme as not supported by Deno registry v2.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Use Deno ${{ matrix.deno-version }}
uses: denolib/setup-deno@v2
with:
deno-version: 1.2.2
deno-version: 1.3.0
- name: Run Benchmark Tests
run: |
mkdir -p artifacts
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
node-version: 12
- name: Install deps
run: make deps
- name: Use Deno v1.2.2
- name: Use Deno v1.3.0
uses: denolib/setup-deno@v2
with:
deno-version: 1.2.2
deno-version: 1.3.0
- run: make typedoc
- run: make ci
- name: Publish Updated Type Docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-egg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v2
- uses: denolib/setup-deno@v2
with:
deno-version: 1.2.2
deno-version: 1.3.0
- run: deno install -A -f --unstable -n eggs https://x.nest.land/eggs@0.2.1/mod.ts
- run: |
export PATH="/home/runner/.deno/bin:$PATH"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
deno-version: [1.2.2]
deno-version: [1.3.0]

steps:
- uses: actions/checkout@v2
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Fast, minimalist web framework for <a href="https://deno.land/">Deno</a> ported
## Getting Started

```ts
import { opine } from "https://deno.land/x/opine@0.20.2/mod.ts";
import { opine } from "https://deno.land/x/opine@0.21.0/mod.ts";

const app = opine();

Expand All @@ -54,13 +54,13 @@ Before importing, [download and install Deno](https://deno.land/#installation).
You can then import Opine straight into your project:

```ts
import { opine } from "https://deno.land/x/opine@0.20.2/mod.ts";
import { opine } from "https://deno.land/x/opine@0.21.0/mod.ts";
```

Opine is also available on [nest.land](https://nest.land/package/opine), a package registry for Deno on the Blockchain.

```ts
import { opine } from "https://x.nest.land/opine@0.20.2/mod.ts";
import { opine } from "https://x.nest.land/opine@0.21.0/mod.ts";
```

## Features
Expand Down
16 changes: 8 additions & 8 deletions deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@ export {
Server,
ServerRequest,
Response,
} from "https://deno.land/std@0.63.0/http/server.ts";
} from "https://deno.land/std@0.65.0/http/server.ts";
export {
Status,
STATUS_TEXT,
} from "https://deno.land/std@0.63.0/http/http_status.ts";
} from "https://deno.land/std@0.65.0/http/http_status.ts";
export {
setCookie,
Cookie,
deleteCookie,
} from "https://deno.land/std@0.63.0/http/cookie.ts";
} from "https://deno.land/std@0.65.0/http/cookie.ts";
export {
extname,
fromFileUrl,
basename,
join,
dirname,
resolve,
} from "https://deno.land/std@0.63.0/path/mod.ts";
export { setImmediate } from "https://deno.land/std@0.63.0/node/timers.ts";
export { Sha1 } from "https://deno.land/std@0.63.0/hash/sha1.ts";
export { encoder } from "https://deno.land/std@0.63.0/encoding/utf8.ts";
} from "https://deno.land/std@0.65.0/path/mod.ts";
export { setImmediate } from "https://deno.land/std@0.65.0/node/timers.ts";
export { Sha1 } from "https://deno.land/std@0.65.0/hash/sha1.ts";
export { encoder } from "https://deno.land/std@0.65.0/encoding/utf8.ts";
export {
Evt as EventEmitter,
to as getEvent,
} from "https://deno.land/x/evt@1.8.0/mod.ts";
} from "https://deno.land/x/evt@v1.8.7/mod.ts";
export {
contentType,
charset,
Expand Down
2 changes: 1 addition & 1 deletion egg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "opine",
"description": "Fast, minimalist web framework for Deno ported from ExpressJS.",
"version": "0.20.2",
"version": "0.21.0",
"repository": "https://github.com/asos-craigmorten/opine",
"stable": true,
"files": [
Expand Down
13 changes: 0 additions & 13 deletions examples/swagger/README.md

This file was deleted.

31 changes: 0 additions & 31 deletions examples/swagger/controllers/v1.ts

This file was deleted.

75 changes: 0 additions & 75 deletions examples/swagger/index.ts

This file was deleted.

Loading

0 comments on commit 0f490c5

Please sign in to comment.