@fougere/react 0.14.0-alpha.0 → 0.15.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/package.json +4 -4
- package/template/scaffold.json +36 -0
- package/template/src/App.tsx +9 -16
- package/template/src/index.css +21 -0
- package/template/index.html +0 -5
- package/template/package.json +0 -25
- package/template/src/main.tsx +0 -4
- package/template/tsconfig.json +0 -17
- package/template/vite.config.ts +0 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fougere/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0-alpha.0",
|
|
4
4
|
"description": "Fougere's four primitives as React hooks — host-independent.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fougere",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"template"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@fougere/app": "0.
|
|
35
|
-
"@fougere/core": "0.
|
|
34
|
+
"@fougere/app": "0.15.0-alpha.0",
|
|
35
|
+
"@fougere/core": "0.15.0-alpha.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/react": "^19.2.2",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@testing-library/react": "^16.3.0",
|
|
42
42
|
"jsdom": "^27.0.0",
|
|
43
43
|
"react-dom": "19.2.8",
|
|
44
|
-
"@fougere/schema": "0.
|
|
44
|
+
"@fougere/schema": "0.15.0-alpha.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"react": "^18.3.0 || ^19.0.0"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"create": [
|
|
3
|
+
"create-vite@9",
|
|
4
|
+
"{dir}",
|
|
5
|
+
"--template",
|
|
6
|
+
"react-ts",
|
|
7
|
+
"--no-interactive",
|
|
8
|
+
"--no-immediate"
|
|
9
|
+
],
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@fougere/core": "latest",
|
|
12
|
+
"@fougere/schema": "latest",
|
|
13
|
+
"@fougere/defaults": "latest",
|
|
14
|
+
"@fougere/container": "latest",
|
|
15
|
+
"better-sqlite3": "^13.0.3",
|
|
16
|
+
"kysely": "^0.28.17",
|
|
17
|
+
"@fougere/react": "latest"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@fougere/vite": "latest"
|
|
21
|
+
},
|
|
22
|
+
"wire": {
|
|
23
|
+
"kind": "vitePlugin",
|
|
24
|
+
"file": "vite.config.ts",
|
|
25
|
+
"from": "@fougere/vite",
|
|
26
|
+
"imported": "fougere",
|
|
27
|
+
"options": {
|
|
28
|
+
"root": "../.."
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"remove": [
|
|
32
|
+
"src/App.css",
|
|
33
|
+
"src/assets"
|
|
34
|
+
],
|
|
35
|
+
"tsconfig": "tsconfig.app.json"
|
|
36
|
+
}
|
package/template/src/App.tsx
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
import { useQuery } from '@fougere/react';
|
|
2
|
-
// Written by the scan: one export per address, carrying the handler that answers there.
|
|
3
|
-
// Replace `post` with a facade your own frond serves.
|
|
4
|
-
import { post } from '@fronds/facade';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* One read. `items` is typed by what the handler's `list` answers, and `error.code` by what
|
|
8
|
-
* it can refuse — neither is written here, and neither can drift from the handler.
|
|
9
|
-
*/
|
|
10
1
|
export default function App() {
|
|
11
|
-
const { items, loading, error } = useQuery(post, 'list');
|
|
12
|
-
|
|
13
2
|
return (
|
|
14
|
-
<main
|
|
15
|
-
<h1
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
<main className="welcome">
|
|
4
|
+
<h1>🌿 Fougere</h1>
|
|
5
|
+
<p className="host">Your app is running on <strong>React</strong>.</p>
|
|
6
|
+
<ol>
|
|
7
|
+
<li><a href="https://fougere.dev/docs/guides/business-logic">Handle your business logic <span>→</span></a></li>
|
|
8
|
+
<li><a href="https://fougere.dev/docs/guides/data">Store your data <span>→</span></a></li>
|
|
9
|
+
<li><a href="https://fougere.dev/docs/guides/topology">Shape your topology <span>→</span></a></li>
|
|
10
|
+
</ol>
|
|
11
|
+
<footer><a href="https://fougere.dev/docs">Docs</a></footer>
|
|
19
12
|
</main>
|
|
20
13
|
);
|
|
21
14
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
color-scheme: light dark;
|
|
3
|
+
--ink: #25372d; --muted: #65736a; --line: #dce3d9; --green: #38714c; --wash: #eaf0e6; --bg: #f7f8f4;
|
|
4
|
+
}
|
|
5
|
+
@media (prefers-color-scheme: dark) {
|
|
6
|
+
:root { --ink: #e0e8df; --muted: #9ca99e; --line: #303c32; --green: #9bc99d; --wash: #29392c; --bg: #151c18; }
|
|
7
|
+
}
|
|
8
|
+
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 system-ui, sans-serif; }
|
|
9
|
+
.welcome { max-width: 520px; margin: 0 auto; padding: 64px 24px 40px; }
|
|
10
|
+
.welcome h1 { margin: 0; font-size: 20px; font-weight: 600; }
|
|
11
|
+
.welcome .host { margin: 12px 0 40px; color: var(--muted); }
|
|
12
|
+
.welcome .host strong { color: var(--ink); font-weight: 500; }
|
|
13
|
+
.welcome ol { margin: 0; padding-left: 32px; }
|
|
14
|
+
.welcome li { padding-left: 8px; border-bottom: 1px solid var(--line); }
|
|
15
|
+
.welcome li::marker { color: var(--muted); font-size: 12px; }
|
|
16
|
+
.welcome li a { display: flex; justify-content: space-between; gap: 20px; padding: 17px 12px; border-radius: 6px; color: inherit; font-size: 18px; text-decoration: none; }
|
|
17
|
+
.welcome li a span { color: var(--muted); }
|
|
18
|
+
.welcome li:first-child a { background: var(--wash); color: var(--green); font-weight: 600; }
|
|
19
|
+
.welcome li a:hover { background: var(--wash); color: var(--green); }
|
|
20
|
+
.welcome footer { margin-top: 32px; font-size: 13px; }
|
|
21
|
+
.welcome footer a { color: var(--muted); }
|
package/template/index.html
DELETED
package/template/package.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "fougere-app",
|
|
3
|
-
"private": true,
|
|
4
|
-
"type": "module",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"dev": "vite",
|
|
7
|
-
"build": "vite build"
|
|
8
|
-
},
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"@fougere/core": "latest",
|
|
11
|
-
"@fougere/react": "latest",
|
|
12
|
-
"@fougere/schema": "latest",
|
|
13
|
-
"@fougere/defaults": "latest",
|
|
14
|
-
"@fougere/container": "latest",
|
|
15
|
-
"better-sqlite3": "^13.0.3",
|
|
16
|
-
"kysely": "^0.28.17",
|
|
17
|
-
"react": "^19.0.0",
|
|
18
|
-
"react-dom": "^19.0.0"
|
|
19
|
-
},
|
|
20
|
-
"devDependencies": {
|
|
21
|
-
"@fougere/vite": "latest",
|
|
22
|
-
"@vitejs/plugin-react": "^5.0.0",
|
|
23
|
-
"vite": "^8.0.0"
|
|
24
|
-
}
|
|
25
|
-
}
|
package/template/src/main.tsx
DELETED
package/template/tsconfig.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "@fougere/core/tsconfig",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "ES2022",
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"moduleResolution": "Bundler",
|
|
7
|
-
"jsx": "react-jsx",
|
|
8
|
-
"strict": true,
|
|
9
|
-
"noEmit": true,
|
|
10
|
-
"types": [
|
|
11
|
-
"node"
|
|
12
|
-
]
|
|
13
|
-
},
|
|
14
|
-
"include": [
|
|
15
|
-
"src"
|
|
16
|
-
]
|
|
17
|
-
}
|
package/template/vite.config.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite';
|
|
2
|
-
import { fougere } from '@fougere/vite';
|
|
3
|
-
import react from '@vitejs/plugin-react';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* `fougere()` states the two things any Vite-built host must know: the packages a boot loads
|
|
7
|
-
* at runtime, and a minifier that keeps class names — designation reads a class's `name`, and
|
|
8
|
-
* a renamed one designates an entity nobody hosts. It also writes `@fronds/facade`.
|
|
9
|
-
*/
|
|
10
|
-
export default defineConfig({
|
|
11
|
-
// Fronds are shared at the workspace root, two levels up from apps/<name>.
|
|
12
|
-
plugins: [fougere({ root: '../..' }), react()],
|
|
13
|
-
});
|