@molecule/app-home-page-react 1.0.0 → 1.0.2

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.
Files changed (2) hide show
  1. package/README.md +93 -0
  2. package/package.json +17 -10
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,7 +1,8 @@
1
1
  {
2
2
  "name": "@molecule/app-home-page-react",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Authenticated home page rendering a personalized greeting (h2 with user name or fallback). Reads auth + i18n; styled via ClassMap.",
5
+ "homepage": "https://www.molecule.dev/packages/app-home-page-react",
5
6
  "type": "module",
6
7
  "main": "dist/index.js",
7
8
  "types": "dist/index.d.ts",
@@ -17,7 +18,8 @@
17
18
  }
18
19
  },
19
20
  "files": [
20
- "dist"
21
+ "dist",
22
+ "README.md"
21
23
  ],
22
24
  "keywords": [
23
25
  "molecule",
@@ -26,21 +28,26 @@
26
28
  "react"
27
29
  ],
28
30
  "license": "Apache-2.0",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "https://github.com/molecule-dev/molecule.git",
34
+ "directory": "packages/app/features/home-page-react"
35
+ },
29
36
  "devDependencies": {
30
37
  "@types/node": "26.1.2",
31
38
  "typescript": "6.0.3",
32
- "vitest": "4.1.10",
33
- "@molecule/app-auth": "1.0.0",
34
- "@molecule/app-react": "1.0.0",
35
- "@molecule/app-ui": "1.0.0",
36
- "@molecule/app-locales-common": "1.0.0",
39
+ "vitest": "4.1.11",
40
+ "@molecule/app-auth": "1.1.1",
41
+ "@molecule/app-react": "1.5.1",
42
+ "@molecule/app-ui": "1.1.1",
43
+ "@molecule/app-locales-common": "1.0.3",
37
44
  "@types/react": "19.2.17",
38
45
  "react": "19.2.8"
39
46
  },
40
47
  "peerDependencies": {
41
- "@molecule/app-auth": "^1.0.0",
42
- "@molecule/app-react": "^1.0.0",
43
- "@molecule/app-ui": "^1.0.0",
48
+ "@molecule/app-auth": "^1.0.1",
49
+ "@molecule/app-react": "^1.0.1",
50
+ "@molecule/app-ui": "^1.0.1",
44
51
  "react": "^18.0.0 || ^19.0.0"
45
52
  }
46
53
  }