@eui/tools 6.20.0 → 6.20.2
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 +20 -0
- package/init.js +2 -0
- package/package.json +1 -1
- package/scripts/csdr/audit/yarn.js +1 -1
- package/scripts/csdr/config/config-skeletons.js +4 -4
- package/scripts/csdr/config/config-utils.js +0 -1
- package/scripts/csdr/config/global.js +16 -4
- package/scripts/csdr/init/global.js +8 -2
- package/scripts/csdr/init/packages.js +8 -0
- package/scripts/csdr/init/standalone/18.x/.eslintrc.eui18.standalone.json +133 -0
- package/scripts/csdr/init/standalone/18.x/.eslintrc.json +44 -0
- package/scripts/csdr/init/standalone/18.x/karma.conf.standalone.js +7 -0
- package/scripts/csdr/init/standalone/18.x/tsconfig.lib.standalone.json +34 -0
- package/scripts/csdr/init/standalone/18.x/tsconfig.spec.standalone.json +17 -0
- package/scripts/csdr/init/standalone/18.x/tsconfig.standalone.json +17 -0
- package/scripts/csdr/install/common.js +100 -0
- package/scripts/csdr/install/packages.js +59 -6
- package/scripts/csdr/metadata/package-utils.js +100 -25
- package/scripts/csdr/release/package/common.js +23 -7
- package/scripts/csdr/release/package/release-package-standalone.js +0 -187
- package/scripts/csdr/release/package/release-ui-standalone.js +20 -16
- package/scripts/index.js +0 -1
- package/scripts/utils/changelog-utils.js +6 -1
- package/scripts/utils/clean/clean-utils.js +10 -2
- package/scripts/utils/git-utils.js +6 -6
- package/scripts/utils/notification/config.js +1 -1
- package/scripts/utils/publish/npm.js +3 -3
- package/scripts/utils/sonar/sonar-utils.js +1 -1
- package/scripts/csdr/config/standalone.js +0 -108
package/.version.properties
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
6.20.
|
|
1
|
+
6.20.2
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## 6.20.2 (2024-08-07)
|
|
2
|
+
|
|
3
|
+
##### Chores
|
|
4
|
+
|
|
5
|
+
* **other:**
|
|
6
|
+
* adapted branch-name fetch for standalone pkg builds - EUI-9788 [EUI-9788](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-9788) ([5059e861](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/5059e86141128602044f41059ff6ff6578659bad))
|
|
7
|
+
|
|
8
|
+
* * *
|
|
9
|
+
* * *
|
|
10
|
+
## 6.20.1 (2024-08-07)
|
|
11
|
+
|
|
12
|
+
##### Chores
|
|
13
|
+
|
|
14
|
+
* **other:**
|
|
15
|
+
* adapted skip CI for pipeline git operations - EUI-9788 [EUI-9788](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-9788) ([d0656022](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/d0656022faa10fce931787be951e53bcbb2e7bd5))
|
|
16
|
+
* adapted injection for standalone pkg build - EUI-9788 [EUI-9788](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-9788) ([197e954e](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/197e954e0b53f602775e60aec5fab261bd32eb63))
|
|
17
|
+
* adapted pipeline release for standalone package - EUI-9788 [EUI-9788](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-9788) ([83e9779d](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/83e9779d7c1d2201e32dbfebfa8e20c8ec6ed3ef))
|
|
18
|
+
|
|
19
|
+
* * *
|
|
20
|
+
* * *
|
|
1
21
|
## 6.20.0 (2024-08-06)
|
|
2
22
|
|
|
3
23
|
##### New Features
|
package/init.js
CHANGED
|
@@ -8,6 +8,8 @@ console.log('Init tools package symlink...');
|
|
|
8
8
|
console.log('----------------------------------------------');
|
|
9
9
|
|
|
10
10
|
const nmSrcPath = path.join(process.cwd(), 'node_modules');
|
|
11
|
+
// for testing purpose standalone mode locally
|
|
12
|
+
// const nmSrcPath = path.join('d:/gitlab/zzz-test-package-ui', 'node_modules');
|
|
11
13
|
|
|
12
14
|
const euiNmToolsPath = path.join(nmSrcPath, '@eui', 'tools');
|
|
13
15
|
const eUIToolsPath = path.join(process.cwd(), 'packages', 'eui-tools');
|
package/package.json
CHANGED
|
@@ -137,7 +137,7 @@ module.exports.audit = (pkg) => {
|
|
|
137
137
|
|
|
138
138
|
if (pkg.standalone) {
|
|
139
139
|
// TODO proceed to gates checks if needed
|
|
140
|
-
// configOptions = configUtils.
|
|
140
|
+
// configOptions = configUtils.global.getConfigOptionsStandalone();
|
|
141
141
|
return;
|
|
142
142
|
} else {
|
|
143
143
|
configOptions = configUtils.global.getConfigOptions();
|
|
@@ -1926,12 +1926,12 @@ module.exports.angularPackageDefV15Standalone = {
|
|
|
1926
1926
|
"build": {
|
|
1927
1927
|
"builder": "@angular-devkit/build-angular:ng-packagr",
|
|
1928
1928
|
"options": {
|
|
1929
|
-
"tsConfig": "tsconfig.lib.json",
|
|
1929
|
+
"tsConfig": "tsconfig.lib.standalone.json",
|
|
1930
1930
|
"project": "ng-package.json"
|
|
1931
1931
|
},
|
|
1932
1932
|
"configurations": {
|
|
1933
1933
|
"production": {
|
|
1934
|
-
"tsConfig": "tsconfig.lib.
|
|
1934
|
+
"tsConfig": "tsconfig.lib.standalone.json"
|
|
1935
1935
|
}
|
|
1936
1936
|
}
|
|
1937
1937
|
},
|
|
@@ -1942,8 +1942,8 @@ module.exports.angularPackageDefV15Standalone = {
|
|
|
1942
1942
|
"zone.js",
|
|
1943
1943
|
"zone.js/testing"
|
|
1944
1944
|
],
|
|
1945
|
-
"tsConfig": "tsconfig.spec.json",
|
|
1946
|
-
"karmaConfig": "karma.conf.js",
|
|
1945
|
+
"tsConfig": "tsconfig.spec.standalone.json",
|
|
1946
|
+
"karmaConfig": "karma.conf.standalone.js",
|
|
1947
1947
|
"scripts": [
|
|
1948
1948
|
"node_modules/quill/dist/quill.js",
|
|
1949
1949
|
"node_modules/quill-better-table/dist/quill-better-table.min.js"
|
|
@@ -253,9 +253,7 @@ module.exports.updateConfig = (args = { project, projects, packages, packagesBra
|
|
|
253
253
|
|
|
254
254
|
|
|
255
255
|
|
|
256
|
-
|
|
257
|
-
const config = this.getConfig();
|
|
258
|
-
|
|
256
|
+
const getConvertedOptions = (config) => {
|
|
259
257
|
let configOptions = {
|
|
260
258
|
DEVOPS_METADATA_REPOSITORY: null,
|
|
261
259
|
DEVOPS_METADATA_LOCKS_REPOSITORY: null,
|
|
@@ -459,11 +457,25 @@ module.exports.getConfigOptions = () => {
|
|
|
459
457
|
}
|
|
460
458
|
}
|
|
461
459
|
|
|
462
|
-
|
|
463
460
|
return configOptions;
|
|
464
461
|
}
|
|
465
462
|
|
|
466
463
|
|
|
464
|
+
|
|
465
|
+
module.exports.getConfigOptions = () => {
|
|
466
|
+
const config = this.getConfig();
|
|
467
|
+
|
|
468
|
+
return getConvertedOptions(config);
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
module.exports.getConfigOptionsStandalone = () => {
|
|
473
|
+
const config = require(path.join(process.cwd(), '.euirc-config.json'));
|
|
474
|
+
|
|
475
|
+
return getConvertedOptions(config);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
|
|
467
479
|
module.exports.getLocalEuiVersion = () => {
|
|
468
480
|
let euiVersionsLocal = [
|
|
469
481
|
...innerPackages.getLocalPackagesEuiVersion(),
|
|
@@ -70,12 +70,18 @@ const processResolutionsInjection = module.exports.processResolutionsInjection =
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
module.exports.initRootFilesAndResolutions = () => {
|
|
73
|
+
module.exports.initRootFilesAndResolutions = (euiVersionInput) => {
|
|
74
74
|
tools.logTitle('Processing injections for local installed eUI versions if needed');
|
|
75
75
|
|
|
76
76
|
return Promise.resolve()
|
|
77
77
|
.then(() => {
|
|
78
|
-
|
|
78
|
+
let euiVersion;
|
|
79
|
+
|
|
80
|
+
if (euiVersionInput) {
|
|
81
|
+
euiVersion = euiVersionInput;
|
|
82
|
+
} else {
|
|
83
|
+
euiVersion = configUtils.global.getLocalEuiVersion();
|
|
84
|
+
}
|
|
79
85
|
|
|
80
86
|
processResolutionsInjection(process.cwd(), euiVersion);
|
|
81
87
|
|
|
@@ -154,3 +154,11 @@ module.exports.importScripts = () => {
|
|
|
154
154
|
throw e;
|
|
155
155
|
})
|
|
156
156
|
}
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
module.exports.injectStandaloneResources = (pkg) => {
|
|
160
|
+
const euiVersion = configUtils.packages.getPackageEuiVersion(pkg);
|
|
161
|
+
const skeletonPath = path.join(__dirname, 'standalone', euiVersion);
|
|
162
|
+
|
|
163
|
+
tools.copy(skeletonPath, pkg.paths.root);
|
|
164
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": true,
|
|
3
|
+
"ignorePatterns": [
|
|
4
|
+
"projects/**/*"
|
|
5
|
+
],
|
|
6
|
+
"overrides": [
|
|
7
|
+
{
|
|
8
|
+
"files": [
|
|
9
|
+
"*.ts"
|
|
10
|
+
],
|
|
11
|
+
"plugins": [
|
|
12
|
+
"prefer-arrow"
|
|
13
|
+
],
|
|
14
|
+
"extends": [
|
|
15
|
+
"eslint:recommended",
|
|
16
|
+
"plugin:@typescript-eslint/recommended",
|
|
17
|
+
"plugin:@angular-eslint/recommended",
|
|
18
|
+
"plugin:@angular-eslint/template/process-inline-templates"
|
|
19
|
+
],
|
|
20
|
+
"rules": {
|
|
21
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
22
|
+
"@typescript-eslint/ban-types": [
|
|
23
|
+
"error",
|
|
24
|
+
{
|
|
25
|
+
"types": {
|
|
26
|
+
"Function": false
|
|
27
|
+
},
|
|
28
|
+
"extendDefaults": true
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"@typescript-eslint/consistent-type-definitions": "off",
|
|
32
|
+
"@typescript-eslint/dot-notation": "off",
|
|
33
|
+
"@typescript-eslint/explicit-member-accessibility": [
|
|
34
|
+
"off",
|
|
35
|
+
{
|
|
36
|
+
"accessibility": "explicit"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"@typescript-eslint/no-require-imports": "error",
|
|
40
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
41
|
+
"@typescript-eslint/no-var-requires": "error",
|
|
42
|
+
"@typescript-eslint/require-await": "error",
|
|
43
|
+
"brace-style": [
|
|
44
|
+
"error",
|
|
45
|
+
"1tbs"
|
|
46
|
+
],
|
|
47
|
+
"comma-dangle": [
|
|
48
|
+
"error",
|
|
49
|
+
"always-multiline"
|
|
50
|
+
],
|
|
51
|
+
"id-blacklist": "off",
|
|
52
|
+
"id-match": "off",
|
|
53
|
+
"no-duplicate-case": "error",
|
|
54
|
+
"no-duplicate-imports": "off",
|
|
55
|
+
"no-invalid-this": "error",
|
|
56
|
+
"no-multiple-empty-lines": [
|
|
57
|
+
"error",
|
|
58
|
+
{
|
|
59
|
+
"max": 1
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"no-new-func": "error",
|
|
63
|
+
"no-redeclare": "off",
|
|
64
|
+
"@typescript-eslint/no-redeclare": [
|
|
65
|
+
"error"
|
|
66
|
+
],
|
|
67
|
+
"no-template-curly-in-string": "error",
|
|
68
|
+
"no-underscore-dangle": "off",
|
|
69
|
+
"@typescript-eslint/naming-convention": [
|
|
70
|
+
"error",
|
|
71
|
+
{
|
|
72
|
+
"selector": "enum",
|
|
73
|
+
"format": [
|
|
74
|
+
"PascalCase",
|
|
75
|
+
"UPPER_CASE"
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"@typescript-eslint/member-ordering": [
|
|
80
|
+
"error",
|
|
81
|
+
{
|
|
82
|
+
"default": [
|
|
83
|
+
"public-static-field",
|
|
84
|
+
"public-instance-field",
|
|
85
|
+
"private-static-field",
|
|
86
|
+
"private-instance-field",
|
|
87
|
+
"public-constructor",
|
|
88
|
+
"private-constructor",
|
|
89
|
+
"public-instance-method",
|
|
90
|
+
"protected-instance-method",
|
|
91
|
+
"private-instance-method"
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
"quote-props": ["error", "as-needed"],
|
|
96
|
+
"prefer-const": "error",
|
|
97
|
+
"@typescript-eslint/no-empty-function": ["error"],
|
|
98
|
+
"prefer-arrow/prefer-arrow-functions": [
|
|
99
|
+
"error",
|
|
100
|
+
{
|
|
101
|
+
"disallowPrototype": false,
|
|
102
|
+
"singleReturnOnly": false,
|
|
103
|
+
"classPropertiesAllowed": false,
|
|
104
|
+
"allowStandaloneDeclarations": true
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"@typescript-eslint/no-inferrable-types": ["error"],
|
|
108
|
+
"@typescript-eslint/explicit-function-return-type": "error",
|
|
109
|
+
"@angular-eslint/no-output-on-prefix": ["error"],
|
|
110
|
+
"@angular-eslint/no-output-native": ["error"],
|
|
111
|
+
"@angular-eslint/no-outputs-metadata-property": ["error"],
|
|
112
|
+
"@typescript-eslint/prefer-for-of": ["error"],
|
|
113
|
+
"@angular-eslint/no-empty-lifecycle-method": ["error"],
|
|
114
|
+
"@typescript-eslint/no-explicit-any": ["error"],
|
|
115
|
+
"@typescript-eslint/no-unsafe-declaration-merging": ["error"],
|
|
116
|
+
"no-empty": "error",
|
|
117
|
+
"object-curly-spacing": ["error", "always"],
|
|
118
|
+
"quotes": ["error", "single"],
|
|
119
|
+
"@angular-eslint/use-lifecycle-interface": ["error"]
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"files": [
|
|
124
|
+
"*.html"
|
|
125
|
+
],
|
|
126
|
+
"extends": [
|
|
127
|
+
"plugin:@angular-eslint/template/recommended"
|
|
128
|
+
],
|
|
129
|
+
"rules": {
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ".eslintrc.eui18.standalone.json",
|
|
3
|
+
"ignorePatterns": [
|
|
4
|
+
"!**/*",
|
|
5
|
+
"**/*.d.ts",
|
|
6
|
+
"dist",
|
|
7
|
+
"test",
|
|
8
|
+
"coverage",
|
|
9
|
+
"externals",
|
|
10
|
+
"legacy",
|
|
11
|
+
"node_modules"
|
|
12
|
+
],
|
|
13
|
+
"overrides": [
|
|
14
|
+
{
|
|
15
|
+
"files": [
|
|
16
|
+
"*.ts"
|
|
17
|
+
],
|
|
18
|
+
"parserOptions": {
|
|
19
|
+
"project": [
|
|
20
|
+
"tsconfig.lib.standalone.json",
|
|
21
|
+
"tsconfig.spec.standalone.json"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"rules": {
|
|
25
|
+
"@angular-eslint/component-selector": [
|
|
26
|
+
"error",
|
|
27
|
+
{
|
|
28
|
+
"type": "element",
|
|
29
|
+
"prefix": ["zzz"],
|
|
30
|
+
"style": "kebab-case"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"@angular-eslint/directive-selector": [
|
|
34
|
+
"error",
|
|
35
|
+
{
|
|
36
|
+
"type": "attribute",
|
|
37
|
+
"prefix": ["zzz"],
|
|
38
|
+
"style": "camelCase"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.standalone.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "./out-tsc/lib",
|
|
5
|
+
"target": "ES2022",
|
|
6
|
+
"module": "ES2022",
|
|
7
|
+
"moduleResolution": "node",
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"sourceMap": true,
|
|
10
|
+
"inlineSources": true,
|
|
11
|
+
"emitDecoratorMetadata": true,
|
|
12
|
+
"experimentalDecorators": true,
|
|
13
|
+
"useDefineForClassFields": false,
|
|
14
|
+
"importHelpers": true,
|
|
15
|
+
"types": [],
|
|
16
|
+
"lib": [
|
|
17
|
+
"ES2022",
|
|
18
|
+
"dom"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"angularCompilerOptions": {
|
|
22
|
+
"annotateForClosureCompiler": true,
|
|
23
|
+
"skipTemplateCodegen": true,
|
|
24
|
+
"strictMetadataEmit": true,
|
|
25
|
+
"fullTemplateTypeCheck": true,
|
|
26
|
+
"strictInjectionParameters": true,
|
|
27
|
+
"enableResourceInlining": true,
|
|
28
|
+
"compilationMode": "partial"
|
|
29
|
+
},
|
|
30
|
+
"exclude": [
|
|
31
|
+
"src/test.ts",
|
|
32
|
+
"**/*.spec.ts"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compileOnSave": false,
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"baseUrl": ".",
|
|
5
|
+
"sourceMap": true,
|
|
6
|
+
"declaration": false,
|
|
7
|
+
"module": "ES2022",
|
|
8
|
+
"moduleResolution": "node",
|
|
9
|
+
"allowSyntheticDefaultImports": true,
|
|
10
|
+
"emitDecoratorMetadata": true,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"target": "ES2022",
|
|
13
|
+
"typeRoots": [
|
|
14
|
+
"node_modules/@types"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -72,6 +72,59 @@ module.exports.installDeps = (deps) => {
|
|
|
72
72
|
);
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
+
|
|
76
|
+
module.exports.installDepsStandalone = (pkg, deps) => {
|
|
77
|
+
const rootFolder = process.cwd();
|
|
78
|
+
const pkgJsonFile = path.resolve(rootFolder, 'package.json');
|
|
79
|
+
const pkgJson = require(pkgJsonFile);
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
Promise.resolve()
|
|
83
|
+
// parse eUI deps and explode the sub-packages (v17 issues)
|
|
84
|
+
.then(() => {
|
|
85
|
+
const euiVersion = configUtils.packages.getPackageEuiVersion(pkg);
|
|
86
|
+
const euiVersionNumber = parseInt(euiVersion);
|
|
87
|
+
|
|
88
|
+
if (euiVersionNumber >= 17) {
|
|
89
|
+
Object.keys(deps).forEach((dep) => {
|
|
90
|
+
if (dep === '@eui/deps-base') {
|
|
91
|
+
deps['@eui/components'] = deps[dep];
|
|
92
|
+
deps['@eui/showcase'] = deps[dep];
|
|
93
|
+
deps['@eui/styles'] = deps[dep];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
// Install dependencies
|
|
100
|
+
.then(() => {
|
|
101
|
+
tools.logTitle('Package dependencies to install : ');
|
|
102
|
+
pkgJson.dependencies = deps;
|
|
103
|
+
|
|
104
|
+
// Updating file and installing
|
|
105
|
+
if (Object.keys(pkgJson.dependencies).length !== 0) {
|
|
106
|
+
tools.writeJsonFileSync(pkgJsonFile, pkgJson);
|
|
107
|
+
tools.logInfo('installing dependencies');
|
|
108
|
+
console.log(pkgJson.dependencies);
|
|
109
|
+
|
|
110
|
+
return executeInstall(rootFolder, configUtils.global.getConfigOptionsStandalone().NPM_REGISTRY_INSTALL);
|
|
111
|
+
}
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
.then(() => {
|
|
115
|
+
pkgJson.dependencies = {}
|
|
116
|
+
pkgJson.resolutions = {}
|
|
117
|
+
tools.writeJsonFileSync(pkgJsonFile, pkgJson);
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
.catch((e) => {
|
|
121
|
+
throw e;
|
|
122
|
+
})
|
|
123
|
+
);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
75
128
|
const executeInstall = (module.exports.executeInstall = (cwdPath, npmRegistry) => {
|
|
76
129
|
return Promise.resolve()
|
|
77
130
|
.then(() => {
|
|
@@ -165,3 +218,50 @@ module.exports.getResolvedCarretDeps = (deps, isMaster, isDevEnvTarget) => {
|
|
|
165
218
|
})
|
|
166
219
|
);
|
|
167
220
|
};
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
module.exports.getResolvedCarretDepsStandalone = (deps, isMaster, isDevEnvTarget) => {
|
|
224
|
+
tools.logTitle('Resolving carret versions of detected packages');
|
|
225
|
+
|
|
226
|
+
tools.logInfo('processing dependencies : ');
|
|
227
|
+
console.log(deps);
|
|
228
|
+
|
|
229
|
+
return (
|
|
230
|
+
Promise.resolve()
|
|
231
|
+
.then(() => {
|
|
232
|
+
const dependencies = Object.keys(deps).reduce((acc, k) => {
|
|
233
|
+
if (deps[k] && deps[k].substr(0, 1) === '^') {
|
|
234
|
+
const npmPkg = k;
|
|
235
|
+
const version = deps[k];
|
|
236
|
+
|
|
237
|
+
tools.logInfo(`\nProcessing ${npmPkg}:${version}`);
|
|
238
|
+
|
|
239
|
+
// getting last major version from metadata history for pkg found
|
|
240
|
+
const lastMajorVersion = metadataUtils.packageUtils.getLastMajorVersionByNpmPkg(
|
|
241
|
+
npmPkg,
|
|
242
|
+
version.substr(1).split('.')[0],
|
|
243
|
+
isMaster,
|
|
244
|
+
isDevEnvTarget
|
|
245
|
+
);
|
|
246
|
+
|
|
247
|
+
if (lastMajorVersion) {
|
|
248
|
+
tools.logInfo(`--version found : ${lastMajorVersion}`);
|
|
249
|
+
acc[k] = lastMajorVersion;
|
|
250
|
+
} else {
|
|
251
|
+
tools.logWarning(`WARNING : Can't resolve carret version from history for pkg: ${npmPkg} for version ${version}`);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return acc;
|
|
255
|
+
}, {});
|
|
256
|
+
|
|
257
|
+
return { ...deps, ...dependencies };
|
|
258
|
+
})
|
|
259
|
+
|
|
260
|
+
// don't rethrow in case of error, just log the exception
|
|
261
|
+
.catch((e) => {
|
|
262
|
+
tools.logError('Unable to resolve deps');
|
|
263
|
+
console.log(e);
|
|
264
|
+
return deps;
|
|
265
|
+
})
|
|
266
|
+
);
|
|
267
|
+
};
|
|
@@ -72,10 +72,15 @@ const getLocalPackageCompositeDeps = (pkg) => {
|
|
|
72
72
|
let pkgJsonFile;
|
|
73
73
|
|
|
74
74
|
if (!skipLocalPackagesDeps) {
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
|
|
76
|
+
if (pkg.standalone) {
|
|
77
|
+
pkgJsonFile = path.join(process.cwd(), 'dependencies-composite.json');
|
|
77
78
|
} else {
|
|
78
|
-
|
|
79
|
+
if (pkg.child) {
|
|
80
|
+
pkgJsonFile = path.join(process.cwd(), 'packages', pkg.parentPkg, 'packages', pkg.folder || pkg.name, 'dependencies-composite.json');
|
|
81
|
+
} else {
|
|
82
|
+
pkgJsonFile = path.join(process.cwd(), 'packages', pkg.name, 'dependencies-composite.json');
|
|
83
|
+
}
|
|
79
84
|
}
|
|
80
85
|
|
|
81
86
|
if (tools.isFileExists(pkgJsonFile)) {
|
|
@@ -122,10 +127,14 @@ const getLocalPackageBaseDeps = (pkg) => {
|
|
|
122
127
|
let pkgJsonFile;
|
|
123
128
|
|
|
124
129
|
if (!skipLocalPackagesDeps) {
|
|
125
|
-
if (pkg.
|
|
126
|
-
pkgJsonFile = path.join(process.cwd(), '
|
|
130
|
+
if (pkg.standalone) {
|
|
131
|
+
pkgJsonFile = path.join(process.cwd(), 'dependencies-base.json');
|
|
127
132
|
} else {
|
|
128
|
-
|
|
133
|
+
if (pkg.child) {
|
|
134
|
+
pkgJsonFile = path.join(process.cwd(), 'packages', pkg.parentPkg, 'packages', pkg.folder || pkg.name, 'dependencies-base.json');
|
|
135
|
+
} else {
|
|
136
|
+
pkgJsonFile = path.join(process.cwd(), 'packages', pkg.name, 'dependencies-base.json');
|
|
137
|
+
}
|
|
129
138
|
}
|
|
130
139
|
|
|
131
140
|
if (tools.isFileExists(pkgJsonFile)) {
|
|
@@ -277,3 +286,47 @@ module.exports.installDeps = (prj, pkg, isMaster) => {
|
|
|
277
286
|
throw e;
|
|
278
287
|
})
|
|
279
288
|
}
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
module.exports.installDepsStandalone = (pkg, isMaster) => {
|
|
292
|
+
let localPkgDeps, localPkgCompositeDeps, remappedDeps, localPkgBaseDeps;
|
|
293
|
+
|
|
294
|
+
return Promise.resolve()
|
|
295
|
+
// fetching depedencies composite deps
|
|
296
|
+
.then(() => {
|
|
297
|
+
return getLocalPackageCompositeDeps(pkg);
|
|
298
|
+
})
|
|
299
|
+
// storing
|
|
300
|
+
.then((localPkgCompositeDepsIn) => {
|
|
301
|
+
localPkgCompositeDeps = localPkgCompositeDepsIn;
|
|
302
|
+
})
|
|
303
|
+
|
|
304
|
+
// remapping from registry
|
|
305
|
+
.then(() => {
|
|
306
|
+
return innerCommon.getResolvedCarretDepsStandalone(localPkgCompositeDeps, isMaster, !isMaster);
|
|
307
|
+
})
|
|
308
|
+
// storing
|
|
309
|
+
.then((remappedDepsIn) => {
|
|
310
|
+
remappedDeps = remappedDepsIn;
|
|
311
|
+
})
|
|
312
|
+
|
|
313
|
+
// fetch dependencies-base deps
|
|
314
|
+
.then(() => {
|
|
315
|
+
return getLocalPackageBaseDeps(pkg);
|
|
316
|
+
})
|
|
317
|
+
|
|
318
|
+
.then((localPkgBaseDepsIn) => {
|
|
319
|
+
localPkgBaseDeps = localPkgBaseDepsIn;
|
|
320
|
+
|
|
321
|
+
const fixedDeps = configUtils.global.getConfigOptionsStandalone().NPM_FIXED_DEPENDENCIES;
|
|
322
|
+
|
|
323
|
+
return innerCommon.installDepsStandalone(pkg, { ...localPkgBaseDeps, ...remappedDeps, ...localPkgDeps, ...fixedDeps});
|
|
324
|
+
})
|
|
325
|
+
|
|
326
|
+
.catch((e) => {
|
|
327
|
+
throw e;
|
|
328
|
+
})
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|