Skip to content

Commit b138c47

Browse files
JohnC-80mkukliszburke
authored
STRIPES-861-int - Integration of Module Federation feature. (#392)
With this update, we shift the POC code to conform to current `stripes-cli` API. The `build` commands build to an `output` directory by default. ### At the workspace level with `stripes-core`, `stripes-connect`, `stripes-components`: (assuming that's where the config file is) Build a module-federation host app: ``` yarn stripes build --federate stripes.config.js ``` Serve the host app (dev mode) ``` yarn stripes serve --federate stripes.config.js ``` At the ui-module level (Builds module bundle for static hosting) ``` yarn stripes build --federate ``` Serving the federated ui-module (dev mode) ``` yarn stripes serve --federate ``` Some `server` features have been updated for sake of serving the host app so that it can further be loaded into a separately hosted 'hub'. --------- Co-authored-by: Michal Kuklis <michal.kuklis@gmail.com> Co-authored-by: Zak Burke <zburke@ebsco.com>
1 parent 939eb7c commit b138c47

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
## 4.1.0 IN PROGRESS
44

55
* Populate module descriptor's `name` field with module-name if `description` is missing. Refs STCLI-272.
6+
* Use node-native glob functionality in `translate compile`. Refs STCLI-273.
67
* Populate module descriptor's `metadata` field with remaining `stripes` properties. Refs STCLI-274.
78
* Supply `webpack` `^5.103` to provide `webpack.ManifestPlugin` for STRWEB-144. Refs STCLI-275.
9+
* Expose the `--federate` flag on `build` and `serve` command. Refs STRIPES-861.
10+
* Build static federated ui-bundles, host app. Refs STRIPES-861.
811

912
## [4.0.0](https://github.com/folio-org/stripes-cli/tree/v4.0.0) (2025-02-24)
1013
[Full Changelog](https://github.com/folio-org/stripes-cli/compare/v3.2.0...v4.0.0)

lib/commands/build.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ module.exports = {
9292
implies: 'createDll',
9393
requiresArg: true
9494
})
95+
.option('federate', {
96+
describe: 'Enables module-federation in build process',
97+
type: 'boolean',
98+
default: false
99+
})
95100
.option('skipStripesBuild', {
96101
describe: 'Bypass Stripes-specific steps in build (useful when building third-party Webpack DLLs).',
97102
type: 'boolean',

lib/commands/serve.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ module.exports = {
103103
stripesConfigMiddleware(),
104104
])
105105
.positional('configFile', stripesConfigFile.configFile)
106+
.option('federate', {
107+
describe: 'At platform level, serves an empty host platform, using configured entitlementUrl to procure a list or remote apps. At the module level, this registers/serves the app as a locally federated remote.',
108+
type: 'boolean',
109+
})
106110
.option('existing-build', {
107111
describe: 'Serve an existing build from the supplied directory',
108112
type: 'string',

lib/server.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const path = require('path');
22
const fs = require('fs');
33
const http = require('http');
44
const express = require('express');
5+
const cors = require('cors');
56
const logger = require('morgan');
67
const debug = require('debug');
78

@@ -48,6 +49,8 @@ function onListening(server) {
4849

4950
function start(dir, options) {
5051
const app = express();
52+
app.use(express.json());
53+
app.use(cors());
5154
app.use(express.static(dir, {}));
5255
app.use(logger('tiny'));
5356

0 commit comments

Comments
 (0)