@ingram-tech/nk-dev 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/guide.md +7 -5
- package/lib/dev.js +2 -2
- package/lib/format.js +2 -2
- package/package.json +1 -1
- package/tier-b.json +0 -4
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ vitest, jsdom, jest-dom, knip) as hard dependencies — so one install gives you
|
|
|
15
15
|
the whole stack instead of re-listing each tool per site.
|
|
16
16
|
|
|
17
17
|
> **Runtime vs dev-time.** nk-dev is the *dev-time* bundle. Runtime features
|
|
18
|
-
> (`@ingram-tech/email`, `nk-db`, `nk-auth`, …) stay separate packages that
|
|
18
|
+
> (`@ingram-tech/nk-email`, `nk-db`, `nk-auth`, …) stay separate packages that
|
|
19
19
|
> peer-depend on `next`/`react`. See the dev-toolchain carve-out in
|
|
20
20
|
> [`philosophy.md`](https://github.com/ingram-technologies/nextkit/blob/main/docs/philosophy.md).
|
|
21
21
|
|
package/guide.md
CHANGED
|
@@ -9,7 +9,7 @@ package. Stay a thin, standard Next.js app (bun · oxlint + oxfmt · strict TS).
|
|
|
9
9
|
- **Any form that emails or stores a submission MUST use `@ingram-tech/bot-protection`**
|
|
10
10
|
(server: `verifyHuman` → silently drop bots; client: honeypot + signed token).
|
|
11
11
|
Never ship a form without it.
|
|
12
|
-
- **Send email only via `@ingram-tech/email`** — never add another mail client.
|
|
12
|
+
- **Send email only via `@ingram-tech/nk-email`** — never add another mail client.
|
|
13
13
|
- **Never trust an external request body's shape — validate it with Zod, never
|
|
14
14
|
`as`-cast it.** Every `/api` route and webhook handler takes untrusted input;
|
|
15
15
|
an `as` cast is a lie the type-checker can't catch at runtime.
|
|
@@ -71,11 +71,13 @@ the UI/page tree, and never expose internal plumbing under `/api/`.
|
|
|
71
71
|
|
|
72
72
|
## What nextkit provides (reach for these)
|
|
73
73
|
|
|
74
|
-
- `@ingram-tech/email` — Cloudflare email: `sendEmail`, `fromAddress`
|
|
75
|
-
- `@ingram-tech/nk-auth` — Better Auth foundation: presets you spread into your own `betterAuth()` (mounts at `/auth` via `authBasePath`; org / JWT / passkey / pool / client helpers)
|
|
76
|
-
- `@ingram-tech/nk-db` — Postgres data layer: `createPool` (one TLS-aware pool) + `createQueries` (raw SQL) + `createDb` (Drizzle),
|
|
74
|
+
- `@ingram-tech/nk-email` — Cloudflare email: `sendEmail`, `fromAddress`
|
|
75
|
+
- `@ingram-tech/nk-auth` — Better Auth foundation: presets you spread into your own `betterAuth()` (mounts at `/auth` via `authBasePath`; org / JWT / passkey / pool / client helpers). Don't hand-roll session reads or auth middleware — bind `createAuthHelpers` (`getUser` / `requireUser` / `redirectIfAuthenticated`, from `@ingram-tech/nk-auth/server`) and gate routes with the loop-safe `createAuthMiddleware`
|
|
76
|
+
- `@ingram-tech/nk-db` — Postgres data layer: `createPool` (one TLS-aware pool) + `createQueries` (raw SQL) + `createDb` (Drizzle), the PGlite dev/test harness at `@ingram-tech/nk-db/pglite`, the prefixed-id codec at `@ingram-tech/nk-db/id`, and the drift-aware migration runner at `@ingram-tech/nk-db/migrate`
|
|
77
|
+
- `@ingram-tech/nk-api` — the standard HTTP API seam (Hono + `@hono/zod-openapi`): one `{ error, details? }` envelope, `createApiApp` / `createRouter`, auth + multi-tenant resource-scope middleware, pagination helpers, and an emitted OpenAPI/Swagger doc. Reach for it instead of hand-rolling route handlers
|
|
78
|
+
- `@ingram-tech/nk-billing` — Stripe primitives: subscriptions, a Stripe-side wallet, and an optional Postgres credit ledger behind the `/credits` subpath. Prices resolve at runtime by Stripe `lookup_key` — **never hardcode a price id**, so test and live share one code path
|
|
77
79
|
- `@ingram-tech/bot-protection` — invisible form protection (honeypot + timing + Vercel BotID)
|
|
78
|
-
- `@ingram-tech/
|
|
80
|
+
- `@ingram-tech/nk-i18n` — type-safe, English-as-key i18n: the English source text *is* the key (no `en.json`), ICU MessageFormat, colocated JSON catalogs; routing is left to the site
|
|
79
81
|
- `@ingram-tech/nk-dev` — the whole dev toolchain in one devDependency: the `nk` command (`nk dev` boots local PGlite via `@ingram-tech/nk-db` if installed, then Next; plus `nk format` / `lint` / `knip` / `check` / `type-check` / `build`), the shared oxlint + oxfmt / TypeScript / Vitest config, knip, the oxfmt format-on-commit hook, and this guide. `nk check` runs every fast checker (oxlint, oxfmt, SQL, knip) in one gate. `nk init` scaffolds a site to use it all.
|
|
80
82
|
|
|
81
83
|
For detail on any package, read its README in `node_modules/@ingram-tech/<pkg>/`.
|
package/lib/dev.js
CHANGED
|
@@ -26,8 +26,8 @@ function hasPgliteDev() {
|
|
|
26
26
|
* (static/marketing sites with no database). PGlite logic lives in nk-db, not
|
|
27
27
|
* here — `nk` only orchestrates.
|
|
28
28
|
*
|
|
29
|
-
* `nk dev`
|
|
30
|
-
*
|
|
29
|
+
* `nk dev` boots no external database service — when nk-db is installed it runs
|
|
30
|
+
* local PGlite (Postgres-in-WASM), and a site with no database just runs Next.
|
|
31
31
|
*/
|
|
32
32
|
export function dev(extraArgs = []) {
|
|
33
33
|
const command = hasPgliteDev()
|
package/lib/format.js
CHANGED
|
@@ -8,14 +8,14 @@ import { run } from "./run.js";
|
|
|
8
8
|
const require = createRequire(import.meta.url);
|
|
9
9
|
|
|
10
10
|
// House SQL defaults, used only when the site has no Prettier config of its own
|
|
11
|
-
// (matches the house tab style +
|
|
11
|
+
// (matches the house tab style + the PostgreSQL dialect).
|
|
12
12
|
const SQL_DEFAULTS = { useTabs: true, language: "postgresql" };
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* `nk format` / `nk format --check`.
|
|
16
16
|
*
|
|
17
17
|
* Code (JS/TS/JSON/CSS) goes through oxfmt; SQL goes through Prettier, which
|
|
18
|
-
* oxfmt can't format. Prettier + prettier-plugin-sql are bundled with nk-
|
|
18
|
+
* oxfmt can't format. Prettier + prettier-plugin-sql are bundled with nk-dev,
|
|
19
19
|
* so they never appear in any app's dependencies — the "no Prettier for code"
|
|
20
20
|
* rule still holds, it's just the one file type oxfmt lacks.
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ingram-tech/nk-dev",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "The nextkit dev toolchain in one package: the `nk` CLI plus shared oxlint/oxfmt, TypeScript, and Vitest config, the format-on-commit hook, and the AI agent guide. `nk init` scaffolds a site to use it.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/tier-b.json
CHANGED