@eui/tools 6.18.0 → 6.19.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/.version.properties +1 -1
- package/CHANGELOG.md +22 -0
- package/package.json +1 -1
- package/scripts/app/public/package-init.js +3 -4
- package/scripts/app/server.js +1 -0
- package/scripts/csdr/cli/constants.js +2 -1
- package/scripts/csdr/cli/package-build-frontend.js +6 -1
- package/scripts/csdr/cli/package.js +4 -0
- package/scripts/csdr/cli/skeletons/virtual-remote/18.x/angular-config.json +6 -0
- package/scripts/csdr/cli/skeletons/virtual-remote/18.x/dependencies.json +21 -0
- package/scripts/csdr/config/angular.js +15 -3
- package/scripts/csdr/config/config-skeletons.js +48 -22
- package/scripts/csdr/config/global.js +27 -7
- package/scripts/csdr/config/packages.js +7 -1
- package/scripts/csdr/config/register.js +10 -2
- package/scripts/csdr/config/remotes.js +26 -6
- package/scripts/csdr/config/sync.js +5 -2
- package/scripts/csdr/init/packages.js +1 -0
- package/scripts/csdr/init/remotes.js +7 -1
- package/scripts/csdr/metadata/package-utils.js +8 -1
- package/scripts/csdr/sync/sync-utils.js +6 -1
package/.version.properties
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
6.
|
|
1
|
+
6.19.1
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
## 6.19.1 (2024-07-26)
|
|
2
|
+
|
|
3
|
+
##### Chores
|
|
4
|
+
|
|
5
|
+
* **other:**
|
|
6
|
+
* adapted package init and generateRemote for external portal config - EUI-9788 [EUI-9788](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-9788) ([6bbf7b3a](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/6bbf7b3a25677be4e7e83aacb948378f4a24e5d8))
|
|
7
|
+
|
|
8
|
+
* * *
|
|
9
|
+
* * *
|
|
10
|
+
## 6.19.0 (2024-07-25)
|
|
11
|
+
|
|
12
|
+
##### Chores
|
|
13
|
+
|
|
14
|
+
* **other:**
|
|
15
|
+
* adapted wrong path check ([95030187](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/9503018748e091defe17bb186a740bdd9bc9d768))
|
|
16
|
+
##### New Features
|
|
17
|
+
|
|
18
|
+
* **other:**
|
|
19
|
+
* adapted to new config for baep standalone portal - adjusted esbuild for proxied configurations - EUI-9788 [EUI-9788](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-9788) ([cf062fc3](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/cf062fc35fda5423fcf136e556779d7c4012a77d))
|
|
20
|
+
|
|
21
|
+
* * *
|
|
22
|
+
* * *
|
|
1
23
|
## 6.18.0 (2024-07-24)
|
|
2
24
|
|
|
3
25
|
##### New Features
|
package/package.json
CHANGED
|
@@ -28,9 +28,8 @@ new Vue({
|
|
|
28
28
|
{ label: "Frontend UI package or remote", value: "frontend" },
|
|
29
29
|
],
|
|
30
30
|
frontendVersions: [
|
|
31
|
-
{ label: "
|
|
32
|
-
{ label: "
|
|
33
|
-
{ label: "17.x", value: "17" }
|
|
31
|
+
{ label: "17.x", value: "17" },
|
|
32
|
+
{ label: "18.x", value: "18" }
|
|
34
33
|
],
|
|
35
34
|
frontendTypes: [
|
|
36
35
|
{ label: "default UI package", value: "default" },
|
|
@@ -45,7 +44,7 @@ new Vue({
|
|
|
45
44
|
getDefaultParams() {
|
|
46
45
|
return {
|
|
47
46
|
pkgType: "frontend",
|
|
48
|
-
pkgFrontendVersion: "
|
|
47
|
+
pkgFrontendVersion: "17",
|
|
49
48
|
pkgFrontendType: "default",
|
|
50
49
|
pkgScope: "@zzz",
|
|
51
50
|
pkgName: "my-package",
|
package/scripts/app/server.js
CHANGED
|
@@ -29,6 +29,7 @@ app.listen(app.get('port'), () => {
|
|
|
29
29
|
open('http://localhost:3000/stats.html');
|
|
30
30
|
} else if (packageInit) {
|
|
31
31
|
open('http://localhost:3000/package-init.html');
|
|
32
|
+
console.log('open your browser at : http://localhost:3000/package-init.html');
|
|
32
33
|
} else {
|
|
33
34
|
open('http://localhost:3000');
|
|
34
35
|
}
|
|
@@ -57,7 +57,12 @@ const generateRemote = (args = constants.DEFAULT_CONFIG) => {
|
|
|
57
57
|
|
|
58
58
|
const configOptions = configUtils.global.getConfigOptions();
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
let remoteConfigTargetPath;
|
|
61
|
+
if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
|
|
62
|
+
remoteConfigTargetPath = path.join(configOptions.CSDR_REMOTES_CONFIG_PATH , args.fullName);
|
|
63
|
+
} else {
|
|
64
|
+
remoteConfigTargetPath = path.join(configOptions.CSDR_REMOTES_CONFIG_PATH , 'assets', args.fullName);
|
|
65
|
+
}
|
|
61
66
|
|
|
62
67
|
return Promise.resolve()
|
|
63
68
|
// INIT and cleanup
|
|
@@ -39,6 +39,10 @@ const generateArgs = (args) => {
|
|
|
39
39
|
} else if (args.pkgFrontendVersion === constants.CONFIG_OPTIONS.pkgFrontendVersion.EUI17) {
|
|
40
40
|
fullName += '-eui17-remote-el-ui';
|
|
41
41
|
npmPkgName = `${args.pkgScope}/${args.pkgName}-eui17-remote-el`;
|
|
42
|
+
|
|
43
|
+
} else if (args.pkgFrontendVersion === constants.CONFIG_OPTIONS.pkgFrontendVersion.EUI18) {
|
|
44
|
+
fullName += '-eui18-remote-el-ui';
|
|
45
|
+
npmPkgName = `${args.pkgScope}/${args.pkgName}-eui18-remote-el`;
|
|
42
46
|
}
|
|
43
47
|
}
|
|
44
48
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"base": {
|
|
3
|
+
},
|
|
4
|
+
"composite": {
|
|
5
|
+
"@eui/deps-base": "^18.0.0",
|
|
6
|
+
"@module.scope@/@module.name@": "^1.0.0",
|
|
7
|
+
"@mywp/shared": "^6.0.0",
|
|
8
|
+
"@csdr/core": "^6.0.0",
|
|
9
|
+
"@csdr/integration": "^5.0.0"
|
|
10
|
+
},
|
|
11
|
+
"INT": {
|
|
12
|
+
},
|
|
13
|
+
"ACC": {
|
|
14
|
+
},
|
|
15
|
+
"DLT": {
|
|
16
|
+
},
|
|
17
|
+
"TRN": {
|
|
18
|
+
},
|
|
19
|
+
"PROD": {
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -26,9 +26,11 @@ const {
|
|
|
26
26
|
angularProjectDefFullSkeletonV17esbuild,
|
|
27
27
|
angularProjectDefConfiguration,
|
|
28
28
|
angularProjectDefConfigurationHost,
|
|
29
|
+
angularProjectDefConfigurationHostEsbuild,
|
|
29
30
|
angularProjectDefConfigurationLight,
|
|
30
31
|
angularProjectDefConfigurationOptimized,
|
|
31
32
|
angularProjectDefConfigurationOptimizedHost,
|
|
33
|
+
angularProjectDefConfigurationOptimizedHostEsbuild,
|
|
32
34
|
angularProjectDefConfigurationOptimizedLight,
|
|
33
35
|
angularPackageDef,
|
|
34
36
|
angularPackageSubEntryDef,
|
|
@@ -321,8 +323,13 @@ module.exports.registerAngularProjectDef = (project, build = false, element = fa
|
|
|
321
323
|
} else {
|
|
322
324
|
tools.logInfo('Injecting angular configuration file replacement');
|
|
323
325
|
if (project.host) {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
+
if (packageEuiVersionNumber >= 18) {
|
|
327
|
+
configurationDef = JSON.stringify(angularProjectDefConfigurationHostEsbuild);
|
|
328
|
+
configurationDefOptimized = JSON.stringify(angularProjectDefConfigurationOptimizedHostEsbuild);
|
|
329
|
+
} else {
|
|
330
|
+
configurationDef = JSON.stringify(angularProjectDefConfigurationHost);
|
|
331
|
+
configurationDefOptimized = JSON.stringify(angularProjectDefConfigurationOptimizedHost);
|
|
332
|
+
}
|
|
326
333
|
} else {
|
|
327
334
|
configurationDef = JSON.stringify(angularProjectDefConfiguration);
|
|
328
335
|
configurationDefOptimized = JSON.stringify(angularProjectDefConfigurationOptimized);
|
|
@@ -393,7 +400,12 @@ module.exports.registerModulePaths = (pkg, isReset) => {
|
|
|
393
400
|
const fileDev = path.join(process.cwd(), 'tsconfig.json');
|
|
394
401
|
const fileBuild = path.join(process.cwd(), 'tsconfig.build.json');
|
|
395
402
|
const fileBuildSpec = path.join(process.cwd(), 'tsconfig.build.spec.json');
|
|
396
|
-
|
|
403
|
+
let defFile;
|
|
404
|
+
if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
|
|
405
|
+
defFile = path.join(process.cwd(), '.config', '.euirc-apps.json');
|
|
406
|
+
} else {
|
|
407
|
+
defFile = path.join(process.cwd(), '.csdr', '.euirc-csdr-apps.json');
|
|
408
|
+
}
|
|
397
409
|
|
|
398
410
|
if ((!tools.isFileExists(fileBuild) || isReset) && !tools.isFileExists(defFile)) {
|
|
399
411
|
tools.copy(fileDev, fileBuild);
|
|
@@ -1496,18 +1496,18 @@ module.exports.angularProjectDefFullSkeletonV17esbuild = {
|
|
|
1496
1496
|
"serve": {
|
|
1497
1497
|
"builder": "@angular-devkit/build-angular:dev-server",
|
|
1498
1498
|
"options": {
|
|
1499
|
-
"
|
|
1499
|
+
"buildTarget": "@project.name@:build"
|
|
1500
1500
|
},
|
|
1501
1501
|
"configurations": {
|
|
1502
1502
|
"proxy-mock": {
|
|
1503
|
-
"
|
|
1503
|
+
"buildTarget": "@project.name@:build",
|
|
1504
1504
|
"proxyConfig": "apps/@project.name@/proxy-mock.conf.json"
|
|
1505
1505
|
},
|
|
1506
1506
|
"production": {
|
|
1507
|
-
"
|
|
1507
|
+
"buildTarget": "@project.name@:build:production"
|
|
1508
1508
|
},
|
|
1509
1509
|
"development": {
|
|
1510
|
-
"
|
|
1510
|
+
"buildTarget": "@project.name@:build:development"
|
|
1511
1511
|
}
|
|
1512
1512
|
},
|
|
1513
1513
|
"defaultConfiguration": "development"
|
|
@@ -1560,6 +1560,49 @@ module.exports.angularProjectDefConfigurationHost = {
|
|
|
1560
1560
|
"namedChunks": true
|
|
1561
1561
|
};
|
|
1562
1562
|
|
|
1563
|
+
module.exports.angularProjectDefConfigurationOptimizedHost = {
|
|
1564
|
+
"optimization": true,
|
|
1565
|
+
"outputHashing": "all",
|
|
1566
|
+
"sourceMap": false,
|
|
1567
|
+
"extractCss": true,
|
|
1568
|
+
"namedChunks": true,
|
|
1569
|
+
"aot": true,
|
|
1570
|
+
"extractLicenses": true,
|
|
1571
|
+
"vendorChunk": false,
|
|
1572
|
+
"buildOptimizer": true,
|
|
1573
|
+
"budgets": [
|
|
1574
|
+
{
|
|
1575
|
+
"type": "initial",
|
|
1576
|
+
"maximumWarning": "2mb",
|
|
1577
|
+
"maximumError": "8mb"
|
|
1578
|
+
}
|
|
1579
|
+
]
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
module.exports.angularProjectDefConfigurationHostEsbuild = {
|
|
1583
|
+
"optimization": false,
|
|
1584
|
+
"extractLicenses": false,
|
|
1585
|
+
"sourceMap": true,
|
|
1586
|
+
"namedChunks": true
|
|
1587
|
+
};
|
|
1588
|
+
|
|
1589
|
+
module.exports.angularProjectDefConfigurationOptimizedHostEsbuild = {
|
|
1590
|
+
"optimization": true,
|
|
1591
|
+
"outputHashing": "all",
|
|
1592
|
+
"sourceMap": false,
|
|
1593
|
+
"extractCss": true,
|
|
1594
|
+
"namedChunks": true,
|
|
1595
|
+
"aot": true,
|
|
1596
|
+
"extractLicenses": true,
|
|
1597
|
+
"budgets": [
|
|
1598
|
+
{
|
|
1599
|
+
"type": "initial",
|
|
1600
|
+
"maximumWarning": "2mb",
|
|
1601
|
+
"maximumError": "8mb"
|
|
1602
|
+
}
|
|
1603
|
+
]
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1563
1606
|
|
|
1564
1607
|
module.exports.angularProjectDefConfigurationLight = {
|
|
1565
1608
|
"buildOptimizer": false,
|
|
@@ -1618,24 +1661,7 @@ module.exports.angularProjectDefConfigurationOptimized = {
|
|
|
1618
1661
|
]
|
|
1619
1662
|
}
|
|
1620
1663
|
|
|
1621
|
-
|
|
1622
|
-
"optimization": true,
|
|
1623
|
-
"outputHashing": "all",
|
|
1624
|
-
"sourceMap": false,
|
|
1625
|
-
"extractCss": true,
|
|
1626
|
-
"namedChunks": true,
|
|
1627
|
-
"aot": true,
|
|
1628
|
-
"extractLicenses": true,
|
|
1629
|
-
"vendorChunk": false,
|
|
1630
|
-
"buildOptimizer": true,
|
|
1631
|
-
"budgets": [
|
|
1632
|
-
{
|
|
1633
|
-
"type": "initial",
|
|
1634
|
-
"maximumWarning": "2mb",
|
|
1635
|
-
"maximumError": "8mb"
|
|
1636
|
-
}
|
|
1637
|
-
]
|
|
1638
|
-
}
|
|
1664
|
+
|
|
1639
1665
|
|
|
1640
1666
|
|
|
1641
1667
|
|
|
@@ -13,10 +13,20 @@ const innerProjects = require('./projects');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
module.exports.getCsdrConfig = (full = true) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
let globalConfig, appsConfig, packagesConfig, remotesConfig;
|
|
17
|
+
|
|
18
|
+
if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
|
|
19
|
+
globalConfig = require(path.join(process.cwd(), '.config', '.euirc-config.json'));
|
|
20
|
+
appsConfig = require(path.join(process.cwd(), '.config', '.euirc-apps.json'));
|
|
21
|
+
packagesConfig = require(path.join(process.cwd(), '.config', '.euirc-packages.json'));
|
|
22
|
+
remotesConfig = require(path.join(process.cwd(), '.config', 'remotes', '.euirc-remotes.json'));
|
|
23
|
+
|
|
24
|
+
} else {
|
|
25
|
+
globalConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-config.json'));
|
|
26
|
+
appsConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-apps.json'));
|
|
27
|
+
packagesConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-packages.json'));
|
|
28
|
+
remotesConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-remotes.json'));
|
|
29
|
+
}
|
|
20
30
|
|
|
21
31
|
const config = globalConfig;
|
|
22
32
|
|
|
@@ -147,9 +157,13 @@ const getConfig = module.exports.getConfig = () => {
|
|
|
147
157
|
let configFile;
|
|
148
158
|
let isCsdr;
|
|
149
159
|
|
|
150
|
-
if (tools.isDirExists(path.join(process.cwd(), '.csdr'))) {
|
|
151
|
-
configFile = path.join(process.cwd(), '.csdr', '.euirc.json');
|
|
160
|
+
if (tools.isDirExists(path.join(process.cwd(), '.csdr')) || tools.isDirExists(path.join(process.cwd(), '.config'))) {
|
|
152
161
|
isCsdr = true;
|
|
162
|
+
if (tools.isDirExists(path.join(process.cwd(), '.csdr'))) {
|
|
163
|
+
configFile = path.join(process.cwd(), '.csdr', '.euirc.json');
|
|
164
|
+
} else {
|
|
165
|
+
configFile = path.join(process.cwd(), '.config', '.euirc.json');
|
|
166
|
+
}
|
|
153
167
|
} else {
|
|
154
168
|
configFile = path.join(process.cwd(), '.euirc.json');
|
|
155
169
|
isCsdr = false;
|
|
@@ -174,7 +188,13 @@ module.exports.updateConfig = (args = { project, projects, packages, packagesBra
|
|
|
174
188
|
tools.logInfo('Updating euirc config');
|
|
175
189
|
console.log(args);
|
|
176
190
|
|
|
177
|
-
|
|
191
|
+
let configFile;
|
|
192
|
+
|
|
193
|
+
if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
|
|
194
|
+
configFile = path.join(process.cwd(), '.config', '.euirc.json');
|
|
195
|
+
} else {
|
|
196
|
+
configFile = path.join(process.cwd(), '.csdr', '.euirc.json');
|
|
197
|
+
}
|
|
178
198
|
|
|
179
199
|
let newConfig = {};
|
|
180
200
|
|
|
@@ -244,7 +244,13 @@ module.exports.getRemotePackages = () => {
|
|
|
244
244
|
};
|
|
245
245
|
|
|
246
246
|
module.exports.isRemote = (pkgName) => {
|
|
247
|
-
|
|
247
|
+
let packagesConfig;
|
|
248
|
+
|
|
249
|
+
if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
|
|
250
|
+
packagesConfig = require(path.join(process.cwd(), '.config', '.euirc-packages.json'));
|
|
251
|
+
} else {
|
|
252
|
+
packagesConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-packages.json'));
|
|
253
|
+
}
|
|
248
254
|
const packageConfig = packagesConfig[pkgName];
|
|
249
255
|
|
|
250
256
|
if (packageConfig) {
|
|
@@ -92,9 +92,17 @@ module.exports.registerCsdrPackage = (pkg, rootPkgScope, rootPkgName, euiVersion
|
|
|
92
92
|
|
|
93
93
|
let file;
|
|
94
94
|
if (isRemote) {
|
|
95
|
-
|
|
95
|
+
if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
|
|
96
|
+
file = path.join(process.cwd(), '.config', 'remotes', '.euirc-remotes.json');
|
|
97
|
+
} else {
|
|
98
|
+
file = path.join(process.cwd(), '.csdr', '.euirc-csdr-remotes.json');
|
|
99
|
+
}
|
|
96
100
|
} else {
|
|
97
|
-
|
|
101
|
+
if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
|
|
102
|
+
file = path.join(process.cwd(), '.config', '.euirc-packages.json');
|
|
103
|
+
} else {
|
|
104
|
+
file = path.join(process.cwd(), '.csdr', '.euirc-csdr-packages.json');
|
|
105
|
+
}
|
|
98
106
|
}
|
|
99
107
|
|
|
100
108
|
const moduleJson = JSON.parse(replaceModule);
|
|
@@ -18,12 +18,19 @@ module.exports.getRemote = (remoteName) => {
|
|
|
18
18
|
remoteName = tools.getArgs().root;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
const remotesConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-remotes.json'));
|
|
22
|
-
const remoteConfig = remotesConfig[remoteName];
|
|
23
|
-
|
|
24
21
|
const configOptions = configUtils.global.getConfigOptions();
|
|
25
22
|
|
|
26
|
-
|
|
23
|
+
let remotesConfig;
|
|
24
|
+
let remotePath;
|
|
25
|
+
if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
|
|
26
|
+
remotesConfig = require(path.join(process.cwd(), '.config', 'remotes', '.euirc-remotes.json'));
|
|
27
|
+
remotePath = path.join(configOptions.CSDR_REMOTES_CONFIG_PATH , remoteName);
|
|
28
|
+
} else {
|
|
29
|
+
remotesConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-remotes.json'));
|
|
30
|
+
remotePath = path.join(configOptions.CSDR_REMOTES_CONFIG_PATH , 'assets', remoteName);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const remoteConfig = remotesConfig[remoteName];
|
|
27
34
|
|
|
28
35
|
if (!tools.isDirExists(remotePath)) {
|
|
29
36
|
throw new Error(`Remote ${remoteName} cannot be found in the remotes global config - check ${configOptions.CSDR_REMOTES_CONFIG_PATH} for available remotes`);
|
|
@@ -71,7 +78,14 @@ module.exports.getRemote = (remoteName) => {
|
|
|
71
78
|
|
|
72
79
|
|
|
73
80
|
module.exports.isVirtualRemote = (remoteName) => {
|
|
74
|
-
|
|
81
|
+
let remotesConfig;
|
|
82
|
+
console.log(tools.isDirExists())
|
|
83
|
+
if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
|
|
84
|
+
remotesConfig = require(path.join(process.cwd(), '.config', 'remotes', '.euirc-remotes.json'));
|
|
85
|
+
} else {
|
|
86
|
+
remotesConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-remotes.json'));
|
|
87
|
+
}
|
|
88
|
+
|
|
75
89
|
const remoteConfig = remotesConfig[remoteName];
|
|
76
90
|
|
|
77
91
|
return remoteConfig !== undefined;
|
|
@@ -111,7 +125,13 @@ module.exports.getCsdrRemotes = (hostName, euiVersion) => {
|
|
|
111
125
|
tools.logInfo(`--- for euiVersion: ${euiVersion}`);
|
|
112
126
|
}
|
|
113
127
|
|
|
114
|
-
|
|
128
|
+
let remotesConfig;
|
|
129
|
+
if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
|
|
130
|
+
remotesConfig = require(path.join(process.cwd(), '.config', 'remotes', '.euirc-remotes.json'));
|
|
131
|
+
} else {
|
|
132
|
+
remotesConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-remotes.json'));
|
|
133
|
+
}
|
|
134
|
+
|
|
115
135
|
let remotesArray = Object.keys(remotesConfig).map((r) => {
|
|
116
136
|
const remote = remotesConfig[r];
|
|
117
137
|
remote.name = r;
|
|
@@ -74,6 +74,9 @@ module.exports.run = () => {
|
|
|
74
74
|
packages: pkgFolders,
|
|
75
75
|
remotes: remoteFolders
|
|
76
76
|
};
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
|
|
78
|
+
tools.writeJsonFileSync(path.join(process.cwd(), '.config', '.euirc.json'), config);
|
|
79
|
+
} else {
|
|
80
|
+
tools.writeJsonFileSync(path.join(process.cwd(), '.csdr', '.euirc.json'), config);
|
|
81
|
+
}
|
|
79
82
|
}
|
|
@@ -83,6 +83,7 @@ module.exports.cloneHostPackage = (projectName) => {
|
|
|
83
83
|
|
|
84
84
|
return Promise.resolve()
|
|
85
85
|
.then(() => {
|
|
86
|
+
tools.logInfo(`Fetching host package info : ${project.hostPackage}`);
|
|
86
87
|
pkg = configUtils.packages.getPackageByNpmPkg(project.hostPackage, true);
|
|
87
88
|
if (!pkg) {
|
|
88
89
|
throw new Error('Invalid host package provided / unknown to CSDR config');
|
|
@@ -14,6 +14,10 @@ const { skipReset } = tools.getArgs();
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
module.exports.initRemotesConfig = () => {
|
|
17
|
+
if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
17
21
|
return Promise.resolve()
|
|
18
22
|
.then(() => {
|
|
19
23
|
const pkg = configUtils.packages.getPackageByNpmPkg('@csdr/remotes-config', true);
|
|
@@ -69,7 +73,9 @@ module.exports.generateVirtualRemote = (remoteName, cloneRemote = true) => {
|
|
|
69
73
|
// clone remotes config if first init
|
|
70
74
|
.then(() => {
|
|
71
75
|
if (cloneRemote) {
|
|
72
|
-
|
|
76
|
+
if (tools.isDirExists(path.join(process.cwd(), '.csdr'))) {
|
|
77
|
+
return cloneRemotesConfig();
|
|
78
|
+
}
|
|
73
79
|
}
|
|
74
80
|
})
|
|
75
81
|
|
|
@@ -25,10 +25,17 @@ const getPackageVersions = (module.exports.getPackageVersions = (pkg) => {
|
|
|
25
25
|
} catch(e) {
|
|
26
26
|
npmOutput = e.stdout;
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
// console.log(npmOutput);
|
|
29
29
|
|
|
30
30
|
let versions = [];
|
|
31
31
|
|
|
32
|
+
if (!npmOutput) {
|
|
33
|
+
tools.logWarning('Cannot find version of pkg - package is probably not published yet');
|
|
34
|
+
return versions;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const json = JSON.parse(npmOutput);
|
|
38
|
+
|
|
32
39
|
if (json.error) {
|
|
33
40
|
tools.logWarning('Error detected while trying to fetch the pkg version');
|
|
34
41
|
console.log(json.error);
|
|
@@ -17,7 +17,12 @@ module.exports.sync = () => {
|
|
|
17
17
|
return Promise.resolve()
|
|
18
18
|
.then(() => {
|
|
19
19
|
tools.logInfo('Resetting package.json');
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
|
|
22
|
+
return tools.copy(path.join(process.cwd(), '.config', 'package.json.reset'), path.join(process.cwd(), 'package.json'));
|
|
23
|
+
} else {
|
|
24
|
+
return tools.copy(path.join(process.cwd(), '.csdr', 'package.json.reset'), path.join(process.cwd(), 'package.json'));
|
|
25
|
+
}
|
|
21
26
|
})
|
|
22
27
|
.then(() => {
|
|
23
28
|
tools.logInfo('Removing yarn.lock');
|