From 15151b60ccdbb931652d6dbf639e3b779bb8c44f Mon Sep 17 00:00:00 2001 From: cmorten Date: Thu, 17 Sep 2020 17:22:18 +0100 Subject: [PATCH] feat: 0.22.0 --- .github/API/application.md | 12 ++++++------ .github/API/middlewares.md | 8 ++++---- .github/API/opine.md | 4 ++-- .github/API/request.md | 4 ++-- .github/API/router.md | 4 ++-- .github/CHANGELOG.md | 4 ++++ README.md | 6 +++--- docs/index.html | 6 +++--- egg.json | 2 +- version.ts | 2 +- 10 files changed, 28 insertions(+), 24 deletions(-) diff --git a/.github/API/application.md b/.github/API/application.md index b2539beb..731463a2 100644 --- a/.github/API/application.md +++ b/.github/API/application.md @@ -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@0.21.6/mod.ts"; +import opine from "https://deno.land/x/opine@0.22.0/mod.ts"; const app = opine(); @@ -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@0.21.6/mod.ts"; +import opine from "https://deno.land/x/opine@0.22.0/mod.ts"; const app = opine(); // the main app const admin = opine(); // the sub app @@ -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@0.21.6/mod.ts"; +import opine from "https://deno.land/x/opine@0.22.0/mod.ts"; const app = opine(); @@ -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@0.21.6/mod.ts"; +import opine from "https://deno.land/x/opine@0.22.0/mod.ts"; const app = opine(); const PORT = 3000; @@ -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@0.21.6/mod.ts"; +import opine from "https://deno.land/x/opine@0.22.0/mod.ts"; const app = opine(); @@ -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@0.21.6/mod.ts"; +import opine from "https://deno.land/x/opine@0.22.0/mod.ts"; const app = opine(); diff --git a/.github/API/middlewares.md b/.github/API/middlewares.md index 162f90b4..c71033ca 100644 --- a/.github/API/middlewares.md +++ b/.github/API/middlewares.md @@ -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@0.21.6/mod.ts"; +import { opine, json } from "https://deno.land/x/opine@0.22.0/mod.ts"; const app = opine(); @@ -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@0.21.6/mod.ts"; +import { opine, raw } from "https://deno.land/x/opine@0.22.0/mod.ts"; const app = opine(); @@ -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@0.21.6/mod.ts"; +import { opine, text } from "https://deno.land/x/opine@0.22.0/mod.ts"; const app = opine(); @@ -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@0.21.6/mod.ts"; +import { opine, urlencoded } from "https://deno.land/x/opine@0.22.0/mod.ts"; const app = opine(); diff --git a/.github/API/opine.md b/.github/API/opine.md index 6f5dd1e7..03c49dae 100644 --- a/.github/API/opine.md +++ b/.github/API/opine.md @@ -7,7 +7,7 @@ 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@0.21.6/mod.ts"; +import opine from "https://deno.land/x/opine@0.22.0/mod.ts"; const app = opine(); ``` @@ -15,7 +15,7 @@ const app = opine(); The `opine()` function is also exported as a named export: ```ts -import { opine } from "https://deno.land/x/opine@0.21.6/mod.ts"; +import { opine } from "https://deno.land/x/opine@0.22.0/mod.ts"; const app = opine(); ``` diff --git a/.github/API/request.md b/.github/API/request.md index ac594729..9fc8ceed 100644 --- a/.github/API/request.md +++ b/.github/API/request.md @@ -84,7 +84,7 @@ import { opine, json, urlencoded, -} from "https://deno.land/x/opine@0.21.6/mod.ts"; +} from "https://deno.land/x/opine@0.22.0/mod.ts"; const app = opine(); @@ -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@0.21.6/mod.ts"; +import opine from "https://deno.land/x/opine@0.22.0/mod.ts"; const app = opine(); diff --git a/.github/API/router.md b/.github/API/router.md index 1a794ed3..d428d632 100644 --- a/.github/API/router.md +++ b/.github/API/router.md @@ -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@0.21.6/mod.ts"; +import { Router } from "https://deno.land/x/opine@0.22.0/mod.ts"; const router = Router(options); ``` @@ -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@0.21.6/mod.ts"; +import opine, { Router } from "https://deno.land/x/opine@0.22.0/mod.ts"; const app = opine(); const router = Router(); diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 0245c37e..a4feb00f 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -1,5 +1,9 @@ # ChangeLog +## [0.22.0] - 17-09-2020 + +- [#69] Upgrade Opine to support Deno 1.4.0 and std 0.69.0 (#70) + ## [0.21.6] - 15-09-2020 - (fix) deno 1.4.0 : export type (#67) diff --git a/README.md b/README.md index fb50ddf6..832c9e60 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Fast, minimalist web framework for Deno ported ## Getting Started ```ts -import { opine } from "https://deno.land/x/opine@0.21.6/mod.ts"; +import { opine } from "https://deno.land/x/opine@0.22.0/mod.ts"; const app = opine(); @@ -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.21.6/mod.ts"; +import { opine } from "https://deno.land/x/opine@0.22.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.21.6/mod.ts"; +import { opine } from "https://x.nest.land/opine@0.22.0/mod.ts"; ``` ## Features diff --git a/docs/index.html b/docs/index.html index eea091b6..6b739e5a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -98,7 +98,7 @@

Table of Contents

Getting Started

-
import { opine } from "https://deno.land/x/opine@0.21.6/mod.ts";
+				
import { opine } from "https://deno.land/x/opine@0.22.0/mod.ts";
 
 const app = opine();
 
@@ -113,9 +113,9 @@ 

Installation

This is a Deno module available to import direct from this repo and via the Deno Registry.

Before importing, download and install Deno.

You can then import Opine straight into your project:

-
import { opine } from "https://deno.land/x/opine@0.21.6/mod.ts";
+
import { opine } from "https://deno.land/x/opine@0.22.0/mod.ts";

Opine is also available on nest.land, a package registry for Deno on the Blockchain.

-
import { opine } from "https://x.nest.land/opine@0.21.6/mod.ts";
+
import { opine } from "https://x.nest.land/opine@0.22.0/mod.ts";

Features

diff --git a/egg.json b/egg.json index 4172666f..403b42a1 100644 --- a/egg.json +++ b/egg.json @@ -1,7 +1,7 @@ { "name": "opine", "description": "Fast, minimalist web framework for Deno ported from ExpressJS.", - "version": "0.21.6", + "version": "0.22.0", "repository": "https://github.com/asos-craigmorten/opine", "stable": true, "files": [ diff --git a/version.ts b/version.ts index bedd3e5b..f7285169 100644 --- a/version.ts +++ b/version.ts @@ -1,7 +1,7 @@ /** * Version of Opine. */ -export const VERSION: string = "0.21.6"; +export const VERSION: string = "0.22.0"; /** * Supported version of Deno.