@molecule/app-home-page-react 1.0.0 → 1.0.1
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 +93 -0
- package/package.json +15 -9
package/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
3
|
+
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
|
+
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
|
+
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
+
Generated: 2026-08-04T01:50:58.149Z
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
# @molecule/app-home-page-react
|
|
10
|
+
|
|
11
|
+
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
12
|
+
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
13
|
+
> package's source — edit `src/index.ts` JSDoc, not this file.
|
|
14
|
+
|
|
15
|
+
`<Home />` — authenticated home page with personalized greeting.
|
|
16
|
+
|
|
17
|
+
Renders a single H2 of the form `{home.greeting}{name|email|home.world}!`
|
|
18
|
+
using the universal common-locale bond. Used as the default
|
|
19
|
+
post-login landing page when the app has no app-specific dashboard.
|
|
20
|
+
|
|
21
|
+
Replaces the byte-identical `pages/Home.tsx` shipped by 19 of the 38
|
|
22
|
+
flagship apps that have an authenticated Home route. Apps that
|
|
23
|
+
override `home.greeting` per-app (e.g. note-taking's
|
|
24
|
+
"Hello, {{name}}.") get the override automatically — the page reads
|
|
25
|
+
the resolved translation, which spreads the bond default beneath
|
|
26
|
+
any per-app override.
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import { Home } from '@molecule/app-home-page-react'
|
|
32
|
+
|
|
33
|
+
;<Route path="/" element={<Home />} />
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Type
|
|
37
|
+
|
|
38
|
+
`feature`
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install @molecule/app-home-page-react @molecule/app-auth @molecule/app-react @molecule/app-ui react
|
|
44
|
+
npm install -D @types/react
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## API
|
|
48
|
+
|
|
49
|
+
### Functions
|
|
50
|
+
|
|
51
|
+
#### `Home()`
|
|
52
|
+
|
|
53
|
+
Authenticated home page — a personalized greeting headline.
|
|
54
|
+
|
|
55
|
+
Renders a single H2 of the form:
|
|
56
|
+
`{home.greeting}{user.name || user.email || home.world}!`
|
|
57
|
+
|
|
58
|
+
`home.greeting` and `home.world` both come from the universal
|
|
59
|
+
common-locale bond (`@molecule/app-locales-common`), so the page is
|
|
60
|
+
fully translated out of the box. Apps can override `home.greeting`
|
|
61
|
+
per-app (e.g. note-taking's "Hello, {{name}}.") simply by including
|
|
62
|
+
the key in their own locale `ui.ts`.
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
function Home(): JSX.Element
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Injection Notes
|
|
69
|
+
|
|
70
|
+
### Requirements
|
|
71
|
+
|
|
72
|
+
Peer dependencies:
|
|
73
|
+
|
|
74
|
+
- `@molecule/app-auth` ^1.0.1
|
|
75
|
+
- `@molecule/app-react` ^1.0.1
|
|
76
|
+
- `@molecule/app-ui` ^1.0.1
|
|
77
|
+
- `react` ^18.0.0 || ^19.0.0
|
|
78
|
+
|
|
79
|
+
### Runtime Dependencies
|
|
80
|
+
|
|
81
|
+
- `@molecule/app-auth`
|
|
82
|
+
- `@molecule/app-react`
|
|
83
|
+
- `@molecule/app-ui`
|
|
84
|
+
- `react`
|
|
85
|
+
|
|
86
|
+
- Calls `useAuth()` and `useTranslation()` — both THROW unless the tree is
|
|
87
|
+
wrapped in `@molecule/app-react`'s `AuthProvider` and `I18nProvider`
|
|
88
|
+
(scaffolded apps do this in `App.tsx`).
|
|
89
|
+
- `home.greeting` / `home.world` have NO inline English fallback: they
|
|
90
|
+
resolve from `@molecule/app-locales-common`, which
|
|
91
|
+
`setupI18nDefault()` (from `@molecule/app-i18n-default-react`) merges
|
|
92
|
+
automatically. A custom i18n setup must register the common bond or the
|
|
93
|
+
raw keys render on screen.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-home-page-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Authenticated home page rendering a personalized greeting (h2 with user name or fallback). Reads auth + i18n; styled via ClassMap.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
20
|
-
"dist"
|
|
20
|
+
"dist",
|
|
21
|
+
"README.md"
|
|
21
22
|
],
|
|
22
23
|
"keywords": [
|
|
23
24
|
"molecule",
|
|
@@ -26,21 +27,26 @@
|
|
|
26
27
|
"react"
|
|
27
28
|
],
|
|
28
29
|
"license": "Apache-2.0",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/molecule-dev/molecule.git",
|
|
33
|
+
"directory": "packages/app/features/home-page-react"
|
|
34
|
+
},
|
|
29
35
|
"devDependencies": {
|
|
30
36
|
"@types/node": "26.1.2",
|
|
31
37
|
"typescript": "6.0.3",
|
|
32
38
|
"vitest": "4.1.10",
|
|
33
|
-
"@molecule/app-auth": "1.0.
|
|
34
|
-
"@molecule/app-react": "1.0.
|
|
35
|
-
"@molecule/app-ui": "1.0.
|
|
36
|
-
"@molecule/app-locales-common": "1.0.
|
|
39
|
+
"@molecule/app-auth": "1.0.1",
|
|
40
|
+
"@molecule/app-react": "1.0.1",
|
|
41
|
+
"@molecule/app-ui": "1.0.1",
|
|
42
|
+
"@molecule/app-locales-common": "1.0.1",
|
|
37
43
|
"@types/react": "19.2.17",
|
|
38
44
|
"react": "19.2.8"
|
|
39
45
|
},
|
|
40
46
|
"peerDependencies": {
|
|
41
|
-
"@molecule/app-auth": "^1.0.
|
|
42
|
-
"@molecule/app-react": "^1.0.
|
|
43
|
-
"@molecule/app-ui": "^1.0.
|
|
47
|
+
"@molecule/app-auth": "^1.0.1",
|
|
48
|
+
"@molecule/app-react": "^1.0.1",
|
|
49
|
+
"@molecule/app-ui": "^1.0.1",
|
|
44
50
|
"react": "^18.0.0 || ^19.0.0"
|
|
45
51
|
}
|
|
46
52
|
}
|