@eui/cli 22.0.0-alpha.6 → 22.0.0-alpha.61
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 +357 -88
- package/bin/eui-cli.js +26 -0
- package/bin/scripts/migrate.js +5 -0
- package/lib/app-utils/build.js +26 -0
- package/lib/app-utils/migrate.js +610 -0
- package/lib/app-utils/serve.js +32 -0
- package/lib/build.js +28 -7
- package/lib/cli.js +16 -2
- package/lib/config.js +10 -1
- package/lib/skeletons/_angular/base/mock/app/routes/{index.js → index.cjs} +1 -1
- package/lib/skeletons/_angular/base/mock/app/routes/{user_routes.js → user_routes.cjs} +1 -1
- package/lib/skeletons/_angular/base/mock/{server.js → server.cjs} +1 -1
- package/lib/skeletons/_angular/base/package.json +4 -3
- package/lib/skeletons/_angular/base-mobile/package.json +5 -4
- package/lib/skeletons/_angular/options/eds/src/app/app.component.html +35 -0
- package/lib/skeletons/_angular/options/eds/src/app/app.component.spec.ts +56 -0
- package/lib/skeletons/_angular/options/eds/src/app/app.component.ts +44 -0
- package/lib/skeletons/_angular/options/eds/src/index.html +21 -0
- package/lib/skeletons/_angular/options/pnpm/package.json +98 -48
- package/lib/skeletons/_react/base/README.md +65 -0
- package/lib/skeletons/_react/base/eslint.config.mjs +17 -0
- package/lib/skeletons/_react/base/gitignore_TO_REPLACE +34 -0
- package/lib/skeletons/_react/base/index.html +13 -0
- package/lib/skeletons/_react/base/mock/app/models/user.cjs +6 -0
- package/lib/skeletons/_react/base/mock/app/routes/index.cjs +5 -0
- package/lib/skeletons/_react/base/mock/app/routes/user_routes.cjs +44 -0
- package/lib/skeletons/_react/base/mock/db/db.json +10 -0
- package/lib/skeletons/_react/base/mock/server.cjs +23 -0
- package/lib/skeletons/_react/base/package.json +29 -0
- package/lib/skeletons/_react/base/public/.gitkeep +0 -0
- package/lib/skeletons/_react/base/src/App.tsx +73 -0
- package/lib/skeletons/_react/base/src/main.tsx +30 -0
- package/lib/skeletons/_react/base/src/pages/about.tsx +27 -0
- package/lib/skeletons/_react/base/src/pages/home.tsx +50 -0
- package/lib/skeletons/_react/base/src/routes.ts +18 -0
- package/lib/skeletons/_react/base/src/styles.css +37 -0
- package/lib/skeletons/_react/base/src/vite-env.d.ts +1 -0
- package/lib/skeletons/_react/base/tsconfig.app.json +18 -0
- package/lib/skeletons/_react/base/tsconfig.json +7 -0
- package/lib/skeletons/_react/base/tsconfig.node.json +15 -0
- package/lib/skeletons/_react/base/vite.config.ts +77 -0
- package/lib/skeletons/_react/options/pnpm/package.json +46 -0
- package/lib/utils.js +26 -2
- package/package.json +1 -1
- package/sonar-project.properties +0 -14
- /package/lib/skeletons/_angular/base/mock/app/models/{user.js → user.cjs} +0 -0
package/README.md
CHANGED
|
@@ -1,157 +1,426 @@
|
|
|
1
1
|
# @eui/cli
|
|
2
2
|
|
|
3
|
-
Command-line interface for scaffolding and
|
|
3
|
+
Command-line interface for **scaffolding, serving and building eUI applications**. It generates a
|
|
4
|
+
ready-to-run project (Angular, React, mobile, or a Java web module) pre-wired with the eUI design
|
|
5
|
+
system, then acts as the app's build/serve tool so every eUI app is driven the same way regardless
|
|
6
|
+
of its underlying framework.
|
|
7
|
+
|
|
8
|
+
- [Installation](#installation)
|
|
9
|
+
- [Quick start](#quick-start)
|
|
10
|
+
- [`eui-cli new` — generate an application](#eui-cli-new--generate-an-application)
|
|
11
|
+
- [The interactive wizard, step by step](#the-interactive-wizard-step-by-step)
|
|
12
|
+
- [Application types explained](#application-types-explained)
|
|
13
|
+
- [Non-interactive / automated mode](#non-interactive--automated-mode)
|
|
14
|
+
- [Full configuration reference](#full-configuration-reference)
|
|
15
|
+
- [Working with a generated app](#working-with-a-generated-app)
|
|
16
|
+
- [`eui-cli serve-app`](#eui-cli-serve-app)
|
|
17
|
+
- [`eui-cli build-app`](#eui-cli-build-app)
|
|
18
|
+
- [`eui-cli lint-app`](#eui-cli-lint-app)
|
|
19
|
+
- [`eui-cli inject-config-app`](#eui-cli-inject-config-app)
|
|
20
|
+
- [`eui-cli generate-sprite`](#eui-cli-generate-sprite)
|
|
21
|
+
- [Generated project layouts](#generated-project-layouts)
|
|
22
|
+
- [Requirements](#requirements)
|
|
23
|
+
- [License](#license)
|
|
24
|
+
|
|
25
|
+
---
|
|
4
26
|
|
|
5
27
|
## Installation
|
|
6
28
|
|
|
29
|
+
Install globally to get the `eui-cli` binary on your `PATH`:
|
|
30
|
+
|
|
7
31
|
```sh
|
|
8
32
|
npm install -g @eui/cli
|
|
9
33
|
```
|
|
10
34
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Run without installing globally:
|
|
35
|
+
Or run it on demand without installing, using `npx`:
|
|
14
36
|
|
|
15
37
|
```sh
|
|
16
38
|
npx @eui/cli new
|
|
17
39
|
```
|
|
18
40
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
### Generate a new application
|
|
41
|
+
Check the installed version at any time:
|
|
22
42
|
|
|
23
43
|
```sh
|
|
24
|
-
eui-cli
|
|
44
|
+
eui-cli --version
|
|
25
45
|
```
|
|
26
46
|
|
|
27
|
-
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Quick start
|
|
28
50
|
|
|
29
51
|
```sh
|
|
30
|
-
|
|
52
|
+
# 1. create an empty folder and move into it
|
|
53
|
+
mkdir my-app && cd my-app
|
|
54
|
+
|
|
55
|
+
# 2. scaffold interactively (answers a few questions)
|
|
56
|
+
eui-cli new
|
|
57
|
+
|
|
58
|
+
# 3. once generated + installed, start the app (opens http://localhost:4200)
|
|
59
|
+
npm start
|
|
31
60
|
```
|
|
32
61
|
|
|
33
|
-
The
|
|
62
|
+
> The generator **requires an empty target directory**. If the current (or `--targetPath`) folder
|
|
63
|
+
> is not empty, the CLI stops with `DIR_NOT_EMPTY` to avoid overwriting your files.
|
|
34
64
|
|
|
35
|
-
|
|
36
|
-
- Desktop (Angular)
|
|
37
|
-
- Mobile Ionic
|
|
38
|
-
- eUI + Spring Boot web module (requires JDK + Maven)
|
|
39
|
-
- eUI + Maven web module (JEE Spring, requires JDK + Maven)
|
|
65
|
+
---
|
|
40
66
|
|
|
41
|
-
|
|
42
|
-
- groupId (e.g., `ec.europa.digit`)
|
|
43
|
-
- artifactId (e.g., `myapp`)
|
|
67
|
+
## `eui-cli new` — generate an application
|
|
44
68
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
69
|
+
`new` is the default command, so `eui-cli` and `eui-cli new` are equivalent. It asks a series of
|
|
70
|
+
questions, scaffolds the matching skeleton into the target folder, optionally installs
|
|
71
|
+
dependencies, optionally sets up [eui-skills](https://sdlc.webcloud.ec.europa.eu/csdr/eui-skills.git),
|
|
72
|
+
and can start the app immediately.
|
|
48
73
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
- **Install all** (`--all`): install all skills to all agents without prompts
|
|
53
|
-
- Or configure individually:
|
|
54
|
-
- **Agent(s)**: target specific agents (e.g. `cursor`, `claude-code`, or `*` for all)
|
|
55
|
-
- **Skill(s)**: specific skill names to install (or `*` for all)
|
|
56
|
-
- **Global**: install at user-level instead of project-level
|
|
57
|
-
- **Skip confirmations**: auto-confirm all skills prompts
|
|
74
|
+
```sh
|
|
75
|
+
eui-cli new [--targetPath <dir>] [--config <string>] [skills flags…]
|
|
76
|
+
```
|
|
58
77
|
|
|
59
|
-
|
|
78
|
+
| Flag | Description |
|
|
79
|
+
| --- | --- |
|
|
80
|
+
| `-t, --targetPath <dir>` | Folder to generate into. Created if missing. Defaults to the current directory. |
|
|
81
|
+
| `-c, --config <string>` | Non-interactive config string (see [automated mode](#non-interactive--automated-mode)). When present, **all prompts are skipped**. |
|
|
82
|
+
| `--skills` | Set up eui-skills after generation (enables the skills sub-flags). |
|
|
83
|
+
| `--skillsAll` | Install all skills to all agents, no prompts. Requires `--skills`. |
|
|
84
|
+
| `--skillsAgent <agents>` | Target agent(s), space-separated, or `*` for all. Requires `--skills`. |
|
|
85
|
+
| `--skillsSkill <skills>` | Skill name(s), space-separated, or `*` for all. Requires `--skills`. |
|
|
86
|
+
| `--skillsGlobal` | Install skills at user level instead of project level. Requires `--skills`. |
|
|
87
|
+
| `--skillsYes` | Auto-confirm all skills prompts. Requires `--skills`. |
|
|
88
|
+
|
|
89
|
+
> All `--skills*` sub-flags require `--skills`; using one without it exits with an error.
|
|
90
|
+
|
|
91
|
+
### The interactive wizard, step by step
|
|
92
|
+
|
|
93
|
+
Running `eui-cli new` with no `--config` walks you through these prompts. Some are conditional —
|
|
94
|
+
they only appear for certain earlier answers.
|
|
95
|
+
|
|
96
|
+
1. **Application type** — the main choice. See
|
|
97
|
+
[Application types explained](#application-types-explained) below. Determines which skeleton is
|
|
98
|
+
generated and which of the following prompts appear.
|
|
99
|
+
|
|
100
|
+
2. **Maven groupId / artifactId** — *only for the Spring Boot web module.* Standard Maven
|
|
101
|
+
coordinates for the generated Java module (e.g. `ec.europa.digit` / `myapp`). Both are required.
|
|
102
|
+
|
|
103
|
+
3. **App-shell option** — *only for `Desktop` (plain Angular); skipped for Desktop EDS, React EDS,
|
|
104
|
+
Mobile, and the Java web modules.* Choose the shell/theme layer:
|
|
105
|
+
- **eUI default app-shell** — the standard `@eui/components` `eui-app` layout.
|
|
106
|
+
- **eUI ECL app-shell** — the Europa Component Library site layout, for `ec.europa.eu` apps.
|
|
107
|
+
If selected, a follow-up prompt asks for the **ECL theme**: **EC theme** (`ecl-ec`) or
|
|
108
|
+
**EU theme** (`ecl-eu`).
|
|
109
|
+
|
|
110
|
+
> Desktop EDS pre-selects the EDS app-shell up-front, so it never shows this prompt.
|
|
111
|
+
|
|
112
|
+
4. **Install dependencies now?** — `Yes` runs the package manager right after scaffolding; `No`
|
|
113
|
+
leaves you to install manually later.
|
|
114
|
+
|
|
115
|
+
5. **Package manager** — *only if you chose to install.* **Yarn 1.x** (default) or
|
|
116
|
+
**pnpm** (experimental). The choice also selects the matching `package.json` variant for
|
|
117
|
+
Angular and React skeletons (pnpm needs all dependencies listed explicitly rather than via the
|
|
118
|
+
`@eui/deps-*` meta-packages).
|
|
119
|
+
|
|
120
|
+
6. **Set up eui-skills?** — `No` by default. `Yes` reveals the skills sub-flow:
|
|
121
|
+
- **Install all** (`--all`) — install every skill to every detected agent with no further
|
|
122
|
+
questions, **or**
|
|
123
|
+
- **Configure individually**:
|
|
124
|
+
- **Agent(s)** — which AI agents to install into (e.g. `cursor`, `claude-code`, `*` for all;
|
|
125
|
+
empty = default).
|
|
126
|
+
- **Skill(s)** — which skills to install (space-separated names, `*` for all, empty = all).
|
|
127
|
+
- **Global** — install at user level instead of project level.
|
|
128
|
+
- **Skip confirmations** — auto-confirm the skills installer's prompts.
|
|
129
|
+
|
|
130
|
+
7. **Start the app?** — when dependencies were installed, the CLI can launch the app immediately
|
|
131
|
+
(`npm start`), opening the browser on `http://localhost:4200`.
|
|
132
|
+
|
|
133
|
+
### Application types explained
|
|
134
|
+
|
|
135
|
+
The **primary choice** is the application type. The two flagship desktop tracks are
|
|
136
|
+
**Desktop / Desktop EDS** (Angular) and **React EDS** (React); the remaining types cover mobile and
|
|
137
|
+
server-rendered Java web modules.
|
|
138
|
+
|
|
139
|
+
| Menu entry | Stack | App shell / UI layer | Notes |
|
|
140
|
+
| --- | --- | --- | --- |
|
|
141
|
+
| **Desktop** | Angular | `@eui/components` (`eui-app`) — legacy app-shell | Prompts for the app-shell option (default vs ECL theme). The classic eUI desktop app. |
|
|
142
|
+
| **Desktop EDS** | Angular | `@eui/eds` (`eds-shell` + EDS components) — modern design system | Same desktop skeleton as *Desktop* (identical routes, features, config, HTTP interceptors) but the shell is composed with `eds-shell`, `eds-user-profile`, `eds-icon-button`, etc. Skips the app-shell prompt. |
|
|
143
|
+
| **React EDS** | React + Vite | `@eui/eds-react` (`EdsShell` + pure-React EDS components) | A Vite React app with an `EdsShell` (toolbar + collapsible sidebar + routed content) and example pages, using React Router (`HashRouter`). |
|
|
144
|
+
| **Mobile Ionic** | Angular + Ionic | eUI mobile layer | A mobile app skeleton. No app-shell / ECL prompt. |
|
|
145
|
+
| **eUI + Spring Boot web module** | Angular inside a Spring Boot Maven module | eUI (default or ECL) | Generates a Java Spring Boot web module with an embedded Angular front-end. **Requires JDK + Maven.** Prompts for Maven `groupId` / `artifactId`. |
|
|
146
|
+
| **eUI + Maven web module** | Angular inside a JEE/Spring Maven module | eUI (default or ECL) | Generates a JEE Spring Maven web module with an embedded Angular front-end. **Requires JDK + Maven.** |
|
|
147
|
+
|
|
148
|
+
**Desktop vs Desktop EDS** — pick *Desktop EDS* for new applications that should adopt the modern
|
|
149
|
+
EU Design System (EDS) look and components; pick *Desktop* if you need the legacy `@eui/components`
|
|
150
|
+
shell or the ECL site layout for `ec.europa.eu` public sites. Both share the same underlying
|
|
151
|
+
Angular application structure, so switching later is mostly a shell/template change.
|
|
152
|
+
|
|
153
|
+
**React EDS** — the React equivalent of Desktop EDS, built on `@eui/eds-react`. It ships a working
|
|
154
|
+
`EdsShell` app (toolbar, collapsible icon sidebar, routed content, Home + About pages) and is
|
|
155
|
+
served/built through the same `eui-cli` commands as the Angular apps (see
|
|
156
|
+
[Working with a generated app](#working-with-a-generated-app)).
|
|
157
|
+
|
|
158
|
+
### Non-interactive / automated mode
|
|
159
|
+
|
|
160
|
+
Pass `--config` (with an optional `--targetPath`) to skip **all** prompts — ideal for CI, scripts,
|
|
161
|
+
or reproducible scaffolding. The value is a comma-separated list of `key:value` pairs; any option
|
|
162
|
+
you omit falls back to its default.
|
|
60
163
|
|
|
61
|
-
|
|
164
|
+
```sh
|
|
165
|
+
eui-cli new --config <config-string> --targetPath <output-directory>
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Examples for the main tracks:
|
|
62
169
|
|
|
63
170
|
```sh
|
|
64
|
-
#
|
|
65
|
-
eui-cli new --
|
|
171
|
+
# Desktop (plain Angular), no install
|
|
172
|
+
eui-cli new --config appType:angular,npmInstall:false --targetPath eui-desktop
|
|
173
|
+
|
|
174
|
+
# Desktop with the ECL app-shell, EC theme
|
|
175
|
+
eui-cli new --config appType:angular,appOptions:ecl,appOptionsEclTheme:ecl-ec,npmInstall:false --targetPath eui-desktop-ecl
|
|
66
176
|
|
|
67
|
-
#
|
|
68
|
-
eui-cli new --
|
|
177
|
+
# Desktop EDS (Angular + eds-shell)
|
|
178
|
+
eui-cli new --config appType:angular,appOptions:eds,npmInstall:false --targetPath eui-desktop-eds
|
|
69
179
|
|
|
70
|
-
#
|
|
71
|
-
eui-cli new --
|
|
180
|
+
# React EDS (React + Vite + @eui/eds-react)
|
|
181
|
+
eui-cli new --config appType:react,npmInstall:false --targetPath eui-react-eds
|
|
72
182
|
|
|
73
|
-
#
|
|
74
|
-
eui-cli new --
|
|
183
|
+
# Spring Boot web module (needs JDK + Maven)
|
|
184
|
+
eui-cli new --config appType:web-spring-boot,groupId:ec.europa.digit,artifactId:myapp,npmInstall:false --targetPath eui-web
|
|
185
|
+
|
|
186
|
+
# Fully automated with pnpm + install + skills
|
|
187
|
+
eui-cli new --config appType:angular,appOptions:eds,npmInstall:true,packageManager:pnpm --skills --skillsAll --targetPath eui-app
|
|
75
188
|
```
|
|
76
189
|
|
|
77
|
-
>
|
|
190
|
+
> **Note on `appOptions`.** In a `--config` string, `appOptions` accepts multiple values joined by
|
|
191
|
+
> an underscore (e.g. `ecl_something`) and is parsed into a list. Use `appOptions:eds` for the EDS
|
|
192
|
+
> desktop shell and `appOptions:ecl` (with `appOptionsEclTheme`) for the ECL shell.
|
|
193
|
+
|
|
194
|
+
### Full configuration reference
|
|
195
|
+
|
|
196
|
+
Every key accepted in the `--config` string (and its interactive-prompt equivalent):
|
|
197
|
+
|
|
198
|
+
| Key | Values | Applies to | Meaning |
|
|
199
|
+
| --- | --- | --- | --- |
|
|
200
|
+
| `appType` | `angular` · `react` · `mobile` · `web-spring-boot` · `web-maven` | all | The skeleton to generate. `Desktop` and `Desktop EDS` both use `angular` (differentiated by `appOptions`). `React EDS` uses `react`. |
|
|
201
|
+
| `appOptions` | `''` (default) · `ecl` · `eds` (underscore-join for multiple) | Angular | App-shell layer. Empty = default eUI shell; `ecl` = ECL site shell; `eds` = EDS desktop shell. |
|
|
202
|
+
| `appOptionsEclTheme` | `ecl-ec` · `ecl-eu` | Angular + `appOptions:ecl` | ECL theme flavor (EC vs EU). |
|
|
203
|
+
| `groupId` | any Maven groupId | `web-spring-boot` | Maven groupId (e.g. `ec.europa.digit`). |
|
|
204
|
+
| `artifactId` | any Maven artifactId | `web-spring-boot` | Maven artifactId (e.g. `myapp`). |
|
|
205
|
+
| `npmInstall` | `true` · `false` | all | Install dependencies right after scaffolding. |
|
|
206
|
+
| `packageManager` | `yarn` · `pnpm` | all (when installing) | Package manager to install with; also selects the pnpm `package.json` variant. |
|
|
207
|
+
| `appStart` | `true` · `false` | all | Start the app (`npm start`) after a successful install. Only runs when `npmInstall` is `true`. |
|
|
208
|
+
| `skills` | `true` · `false` | all | Set up eui-skills after generation. |
|
|
209
|
+
| `skillsAll` | `true` · `false` | with `skills` | Install all skills to all agents, no prompts. |
|
|
210
|
+
| `skillsAgent` | agent name(s), space-separated or `*` | with `skills` | Target agents. |
|
|
211
|
+
| `skillsSkill` | skill name(s), space-separated or `*` | with `skills` | Skills to install. |
|
|
212
|
+
| `skillsGlobal` | `true` · `false` | with `skills` | Install at user level instead of project level. |
|
|
213
|
+
| `skillsYes` | `true` · `false` | with `skills` | Auto-confirm skills prompts. |
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## Working with a generated app
|
|
218
|
+
|
|
219
|
+
Every generated app exposes the same npm scripts, which delegate to `eui-cli`. The CLI's
|
|
220
|
+
`serve-app` and `build-app` are **framework-aware**: they detect whether the project is an Angular
|
|
221
|
+
app (`angular.json`) or a Vite React app (`vite.config.*`) and run the correct toolchain. This is
|
|
222
|
+
what lets both Desktop/Desktop EDS (Angular) and React EDS (Vite) be driven with identical commands.
|
|
223
|
+
|
|
224
|
+
Common scripts in the generated `package.json`:
|
|
78
225
|
|
|
79
|
-
|
|
226
|
+
| Script | Angular apps | React EDS app |
|
|
227
|
+
| --- | --- | --- |
|
|
228
|
+
| `npm start` | Mock server + `eui-cli serve-app` (proxy-mock) in parallel | Mock server + `eui-cli serve-app` (Vite dev server) in parallel |
|
|
229
|
+
| `npm run start-local` | `eui-cli serve-app` (no proxy) | `eui-cli serve-app` (Vite) |
|
|
230
|
+
| `npm run build` | `eui-cli build-app` | `tsc -b && eui-cli build-app` (Vite build) |
|
|
80
231
|
|
|
81
|
-
|
|
232
|
+
### `eui-cli serve-app`
|
|
233
|
+
|
|
234
|
+
Serves the application on a local dev server.
|
|
82
235
|
|
|
83
236
|
```sh
|
|
84
|
-
eui-cli
|
|
237
|
+
eui-cli serve-app [options]
|
|
85
238
|
```
|
|
86
239
|
|
|
87
|
-
|
|
240
|
+
| Option | Angular | React (Vite) |
|
|
241
|
+
| --- | --- | --- |
|
|
242
|
+
| `-c, --configuration <config>` | Angular build configuration | ignored |
|
|
243
|
+
| `-p, --port <port>` | dev-server port (default 4200) | Vite port |
|
|
244
|
+
| `-h, --host <host>` | host to bind | Vite host |
|
|
245
|
+
| `--proxyConfig <path>` | proxy config file | ignored (use `vite.config.ts` `server.proxy`) |
|
|
246
|
+
| `--baseHref, --base-href <href>` | base href | ignored |
|
|
247
|
+
| `--servePath <path>` | serve path | ignored |
|
|
248
|
+
| `--open <value>` | open browser (default on; `--open=false` to disable) | `--open` / `--no-open` |
|
|
249
|
+
| `--configEnvTarget <target>` | inject env config before serving | ignored |
|
|
250
|
+
| `--noLiveReload` | disable live reload | ignored |
|
|
251
|
+
| `--disableHostCheck` | disable host check | ignored |
|
|
252
|
+
| `--maxSpaceSize` | raise Node memory to 8 GB | ignored |
|
|
253
|
+
| `-d, --debug` | verbose logging | verbose logging |
|
|
254
|
+
|
|
255
|
+
### `eui-cli build-app`
|
|
256
|
+
|
|
257
|
+
Builds the application for production.
|
|
258
|
+
|
|
259
|
+
```sh
|
|
260
|
+
eui-cli build-app [options]
|
|
88
261
|
```
|
|
89
|
-
|
|
262
|
+
|
|
263
|
+
| Option | Angular | React (Vite) |
|
|
264
|
+
| --- | --- | --- |
|
|
265
|
+
| `--skipLint` | skip `ng lint` | n/a (lint is a separate script) |
|
|
266
|
+
| `--skipTest` | skip unit tests | n/a |
|
|
267
|
+
| `--skipCompile` | skip the final compile step | n/a |
|
|
268
|
+
| `-c, --configuration <config>` | Angular build configuration (default `production`) | ignored |
|
|
269
|
+
| `--baseHref, --base-href <href>` | base href | mapped to Vite `--base` |
|
|
270
|
+
| `--servePath <path>` | serve path | ignored |
|
|
271
|
+
| `--statsJson` | emit `stats.json` | ignored |
|
|
272
|
+
| `--sourceMap` | emit source maps | ignored |
|
|
273
|
+
| `--deployUrl <url>` | deploy URL | ignored |
|
|
274
|
+
| `--configEnvTarget <target>` | inject env config before build | ignored |
|
|
275
|
+
| `--maxSpaceSize` | raise Node memory to 8 GB | ignored |
|
|
276
|
+
| `--ci` | disable progress output | ignored |
|
|
277
|
+
| `--dryRun` | print commands without running them | print without running |
|
|
278
|
+
| `-w, --watch` | watch mode for tests | ignored |
|
|
279
|
+
| `-d, --debug` | verbose logging | verbose logging |
|
|
280
|
+
|
|
281
|
+
> For React apps, TypeScript type-checking stays in the app's own `tsc -b` step (part of the
|
|
282
|
+
> `build` npm script); `eui-cli build-app` runs the Vite bundle step. The Angular-only quality
|
|
283
|
+
> gates (`--skipLint` / `--skipTest`) and env-config injection do not apply to React.
|
|
284
|
+
|
|
285
|
+
### `eui-cli lint-app`
|
|
286
|
+
|
|
287
|
+
Lints an Angular application.
|
|
288
|
+
|
|
289
|
+
```sh
|
|
290
|
+
eui-cli lint-app [-p, --project <name>] [-d, --debug]
|
|
90
291
|
```
|
|
91
292
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
- `skillsAll`: `true`, `false`
|
|
102
|
-
- `skillsAgent`: agent name(s), space-separated or `*`
|
|
103
|
-
- `skillsSkill`: skill name(s), space-separated or `*`
|
|
104
|
-
- `skillsGlobal`: `true`, `false`
|
|
105
|
-
- `skillsYes`: `true`, `false`
|
|
293
|
+
### Migrate application
|
|
294
|
+
|
|
295
|
+
Runs the eUI, ECL and Angular **migration schematics** on a **standalone** eUI application. Every
|
|
296
|
+
group is selected and runs all of its schematics by default; you can also pick specific groups or
|
|
297
|
+
specific schematics.
|
|
298
|
+
|
|
299
|
+
> This is primarily for standalone eUI applications that are **not** part of the MyWorkplace /
|
|
300
|
+
> CSDR ecosystem. In MyWorkplace the `csdr-engine` runs these schematics for you; for a standalone
|
|
301
|
+
> app you run them yourself with this command.
|
|
106
302
|
|
|
107
|
-
|
|
303
|
+
Unlike `ng update` (which only runs the version-gated migrations tied to a package upgrade), this
|
|
304
|
+
command executes the schematics directly via `ng generate`, so you can run — or re-run — any
|
|
305
|
+
migration on demand.
|
|
108
306
|
|
|
109
307
|
```sh
|
|
110
|
-
eui-cli
|
|
308
|
+
eui-cli migrate [--groups <list>] [--only <list>] [--path <path>] [--dryRun] [--force]
|
|
111
309
|
```
|
|
112
310
|
|
|
113
|
-
|
|
114
|
-
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
- `-c, --configuration <config>` - Angular build configuration
|
|
118
|
-
- `--baseHref, --base-href <href>` - Base href for the application
|
|
119
|
-
- `--statsJson` - Generate stats.json file
|
|
120
|
-
- `--sourceMap` - Generate source maps
|
|
311
|
+
Run without arguments to pick interactively in two stages: first choose the groups (all
|
|
312
|
+
pre-selected), then for each multi-schematic group a pre-checked checklist of its individual
|
|
313
|
+
schematics — press enter to keep them all, or toggle to run a subset. Groups always run in the
|
|
314
|
+
order Angular → eUI → ECL so framework-level migrations run first.
|
|
121
315
|
|
|
122
|
-
|
|
316
|
+
Groups:
|
|
317
|
+
- `angular` - official [Angular v22 migrations](https://v22.angular.dev/reference/migrations) via `ng generate @angular/core:<name>` (standalone, control-flow, inject, signal inputs/outputs/queries, self-closing tags, unused imports, NgClass/NgStyle, CommonModule→standalone, Injectable→Service, …); Angular **v22 only**
|
|
318
|
+
- `eui` - eUI breaking-change / modernisation schematics via `ng generate @eui/core:<name>`; running the whole group uses the `migrate-all` aggregate which runs them all in sequence
|
|
319
|
+
- `ecl` - eUI-ECL template migration via `ng generate @eui/core:migrate-ecl`
|
|
320
|
+
|
|
321
|
+
Options:
|
|
322
|
+
- `--groups <list>` - Comma/space separated groups to run (`eui`, `ecl`, `angular`); skips the group prompt
|
|
323
|
+
- `--schematics <list>` - Alias of `--groups`
|
|
324
|
+
- `--only <list>` - Comma/space separated specific schematic names to run within the selected groups
|
|
325
|
+
- `--path <path>` - Restrict schematics to a sub-path (eUI schematics default to `./src`)
|
|
326
|
+
- `--dryRun` - Preview changes without writing files (`ng generate --dry-run`)
|
|
327
|
+
- `--force` - Allow a dirty working tree (`ng generate --force`)
|
|
123
328
|
|
|
124
329
|
```sh
|
|
125
|
-
|
|
330
|
+
# interactive, all groups + all schematics selected by default
|
|
331
|
+
eui-cli migrate
|
|
332
|
+
|
|
333
|
+
# run the eUI and Angular groups (every schematic in each)
|
|
334
|
+
eui-cli migrate --groups=eui,angular
|
|
335
|
+
|
|
336
|
+
# run only specific Angular migrations
|
|
337
|
+
eui-cli migrate --groups=angular --only=standalone-migration,control-flow-migration
|
|
338
|
+
|
|
339
|
+
# run a single eUI schematic
|
|
340
|
+
eui-cli migrate --groups=eui --only=migrate-eui-table
|
|
341
|
+
|
|
342
|
+
# preview everything without writing files
|
|
343
|
+
eui-cli migrate --dryRun
|
|
126
344
|
```
|
|
127
345
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
-
|
|
132
|
-
- `--proxyConfig <path>` - Path to proxy configuration file
|
|
133
|
-
- `--open` - Open browser automatically
|
|
346
|
+
> Only available for Angular-based eUI applications (an `angular.json` must be present in the
|
|
347
|
+
> current directory).
|
|
348
|
+
|
|
349
|
+
### `eui-cli inject-config-app`
|
|
134
350
|
|
|
135
|
-
|
|
351
|
+
Injects an environment-specific configuration file (`env-json-config-<target>.json`) into the app
|
|
352
|
+
before serving/building. Used by the Angular `build-*` / `start-*` scripts via `--configEnvTarget`.
|
|
136
353
|
|
|
137
354
|
```sh
|
|
138
|
-
eui-cli
|
|
355
|
+
eui-cli inject-config-app -c, --configEnvTarget <target> [-d, --debug]
|
|
139
356
|
```
|
|
140
357
|
|
|
141
|
-
###
|
|
358
|
+
### `eui-cli generate-sprite`
|
|
359
|
+
|
|
360
|
+
Generates an SVG sprite from a folder of individual SVG files.
|
|
142
361
|
|
|
143
362
|
```sh
|
|
144
|
-
eui-cli generate-sprite -i <input-folder> -o <output-file>
|
|
363
|
+
eui-cli generate-sprite -i <input-folder> -o <output-file.svg>
|
|
145
364
|
```
|
|
146
365
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
366
|
+
| Option | Description |
|
|
367
|
+
| --- | --- |
|
|
368
|
+
| `-i, --inFolder <path>` | Input folder containing SVG files (**required**). |
|
|
369
|
+
| `-o, --outFile <filename>` | Output sprite filename; must end in `.svg` (**required**). |
|
|
370
|
+
| `-d, --debug` | Verbose logging. |
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
## Generated project layouts
|
|
375
|
+
|
|
376
|
+
### Angular (Desktop / Desktop EDS)
|
|
377
|
+
|
|
378
|
+
```
|
|
379
|
+
├── angular.json # Angular workspace (EDS variant also wires @eui/eds-styles)
|
|
380
|
+
├── package.json # scripts delegate to eui-cli; deps via @eui/deps-base(+dev)
|
|
381
|
+
├── proxy.conf.json # dev proxy to a real backend
|
|
382
|
+
├── proxy-mock.conf.json # dev proxy to the local mock server
|
|
383
|
+
├── mock/ # json-server mock API (server.js, db/, app/routes, app/models)
|
|
384
|
+
└── src/
|
|
385
|
+
├── index.html # Desktop EDS adds class="eui-21" on <body> (EDS token scope)
|
|
386
|
+
├── main.ts
|
|
387
|
+
├── styles.scss
|
|
388
|
+
├── config/ # eUI app config
|
|
389
|
+
├── environments/ # environment.ts / environment.prod.ts
|
|
390
|
+
└── app/
|
|
391
|
+
├── app.component.* # Desktop = eui-app shell · Desktop EDS = eds-shell
|
|
392
|
+
├── app.config.ts # providers, HTTP interceptors, i18n, app initializer
|
|
393
|
+
├── app.routes.ts # lazy-loaded feature routes
|
|
394
|
+
└── features/ # home / module1 / module2 sample features
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
### React EDS
|
|
398
|
+
|
|
399
|
+
```
|
|
400
|
+
├── index.html # <body class="eui-21"> (EDS token scope)
|
|
401
|
+
├── vite.config.ts # Vite config; serves EDS icon sprites, proxies /api to the mock
|
|
402
|
+
├── tsconfig*.json # project references (app + node)
|
|
403
|
+
├── eslint.config.mjs # flat ESLint config (single quotes, TS recommended)
|
|
404
|
+
├── package.json # scripts delegate to eui-cli; deps via @eui/deps-base-react
|
|
405
|
+
├── mock/ # json-server mock API (same shape as the Angular mock)
|
|
406
|
+
├── public/ # host-owned static assets
|
|
407
|
+
└── src/
|
|
408
|
+
├── main.tsx # mounts <App/> in a HashRouter; loads EDS + component styles
|
|
409
|
+
├── App.tsx # the EdsShell (toolbar + sidebar + routed content)
|
|
410
|
+
├── routes.ts # sidebar/route table
|
|
411
|
+
├── styles.css # app-level styles
|
|
412
|
+
└── pages/ # home / about example pages
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
---
|
|
150
416
|
|
|
151
417
|
## Requirements
|
|
152
418
|
|
|
153
|
-
- Node.js
|
|
154
|
-
-
|
|
419
|
+
- **Node.js** `^20.19.0 || ^22.12.0 || >=24.15.0`
|
|
420
|
+
- **Yarn** `>=1.22.4 <2` (or pnpm, experimental)
|
|
421
|
+
- **JDK + Maven** — only for the `web-spring-boot` / `web-maven` application types.
|
|
422
|
+
|
|
423
|
+
---
|
|
155
424
|
|
|
156
425
|
## License
|
|
157
426
|
|
package/bin/eui-cli.js
CHANGED
|
@@ -110,6 +110,32 @@ program
|
|
|
110
110
|
.option('-d, --debug', 'Enable debug mode')
|
|
111
111
|
.action((options, command) => handleCommand('./scripts/lint-app', options, command));
|
|
112
112
|
|
|
113
|
+
program
|
|
114
|
+
.command('migrate')
|
|
115
|
+
.description('Migrate a standalone eUI application (runs eUI / ECL / Angular migration schematics)')
|
|
116
|
+
.option('--groups <list>', 'Comma/space separated groups to migrate: eui, ecl, angular (default: prompt, all selected)')
|
|
117
|
+
.option('--schematics <list>', 'Alias of --groups (comma/space separated: eui, ecl, angular)')
|
|
118
|
+
.option('--only <list>', 'Comma/space separated specific schematic names to run within the selected groups')
|
|
119
|
+
.option('--path <path>', 'Restrict schematics to a sub-path (default: ./src for eUI schematics)')
|
|
120
|
+
.option('--dryRun', 'Run schematics in dry-run mode (no files written)')
|
|
121
|
+
.option('--force', 'Pass --force to ng generate (allow a dirty working tree)')
|
|
122
|
+
.addHelpText('after', `
|
|
123
|
+
Groups:
|
|
124
|
+
angular Angular v22 migrations (https://v22.angular.dev/reference/migrations) via @angular/core
|
|
125
|
+
eui eUI breaking-change / modernisation schematics via @eui/core (migrate-all runs them all)
|
|
126
|
+
ecl eUI-ECL template migration via @eui/core:migrate-ecl
|
|
127
|
+
|
|
128
|
+
Running a whole group runs every schematic in it (the eUI group uses the migrate-all aggregate).
|
|
129
|
+
Use --only to run specific schematics, or pick them interactively.
|
|
130
|
+
|
|
131
|
+
Examples:
|
|
132
|
+
eui-cli migrate interactive, all groups selected by default
|
|
133
|
+
eui-cli migrate --groups=eui,angular run the eUI and Angular groups (all schematics)
|
|
134
|
+
eui-cli migrate --groups=angular --only=standalone-migration,control-flow-migration
|
|
135
|
+
eui-cli migrate --groups=eui --only=migrate-eui-table
|
|
136
|
+
eui-cli migrate --dryRun preview the migrations without writing files`)
|
|
137
|
+
.action((options, command) => handleCommand('./scripts/migrate', options, command));
|
|
138
|
+
|
|
113
139
|
program
|
|
114
140
|
.command('inject-config-app')
|
|
115
141
|
.description('Inject configuration into the application')
|
package/lib/app-utils/build.js
CHANGED
|
@@ -51,6 +51,11 @@ module.exports.run = () => {
|
|
|
51
51
|
prjName = project;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
// Vite React app — build with the Vite bundler instead of the Angular CLI.
|
|
55
|
+
if (utils.detectAppTool() === 'vite') {
|
|
56
|
+
return buildVite({ baseHref, dryRun });
|
|
57
|
+
}
|
|
58
|
+
|
|
54
59
|
utils.logTitle(`Building application : ${prjName}...`);
|
|
55
60
|
|
|
56
61
|
const ng = path.resolve(process.cwd(), 'node_modules', '@angular', 'cli', 'bin', 'ng');
|
|
@@ -140,3 +145,24 @@ module.exports.run = () => {
|
|
|
140
145
|
}
|
|
141
146
|
};
|
|
142
147
|
|
|
148
|
+
/**
|
|
149
|
+
* Builds a standalone Vite React app via the local `vite` binary. TypeScript type-checking is
|
|
150
|
+
* done by the app's own `tsc -b` (kept in the app's `build` script chain); this runs the bundle
|
|
151
|
+
* step so the `eui-cli build-app` surface stays the same for both Angular and React apps.
|
|
152
|
+
*/
|
|
153
|
+
const buildVite = ({ baseHref, dryRun }) => {
|
|
154
|
+
utils.logTitle('Building Vite React application...');
|
|
155
|
+
|
|
156
|
+
const args = ['vite', 'build'];
|
|
157
|
+
|
|
158
|
+
if (baseHref) {
|
|
159
|
+
args.push(`--base=${baseHref}`);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
utils.logInfo(`vite build with args ${args.join(' ')}`);
|
|
163
|
+
|
|
164
|
+
if (!dryRun) {
|
|
165
|
+
execSync(`npx ${args.join(' ')}`, { cwd: process.cwd(), stdio: 'inherit' });
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
|