demf-custom-operator-details 3.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/README.md +343 -0
- package/favicon.ico +0 -0
- package/mf-app.js +753 -0
- package/mf-app.js.map +1 -0
- package/package.json +46 -0
package/README.md
ADDED
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
# π¨ Vue 3 + Vite Microfrontend Template
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
Professional template for creating Vue 3 + Vite microfrontends with Single-SPA architecture.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## π¦ Repository Contents
|
|
10
|
+
|
|
11
|
+
This repository provides:
|
|
12
|
+
|
|
13
|
+
### π¨ **Microfrontend Template** (`/app`)
|
|
14
|
+
Base Vue 3 + Vite + Vuetify 3 template for Single-SPA
|
|
15
|
+
|
|
16
|
+
### π οΈ **MF Generator** (`/generator`)
|
|
17
|
+
Automated tool to create new microfrontends from template
|
|
18
|
+
|
|
19
|
+
### π **Migration Tool** (`/migration-tools`)
|
|
20
|
+
Automated tool to migrate Vue CLI β Vite projects
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## π Quick Start
|
|
25
|
+
|
|
26
|
+
### Option 1: Create New Microfrontend
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# 1. Navigate to generator folder
|
|
30
|
+
cd generator
|
|
31
|
+
|
|
32
|
+
# 2. Run the script
|
|
33
|
+
# Windows
|
|
34
|
+
create-mf.bat
|
|
35
|
+
|
|
36
|
+
# Linux/macOS
|
|
37
|
+
./create-mf.sh
|
|
38
|
+
|
|
39
|
+
# Cross-platform (Node.js)
|
|
40
|
+
node create-mf.js
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
π **Complete Documentation:**
|
|
44
|
+
- [`generator/README.md`](./generator/README.md) - Complete guide
|
|
45
|
+
- [`generator/QUICKSTART.md`](./generator/QUICKSTART.md) - Quick reference
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
### Option 2: Migrate Existing Vue CLI Project
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# 1. Navigate to migration-tools folder
|
|
53
|
+
cd migration-tools
|
|
54
|
+
|
|
55
|
+
# 2. Run the script
|
|
56
|
+
# Windows
|
|
57
|
+
migrate-to-vite.bat
|
|
58
|
+
|
|
59
|
+
# Linux/macOS
|
|
60
|
+
node migrate-to-vite.js
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
β‘ **Automated migration in 5-10 minutes!**
|
|
64
|
+
|
|
65
|
+
π **Migration Documentation:**
|
|
66
|
+
- [`migration-tools/README.md`](./migration-tools/README.md) - Complete guide
|
|
67
|
+
- [`migration-tools/QUICKSTART.md`](./migration-tools/QUICKSTART.md) - Quick guide
|
|
68
|
+
- [`migration-tools/CHANGELOG.md`](./migration-tools/CHANGELOG.md) - Version changelog
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## π Prerequisites
|
|
73
|
+
|
|
74
|
+
- **Node.js** >= 22.0.0 < 23 || >= 24.8.0 < 25
|
|
75
|
+
- **npm** (included with Node.js)
|
|
76
|
+
- **Git** (to clone the repository)
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## π― Template Features
|
|
81
|
+
|
|
82
|
+
### Frontend Stack
|
|
83
|
+
- β
**Vue 3** + Composition API
|
|
84
|
+
- β
**Vuetify 3** - Material Design UI
|
|
85
|
+
- β
**Vite** - Fast build + HMR
|
|
86
|
+
- β
**Vue Router 4** - Routing
|
|
87
|
+
- β
**Vuex 4** - State management
|
|
88
|
+
- β
**Vue I18n 9** - Internationalization
|
|
89
|
+
|
|
90
|
+
### Architecture
|
|
91
|
+
- β
**Single-SPA** - Microfrontend orchestration
|
|
92
|
+
- β
**SystemJS** - Module loading
|
|
93
|
+
- β
**Dynamic Props** - Runtime configuration
|
|
94
|
+
- β
**Dynamic Theme** - Customizable palette
|
|
95
|
+
|
|
96
|
+
### Developer Experience
|
|
97
|
+
- β
**ESLint** - Linting
|
|
98
|
+
- β
**Prettier** - Formatting
|
|
99
|
+
- β
**Hot Module Replacement** - Fast development
|
|
100
|
+
- β
**TypeScript Support** - Optional
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## π Repository Structure
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
vuejs3-microfrontend-vite-template/
|
|
108
|
+
βββ app/ # π¨ Microfrontend Template
|
|
109
|
+
β βββ public/
|
|
110
|
+
β βββ src/
|
|
111
|
+
β β βββ App.vue
|
|
112
|
+
β β βββ main.js
|
|
113
|
+
β β βββ components/
|
|
114
|
+
β β βββ locales/
|
|
115
|
+
β β βββ plugins/
|
|
116
|
+
β β βββ router/
|
|
117
|
+
β β βββ store/
|
|
118
|
+
β βββ package.json
|
|
119
|
+
β βββ vite.config.js
|
|
120
|
+
β βββ ...
|
|
121
|
+
β
|
|
122
|
+
βββ generator/ # π οΈ MF Creation Tool
|
|
123
|
+
β βββ create-mf.js # Main script
|
|
124
|
+
β βββ create-mf.bat # Windows wrapper
|
|
125
|
+
β βββ create-mf.ps1 # PowerShell
|
|
126
|
+
β βββ create-mf.sh # Bash
|
|
127
|
+
β βββ README.md # Complete documentation
|
|
128
|
+
β βββ QUICKSTART.md # Quick guide
|
|
129
|
+
β βββ CLEANUP-INSTRUCTIONS.md
|
|
130
|
+
β
|
|
131
|
+
βββ migration-tools/ # π Migration Tool
|
|
132
|
+
β βββ migrate-to-vite.js # Migration script
|
|
133
|
+
β βββ migrate-to-vite.bat # Windows wrapper
|
|
134
|
+
β βββ migrate-to-vite.ps1 # PowerShell
|
|
135
|
+
β βββ README.md # Complete guide
|
|
136
|
+
β βββ CHANGELOG.md # Versions
|
|
137
|
+
β βββ QUICKSTART.md # Quick guide
|
|
138
|
+
β βββ CLEANUP-INSTRUCTIONS.md
|
|
139
|
+
β
|
|
140
|
+
βββ .circleci/ # CI/CD configuration
|
|
141
|
+
βββ .gitignore
|
|
142
|
+
βββ CHANGELOG.md # Template changelog
|
|
143
|
+
βββ package.json # Root package
|
|
144
|
+
βββ README.md # π This file
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## β οΈ Naming Conventions
|
|
150
|
+
|
|
151
|
+
### Digital Enabler Standard
|
|
152
|
+
|
|
153
|
+
New microfrontends follow the convention:
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
demf-[functional-name]
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**Valid examples:**
|
|
160
|
+
- β
`demf-auth` - Authentication
|
|
161
|
+
- β
`demf-sidebar` - Sidebar
|
|
162
|
+
- β
`demf-dashboard` - Dashboard
|
|
163
|
+
- β
`demf-mashups-list` - Mashup list
|
|
164
|
+
|
|
165
|
+
**Rules:**
|
|
166
|
+
- Only lowercase letters (a-z)
|
|
167
|
+
- Numbers (0-9)
|
|
168
|
+
- Hyphens (`-`) and underscores (`_`)
|
|
169
|
+
- β NO spaces
|
|
170
|
+
- β NO special characters
|
|
171
|
+
- β NO uppercase letters
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## π Root-Config Integration
|
|
176
|
+
|
|
177
|
+
After creating a microfrontend:
|
|
178
|
+
|
|
179
|
+
### 1. Update Import Map
|
|
180
|
+
|
|
181
|
+
```json
|
|
182
|
+
{
|
|
183
|
+
"imports": {
|
|
184
|
+
"demf-my-app": "http://localhost:9901/mf-app.js"
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### 2. Add to Layout
|
|
190
|
+
|
|
191
|
+
```html
|
|
192
|
+
<application name="demf-my-app" props="realm, palette, mfConfig"></application>
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### 3. Configure Props
|
|
196
|
+
|
|
197
|
+
Standard props are:
|
|
198
|
+
- **`realm`** - Application context
|
|
199
|
+
- **`palette`** - Color theme
|
|
200
|
+
- **`mfConfig`** - MF-specific configuration
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## π οΈ Development Commands
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
# Install dependencies
|
|
208
|
+
npm install
|
|
209
|
+
|
|
210
|
+
# Development (watch + preview)
|
|
211
|
+
npm run dev
|
|
212
|
+
|
|
213
|
+
# Production build
|
|
214
|
+
npm run build
|
|
215
|
+
|
|
216
|
+
# Preview build
|
|
217
|
+
npm run preview
|
|
218
|
+
|
|
219
|
+
# Lint
|
|
220
|
+
npm run lint
|
|
221
|
+
|
|
222
|
+
# Format
|
|
223
|
+
npm run format
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## π Detailed Documentation
|
|
229
|
+
|
|
230
|
+
### MF Generator
|
|
231
|
+
- [`generator/README.md`](./generator/README.md) - Complete generator guide
|
|
232
|
+
- [`generator/QUICKSTART.md`](./generator/QUICKSTART.md) - Quick start
|
|
233
|
+
- [`generator/CLEANUP-INSTRUCTIONS.md`](./generator/CLEANUP-INSTRUCTIONS.md) - Cleanup instructions
|
|
234
|
+
|
|
235
|
+
### Migration Tool
|
|
236
|
+
- [`migration-tools/README.md`](./migration-tools/README.md) - Complete migration guide
|
|
237
|
+
- [`migration-tools/QUICKSTART.md`](./migration-tools/QUICKSTART.md) - Quick migration
|
|
238
|
+
- [`migration-tools/CHANGELOG.md`](./migration-tools/CHANGELOG.md) - Version changelog
|
|
239
|
+
- [`migration-tools/CLEANUP-INSTRUCTIONS.md`](./migration-tools/CLEANUP-INSTRUCTIONS.md) - Cleanup instructions
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## π Versions
|
|
244
|
+
|
|
245
|
+
### Template
|
|
246
|
+
- **Current Version**: 3.0.0
|
|
247
|
+
- **Vue**: 3.5.13
|
|
248
|
+
- **Vuetify**: 3.10.5
|
|
249
|
+
- **Vite**: 6.0.11
|
|
250
|
+
|
|
251
|
+
### Tools
|
|
252
|
+
- **Generator**: v1.0.0
|
|
253
|
+
- **Migration Tool**: v1.0.0
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## π Troubleshooting
|
|
258
|
+
|
|
259
|
+
### MF Generator
|
|
260
|
+
|
|
261
|
+
| Problem | Solution |
|
|
262
|
+
|---------|----------|
|
|
263
|
+
| Invalid MF name | Use only lowercase, numbers, `-` and `_` |
|
|
264
|
+
| Directory already exists | Choose different name or delete directory |
|
|
265
|
+
| Port in use | Use different port (1024-65535) |
|
|
266
|
+
|
|
267
|
+
### Migration Tool
|
|
268
|
+
|
|
269
|
+
| Problem | Solution |
|
|
270
|
+
|---------|----------|
|
|
271
|
+
| Not a Vue CLI project | Check for `vue.config.js` file |
|
|
272
|
+
| Build failed | Read `MIGRATION-REPORT.md` |
|
|
273
|
+
| Broken i18n imports | Check relative paths in `src/` |
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## π€ Contributing
|
|
278
|
+
|
|
279
|
+
To contribute to this template:
|
|
280
|
+
|
|
281
|
+
1. Fork the repository
|
|
282
|
+
2. Create a branch for your feature (`git checkout -b feature/amazing-feature`)
|
|
283
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
284
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
285
|
+
5. Open a Pull Request
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## π License
|
|
290
|
+
|
|
291
|
+
Questo progetto Γ¨ proprietΓ di **Engineering Ingegneria Informatica S.p.A.**
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## π Risorse Utili
|
|
296
|
+
|
|
297
|
+
- [Single-SPA Documentation](https://single-spa.js.org/)
|
|
298
|
+
- [Vue 3 Documentation](https://vuejs.org/)
|
|
299
|
+
- [Vite Documentation](https://vitejs.dev/)
|
|
300
|
+
- [Vuetify 3 Documentation](https://vuetifyjs.com/)
|
|
301
|
+
- [Vue Router Documentation](https://router.vuejs.org/)
|
|
302
|
+
- [Vuex Documentation](https://vuex.vuejs.org/)
|
|
303
|
+
- [Vue I18n Documentation](https://vue-i18n.intlify.dev/)
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## π§ Support
|
|
308
|
+
|
|
309
|
+
For issues or questions:
|
|
310
|
+
|
|
311
|
+
1. Check documentation in `generator/` and `migration-tools/` folders
|
|
312
|
+
2. Review Troubleshooting sections
|
|
313
|
+
3. Contact the **Digital Enabler Team**
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
**Digital Enabler Team**
|
|
318
|
+
*Engineering Ingegneria Informatica S.p.A.*
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## π― Next Steps
|
|
323
|
+
|
|
324
|
+
### Want to create a new MF?
|
|
325
|
+
```bash
|
|
326
|
+
cd generator
|
|
327
|
+
create-mf.bat # Windows
|
|
328
|
+
./create-mf.sh # Linux/macOS
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### Want to migrate a Vue CLI project?
|
|
332
|
+
```bash
|
|
333
|
+
cd migration-tools
|
|
334
|
+
migrate-to-vite.bat # Windows
|
|
335
|
+
node migrate-to-vite.js # Linux/macOS
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
### Want to use the template manually?
|
|
339
|
+
Copy the `app/` folder and customize files manually.
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
*Last updated: January 2025*
|
package/favicon.ico
ADDED
|
Binary file
|