@equinor/roma-nx-plugin 0.0.20 → 0.0.22

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.
Files changed (67) hide show
  1. package/executors.json +0 -5
  2. package/migrations.json +32 -5
  3. package/package.json +17 -7
  4. package/src/executors/build/build.d.ts +4 -0
  5. package/src/executors/build/build.js +63 -0
  6. package/src/executors/build/build.js.map +1 -0
  7. package/src/executors/build/executor.js +2 -71
  8. package/src/executors/build/executor.js.map +1 -1
  9. package/src/executors/build/minify.d.ts +2 -0
  10. package/src/executors/build/minify.js +23 -0
  11. package/src/executors/build/minify.js.map +1 -0
  12. package/src/executors/build/schema.d.ts +1 -1
  13. package/src/executors/create-vite-config.d.ts +3 -0
  14. package/src/executors/create-vite-config.js +73 -0
  15. package/src/executors/create-vite-config.js.map +1 -0
  16. package/src/executors/executor-context.js +11 -9
  17. package/src/executors/executor-context.js.map +1 -1
  18. package/src/executors/publish/environment.d.ts +1 -0
  19. package/src/executors/publish/executor.js +1 -1
  20. package/src/executors/publish/executor.js.map +1 -1
  21. package/src/executors/publish/manifest-model.d.ts +2 -2
  22. package/src/executors/publish/publish-script.d.ts +1 -2
  23. package/src/executors/publish/publish-script.js +3 -3
  24. package/src/executors/publish/publish-script.js.map +1 -1
  25. package/src/executors/publish/schema.d.ts +1 -1
  26. package/src/executors/serve/executor.d.ts +1 -3
  27. package/src/executors/serve/executor.js +2 -50
  28. package/src/executors/serve/executor.js.map +1 -1
  29. package/src/executors/serve/schema.d.ts +3 -3
  30. package/src/executors/serve/schema.json +3 -3
  31. package/src/executors/serve/server.d.ts +3 -0
  32. package/src/executors/serve/server.js +162 -0
  33. package/src/executors/serve/server.js.map +1 -0
  34. package/src/executors/utils/get-vite-config.d.ts +1 -0
  35. package/src/executors/utils/get-vite-config.js +14 -0
  36. package/src/executors/utils/get-vite-config.js.map +1 -0
  37. package/src/executors/utils/logger.d.ts +24 -0
  38. package/src/executors/utils/logger.js +69 -0
  39. package/src/executors/utils/logger.js.map +1 -0
  40. package/src/generators/app/files/.eslintrc.json +130 -0
  41. package/src/generators/app/files/fusion-manifest.json.template +1 -1
  42. package/src/generators/app/files/src/App.tsx.template +10 -13
  43. package/src/generators/app/files/src/config.ts.template +8 -11
  44. package/src/generators/app/files/src/index.ts.template +19 -15
  45. package/src/generators/app/files/vite.config.d.ts +2 -0
  46. package/src/generators/app/files/vite.config.js +12 -15
  47. package/src/generators/app/files/vite.config.js.map +1 -0
  48. package/src/generators/app/generator.js +46 -60
  49. package/src/generators/app/generator.js.map +1 -1
  50. package/src/generators/app/schema.d.ts +2 -2
  51. package/src/generators/preset/generator.js +1 -24
  52. package/src/generators/preset/generator.js.map +1 -1
  53. package/src/generators/preset/schema.d.ts +2 -2
  54. package/src/migrations/remove-fusion-cli/remove-fusion-cli.d.ts +2 -0
  55. package/src/migrations/remove-fusion-cli/remove-fusion-cli.js +45 -0
  56. package/src/migrations/remove-fusion-cli/remove-fusion-cli.js.map +1 -0
  57. package/src/executors/portal/executor.d.ts +0 -5
  58. package/src/executors/portal/executor.js +0 -16
  59. package/src/executors/portal/executor.js.map +0 -1
  60. package/src/executors/portal/proxy.d.ts +0 -19
  61. package/src/executors/portal/proxy.js +0 -179
  62. package/src/executors/portal/proxy.js.map +0 -1
  63. package/src/executors/portal/schema.d.ts +0 -10
  64. package/src/executors/portal/schema.json +0 -36
  65. package/src/migrations/add-portal-proxy-target/add-portal-proxy-target.d.ts +0 -2
  66. package/src/migrations/add-portal-proxy-target/add-portal-proxy-target.js +0 -23
  67. package/src/migrations/add-portal-proxy-target/add-portal-proxy-target.js.map +0 -1
