Skip to content

Commit

Permalink
chore: move examples to use jsr, update inline docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsonk committed Mar 5, 2024
1 parent 1345298 commit a746485
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 100 deletions.
4 changes: 2 additions & 2 deletions application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ export class ApplicationListenEvent extends Event {
* ### Basic example
*
* ```ts
* import { Application } from "https://deno.land/x/oak/mod.ts";
* import { Application } from "jsr:@oak/oak/application";
*
* const app = new Application();
*
Expand Down Expand Up @@ -812,7 +812,7 @@ export class Application<AS extends State = Record<string, any>>
* Basic usage:
*
* ```ts
* const import { Application } from "https://deno.land/x/oak/mod.ts";
* const import { Application } from "jsr:@oak/oak/application";
*
* const app = new Application();
*
Expand Down
4 changes: 2 additions & 2 deletions context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export interface ContextSendOptions extends SendOptions {
* ### Example
*
* ```ts
* import { Application, Context } from "https://deno.land/x/oak/mod.ts";
* import { Application, Context } from "jsr:@oak/oak/";
*
* const app = new Application();
*
Expand Down Expand Up @@ -200,7 +200,7 @@ export class Context<
* ### Example
*
* ```ts
* import { Context, Status } from "https://deno.land/x/oak/mod.ts";
* import { Context, Status } from "jsr:@oak/oak/";
*
* export function mw(ctx: Context) {
* const body = ctx.request.body();
Expand Down
7 changes: 1 addition & 6 deletions examples/closeServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
*/

// Importing some console colors
import {
bold,
cyan,
green,
yellow,
} from "https://deno.land/std@0.218.2/fmt/colors.ts";
import { bold, cyan, green, yellow } from "jsr:@std/fmt@0.218/colors";

import { Application, Context, Router, Status } from "../mod.ts";

Expand Down
7 changes: 1 addition & 6 deletions examples/cookieServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
*/

// Importing some console colors
import {
bold,
cyan,
green,
yellow,
} from "https://deno.land/std@0.218.2/fmt/colors.ts";
import { bold, cyan, green, yellow } from "jsr:@std/fmt@0.218/colors";

import { Application } from "../mod.ts";

Expand Down
7 changes: 1 addition & 6 deletions examples/countingServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
* `MiddlewareObject` can be ideal for when a middleware needs to encapsulate
* large amounts of logic or its own state. */

import {
bold,
cyan,
green,
yellow,
} from "https://deno.land/std@0.218.2/fmt/colors.ts";
import { bold, cyan, green, yellow } from "jsr:@std/fmt@0.218/colors";

import {
Application,
Expand Down
7 changes: 1 addition & 6 deletions examples/httpsServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@
*/

// Importing some console colors
import {
bold,
cyan,
green,
yellow,
} from "https://deno.land/std@0.218.2/fmt/colors.ts";
import { bold, cyan, green, yellow } from "jsr:@std/fmt@0.218/colors";

import { Application } from "../mod.ts";

Expand Down
8 changes: 1 addition & 7 deletions examples/proxyServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
* This is an example proxy server.
*/

import {
bold,
cyan,
green,
red,
yellow,
} from "https://deno.land/std@0.218.2/fmt/colors.ts";
import { bold, cyan, green, red, yellow } from "jsr:@std/fmt@0.218/colors";

import { Application, HttpError, proxy, Status } from "../mod.ts";

Expand Down
27 changes: 0 additions & 27 deletions examples/readerServer.ts

This file was deleted.

7 changes: 1 addition & 6 deletions examples/routingServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
*/

// Importing some console colors
import {
bold,
cyan,
green,
yellow,
} from "https://deno.land/std@0.218.2/fmt/colors.ts";
import { bold, cyan, green, yellow } from "jsr:@std/fmt@0.218/colors";

import {
Application,
Expand Down
7 changes: 1 addition & 6 deletions examples/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
*/

// Importing some console colors
import {
bold,
cyan,
green,
yellow,
} from "https://deno.land/std@0.218.2/fmt/colors.ts";
import { bold, cyan, green, yellow } from "jsr:@std/fmt@0.218/colors";

import { Application } from "../mod.ts";

Expand Down
7 changes: 1 addition & 6 deletions examples/sseServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
*/

// Importing some console colors
import {
bold,
cyan,
green,
yellow,
} from "https://deno.land/std@0.218.2/fmt/colors.ts";
import { bold, cyan, green, yellow } from "jsr:@std/fmt@0.218/colors";

import {
Application,
Expand Down
8 changes: 1 addition & 7 deletions examples/staticServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
* $CWD/examples/static path.
*/

import {
bold,
cyan,
green,
red,
yellow,
} from "https://deno.land/std@0.218.2/fmt/colors.ts";
import { bold, cyan, green, red, yellow } from "jsr:@std/fmt@0.218/colors";

import { Application, HttpError, Status } from "../mod.ts";

Expand Down
4 changes: 2 additions & 2 deletions response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export type ResponseBodyFunction = () => ResponseBody | Promise<ResponseBody>;
* back to the request referrer. For example:
*
* ```ts
* import { Application, REDIRECT_BACK } from "https://deno.land/x/oak/mod.ts";
* import { Application, REDIRECT_BACK } from "jsr:@oak/oak/";
*
* const app = new Application();
*
Expand Down Expand Up @@ -93,7 +93,7 @@ async function convertBodyToBodyInit(
* ### Example
*
* ```ts
* import { Application, Status } from "https://deno.land/x/oak/mod.ts";
* import { Application, Status } from "jsr:@oak/oak/";
*
* const app = new Application();
*
Expand Down
4 changes: 2 additions & 2 deletions router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ export class Layer<
* ### Basic example
*
* ```ts
* import { Application, Router } from "https://deno.land/x/oak/mod.ts";
* import { Application, Router } from "jsr:@oak/oak/";
*
* const router = new Router();
* router.get("/", (ctx, next) => {
Expand Down Expand Up @@ -1272,7 +1272,7 @@ export class Router<
* has been configured to handle. Typical usage would be something like this:
*
* ```ts
* import { Application, Router } from "https://deno.land/x/oak/mod.ts";
* import { Application, Router } from "jsr:@oak/oak/";
*
* const app = new Application();
* const router = new Router();
Expand Down
9 changes: 0 additions & 9 deletions util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,6 @@ export function readableStreamFromAsyncIterable(
* When the pull algorithm is called on the stream, a chunk from the reader
* will be read. When `null` is returned from the reader, the stream will be
* closed along with the reader (if it is also a `Deno.Closer`).
*
* An example converting a `Deno.FsFile` into a readable stream:
*
* ```ts
* import { readableStreamFromReader } from "https://deno.land/std/io/mod.ts";
*
* const file = await Deno.open("./file.txt", { read: true });
* const fileStream = readableStreamFromReader(file);
* ```
*/
export function readableStreamFromReader(
reader: Deno.Reader | (Deno.Reader & Deno.Closer),
Expand Down

0 comments on commit a746485

Please sign in to comment.