@eui/cli 21.0.0-next.45 → 21.0.0-next.47
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/scripts/inject-config-app.js +2 -2
- package/lib/app-utils/build.js +2 -53
- package/lib/app-utils/common.js +43 -0
- package/lib/app-utils/serve.js +6 -4
- package/lib/skeletons/_angular/base/package.json +3 -3
- package/lib/skeletons/_angular/base/src/app/shared/testing/router.mock.ts +2 -9
- package/lib/skeletons/_angular/base-mobile/package.json +1 -1
- package/lib/skeletons/_angular/options/pnpm/package.json +7 -7
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const common = require('../../lib/app-utils/common');
|
|
4
4
|
|
|
5
5
|
Promise.resolve()
|
|
6
6
|
.then(() => {
|
|
7
|
-
return
|
|
7
|
+
return common.injectAppConfig();
|
|
8
8
|
})
|
|
9
9
|
.catch((e) => {
|
|
10
10
|
console.error(e);
|
package/lib/app-utils/build.js
CHANGED
|
@@ -1,10 +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');
|
|
6
|
+
const common = require('./common');
|
|
8
7
|
|
|
9
8
|
module.exports.run = () => {
|
|
10
9
|
let {
|
|
@@ -33,7 +32,7 @@ module.exports.run = () => {
|
|
|
33
32
|
return Promise.resolve()
|
|
34
33
|
.then(() => {
|
|
35
34
|
if (configEnvTarget) {
|
|
36
|
-
return injectAppConfig();
|
|
35
|
+
return common.injectAppConfig();
|
|
37
36
|
}
|
|
38
37
|
})
|
|
39
38
|
|
|
@@ -44,12 +43,6 @@ module.exports.run = () => {
|
|
|
44
43
|
}
|
|
45
44
|
})
|
|
46
45
|
|
|
47
|
-
.then(() => {
|
|
48
|
-
if (!skipLint) {
|
|
49
|
-
utils.logSuccess();
|
|
50
|
-
}
|
|
51
|
-
})
|
|
52
|
-
|
|
53
46
|
.then(() => {
|
|
54
47
|
if (!skipLint) {
|
|
55
48
|
utils.logSuccess();
|
|
@@ -132,52 +125,8 @@ module.exports.run = () => {
|
|
|
132
125
|
}
|
|
133
126
|
})
|
|
134
127
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
128
|
.catch((e) => {
|
|
139
129
|
throw e;
|
|
140
130
|
});
|
|
141
131
|
};
|
|
142
132
|
|
|
143
|
-
|
|
144
|
-
const injectAppConfig = module.exports.injectAppConfig = () => {
|
|
145
|
-
return Promise.resolve()
|
|
146
|
-
.then(() => {
|
|
147
|
-
let { configEnvTarget } = utils.getArgs();
|
|
148
|
-
|
|
149
|
-
if (!configEnvTarget) {
|
|
150
|
-
throw new Error('configEnvTarget not provided as argument');
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
// set default if not envTarget provided
|
|
154
|
-
let envFilePath = path.join(process.cwd(), 'src/assets/config', `env-json-config.json`);
|
|
155
|
-
|
|
156
|
-
utils.logInfo(`Executing configuration replacement for : ${configEnvTarget} environment`);
|
|
157
|
-
|
|
158
|
-
let envOpenidPrefix = 'env-json-config-';
|
|
159
|
-
let openidConfigAssetsFolder = 'assets/config';
|
|
160
|
-
|
|
161
|
-
envFilePath = path.join(process.cwd(), `src/${openidConfigAssetsFolder}`, `${envOpenidPrefix}${configEnvTarget}.json`);
|
|
162
|
-
|
|
163
|
-
if (!utils.isFileExists(envFilePath)) {
|
|
164
|
-
utils.logError(`Cannot find environment config to inject : `);
|
|
165
|
-
utils.logError(`${envFilePath} missing...`);
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
let rootTargetFolder = 'src';
|
|
170
|
-
let replacedFile;
|
|
171
|
-
|
|
172
|
-
replacedFile = `${rootTargetFolder}/assets/env-json-config.json`;
|
|
173
|
-
|
|
174
|
-
utils.logInfo(`Replacing default ${replacedFile} file by ${envFilePath} content`);
|
|
175
|
-
utils.copy(envFilePath, path.join(process.cwd(), `${replacedFile}`));
|
|
176
|
-
|
|
177
|
-
utils.logSuccess();
|
|
178
|
-
})
|
|
179
|
-
|
|
180
|
-
.catch((e) => {
|
|
181
|
-
throw e;
|
|
182
|
-
});
|
|
183
|
-
}
|
|
@@ -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(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eui-angular-app",
|
|
3
|
-
"version": "21.0.0-next.
|
|
3
|
+
"version": "21.0.0-next.47",
|
|
4
4
|
"license": "EUPL-1.1",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"ng": "ng",
|
|
@@ -13,13 +13,13 @@
|
|
|
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
18
|
"app:inject-config": "eui-cli inject-config-app"
|
|
19
19
|
},
|
|
20
20
|
"private": true,
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@eui/deps-base": "21.0.0-next.
|
|
22
|
+
"@eui/deps-base": "21.0.0-next.47"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"npm-run-all": "4.1.5",
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eui-angular-app",
|
|
3
|
-
"version": "21.0.0-next.
|
|
3
|
+
"version": "21.0.0-next.47",
|
|
4
4
|
"license": "EUPL-1.1",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"ng": "ng",
|
|
@@ -46,17 +46,17 @@
|
|
|
46
46
|
"pikaday": "1.8.2",
|
|
47
47
|
"lodash-es": "4.17.21",
|
|
48
48
|
"localforage": "1.10.0",
|
|
49
|
-
"@eui/base": "21.0.0-next.
|
|
50
|
-
"@eui/core": "21.0.0-next.
|
|
51
|
-
"@eui/styles": "21.0.0-next.
|
|
52
|
-
"@eui/components": "21.0.0-next.
|
|
53
|
-
"@eui/ecl": "21.0.0-next.
|
|
49
|
+
"@eui/base": "21.0.0-next.47",
|
|
50
|
+
"@eui/core": "21.0.0-next.47",
|
|
51
|
+
"@eui/styles": "21.0.0-next.47",
|
|
52
|
+
"@eui/components": "21.0.0-next.47",
|
|
53
|
+
"@eui/ecl": "21.0.0-next.47"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@angular/build": "21.0.1",
|
|
57
57
|
"@angular/compiler-cli": "21.0.1",
|
|
58
58
|
"@angular/cli": "21.0.1",
|
|
59
|
-
"@eui/cli": "21.0.0-next.
|
|
59
|
+
"@eui/cli": "21.0.0-next.47",
|
|
60
60
|
"ng-packagr": "21.0.0",
|
|
61
61
|
"typescript": "5.9.2",
|
|
62
62
|
"npm-run-all": "4.1.5",
|