Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/docs/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function Layout({ children }: LayoutProps<"/docs">) {
url: "/",
}}
githubUrl="https://github.com/inkanjs/inkan"
links={[{ text: "Hanko", url: "/hanko" }, { text: "npm", url: "https://www.npmjs.com/package/@vxnsin/inkan", external: true }]}
links={[{ text: "Hanko", url: "/hanko" }, { text: "npm", url: "https://www.npmjs.com/package/@inkanjs/inkan", external: true }]}
>
{children}
</DocsLayout>
Expand Down
2 changes: 1 addition & 1 deletion app/hanko/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const PACKAGE = `// package.json
"description": "One line: what it does.",
"keywords": ["inkan", "inkan-plugin"],
"peerDependencies": {
"@vxnsin/inkan": ">=0.8.0 <1.0.0"
"@inkanjs/inkan": ">=0.8.0 <1.0.0"
}
}`;

Expand Down
2 changes: 1 addition & 1 deletion components/landing/chrome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function Footer() {
</div>
{[
{ title: "Learn", links: [["Docs", "/docs"], ["Installation", "/docs/installation"], ["Routes", "/docs/routes"], ["Compared", "/docs/compare"], ["From Express", "/docs/migrate/express"], ["From Fastify", "/docs/migrate/fastify"], ["npm create inkan", "/docs/installation#start-a-project"]] },
{ title: "Packages", links: [["@vxnsin/inkan", "https://www.npmjs.com/package/@vxnsin/inkan"], ["@inkanjs/vite", "/docs/integrations/vite"], ["@inkanjs/next", "/docs/integrations/next"], ["@inkanjs/query", "/docs/integrations/query"], ["@inkanjs/uws", "/docs/integrations/uws"], ["@inkanjs/bun", "/docs/integrations/bun"], ["check-action", "https://github.com/inkanjs/check-action"]] },
{ title: "Packages", links: [["@inkanjs/inkan", "https://www.npmjs.com/package/@inkanjs/inkan"], ["@inkanjs/vite", "/docs/integrations/vite"], ["@inkanjs/next", "/docs/integrations/next"], ["@inkanjs/query", "/docs/integrations/query"], ["@inkanjs/uws", "/docs/integrations/uws"], ["@inkanjs/bun", "/docs/integrations/bun"], ["check-action", "https://github.com/inkanjs/check-action"]] },
{ title: "Project", links: [["Hanko", "/hanko"], ["Benchmarks", "/benchmarks"], ["Community", "/community"], ["Blog", "/blog"], ["GitHub", "https://github.com/inkanjs/inkan"], ["Integrations", "https://github.com/inkanjs/integrations"], ["Changelog", "https://github.com/inkanjs/inkan/blob/main/CHANGELOG.md"], ["This API's docs", "/api/docs"]] },
].map((col) => (
<div key={col.title}>
Expand Down
2 changes: 1 addition & 1 deletion components/landing/hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export function Hero() {
</Link>
<p className="basis-full font-mono text-xs text-muted">
a project with a store, auth and tests · into one you have:{" "}
<span className="text-soft">npm i @vxnsin/inkan</span>
<span className="text-soft">npm i @inkanjs/inkan</span>
</p>
</motion.div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion content/blog/inkan-0-9.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ This site got the things I kept being asked for:
## Upgrading

```sh
npm install @vxnsin/inkan@0.9
npm install @inkanjs/inkan@0.9
```

There is nothing to change in your code. One thing for CI scripts: the CLI now exits with 2,
Expand Down
8 changes: 4 additions & 4 deletions content/docs/api/app.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "inkan(): the app, its options, and everything it can do."
---

```ts
import { inkan, t } from "@vxnsin/inkan";
import { inkan, t } from "@inkanjs/inkan";

const app = inkan({ title: "Tea Shop", version: "1.0.0" })
.get("/hello", () => ({ hello: "world" }));
Expand Down Expand Up @@ -99,7 +99,7 @@ request, so a route pays for it only when a scope above it has one. Experimental
## register()

```ts
import { plugin } from "@vxnsin/inkan";
import { plugin } from "@inkanjs/inkan";

const admin = plugin((scope, options: { token: string }) => {
scope.onRequest((ctx) => {
Expand Down Expand Up @@ -209,7 +209,7 @@ Read-only. `dev` is whether the app runs in development (the `dev` option, by de
with `register(p, options, { prefix: "/v1" })`. New in 0.7.0.

```ts
import { joinPath } from "@vxnsin/inkan";
import { joinPath } from "@inkanjs/inkan";

joinPath(scope.prefix, "/login"); // "/auth/login", one slash between the parts
```
Expand Down Expand Up @@ -239,7 +239,7 @@ docs page list them. Whether the credentials are good is for your hook or handle
## mount()

```ts
import { routes } from "@vxnsin/inkan";
import { routes } from "@inkanjs/inkan";

const teas = routes().get("/", list).get("/:id", spec, one);
app.mount("/teas", teas);
Expand Down
4 changes: 2 additions & 2 deletions content/docs/api/context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Free space for middleware to hand things on to the handler. For values that are
every request, a [decoration](/docs/api/app#decorate) is cheaper.

```ts
import { stateKey } from "@vxnsin/inkan";
import { stateKey } from "@inkanjs/inkan";

export const tenant = stateKey<Tenant>("tenant");

Expand Down Expand Up @@ -194,7 +194,7 @@ Plain text. The status is the one `status()` set, or the usual one, unless given
## html()

```ts
import { html } from "@vxnsin/inkan";
import { html } from "@inkanjs/inkan";

app.get("/tea/:name", ({ params, html: page }) => page(html`<h1>${params.name}</h1>`));
app.get("/hi/:name", ({ params }) => html`<p>Hello, ${params.name}</p>`); // the same, returned as it is
Expand Down
2 changes: 1 addition & 1 deletion content/docs/api/problems.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "How inkan answers when something is wrong: RFC 9457 problem docume
---

```ts
import { problem } from "@vxnsin/inkan";
import { problem } from "@inkanjs/inkan";

app.post("/teas", { body: NewTea }, ({ body }) => {
if (store.has(body.name)) throw problem(409, "taken", `There is a tea called ${body.name}`, { name: body.name });
Expand Down
4 changes: 2 additions & 2 deletions content/docs/api/routing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ for the whole. A client that sends `accept: application/x-ndjson` gets one JSON
## Groups

```ts
import { routes } from "@vxnsin/inkan";
import { routes } from "@inkanjs/inkan";

const admin = routes().security("bearer").use(audit).get("/stats", stats);
app.mount("/admin", admin);
Expand All @@ -200,7 +200,7 @@ under a prefix, types and all. For hooks and decorations of their own, use a

```ts
// routes/teas/[id].ts
import { route, t } from "@vxnsin/inkan";
import { route, t } from "@inkanjs/inkan";

export const GET = route({ params: t.object({ id: t.int() }) }, ({ params }) => findTea(params.id));
```
Expand Down
2 changes: 1 addition & 1 deletion content/docs/api/schemas.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "t: every schema, and every rule a schema takes."
---

```ts
import { t } from "@vxnsin/inkan";
import { t } from "@inkanjs/inkan";

const Tea = t.object({
id: t.int(),
Expand Down
2 changes: 1 addition & 1 deletion content/docs/built-in/compress.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Brotli or gzip, as the client takes it."
---

```ts
import { compress } from "@vxnsin/inkan";
import { compress } from "@inkanjs/inkan";

app.register(compress());
```
Expand Down
2 changes: 1 addition & 1 deletion content/docs/built-in/cors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Lets pages on other origins call the API."
---

```ts
import { cors } from "@vxnsin/inkan";
import { cors } from "@inkanjs/inkan";

app.register(cors({ origins: ["https://shop.example"], credentials: true }));
```
Expand Down
2 changes: 1 addition & 1 deletion content/docs/built-in/rate-limit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "At most so many requests per client and window."
---

```ts
import { rateLimit } from "@vxnsin/inkan";
import { rateLimit } from "@inkanjs/inkan";

app.register(rateLimit({ max: 120 })); // 120 a minute, per client
```
Expand Down
2 changes: 1 addition & 1 deletion content/docs/built-in/static.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "The built frontend next to the API, with the fallback a single-pag
---

```ts
import { compress, serveStatic } from "@vxnsin/inkan";
import { compress, serveStatic } from "@inkanjs/inkan";

app
.register(compress())
Expand Down
2 changes: 1 addition & 1 deletion content/docs/client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const api = inkan()

// web.ts: only the type crosses over, none of the server
import type { api } from "./server.ts";
import { client } from "@vxnsin/inkan/client";
import { client } from "@inkanjs/inkan/client";

const shop = client<typeof api>("https://shop.example.com", { headers: () => ({ authorization: `Bearer ${token}` }) });

Expand Down
2 changes: 1 addition & 1 deletion content/docs/deploy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ An app that serves its own built frontend registers two plugins: the files, with
fallback a single-page app needs, and compression for everything that pays.

```ts
import { compress, serveStatic } from "@vxnsin/inkan";
import { compress, serveStatic } from "@inkanjs/inkan";

app
.register(compress()) // brotli or gzip, as the client takes it; streams too, event streams not
Expand Down
2 changes: 1 addition & 1 deletion content/docs/hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ A plugin is a function that gets a scope of its own. What it adds there (routes,
hooks, decorations) stays there, under its prefix, unless it says `shared: true`:

```ts
import { plugin, problem, rateLimit } from "@vxnsin/inkan";
import { plugin, problem, rateLimit } from "@inkanjs/inkan";

const admin = plugin(async (app, opts: { token: string }) => {
app.register(rateLimit({ max: 10 })); // only these routes
Expand Down
2 changes: 1 addition & 1 deletion content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ checks what goes out, writes OpenAPI 3.1, serves the docs, and runs every
example as a test.

```ts
import { inkan, problem, t } from "@vxnsin/inkan";
import { inkan, problem, t } from "@inkanjs/inkan";

const Tea = t.object({ id: t.int(), name: t.string(), kind: t.enum(["green", "black", "oolong"]) });
const teas = [{ id: 1, name: "Sencha", kind: "green" as const }];
Expand Down
4 changes: 2 additions & 2 deletions content/docs/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Install inkan, start an app, try the example."
---

```sh
npm install @vxnsin/inkan
npm install @inkanjs/inkan
```

The package is scoped because npm keeps the plain name `inkan` free of look-alikes. The command it installs is `inkan` either way.
Expand Down Expand Up @@ -69,7 +69,7 @@ statuses the auth plugin promises that no single example can show.


```sh
npx @vxnsin/inkan examples # pick one, and it lands in a folder of its own
npx @inkanjs/inkan examples # pick one, and it lands in a folder of its own
```

Six example projects, in reading order, each explained file by file:
Expand Down
4 changes: 2 additions & 2 deletions content/docs/integrations/bun.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Bun's own websockets carrying the frames.
## Install

```sh
bun add @vxnsin/inkan @inkanjs/bun
bun add @inkanjs/inkan @inkanjs/bun
```

## Use

```ts
import { inkan, t } from "@vxnsin/inkan";
import { inkan, t } from "@inkanjs/inkan";
import { serve } from "@inkanjs/bun";

const app = inkan().get("/teas/:id", { params: t.object({ id: t.int() }) }, ({ params }) => ({ id: params.id }));
Expand Down
4 changes: 2 additions & 2 deletions content/docs/integrations/next.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ route handlers, as a Pages Router API route, and as a typed client for Server Co
Contracts, validation, problems, `/docs` and the inspector all come along.

```sh
npm install @vxnsin/inkan @inkanjs/next
npm install @inkanjs/inkan @inkanjs/next
```

The app keeps its routes under `/api`, and its docs, document and inspector too, so every
link on the docs page points where Next will route it:

```ts
// server/app.ts
import { inkan, routes, t } from "@vxnsin/inkan";
import { inkan, routes, t } from "@inkanjs/inkan";

const teas = routes().get("/teas/:id", { params: t.object({ id: t.int() }) }, ({ params }) => findTea(params.id));

Expand Down
2 changes: 1 addition & 1 deletion content/docs/integrations/query.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ npm install @inkanjs/query
```

```ts
import { client } from "@vxnsin/inkan/client";
import { client } from "@inkanjs/inkan/client";
import { queries } from "@inkanjs/query";
import type { app } from "../server/app";

Expand Down
2 changes: 1 addition & 1 deletion content/docs/integrations/recipes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ under the prefix the framework routes to it, so every link on the docs page poin

```ts
// server/app.ts, the same in every recipe
import { inkan, plugin, t } from "@vxnsin/inkan";
import { inkan, plugin, t } from "@inkanjs/inkan";

const api = plugin((app) => {
app.get("/teas/:id", { params: t.object({ id: t.int() }) }, ({ params }) => findTea(params.id));
Expand Down
2 changes: 1 addition & 1 deletion content/docs/integrations/uws.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ npm install --allow-git=all "uWebSockets.js@github:uNetworking/uWebSockets.js#v2
## Use

```ts
import { inkan } from "@vxnsin/inkan";
import { inkan } from "@inkanjs/inkan";
import { serve } from "@inkanjs/uws";

const app = inkan().get("/hello", () => ({ hello: "world" }));
Expand Down
6 changes: 3 additions & 3 deletions content/docs/integrations/vite.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ and the API on one port, no proxy and no CORS, and the API reloaded on every sav
for every Vite project: Vue, React, Svelte, Solid, plain TypeScript.

```sh
npm install @vxnsin/inkan
npm install @inkanjs/inkan
npm install -D @inkanjs/vite
```

Expand All @@ -26,7 +26,7 @@ The app keeps its routes, and its docs, document and inspector, under the prefix

```ts
// src/server/app.ts
import { inkan, routes } from "@vxnsin/inkan";
import { inkan, routes } from "@inkanjs/inkan";

const teas = routes().get("/teas", () => listTeas());

Expand Down Expand Up @@ -75,7 +75,7 @@ Pair it with the typed client and every call in the frontend is checked against
by the compiler (it sees the routes of a chain and of `mount`):

```ts
import { client } from "@vxnsin/inkan/client";
import { client } from "@inkanjs/inkan/client";
import type { app } from "../server/app";

const api = client<typeof app>(location.origin);
Expand Down
2 changes: 1 addition & 1 deletion content/docs/jobs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ first of the month and every Monday. `@yearly`, `@monthly`, `@weekly`, `@daily`,
## Where jobs are kept

```ts notwoslash
import { memoryStore } from "@vxnsin/inkan";
import { memoryStore } from "@inkanjs/inkan";
import { redisStore } from "@inkanjs/redis";

app.job("/exports", { store: memoryStore({ max: 5000 }) }, run); // this process
Expand Down
4 changes: 2 additions & 2 deletions content/docs/middleware.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ without them breaks the contract like a wrong body does.
origin, add `cors()`:

```ts
import { cors } from "@vxnsin/inkan";
import { cors } from "@inkanjs/inkan";

app.register(cors()); // any origin
app.register(cors({ origins: ["https://shop.example"], credentials: true })); // one origin, with cookies
Expand All @@ -79,7 +79,7 @@ routes/files/[...rest].ts /files/*rest

```ts
// routes/teas/[id].ts
import { route, t } from "@vxnsin/inkan";
import { route, t } from "@inkanjs/inkan";

export const GET = route({ params: t.object({ id: t.int() }), response: { 200: Tea } }, ({ params }) => find(params.id));
export const DELETE = route({ params: t.object({ id: t.int() }) }, ({ params }) => remove(params.id));
Expand Down
2 changes: 1 addition & 1 deletion content/docs/migrate/fastify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ fastify.register(poweredBy);
```

```ts title="inkan"
import { plugin } from "@vxnsin/inkan";
import { plugin } from "@inkanjs/inkan";

// scoped: its hooks reach only its own routes
const admin = plugin((scope, opts: { token: string }) => {
Expand Down
2 changes: 1 addition & 1 deletion content/docs/official/auth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ scheme: list your public origin in `origins`.

Sessions, refresh tokens, pending TOTP secrets and used TOTP steps live in `store`; the
brute-force counters in `bruteForce.store`, a second one. Both are inkan
[`Store`](/docs/storage)s, by default `memoryStore()` from `@vxnsin/inkan`: in memory, per
[`Store`](/docs/storage)s, by default `memoryStore()` from `@inkanjs/inkan`: in memory, per
process (100 000 keys for `store`, 50 000 for the counters). For several processes, give
shared ones, from an adapter or written against the interface:

Expand Down
2 changes: 1 addition & 1 deletion content/docs/official/circuit-breaker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The common case: a service you call that sometimes falls over. Wrap the call onc
the wrapped function as before.

```ts
import { HttpProblem } from "@vxnsin/inkan";
import { HttpProblem } from "@inkanjs/inkan";
import { circuit, CircuitOpenError } from "@inkanjs/circuit-breaker";

const rates = circuit((currency: string) => fetch(`https://rates.example/${currency}`, { signal: AbortSignal.timeout(2000) }), {
Expand Down
2 changes: 1 addition & 1 deletion content/docs/official/idempotency.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ it.
## Store

Answers are kept in an inkan [`Store`](/docs/storage), by default `memoryStore()` from
`@vxnsin/inkan`: one process, at most 10000 keys, the one used longest ago dropped first. For
`@inkanjs/inkan`: one process, at most 10000 keys, the one used longest ago dropped first. For
several processes any shared `Store` works:

```ts notwoslash
Expand Down
4 changes: 2 additions & 2 deletions content/docs/official/mongo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ limits, sessions, logins and idempotency keys kept where every process of your a
them. You pass your own `mongodb` client; the package has no dependencies.

```sh
npm install @vxnsin/inkan @inkanjs/mongo mongodb
npm install @inkanjs/inkan @inkanjs/mongo mongodb
```

```ts notwoslash
import { MongoClient } from "mongodb";
import { inkan, rateLimit } from "@vxnsin/inkan";
import { inkan, rateLimit } from "@inkanjs/inkan";
import { mongoStore } from "@inkanjs/mongo";

const client = await new MongoClient(process.env.MONGO_URL!).connect();
Expand Down
Loading
Loading