@fougere/next 0.9.3-alpha.0 → 0.11.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/dist/config.d.ts.map +1 -1
- package/dist/config.js +41 -0
- package/dist/config.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -5
- package/src/config.ts +45 -0
- package/src/index.ts +1 -1
- package/template/app/layout.tsx +3 -0
- package/template/app/page.tsx +21 -0
- package/template/next.config.mjs +11 -0
- package/template/package.json +22 -0
- package/template/tsconfig.json +23 -0
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAmCvC,wBAAgB,WAAW,CAAC,MAAM,GAAE,UAAe,GAAG,UAAU,CA8C/D"}
|
package/dist/config.js
CHANGED
|
@@ -1,8 +1,40 @@
|
|
|
1
1
|
/** `withFougere(config)` — what Next has to be told so a Fougere app builds. */
|
|
2
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { dirname, join } from 'node:path';
|
|
2
4
|
import TerserPlugin from 'terser-webpack-plugin';
|
|
3
5
|
import { RUNTIME_PACKAGES } from '@fougere/compiler';
|
|
6
|
+
/** Where the facades land, and what a page imports them by. */
|
|
7
|
+
const FACADE = '.fougere/facade.generated.ts';
|
|
8
|
+
const SPECIFIER = '@fronds/facade';
|
|
9
|
+
/**
|
|
10
|
+
* The facades this app serves, written when the config is read.
|
|
11
|
+
*
|
|
12
|
+
* Synchronously and not in a hook: a Next config is evaluated before anything resolves a
|
|
13
|
+
* module, and the alias below points at a file a page imports. The scan LOADS a frond's own
|
|
14
|
+
* sources, so a TS-aware loader is installed first — without it `scanProject` throws and the
|
|
15
|
+
* module is silently never written.
|
|
16
|
+
*/
|
|
17
|
+
async function writeFacades(root) {
|
|
18
|
+
try {
|
|
19
|
+
const { scanProject, emitFacade, frondAliases } = await import('@fougere/compiler');
|
|
20
|
+
const { setModuleLoader } = await import('@fougere/core/node');
|
|
21
|
+
const { resolveConventions } = await import('@fougere/core');
|
|
22
|
+
const { createJiti } = await import('jiti');
|
|
23
|
+
const jiti = createJiti(import.meta.url, {
|
|
24
|
+
interopDefault: true,
|
|
25
|
+
alias: await frondAliases(root, resolveConventions()),
|
|
26
|
+
});
|
|
27
|
+
setModuleLoader((filePath) => jiti.import(filePath));
|
|
28
|
+
const out = join(root, FACADE);
|
|
29
|
+
mkdirSync(dirname(out), { recursive: true });
|
|
30
|
+
writeFileSync(out, emitFacade(await scanProject(root), { outFile: out }));
|
|
31
|
+
}
|
|
32
|
+
catch { /* a host with no fronds, or a scan that could not run */ }
|
|
33
|
+
}
|
|
4
34
|
export function withFougere(config = {}) {
|
|
5
35
|
const userWebpack = config.webpack;
|
|
36
|
+
const root = process.cwd();
|
|
37
|
+
const written = writeFacades(root);
|
|
6
38
|
return {
|
|
7
39
|
...config,
|
|
8
40
|
// Additive: whatever the app already listed is kept.
|
|
@@ -11,10 +43,19 @@ export function withFougere(config = {}) {
|
|
|
11
43
|
// fact about Next and not about a Fougere boot, so it is added here and not to the list.
|
|
12
44
|
...new Set([...(config.serverExternalPackages ?? []), ...RUNTIME_PACKAGES, '@fougere/next']),
|
|
13
45
|
],
|
|
46
|
+
// A page IMPORTS its facade, so the alias sits beside the file `writeFacades` writes: a
|
|
47
|
+
// project that never generated it fails to resolve rather than losing its types in silence.
|
|
48
|
+
turbopack: {
|
|
49
|
+
...config.turbopack,
|
|
50
|
+
resolveAlias: { ...config.turbopack?.resolveAlias, [SPECIFIER]: join(root, FACADE) },
|
|
51
|
+
},
|
|
14
52
|
webpack: (webpackConfig, context) => {
|
|
15
53
|
// The app's own webpack function runs FIRST, so it sees an untouched config
|
|
16
54
|
// and this never silently discards what it did.
|
|
17
55
|
const base = userWebpack ? userWebpack(webpackConfig, context) : webpackConfig;
|
|
56
|
+
void written;
|
|
57
|
+
base.resolve ??= {};
|
|
58
|
+
base.resolve.alias = { ...base.resolve.alias, [SPECIFIER]: join(root, FACADE) };
|
|
18
59
|
base.optimization ??= {};
|
|
19
60
|
// ONLY the JS minifier is replaced. Next's minimizers are plain functions with
|
|
20
61
|
// no readable options, so they are told apart by their source: index 0 loads
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,OAAO,YAAY,MAAM,uBAAuB,CAAC;AAGjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,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,mFAAmF;YACnF,yFAAyF;YACzF,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,sBAAsB,IAAI,EAAE,CAAC,EAAE,GAAG,gBAAgB,EAAE,eAAe,CAAC,CAAC;SAC7F;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,CA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is deliberately NOT re-exported here. It is build-time config and
|
|
4
4
|
// it pulls terser in; the root entry is imported by pages, so re-exporting it sent
|
|
5
5
|
// a bundler into the browser bundle (measured: `esbuild/lib/main.d.ts` failed to
|
|
6
|
-
// parse inside `app/page.tsx`). Build-time and runtime do not share a
|
|
6
|
+
// parse inside `app/page.tsx`). Build-time and runtime do not share a facade:
|
|
7
7
|
// `@fougere/next/config`.
|
|
8
8
|
// The boot, so an app can override its data layer from `instrumentation.ts` the way
|
|
9
9
|
// a Nuxt app does from a Nitro plugin.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEjD,kFAAkF;AAClF,mFAAmF;AACnF,iFAAiF;AACjF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEjD,kFAAkF;AAClF,mFAAmF;AACnF,iFAAiF;AACjF,8EAA8E;AAC9E,0BAA0B;AAE1B,oFAAoF;AACpF,uCAAuC;AACvC,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,aAAa,EACb,QAAQ,GAGT,MAAM,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fougere/next",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0-alpha.0",
|
|
4
4
|
"description": "The Next.js adapter: mounting, and the one import that is genuinely Next.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fougere",
|
|
@@ -44,13 +44,15 @@
|
|
|
44
44
|
},
|
|
45
45
|
"files": [
|
|
46
46
|
"dist",
|
|
47
|
-
"src"
|
|
47
|
+
"src",
|
|
48
|
+
"template"
|
|
48
49
|
],
|
|
49
50
|
"dependencies": {
|
|
51
|
+
"jiti": "^2.7.0",
|
|
50
52
|
"terser-webpack-plugin": "^5.3.14",
|
|
51
|
-
"@fougere/
|
|
52
|
-
"@fougere/compiler": "0.
|
|
53
|
-
"@fougere/
|
|
53
|
+
"@fougere/app": "0.11.0-alpha.0",
|
|
54
|
+
"@fougere/compiler": "0.11.0-alpha.0",
|
|
55
|
+
"@fougere/core": "0.11.0-alpha.0"
|
|
54
56
|
},
|
|
55
57
|
"devDependencies": {
|
|
56
58
|
"next": "^15.5.7",
|
package/src/config.ts
CHANGED
|
@@ -1,11 +1,46 @@
|
|
|
1
1
|
/** `withFougere(config)` — what Next has to be told so a Fougere app builds. */
|
|
2
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { dirname, join } from 'node:path';
|
|
2
4
|
import TerserPlugin from 'terser-webpack-plugin';
|
|
3
5
|
import type { NextConfig } from 'next';
|
|
4
6
|
|
|
5
7
|
import { RUNTIME_PACKAGES } from '@fougere/compiler';
|
|
6
8
|
|
|
9
|
+
/** Where the facades land, and what a page imports them by. */
|
|
10
|
+
const FACADE = '.fougere/facade.generated.ts';
|
|
11
|
+
const SPECIFIER = '@fronds/facade';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The facades this app serves, written when the config is read.
|
|
15
|
+
*
|
|
16
|
+
* Synchronously and not in a hook: a Next config is evaluated before anything resolves a
|
|
17
|
+
* module, and the alias below points at a file a page imports. The scan LOADS a frond's own
|
|
18
|
+
* sources, so a TS-aware loader is installed first — without it `scanProject` throws and the
|
|
19
|
+
* module is silently never written.
|
|
20
|
+
*/
|
|
21
|
+
async function writeFacades(root: string): Promise<void> {
|
|
22
|
+
try {
|
|
23
|
+
const { scanProject, emitFacade, frondAliases } = await import('@fougere/compiler');
|
|
24
|
+
const { setModuleLoader } = await import('@fougere/core/node');
|
|
25
|
+
const { resolveConventions } = await import('@fougere/core');
|
|
26
|
+
const { createJiti } = await import('jiti');
|
|
27
|
+
|
|
28
|
+
const jiti = createJiti(import.meta.url, {
|
|
29
|
+
interopDefault: true,
|
|
30
|
+
alias: await frondAliases(root, resolveConventions()),
|
|
31
|
+
});
|
|
32
|
+
setModuleLoader((filePath: string) => jiti.import(filePath) as Promise<Record<string, unknown>>);
|
|
33
|
+
|
|
34
|
+
const out = join(root, FACADE);
|
|
35
|
+
mkdirSync(dirname(out), { recursive: true });
|
|
36
|
+
writeFileSync(out, emitFacade(await scanProject(root), { outFile: out }));
|
|
37
|
+
} catch { /* a host with no fronds, or a scan that could not run */ }
|
|
38
|
+
}
|
|
39
|
+
|
|
7
40
|
export function withFougere(config: NextConfig = {}): NextConfig {
|
|
8
41
|
const userWebpack = config.webpack;
|
|
42
|
+
const root = process.cwd();
|
|
43
|
+
const written = writeFacades(root);
|
|
9
44
|
|
|
10
45
|
return {
|
|
11
46
|
...config,
|
|
@@ -15,11 +50,21 @@ export function withFougere(config: NextConfig = {}): NextConfig {
|
|
|
15
50
|
// fact about Next and not about a Fougere boot, so it is added here and not to the list.
|
|
16
51
|
...new Set([...(config.serverExternalPackages ?? []), ...RUNTIME_PACKAGES, '@fougere/next']),
|
|
17
52
|
],
|
|
53
|
+
// A page IMPORTS its facade, so the alias sits beside the file `writeFacades` writes: a
|
|
54
|
+
// project that never generated it fails to resolve rather than losing its types in silence.
|
|
55
|
+
turbopack: {
|
|
56
|
+
...config.turbopack,
|
|
57
|
+
resolveAlias: { ...config.turbopack?.resolveAlias, [SPECIFIER]: join(root, FACADE) },
|
|
58
|
+
},
|
|
18
59
|
webpack: (webpackConfig, context) => {
|
|
19
60
|
// The app's own webpack function runs FIRST, so it sees an untouched config
|
|
20
61
|
// and this never silently discards what it did.
|
|
21
62
|
const base = userWebpack ? userWebpack(webpackConfig, context) : webpackConfig;
|
|
22
63
|
|
|
64
|
+
void written;
|
|
65
|
+
base.resolve ??= {};
|
|
66
|
+
base.resolve.alias = { ...base.resolve.alias, [SPECIFIER]: join(root, FACADE) };
|
|
67
|
+
|
|
23
68
|
base.optimization ??= {};
|
|
24
69
|
// ONLY the JS minifier is replaced. Next's minimizers are plain functions with
|
|
25
70
|
// no readable options, so they are told apart by their source: index 0 loads
|
package/src/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { invoke, getSession } from './invoke.js';
|
|
|
4
4
|
// `withFougere` is deliberately NOT re-exported here. It is build-time config and
|
|
5
5
|
// it pulls terser in; the root entry is imported by pages, so re-exporting it sent
|
|
6
6
|
// a bundler into the browser bundle (measured: `esbuild/lib/main.d.ts` failed to
|
|
7
|
-
// parse inside `app/page.tsx`). Build-time and runtime do not share a
|
|
7
|
+
// parse inside `app/page.tsx`). Build-time and runtime do not share a facade:
|
|
8
8
|
// `@fougere/next/config`.
|
|
9
9
|
|
|
10
10
|
// The boot, so an app can override its data layer from `instrumentation.ts` the way
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { invoke } from '@fougere/next';
|
|
2
|
+
// Replace with an entity your own frond declares.
|
|
3
|
+
import Post from '@fronds/blog/entities/Post';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A server component reading a Frond directly — no fetch, no endpoint, no route.
|
|
7
|
+
*
|
|
8
|
+
* `invoke` names the call and the runner places it: in memory here, over JSON-RPC the day
|
|
9
|
+
* `remotes:` names the frond in `fougere.config.ts`. A page that needs reactivity uses
|
|
10
|
+
* `useQuery` from `@fougere/react` instead, with a facade from `@fronds/facade`.
|
|
11
|
+
*/
|
|
12
|
+
export default async function Home() {
|
|
13
|
+
const rows = await invoke<Post[]>(Post, 'list');
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<main style={{ maxWidth: 720, margin: '3rem auto', fontFamily: 'system-ui' }}>
|
|
17
|
+
<h1>Fougere</h1>
|
|
18
|
+
{rows.map((row) => <pre key={row.id}>{JSON.stringify(row, null, 2)}</pre>)}
|
|
19
|
+
</main>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { withFougere } from '@fougere/next/config';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* `.mjs` and not `.ts`: Next loads a TypeScript config through a CommonJS require, and
|
|
5
|
+
* `@fougere/next` is ESM-only — the subpath does not resolve there. An `.mjs` config goes
|
|
6
|
+
* through Node's ESM loader, which resolves it fine.
|
|
7
|
+
*
|
|
8
|
+
* `withFougere` states the two things Next has to know: the packages a boot loads at runtime,
|
|
9
|
+
* and a minifier that keeps class names. Your own config goes in the object, untouched.
|
|
10
|
+
*/
|
|
11
|
+
export default withFougere();
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "fougere-app",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "next dev",
|
|
7
|
+
"build": "next build"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@fougere/core": "latest",
|
|
11
|
+
"@fougere/next": "latest",
|
|
12
|
+
"@fougere/react": "latest",
|
|
13
|
+
"@fougere/schema": "latest",
|
|
14
|
+
"@fougere/defaults": "latest",
|
|
15
|
+
"@fougere/container": "latest",
|
|
16
|
+
"better-sqlite3": "^13.0.3",
|
|
17
|
+
"kysely": "^0.28.17",
|
|
18
|
+
"next": "^15.0.0",
|
|
19
|
+
"react": "^19.0.0",
|
|
20
|
+
"react-dom": "^19.0.0"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
|
+
"jsx": "preserve",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"types": [
|
|
10
|
+
"node",
|
|
11
|
+
"react"
|
|
12
|
+
],
|
|
13
|
+
"paths": {
|
|
14
|
+
"@fronds/facade": [
|
|
15
|
+
"./.fougere/facade.generated.ts"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"include": [
|
|
20
|
+
"app",
|
|
21
|
+
"next-env.d.ts"
|
|
22
|
+
]
|
|
23
|
+
}
|