@@ -1,22 +1,23 @@
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 = tslib_1.__importStar(require("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) {
10
- let dependencies = {
11
- '@equinor/roma-framework': '^0.0.7',
12
- '@equinor/fusion-framework': '^7.0.19',
13
- '@equinor/fusion-framework-module-app': '^5.2.4',
14
- '@equinor/eds-core-react': '^0.35.1',
9
+ const dependencies = {
10
+ '@equinor/roma-framework': '^0.0.10',
11
+ '@equinor/fusion-framework': '7.0.30',
12
+ '@equinor/fusion-framework-module-app': '5.2.13',
13
+ '@equinor/eds-core-react': '^0.36.0',
14
+ '@equinor/eds-data-grid-react': '^0.4.0',
15
15
  '@equinor/eds-icons': '^0.20.0',
16
16
  '@equinor/eds-tokens': '^0.9.2',
17
- '@equinor/fusion-framework-react': '^5.2.3',
18
- '@equinor/fusion-framework-react-app': '^4.1.2',
19
- '@equinor/fusion-framework-react-module': '^3.0.5',
17
+ '@equinor/fusion-framework-react': '6.0.2',
18
+ '@equinor/fusion-framework-react-app': '4.3.3',
19
+ '@equinor/fusion-framework-react-module': '3.0.8',
20
+ '@equinor/fusion-framework-module-navigation': '3.1.4',
20
21
  'styled-components': '^6.0.8',
21
22
  };
22
23
  options.fusionModules
@@ -24,69 +25,60 @@ async function addDependencies(tree, options) {
24
25
  .forEach((module) => {
25
26
  dependencies[`@equinor/${module}`] = modules_1.modules[module];
26
27
  });
27
- if (options.routing) {
28
- dependencies = Object.assign(Object.assign({}, dependencies), { '@equinor/fusion-framework-module-navigation': '^3.0.3' });
29
- }
30
- const devDependencies = {
31
- '@equinor/fusion-framework-cli': '^9.1.1',
32
- 'vite-tsconfig-paths': '^4.2.0',
33
- };
28
+ const devDependencies = {};
34
29
  return (0, devkit_1.runTasksInSerial)(...[
35
30
  (0, devkit_1.removeDependenciesFromPackageJson)(tree, Object.keys(dependencies), Object.keys(devDependencies)),
36
31
  (0, devkit_1.addDependenciesToPackageJson)(tree, dependencies, devDependencies),
37
32
  ]);
38
33
  }
39
- function updateTargets(tree, projectRoot, options) {
40
- (0, devkit_1.updateJson)(tree, `${projectRoot.replace('\\', '/')}/project.json`, (json) => {
41
- var _a;
42
- json.targets.build = {
43
- executor: '@equinor/roma-nx-plugin:build',
44
- options: {},
45
- };
46
- json.targets.serve = {
47
- executor: '@equinor/roma-nx-plugin:serve',
48
- options: {
49
- port: (_a = options.devServerPort) !== null && _a !== void 0 ? _a : 3000,
34
+ function updateTargets(tree, options) {
35
+ var _a;
36
+ const existing = (0, devkit_1.readProjectConfiguration)(tree, options.name);
37
+ (0, devkit_1.updateProjectConfiguration)(tree, options.name, Object.assign(Object.assign({}, existing), { targets: {
38
+ build: {
39
+ executor: '@equinor/roma-nx-plugin:build',
40
+ options: {},
50
41
  },
51
- };
52
- json.targets.portal = {
53
- executor: '@equinor/roma-nx-plugin:portal',
54
- options: {},
55
- };
56
- json.targets.publish = {
57
- executor: '@equinor/roma-nx-plugin:publish',
58
- configurations: {
59
- production: {
60
- environment: 'production',
61
- },
62
- qa: {
63
- environment: 'qa',
42
+ serve: {
43
+ executor: '@equinor/roma-nx-plugin:serve',
44
+ options: {
45
+ port: (_a = options.devServerPort) !== null && _a !== void 0 ? _a : 3000,
64
46
  },
65
- dev: {
66
- environment: 'dev',
47
+ },
48
+ portal: {
49
+ executor: '@equinor/roma-nx-plugin:portal',
50
+ options: {},
51
+ },
52
+ publish: {
53
+ executor: '@equinor/roma-nx-plugin:publish',
54
+ configurations: {
55
+ production: {
56
+ environment: 'production',
57
+ },
58
+ qa: {
59
+ environment: 'qa',
60
+ },
61
+ dev: {
62
+ environment: 'dev',
63
+ },
67
64
  },
65
+ defaultConfiguration: 'dev',
68
66
  },
69
- defaultConfiguration: 'dev',
70
- };
71
- delete json.targets.preview;
72
- return json;
73
- });
67
+ } }));
74
68
  }
75
69
  async function appGenerator(tree, options) {
76
70
  var _a;
77
71
  const config = (0, devkit_1.getWorkspaceLayout)(tree);
78
- let appPath = '/';
79
- if (config.appsDir) {
72
+ let appPath = './';
73
+ if (config.appsDir && options.projectNameAndRootFormat !== 'as-provided') {
80
74
  appPath = config.appsDir;
81
75
  }
82
76
  if (options.directory) {
83
77
  appPath = path.join(appPath, options.directory);
84
78
  }
85
79
  const projectRoot = path.join(appPath, options.name);
86
- // Windows has some issues with resolving paths in the tree-structure, so adding a fallback for it.
87
- const directory = `${appPath}/${options.name}`;
88
- await (0, react_1.applicationGenerator)(tree, Object.assign(Object.assign({}, options), { directory, tags: [(_a = options.tags) !== null && _a !== void 0 ? _a : '', 'roma-application'].join(','), rootProject: false, bundler: 'vite' }));
89
- updateTargets(tree, projectRoot, options);
80
+ await (0, react_1.applicationGenerator)(tree, Object.assign(Object.assign({}, options), { tags: [(_a = options.tags) !== null && _a !== void 0 ? _a : '', 'roma-application'].join(','), rootProject: false, bundler: 'vite' }));
81
+ updateTargets(tree, options);
90
82
  (0, devkit_1.generateFiles)(tree, path.join(__dirname, 'files'), projectRoot, options);
91
83
  await addDependencies(tree, options);
92
84
  await (0, devkit_1.formatFiles)(tree);
@@ -97,12 +89,6 @@ async function appGenerator(tree, options) {
97
89
  tree.delete(`${projectRoot}/index.html`);
98
90
  tree.delete(`${projectRoot}/public`);
99
91
  tree.delete(`${projectRoot}/vite.config.ts`);
100
- // if (options.linter && isEslintConfigSupported(tree)) {
101
- // Create eslint config project and extend as below:
102
- // Package must be published as @equinor/eslint-config-roma
103
- // See: https://eslint.org/docs/latest/extend/shareable-configs
104
- // addExtendsToLintConfig(tree, options.appProjectRoot, '@equinor/roma');
105
- // }
106
92
  if (options.skipPackageJson) {
107
93
  return () => true;
108
94
  }
@@ -1 +1 @@
1
- {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/generators/app/generator.ts"],"names":[],"mappings":";;;;AAAA,uCAWoB;AACpB,mDAA6B;AAE7B,qCAAiD;AAEjD,4CAAyC;AAEzC,KAAK,UAAU,eAAe,CAC5B,IAAU,EACV,OAA2E;IAE3E,IAAI,YAAY,GAA2B;QACzC,yBAAyB,EAAE,QAAQ;QACnC,2BAA2B,EAAE,SAAS;QACtC,sCA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,kBAAe,YAAY,CAAC"}
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,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACtC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QAClB,YAAY,CAAC,YAAY,MAAM,EAAE,CAAC,GAAG,iBAAO,CAAC,MAAM,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IACL,MAAM,eAAe,GAAG,EAAE,CAAC;IAC3B,OAAO,IAAA,yBAAgB,EACrB,GAAG;QACD,IAAA,0CAAiC,EAC/B,IAAI,EACJ,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EACzB,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAC7B;QACD,IAAA,qCAA4B,EAAC,IAAI,EAAE,YAAY,EAAE,eAAe,CAAC;KAClE,CACF,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CACpB,IAAU,EACV,OAA+D;;IAE/D,MAAM,QAAQ,GAAG,IAAA,iCAAwB,EAAC,IAAI,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,IAAI,kCAC1B,OAAO,KACV,IAAI,EAAE,CAAC,MAAA,OAAO,CAAC,IAAI,mCAAI,EAAE,EAAE,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EACxD,WAAW,EAAE,KAAK,EAClB,OAAO,EAAE,MAAM,IACf,CAAC;IACH,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC7B,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IACzE,MAAM,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACrC,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IACxB,IAAI,CAAC,MAAM,CAAC,GAAG,WAAW,UAAU,CAAC,CAAC;IACtC,IAAI,CAAC,MAAM,CAAC,GAAG,WAAW,aAAa,CAAC,CAAC;IACzC,IAAI,CAAC,MAAM,CAAC,GAAG,WAAW,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,6 +1,6 @@
1
1
  import { NormalizedSchema } from '@nx/react/src/generators/application/schema';
2
2
 
3
- export interface AppGeneratorSchema extends Omit<NormalizedSchema, 'bundler'> {
3
+ export type AppGeneratorSchema = {
4
4
  name: string;
5
5
  fusionModules: Array<string>;
6
- }
6
+ } & Omit<NormalizedSchema, 'bundler'>;
@@ -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(() => __importStar(require('../app/generator'))).then(({ appGenerator }) => appGenerator(tree, Object.assign({}, options)));
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":";;;;;;;;;;;;;;;;;;;;;;;;;;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,kDAAO,kBAAkB,IAAE,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"}
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"}
@@ -1,8 +1,8 @@
1
1
  import { AppGeneratorSchema } from '../app/schema';
2
2
 
3
- export interface PresetGeneratorSchema extends AppGeneratorSchema {
3
+ export type PresetGeneratorSchema = {
4
4
  name: string;
5
5
  appName?: string;
6
6
  tags?: string;
7
7
  directory?: string;
8
- }
8
+ } & AppGeneratorSchema;
@@ -0,0 +1,2 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export default function update(tree: Tree): () => Promise<[void, void]>;
@@ -0,0 +1,45 @@
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
+ 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
+ const add = (0, devkit_1.addDependenciesToPackageJson)(tree, {
10
+ vite: '5.2.7',
11
+ }, {});
12
+ for (const [name, project] of projects) {
13
+ if (project.projectType !== 'application')
14
+ continue;
15
+ if ('portal' in project.targets) {
16
+ delete project.targets.portal;
17
+ }
18
+ if ('serve' in project.targets) {
19
+ const target = project.targets.serve;
20
+ if ((_a = target.options.portal) === null || _a === void 0 ? void 0 : _a.includes('localhost')) {
21
+ delete target.options.portal;
22
+ project.targets.serve = target;
23
+ }
24
+ }
25
+ if (tree.exists(`${project.root}/vite.config.js`)) {
26
+ tree.delete(`${project.root}/vite.config.js`);
27
+ }
28
+ tree.write(`${project.root}/vite.config.ts`, `import { defineConfig } from 'vite';
29
+
30
+ export default defineConfig({
31
+ build: {
32
+ lib: {
33
+ entry: 'src/index.ts',
34
+ fileName: 'app-bundle',
35
+ formats: ['es'],
36
+ },
37
+ },
38
+ });
39
+ `);
40
+ (0, devkit_1.updateProjectConfiguration)(tree, name, project);
41
+ }
42
+ return () => Promise.all([remove(), add()]);
43
+ }
44
+ exports.default = update;
45
+ //# 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;AAUpB,SAAwB,MAAM,CAAC,IAAU;;IACvC,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;IACF,MAAM,GAAG,GAAG,IAAA,qCAA4B,EACtC,IAAI,EACJ;QACE,IAAI,EAAE,OAAO;KACd,EACD,EAAE,CACH,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,CAAC,KAAK,CACR,GAAG,OAAO,CAAC,IAAI,iBAAiB,EAChC;;;;;;;;;;;CAWL,CACI,CAAC;QACF,IAAA,mCAA0B,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IAED,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;AAC9C,CAAC;AAjDD,yBAiDC"}
@@ -1,5 +0,0 @@
1
- import { PortalExecutorSchema } from './schema';
2
- import { ExecutorContext } from '@nx/devkit';
3
- export default function runExecutor(options: PortalExecutorSchema, context: ExecutorContext): Promise<{
4
- success: boolean;
5
- }>;
@@ -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, context) {
5
- return new Promise((resolve, reject) => {
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":";;AAEA,mCAAsC;AAEvB,KAAK,UAAU,WAAW,CACvC,OAA6B,EAC7B,OAAwB;IAExB,OAAO,IAAI,OAAO,CAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3D,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;AAjBD,8BAiBC"}
@@ -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
- };
@@ -1,179 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.proxyServer = void 0;
4
- const http_proxy_1 = require("http-proxy");
5
- const http_1 = require("http");
6
- /**
7
- * Function that sets up cors-handling locally, to ensure the proxy works as expected on any / all endpoints.
8
- * @param req
9
- * @param res
10
- */
11
- const enableCors = (req, res) => {
12
- var _a;
13
- res.setHeader('access-control-allow-origin', (_a = req.headers.origin) !== null && _a !== void 0 ? _a : 'http://localhost:3001');
14
- if (req.headers['access-control-request-method']) {
15
- res.setHeader('access-control-allow-methods', req.headers['access-control-request-method']);
16
- }
17
- if (req.headers['access-control-request-headers']) {
18
- res.setHeader('access-control-allow-headers', req.headers['access-control-request-headers']);
19
- }
20
- else {
21
- res.setHeader('access-control-allow-headers', 'Last-Event-Id');
22
- }
23
- res.setHeader('Access-Control-Expose-Headers', 'Content-Disposition');
24
- if (req.headers.origin) {
25
- res.setHeader('access-control-allow-credentials', 'true');
26
- }
27
- };
28
- /**
29
- * This is a TypeScript function that creates a proxy server to forward HTTP requests to another server.
30
- * @param port The port number on which the proxy server should listen for incoming requests.
31
- * @param target The URL of the target server to which the HTTP requests should be forwarded.
32
- * @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.
33
- *
34
- * @returns Object
35
- * server: An instance of the Node.js http.Server class that represents the proxy server.
36
- * proxy: An instance of the http-proxy library that is used to forward the HTTP requests to the target server.
37
- */
38
- const proxyServer = (port, target, additionalTarget) => {
39
- const asUri = new URL(target);
40
- /**
41
- * creates a new instance of createProxyServer() method from the http-proxy module, passing in an object with various configuration options.
42
- */
43
- const proxy = (0, http_proxy_1.createProxyServer)({
44
- target,
45
- secure: false,
46
- changeOrigin: true,
47
- hostRewrite: asUri.origin,
48
- proxyTimeout: 600000, // 10 minutes
49
- followRedirects: true,
50
- headers: {
51
- 'Sec-Fetch-Site': 'same-origin',
52
- // Accept: 'application/json',
53
- },
54
- });
55
- /**
56
- * This sets up an event listener for the proxyReq event, which is emitted when a request is received by the proxy server.
57
- * It logs the request details to the console, removes the origin header from the request, removes the origin header from the response, and enables CORS.
58
- */
59
- proxy.on('proxyReq', function (proxyReq, req, res) {
60
- console.log(
61
- // @ts-ignore
62
- `[REQ]: Proxy ${req.method} ${req.url} to ${proxyReq._currentUrl}`);
63
- proxyReq.removeHeader('origin');
64
- res.removeHeader('origin');
65
- enableCors(req, res);
66
- });
67
- /**
68
- * This sets up an event listener for the proxyRes event, which is emitted when a response is received by the proxy server.
69
- * It logs the response details to the console, enables CORS, and checks if the request URL matches /_discovery/environments/current.
70
- * If it does, it reads the response body, replaces the target server URL with http://localhost:${port}, and sends the modified response to the original requester.
71
- */
72
- proxy.on('proxyRes', function (proxyRes, req, res) {
73
- console.log(`[RES] Response from ${req.url}`);
74
- enableCors(req, res);
75
- if (proxyRes.statusCode >= 400) {
76
- console.log(req.rawHeaders);
77
- console.error(proxyRes.rawHeaders);
78
- console.error(proxyRes.statusMessage);
79
- }
80
- if (req.url === '/_discovery/environments/current') {
81
- const body = [];
82
- proxyRes.on('data', function (chunk) {
83
- body.push(chunk);
84
- });
85
- proxyRes.on('end', function () {
86
- const bodyStr = Buffer.concat(body).toString();
87
- const environment = JSON.parse(bodyStr);
88
- environment.services.forEach((s) => {
89
- if (s.uri.includes(target)) {
90
- s.uri = s.uri.replace(target, `http://localhost:${port}`);
91
- }
92
- });
93
- res.end(JSON.stringify(environment));
94
- });
95
- }
96
- });
97
- proxy.on('open', () => {
98
- console.log(`Proxy opened to ${target}`);
99
- });
100
- /**
101
- * creates a new HTTP server instance using createServer() method from the http module, which listens for incoming requests and forwards them to the proxy server using proxy.web() method.
102
- * It also sets up some default headers for CORS and checks if the incoming request method is OPTIONS.
103
- * If it is, it sends a 204 response with the CORS headers and ends the response.
104
- */
105
- const server = (0, http_1.createServer)((req, res) => {
106
- var _a;
107
- const headers = {
108
- 'Access-Control-Allow-Origin': (_a = req.headers.origin) !== null && _a !== void 0 ? _a : '*',
109
- 'Access-Control-Allow-Methods': 'OPTIONS, POST, GET, PUT, DELETE',
110
- 'Access-Control-Max-Age': 2592000, // 30 days,
111
- 'Access-Control-Allow-Headers': 'authorization,content-type,last-event-id',
112
- };
113
- if (req.method === 'OPTIONS') {
114
- res.writeHead(204, headers);
115
- res.end();
116
- return;
117
- }
118
- /**
119
- * checks if the incoming request URL matches /_discovery/environments/current.
120
- * If it does, it logs a message to the console, and forwards the request to the proxy server with the target and selfHandleResponse options set.
121
- */
122
- if (req.url === '/_discovery/environments/current') {
123
- console.log(`[REWRITE] Rewriting all ROMA apis to use localhost:${port} as portal-url`);
124
- proxy.web(req, res, {
125
- target,
126
- selfHandleResponse: true,
127
- });
128
- return;
129
- }
130
- /**
131
- * Check if the incoming request method is GET, POST, PUT, or DELETE.
132
- * If it is, it checks if there are any additional configuration options for the incoming request URL.
133
- * If there are, it reads the configuration options, replaces any environment variables in the headers, and removes the target path if necessary.
134
- * It then forwards the request to the proxy server with the configuration options.
135
- * If there are no additional configuration options, it forwards the request to the proxy server with the default target option.
136
- */
137
- if (['GET', 'POST', 'PUT', 'DELETE'].indexOf(req.method) > -1) {
138
- let targetKeys = Object.keys(additionalTarget !== null && additionalTarget !== void 0 ? additionalTarget : {});
139
- const manualConfig = targetKeys.find((v) => req.url.startsWith(v));
140
- if (manualConfig) {
141
- const config = additionalTarget[manualConfig];
142
- if (config.headers) {
143
- Object.keys(config.headers).forEach((key) => {
144
- if (process.env[config.headers[key]]) {
145
- console.log(`Replacing ${key} in headers with env variable`);
146
- config.headers[key] = process.env[config.headers[key]];
147
- }
148
- });
149
- }
150
- if (config.ignoreTargetPath && typeof config.target === 'string') {
151
- req.url = req.url.replace(manualConfig, '');
152
- }
153
- proxy.web(req, res, config);
154
- }
155
- else {
156
- proxy.web(req, res, {
157
- target,
158
- });
159
- }
160
- return;
161
- }
162
- /**
163
- * If no match above, we return a 405 Method not allowed error.
164
- */
165
- res.writeHead(405, headers);
166
- res.end(`${req.method} is not allowed for the request.`);
167
- });
168
- /**
169
- * @return an object with two properties:
170
- * server, which is the HTTP server instance created by createServer() method.
171
- * proxy, which is the HTTP proxy instance created by createProxyServer() method.
172
- */
173
- return {
174
- server,
175
- proxy,
176
- };
177
- };
178
- exports.proxyServer = proxyServer;
179
- //# sourceMappingURL=proxy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proxy.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/executors/portal/proxy.ts"],"names":[],"mappings":";;;AAAA,2CAA8D;AAE9D,+BAAqE;AAErE;;;;GAIG;AACH,MAAM,UAAU,GAAG,CACjB,GAAoB,EACpB,GAAoC,EACpC,EAAE;;IACF,GAAG,CAAC,SAAS,CACX,6BAA6B,EAC7B,MAAA,GAAG,CAAC,OAAO,CAAC,MAAM,mCAAI,uBAAuB,CAC9C,CAAC;IAEF,IAAI,GAAG,CAAC,OAAO,CAAC,+BAA+B,CAAC,EAAE,CAAC;QACjD,GAAG,CAAC,SAAS,CACX,8BAA8B,EAC9B,GAAG,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAC7C,CAAC;IACJ,CAAC;IAED,IAAI,GAAG,CAAC,OAAO,CAAC,gCAAgC,CAAC,EAAE,CAAC;QAClD,GAAG,CAAC,SAAS,CACX,8BAA8B,EAC9B,GAAG,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAC9C,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,SAAS,CAAC,8BAA8B,EAAE,eAAe,CAAC,CAAC;IACjE,CAAC;IACD,GAAG,CAAC,SAAS,CAAC,+BAA+B,EAAE,qBAAqB,CAAC,CAAC;IAEtE,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACvB,GAAG,CAAC,SAAS,CAAC,kCAAkC,EAAE,MAAM,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACI,MAAM,WAAW,GAAG,CACzB,IAAY,EACZ,MAAc,EACd,gBAGC,EACD,EAAE;IACF,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;IAE9B;;OAEG;IACH,MAAM,KAAK,GAAG,IAAA,8BAAiB,EAA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AC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;wBACzD,CAAC;oBACH,CAAC,CAAC,CAAC;gBACL,CAAC;gBACD,IAAI,MAAM,CAAC,gBAAgB,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;oBACjE,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;gBAC9C,CAAC;gBACD,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;YAC9B,CAAC;iBAAM,CAAC;gBACN,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE;oBAClB,MAAM;iBACP,CAAC,CAAC;YACL,CAAC;YACD,OAAO;QACT,CAAC;QAED;;WAEG;QACH,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC5B,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,kCAAkC,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH;;;;OAIG;IACH,OAAO;QACL,MAAM;QACN,KAAK;KACN,CAAC;AACJ,CAAC,CAAC;AA9JW,QAAA,WAAW,eA8JtB"}
@@ -1,10 +0,0 @@
1
- import { ServerOptions } from 'http-proxy';
2
-
3
- export interface PortalExecutorSchema {
4
- portal: string;
5
- port: number;
6
- additionalProxyTargets?: Record<
7
- string,
8
- ServerOptions & { ignoreTargetPath?: boolean }
9
- >;
10
- }
@@ -1,36 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/schema",
3
- "version": 2,
4
- "title": "Portal executor",
5
- "description": "",
6
- "type": "object",
7
- "properties": {
8
- "portal": {
9
- "type": "string",
10
- "description": "Portal host",
11
- "default": "https://romadev.equinor.com"
12
- },
13
- "port": {
14
- "type": "number",
15
- "description": "Proxy port (default 9000)",
16
- "default": 9000
17
- },
18
- "additionalProxyTargets": {
19
- "type": "object",
20
- "description": "Additional proxy targets",
21
- "properties": {
22
- "*": {
23
- "type": "object",
24
- "properties": {
25
- "target": "string",
26
- "headers": {
27
- "type": "object",
28
- "description": "Headers can read environment variables added to .env files"
29
- }
30
- }
31
- }
32
- }
33
- }
34
- },
35
- "required": []
36
- }
@@ -1,2 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export default function update(tree: Tree): Promise<void>;
@@ -1,23 +0,0 @@
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
- for (const [name, project] of projects) {
9
- if (project.projectType !== 'application')
10
- continue;
11
- if (!((_a = project.targets) === null || _a === void 0 ? void 0 : _a.portal)) {
12
- project.targets.portal = {
13
- executor: '@equinor/roma-nx-plugin:portal',
14
- options: {
15
- additionalProxyTargets: {},
16
- },
17
- };
18
- (0, devkit_1.updateProjectConfiguration)(tree, name, project);
19
- }
20
- }
21
- }
22
- exports.default = update;
23
- //# sourceMappingURL=add-portal-proxy-target.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-portal-proxy-target.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/migrations/add-portal-proxy-target/add-portal-proxy-target.ts"],"names":[],"mappings":";;AAAA,sDAAsD;AACtD,uCAA2E;AAE5D,KAAK,UAAU,MAAM,CAAC,IAAU;;IAC7C,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAEnC,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,QAAQ,EAAE,CAAC;QACvC,IAAI,OAAO,CAAC,WAAW,KAAK,aAAa;YAAE,SAAS;QACpD,IAAI,CAAC,CAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,MAAM,CAAA,EAAE,CAAC;YAC7B,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG;gBACvB,QAAQ,EAAE,gCAAgC;gBAC1C,OAAO,EAAE;oBACP,sBAAsB,EAAE,EAAE;iBAC3B;aACF,CAAC;YACF,IAAA,mCAA0B,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;AACH,CAAC;AAfD,yBAeC"}