@fougere/next 0.2.0-alpha.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Fougere contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,3 @@
1
+ import type { NextConfig } from 'next';
2
+ export declare function withFougere(config?: NextConfig): NextConfig;
3
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAavC,wBAAgB,WAAW,CAAC,MAAM,GAAE,UAAe,GAAG,UAAU,CAgC/D"}
package/dist/config.js ADDED
@@ -0,0 +1,75 @@
1
+ /**
2
+ * `withFougere(config)` — what Next has to be told so a Fougere app builds.
3
+ *
4
+ * ```ts
5
+ * // next.config.ts
6
+ * import { withFougere } from '@fougere/next/config';
7
+ *
8
+ * export default withFougere({ reactStrictMode: true });
9
+ * ```
10
+ *
11
+ * The adapter owns the host's quirks. Nothing here leaks into the framework, and
12
+ * nothing here asks the developer to write anything twice — a Next-specific
13
+ * problem gets a Next-specific answer, in the Next package.
14
+ *
15
+ * Two things are set, both measured against a real production build:
16
+ *
17
+ * 1. **Class names survive minification.** Designation is class + verb, so
18
+ * `invoke(Post, 'list')` and `useQuery(Post, 'list')` read `Post.name`. Next's
19
+ * minifier renames it, and the call goes looking for an entity nobody hosts —
20
+ * `Entity 'j' is not hosted here. Hosted here: post`. Next's own knob
21
+ * (`noMangling`) is internal and all-or-nothing, so the minimizer is replaced by
22
+ * terser with `keep_classnames`, which keeps mangling everything else.
23
+ * Verified: the production browser chunk contains `class Post extends`.
24
+ *
25
+ * 2. **The scan's dependencies stay out of the bundle.** A boot reads frond
26
+ * sources off disk through jiti, so those packages must be loaded at runtime
27
+ * rather than compiled in.
28
+ *
29
+ * **Limit, stated rather than discovered later:** this rides Next's `webpack()`
30
+ * hook, which Turbopack ignores. Next 16 builds with Turbopack by default, so an
31
+ * app on 16 needs `next build --webpack` until Turbopack exposes a minifier option.
32
+ * Next also documents its webpack config as outside semver.
33
+ */
34
+ import TerserPlugin from 'terser-webpack-plugin';
35
+ /** Packages a Fougere boot loads at runtime — they must not be bundled. */
36
+ const RUNTIME_PACKAGES = [
37
+ '@fougere/app',
38
+ '@fougere/core',
39
+ '@fougere/next',
40
+ '@fougere/schema-sql',
41
+ 'better-sqlite3',
42
+ 'jiti',
43
+ 'typescript',
44
+ ];
45
+ export function withFougere(config = {}) {
46
+ const userWebpack = config.webpack;
47
+ return {
48
+ ...config,
49
+ // Additive: whatever the app already listed is kept.
50
+ serverExternalPackages: [
51
+ ...new Set([...(config.serverExternalPackages ?? []), ...RUNTIME_PACKAGES]),
52
+ ],
53
+ webpack: (webpackConfig, context) => {
54
+ // The app's own webpack function runs FIRST, so it sees an untouched config
55
+ // and this never silently discards what it did.
56
+ const base = userWebpack ? userWebpack(webpackConfig, context) : webpackConfig;
57
+ base.optimization ??= {};
58
+ // ONLY the JS minifier is replaced. Next's minimizers are plain functions with
59
+ // no readable options, so they are told apart by their source: index 0 loads
60
+ // `minify-webpack-plugin` (JS), index 1 loads `css-minimizer-plugin`. Replacing
61
+ // the whole array — which this did at first — silently dropped CSS minification
62
+ // and anything the app's own webpack function had added.
63
+ const isJsMinifier = (m) => String(m).includes('minify-webpack-plugin');
64
+ base.optimization.minimizer = [
65
+ ...(base.optimization.minimizer ?? []).filter((m) => !isJsMinifier(m)),
66
+ // `keep_fnames` is deliberately absent: designation reads a CLASS name and
67
+ // nothing in this path reads a function name. Keeping every function name
68
+ // costs bundle size for an invariant nothing has demonstrated.
69
+ new TerserPlugin({ terserOptions: { keep_classnames: true } }),
70
+ ];
71
+ return base;
72
+ },
73
+ };
74
+ }
75
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,YAAY,MAAM,uBAAuB,CAAC;AAGjD,2EAA2E;AAC3E,MAAM,gBAAgB,GAAG;IACvB,cAAc;IACd,eAAe;IACf,eAAe;IACf,qBAAqB;IACrB,gBAAgB;IAChB,MAAM;IACN,YAAY;CACb,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,MAAM,GAAe,EAAE;IACjD,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC;IAEnC,OAAO;QACL,GAAG,MAAM;QACT,qDAAqD;QACrD,sBAAsB,EAAE;YACtB,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,sBAAsB,IAAI,EAAE,CAAC,EAAE,GAAG,gBAAgB,CAAC,CAAC;SAC5E;QACD,OAAO,EAAE,CAAC,aAAa,EAAE,OAAO,EAAE,EAAE;YAClC,4EAA4E;YAC5E,gDAAgD;YAChD,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;YAE/E,IAAI,CAAC,YAAY,KAAK,EAAE,CAAC;YACzB,+EAA+E;YAC/E,6EAA6E;YAC7E,gFAAgF;YAChF,gFAAgF;YAChF,yDAAyD;YACzD,MAAM,YAAY,GAAG,CAAC,CAAU,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC;YACjF,IAAI,CAAC,YAAY,CAAC,SAAS,GAAG;gBAC5B,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAU,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;gBAC/E,2EAA2E;gBAC3E,0EAA0E;gBAC1E,+DAA+D;gBAC/D,IAAI,YAAY,CAAC,EAAE,aAAa,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAAC;aAC/D,CAAC;YAEF,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * `@fougere/next` — what is Next about hosting a Fougere app, and nothing else.
3
+ *
4
+ * The package is deliberately thin, and its thinness is the measurement: the three
5
+ * doors are Web-standard handlers living in `@fougere/app/web`, the four primitives
6
+ * are React hooks living in `@fougere/react`, and neither imports Next. What is
7
+ * left here is mounting (Next has no module API, so routes are three one-line files
8
+ * under `app/`) and `next/headers`, the one import that is genuinely Next's.
9
+ *
10
+ * ```ts
11
+ * // app/%5Ffougere/call/[[...surface]]/route.ts ← %5F, not _, see routes/call.ts
12
+ * export { POST } from '@fougere/next/call';
13
+ * // app/%5Ffougere/session/route.ts
14
+ * export { GET } from '@fougere/next/session';
15
+ * // app/api/[...fougere]/route.ts
16
+ * export { GET, POST, PUT, PATCH, DELETE } from '@fougere/next/rest';
17
+ * ```
18
+ *
19
+ * Nothing else in the app moves: pages, layouts, existing route handlers and an
20
+ * existing auth setup are untouched. The scan runs on the first request that needs
21
+ * the app (`useFougereApp` is lazy and memoized), so there is no build hook to
22
+ * install and no generated file to keep in sync.
23
+ *
24
+ * Client primitives: `@fougere/react`.
25
+ */
26
+ export { invoke, getSession } from './invoke.js';
27
+ export { configureFougere, useFougereApp, useFougereAuth, sessionViewOf, stateFor, type FougereServerConfig, type SessionView, } from '@fougere/app';
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAUjD,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,aAAa,EACb,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,cAAc,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,35 @@
1
+ /**
2
+ * `@fougere/next` — what is Next about hosting a Fougere app, and nothing else.
3
+ *
4
+ * The package is deliberately thin, and its thinness is the measurement: the three
5
+ * doors are Web-standard handlers living in `@fougere/app/web`, the four primitives
6
+ * are React hooks living in `@fougere/react`, and neither imports Next. What is
7
+ * left here is mounting (Next has no module API, so routes are three one-line files
8
+ * under `app/`) and `next/headers`, the one import that is genuinely Next's.
9
+ *
10
+ * ```ts
11
+ * // app/%5Ffougere/call/[[...surface]]/route.ts ← %5F, not _, see routes/call.ts
12
+ * export { POST } from '@fougere/next/call';
13
+ * // app/%5Ffougere/session/route.ts
14
+ * export { GET } from '@fougere/next/session';
15
+ * // app/api/[...fougere]/route.ts
16
+ * export { GET, POST, PUT, PATCH, DELETE } from '@fougere/next/rest';
17
+ * ```
18
+ *
19
+ * Nothing else in the app moves: pages, layouts, existing route handlers and an
20
+ * existing auth setup are untouched. The scan runs on the first request that needs
21
+ * the app (`useFougereApp` is lazy and memoized), so there is no build hook to
22
+ * install and no generated file to keep in sync.
23
+ *
24
+ * Client primitives: `@fougere/react`.
25
+ */
26
+ export { invoke, getSession } from './invoke.js';
27
+ // `withFougere` is deliberately NOT re-exported here. It is build-time config and
28
+ // it pulls terser in; the root entry is imported by pages, so re-exporting it sent
29
+ // a bundler into the browser bundle (measured: `esbuild/lib/main.d.ts` failed to
30
+ // parse inside `app/page.tsx`). Build-time and runtime do not share a door:
31
+ // `@fougere/next/config`.
32
+ // The boot, so an app can override its data layer from `instrumentation.ts` the way
33
+ // a Nuxt app does from a Nitro plugin.
34
+ export { configureFougere, useFougereApp, useFougereAuth, sessionViewOf, stateFor, } from '@fougere/app';
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEjD,kFAAkF;AAClF,mFAAmF;AACnF,iFAAiF;AACjF,4EAA4E;AAC5E,0BAA0B;AAE1B,oFAAoF;AACpF,uCAAuC;AACvC,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,aAAa,EACb,QAAQ,GAGT,MAAM,cAAc,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The server dual of the couple, in Next — for server components, server actions
3
+ * and route handlers.
4
+ *
5
+ * Same designation as the browser side (class + verb), same return, same errors.
6
+ * `invokeOn` places the call: a local façade executes in memory, a frond listed in
7
+ * `remotes:` goes over JSON-RPC, and the caller never learns which.
8
+ *
9
+ * `next/headers` is the ONLY Next-specific import in this package — measured, and
10
+ * it is what a host actually owns: how to find the current request. It answers
11
+ * inside a request scope and throws outside one, so a call from a script or a test
12
+ * is simply anonymous, the same fallback Nitro's `useEvent()` gets.
13
+ */
14
+ import { type SessionView } from '@fougere/app';
15
+ import type { FrondCall, InvocationContext } from '@fougere/core';
16
+ type EntityClass = {
17
+ name: string;
18
+ };
19
+ type CallInput = Partial<InvocationContext>;
20
+ export declare function invoke<T = unknown>(entity: EntityClass, op: string, input?: CallInput): Promise<T>;
21
+ export declare function invoke<T = unknown>(call: FrondCall, input?: CallInput): Promise<T>;
22
+ /** The session a layout may hand to `<FougereSession>` so the page arrives knowing its user. */
23
+ export declare function getSession(): Promise<SessionView>;
24
+ export {};
25
+ //# sourceMappingURL=invoke.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoke.d.ts","sourceRoot":"","sources":["../src/invoke.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAoD,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAClG,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElE,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AACpC,KAAK,SAAS,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE5C,wBAAsB,MAAM,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAC1G,wBAAsB,MAAM,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAU1F,gGAAgG;AAChG,wBAAsB,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC,CAEvD"}
package/dist/invoke.js ADDED
@@ -0,0 +1,33 @@
1
+ /**
2
+ * The server dual of the couple, in Next — for server components, server actions
3
+ * and route handlers.
4
+ *
5
+ * Same designation as the browser side (class + verb), same return, same errors.
6
+ * `invokeOn` places the call: a local façade executes in memory, a frond listed in
7
+ * `remotes:` goes over JSON-RPC, and the caller never learns which.
8
+ *
9
+ * `next/headers` is the ONLY Next-specific import in this package — measured, and
10
+ * it is what a host actually owns: how to find the current request. It answers
11
+ * inside a request scope and throws outside one, so a call from a script or a test
12
+ * is simply anonymous, the same fallback Nitro's `useEvent()` gets.
13
+ */
14
+ import { invokeOn, useFougereApp, sessionViewOf, stateFor } from '@fougere/app';
15
+ export async function invoke(target, opOrInput, input) {
16
+ const app = await useFougereApp();
17
+ return invokeOn(app, target, opOrInput, input, await requestState());
18
+ }
19
+ /** The session a layout may hand to `<FougereSession>` so the page arrives knowing its user. */
20
+ export async function getSession() {
21
+ return sessionViewOf(await requestState());
22
+ }
23
+ async function requestState() {
24
+ try {
25
+ // Awaited on purpose: async in Next 15+, synchronous before — `await` accepts both.
26
+ const { headers } = await import('next/headers');
27
+ return await stateFor(await headers());
28
+ }
29
+ catch {
30
+ return {};
31
+ }
32
+ }
33
+ //# sourceMappingURL=invoke.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoke.js","sourceRoot":"","sources":["../src/invoke.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAoB,MAAM,cAAc,CAAC;AAQlG,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,MAA+B,EAC/B,SAA8B,EAC9B,KAAiB;IAEjB,MAAM,GAAG,GAAG,MAAM,aAAa,EAAE,CAAC;IAClC,OAAO,QAAQ,CAAI,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,YAAY,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED,gGAAgG;AAChG,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,OAAO,aAAa,CAAC,MAAM,YAAY,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED,KAAK,UAAU,YAAY;IACzB,IAAI,CAAC;QACH,oFAAoF;QACpF,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,CAAC;QACjD,OAAO,MAAM,QAAQ,CAAC,MAAM,OAAO,EAAE,CAAC,CAAC;IACzC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * ```ts
3
+ * // app/%5Ffougere/call/[[...surface]]/route.ts
4
+ * export { POST } from '@fougere/next/call';
5
+ * ```
6
+ *
7
+ * The folder is `%5Ffougere`, not `_fougere`: the App Router treats a leading
8
+ * underscore as a PRIVATE folder and excludes it from routing, and `%5F` is Next's
9
+ * own escape for a literal one. Measured the hard way — the door 404'd while every
10
+ * other route answered.
11
+ *
12
+ * The optional catch-all is what serves a named surface: `/_fougere/call/public`
13
+ * selects the `public` audience.
14
+ */
15
+ export { fougereCall as POST } from '@fougere/app/web';
16
+ //# sourceMappingURL=call.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../../src/routes/call.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,WAAW,IAAI,IAAI,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * ```ts
3
+ * // app/%5Ffougere/call/[[...surface]]/route.ts
4
+ * export { POST } from '@fougere/next/call';
5
+ * ```
6
+ *
7
+ * The folder is `%5Ffougere`, not `_fougere`: the App Router treats a leading
8
+ * underscore as a PRIVATE folder and excludes it from routing, and `%5F` is Next's
9
+ * own escape for a literal one. Measured the hard way — the door 404'd while every
10
+ * other route answered.
11
+ *
12
+ * The optional catch-all is what serves a named surface: `/_fougere/call/public`
13
+ * selects the `public` audience.
14
+ */
15
+ export { fougereCall as POST } from '@fougere/app/web';
16
+ //# sourceMappingURL=call.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"call.js","sourceRoot":"","sources":["../../src/routes/call.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,WAAW,IAAI,IAAI,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * ```ts
3
+ * // app/api/[...fougere]/route.ts
4
+ * export { GET, POST, PUT, PATCH, DELETE } from '@fougere/next/rest';
5
+ * ```
6
+ *
7
+ * Five names for one handler, because Next decides which verbs a route accepts by
8
+ * which names it exports. Which verb reaches which OPERATION is decided elsewhere,
9
+ * off the table `schema-rest` generates — this file does not narrow it.
10
+ *
11
+ * Next resolves a static segment (`app/api/health/route.ts`) before a catch-all, so
12
+ * mounting this takes nothing away from an app that already serves `/api/*`.
13
+ */
14
+ import { fougereRest } from '@fougere/app/web';
15
+ export declare const GET: typeof fougereRest;
16
+ export declare const POST: typeof fougereRest;
17
+ export declare const PUT: typeof fougereRest;
18
+ export declare const PATCH: typeof fougereRest;
19
+ export declare const DELETE: typeof fougereRest;
20
+ //# sourceMappingURL=rest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rest.d.ts","sourceRoot":"","sources":["../../src/routes/rest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,eAAO,MAAM,GAAG,oBAAc,CAAC;AAC/B,eAAO,MAAM,IAAI,oBAAc,CAAC;AAChC,eAAO,MAAM,GAAG,oBAAc,CAAC;AAC/B,eAAO,MAAM,KAAK,oBAAc,CAAC;AACjC,eAAO,MAAM,MAAM,oBAAc,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * ```ts
3
+ * // app/api/[...fougere]/route.ts
4
+ * export { GET, POST, PUT, PATCH, DELETE } from '@fougere/next/rest';
5
+ * ```
6
+ *
7
+ * Five names for one handler, because Next decides which verbs a route accepts by
8
+ * which names it exports. Which verb reaches which OPERATION is decided elsewhere,
9
+ * off the table `schema-rest` generates — this file does not narrow it.
10
+ *
11
+ * Next resolves a static segment (`app/api/health/route.ts`) before a catch-all, so
12
+ * mounting this takes nothing away from an app that already serves `/api/*`.
13
+ */
14
+ import { fougereRest } from '@fougere/app/web';
15
+ export const GET = fougereRest;
16
+ export const POST = fougereRest;
17
+ export const PUT = fougereRest;
18
+ export const PATCH = fougereRest;
19
+ export const DELETE = fougereRest;
20
+ //# sourceMappingURL=rest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rest.js","sourceRoot":"","sources":["../../src/routes/rest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,CAAC,MAAM,GAAG,GAAG,WAAW,CAAC;AAC/B,MAAM,CAAC,MAAM,IAAI,GAAG,WAAW,CAAC;AAChC,MAAM,CAAC,MAAM,GAAG,GAAG,WAAW,CAAC;AAC/B,MAAM,CAAC,MAAM,KAAK,GAAG,WAAW,CAAC;AACjC,MAAM,CAAC,MAAM,MAAM,GAAG,WAAW,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * ```ts
3
+ * // app/%5Ffougere/session/route.ts
4
+ * export { GET } from '@fougere/next/session';
5
+ * ```
6
+ */
7
+ export { fougereSession as GET } from '@fougere/app/web';
8
+ //# sourceMappingURL=session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/routes/session.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,cAAc,IAAI,GAAG,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * ```ts
3
+ * // app/%5Ffougere/session/route.ts
4
+ * export { GET } from '@fougere/next/session';
5
+ * ```
6
+ */
7
+ export { fougereSession as GET } from '@fougere/app/web';
8
+ //# sourceMappingURL=session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/routes/session.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,cAAc,IAAI,GAAG,EAAE,MAAM,kBAAkB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@fougere/next",
3
+ "version": "0.2.0-alpha.0",
4
+ "description": "The Next.js adapter: mounting, and the one import that is genuinely Next.",
5
+ "keywords": [
6
+ "fougere",
7
+ "next",
8
+ "nextjs",
9
+ "react",
10
+ "typescript",
11
+ "fullstack",
12
+ "rpc"
13
+ ],
14
+ "license": "MIT",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/chok/fougere.git",
18
+ "directory": "packages/app/next"
19
+ },
20
+ "type": "module",
21
+ "main": "dist/index.js",
22
+ "types": "dist/index.d.ts",
23
+ "exports": {
24
+ ".": {
25
+ "types": "./dist/index.d.ts",
26
+ "import": "./dist/index.js"
27
+ },
28
+ "./call": {
29
+ "types": "./dist/routes/call.d.ts",
30
+ "import": "./dist/routes/call.js"
31
+ },
32
+ "./rest": {
33
+ "types": "./dist/routes/rest.d.ts",
34
+ "import": "./dist/routes/rest.js"
35
+ },
36
+ "./session": {
37
+ "types": "./dist/routes/session.d.ts",
38
+ "import": "./dist/routes/session.js"
39
+ },
40
+ "./config": {
41
+ "types": "./dist/config.d.ts",
42
+ "import": "./dist/config.js"
43
+ }
44
+ },
45
+ "files": [
46
+ "dist"
47
+ ],
48
+ "dependencies": {
49
+ "terser-webpack-plugin": "^5.3.14",
50
+ "@fougere/app": "0.2.0-alpha.0",
51
+ "@fougere/core": "0.2.0-alpha.0"
52
+ },
53
+ "devDependencies": {
54
+ "next": "^15.5.7",
55
+ "vitest": "^4.1.0"
56
+ },
57
+ "peerDependencies": {
58
+ "next": "^15.0.0 || ^16.0.0"
59
+ },
60
+ "publishConfig": {
61
+ "access": "public"
62
+ },
63
+ "scripts": {
64
+ "build": "rm -rf dist && tsc",
65
+ "test": "vitest run",
66
+ "typecheck": "tsc --noEmit -p tsconfig.test.json"
67
+ }
68
+ }