@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
package/executors.json
CHANGED
|
@@ -10,11 +10,6 @@
|
|
|
10
10
|
"schema": "./src/executors/build/schema.json",
|
|
11
11
|
"description": "build executor"
|
|
12
12
|
},
|
|
13
|
-
"portal": {
|
|
14
|
-
"implementation": "./src/executors/portal/executor",
|
|
15
|
-
"schema": "./src/executors/portal/schema.json",
|
|
16
|
-
"description": "portal executor"
|
|
17
|
-
},
|
|
18
13
|
"publish": {
|
|
19
14
|
"implementation": "./src/executors/publish/executor",
|
|
20
15
|
"schema": "./src/executors/publish/schema.json",
|
package/migrations.json
CHANGED
|
@@ -1,14 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"generators": {
|
|
3
|
-
"add-portal-proxy-target": {
|
|
4
|
-
"version": "0.0.4",
|
|
5
|
-
"description": "Add a new target to all apps called portal",
|
|
6
|
-
"implementation": "./src/migrations/add-portal-proxy-target/add-portal-proxy-target"
|
|
7
|
-
},
|
|
8
3
|
"add-publish-target": {
|
|
9
4
|
"version": "0.0.13",
|
|
10
5
|
"description": "add-publish-target",
|
|
11
6
|
"implementation": "./src/migrations/add-publish-target/add-publish-target"
|
|
7
|
+
},
|
|
8
|
+
"remove-fusion-cli": {
|
|
9
|
+
"version": "0.0.22",
|
|
10
|
+
"description": "Removes dependency on fusion-cli and old portal target",
|
|
11
|
+
"implementation": "./src/migrations/remove-fusion-cli/remove-fusion-cli"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"packageJsonUpdates": {
|
|
15
|
+
"update-after-remove-fusion-cli": {
|
|
16
|
+
"version": "0.0.22",
|
|
17
|
+
"packages": {
|
|
18
|
+
"vitest": {
|
|
19
|
+
"version": "1.4.0",
|
|
20
|
+
"alwaysAddToPackageJson": true
|
|
21
|
+
},
|
|
22
|
+
"@vitest/coverage-v8": {
|
|
23
|
+
"version": "1.4.0",
|
|
24
|
+
"alwaysAddToPackageJson": true
|
|
25
|
+
},
|
|
26
|
+
"@vitest/ui": {
|
|
27
|
+
"version": "1.4.0",
|
|
28
|
+
"alwaysAddToPackageJson": true
|
|
29
|
+
},
|
|
30
|
+
"@equinor/fusion-framework-app": {
|
|
31
|
+
"version": "9.0.1",
|
|
32
|
+
"alwaysAddToPackageJson": true
|
|
33
|
+
},
|
|
34
|
+
"@equinor/roma-framework": {
|
|
35
|
+
"version": "0.0.11",
|
|
36
|
+
"alwaysAddToPackageJson": true
|
|
37
|
+
},
|
|
38
|
+
"vite": {
|
|
39
|
+
"version": "5.2.7",
|
|
40
|
+
"alwaysAddToPackageJson": true
|
|
41
|
+
}
|
|
42
|
+
}
|
|
12
43
|
}
|
|
13
44
|
}
|
|
14
45
|
}
|
package/package.json
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/roma-nx-plugin",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.23",
|
|
5
5
|
"repository": "https://github.com/equinor/tops-roma",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@nx/devkit": "17.3.0",
|
|
8
|
+
"get-port-cjs": "6.1.3",
|
|
9
|
+
"open": "^8.4.2",
|
|
10
|
+
"chalk": "^4.0.0",
|
|
8
11
|
"@nx/react": "17.3.0",
|
|
9
12
|
"nx": "17.3.0",
|
|
10
13
|
"tslib": "^2.3.0",
|
|
11
14
|
"@azure/identity": "^3.3.0",
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"@equinor/fusion-framework-module-service-discovery": "7.0.20",
|
|
15
|
-
"vite": "5.0.12",
|
|
15
|
+
"@equinor/fusion-framework-module-service-discovery": "7.1.0",
|
|
16
|
+
"vite": "5.2.7",
|
|
16
17
|
"@vitejs/plugin-react": "4.2.1",
|
|
17
|
-
"@nx/vite": "17.3.0"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
18
|
+
"@nx/vite": "17.3.0",
|
|
19
|
+
"vite-plugin-restart": "^0.4.0",
|
|
20
|
+
"vite-plugin-environment": "^1.1.3",
|
|
21
|
+
"semver": "7.5.3",
|
|
22
|
+
"rollup": "2.79.1",
|
|
23
|
+
"express": "^4.18.3",
|
|
24
|
+
"http-proxy-middleware": "^2.0.6",
|
|
25
|
+
"@equinor/fusion-framework-module-app": "^5.2.4",
|
|
26
|
+
"esbuild": "0.20.2"
|
|
21
27
|
},
|
|
28
|
+
"peerDependencies": {},
|
|
22
29
|
"type": "commonjs",
|
|
23
30
|
"main": "./src/index.js",
|
|
24
31
|
"typings": "./src/index.d.ts",
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const create_vite_config_1 = require("../create-vite-config");
|
|
4
|
+
const vite_1 = require("vite");
|
|
5
|
+
const semver_1 = require("semver");
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
const path_1 = require("path");
|
|
9
|
+
const logger_1 = require("../utils/logger");
|
|
10
|
+
const logger = new logger_1.Logger();
|
|
11
|
+
function getViteConfig(root) {
|
|
12
|
+
const files = (0, node_fs_1.readdirSync)(root);
|
|
13
|
+
const file = files.find((f) => f.startsWith('vite.config'));
|
|
14
|
+
if (!file)
|
|
15
|
+
throw new Error(`No vite config found!`);
|
|
16
|
+
return (0, path_1.resolve)(root, file);
|
|
17
|
+
}
|
|
18
|
+
async function default_1(context, watch = false) {
|
|
19
|
+
const projectName = context.projectName;
|
|
20
|
+
const project = context.workspace.projects[projectName];
|
|
21
|
+
const base = (0, path_1.resolve)(context.root, project.root);
|
|
22
|
+
// const viteConfigPath = resolve(base, 'vite.config.ts');
|
|
23
|
+
const viteConfigPath = getViteConfig(base);
|
|
24
|
+
const userConfig = await (0, vite_1.loadConfigFromFile)({
|
|
25
|
+
command: 'build',
|
|
26
|
+
mode: 'production',
|
|
27
|
+
}, viteConfigPath);
|
|
28
|
+
const viteConfig = userConfig.config;
|
|
29
|
+
const config = (0, create_vite_config_1.createRomaViteConfig)(viteConfig, context, watch);
|
|
30
|
+
const normalizeVersion = (version) => {
|
|
31
|
+
const semverVersion = (0, semver_1.parse)(version);
|
|
32
|
+
const { major, minor, patch } = semverVersion;
|
|
33
|
+
return { major, minor, patch };
|
|
34
|
+
};
|
|
35
|
+
try {
|
|
36
|
+
const result = await (0, vite_1.build)(config).then((r) => {
|
|
37
|
+
const out = config.build.outDir;
|
|
38
|
+
const manifest = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(config.root, 'fusion-manifest.json'), 'utf8'));
|
|
39
|
+
const normalizedVersion = normalizeVersion(manifest.version);
|
|
40
|
+
(0, node_fs_1.writeFileSync)((0, node_path_1.join)(out, 'manifest.json'), JSON.stringify(Object.assign(Object.assign({}, manifest), { version: normalizedVersion }), null, 2), 'utf8');
|
|
41
|
+
return r;
|
|
42
|
+
});
|
|
43
|
+
return new Promise((resolve) => {
|
|
44
|
+
if (watch) {
|
|
45
|
+
result.on('change', (e) => logger.info(e));
|
|
46
|
+
result.on('close', () => {
|
|
47
|
+
logger.info('Stopping watch');
|
|
48
|
+
resolve({ success: true });
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
resolve({ success: true });
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
catch (ex) {
|
|
57
|
+
logger.error(`Failed to build ${projectName}:`);
|
|
58
|
+
logger.error(ex);
|
|
59
|
+
return { success: false };
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.default = default_1;
|
|
63
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/executors/build/build.ts"],"names":[],"mappings":";;AAAA,8DAA6D;AAC7D,+BAAiD;AACjD,mCAA8C;AAC9C,qCAAmE;AACnE,yCAAiC;AAEjC,+BAA+B;AAE/B,4CAAyC;AAEzC,MAAM,MAAM,GAAG,IAAI,eAAM,EAAE,CAAC;AAE5B,SAAS,aAAa,CAAC,IAAY;IACjC,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;AAEc,KAAK,oBAClB,OAAwB,EACxB,KAAK,GAAG,KAAK;IAEb,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IACxC,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IACxD,MAAM,IAAI,GAAG,IAAA,cAAO,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,0DAA0D;IAC1D,MAAM,cAAc,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAC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AK,EAAE,CAAC;gBACV,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC3C,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;oBACtB,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;oBAC9B,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;gBAC7B,CAAC,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,EAAE,EAAE,CAAC;QACZ,MAAM,CAAC,KAAK,CAAC,mBAAmB,WAAW,GAAG,CAAC,CAAC;QAChD,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACjB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;AACH,CAAC;AAhED,4BAgEC"}
|
|
@@ -1,77 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const run_commands_impl_1 = tslib_1.__importDefault(require("nx/src/executors/run-commands/run-commands.impl"));
|
|
6
|
-
const path = tslib_1.__importStar(require("path"));
|
|
7
|
-
/**
|
|
8
|
-
* Function that will validate that a value is set (not empty string, and not null-ish)
|
|
9
|
-
*
|
|
10
|
-
* @param value
|
|
11
|
-
* @param field
|
|
12
|
-
* @throws Error If validation fails, an error is thrown.
|
|
13
|
-
*/
|
|
14
|
-
function assertValueExists(value, field) {
|
|
15
|
-
const isNullish = typeof value !== 'boolean' && (value !== null && value !== void 0 ? value : true);
|
|
16
|
-
const isNotempty = value !== '';
|
|
17
|
-
if (isNullish === true) {
|
|
18
|
-
throw new Error(`Validation failed: ${field} is null-like`);
|
|
19
|
-
}
|
|
20
|
-
if (!isNotempty) {
|
|
21
|
-
throw new Error(`Validation failed: ${field} is empty`);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Function that will read the fusion-manifest on the given path, and validate it to ensure we're not missing information
|
|
26
|
-
* @param manifestPath
|
|
27
|
-
*/
|
|
28
|
-
function validateManifest(manifestPath) {
|
|
29
|
-
// TODO: Improve this, for now this is only meant as a POC that we can validate the manifest files
|
|
30
|
-
const manifest = (0, devkit_1.readJsonFile)(manifestPath);
|
|
31
|
-
assertValueExists(manifest.key, 'key');
|
|
32
|
-
assertValueExists(manifest.name, 'name');
|
|
33
|
-
assertValueExists(manifest.categoryId, 'categoryId');
|
|
34
|
-
if (manifest.type === 'standalone') {
|
|
35
|
-
assertValueExists(manifest.description, 'description');
|
|
36
|
-
assertValueExists(manifest.shortName, 'shortName');
|
|
37
|
-
}
|
|
38
|
-
}
|
|
3
|
+
const build_1 = require("./build");
|
|
39
4
|
async function runExecutor(options, context) {
|
|
40
|
-
|
|
41
|
-
const projectName = context.projectName;
|
|
42
|
-
const project = context.workspace.projects[projectName];
|
|
43
|
-
const projectPath = path.resolve(context.root, project.root);
|
|
44
|
-
const buildConfig = project.targets.build;
|
|
45
|
-
const outputPath = (_a = buildConfig.outputPath) !== null && _a !== void 0 ? _a : `dist/apps/${projectName}`;
|
|
46
|
-
const build = () => {
|
|
47
|
-
validateManifest(`${projectPath}/fusion-manifest.json`);
|
|
48
|
-
/**
|
|
49
|
-
* Build happens in two stages:
|
|
50
|
-
* - First we call the build-command from fusion's CLI
|
|
51
|
-
* - Once complete, we call the manifest command, converting the manifest to the expected format.
|
|
52
|
-
* This prepares the files to uploaded via the publish command.
|
|
53
|
-
*/
|
|
54
|
-
return (0, run_commands_impl_1.default)({
|
|
55
|
-
commands: [
|
|
56
|
-
`fusion-framework-cli app build -o ${context.root}/${outputPath}`,
|
|
57
|
-
`fusion-framework-cli app manifest -c ${projectPath}/fusion-manifest.json -o ${context.root}/${outputPath}/manifest.json`,
|
|
58
|
-
],
|
|
59
|
-
cwd: projectPath,
|
|
60
|
-
__unparsed__: [],
|
|
61
|
-
}, context);
|
|
62
|
-
};
|
|
63
|
-
if ('watch' in options && options.watch !== false) {
|
|
64
|
-
const fusionBuild = `fusion-framework-cli app build -o ${context.root}/dist/apps/${projectName}`;
|
|
65
|
-
const watch = `nx watch --projects=${context.projectName} -- ${fusionBuild}`;
|
|
66
|
-
return build().then(() => (0, run_commands_impl_1.default)({
|
|
67
|
-
command: watch,
|
|
68
|
-
cwd: projectPath,
|
|
69
|
-
__unparsed__: [],
|
|
70
|
-
}, context));
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
return build();
|
|
74
|
-
}
|
|
5
|
+
return (0, build_1.default)(context, options.watch);
|
|
75
6
|
}
|
|
76
7
|
exports.default = runExecutor;
|
|
77
8
|
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/executors/build/executor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/executors/build/executor.ts"],"names":[],"mappings":";;AAEA,mCAA4B;AAEb,KAAK,UAAU,WAAW,CACvC,OAA4B,EAC5B,OAAwB;IAExB,OAAO,IAAA,eAAK,EAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;AACvC,CAAC;AALD,8BAKC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.minifyEs = void 0;
|
|
4
|
+
const esbuild_1 = require("esbuild");
|
|
5
|
+
function minifyEs() {
|
|
6
|
+
return {
|
|
7
|
+
name: 'minifyEs',
|
|
8
|
+
renderChunk: {
|
|
9
|
+
order: 'post',
|
|
10
|
+
async handler(code, chunk, outputOptions) {
|
|
11
|
+
if (outputOptions.format === 'es') {
|
|
12
|
+
return await (0, esbuild_1.transform)(code, {
|
|
13
|
+
minifyWhitespace: true,
|
|
14
|
+
minifySyntax: true,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return code;
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
exports.minifyEs = minifyEs;
|
|
23
|
+
//# sourceMappingURL=minify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minify.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/executors/build/minify.ts"],"names":[],"mappings":";;;AACA,qCAAoC;AAEpC,SAAgB,QAAQ;IACtB,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE;YACX,KAAK,EAAE,MAAM;YACb,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,aAAa;gBACtC,IAAI,aAAa,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;oBAClC,OAAO,MAAM,IAAA,mBAAS,EAAC,IAAI,EAAE;wBAC3B,gBAAgB,EAAE,IAAI;wBACtB,YAAY,EAAE,IAAI;qBACnB,CAAC,CAAC;gBACL,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC;SACF;KACQ,CAAC;AACd,CAAC;AAhBD,4BAgBC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createRomaViteConfig = void 0;
|
|
4
|
+
const vite_1 = require("vite");
|
|
5
|
+
const vite_plugin_restart_1 = require("vite-plugin-restart");
|
|
6
|
+
const vite_plugin_environment_1 = require("vite-plugin-environment");
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
const plugin_react_1 = require("@vitejs/plugin-react");
|
|
9
|
+
const logger_1 = require("./utils/logger");
|
|
10
|
+
const nx_tsconfig_paths_plugin_1 = require("@nx/vite/plugins/nx-tsconfig-paths.plugin");
|
|
11
|
+
const minify_1 = require("./build/minify");
|
|
12
|
+
const createRomaViteConfig = (config, context, watch = false, hmrPort = 42000) => {
|
|
13
|
+
var _a;
|
|
14
|
+
const projectName = context.projectName;
|
|
15
|
+
const project = context.workspace.projects[projectName];
|
|
16
|
+
const workspaceRoot = context.root;
|
|
17
|
+
const base = (0, path_1.resolve)(context.root, project.root);
|
|
18
|
+
const viteConfigPath = (0, path_1.resolve)(base, 'vite.config.ts');
|
|
19
|
+
const buildConfig = project.targets.build;
|
|
20
|
+
const outputPath = (_a = buildConfig.outputPath) !== null && _a !== void 0 ? _a : `dist/apps/${projectName}`;
|
|
21
|
+
const devPortalPath = (0, path_1.resolve)(process.cwd(), 'node_modules/@equinor/roma-framework/dev-portal');
|
|
22
|
+
if (!config.build) {
|
|
23
|
+
config.build = {
|
|
24
|
+
lib: {
|
|
25
|
+
entry: 'src/index.ts',
|
|
26
|
+
fileName: 'app-bundle',
|
|
27
|
+
formats: ['es'],
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const minifyPlugin = [];
|
|
32
|
+
if (config.build.minify) {
|
|
33
|
+
minifyPlugin.push((0, minify_1.minifyEs)());
|
|
34
|
+
}
|
|
35
|
+
const build = context.targetName === 'build';
|
|
36
|
+
const romaConfig = {
|
|
37
|
+
customLogger: new logger_1.Logger(),
|
|
38
|
+
assetsInclude: [`${devPortalPath}/roma-framework.umd.js`],
|
|
39
|
+
root: base,
|
|
40
|
+
server: {
|
|
41
|
+
middlewareMode: true,
|
|
42
|
+
hmr: {
|
|
43
|
+
port: hmrPort,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
appType: 'custom',
|
|
47
|
+
define: {
|
|
48
|
+
'process.env': {},
|
|
49
|
+
},
|
|
50
|
+
build: {
|
|
51
|
+
outDir: (0, path_1.resolve)(workspaceRoot, outputPath),
|
|
52
|
+
watch: watch
|
|
53
|
+
? {
|
|
54
|
+
clearScreen: true,
|
|
55
|
+
}
|
|
56
|
+
: undefined,
|
|
57
|
+
},
|
|
58
|
+
plugins: [
|
|
59
|
+
(0, plugin_react_1.default)(),
|
|
60
|
+
(0, nx_tsconfig_paths_plugin_1.nxViteTsPaths)(),
|
|
61
|
+
(0, vite_plugin_environment_1.default)({
|
|
62
|
+
NODE_ENV: build ? 'production' : 'development',
|
|
63
|
+
}),
|
|
64
|
+
(0, vite_plugin_restart_1.default)({
|
|
65
|
+
restart: ['package.json', viteConfigPath].filter((x) => !!x),
|
|
66
|
+
}),
|
|
67
|
+
...minifyPlugin,
|
|
68
|
+
],
|
|
69
|
+
};
|
|
70
|
+
return (0, vite_1.defineConfig)((0, vite_1.mergeConfig)(config, romaConfig));
|
|
71
|
+
};
|
|
72
|
+
exports.createRomaViteConfig = createRomaViteConfig;
|
|
73
|
+
//# sourceMappingURL=create-vite-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-vite-config.js","sourceRoot":"","sources":["../../../../../plugins/roma/src/executors/create-vite-config.ts"],"names":[],"mappings":";;;AAAA,+BAA6D;AAC7D,6DAA8C;AAC9C,qEAA8C;AAC9C,+BAA+B;AAC/B,uDAAyC;AACzC,2CAAwC;AAGxC,wFAA0E;AAC1E,2CAA0C;AAMnC,MAAM,oBAAoB,GAAG,CAClC,MAAkB,EAClB,OAAwB,EACxB,KAAK,GAAG,KAAK,EACb,OAAO,GAAG,KAAK,EACf,EAAE;;IACF,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IACxC,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IACxD,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IACnC,MAAM,IAAI,GAAG,IAAA,cAAO,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,C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AAO,EAAE;YACP,IAAA,sBAAK,GAAE;YACP,IAAA,wCAAa,GAAE;YACf,IAAA,iCAAO,EAAC;gBACN,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa;aAC/C,CAAC;YACF,IAAA,6BAAW,EAAC;gBACV,OAAO,EAAE,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,MAAM,CAC9C,CAAC,CAAC,EAAe,EAAE,CAAC,CAAC,CAAC,CAAC,CACxB;aACF,CAAC;YACF,GAAG,YAAY;SAChB;KACY,CAAC;IAChB,OAAO,IAAA,mBAAY,EAAC,IAAA,kBAAW,EAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;AACvD,CAAC,CAAC;AAzEW,QAAA,oBAAoB,wBAyE/B"}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.executorContext = void 0;
|
|
4
4
|
const projects = {
|
|
5
|
-
|
|
6
|
-
name: '
|
|
7
|
-
root: 'apps/applications/
|
|
5
|
+
administration: {
|
|
6
|
+
name: 'administration',
|
|
7
|
+
root: 'apps/applications/administration',
|
|
8
8
|
$schema: '../../../node_modules/nx/schemas/project-schema.json',
|
|
9
|
-
sourceRoot: 'apps/applications/
|
|
9
|
+
sourceRoot: 'apps/applications/administration/src',
|
|
10
10
|
projectType: 'application',
|
|
11
11
|
targets: {
|
|
12
12
|
build: {
|
|
@@ -29,8 +29,8 @@ const projects = {
|
|
|
29
29
|
executor: '@equinor/roma-nx-plugin:portal',
|
|
30
30
|
options: {
|
|
31
31
|
additionalProxyTargets: {
|
|
32
|
-
'/
|
|
33
|
-
target: 'https://api-dev.gateway.equinor.com/
|
|
32
|
+
'/tradeadministration': {
|
|
33
|
+
target: 'https://api-dev.gateway.equinor.com/tradeadministration/v1',
|
|
34
34
|
headers: {
|
|
35
35
|
'Ocp-Apim-Subscription-Key': 'RATSCORE_SUB_KEY',
|
|
36
36
|
},
|
|
@@ -50,7 +50,7 @@ const projects = {
|
|
|
50
50
|
outputs: ['{options.reportsDirectory}'],
|
|
51
51
|
options: {
|
|
52
52
|
passWithNoTests: true,
|
|
53
|
-
reportsDirectory: '../../../coverage/apps/applications/
|
|
53
|
+
reportsDirectory: '../../../coverage/apps/applications/administration',
|
|
54
54
|
},
|
|
55
55
|
configurations: {},
|
|
56
56
|
},
|
|
@@ -64,7 +64,9 @@ const projects = {
|
|
|
64
64
|
executor: '@nx/eslint:eslint',
|
|
65
65
|
outputs: ['{options.outputFile}'],
|
|
66
66
|
options: {
|
|
67
|
-
lintFilePatterns: [
|
|
67
|
+
lintFilePatterns: [
|
|
68
|
+
'apps/applications/administration/**/*.{ts,tsx,js,jsx}',
|
|
69
|
+
],
|
|
68
70
|
},
|
|
69
71
|
configurations: {},
|
|
70
72
|
},
|
|
@@ -91,7 +93,7 @@ exports.executorContext = {
|
|
|
91
93
|
version: 2,
|
|
92
94
|
$schema: './node_modules/nx/schemas/nx-schema.json',
|
|
93
95
|
},
|
|
94
|
-
projectName: '
|
|
96
|
+
projectName: 'administration',
|
|
95
97
|
targetName: 'build',
|
|
96
98
|
cwd: '/Users/RHENRI/dev/tops-roma/roma-workbench',
|
|
97
99
|
isVerbose: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor-context.js","sourceRoot":"","sources":["../../../../../plugins/roma/src/executors/executor-context.ts"],"names":[],"mappings":";;;AAEA,MAAM,QAAQ,GAAG;IACf,
|
|
1
|
+
{"version":3,"file":"executor-context.js","sourceRoot":"","sources":["../../../../../plugins/roma/src/executors/executor-context.ts"],"names":[],"mappings":";;;AAEA,MAAM,QAAQ,GAAG;IACf,cAAc,EAAE;QACd,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,kCAAkC;QACxC,OAAO,EAAE,sDAAsD;QAC/D,UAAU,EAAE,sCAAsC;QAClD,WAAW,EAAE,aAAa;QAC1B,OAAO,EAAE;YACP,KAAK,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AAA,eAAe,GAAG;IAC7B,IAAI,EAAE,4CAA4C;IAClD,MAAM,EAAE;QACN,SAAS,EAAE,CAAC,QAAQ,CAAC;QACrB,MAAM,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC;QACrC,QAAQ,EAAE,+BAA+B;QACzC,OAAO,EAAE,EAAE;QACX,cAAc,EAAE,EAAE;KACnB;IACD,sBAAsB,EAAE;QACtB,QAAQ;QACR,OAAO,EAAE,CAAC;KACX;IACD,SAAS,EAAE;QACT,QAAQ;QACR,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,0CAA0C;KACpD;IACD,WAAW,EAAE,gBAAgB;IAC7B,UAAU,EAAE,OAAO;IACnB,GAAG,EAAE,4CAA4C;IACjD,SAAS,EAAE,KAAK;CACE,CAAC"}
|
|
@@ -9,7 +9,7 @@ async function runExecutor(options, context) {
|
|
|
9
9
|
const outputPath = (_a = buildConfig.outputPath) !== null && _a !== void 0 ? _a : `dist/apps/${projectName}`;
|
|
10
10
|
let success = true;
|
|
11
11
|
try {
|
|
12
|
-
await (0, publish_script_1.publishApplication)(
|
|
12
|
+
await (0, publish_script_1.publishApplication)(outputPath, options);
|
|
13
13
|
}
|
|
14
14
|
catch (ex) {
|
|
15
15
|
console.error(`Error when publishing ${projectName}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/executors/publish/executor.ts"],"names":[],"mappings":";;AAEA,qDAAsD;AAOvC,KAAK,UAAU,WAAW,CACvC,OAA8B,EAC9B,OAAwB;;IAExB,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IACxC,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAuB,CAAC;IAC9E,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,KAA2B,CAAC;IAChE,MAAM,UAAU,GAAG,MAAA,WAAW,CAAC,UAAU,mCAAI,aAAa,WAAW,EAAE,CAAC;IACxE,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,IAAI,CAAC;QACH,MAAM,IAAA,mCAAkB,EAAC,
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/executors/publish/executor.ts"],"names":[],"mappings":";;AAEA,qDAAsD;AAOvC,KAAK,UAAU,WAAW,CACvC,OAA8B,EAC9B,OAAwB;;IAExB,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IACxC,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAuB,CAAC;IAC9E,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,KAA2B,CAAC;IAChE,MAAM,UAAU,GAAG,MAAA,WAAW,CAAC,UAAU,mCAAI,aAAa,WAAW,EAAE,CAAC;IACxE,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,IAAI,CAAC;QACH,MAAM,IAAA,mCAAkB,EAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IAAC,OAAO,EAAE,EAAE,CAAC;QACZ,OAAO,CAAC,KAAK,CAAC,yBAAyB,WAAW,EAAE,CAAC,CAAC;QACtD,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAClB,OAAO,GAAG,KAAK,CAAC;IAClB,CAAC;IACD,OAAO;QACL,OAAO;KACR,CAAC;AACJ,CAAC;AAnBD,8BAmBC"}
|
|
@@ -2,8 +2,7 @@ import type { PublishExecutorSchema } from './schema';
|
|
|
2
2
|
/**
|
|
3
3
|
* Publishes the application to the specified environment.
|
|
4
4
|
*
|
|
5
|
-
* @param appName - The name of the application to publish.
|
|
6
5
|
* @param pathToOutput - The path to the output directory.
|
|
7
6
|
* @param options - The options for the publish operation.
|
|
8
7
|
*/
|
|
9
|
-
export declare const publishApplication: (
|
|
8
|
+
export declare const publishApplication: (pathToOutput: string, options: PublishExecutorSchema) => Promise<void>;
|
|
@@ -43,11 +43,10 @@ let token;
|
|
|
43
43
|
/**
|
|
44
44
|
* Publishes the application to the specified environment.
|
|
45
45
|
*
|
|
46
|
-
* @param appName - The name of the application to publish.
|
|
47
46
|
* @param pathToOutput - The path to the output directory.
|
|
48
47
|
* @param options - The options for the publish operation.
|
|
49
48
|
*/
|
|
50
|
-
const publishApplication = async (
|
|
49
|
+
const publishApplication = async (pathToOutput, options) => {
|
|
51
50
|
var _a;
|
|
52
51
|
let env = options.environment;
|
|
53
52
|
// @ts-expect-error Need to rewrite this as nx expects production, not prod.
|
|
@@ -59,6 +58,7 @@ const publishApplication = async (appName, pathToOutput, options) => {
|
|
|
59
58
|
const manifest = await (0, promises_1.readFile)((0, node_path_1.join)(pathToOutput, 'manifest.json'));
|
|
60
59
|
const manifestJsonString = manifest.toString('utf-8');
|
|
61
60
|
const parsedManifest = JSON.parse(manifestJsonString);
|
|
61
|
+
const appName = parsedManifest.key;
|
|
62
62
|
const categories = await getCategories(config);
|
|
63
63
|
const categoryIds = categories.map((c) => c.id);
|
|
64
64
|
if (!categoryIds.includes(parsedManifest.categoryId)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish-script.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/executors/publish/publish-script.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAC5C,yCAAiC;AACjC,8CAAyD;AAGzD,yCAA2C;AAC3C,yCAAsC;AAEtC,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,0BAAc,CAAC,CAAC;AAEzC;;;GAGG;AACH,IAAK,MAGJ;AAHD,WAAK,MAAM;IACT,yCAAO,CAAA;IACP,qCAAK,CAAA;AACP,CAAC,EAHI,MAAM,KAAN,MAAM,QAGV;AAeD;;GAEG;AACH,MAAM,SAAS,GAA2B;IACxC,GAAG,EAAE;QACH,OAAO,EAAE,6BAA6B;QACtC,aAAa,EAAE,IAAI;QACnB,SAAS,EAAE,CAAC,wCAAwC,CAAC;KACtD;IACD,EAAE,EAAE;QACF,OAAO,EAAE,4BAA4B;QACrC,aAAa,EAAE,IAAI;QACnB,SAAS,EAAE,CAAC,wCAAwC,CAAC;KACtD;IACD,UAAU,EAAE;QACV,OAAO,EAAE,0BAA0B;QACnC,aAAa,EAAE,KAAK;QACpB,SAAS,EAAE,CAAC,iCAAiC,CAAC;KAC/C;CACF,CAAC;AAEF;;GAEG;AACH,IAAI,KAAa,CAAC;AAElB
|
|
1
|
+
{"version":3,"file":"publish-script.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/executors/publish/publish-script.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAC5C,yCAAiC;AACjC,8CAAyD;AAGzD,yCAA2C;AAC3C,yCAAsC;AAEtC,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,0BAAc,CAAC,CAAC;AAEzC;;;GAGG;AACH,IAAK,MAGJ;AAHD,WAAK,MAAM;IACT,yCAAO,CAAA;IACP,qCAAK,CAAA;AACP,CAAC,EAHI,MAAM,KAAN,MAAM,QAGV;AAeD;;GAEG;AACH,MAAM,SAAS,GAA2B;IACxC,GAAG,EAAE;QACH,OAAO,EAAE,6BAA6B;QACtC,aAAa,EAAE,IAAI;QACnB,SAAS,EAAE,CAAC,wCAAwC,CAAC;KACtD;IACD,EAAE,EAAE;QACF,OAAO,EAAE,4BAA4B;QACrC,aAAa,EAAE,IAAI;QACnB,SAAS,EAAE,CAAC,wCAAwC,CAAC;KACtD;IACD,UAAU,EAAE;QACV,OAAO,EAAE,0BAA0B;QACnC,aAAa,EAAE,KAAK;QACpB,SAAS,EAAE,CAAC,iCAAiC,CAAC;KAC/C;CACF,CAAC;AAEF;;GAEG;AACH,IAAI,KAAa,CAAC;AAElB;;;;;GAKG;AACI,MAAM,kBAAkB,GAAG,KAAK,EACrC,YAAoB,EACpB,OAA8B,EAC9B,EAAE;;IACF,IAAI,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC;IAC9B,4EAA4E;IAC5E,IAAI,GAAG,KAAK,MAAM;QA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|
|
3
|
-
export default function runExecutor(options: ServeExecutorSchema, context: ExecutorContext): Promise<
|
|
4
|
-
success: boolean;
|
|
5
|
-
}>;
|
|
3
|
+
export default function runExecutor(options: ServeExecutorSchema, context: ExecutorContext): Promise<unknown>;
|
|
@@ -1,56 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const run_commands_impl_1 = tslib_1.__importDefault(require("nx/src/executors/run-commands/run-commands.impl"));
|
|
5
|
-
const path = tslib_1.__importStar(require("path"));
|
|
6
|
-
// This method will be used to resolve the path of our custom dev-portal
|
|
7
|
-
// const depPath = require.resolve('@equinor-roma/framework');
|
|
3
|
+
const server_1 = require("./server");
|
|
8
4
|
async function runExecutor(options, context) {
|
|
9
|
-
|
|
10
|
-
// Get the name and root directory of the project.
|
|
11
|
-
const projectName = context.projectName;
|
|
12
|
-
const project = context.workspace.projects[projectName];
|
|
13
|
-
const cwd = path.resolve(context.root, project.root);
|
|
14
|
-
// Set up extra arguments for the Fusion CLI command.
|
|
15
|
-
const extraFusionArgs = [];
|
|
16
|
-
if (options.portal) {
|
|
17
|
-
extraFusionArgs.push(`--portal=${options.portal}`);
|
|
18
|
-
}
|
|
19
|
-
if (options.devPortal) {
|
|
20
|
-
// If a custom dev-portal is specified, use it.
|
|
21
|
-
const portalPath = path.join(context.root, options.devPortal);
|
|
22
|
-
const relativePath = path.relative(cwd, portalPath);
|
|
23
|
-
extraFusionArgs.push(`--dev-portal ${relativePath}`);
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
// If no custom dev-portal is specified, we use the default one.
|
|
27
|
-
// This is a relative path to the dev-portal (see comment on l#5)
|
|
28
|
-
// const relative = path.relative(projectPath, depPath);
|
|
29
|
-
// Change this to the dependency dev portal location.
|
|
30
|
-
const relative = path.relative(cwd, path.resolve(context.root, 'node_modules/@equinor/roma-framework/dev-portal'));
|
|
31
|
-
extraFusionArgs.push(`--dev-portal ${relative}`);
|
|
32
|
-
}
|
|
33
|
-
const commands = [
|
|
34
|
-
`fusion-framework-cli app dev ${extraFusionArgs.join(' ')} -p ${(_a = options.port) !== null && _a !== void 0 ? _a : 3000}`,
|
|
35
|
-
];
|
|
36
|
-
if (options.proxy) {
|
|
37
|
-
// If the `--proxy` flag is set, run the portal target.
|
|
38
|
-
if (!project.targets.portal) {
|
|
39
|
-
// But not if we dont have a portal-target
|
|
40
|
-
console.error(`\x1b[31m Proxy Error: Target "portal" not defined for project, portal-proxy will not run. \x1b[0m`);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
commands.push(`nx run ${project.name}:portal`);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
const manifestPath = path.relative(cwd, path.resolve(project.root, 'fusion-manifest.json'));
|
|
47
|
-
extraFusionArgs.push(`--manifest ${manifestPath}`);
|
|
48
|
-
return (0, run_commands_impl_1.default)({
|
|
49
|
-
commands,
|
|
50
|
-
parallel: true,
|
|
51
|
-
cwd: cwd,
|
|
52
|
-
__unparsed__: [],
|
|
53
|
-
}, context);
|
|
5
|
+
return (0, server_1.createServer)(options, context);
|
|
54
6
|
}
|
|
55
7
|
exports.default = runExecutor;
|
|
56
8
|
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/executors/serve/executor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/executors/serve/executor.ts"],"names":[],"mappings":";;AAEA,qCAAwC;AAEzB,KAAK,UAAU,WAAW,CACvC,OAA4B,EAC5B,OAAwB;IAExB,OAAO,IAAA,qBAAY,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC;AALD,8BAKC"}
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"type": "string",
|
|
19
19
|
"description": "Path to custom dev-portal (from workspace root) (default: use ROMA dev-portal)"
|
|
20
20
|
},
|
|
21
|
-
"
|
|
21
|
+
"open": {
|
|
22
22
|
"type": "boolean",
|
|
23
|
-
"description": "Whether
|
|
24
|
-
"default":
|
|
23
|
+
"description": "Whether to open the application in your default browser. Default false",
|
|
24
|
+
"default": false
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"required": []
|