@equinor/fusion-framework-cli 5.0.7 → 5.1.0
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/CHANGELOG.md +14 -0
- package/bin/app-config.js +12 -24
- package/bin/dev-portal/assets/{index-cec1b585.js → index-2f7c7343.js} +115 -115
- package/bin/dev-portal/index.html +1 -1
- package/bin/main.js +9 -2
- package/bin/serve.js +4 -3
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [5.1.0](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-cli@5.0.8...@equinor/fusion-framework-cli@5.1.0) (2023-03-20)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **cli:** allow configuring portal host in cli ([9641b21](https://github.com/equinor/fusion-framework/commit/9641b215a1bff957687e9eda661679f000588a47))
|
|
11
|
+
|
|
12
|
+
## [5.0.8](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-cli@5.0.7...@equinor/fusion-framework-cli@5.0.8) (2023-03-20)
|
|
13
|
+
|
|
14
|
+
**Note:** Version bump only for package @equinor/fusion-framework-cli
|
|
15
|
+
|
|
16
|
+
## [5.0.7](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-cli@5.0.7...@equinor/fusion-framework-cli@5.0.7) (2023-03-20)
|
|
17
|
+
|
|
18
|
+
**Note:** Version bump only for package @equinor/fusion-framework-cli
|
|
19
|
+
|
|
6
20
|
## [5.0.7](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-cli@5.0.6...@equinor/fusion-framework-cli@5.0.7) (2023-03-17)
|
|
7
21
|
|
|
8
22
|
### Bug Fixes
|
package/bin/app-config.js
CHANGED
|
@@ -7,17 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
-
var t = {};
|
|
12
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
-
t[p] = s[p];
|
|
14
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
-
t[p[i]] = s[p[i]];
|
|
18
|
-
}
|
|
19
|
-
return t;
|
|
20
|
-
};
|
|
21
10
|
import path from 'path';
|
|
22
11
|
import fs from 'fs';
|
|
23
12
|
import { findUpSync } from 'find-up';
|
|
@@ -46,19 +35,19 @@ const loadConfigFromJavascript = (file) => __awaiter(void 0, void 0, void 0, fun
|
|
|
46
35
|
const loadConfigFromJson = (file) => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
36
|
return JSON.parse(fs.readFileSync(file, 'utf-8'));
|
|
48
37
|
});
|
|
49
|
-
export const loadConfig = (
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
switch (
|
|
38
|
+
export const loadConfig = (path) => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
+
const configSource = getConfigType(path);
|
|
40
|
+
const customConfig = yield (() => {
|
|
41
|
+
switch (configSource === null || configSource === void 0 ? void 0 : configSource.type) {
|
|
53
42
|
case 'js':
|
|
54
|
-
return loadConfigFromJavascript(
|
|
43
|
+
return loadConfigFromJavascript(configSource.file);
|
|
55
44
|
case 'json':
|
|
56
|
-
return loadConfigFromJson(
|
|
45
|
+
return loadConfigFromJson(configSource.file);
|
|
57
46
|
default:
|
|
58
47
|
return Promise.resolve({});
|
|
59
48
|
}
|
|
60
|
-
})()
|
|
61
|
-
return Object.assign(Object.assign({},
|
|
49
|
+
})();
|
|
50
|
+
return Object.assign(Object.assign({}, customConfig), { configSource });
|
|
62
51
|
});
|
|
63
52
|
const validateConfig = (config) => {
|
|
64
53
|
if (!config.main) {
|
|
@@ -67,16 +56,15 @@ const validateConfig = (config) => {
|
|
|
67
56
|
};
|
|
68
57
|
export const resolveAppConfig = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
69
58
|
const { root, pkg } = resolvePackage();
|
|
70
|
-
const
|
|
71
|
-
const dev = { root, configSource };
|
|
59
|
+
const appConfig = yield loadConfig(root);
|
|
72
60
|
const manifest = Object.assign({
|
|
73
61
|
key: pkg.name.replace(/^@|\w.*\//gm, ''),
|
|
74
|
-
},
|
|
62
|
+
}, appConfig.manifest, {
|
|
75
63
|
version: pkg.version,
|
|
76
64
|
name: pkg.name,
|
|
77
65
|
main: pkg.main,
|
|
78
|
-
__DEV__:
|
|
66
|
+
__DEV__: { root, configSource: appConfig.configSource, portal: appConfig.portalHost },
|
|
79
67
|
});
|
|
80
68
|
validateConfig(manifest);
|
|
81
|
-
return Object.assign(Object.assign({},
|
|
69
|
+
return Object.assign(Object.assign({}, appConfig), { manifest, pkg, root });
|
|
82
70
|
});
|