Skip to content

Commit

Permalink
feat: maintenance mode
Browse files Browse the repository at this point in the history
  • Loading branch information
cmorten committed Aug 26, 2022
1 parent 07f563a commit 6921769
Show file tree
Hide file tree
Showing 28 changed files with 105 additions and 135 deletions.
12 changes: 6 additions & 6 deletions .github/API/application.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ 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@2.2.0/mod.ts";
import opine from "https://deno.land/x/opine@2.3.0/mod.ts";

const app = opine();

Expand Down Expand Up @@ -69,7 +69,7 @@ sub-app was mounted.
> to a route.
```ts
import opine from "https://deno.land/x/opine@2.2.0/mod.ts";
import opine from "https://deno.land/x/opine@2.3.0/mod.ts";

const app = opine(); // the main app
const admin = opine(); // the sub app
Expand Down Expand Up @@ -487,7 +487,7 @@ 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@2.2.0/mod.ts";
import opine from "https://deno.land/x/opine@2.3.0/mod.ts";

const app = opine();

Expand Down Expand Up @@ -523,7 +523,7 @@ This method is supported for legacy reasons to aid in transitions from Express
on Node.

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

const app = opine();
const PORT = 3000;
Expand All @@ -542,7 +542,7 @@ 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@2.2.0/mod.ts";
import opine from "https://deno.land/x/opine@2.3.0/mod.ts";

const app = opine();

Expand All @@ -560,7 +560,7 @@ 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@2.2.0/mod.ts";
import opine from "https://deno.land/x/opine@2.3.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 @@ -28,7 +28,7 @@ reasons.
> `toString` may not be a function and instead a string or other user-input.
```ts
import { json, opine } from "https://deno.land/x/opine@2.2.0/mod.ts";
import { json, opine } from "https://deno.land/x/opine@2.3.0/mod.ts";

const app = opine();

Expand Down Expand Up @@ -77,7 +77,7 @@ reasons.
> recommended.
```ts
import { opine, raw } from "https://deno.land/x/opine@2.2.0/mod.ts";
import { opine, raw } from "https://deno.land/x/opine@2.3.0/mod.ts";

const app = opine();

Expand Down Expand Up @@ -230,7 +230,7 @@ reasons.
> recommended.
```ts
import { opine, text } from "https://deno.land/x/opine@2.2.0/mod.ts";
import { opine, text } from "https://deno.land/x/opine@2.3.0/mod.ts";

const app = opine();

Expand Down Expand Up @@ -277,7 +277,7 @@ reasons.
> `toString` may not be a function and instead a string or other user-input.
```ts
import { opine, urlencoded } from "https://deno.land/x/opine@2.2.0/mod.ts";
import { opine, urlencoded } from "https://deno.land/x/opine@2.3.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 @@ -8,15 +8,15 @@ 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@2.2.0/mod.ts";
import opine from "https://deno.land/x/opine@2.3.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@2.2.0/mod.ts";
import { opine } from "https://deno.land/x/opine@2.3.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 @@ -101,7 +101,7 @@ import {
json,
opine,
urlencoded,
} from "https://deno.land/x/opine@2.2.0/mod.ts";
} from "https://deno.land/x/opine@2.3.0/mod.ts";

const app = opine();

Expand All @@ -118,7 +118,7 @@ The following example shows how to implement your own simple body-parsing
middleware to transform `req.body` into a raw string:

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

import { readAll } from "https://deno.land/[email protected]/streams/conversion.ts";

Expand Down
4 changes: 2 additions & 2 deletions .github/API/router.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Opine has a top-level named function export `Router()` that creates a new
`router` object.

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

const router = Router(options);
```
Expand Down Expand Up @@ -260,7 +260,7 @@ 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@2.2.0/mod.ts";
import opine, { Router } from "https://deno.land/x/opine@2.3.0/mod.ts";

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

## [2.3.0] - 26-08-2022

- deps: support Deno `1.25.0`, std `0.153.0`, and other minor dep upgrades.

## [2.2.0] - 02-05-2022

