@wwchen/stack 0.6.3 → 0.7.0
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 +9 -8
- package/blocks/env.example +1 -2
- package/dist/auth/better-auth/index.d.ts +2 -316
- package/dist/auth/better-auth/index.js +2 -237
- package/dist/auth/index.d.ts +2 -58
- package/dist/auth/index.js +2 -120
- package/dist/auth/proxy.d.ts +2 -14
- package/dist/auth/proxy.js +2 -50
- package/dist/cli/context.d.ts +6 -3
- package/dist/cli/context.js +3 -0
- package/dist/cli/db.d.ts +3 -0
- package/dist/cli/db.js +26 -0
- package/dist/cli/index.js +14 -3
- package/dist/cli/migrate-suite.d.ts +2 -0
- package/dist/cli/migrate-suite.js +787 -0
- package/dist/cli/neon.d.ts +11 -44
- package/dist/cli/neon.js +15 -56
- package/dist/cli/sync-blocks.d.ts +1 -3
- package/dist/cli/sync-blocks.js +2 -6
- package/dist/cli/vercel-build.js +5 -16
- package/dist/configs/vitest.js +3 -7
- package/dist/connections/index.d.ts +2 -8
- package/dist/connections/index.js +3 -9
- package/dist/connections/providers.d.ts +1 -3
- package/dist/connections/table.d.ts +2 -3
- package/dist/connections/table.js +1 -2
- package/dist/db/explaining-pool.d.ts +1 -6
- package/dist/db/explaining-pool.js +3 -10
- package/dist/db/index.d.ts +1 -3
- package/dist/db/index.js +5 -13
- package/dist/db/migration-status.d.ts +1 -4
- package/dist/db/migration-status.js +1 -4
- package/dist/db/schema-changes.d.ts +13 -0
- package/dist/db/schema-changes.js +99 -0
- package/dist/db/ssl.d.ts +1 -5
- package/dist/db/ssl.js +1 -5
- package/dist/db/target.d.ts +2 -9
- package/dist/db/target.js +2 -9
- package/dist/db/testing/index.d.ts +3 -7
- package/dist/db/testing/index.js +3 -7
- package/dist/db/testing/isolate.js +1 -2
- package/dist/db/testing/pglite.d.ts +2 -6
- package/dist/db/testing/pglite.js +2 -6
- package/dist/env/define-env.d.ts +3 -9
- package/dist/env/define-env.js +6 -16
- package/dist/env/load-env-file.d.ts +4 -9
- package/dist/env/load-env-file.js +5 -11
- package/dist/env/stack-env.d.ts +1 -3
- package/dist/env/stack-env.js +3 -7
- package/dist/env/testing.d.ts +1 -3
- package/dist/env/testing.js +2 -5
- package/dist/http/guards.d.ts +3 -10
- package/dist/http/guards.js +4 -12
- package/dist/jobs/index.d.ts +2 -9
- package/dist/jobs/index.js +2 -9
- package/dist/mail/index.d.ts +4 -45
- package/dist/mail/index.js +4 -97
- package/dist/next/api.d.ts +7 -19
- package/dist/next/api.js +6 -15
- package/dist/next/config.js +10 -32
- package/dist/next/cron.d.ts +2 -6
- package/dist/next/cron.js +3 -8
- package/dist/next/health.d.ts +3 -8
- package/dist/next/health.js +3 -8
- package/dist/testing/next.d.ts +1 -4
- package/dist/testing/next.js +2 -7
- package/dist/ui/app.css +5 -16
- package/dist/ui/globals.css +6 -20
- package/dist/ui/icons.d.ts +1 -3
- package/dist/ui/icons.js +3 -10
- package/dist/ui/index.d.ts +4 -12
- package/dist/ui/index.js +4 -12
- package/dist/ui/theme.d.ts +3 -9
- package/dist/ui/theme.js +3 -9
- package/package.json +15 -9
- package/dist/auth/better-auth/tables.d.ts +0 -628
- package/dist/auth/better-auth/tables.js +0 -76
- package/dist/auth/better-auth/users.d.ts +0 -27
- package/dist/auth/better-auth/users.js +0 -128
- package/dist/auth/safe-next.d.ts +0 -17
- package/dist/auth/safe-next.js +0 -36
- package/dist/auth/types.d.ts +0 -47
- package/dist/auth/types.js +0 -5
- package/dist/http/client-ip.d.ts +0 -12
- package/dist/http/client-ip.js +0 -28
- package/dist/http/rate-limit.d.ts +0 -34
- package/dist/http/rate-limit.js +0 -79
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { type ButtonProps, type IconButtonProps, type LinkProps, type RowProps } from "@lew-ds/lds-react";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
/**
|
|
4
|
-
* The design system, as an app imports it: `@lew-ds/lds-react` (server components, but for the
|
|
5
|
-
* five stateful ones, which carry their own `"use client"`), with one thing bound. Every component
|
|
6
|
-
* that can take an `href` (Button, IconButton, Link, Row) renders it through `next/link`, so moving
|
|
7
|
-
* between pages is a client navigation rather than a full reload. LDS takes the router's link as
|
|
8
|
-
* `as`; a call site can still pass its own.
|
|
4
|
+
* The design system, as an app imports it: `@lew-ds/lds-react` (server components, but for the five stateful ones, which carry their own `"use client"`), with one thing bound. Every component that can take an `href` (Button, IconButton, Link, Row) renders it through `next/link`, so moving between pages is a client navigation rather than a full reload. LDS takes the router's link as `as`; a call site can still pass its own.
|
|
9
5
|
*
|
|
10
|
-
* Import every LDS component from here, never from the package directly, so no link forgets `as`.
|
|
11
|
-
* This module has no `"use client"`: a server component can import it, and so can a client one.
|
|
6
|
+
* Import every LDS component from here, never from the package directly, so no link forgets `as`. This module has no `"use client"`: a server component can import it, and so can a client one.
|
|
12
7
|
*/
|
|
13
8
|
export * from "@lew-ds/lds-react";
|
|
14
9
|
export type { Theme } from "./theme.ts";
|
|
@@ -17,15 +12,12 @@ export declare function Button(props: ButtonProps): import("react").JSX.Element;
|
|
|
17
12
|
/** IconButton renders the package's own Button inside its Tooltip, so it needs the binding too. */
|
|
18
13
|
export declare function IconButton(props: IconButtonProps): import("react").JSX.Element;
|
|
19
14
|
/**
|
|
20
|
-
* LDS's Link renders an anchor even with no `href` (a placeholder link), which `next/link` refuses:
|
|
21
|
-
* the router's link only stands in when there is somewhere to go.
|
|
15
|
+
* LDS's Link renders an anchor even with no `href` (a placeholder link), which `next/link` refuses: the router's link only stands in when there is somewhere to go.
|
|
22
16
|
*/
|
|
23
17
|
export declare function Link(props: LinkProps): import("react").JSX.Element;
|
|
24
18
|
export declare function Row(props: RowProps): import("react").JSX.Element;
|
|
25
19
|
/**
|
|
26
|
-
* The root of an app's `<body>`: the inline icon sprite, then the page. Masked glyphs draw blank
|
|
27
|
-
* from an external sprite in Chromium, so the sprite is in the document. `icons` is the app's own
|
|
28
|
-
* glyphs (see `checkIcons`); LDS adds the ones its components draw.
|
|
20
|
+
* The root of an app's `<body>`: the inline icon sprite, then the page. Masked glyphs draw blank from an external sprite in Chromium, so the sprite is in the document. `icons` is the app's own glyphs (see `checkIcons`); LDS adds the ones its components draw.
|
|
29
21
|
*/
|
|
30
22
|
export declare function StackRoot({ icons, children }: {
|
|
31
23
|
icons: readonly string[];
|
package/dist/ui/index.js
CHANGED
|
@@ -3,14 +3,9 @@ import { Button as LdsButton, IconButton as LdsIconButton, Link as LdsLink, Row
|
|
|
3
3
|
import { IconSprite } from "@lew-ds/lds-react/icon-sprite";
|
|
4
4
|
import NextLink from "next/link.js";
|
|
5
5
|
/**
|
|
6
|
-
* The design system, as an app imports it: `@lew-ds/lds-react` (server components, but for the
|
|
7
|
-
* five stateful ones, which carry their own `"use client"`), with one thing bound. Every component
|
|
8
|
-
* that can take an `href` (Button, IconButton, Link, Row) renders it through `next/link`, so moving
|
|
9
|
-
* between pages is a client navigation rather than a full reload. LDS takes the router's link as
|
|
10
|
-
* `as`; a call site can still pass its own.
|
|
6
|
+
* The design system, as an app imports it: `@lew-ds/lds-react` (server components, but for the five stateful ones, which carry their own `"use client"`), with one thing bound. Every component that can take an `href` (Button, IconButton, Link, Row) renders it through `next/link`, so moving between pages is a client navigation rather than a full reload. LDS takes the router's link as `as`; a call site can still pass its own.
|
|
11
7
|
*
|
|
12
|
-
* Import every LDS component from here, never from the package directly, so no link forgets `as`.
|
|
13
|
-
* This module has no `"use client"`: a server component can import it, and so can a client one.
|
|
8
|
+
* Import every LDS component from here, never from the package directly, so no link forgets `as`. This module has no `"use client"`: a server component can import it, and so can a client one.
|
|
14
9
|
*/
|
|
15
10
|
export * from "@lew-ds/lds-react";
|
|
16
11
|
export { htmlClassName, resolveTheme, THEME_COOKIE } from "./theme.js";
|
|
@@ -22,8 +17,7 @@ export function IconButton(props) {
|
|
|
22
17
|
return _jsx(LdsIconButton, { as: NextLink, ...props });
|
|
23
18
|
}
|
|
24
19
|
/**
|
|
25
|
-
* LDS's Link renders an anchor even with no `href` (a placeholder link), which `next/link` refuses:
|
|
26
|
-
* the router's link only stands in when there is somewhere to go.
|
|
20
|
+
* LDS's Link renders an anchor even with no `href` (a placeholder link), which `next/link` refuses: the router's link only stands in when there is somewhere to go.
|
|
27
21
|
*/
|
|
28
22
|
export function Link(props) {
|
|
29
23
|
return _jsx(LdsLink, { as: props.href === undefined ? undefined : NextLink, ...props });
|
|
@@ -32,9 +26,7 @@ export function Row(props) {
|
|
|
32
26
|
return _jsx(LdsRow, { as: NextLink, ...props });
|
|
33
27
|
}
|
|
34
28
|
/**
|
|
35
|
-
* The root of an app's `<body>`: the inline icon sprite, then the page. Masked glyphs draw blank
|
|
36
|
-
* from an external sprite in Chromium, so the sprite is in the document. `icons` is the app's own
|
|
37
|
-
* glyphs (see `checkIcons`); LDS adds the ones its components draw.
|
|
29
|
+
* The root of an app's `<body>`: the inline icon sprite, then the page. Masked glyphs draw blank from an external sprite in Chromium, so the sprite is in the document. `icons` is the app's own glyphs (see `checkIcons`); LDS adds the ones its components draw.
|
|
38
30
|
*/
|
|
39
31
|
export function StackRoot({ icons, children }) {
|
|
40
32
|
return (_jsxs(_Fragment, { children: [_jsx(IconSprite, { icons: icons }), children] }));
|
package/dist/ui/theme.d.ts
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
export type Theme = "light" | "dark";
|
|
2
2
|
export declare const THEME_COOKIE = "theme";
|
|
3
3
|
/**
|
|
4
|
-
* The classes LDS needs on `<html>`: the product theme (its ramps, type, radii and shadows) and the
|
|
5
|
-
* mode its dark rules key on (`.mode-dark .lds-tag`). Pure, so a root layout and Storybook write
|
|
6
|
-
* the same thing. `extra` is appended (an app's `next/font` class).
|
|
4
|
+
* The classes LDS needs on `<html>`: the product theme (its ramps, type, radii and shadows) and the mode its dark rules key on (`.mode-dark .lds-tag`). Pure, so a root layout and Storybook write the same thing. `extra` is appended (an app's `next/font` class).
|
|
7
5
|
*/
|
|
8
6
|
export declare function htmlClassName(theme: Theme, extra?: string): string;
|
|
9
7
|
/**
|
|
10
|
-
* The server-side theme read: the `theme` cookie, `light` unless it says `dark`. Dark mode is
|
|
11
|
-
* correct in the FIRST server response, before any client script runs, because the root layout
|
|
12
|
-
* calls this during render and writes the class onto `<html>`.
|
|
8
|
+
* The server-side theme read: the `theme` cookie, `light` unless it says `dark`. Dark mode is correct in the FIRST server response, before any client script runs, because the root layout calls this during render and writes the class onto `<html>`.
|
|
13
9
|
*
|
|
14
|
-
* `next/headers.js` is imported on call, not at the top: `@wwchen/stack/ui` also re-exports the
|
|
15
|
-
* design system's components, and a client component importing a Button from it must not pull
|
|
16
|
-
* `next/headers` into the client bundle.
|
|
10
|
+
* `next/headers.js` is imported on call, not at the top: `@wwchen/stack/ui` also re-exports the design system's components, and a client component importing a Button from it must not pull `next/headers` into the client bundle.
|
|
17
11
|
*/
|
|
18
12
|
export declare function resolveTheme(): Promise<Theme>;
|
package/dist/ui/theme.js
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
export const THEME_COOKIE = "theme";
|
|
2
2
|
/**
|
|
3
|
-
* The classes LDS needs on `<html>`: the product theme (its ramps, type, radii and shadows) and the
|
|
4
|
-
* mode its dark rules key on (`.mode-dark .lds-tag`). Pure, so a root layout and Storybook write
|
|
5
|
-
* the same thing. `extra` is appended (an app's `next/font` class).
|
|
3
|
+
* The classes LDS needs on `<html>`: the product theme (its ramps, type, radii and shadows) and the mode its dark rules key on (`.mode-dark .lds-tag`). Pure, so a root layout and Storybook write the same thing. `extra` is appended (an app's `next/font` class).
|
|
6
4
|
*/
|
|
7
5
|
export function htmlClassName(theme, extra) {
|
|
8
6
|
const base = `theme-product mode-${theme}`;
|
|
9
7
|
return extra ? `${base} ${extra}` : base;
|
|
10
8
|
}
|
|
11
9
|
/**
|
|
12
|
-
* The server-side theme read: the `theme` cookie, `light` unless it says `dark`. Dark mode is
|
|
13
|
-
* correct in the FIRST server response, before any client script runs, because the root layout
|
|
14
|
-
* calls this during render and writes the class onto `<html>`.
|
|
10
|
+
* The server-side theme read: the `theme` cookie, `light` unless it says `dark`. Dark mode is correct in the FIRST server response, before any client script runs, because the root layout calls this during render and writes the class onto `<html>`.
|
|
15
11
|
*
|
|
16
|
-
* `next/headers.js` is imported on call, not at the top: `@wwchen/stack/ui` also re-exports the
|
|
17
|
-
* design system's components, and a client component importing a Button from it must not pull
|
|
18
|
-
* `next/headers` into the client bundle.
|
|
12
|
+
* `next/headers.js` is imported on call, not at the top: `@wwchen/stack/ui` also re-exports the design system's components, and a client component importing a Button from it must not pull `next/headers` into the client bundle.
|
|
19
13
|
*/
|
|
20
14
|
export async function resolveTheme() {
|
|
21
15
|
const { cookies } = await import("next/headers.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wwchen/stack",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Shared Next.js, Neon, Better Auth, Resend and lew-ds building blocks.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -95,14 +95,10 @@
|
|
|
95
95
|
},
|
|
96
96
|
"./blocks/*": "./blocks/*"
|
|
97
97
|
},
|
|
98
|
-
"scripts": {
|
|
99
|
-
"build": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.build.json && node scripts/copy-css.mjs",
|
|
100
|
-
"test": "vitest run",
|
|
101
|
-
"typecheck": "tsc --noEmit"
|
|
102
|
-
},
|
|
103
98
|
"dependencies": {
|
|
104
99
|
"@vercel/functions": "3.12.0",
|
|
105
|
-
"
|
|
100
|
+
"@wwchen/stack-auth": "0.7.0",
|
|
101
|
+
"@wwchen/stack-notify": "0.7.0",
|
|
106
102
|
"pg": "8.23.1",
|
|
107
103
|
"zod": "4.6.7"
|
|
108
104
|
},
|
|
@@ -113,11 +109,13 @@
|
|
|
113
109
|
"@lew-ds/lds-react": "2.1.0",
|
|
114
110
|
"@lew-ds/open-icons": "1.1.0",
|
|
115
111
|
"@storybook/nextjs-vite": "10.6.2",
|
|
112
|
+
"drizzle-kit": "0.31.11",
|
|
116
113
|
"drizzle-orm": "0.45.4",
|
|
117
114
|
"next": "16.4.6",
|
|
118
115
|
"react": "19.3.1",
|
|
119
116
|
"react-dom": "19.3.1",
|
|
120
|
-
"storybook": "10.6.2"
|
|
117
|
+
"storybook": "10.6.2",
|
|
118
|
+
"typescript": "~6.0.3"
|
|
121
119
|
},
|
|
122
120
|
"peerDependenciesMeta": {
|
|
123
121
|
"@electric-sql/pglite": {
|
|
@@ -129,6 +127,9 @@
|
|
|
129
127
|
"@storybook/nextjs-vite": {
|
|
130
128
|
"optional": true
|
|
131
129
|
},
|
|
130
|
+
"drizzle-kit": {
|
|
131
|
+
"optional": true
|
|
132
|
+
},
|
|
132
133
|
"storybook": {
|
|
133
134
|
"optional": true
|
|
134
135
|
}
|
|
@@ -146,5 +147,10 @@
|
|
|
146
147
|
"tailwindcss": "4.3.3",
|
|
147
148
|
"typescript": "~6.0.3",
|
|
148
149
|
"vitest": "5.0.5"
|
|
150
|
+
},
|
|
151
|
+
"scripts": {
|
|
152
|
+
"build": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.build.json && node scripts/copy-css.mjs",
|
|
153
|
+
"test": "vitest run",
|
|
154
|
+
"typecheck": "tsc --noEmit"
|
|
149
155
|
}
|
|
150
|
-
}
|
|
156
|
+
}
|