@eui/cli 21.0.0-next.9 → 21.0.0-rc.1
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/bin/eui-cli.js +0 -7
- package/bin/scripts/inject-config-app.js +12 -0
- package/lib/app-utils/build.js +8 -52
- package/lib/app-utils/common.js +43 -0
- package/lib/app-utils/serve.js +6 -4
- package/lib/skeletons/_angular/base/angular.json +16 -0
- package/lib/skeletons/_angular/base/eslint.config.js +43 -0
- package/lib/skeletons/_angular/base/package.json +5 -7
- package/lib/skeletons/_angular/base/src/app/app-starter.service.spec.ts +9 -6
- package/lib/skeletons/_angular/base/src/app/app.component.html +1 -1
- package/lib/skeletons/_angular/base/src/app/app.component.spec.ts +14 -11
- 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/shared/testing/router.mock.ts +2 -9
- package/lib/skeletons/_angular/base/src/dummy.spec.ts +2 -0
- package/lib/skeletons/_angular/base/src/tsconfig.app.json +3 -0
- package/lib/skeletons/_angular/base/tsconfig.json +28 -24
- package/lib/skeletons/_angular/base-mobile/package.json +3 -3
- package/lib/skeletons/_angular/options/ecl-ec/angular.json +7 -29
- package/lib/skeletons/_angular/options/ecl-ec/src/app/app.component.html +101 -155
- package/lib/skeletons/_angular/options/ecl-ec/src/app/app.component.ts +4 -3
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/home/home.component.ts +5 -3
- package/lib/skeletons/_angular/options/ecl-eu/angular.json +7 -29
- package/lib/skeletons/_angular/options/ecl-eu/src/app/app.component.html +43 -68
- package/lib/skeletons/_angular/options/ecl-eu/src/app/app.component.ts +2 -3
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/home/home.component.ts +5 -3
- package/lib/skeletons/_angular/options/pnpm/package.json +27 -29
- package/package.json +1 -1
- package/lib/app-utils/projects.js +0 -41
- package/lib/skeletons/_angular/base/src/.eslintrc.json +0 -121
- package/lib/skeletons/_angular/base/src/karma.conf.js +0 -47
package/bin/eui-cli.js
CHANGED
|
@@ -11,9 +11,6 @@ const scriptIndex = args.findIndex(
|
|
|
11
11
|
x === 'build-app' ||
|
|
12
12
|
x === 'serve-app' ||
|
|
13
13
|
x === 'lint-app' ||
|
|
14
|
-
x === 'generate-sprite' ||
|
|
15
|
-
x === 'generate-app-metadata' ||
|
|
16
|
-
x === 'help' ||
|
|
17
14
|
x === 'inject-config-app'
|
|
18
15
|
);
|
|
19
16
|
const script = scriptIndex === -1 ? args[0] : args[scriptIndex];
|
|
@@ -26,10 +23,6 @@ switch (script) {
|
|
|
26
23
|
case 'build-app':
|
|
27
24
|
case 'serve-app':
|
|
28
25
|
case 'lint-app':
|
|
29
|
-
case 'generate-translations':
|
|
30
|
-
case 'generate-sprite':
|
|
31
|
-
case 'generate-app-metadata':
|
|
32
|
-
case 'help':
|
|
33
26
|
case 'inject-config-app': {
|
|
34
27
|
let genScript = script;
|
|
35
28
|
if (script === '' || script === undefined) {
|
package/lib/app-utils/build.js
CHANGED
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
// TODO v21 - app prebuild for config injection from eUI tools
|
|
2
|
-
|
|
3
1
|
const path = require('path');
|
|
4
2
|
const childProcess = require('child_process');
|
|
5
3
|
const execSync = childProcess.execSync;
|
|
6
4
|
|
|
7
5
|
const utils = require('../utils');
|
|
8
|
-
|
|
9
|
-
// const execa = require('execa');
|
|
10
|
-
|
|
11
|
-
// const tools = require('../../tools');
|
|
12
|
-
// const mavenUtils = require('../../maven-utils');
|
|
13
|
-
// const configUtils = require('../../../csdr/config/config-utils');
|
|
14
|
-
// const versionUtils = require('../../../csdr/version/version-utils');
|
|
15
|
-
|
|
16
|
-
// const preBuildUtils = require('../../pre-build/pre-build-utils');
|
|
17
|
-
|
|
6
|
+
const common = require('./common');
|
|
18
7
|
|
|
19
8
|
module.exports.run = () => {
|
|
20
9
|
let {
|
|
@@ -28,7 +17,6 @@ module.exports.run = () => {
|
|
|
28
17
|
dryRun,
|
|
29
18
|
maxSpaceSize,
|
|
30
19
|
statsJson,
|
|
31
|
-
extraWebpackConfig,
|
|
32
20
|
ci,
|
|
33
21
|
deployUrl,
|
|
34
22
|
sourceMap,
|
|
@@ -39,23 +27,19 @@ module.exports.run = () => {
|
|
|
39
27
|
|
|
40
28
|
utils.logTitle(`Building application : ${prjName}...`);
|
|
41
29
|
|
|
42
|
-
const ng = path.resolve(process.cwd(), '@angular', 'cli', 'bin', 'ng');
|
|
30
|
+
const ng = path.resolve(process.cwd(), 'node_modules', '@angular', 'cli', 'bin', 'ng');
|
|
43
31
|
|
|
44
32
|
return Promise.resolve()
|
|
45
|
-
// .then(() => {
|
|
46
|
-
// return preBuildUtils.projects.preBuild(currentProject, envTarget, true, configEnvTarget);
|
|
47
|
-
// })
|
|
48
|
-
|
|
49
33
|
.then(() => {
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
execSync(`ng lint ${prjName}`);
|
|
34
|
+
if (configEnvTarget) {
|
|
35
|
+
return common.injectAppConfig();
|
|
53
36
|
}
|
|
54
37
|
})
|
|
55
38
|
|
|
56
39
|
.then(() => {
|
|
57
40
|
if (!skipLint) {
|
|
58
|
-
|
|
41
|
+
utils.logInfo(`running ng lint ${prjName}`);
|
|
42
|
+
execSync(`ng lint ${prjName}`, { cwd: process.cwd(), stdio: 'inherit' });
|
|
59
43
|
}
|
|
60
44
|
})
|
|
61
45
|
|
|
@@ -80,14 +64,12 @@ module.exports.run = () => {
|
|
|
80
64
|
args.push(`--watch=false`);
|
|
81
65
|
}
|
|
82
66
|
|
|
83
|
-
args.push('--code-coverage');
|
|
84
|
-
|
|
85
67
|
utils.logInfo(`ng test : watching = ${watch || false}`);
|
|
86
68
|
|
|
87
69
|
utils.logInfo(`running Angular TEST with args: ${args} on :`);
|
|
88
70
|
|
|
89
71
|
if (!dryRun) {
|
|
90
|
-
execSync(`node ${args.join(' ')}`, { cwd:
|
|
72
|
+
execSync(`node ${args.join(' ')}`, { cwd: process.cwd(), stdio: 'inherit' });
|
|
91
73
|
}
|
|
92
74
|
}
|
|
93
75
|
})
|
|
@@ -139,38 +121,12 @@ module.exports.run = () => {
|
|
|
139
121
|
utils.logInfo(`running Angular BUILD with args: ${args}`);
|
|
140
122
|
|
|
141
123
|
if (!dryRun && !skipCompile) {
|
|
142
|
-
execSync(`node ${args.join(' ')}`, { cwd:
|
|
124
|
+
execSync(`node ${args.join(' ')}`, { cwd: process.cwd(), stdio: 'inherit' });
|
|
143
125
|
}
|
|
144
126
|
})
|
|
145
127
|
|
|
146
|
-
// .then(() => {
|
|
147
|
-
// const projectVersion = parseInt(configUtils.projects.getProjectEuiVersion(currentProject));
|
|
148
|
-
|
|
149
|
-
// if (currentProject.build && currentProject.build.skipBrowserOutputPath) {
|
|
150
|
-
// if (currentProject.build.esbuild || projectVersion >= 18) {
|
|
151
|
-
// utils.copydir(path.join(currentProject.paths.rootPath, 'dist', 'browser'), path.join(currentProject.paths.rootPath, 'dist'));
|
|
152
|
-
// utils.remove(path.join(currentProject.paths.rootPath, 'dist', 'browser'));
|
|
153
|
-
// }
|
|
154
|
-
// }
|
|
155
|
-
// })
|
|
156
|
-
|
|
157
|
-
// .then(() => {
|
|
158
|
-
// const desti18ncompiledPath = path.join(currentProject.paths.rootPath, 'dist', 'assets', 'i18n-compiled');
|
|
159
|
-
// if (utils.isDirExists(desti18ncompiledPath)) {
|
|
160
|
-
// utils.logTitle('Post-build assets i18n-compiled folder content:');
|
|
161
|
-
// const i18nfiles = utils.getFiles(desti18ncompiledPath);
|
|
162
|
-
// console.log(i18nfiles);
|
|
163
|
-
// }
|
|
164
|
-
|
|
165
|
-
// const mediaAssetsPath = path.join(currentProject.paths.rootPath, 'dist', 'assets', 'media');
|
|
166
|
-
// if (utils.isDirExists(mediaAssetsPath)) {
|
|
167
|
-
// utils.copydirFiles(mediaAssetsPath, path.join(currentProject.paths.rootPath, 'dist', 'media'));
|
|
168
|
-
// }
|
|
169
|
-
// })
|
|
170
|
-
|
|
171
128
|
.catch((e) => {
|
|
172
129
|
throw e;
|
|
173
130
|
});
|
|
174
131
|
};
|
|
175
132
|
|
|
176
|
-
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const utils = require('../utils');
|
|
3
|
+
|
|
4
|
+
module.exports.injectAppConfig = () => {
|
|
5
|
+
return Promise.resolve()
|
|
6
|
+
.then(() => {
|
|
7
|
+
let { configEnvTarget } = utils.getArgs();
|
|
8
|
+
|
|
9
|
+
if (!configEnvTarget) {
|
|
10
|
+
throw new Error('configEnvTarget not provided as argument');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// set default if not envTarget provided
|
|
14
|
+
let envFilePath = path.join(process.cwd(), 'src/assets/config', `env-json-config.json`);
|
|
15
|
+
|
|
16
|
+
utils.logInfo(`Executing configuration replacement for : ${configEnvTarget} environment`);
|
|
17
|
+
|
|
18
|
+
let envOpenidPrefix = 'env-json-config-';
|
|
19
|
+
let openidConfigAssetsFolder = 'assets/config';
|
|
20
|
+
|
|
21
|
+
envFilePath = path.join(process.cwd(), `src/${openidConfigAssetsFolder}`, `${envOpenidPrefix}${configEnvTarget}.json`);
|
|
22
|
+
|
|
23
|
+
if (!utils.isFileExists(envFilePath)) {
|
|
24
|
+
utils.logError(`Cannot find environment config to inject : `);
|
|
25
|
+
utils.logError(`${envFilePath} missing...`);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
let rootTargetFolder = 'src';
|
|
30
|
+
let replacedFile;
|
|
31
|
+
|
|
32
|
+
replacedFile = `${rootTargetFolder}/assets/env-json-config.json`;
|
|
33
|
+
|
|
34
|
+
utils.logInfo(`Replacing default ${replacedFile} file by ${envFilePath} content`);
|
|
35
|
+
utils.copy(envFilePath, path.join(process.cwd(), `${replacedFile}`));
|
|
36
|
+
|
|
37
|
+
utils.logSuccess();
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
.catch((e) => {
|
|
41
|
+
throw e;
|
|
42
|
+
});
|
|
43
|
+
}
|
package/lib/app-utils/serve.js
CHANGED
|
@@ -5,6 +5,7 @@ const childProcess = require('child_process');
|
|
|
5
5
|
const execSync = childProcess.execSync;
|
|
6
6
|
|
|
7
7
|
const utils = require('../utils');
|
|
8
|
+
const common = require('./common');
|
|
8
9
|
|
|
9
10
|
module.exports.run = () => {
|
|
10
11
|
|
|
@@ -15,10 +16,11 @@ module.exports.run = () => {
|
|
|
15
16
|
const prjName = 'app';
|
|
16
17
|
|
|
17
18
|
return Promise.resolve()
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
.then(() => {
|
|
20
|
+
if (configEnvTarget) {
|
|
21
|
+
return common.injectAppConfig();
|
|
22
|
+
}
|
|
23
|
+
})
|
|
22
24
|
|
|
23
25
|
// trigger ng serve with parameters provided
|
|
24
26
|
.then(() => {
|
|
@@ -122,6 +122,22 @@
|
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
124
|
"defaultConfiguration": "development"
|
|
125
|
+
},
|
|
126
|
+
"test": {
|
|
127
|
+
"builder": "@angular/build:unit-test",
|
|
128
|
+
"options": {
|
|
129
|
+
"tsConfig": "src/tsconfig.spec.json"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"lint": {
|
|
133
|
+
"builder": "@angular-eslint/builder:lint",
|
|
134
|
+
"options": {
|
|
135
|
+
"lintFilePatterns": [
|
|
136
|
+
"src/**/*.ts",
|
|
137
|
+
"src/**/*.html"
|
|
138
|
+
],
|
|
139
|
+
"eslintConfig": "eslint.config.js"
|
|
140
|
+
}
|
|
125
141
|
}
|
|
126
142
|
}
|
|
127
143
|
}
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eui-angular-app",
|
|
3
|
-
"version": "21.0.0-
|
|
3
|
+
"version": "21.0.0-rc.1",
|
|
4
4
|
"license": "EUPL-1.1",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"ng": "ng",
|
|
@@ -13,20 +13,18 @@
|
|
|
13
13
|
"build-dev": "eui-cli build-app --configuration=development --configEnvTarget=dev",
|
|
14
14
|
"build-prod": "eui-cli build-app --configuration=production-optimized --configEnvTarget=prod",
|
|
15
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
|
|
16
|
+
"build-prod-stats": "eui-cli build-app --configuration=production-optimized --configEnvTarget=prod",
|
|
17
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"
|
|
18
|
+
"app:inject-config": "eui-cli inject-config-app"
|
|
21
19
|
},
|
|
22
20
|
"private": true,
|
|
23
21
|
"dependencies": {
|
|
24
|
-
"@eui/deps-base": "21.0.0-
|
|
22
|
+
"@eui/deps-base": "21.0.0-rc.1"
|
|
25
23
|
},
|
|
26
24
|
"devDependencies": {
|
|
27
25
|
"npm-run-all": "4.1.5",
|
|
28
26
|
"json-server": "1.0.0-beta.3",
|
|
29
|
-
"nodemon": "
|
|
27
|
+
"nodemon": "3.1.11",
|
|
30
28
|
"lowdb": "1.0.0",
|
|
31
29
|
"body-parser": "1.20.3",
|
|
32
30
|
"express": "4.21.2"
|
|
@@ -4,9 +4,12 @@ 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
|
+
// eslint-disable-next-line
|
|
12
|
+
type SpyObj<T> = { [K in keyof T]: T[K] extends (...args: any[]) => any ? ReturnType<typeof vi.fn> : T[K] };
|
|
10
13
|
|
|
11
14
|
describe('AppStarterService', () => {
|
|
12
15
|
let service: AppStarterService;
|
|
@@ -16,8 +19,8 @@ describe('AppStarterService', () => {
|
|
|
16
19
|
let configMock: EuiAppConfig;
|
|
17
20
|
|
|
18
21
|
beforeEach(() => {
|
|
19
|
-
userServiceMock =
|
|
20
|
-
i18nServiceMock =
|
|
22
|
+
userServiceMock = { init: vi.fn() } as SpyObj<UserService>;
|
|
23
|
+
i18nServiceMock = { init: vi.fn() } as SpyObj<I18nService>;
|
|
21
24
|
configMock = {global: {}, modules: {core: {base: 'localhost:3000', userDetails: 'dummy'}}};
|
|
22
25
|
|
|
23
26
|
TestBed.configureTestingModule({
|
|
@@ -40,8 +43,8 @@ describe('AppStarterService', () => {
|
|
|
40
43
|
});
|
|
41
44
|
|
|
42
45
|
it('should call start method', () => {
|
|
43
|
-
userServiceMock.init.
|
|
44
|
-
i18nServiceMock.init.
|
|
46
|
+
vi.mocked(userServiceMock.init).mockReturnValue(of({ } as EuiServiceStatus));
|
|
47
|
+
vi.mocked(i18nServiceMock.init).mockReturnValue(of({ } as EuiServiceStatus));
|
|
45
48
|
service.start().subscribe(() => {
|
|
46
49
|
expect(userServiceMock.init).toHaveBeenCalled();
|
|
47
50
|
expect(i18nServiceMock.init).toHaveBeenCalled();
|
|
@@ -49,7 +52,7 @@ describe('AppStarterService', () => {
|
|
|
49
52
|
});
|
|
50
53
|
|
|
51
54
|
it('should call initUserService method', () => {
|
|
52
|
-
userServiceMock.init.
|
|
55
|
+
vi.mocked(userServiceMock.init).mockReturnValue(of({ } as EuiServiceStatus));
|
|
53
56
|
service.initUserService().subscribe(() => {
|
|
54
57
|
expect(userServiceMock.init).toHaveBeenCalled();
|
|
55
58
|
});
|
|
@@ -20,7 +20,7 @@
|
|
|
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
|
|
|
@@ -10,7 +10,10 @@ 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
|
+
// eslint-disable-next-line
|
|
16
|
+
type SpyObj<T> = { [K in keyof T]: T[K] extends (...args: any[]) => any ? ReturnType<typeof vi.fn> : T[K] };
|
|
14
17
|
|
|
15
18
|
describe('AppComponent', () => {
|
|
16
19
|
let component: AppComponent;
|
|
@@ -20,18 +23,18 @@ describe('AppComponent', () => {
|
|
|
20
23
|
let configMock: EuiAppConfig;
|
|
21
24
|
|
|
22
25
|
beforeEach(async () => {
|
|
23
|
-
|
|
24
|
-
// Handle the overloaded getState method
|
|
25
26
|
type GetStateReturnType<T> = T extends keyof I18nState ? Observable<I18nState[T]> : Observable<I18nState>;
|
|
26
27
|
|
|
27
|
-
userServiceMock =
|
|
28
|
-
i18nServiceMock =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
userServiceMock = { init: vi.fn() } as SpyObj<UserService>;
|
|
29
|
+
i18nServiceMock = {
|
|
30
|
+
init: vi.fn(),
|
|
31
|
+
getState: vi.fn(<K extends keyof I18nState>(key?: K): GetStateReturnType<K> => {
|
|
32
|
+
if (typeof key === 'string') {
|
|
33
|
+
return of({ activeLang: 'en' }[key]) as GetStateReturnType<K>;
|
|
34
|
+
}
|
|
35
|
+
return of({ activeLang: 'en' }) as GetStateReturnType<K>;
|
|
36
|
+
})
|
|
37
|
+
} as SpyObj<I18nService>;
|
|
35
38
|
configMock = {global: {}, modules: {core: {base: 'localhost:3000', userDetails: 'dummy'}}};
|
|
36
39
|
|
|
37
40
|
await TestBed.configureTestingModule({
|
|
@@ -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,5 +1,5 @@
|
|
|
1
1
|
import { NavigationEnd } from '@angular/router';
|
|
2
|
-
import { Observable } from 'rxjs
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
3
|
|
|
4
4
|
export class RouterMock {
|
|
5
5
|
routerState = { root: '' };
|
|
@@ -8,11 +8,4 @@ export class RouterMock {
|
|
|
8
8
|
observer.next(this.navigationEnd);
|
|
9
9
|
observer.complete();
|
|
10
10
|
});
|
|
11
|
-
|
|
12
|
-
constructor() {}
|
|
13
|
-
|
|
14
|
-
createUrlTree() {}
|
|
15
|
-
|
|
16
|
-
serializeUrl() {}
|
|
17
|
-
|
|
18
|
-
}
|
|
11
|
+
}
|
|
@@ -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-rc.1",
|
|
4
4
|
"license": "EUPL-1.1",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"ng": "ng",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"private": true,
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@eui/deps-base": "18.2.20",
|
|
24
|
-
"@eui/mobile-core": "18.1.
|
|
25
|
-
"@eui/mobile-styles": "18.1.
|
|
24
|
+
"@eui/mobile-core": "18.1.4",
|
|
25
|
+
"@eui/mobile-styles": "18.1.4"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -140,39 +140,17 @@
|
|
|
140
140
|
"lint": {
|
|
141
141
|
"builder": "@angular-eslint/builder:lint",
|
|
142
142
|
"options": {
|
|
143
|
-
"lintFilePatterns": [
|
|
144
|
-
|
|
143
|
+
"lintFilePatterns": [
|
|
144
|
+
"src/**/*.ts",
|
|
145
|
+
"src/**/*.html"
|
|
146
|
+
],
|
|
147
|
+
"eslintConfig": "eslint.config.js"
|
|
145
148
|
}
|
|
146
149
|
},
|
|
147
150
|
"test": {
|
|
148
|
-
"builder": "@angular
|
|
151
|
+
"builder": "@angular/build:unit-test",
|
|
149
152
|
"options": {
|
|
150
|
-
"
|
|
151
|
-
"tsConfig": "src/tsconfig.spec.json",
|
|
152
|
-
"karmaConfig": "src/karma.conf.js",
|
|
153
|
-
"inlineStyleLanguage": "scss",
|
|
154
|
-
"assets": [
|
|
155
|
-
{
|
|
156
|
-
"glob": "**/*",
|
|
157
|
-
"input": "node_modules/@eui/core/assets/",
|
|
158
|
-
"output": "./assets"
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
"glob": "**/*",
|
|
162
|
-
"input": "node_modules/@eui/styles/dist/assets/ecl",
|
|
163
|
-
"output": "./assets/images/ecl"
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
"glob": "**/*",
|
|
167
|
-
"input": "node_modules/@eui/styles/dist/assets",
|
|
168
|
-
"output": "./assets"
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
"glob": "**/*",
|
|
172
|
-
"input": "node_modules/@eui/ecl/assets/",
|
|
173
|
-
"output": "./assets"
|
|
174
|
-
}
|
|
175
|
-
]
|
|
153
|
+
"tsConfig": "src/tsconfig.spec.json"
|
|
176
154
|
}
|
|
177
155
|
}
|
|
178
156
|
}
|