- deps: support Deno `1.21.1`, std `0.137.0`, and other minor dep upgrades.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.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.21.1
deno-version: 1.25.0
- run: |
mkdir -p artifacts
cat > artifacts/message.md <<EOF
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- run: make deps
- uses: denolib/setup-deno@v2
with:
deno-version: 1.21.1
deno-version: 1.25.0
- run: make typedoc
- run: make ci
- uses: stefanzweifel/git-auto-commit-action@v4
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.21.1
deno-version: 1.25.0
- run: deno install -A -f --unstable -n eggs https://x.nest.land/[email protected]/eggs.ts
- run: |
export PATH="/home/runner/.deno/bin:$PATH"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
deno-version: [1.21.1]
deno-version: [1.25.0]

runs-on: ${{ matrix.os }}

Expand All @@ -25,7 +25,7 @@ jobs:
strategy:
matrix:
os: [windows-latest]
deno-version: [1.21.1]
deno-version: [1.25.0]

runs-on: ${{ matrix.os }}

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ benchmark:
@echo ""

build:
@deno run --allow-net="deno.land" --reload mod.ts
@deno run --allow-net="deno.land" --allow-env --reload mod.ts

ci:
@make fmt-check
Expand Down
39 changes: 21 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h1 align="center">Opine</h1>
</p>
<p align="center">
Fast, minimalist web framework for <a href="https://deno.land/">Deno</a> ported from <a href="https://github.com/expressjs/express">ExpressJS</a>.</p>
A minimalist web framework for <a href="https://deno.land/">Deno</a> ported from <a href="https://github.com/expressjs/express">ExpressJS</a>.</p>
<p align="center">
<a href="https://github.com/cmorten/opine/tags/"><img src="https://img.shields.io/github/tag/cmorten/opine" alt="Current version" /></a>
<img src="https://github.com/cmorten/opine/workflows/Test/badge.svg" alt="Current test status" />
Expand All @@ -13,19 +13,28 @@ Fast, minimalist web framework for <a href="https://deno.land/">Deno</a> ported
<img src="https://img.shields.io/github/stars/cmorten/opine" alt="Opine stars" />
<img src="https://img.shields.io/github/forks/cmorten/opine" alt="Opine forks" />
<img src="https://img.shields.io/github/license/cmorten/opine" alt="Opine license" />
<a href="https://GitHub.com/cmorten/opine/graphs/commit-activity"><img src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" alt="Opine is maintained" /></a>
<a href="https://GitHub.com/cmorten/opine/graphs/commit-activity"><img src="https://img.shields.io/badge/Maintained%3F-no-green.svg" alt="Opine is not maintained" /></a>
<a href="https://nest.land/package/opine"><img src="https://nest.land/badge.svg" alt="Published on nest.land" /></a>
</p>
<p align="center">
<a href="https://deno.land/x/opine"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fdeno-visualizer.danopia.net%2Fshields%2Flatest-version%2Fx%2Fopine%2Fmod.ts" alt="Opine latest /x/ version" /></a>
<a href="https://github.com/denoland/deno/blob/main/Releases.md"><img src="https://img.shields.io/badge/deno-1.21.1-brightgreen?logo=deno" alt="Minimum supported Deno version" /></a>
<a href="https://github.com/denoland/deno/blob/main/Releases.md"><img src="https://img.shields.io/badge/deno-1.25.0-brightgreen?logo=deno" alt="Minimum supported Deno version" /></a>
<a href="https://deno-visualizer.danopia.net/dependencies-of/https/deno.land/x/opine/mod.ts"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fdeno-visualizer.danopia.net%2Fshields%2Fdep-count%2Fx%2Fopine%2Fmod.ts" alt="Opine dependency count" /></a>
<a href="https://deno-visualizer.danopia.net/dependencies-of/https/deno.land/x/opine/mod.ts"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fdeno-visualizer.danopia.net%2Fshields%2Fupdates%2Fx%2Fopine%2Fmod.ts" alt="Opine dependency outdatedness" /></a>
<a href="https://deno-visualizer.danopia.net/dependencies-of/https/deno.land/x/opine/mod.ts"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fdeno-visualizer.danopia.net%2Fshields%2Fcache-size%2Fx%2Fopine%2Fmod.ts" alt="Opine cached size" /></a>
</p>

---

