@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/bin/main.js
CHANGED
|
@@ -24,10 +24,17 @@ const app = program
|
|
|
24
24
|
app.command('dev')
|
|
25
25
|
.description('Create a development server')
|
|
26
26
|
.option('-p, --port <number>', 'dev-server port', '3000')
|
|
27
|
-
.
|
|
27
|
+
.option('--portal <string>', 'fusion portal host')
|
|
28
|
+
.action(({ port, portal }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
+
var _a;
|
|
28
30
|
const spinner = ora('Loading configuration').start();
|
|
29
|
-
const viteConfig = mergeConfig(yield createConfig(), { server: port });
|
|
31
|
+
const viteConfig = mergeConfig(yield createConfig(), { server: { port } });
|
|
30
32
|
const appConfig = yield resolveAppConfig();
|
|
33
|
+
if (portal) {
|
|
34
|
+
appConfig.portalHost = portal
|
|
35
|
+
? portal
|
|
36
|
+
: (_a = process.env.FUSION_PORTAL_HOST) !== null && _a !== void 0 ? _a : 'https://fusion-s-portal-ci.azurewebsites.net';
|
|
37
|
+
}
|
|
31
38
|
spinner.succeed('Configuration loaded');
|
|
32
39
|
startDevServer({ viteConfig, appConfig });
|
|
33
40
|
}));
|
package/bin/serve.js
CHANGED
|
@@ -29,13 +29,14 @@ export const server = (config) => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
29
29
|
host.port = String((_c = (_b = config.viteConfig.server) === null || _b === void 0 ? void 0 : _b.port) !== null && _c !== void 0 ? _c : 3000);
|
|
30
30
|
const spinner = ora('Configuring dev-server').start();
|
|
31
31
|
const vite = yield createServer(config.viteConfig);
|
|
32
|
+
const { portalHost } = config.appConfig;
|
|
32
33
|
spinner.succeed('Configured dev-server');
|
|
33
34
|
/** expose middlewares from vite (dev-server) */
|
|
34
35
|
app.use(vite.middlewares);
|
|
35
36
|
/** serve static files (portal prebuild) */
|
|
36
37
|
app.use(express.static(resolveRelativePath('dev-portal'), { index: false }));
|
|
37
38
|
app.use(createProxyMiddleware('/_discovery/environments/current', {
|
|
38
|
-
target:
|
|
39
|
+
target: portalHost,
|
|
39
40
|
changeOrigin: true,
|
|
40
41
|
selfHandleResponse: true,
|
|
41
42
|
onProxyRes: responseInterceptor((responseBuffer, _proxyRes, req) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -52,7 +53,7 @@ export const server = (config) => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
52
53
|
app.get('/api/apps/:appKey/config',
|
|
53
54
|
// '/api/widget/:appKey/config',
|
|
54
55
|
createProxyMiddleware('/api/apps/*/config', {
|
|
55
|
-
target:
|
|
56
|
+
target: portalHost,
|
|
56
57
|
changeOrigin: true,
|
|
57
58
|
selfHandleResponse: true,
|
|
58
59
|
onProxyRes: responseInterceptor((responseBuffer, proxyRes, req, res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -72,7 +73,7 @@ export const server = (config) => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
72
73
|
})),
|
|
73
74
|
}));
|
|
74
75
|
app.get('/api/apps/:appKey', createProxyMiddleware('/api/apps/*', {
|
|
75
|
-
target:
|
|
76
|
+
target: portalHost,
|
|
76
77
|
changeOrigin: true,
|
|
77
78
|
selfHandleResponse: true,
|
|
78
79
|
onProxyRes: responseInterceptor((responseBuffer, proxyRes, req, res) => __awaiter(void 0, void 0, void 0, function* () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-framework-cli",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"Fusion",
|
|
6
6
|
"Fusion Framework",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"prepack": "yarn build"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@equinor/fusion-framework-app": "^6.0.
|
|
28
|
-
"@equinor/fusion-observable": "^7.0.
|
|
27
|
+
"@equinor/fusion-framework-app": "^6.0.8",
|
|
28
|
+
"@equinor/fusion-observable": "^7.0.2",
|
|
29
29
|
"@vitejs/plugin-react": "^3.0.0",
|
|
30
30
|
"commander": "^10.0.0",
|
|
31
31
|
"express": "^4.18.2",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"vite-tsconfig-paths": "^4.0.5"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@equinor/fusion-framework-module-context": "^2.0.
|
|
41
|
-
"@equinor/fusion-framework-react": "^4.0.
|
|
42
|
-
"@equinor/fusion-query": "^2.0.
|
|
40
|
+
"@equinor/fusion-framework-module-context": "^2.0.8",
|
|
41
|
+
"@equinor/fusion-framework-react": "^4.0.5",
|
|
42
|
+
"@equinor/fusion-query": "^2.0.6",
|
|
43
43
|
"@equinor/fusion-react-button": "^0.6.1",
|
|
44
44
|
"@equinor/fusion-react-context-selector": "^0.3.0",
|
|
45
45
|
"@equinor/fusion-react-icon": "^0.2.15",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"typescript": "^4.9.3",
|
|
57
57
|
"vite-plugin-environment": "^1.1.3"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "4bb6a70e2acb5c22a9a953da23c98565b8ef28d2"
|
|
60
60
|
}
|