@equinor/roma-nx-plugin 0.0.21 → 0.0.23
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/executors.json +0 -5
- package/migrations.json +36 -5
- package/package.json +16 -9
- package/src/executors/build/build.d.ts +4 -0
- package/src/executors/build/build.js +63 -0
- package/src/executors/build/build.js.map +1 -0
- package/src/executors/build/executor.js +2 -71
- package/src/executors/build/executor.js.map +1 -1
- package/src/executors/build/minify.d.ts +2 -0
- package/src/executors/build/minify.js +23 -0
- package/src/executors/build/minify.js.map +1 -0
- package/src/executors/create-vite-config.d.ts +3 -0
- package/src/executors/create-vite-config.js +73 -0
- package/src/executors/create-vite-config.js.map +1 -0
- package/src/executors/executor-context.js +11 -9
- package/src/executors/executor-context.js.map +1 -1
- package/src/executors/publish/executor.js +1 -1
- package/src/executors/publish/executor.js.map +1 -1
- package/src/executors/publish/publish-script.d.ts +1 -2
- package/src/executors/publish/publish-script.js +2 -2
- package/src/executors/publish/publish-script.js.map +1 -1
- package/src/executors/serve/executor.d.ts +1 -3
- package/src/executors/serve/executor.js +2 -50
- package/src/executors/serve/executor.js.map +1 -1
- package/src/executors/serve/schema.d.ts +2 -2
- package/src/executors/serve/schema.json +3 -3
- package/src/executors/serve/server.d.ts +3 -0
- package/src/executors/serve/server.js +162 -0
- package/src/executors/serve/server.js.map +1 -0
- package/src/executors/utils/get-vite-config.d.ts +1 -0
- package/src/executors/utils/get-vite-config.js +14 -0
- package/src/executors/utils/get-vite-config.js.map +1 -0
- package/src/executors/utils/logger.d.ts +24 -0
- package/src/executors/utils/logger.js +69 -0
- package/src/executors/utils/logger.js.map +1 -0
- package/src/generators/app/files/vite.config.d.ts +2 -0
- package/src/generators/app/files/vite.config.js +12 -16
- package/src/generators/app/files/vite.config.js.map +1 -0
- package/src/generators/app/generator.js +3 -7
- package/src/generators/app/generator.js.map +1 -1
- package/src/generators/preset/generator.js +1 -24
- package/src/generators/preset/generator.js.map +1 -1
- package/src/migrations/remove-fusion-cli/remove-fusion-cli.js +48 -0
- package/src/migrations/remove-fusion-cli/remove-fusion-cli.js.map +1 -0
- package/src/executors/portal/executor.d.ts +0 -4
- package/src/executors/portal/executor.js +0 -16
- package/src/executors/portal/executor.js.map +0 -1
- package/src/executors/portal/proxy.d.ts +0 -19
- package/src/executors/portal/proxy.js +0 -179
- package/src/executors/portal/proxy.js.map +0 -1
- package/src/executors/portal/schema.d.ts +0 -10
- package/src/executors/portal/schema.json +0 -36
- package/src/migrations/add-portal-proxy-target/add-portal-proxy-target.js +0 -23
- package/src/migrations/add-portal-proxy-target/add-portal-proxy-target.js.map +0 -1
- /package/src/migrations/{add-portal-proxy-target/add-portal-proxy-target.d.ts → remove-fusion-cli/remove-fusion-cli.d.ts} +0 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createServer = void 0;
|
|
4
|
+
const openBrowser = require('open');
|
|
5
|
+
const express = require('express');
|
|
6
|
+
const chalk = require('chalk');
|
|
7
|
+
const getPort = require('get-port-cjs');
|
|
8
|
+
const vite_1 = require("vite");
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const node_fs_1 = require("node:fs");
|
|
11
|
+
const http_proxy_middleware_1 = require("http-proxy-middleware");
|
|
12
|
+
const create_vite_config_1 = require("../create-vite-config");
|
|
13
|
+
const get_vite_config_1 = require("../utils/get-vite-config");
|
|
14
|
+
async function loadServices(portalTarget) {
|
|
15
|
+
try {
|
|
16
|
+
const req = await fetch(`${portalTarget}/_discovery/environments/current`);
|
|
17
|
+
const res = (await req.json());
|
|
18
|
+
return res.services
|
|
19
|
+
.filter((s) => s.uri.startsWith(portalTarget))
|
|
20
|
+
.map((s) => new URL(s.uri).pathname)
|
|
21
|
+
.filter((path) => path.length >= 3);
|
|
22
|
+
}
|
|
23
|
+
catch (ex) {
|
|
24
|
+
console.error(ex);
|
|
25
|
+
process.exit();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
async function createServer({ port: requestedPort = 3000, devPortal = 'node_modules/@equinor/roma-framework/dev-portal', portal: portalTarget = 'https://romadev.equinor.com', open, }, context) {
|
|
29
|
+
// Get path to dev-portal, this would be a flag from executor.
|
|
30
|
+
const devPortalPath = (0, path_1.resolve)(process.cwd(), devPortal);
|
|
31
|
+
// Get available port, prefers requestedPort but falls back to another free port
|
|
32
|
+
const ports = Array.from(new Set([requestedPort, ...getPort.portNumbers(3000, 30009)]));
|
|
33
|
+
const port = (await getPort({ port: ports }));
|
|
34
|
+
if (!ports.includes(port)) {
|
|
35
|
+
throw new Error(`All valid ports (3000-3009) are closed`);
|
|
36
|
+
}
|
|
37
|
+
console.clear();
|
|
38
|
+
if (port !== requestedPort) {
|
|
39
|
+
console.log(chalk.yellow(`Port ${requestedPort} is taken, using ${port}`));
|
|
40
|
+
}
|
|
41
|
+
const projectName = context.projectName;
|
|
42
|
+
const project = context.workspace.projects[projectName];
|
|
43
|
+
const base = (0, path_1.resolve)(context.root, project.root);
|
|
44
|
+
// Load user-defined viteConfig
|
|
45
|
+
const viteConfigPath = (0, get_vite_config_1.getViteConfig)(base);
|
|
46
|
+
const userConfig = await (0, vite_1.loadConfigFromFile)({
|
|
47
|
+
command: 'build',
|
|
48
|
+
mode: 'production',
|
|
49
|
+
}, viteConfigPath);
|
|
50
|
+
const viteConfig = userConfig.config;
|
|
51
|
+
// Create express application
|
|
52
|
+
const app = express();
|
|
53
|
+
app.set('x-powered-by', false);
|
|
54
|
+
app.use(express.static(devPortalPath));
|
|
55
|
+
// Load Roma services
|
|
56
|
+
const services = await loadServices(portalTarget);
|
|
57
|
+
// Add proxy middleware for all roma-services
|
|
58
|
+
services.forEach((p) => app.use(p, (0, http_proxy_middleware_1.createProxyMiddleware)(p, { target: portalTarget, changeOrigin: true })));
|
|
59
|
+
// Range of port numbers for hmr, otherwise HMR won't work for multiple apps at the same time
|
|
60
|
+
const hmrPorts = getPort.portNumbers(40000, 45000);
|
|
61
|
+
const hmrPort = await getPort(hmrPorts);
|
|
62
|
+
// Create Vite server in middleware mode
|
|
63
|
+
const vite = await (0, vite_1.createServer)((0, create_vite_config_1.createRomaViteConfig)(viteConfig, context, false, hmrPort));
|
|
64
|
+
// Apply vite-middleware to the express app
|
|
65
|
+
app.use(vite.middlewares);
|
|
66
|
+
app.use(
|
|
67
|
+
// Custom proxy-setup for service discovery endpoint
|
|
68
|
+
'/_discovery*', (0, http_proxy_middleware_1.createProxyMiddleware)('/_discovery', {
|
|
69
|
+
target: portalTarget,
|
|
70
|
+
changeOrigin: true, // Avoid API errors due to origin-conflicts
|
|
71
|
+
selfHandleResponse: true, // Tell the proxy we want to override the response
|
|
72
|
+
onProxyRes: (proxyRes, req, res) => {
|
|
73
|
+
const body = [];
|
|
74
|
+
proxyRes.on('data', function (chunk) {
|
|
75
|
+
body.push(chunk);
|
|
76
|
+
});
|
|
77
|
+
proxyRes.on('end', function () {
|
|
78
|
+
const bodyStr = Buffer.concat(body).toString();
|
|
79
|
+
const environment = JSON.parse(bodyStr);
|
|
80
|
+
// Override the services, and direct all api's from <target> to go via this proxy.
|
|
81
|
+
environment.services.forEach((s) => {
|
|
82
|
+
if (s.uri.includes(portalTarget)) {
|
|
83
|
+
s.uri = s.uri.replace(portalTarget, `http://localhost:${port}`);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
res.end(JSON.stringify(environment));
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
}));
|
|
90
|
+
// Extract entrypoint-url
|
|
91
|
+
const entry = `/${vite.config.build.lib.entry}`;
|
|
92
|
+
// Custom proxy for app-list to add the current application
|
|
93
|
+
app.get('/api/apps', (0, http_proxy_middleware_1.createProxyMiddleware)('/api/apps', {
|
|
94
|
+
target: portalTarget,
|
|
95
|
+
changeOrigin: true,
|
|
96
|
+
selfHandleResponse: true,
|
|
97
|
+
onProxyRes: (proxyRes, req, res) => {
|
|
98
|
+
const body = [];
|
|
99
|
+
proxyRes.on('data', function (chunk) {
|
|
100
|
+
body.push(chunk);
|
|
101
|
+
});
|
|
102
|
+
proxyRes.on('end', function () {
|
|
103
|
+
var _a;
|
|
104
|
+
const bodyStr = Buffer.concat(body).toString();
|
|
105
|
+
const data = JSON.parse(bodyStr);
|
|
106
|
+
const atIndex = (_a = data === null || data === void 0 ? void 0 : data.findIndex((manifest) => manifest.key === projectName)) !== null && _a !== void 0 ? _a : -1;
|
|
107
|
+
// If existing app, we need to change the entry-point.
|
|
108
|
+
if (atIndex > -1) {
|
|
109
|
+
data[atIndex].entry = entry;
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
// New app, so adding it to the app-list
|
|
113
|
+
try {
|
|
114
|
+
// Read and parse fusion-manifest
|
|
115
|
+
const manifest = JSON.parse((0, node_fs_1.readFileSync)((0, path_1.join)(vite.config.root, 'fusion-manifest.json'), 'utf8'));
|
|
116
|
+
manifest.entry = entry;
|
|
117
|
+
data.push(manifest);
|
|
118
|
+
}
|
|
119
|
+
catch (ex) {
|
|
120
|
+
throw new Error(chalk.red(`Fatal error: Failed to read fusion-manifest.json in ${vite.config.root}
|
|
121
|
+
Application will now exit.`));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
res.json(data);
|
|
125
|
+
});
|
|
126
|
+
},
|
|
127
|
+
}));
|
|
128
|
+
// Roma portal api
|
|
129
|
+
app.use('/api/*', (0, http_proxy_middleware_1.createProxyMiddleware)('/api', {
|
|
130
|
+
target: portalTarget,
|
|
131
|
+
changeOrigin: true,
|
|
132
|
+
}));
|
|
133
|
+
// Roma SSE api
|
|
134
|
+
app.use('/eventstream/*', (0, http_proxy_middleware_1.createProxyMiddleware)('/eventstream', {
|
|
135
|
+
target: portalTarget,
|
|
136
|
+
changeOrigin: true,
|
|
137
|
+
proxyTimeout: 1000 * 60 * 30,
|
|
138
|
+
}));
|
|
139
|
+
// SPA-style routing
|
|
140
|
+
app.use('*', async (req, res) => {
|
|
141
|
+
const htmlRaw = (0, node_fs_1.readFileSync)((0, path_1.join)(devPortalPath + '/index.html'), 'utf-8');
|
|
142
|
+
const html = await vite.transformIndexHtml(req.url, htmlRaw);
|
|
143
|
+
res.send(html);
|
|
144
|
+
});
|
|
145
|
+
return new Promise((resolve) => {
|
|
146
|
+
app.listen(port, () => {
|
|
147
|
+
console.log(chalk.green('Roma dev server listening on port ' + port));
|
|
148
|
+
if (open) {
|
|
149
|
+
console.log(chalk.green(`Opening the application at http://localhost:${port}/apps/${projectName}`));
|
|
150
|
+
openBrowser(`http://localhost:${port}/apps/${projectName}`);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
console.log(chalk.green(`Open the application at http://localhost:${port}/apps/${projectName}`));
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
app.on('close', () => {
|
|
157
|
+
resolve({ success: true });
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
exports.createServer = createServer;
|
|
162
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/executors/serve/server.ts"],"names":[],"mappings":";;;AAGA,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AACpC,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACnC,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AACxC,+BAIc;AACd,+BAAqC;AACrC,qCAAuC;AACvC,iEAA8D;AAG9D,8DAA6D;AAE7D,8DAAyD;AAEzD,KAAK,UAAU,YAAY,CAAC,YAAoB;IAC9C,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,YAAY,kCAAkC,CAAC,CAAC;QAC3E,MAAM,GAAG,GAAG,CAAC,MAAM,GAAG,C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CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;YACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,oCAAoC,GAAG,IAAI,CAAC,CAAC,CAAC;YACtE,IAAI,IAAI,EAAE,CAAC;gBACT,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,KAAK,CACT,+CAA+C,IAAI,SAAS,WAAW,EAAE,CAC1E,CACF,CAAC;gBACF,WAAW,CAAC,oBAAoB,IAAI,SAAS,WAAW,EAAE,CAAC,CAAC;YAC9D,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,KAAK,CACT,4CAA4C,IAAI,SAAS,WAAW,EAAE,CACvE,CACF,CAAC;YACJ,CAAC;QACH,CAAC,CAAC,CAAC;QACH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YACnB,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAjMD,oCAiMC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getViteConfig(root: string): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getViteConfig = void 0;
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
function getViteConfig(root) {
|
|
7
|
+
const files = (0, node_fs_1.readdirSync)(root);
|
|
8
|
+
const file = files.find((f) => f.startsWith('vite.config'));
|
|
9
|
+
if (!file)
|
|
10
|
+
throw new Error(`No vite config found!`);
|
|
11
|
+
return (0, path_1.resolve)(root, file);
|
|
12
|
+
}
|
|
13
|
+
exports.getViteConfig = getViteConfig;
|
|
14
|
+
//# sourceMappingURL=get-vite-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-vite-config.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/executors/utils/get-vite-config.ts"],"names":[],"mappings":";;;AAAA,qCAAsC;AACtC,+BAA+B;AAE/B,SAAgB,aAAa,CAAC,IAAY;IACxC,MAAM,KAAK,GAAG,IAAA,qBAAW,EAAC,IAAI,CAAC,CAAC;IAChC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC;IAC5D,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IACpD,OAAO,IAAA,cAAO,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC7B,CAAC;AALD,sCAKC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LogErrorOptions, LogOptions, LogType } from 'vite';
|
|
2
|
+
import { RollupError } from 'rollup';
|
|
3
|
+
type ILogger = {
|
|
4
|
+
info(msg: string, options?: LogOptions): void;
|
|
5
|
+
warn(msg: string, options?: LogOptions): void;
|
|
6
|
+
warnOnce(msg: string, options?: LogOptions): void;
|
|
7
|
+
error(msg: string, options?: LogErrorOptions): void;
|
|
8
|
+
clearScreen(type: LogType): void;
|
|
9
|
+
hasErrorLogged(error: Error | RollupError): boolean;
|
|
10
|
+
hasWarned: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare class Logger implements ILogger {
|
|
13
|
+
private warnings;
|
|
14
|
+
private errors;
|
|
15
|
+
hasWarned: boolean;
|
|
16
|
+
constructor();
|
|
17
|
+
info(msg: string, options?: LogOptions): void;
|
|
18
|
+
warn(msg: string, options?: LogOptions): void;
|
|
19
|
+
warnOnce(msg: string, options?: LogOptions): void;
|
|
20
|
+
error(msg: string, options?: LogErrorOptions): void;
|
|
21
|
+
clearScreen(type: LogType): void;
|
|
22
|
+
hasErrorLogged(error: Error | RollupError): boolean;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Logger = void 0;
|
|
4
|
+
const chalk = require("chalk");
|
|
5
|
+
const timestamp = () => {
|
|
6
|
+
const date = new Date();
|
|
7
|
+
const year = date.getFullYear();
|
|
8
|
+
const month = date.getUTCMonth() + 1;
|
|
9
|
+
const day = date.getDate();
|
|
10
|
+
const hour = date.getHours();
|
|
11
|
+
const minutes = date.getMinutes();
|
|
12
|
+
const seconds = date.getSeconds();
|
|
13
|
+
return `[${year}-${String(month).padStart(2, '0')}-${day} ${hour}:${minutes}:${seconds}]`;
|
|
14
|
+
};
|
|
15
|
+
const logModes = {
|
|
16
|
+
error: () => {
|
|
17
|
+
return chalk.red(`${timestamp()}: [roma]:`);
|
|
18
|
+
},
|
|
19
|
+
warning: () => {
|
|
20
|
+
return chalk.yellow(`${timestamp()}: [roma]:`);
|
|
21
|
+
},
|
|
22
|
+
info: () => {
|
|
23
|
+
return chalk.green(`${timestamp()}: [roma]:`);
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
// Custom logger, for now ignores error on roma-framework.umd.js, but can be improved on further.
|
|
27
|
+
class Logger {
|
|
28
|
+
constructor() {
|
|
29
|
+
this.warnings = new Set();
|
|
30
|
+
this.errors = new Set();
|
|
31
|
+
this.hasWarned = false;
|
|
32
|
+
}
|
|
33
|
+
info(msg, options) {
|
|
34
|
+
if (options === null || options === void 0 ? void 0 : options.clear)
|
|
35
|
+
this.clearScreen('info');
|
|
36
|
+
console.info(logModes.info(), msg);
|
|
37
|
+
// Additional logic can be added here to handle options
|
|
38
|
+
}
|
|
39
|
+
warn(msg, options) {
|
|
40
|
+
console.warn(logModes.warning(), msg);
|
|
41
|
+
if (options === null || options === void 0 ? void 0 : options.clear)
|
|
42
|
+
this.clearScreen('warn');
|
|
43
|
+
this.hasWarned = true;
|
|
44
|
+
// Additional logic can be added here to handle options
|
|
45
|
+
}
|
|
46
|
+
warnOnce(msg, options) {
|
|
47
|
+
if (!this.warnings.has(msg)) {
|
|
48
|
+
this.warnings.add(msg);
|
|
49
|
+
this.warn(msg, options);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
error(msg, options) {
|
|
53
|
+
if (msg.includes('resolved id: /roma-framework.umd.js'))
|
|
54
|
+
return;
|
|
55
|
+
if (options === null || options === void 0 ? void 0 : options.clear)
|
|
56
|
+
this.clearScreen('error');
|
|
57
|
+
console.error(logModes.error(), msg);
|
|
58
|
+
}
|
|
59
|
+
clearScreen(type) {
|
|
60
|
+
console.clear();
|
|
61
|
+
if (type === 'error')
|
|
62
|
+
console.log(`Console cleared: ${type}`);
|
|
63
|
+
}
|
|
64
|
+
hasErrorLogged(error) {
|
|
65
|
+
return this.errors.has(error);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.Logger = Logger;
|
|
69
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/executors/utils/logger.ts"],"names":[],"mappings":";;;AAEA,+BAA+B;AAY/B,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;IACxB,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAChC,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IACrC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC7B,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;IAClC,MAA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,WAAW,CAAC,MAAM,CAAC,CAAC;QAC7C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,uDAAuD;IACzD,CAAC;IAED,QAAQ,CAAC,GAAW,EAAE,OAAoB;QACxC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACvB,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,KAAK,CAAC,GAAW,EAAE,OAAyB;QAC1C,IAAI,GAAG,CAAC,QAAQ,CAAC,qCAAqC,CAAC;YAAE,OAAO;QAChE,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK;YAAE,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC9C,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,GAAG,CAAC,CAAC;IACvC,CAAC;IAED,WAAW,CAAC,IAAa;QACvB,OAAO,CAAC,KAAK,EAAE,CAAC;QAChB,IAAI,IAAI,KAAK,OAAO;YAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC;IAChE,CAAC;IAED,cAAc,CAAC,KAA0B;QACvC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;CACF;AA7CD,wBA6CC"}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vite_1 = require("vite");
|
|
4
|
+
exports.default = (0, vite_1.defineConfig)({
|
|
5
|
+
build: {
|
|
6
|
+
lib: {
|
|
7
|
+
entry: 'src/index.ts',
|
|
8
|
+
fileName: 'app-bundle',
|
|
9
|
+
formats: ['es'],
|
|
10
|
+
},
|
|
11
11
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
setupFiles: ['@equinor/roma-testing-utils/lib/override-imports.tsx'],
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
};
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=vite.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.config.js","sourceRoot":"","sources":["../../../../../../../plugins/roma/src/generators/app/files/vite.config.ts"],"names":[],"mappings":";;AAAA,+BAAoC;AAEpC,kBAAe,IAAA,mBAAY,EAAC;IAC1B,KAAK,EAAE;QACL,GAAG,EAAE;YACH,KAAK,EAAE,cAAc;YACrB,QAAQ,EAAE,YAAY;YACtB,OAAO,EAAE,CAAC,IAAI,CAAC;SAChB;KACF;CACF,CAAC,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.appGenerator = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const path =
|
|
5
|
+
const path = require("path");
|
|
7
6
|
const react_1 = require("@nx/react");
|
|
8
7
|
const modules_1 = require("./data/modules");
|
|
9
8
|
async function addDependencies(tree, options) {
|
|
@@ -12,7 +11,7 @@ async function addDependencies(tree, options) {
|
|
|
12
11
|
'@equinor/fusion-framework': '7.0.30',
|
|
13
12
|
'@equinor/fusion-framework-module-app': '5.2.13',
|
|
14
13
|
'@equinor/eds-core-react': '^0.36.0',
|
|
15
|
-
'@equinor/eds-data-grid-react': '^0.
|
|
14
|
+
'@equinor/eds-data-grid-react': '^0.4.0',
|
|
16
15
|
'@equinor/eds-icons': '^0.20.0',
|
|
17
16
|
'@equinor/eds-tokens': '^0.9.2',
|
|
18
17
|
'@equinor/fusion-framework-react': '6.0.2',
|
|
@@ -26,10 +25,7 @@ async function addDependencies(tree, options) {
|
|
|
26
25
|
.forEach((module) => {
|
|
27
26
|
dependencies[`@equinor/${module}`] = modules_1.modules[module];
|
|
28
27
|
});
|
|
29
|
-
const devDependencies = {
|
|
30
|
-
'@equinor/fusion-framework-cli': '9.2.1',
|
|
31
|
-
'vite-tsconfig-paths': '4.2.1',
|
|
32
|
-
};
|
|
28
|
+
const devDependencies = {};
|
|
33
29
|
return (0, devkit_1.runTasksInSerial)(...[
|
|
34
30
|
(0, devkit_1.removeDependenciesFromPackageJson)(tree, Object.keys(dependencies), Object.keys(devDependencies)),
|
|
35
31
|
(0, devkit_1.addDependenciesToPackageJson)(tree, dependencies, devDependencies),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/generators/app/generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/generators/app/generator.ts"],"names":[],"mappings":";;;AAAA,uCAWoB;AACpB,6BAA6B;AAE7B,qCAAiD;AAEjD,4CAAyC;AAEzC,KAAK,UAAU,eAAe,CAC5B,IAAU,EACV,OAA2E;IAE3E,MAAM,YAAY,GAA2B;QAC3C,yBAAyB,EAAE,SAAS;QACpC,2BAA2B,EAAE,QAAQ;QACrC,sCAAsC,EAAE,QAAQ;QAChD,yBAAyB,EAAE,SAAS;QACpC,8BAA8B,EAAE,QAAQ;QACxC,oBAAoB,EAAE,SAAS;QAC/B,qBAAqB,EAAE,QAAQ;QAC/B,iCAAiC,EAAE,OAAO;QAC1C,qCAAqC,EAAE,OAAO;QAC9C,wCAAwC,EAAE,OAAO;QACjD,6CAA6C,EAAE,OAAO;QACtD,mBAAmB,EAAE,QAAQ;KAC9B,CAAC;IACF,OAAO,CAAC,aAAa;SAClB,OAAO,CA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eAAe,CAAC,CAAC;IAC3C,IAAI,CAAC,MAAM,CAAC,GAAG,WAAW,iBAAiB,CAAC,CAAC;IAC7C,IAAI,CAAC,MAAM,CAAC,GAAG,WAAW,aAAa,CAAC,CAAC;IACzC,IAAI,CAAC,MAAM,CAAC,GAAG,WAAW,SAAS,CAAC,CAAC;IACrC,IAAI,CAAC,MAAM,CAAC,GAAG,WAAW,iBAAiB,CAAC,CAAC;IAE7C,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;QAC5B,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC;IACpB,CAAC;IAED,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC;AAvCD,oCAuCC;AAED,kBAAe,YAAY,CAAC"}
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.presetGenerator = void 0;
|
|
27
4
|
async function presetGenerator(tree, options) {
|
|
@@ -30,7 +7,7 @@ async function presetGenerator(tree, options) {
|
|
|
30
7
|
options.projectName = options.appName || options.name;
|
|
31
8
|
options.style = options.style || options.styledModule || 'styled-components';
|
|
32
9
|
options.styledModule = options.style;
|
|
33
|
-
return await Promise.resolve().then(() =>
|
|
10
|
+
return await Promise.resolve().then(() => require('../app/generator')).then(({ appGenerator }) => appGenerator(tree, Object.assign({}, options)));
|
|
34
11
|
}
|
|
35
12
|
exports.presetGenerator = presetGenerator;
|
|
36
13
|
exports.default = presetGenerator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/generators/preset/generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/generators/preset/generator.ts"],"names":[],"mappings":";;;AAGO,KAAK,UAAU,eAAe,CACnC,IAAU,EACV,OAA8B;IAE9B,OAAO,CAAC,SAAS,GAAG,MAAM,CAAC;IAC3B,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAC/C,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IACtD,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,YAAY,IAAI,mBAAmB,CAAC;IAC7E,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC;IACrC,OAAO,MAAM,qCAAO,kBAAkB,GAAE,IAAI,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAChE,YAAY,CAAC,IAAI,oBAAO,OAAO,EAAG,CACnC,CAAC;AACJ,CAAC;AAZD,0CAYC;AAED,kBAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
async function update(tree) {
|
|
6
|
+
var _a;
|
|
7
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
8
|
+
const remove = (0, devkit_1.removeDependenciesFromPackageJson)(tree, [], ['@equinor/fusion-framework-cli']);
|
|
9
|
+
for (const [name, project] of projects) {
|
|
10
|
+
if (project.projectType !== 'application')
|
|
11
|
+
continue;
|
|
12
|
+
if ('portal' in project.targets) {
|
|
13
|
+
delete project.targets.portal;
|
|
14
|
+
}
|
|
15
|
+
if ('serve' in project.targets) {
|
|
16
|
+
const target = project.targets.serve;
|
|
17
|
+
if ((_a = target.options.portal) === null || _a === void 0 ? void 0 : _a.includes('localhost')) {
|
|
18
|
+
delete target.options.portal;
|
|
19
|
+
project.targets.serve = target;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (tree.exists(`${project.root}/vite.config.js`)) {
|
|
23
|
+
tree.delete(`${project.root}/vite.config.js`);
|
|
24
|
+
}
|
|
25
|
+
if (tree.exists(`${project.root}/.eslintrc.json`)) {
|
|
26
|
+
(0, devkit_1.updateJson)(tree, `${project.root}/.eslintrc.json`, (value) => (Object.assign(Object.assign({}, value), { parserOptions: {
|
|
27
|
+
sourceType: 'module',
|
|
28
|
+
} })));
|
|
29
|
+
}
|
|
30
|
+
tree.write(`${project.root}/vite.config.ts`, `import { defineConfig } from 'vite';
|
|
31
|
+
|
|
32
|
+
export default defineConfig({
|
|
33
|
+
build: {
|
|
34
|
+
minify: true,
|
|
35
|
+
lib: {
|
|
36
|
+
entry: 'src/index.ts',
|
|
37
|
+
fileName: 'app-bundle',
|
|
38
|
+
formats: ['es'],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
`);
|
|
43
|
+
(0, devkit_1.updateProjectConfiguration)(tree, name, project);
|
|
44
|
+
}
|
|
45
|
+
return remove();
|
|
46
|
+
}
|
|
47
|
+
exports.default = update;
|
|
48
|
+
//# sourceMappingURL=remove-fusion-cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-fusion-cli.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/migrations/remove-fusion-cli/remove-fusion-cli.ts"],"names":[],"mappings":";;AAAA,sDAAsD;AACtD,uCAMoB;AAWL,KAAK,UAAU,MAAM,CAAC,IAAU;;IAC7C,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IACnC,MAAM,MAAM,GAAG,IAAA,0CAAiC,EAC9C,IAAI,EACJ,EAAE,EACF,CAAC,+BAA+B,CAAC,CAClC,CAAC;IAEF,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,QAAQ,EAAE,CAAC;QACvC,IAAI,OAAO,CAAC,WAAW,KAAK,aAAa;YAAE,SAAS;QACpD,IAAI,QAAQ,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YAChC,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;QAChC,CAAC;QACD,IAAI,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YAC/B,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,KAAoB,CAAC;YACpD,IAAI,MAAA,MAAM,CAAC,OAAO,CAAC,MAAM,0CAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;gBACjD,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;gBAC7B,OAAO,CAAC,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC;YACjC,CAAC;QACH,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,iBAAiB,CAAC,EAAE,CAAC;YAClD,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,iBAAiB,CAAC,CAAC;QAChD,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,iBAAiB,CAAC,EAAE,CAAC;YAClD,IAAA,mBAAU,EAAC,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,iCACzD,KAAK,KACR,aAAa,EAAE;oBACb,UAAU,EAAE,QAAQ;iBACrB,IACD,CAAC,CAAC;QACN,CAAC;QACD,IAAI,CAAC,KAAK,CACR,GAAG,OAAO,CAAC,IAAI,iBAAiB,EAChC;;;;;;;;;;;;CAYL,CACI,CAAC;QACF,IAAA,mCAA0B,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IAED,OAAO,MAAM,EAAE,CAAC;AAClB,CAAC;AAnDD,yBAmDC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const proxy_1 = require("./proxy");
|
|
4
|
-
async function runExecutor(options) {
|
|
5
|
-
return new Promise((resolve) => {
|
|
6
|
-
const { server, proxy } = (0, proxy_1.proxyServer)(options.port, options.portal, options.additionalProxyTargets);
|
|
7
|
-
proxy.on('close', () => {
|
|
8
|
-
console.log('Proxy connection closed');
|
|
9
|
-
resolve({ success: true });
|
|
10
|
-
});
|
|
11
|
-
server.listen(options.port);
|
|
12
|
-
console.log(`Proxying all requests to portal ${options.portal}`);
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
exports.default = runExecutor;
|
|
16
|
-
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/executors/portal/executor.ts"],"names":[],"mappings":";;AACA,mCAAsC;AAEvB,KAAK,UAAU,WAAW,CAAC,OAA6B;IACrE,OAAO,IAAI,OAAO,CAAuB,CAAC,OAAO,EAAE,EAAE;QACnD,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,mBAAW,EACnC,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,MAAM,EACd,OAAO,CAAC,sBAAsB,CAC/B,CAAC;QACF,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YACrB,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;YACvC,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC5B,OAAO,CAAC,GAAG,CAAC,mCAAmC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC;AAdD,8BAcC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { ServerOptions } from 'http-proxy';
|
|
3
|
-
import { IncomingMessage, ServerResponse } from 'http';
|
|
4
|
-
/**
|
|
5
|
-
* This is a TypeScript function that creates a proxy server to forward HTTP requests to another server.
|
|
6
|
-
* @param port The port number on which the proxy server should listen for incoming requests.
|
|
7
|
-
* @param target The URL of the target server to which the HTTP requests should be forwarded.
|
|
8
|
-
* @param additionalTarget An optional object containing additional target servers that should be used for specific URLs. Each key in this object is a URL prefix that should be matched against the incoming request URL, and the corresponding value is an object containing the options to be passed to the http-proxy library for that URL prefix.
|
|
9
|
-
*
|
|
10
|
-
* @returns Object
|
|
11
|
-
* server: An instance of the Node.js http.Server class that represents the proxy server.
|
|
12
|
-
* proxy: An instance of the http-proxy library that is used to forward the HTTP requests to the target server.
|
|
13
|
-
*/
|
|
14
|
-
export declare const proxyServer: (port: number, target: string, additionalTarget?: Record<string, ServerOptions & {
|
|
15
|
-
ignoreTargetPath?: boolean;
|
|
16
|
-
}>) => {
|
|
17
|
-
server: import("http").Server<typeof IncomingMessage, typeof ServerResponse>;
|
|
18
|
-
proxy: import("http-proxy")<IncomingMessage, ServerResponse<IncomingMessage>>;
|
|
19
|
-
};
|