_**Now in maintenance mode:** Deno has introduced Node and NPM compat, [considering using Express itself in
Deno](https://deno.com/blog/v1.25#experimental-npm-support)!_

```ts
import express from "npm:express";
```

---

## Table of Contents

- [Getting Started](#getting-started)
Expand All @@ -41,17 +50,16 @@ Fast, minimalist web framework for <a href="https://deno.land/">Deno</a> ported
## Getting Started

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

const app = opine();

app.get("/", function (req, res) {
res.send("Hello World");
});

app.listen(
3000,
() => console.log("server has started on http://localhost:3000 🚀"),
app.listen(3000, () =>
console.log("server has started on http://localhost:3000 🚀")
);
```

Expand All @@ -65,29 +73,24 @@ 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@2.2.0/mod.ts";
import { opine } from "https://deno.land/x/opine@2.3.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@2.2.0/mod.ts";
import { opine } from "https://x.nest.land/opine@2.3.0/mod.ts";
```

## Features

- Robust routing
- Focus on high performance
- Large selection of HTTP helpers including support for downloading / sending
files, etags, Content-Disposition, cookies, JSONP etc.
- Support for static serving of assets
- View system supporting template engines
- Content negotiation
- Compatible with [SuperDeno](https://github.com/cmorten/superdeno) for easy
server testing
- Supports HTTP proxy middleware with
[opine-http-proxy](https://github.com/cmorten/opine-http-proxy)

## Documentation

Expand Down Expand Up @@ -132,11 +135,11 @@ The [Express](https://github.com/expressjs/express) philosophy is to provide
small, robust tooling for HTTP servers, making it a great solution for single
page applications, web sites, hybrids, or public HTTP APIs.

Opine will aim to achieve these same great goals, focussing on providing
equivalent robust tooling and features.
Opine aimed to achieve these same great goals, focussing on providing equivalent
robust tooling and features for Deno uses.

Once Deno's [Node compatibility layer](https://deno.land/std/node/README.md)
matures sufficiently to support Express out of the box, Opine will likely operate in
Now Deno's [Node compatibility layer](https://deno.land/std/node/README.md) is
maturing sufficiently to support Express out of the box, Opine is operating
maintenance mode.

## Examples
Expand Down
28 changes: 16 additions & 12 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
export { Server } from "https://deno.land/[email protected]/http/server.ts";
export type { ConnInfo } from "https://deno.land/[email protected]/http/server.ts";
export {
serve,
Server,
serveTls,
} from "https://deno.land/[email protected]/http/server.ts";
export type { ConnInfo } from "https://deno.land/[email protected]/http/server.ts";
export {
Status,
STATUS_TEXT,
} from "https://deno.land/std@0.137.0/http/http_status.ts";
} from "https://deno.land/std@0.153.0/http/http_status.ts";
export {
deleteCookie,
setCookie,
} from "https://deno.land/std@0.137.0/http/cookie.ts";
export type { Cookie } from "https://deno.land/std@0.137.0/http/cookie.ts";
} from "https://deno.land/std@0.153.0/http/cookie.ts";
export type { Cookie } from "https://deno.land/std@0.153.0/http/cookie.ts";
export {
basename,
dirname,
Expand All @@ -19,22 +23,22 @@ export {
normalize,
resolve,
sep,
} from "https://deno.land/std@0.137.0/path/mod.ts";
export { setImmediate } from "https://deno.land/std@0.133.0/node/timers.ts";
export { parse } from "https://deno.land/std@0.133.0/node/querystring.ts";
export { default as EventEmitter } from "https://deno.land/std@0.133.0/node/events.ts";
export { Sha1 } from "https://deno.land/std@0.137.0/hash/sha1.ts";
} from "https://deno.land/std@0.153.0/path/mod.ts";
export { setImmediate } from "https://deno.land/std@0.153.0/node/timers.ts";
export { parse } from "https://deno.land/std@0.153.0/node/querystring.ts";
export { default as EventEmitter } from "https://deno.land/std@0.153.0/node/events.ts";
export { Sha1 } from "https://deno.land/std@0.153.0/hash/sha1.ts";
export {
readableStreamFromReader,
readAll,
readerFromStreamReader,
} from "https://deno.land/std@0.137.0/streams/conversion.ts";
} from "https://deno.land/std@0.153.0/streams/conversion.ts";

export {
charset,
contentType,
lookup,
} from "https://deno.land/x/[email protected].2/mod.ts";
} from "https://deno.land/x/[email protected].3/mod.ts";
export { Accepts } from "https://deno.land/x/[email protected]/mod.ts";
export {
hasBody,
Expand Down
Loading

0 comments on commit 6921769

Please sign in to comment.