transactions-mfe 1.0.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
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.
package/README.md ADDED
@@ -0,0 +1,84 @@
1
+ # transactions-mfe
2
+
3
+ Microfrontend de Transacciones — paquete dual:
4
+
5
+ - **App Next.js standalone** en `:3001` para desarrollo aislado del MFE.
6
+ - **Librería npm** que un host Next.js puede instalar e importar como componentes React (sin iframe, sin multi-zone).
7
+
8
+ ---
9
+
10
+ ## Instalación (como librería en un host)
11
+
12
+ ```bash
13
+ npm install transactions-mfe
14
+ ```
15
+
16
+ `react`, `react-dom` y `next` son **peerDependencies** — los provee el host.
17
+
18
+ ## Uso desde el host
19
+
20
+ ```tsx
21
+ // app/dashboard/transactions/page.tsx
22
+ import { TransactionsListPage } from "transactions-mfe";
23
+ import "transactions-mfe/styles.css";
24
+
25
+ export default function Page() {
26
+ return <TransactionsListPage />;
27
+ }
28
+ ```
29
+
30
+ Componentes exportados:
31
+
32
+ | Export | Origen en el repo |
33
+ |-----------------------|------------------------------|
34
+ | `TransactionsListPage`| `app/page.tsx` |
35
+ | `NewTransactionPage` | `app/new/page.tsx` |
36
+ | `EditTransactionPage` | `app/edit/[id]/page.tsx` |
37
+ | `Sidebar` | `app/components/Sidebar.tsx` |
38
+ | `EmbeddedShell` | `app/components/EmbeddedShell.tsx` |
39
+
40
+ ### Variables de entorno requeridas en el host
41
+
42
+ ```
43
+ NEXT_PUBLIC_API_URL=http://localhost:3000
44
+ ```
45
+
46
+ El MFE llama a `${NEXT_PUBLIC_API_URL}/api/transactions`.
47
+
48
+ ---
49
+
50
+ ## Desarrollo local (modo standalone)
51
+
52
+ ```bash
53
+ npm install
54
+ npm run dev # levanta el MFE en http://localhost:3001
55
+ ```
56
+
57
+ Sigue funcionando como app Next.js completa, con sidebar/topbar propios.
58
+
59
+ ---
60
+
61
+ ## Empaquetado y publicación
62
+
63
+ ```bash
64
+ npm run build:lib # tsup → /dist (ESM + CJS + d.ts) + styles.css
65
+ npm run pack:dry # ver qué entraría al tarball
66
+ npm publish # publica al registry configurado
67
+ ```
68
+
69
+ `prepublishOnly` corre `build:lib` automáticamente, así que `npm publish`
70
+ nunca sube código sin compilar.
71
+
72
+ ### Estructura del tarball publicado
73
+
74
+ ```
75
+ transactions-mfe-1.0.0.tgz
76
+ ├── dist/
77
+ │ ├── index.js ESM
78
+ │ ├── index.cjs CommonJS
79
+ │ ├── index.d.ts tipos
80
+ │ └── styles.css Tailwind compilado
81
+ ├── package.json
82
+ ├── README.md
83
+ └── LICENSE
84
+ ```