@eui/cli 21.0.0-alpha.9 → 21.0.0-next.10
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 +1 -1
- package/bin/eui-cli.js +61 -41
- package/bin/scripts/build-app.js +12 -0
- package/bin/scripts/lint-app.js +22 -0
- package/bin/scripts/new.js +39 -0
- package/bin/scripts/serve-app.js +12 -0
- package/lib/app-utils/build.js +176 -0
- package/lib/app-utils/projects.js +41 -0
- package/lib/app-utils/serve.js +78 -0
- package/lib/build.js +14 -39
- package/lib/cli.js +22 -5
- package/lib/config.js +1 -0
- package/lib/generators.js +5 -8
- package/lib/install.js +7 -7
- package/lib/post-build.js +1 -3
- package/lib/skeletons/_angular/base/angular.json +12 -25
- package/lib/skeletons/_angular/base/eslint.config.js +43 -0
- package/lib/skeletons/_angular/base/package.json +29 -23
- package/lib/skeletons/_angular/base/src/app/app-starter.service.spec.ts +8 -6
- package/lib/skeletons/_angular/base/src/app/app.component.html +3 -3
- package/lib/skeletons/_angular/base/src/app/app.component.spec.ts +15 -13
- package/lib/skeletons/_angular/base/src/app/app.component.ts +2 -2
- package/lib/skeletons/_angular/base/src/app/features/home/home.component.html +1 -1
- package/lib/skeletons/_angular/base/src/app/features/home/home.component.ts +5 -3
- package/lib/skeletons/_angular/base/src/app/features/module1/components/page1/page1.component.html +1 -1
- package/lib/skeletons/_angular/base/src/app/features/module1/components/page2/page2.component.html +1 -1
- package/lib/skeletons/_angular/base/src/app/features/module1/module1.component.html +2 -4
- package/lib/skeletons/_angular/base/src/app/features/module2/module2.component.html +1 -1
- package/lib/skeletons/_angular/base/src/app/features/module2/module2.component.ts +1 -1
- package/lib/skeletons/_angular/base/src/dummy.spec.ts +2 -0
- package/lib/skeletons/_angular/base/src/karma.conf.js +42 -2
- package/lib/skeletons/_angular/base/src/tsconfig.app.json +3 -0
- package/lib/skeletons/_angular/base/src/tsconfig.spec.json +1 -5
- package/lib/skeletons/_angular/base/tsconfig.json +28 -24
- package/lib/skeletons/_angular/base-mobile/package.json +4 -4
- package/lib/skeletons/_angular/base-mobile/tsconfig.json +27 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/app.component.ts +16 -16
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/home/home.component.ts +4 -4
- package/lib/skeletons/_angular/options/ecl-eu/src/app/app.component.ts +16 -16
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/home/home.component.ts +4 -4
- package/lib/skeletons/_angular/options/ecl-eu/src/app/shared/shared.module.ts +1 -5
- package/lib/skeletons/_angular/options/pnpm/package.json +72 -0
- package/lib/utils.js +204 -0
- package/package.json +10 -13
- package/.version.properties +0 -1
- package/lib/skeletons/_angular/base/.euirc.json +0 -8
- package/lib/skeletons/_angular/base/src/.eslintrc.json +0 -121
- package/lib/skeletons/web-symfony/myapp-web/angular.json +0 -169
- package/lib/skeletons/web-symfony/myapp-web/package.json +0 -23
- package/lib/skeletons/web-symfony/myapp-web/src/app/app-routing.module.ts +0 -18
- package/lib/skeletons/web-symfony/myapp-web/src/app/app.component.ts +0 -77
- package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/components/products.component.html +0 -160
- package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/components/products.component.scss +0 -0
- package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/components/products.component.ts +0 -104
- package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/models/product.model.ts +0 -6
- package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/products-routing.module.ts +0 -16
- package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/products.module.ts +0 -16
- package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/services/products.service.ts +0 -29
- package/lib/skeletons/web-symfony/myapp-web/src/environments/environment.ts +0 -17
- package/lib/skeletons/web-symfony/myapp-web-rest/.env +0 -28
- package/lib/skeletons/web-symfony/myapp-web-rest/bin/console +0 -42
- package/lib/skeletons/web-symfony/myapp-web-rest/composer.json +0 -67
- package/lib/skeletons/web-symfony/myapp-web-rest/composer.lock +0 -3572
- package/lib/skeletons/web-symfony/myapp-web-rest/config/bootstrap.php +0 -21
- package/lib/skeletons/web-symfony/myapp-web-rest/config/bundles.php +0 -12
- package/lib/skeletons/web-symfony/myapp-web-rest/config/config.yml +0 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/cache.yaml +0 -19
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/dev/routing.yaml +0 -3
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/doctrine.yaml +0 -29
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/doctrine_migrations.yaml +0 -5
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/framework.yaml +0 -17
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/prod/doctrine.yaml +0 -32
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/routing.yaml +0 -4
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/sensio_framework_extra.yaml +0 -3
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/test/framework.yaml +0 -4
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/test/routing.yaml +0 -3
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/twig.yaml +0 -4
- package/lib/skeletons/web-symfony/myapp-web-rest/config/routes/annotations.yaml +0 -3
- package/lib/skeletons/web-symfony/myapp-web-rest/config/routes/dev/twig.yaml +0 -3
- package/lib/skeletons/web-symfony/myapp-web-rest/config/routes.yaml +0 -3
- package/lib/skeletons/web-symfony/myapp-web-rest/config/services.yaml +0 -27
- package/lib/skeletons/web-symfony/myapp-web-rest/public/index.php +0 -27
- package/lib/skeletons/web-symfony/myapp-web-rest/src/Controller/ProductController.php +0 -196
- package/lib/skeletons/web-symfony/myapp-web-rest/src/Entity/Product.php +0 -99
- package/lib/skeletons/web-symfony/myapp-web-rest/src/Kernel.php +0 -53
- package/lib/skeletons/web-symfony/myapp-web-rest/src/Migrations/Version20190604101623.php +0 -31
- package/lib/skeletons/web-symfony/myapp-web-rest/src/Migrations/Version20190604101638.php +0 -35
- package/lib/skeletons/web-symfony/myapp-web-rest/src/Repository/ProductRepository.php +0 -51
- package/lib/skeletons/web-symfony/myapp-web-rest/symfony.lock +0 -274
- package/lib/skeletons/web-symfony/myapp-web-rest/templates/base.html.twig +0 -12
- package/lib/skeletons/web-symfony/myapp-web-rest/templates/lucky/number.html.twig +0 -1
- package/lib/skeletons/web-symfony/myapp-web-rest/templates/product/index.html.twig +0 -20
package/lib/generators.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
const chalk = require('chalk');
|
|
2
1
|
const childProcess = require('child_process');
|
|
3
2
|
const execSync = childProcess.execSync;
|
|
4
3
|
const cli = require('./cli');
|
|
@@ -10,9 +9,9 @@ const utils = require('./utils');
|
|
|
10
9
|
|
|
11
10
|
const appGenerate = (options) => {
|
|
12
11
|
if (options.inputConfig) {
|
|
13
|
-
|
|
12
|
+
utils.logInfo('Creating your project - automated mode : \n');
|
|
14
13
|
} else {
|
|
15
|
-
|
|
14
|
+
utils.logInfo('Configuring your project : please answer the following : \n');
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
// Query the questions
|
|
@@ -52,11 +51,9 @@ const appGenerate = (options) => {
|
|
|
52
51
|
if (!cliConfig.appStart || typeof cliConfig.npmInstall !== 'boolean' || !cliConfig.npmInstall) {
|
|
53
52
|
return;
|
|
54
53
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
console.log(chalk.cyan(' Starting eUI app... browser will open soon on localhost:4200'));
|
|
59
|
-
console.log('*****************************************************************');
|
|
54
|
+
utils.logInfo('*****************************************************************');
|
|
55
|
+
utils.logInfo(' Starting eUI app... browser will open soon on localhost:4200');
|
|
56
|
+
utils.logInfo('*****************************************************************');
|
|
60
57
|
|
|
61
58
|
const wd = path.resolve(utils.getAngularPath(options.targetPath, cliConfig.appName, cliConfig.appType, cliConfig.artifactId));
|
|
62
59
|
return execSync("npm start", { cwd: wd, stdio: "inherit" });
|
package/lib/install.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
const childProcess = require('child_process');
|
|
2
2
|
const execSync = childProcess.execSync;
|
|
3
3
|
const path = require('path');
|
|
4
|
-
const tools = require('@eui/tools/scripts/utils/tools');
|
|
5
4
|
const utils = require('./utils');
|
|
6
|
-
const chalk = require('chalk');
|
|
7
5
|
|
|
8
6
|
module.exports.start = (options) => {
|
|
9
7
|
|
|
@@ -27,15 +25,17 @@ const install = (cliConfig, targetPath) => {
|
|
|
27
25
|
console.log('');
|
|
28
26
|
console.log('');
|
|
29
27
|
console.log('*****************************************************');
|
|
30
|
-
console.log(
|
|
28
|
+
console.log(' Installing app dependencies... PLEASE WAIT....');
|
|
31
29
|
console.log('*****************************************************');
|
|
32
30
|
|
|
33
31
|
return Promise.resolve()
|
|
34
32
|
.then(() => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
if (cliConfig.packageManager === 'pnpm') {
|
|
34
|
+
return execSync("pnpm install", { cwd: wd, stdio: "inherit" });
|
|
35
|
+
|
|
36
|
+
} else {
|
|
37
|
+
return execSync("yarn", { cwd: wd, stdio: "inherit" });
|
|
38
|
+
}
|
|
39
39
|
})
|
|
40
40
|
|
|
41
41
|
.catch((e) => {
|
package/lib/post-build.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
-
const tools = require('@eui/tools/scripts/utils/tools');
|
|
3
|
-
|
|
4
2
|
const utils = require('./utils');
|
|
5
3
|
|
|
6
4
|
module.exports.start = (options) => {
|
|
@@ -24,7 +22,7 @@ const postBuild = (cliConfig, targetPath) => {
|
|
|
24
22
|
.then(() => {
|
|
25
23
|
console.log('--renaming .gitignore');
|
|
26
24
|
const angularPath = utils.getAngularPath(targetPath, appName, appType, artifactId);
|
|
27
|
-
return
|
|
25
|
+
return utils.move(path.join(angularPath, 'gitignore_TO_REPLACE'), path.join(angularPath, '.gitignore'));
|
|
28
26
|
})
|
|
29
27
|
|
|
30
28
|
.catch((e) => {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"architect": {
|
|
23
23
|
"build": {
|
|
24
|
-
"builder": "@angular
|
|
24
|
+
"builder": "@angular/build:application",
|
|
25
25
|
"options": {
|
|
26
26
|
"outputPath": "dist",
|
|
27
27
|
"index": "src/index.html",
|
|
@@ -46,7 +46,6 @@
|
|
|
46
46
|
"styles": [
|
|
47
47
|
"node_modules/@eui/styles/dist/eui.css",
|
|
48
48
|
"node_modules/@eui/styles/dist/eui-utilities.css",
|
|
49
|
-
"node_modules/@eui/styles/dist/eui-theme-eui-legacy.css",
|
|
50
49
|
"src/styles.scss"
|
|
51
50
|
]
|
|
52
51
|
},
|
|
@@ -106,7 +105,7 @@
|
|
|
106
105
|
"defaultConfiguration": "production"
|
|
107
106
|
},
|
|
108
107
|
"serve": {
|
|
109
|
-
"builder": "@angular
|
|
108
|
+
"builder": "@angular/build:dev-server",
|
|
110
109
|
"options": {
|
|
111
110
|
"buildTarget": "app:build"
|
|
112
111
|
},
|
|
@@ -124,32 +123,20 @@
|
|
|
124
123
|
},
|
|
125
124
|
"defaultConfiguration": "development"
|
|
126
125
|
},
|
|
127
|
-
"
|
|
128
|
-
"builder": "@angular
|
|
126
|
+
"test": {
|
|
127
|
+
"builder": "@angular/build:unit-test",
|
|
129
128
|
"options": {
|
|
130
|
-
"
|
|
131
|
-
"eslintConfig": "src/.eslintrc.json"
|
|
129
|
+
"tsConfig": "src/tsconfig.spec.json"
|
|
132
130
|
}
|
|
133
131
|
},
|
|
134
|
-
"
|
|
135
|
-
"builder": "@angular-
|
|
132
|
+
"lint": {
|
|
133
|
+
"builder": "@angular-eslint/builder:lint",
|
|
136
134
|
"options": {
|
|
137
|
-
"
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
"
|
|
142
|
-
{
|
|
143
|
-
"glob": "**/*",
|
|
144
|
-
"input": "node_modules/@eui/core/assets/",
|
|
145
|
-
"output": "./assets"
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
"glob": "**/*",
|
|
149
|
-
"input": "node_modules/@eui/styles/dist/assets/",
|
|
150
|
-
"output": "./assets"
|
|
151
|
-
}
|
|
152
|
-
]
|
|
135
|
+
"lintFilePatterns": [
|
|
136
|
+
"src/**/*.ts",
|
|
137
|
+
"src/**/*.html"
|
|
138
|
+
],
|
|
139
|
+
"eslintConfig": "eslint.config.js"
|
|
153
140
|
}
|
|
154
141
|
}
|
|
155
142
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
const eslint = require("@eslint/js");
|
|
3
|
+
const tseslint = require("typescript-eslint");
|
|
4
|
+
const angular = require("angular-eslint");
|
|
5
|
+
|
|
6
|
+
module.exports = tseslint.config(
|
|
7
|
+
{
|
|
8
|
+
files: ["**/*.ts"],
|
|
9
|
+
extends: [
|
|
10
|
+
eslint.configs.recommended,
|
|
11
|
+
...tseslint.configs.recommended,
|
|
12
|
+
...tseslint.configs.stylistic,
|
|
13
|
+
...angular.configs.tsRecommended,
|
|
14
|
+
],
|
|
15
|
+
processor: angular.processInlineTemplates,
|
|
16
|
+
rules: {
|
|
17
|
+
"@angular-eslint/directive-selector": [
|
|
18
|
+
"error",
|
|
19
|
+
{
|
|
20
|
+
type: "attribute",
|
|
21
|
+
prefix: "app",
|
|
22
|
+
style: "camelCase",
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
"@angular-eslint/component-selector": [
|
|
26
|
+
"error",
|
|
27
|
+
{
|
|
28
|
+
type: "element",
|
|
29
|
+
prefix: "app",
|
|
30
|
+
style: "kebab-case",
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
files: ["**/*.html"],
|
|
37
|
+
extends: [
|
|
38
|
+
...angular.configs.templateRecommended,
|
|
39
|
+
...angular.configs.templateAccessibility,
|
|
40
|
+
],
|
|
41
|
+
rules: {},
|
|
42
|
+
},
|
|
43
|
+
);
|
|
@@ -1,38 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eui-angular-app",
|
|
3
|
-
"version": "21.0.0-
|
|
3
|
+
"version": "21.0.0-next.10",
|
|
4
4
|
"license": "EUPL-1.1",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"ng": "ng",
|
|
7
7
|
"start-mock-server": "nodemon --watch ./mock ./mock/server.js",
|
|
8
|
-
"start-serve": "eui-
|
|
8
|
+
"start-serve": "eui-cli serve-app --configuration=proxy-mock",
|
|
9
9
|
"start": "npm-run-all --parallel start-mock-server start-serve",
|
|
10
|
-
"start-proxy": "eui-
|
|
11
|
-
"start-local": "eui-
|
|
12
|
-
"build": "eui-
|
|
13
|
-
"build-dev": "eui-
|
|
14
|
-
"build-prod": "eui-
|
|
15
|
-
"build-prod-skip-test": "eui-
|
|
16
|
-
"build-prod-stats": "eui-
|
|
17
|
-
"app:build": "eui-
|
|
18
|
-
"app:inject-config": "eui-
|
|
19
|
-
"generate-changelog": "eui-
|
|
20
|
-
"generate-sprite": "eui-
|
|
10
|
+
"start-proxy": "eui-cli serve-app --configuration=proxy",
|
|
11
|
+
"start-local": "eui-cli serve-app",
|
|
12
|
+
"build": "eui-cli build-app",
|
|
13
|
+
"build-dev": "eui-cli build-app --configuration=development --configEnvTarget=dev",
|
|
14
|
+
"build-prod": "eui-cli build-app --configuration=production-optimized --configEnvTarget=prod",
|
|
15
|
+
"build-prod-skip-test": "eui-cli build-app --configuration=production-optimized --configEnvTarget=prod --skipTest",
|
|
16
|
+
"build-prod-stats": "eui-cli build-app --configuration=production-optimized --configEnvTarget=prod --statsJson",
|
|
17
|
+
"app:build": "eui-cli build-app",
|
|
18
|
+
"app:inject-config": "eui-cli inject-config-app",
|
|
19
|
+
"generate-changelog": "eui-cli generate-changelog",
|
|
20
|
+
"generate-sprite": "eui-cli generate-sprite"
|
|
21
21
|
},
|
|
22
22
|
"private": true,
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@eui/deps-base": "21.0.0-
|
|
24
|
+
"@eui/deps-base": "21.0.0-next.10"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"npm-run-all": "4.1.5",
|
|
28
|
+
"json-server": "1.0.0-beta.3",
|
|
29
|
+
"nodemon": "2.0.22",
|
|
30
|
+
"lowdb": "1.0.0",
|
|
31
|
+
"body-parser": "1.20.3",
|
|
32
|
+
"express": "4.21.2",
|
|
33
|
+
"typescript-eslint": "8.46.3",
|
|
34
|
+
"angular-eslint": "20.6.0",
|
|
35
|
+
"eslint": "^9.39.0",
|
|
36
|
+
"vitest": "^4.0.0",
|
|
37
|
+
"jsdom": "^27.2.0"
|
|
25
38
|
},
|
|
26
39
|
"resolutions": {
|
|
27
|
-
"js-yaml": ">=3.13.1",
|
|
28
|
-
"pdfjs-dist": "4.10.38",
|
|
29
|
-
"tar": ">=6.2.1",
|
|
30
|
-
"katex": ">=0.16.10",
|
|
31
|
-
"follow-redirects": ">=1.15.4",
|
|
32
|
-
"word-wrap": ">=1.2.4",
|
|
33
|
-
"postcss": ">=8.4.31",
|
|
34
40
|
"semver": ">=7.5.2",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
41
|
+
"dompurify": ">=3.2.4",
|
|
42
|
+
"tmp": ">0.2.4"
|
|
37
43
|
}
|
|
38
44
|
}
|
|
@@ -4,9 +4,11 @@ import {CONFIG_TOKEN, I18nService, UserService} from '@eui/core';
|
|
|
4
4
|
import {EuiAppConfig} from '@eui/core';
|
|
5
5
|
import {of} from 'rxjs';
|
|
6
6
|
import {AppStarterService} from './app-starter.service';
|
|
7
|
-
import SpyObj = jasmine.SpyObj;
|
|
8
7
|
import { EuiServiceStatus } from '@eui/base';
|
|
9
8
|
import { provideHttpClient, withInterceptorsFromDi } from "@angular/common/http";
|
|
9
|
+
import { describe, it, beforeEach, expect, vi } from 'vitest';
|
|
10
|
+
|
|
11
|
+
type SpyObj<T> = { [K in keyof T]: T[K] extends (...args: any[]) => any ? ReturnType<typeof vi.fn> : T[K] };
|
|
10
12
|
|
|
11
13
|
describe('AppStarterService', () => {
|
|
12
14
|
let service: AppStarterService;
|
|
@@ -16,8 +18,8 @@ describe('AppStarterService', () => {
|
|
|
16
18
|
let configMock: EuiAppConfig;
|
|
17
19
|
|
|
18
20
|
beforeEach(() => {
|
|
19
|
-
userServiceMock =
|
|
20
|
-
i18nServiceMock =
|
|
21
|
+
userServiceMock = { init: vi.fn() } as SpyObj<UserService>;
|
|
22
|
+
i18nServiceMock = { init: vi.fn() } as SpyObj<I18nService>;
|
|
21
23
|
configMock = {global: {}, modules: {core: {base: 'localhost:3000', userDetails: 'dummy'}}};
|
|
22
24
|
|
|
23
25
|
TestBed.configureTestingModule({
|
|
@@ -40,8 +42,8 @@ describe('AppStarterService', () => {
|
|
|
40
42
|
});
|
|
41
43
|
|
|
42
44
|
it('should call start method', () => {
|
|
43
|
-
userServiceMock.init.
|
|
44
|
-
i18nServiceMock.init.
|
|
45
|
+
vi.mocked(userServiceMock.init).mockReturnValue(of({ } as EuiServiceStatus));
|
|
46
|
+
vi.mocked(i18nServiceMock.init).mockReturnValue(of({ } as EuiServiceStatus));
|
|
45
47
|
service.start().subscribe(() => {
|
|
46
48
|
expect(userServiceMock.init).toHaveBeenCalled();
|
|
47
49
|
expect(i18nServiceMock.init).toHaveBeenCalled();
|
|
@@ -49,7 +51,7 @@ describe('AppStarterService', () => {
|
|
|
49
51
|
});
|
|
50
52
|
|
|
51
53
|
it('should call initUserService method', () => {
|
|
52
|
-
userServiceMock.init.
|
|
54
|
+
vi.mocked(userServiceMock.init).mockReturnValue(of({ } as EuiServiceStatus));
|
|
53
55
|
service.initUserService().subscribe(() => {
|
|
54
56
|
expect(userServiceMock.init).toHaveBeenCalled();
|
|
55
57
|
});
|
|
@@ -10,17 +10,17 @@
|
|
|
10
10
|
<eui-user-profile isShowAvatarInitials>
|
|
11
11
|
<eui-user-profile-menu>
|
|
12
12
|
<eui-user-profile-menu-item>
|
|
13
|
-
<eui-icon-svg icon="
|
|
13
|
+
<eui-icon-svg icon="user:regular"/>{{ 'eui.my-profile-informations' | translate }}
|
|
14
14
|
</eui-user-profile-menu-item>
|
|
15
15
|
<eui-user-profile-menu-item>
|
|
16
|
-
<eui-icon-svg icon="
|
|
16
|
+
<eui-icon-svg icon="sign-out:regular"/>{{ 'eui.sign-out' | translate }}
|
|
17
17
|
</eui-user-profile-menu-item>
|
|
18
18
|
</eui-user-profile-menu>
|
|
19
19
|
</eui-user-profile>
|
|
20
20
|
</eui-toolbar-item>
|
|
21
21
|
|
|
22
22
|
<eui-toolbar-item>
|
|
23
|
-
<eui-notifications [count]="notificationItems
|
|
23
|
+
<eui-notifications [count]="notificationItems.length" [items]="notificationItems" />
|
|
24
24
|
</eui-toolbar-item>
|
|
25
25
|
</eui-toolbar-items>
|
|
26
26
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
2
|
import { RouterModule } from '@angular/router';
|
|
3
3
|
import { AppComponent } from './app.component';
|
|
4
|
-
import {
|
|
4
|
+
import { EUI_LAYOUT } from '@eui/components/layout';
|
|
5
5
|
import { routes } from './app.routes';
|
|
6
6
|
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
|
7
7
|
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
|
@@ -10,7 +10,9 @@ import { CONFIG_TOKEN, I18nService, I18nState, UserService} from '@eui/core';
|
|
|
10
10
|
import { EuiAppConfig } from '@eui/core';
|
|
11
11
|
import { Observable, of } from 'rxjs';
|
|
12
12
|
import { TranslateModule } from '@ngx-translate/core';
|
|
13
|
-
import
|
|
13
|
+
import { describe, it, beforeEach, expect, vi } from 'vitest';
|
|
14
|
+
|
|
15
|
+
type SpyObj<T> = { [K in keyof T]: T[K] extends (...args: any[]) => any ? ReturnType<typeof vi.fn> : T[K] };
|
|
14
16
|
|
|
15
17
|
describe('AppComponent', () => {
|
|
16
18
|
let component: AppComponent;
|
|
@@ -20,24 +22,24 @@ describe('AppComponent', () => {
|
|
|
20
22
|
let configMock: EuiAppConfig;
|
|
21
23
|
|
|
22
24
|
beforeEach(async () => {
|
|
23
|
-
|
|
24
|
-
// Handle the overloaded getState method
|
|
25
25
|
type GetStateReturnType<T> = T extends keyof I18nState ? Observable<I18nState[T]> : Observable<I18nState>;
|
|
26
26
|
|
|
27
|
-
userServiceMock =
|
|
28
|
-
i18nServiceMock =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
userServiceMock = { init: vi.fn() } as SpyObj<UserService>;
|
|
28
|
+
i18nServiceMock = {
|
|
29
|
+
init: vi.fn(),
|
|
30
|
+
getState: vi.fn(<K extends keyof I18nState>(key?: K): GetStateReturnType<K> => {
|
|
31
|
+
if (typeof key === 'string') {
|
|
32
|
+
return of({ activeLang: 'en' }[key]) as GetStateReturnType<K>;
|
|
33
|
+
}
|
|
34
|
+
return of({ activeLang: 'en' }) as GetStateReturnType<K>;
|
|
35
|
+
})
|
|
36
|
+
} as SpyObj<I18nService>;
|
|
35
37
|
configMock = {global: {}, modules: {core: {base: 'localhost:3000', userDetails: 'dummy'}}};
|
|
36
38
|
|
|
37
39
|
await TestBed.configureTestingModule({
|
|
38
40
|
imports: [
|
|
39
41
|
RouterModule.forRoot(routes),
|
|
40
|
-
|
|
42
|
+
...EUI_LAYOUT,
|
|
41
43
|
TranslateModule.forRoot(),
|
|
42
44
|
],
|
|
43
45
|
providers: [
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Component } from '@angular/core';
|
|
2
2
|
import { TranslateModule } from '@ngx-translate/core';
|
|
3
|
-
import { EuiLayoutModule } from '@eui/components/layout';
|
|
4
3
|
import { EUI_LANGUAGE_SELECTOR } from '@eui/components/eui-language-selector';
|
|
5
4
|
import { EUI_USER_PROFILE } from '@eui/components/eui-user-profile';
|
|
6
5
|
import { EUI_ICON } from '@eui/components/eui-icon';
|
|
7
6
|
import { EuiMenuItem } from '@eui/components/eui-menu';
|
|
7
|
+
import { EUI_LAYOUT } from '@eui/components/layout';
|
|
8
8
|
|
|
9
9
|
@Component({
|
|
10
10
|
selector: 'app-root',
|
|
11
11
|
templateUrl: './app.component.html',
|
|
12
12
|
imports: [
|
|
13
13
|
TranslateModule,
|
|
14
|
-
|
|
14
|
+
...EUI_LAYOUT,
|
|
15
15
|
...EUI_ICON,
|
|
16
16
|
...EUI_USER_PROFILE,
|
|
17
17
|
...EUI_LANGUAGE_SELECTOR,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component,
|
|
1
|
+
import { Component, inject } from '@angular/core';
|
|
2
2
|
import { CONFIG_TOKEN, EuiAppConfig } from '@eui/core';
|
|
3
3
|
import { EUI_PAGE } from '@eui/components/eui-page';
|
|
4
4
|
import { TranslateModule } from '@ngx-translate/core';
|
|
@@ -11,7 +11,9 @@ import { TranslateModule } from '@ngx-translate/core';
|
|
|
11
11
|
],
|
|
12
12
|
})
|
|
13
13
|
export class HomeComponent {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
protected config: EuiAppConfig = inject(CONFIG_TOKEN);
|
|
15
|
+
|
|
16
|
+
constructor() {
|
|
17
|
+
console.log(this.config);
|
|
16
18
|
}
|
|
17
19
|
}
|
|
@@ -1,7 +1,47 @@
|
|
|
1
|
-
|
|
1
|
+
function get(config) {
|
|
2
|
+
|
|
3
|
+
return {
|
|
4
|
+
basePath: '',
|
|
5
|
+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
|
6
|
+
plugins: [
|
|
7
|
+
require('karma-jasmine'),
|
|
8
|
+
require('karma-chrome-launcher'),
|
|
9
|
+
require('karma-jasmine-html-reporter'),
|
|
10
|
+
require('karma-coverage-istanbul-reporter'),
|
|
11
|
+
require('karma-coverage'),
|
|
12
|
+
require('karma-sourcemap-loader'),
|
|
13
|
+
require('@angular-devkit/build-angular/plugins/karma')
|
|
14
|
+
],
|
|
15
|
+
client:{
|
|
16
|
+
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
17
|
+
},
|
|
18
|
+
coverageIstanbulReporter: {
|
|
19
|
+
reports: [ 'html', 'lcovonly' ],
|
|
20
|
+
fixWebpackSourcePaths: true
|
|
21
|
+
},
|
|
22
|
+
angularCli: {
|
|
23
|
+
environment: 'dev'
|
|
24
|
+
},
|
|
25
|
+
reporters: ['progress', 'kjhtml'],
|
|
26
|
+
port: 9876,
|
|
27
|
+
colors: true,
|
|
28
|
+
logLevel: config.LOG_INFO,
|
|
29
|
+
autoWatch: true,
|
|
30
|
+
browsers: ['ChromeHeadlessCustom'],
|
|
31
|
+
customLaunchers: {
|
|
32
|
+
ChromeHeadlessCustom: {
|
|
33
|
+
base: 'ChromeHeadless',
|
|
34
|
+
flags: [
|
|
35
|
+
'--no-sandbox',
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
singleRun: false
|
|
40
|
+
}
|
|
41
|
+
}
|
|
2
42
|
|
|
3
43
|
module.exports = function (config) {
|
|
4
44
|
config.set(
|
|
5
|
-
|
|
45
|
+
get(config)
|
|
6
46
|
);
|
|
7
47
|
}
|
|
@@ -1,27 +1,31 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
1
3
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
4
|
+
"compileOnSave": false,
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"baseUrl": "./",
|
|
7
|
+
"outDir": "./dist/out-tsc",
|
|
8
|
+
"target": "ES2022",
|
|
9
|
+
"module": "ES2022",
|
|
10
|
+
"useDefineForClassFields": false,
|
|
11
|
+
"lib": [
|
|
12
|
+
"ES2022",
|
|
13
|
+
"dom"
|
|
14
|
+
],
|
|
15
|
+
"sourceMap": true,
|
|
16
|
+
"declaration": false,
|
|
17
|
+
"moduleResolution": "bundler",
|
|
18
|
+
"emitDecoratorMetadata": false,
|
|
19
|
+
"experimentalDecorators": true,
|
|
20
|
+
"allowSyntheticDefaultImports": true,
|
|
21
|
+
"importHelpers": true,
|
|
22
|
+
"typeRoots": [
|
|
23
|
+
"node_modules/@types"
|
|
24
|
+
],
|
|
25
|
+
"paths": {
|
|
26
|
+
"@shared/*": [
|
|
27
|
+
"src/app/shared/*"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
25
30
|
}
|
|
26
|
-
}
|
|
27
31
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eui-angular-app",
|
|
3
|
-
"version": "21.0.0-
|
|
3
|
+
"version": "21.0.0-next.10",
|
|
4
4
|
"license": "EUPL-1.1",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"ng": "ng",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
},
|
|
21
21
|
"private": true,
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@eui/deps-base": "18.2.
|
|
24
|
-
"@eui/mobile-core": "18.1.
|
|
25
|
-
"@eui/mobile-styles": "18.1.
|
|
23
|
+
"@eui/deps-base": "18.2.20",
|
|
24
|
+
"@eui/mobile-core": "18.1.3",
|
|
25
|
+
"@eui/mobile-styles": "18.1.3"
|
|
26
26
|
}
|
|
27
27
|
}
|