@module-federation/treeshake-server 2.6.0 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/876.mjs +940 -0
  2. package/dist/app.d.ts +1 -1
  3. package/dist/frontend/adapter/index.js +12 -8
  4. package/dist/frontend/index.html +1 -1
  5. package/dist/frontend/static/css/index.513418ff5d.css +1 -0
  6. package/dist/frontend/static/js/637.b47e0403af.js +2 -0
  7. package/dist/frontend/static/js/async/427.dbb8b74259.js +2 -0
  8. package/dist/frontend/static/js/async/503.7bd056737e.js +12 -0
  9. package/dist/frontend/static/js/async/515.1b7f26d7ec.js +2 -0
  10. package/dist/frontend/static/js/index.ace3fa3d0e.js +88 -0
  11. package/dist/frontend/static/js/lib-react.7c43a84261.js +2 -0
  12. package/dist/frontend/static/js/{lib-router.949393cc.js → lib-router.5077a93d5a.js} +3 -3
  13. package/dist/http/routes/build.d.ts +1 -1
  14. package/dist/http/routes/index.d.ts +1 -1
  15. package/dist/http/routes/maintenance.d.ts +1 -1
  16. package/dist/http/routes/static.d.ts +1 -1
  17. package/dist/index.js +29 -27
  18. package/dist/index.mjs +1 -942
  19. package/dist/nodeServer.d.ts +1 -1
  20. package/dist/server.js +23 -21
  21. package/dist/server.mjs +11 -949
  22. package/package.json +5 -5
  23. package/dist/frontend/static/css/index.16175e0f.css +0 -1
  24. package/dist/frontend/static/js/465.8ad65aff.js +0 -2
  25. package/dist/frontend/static/js/async/538.91f59a63.js +0 -12
  26. package/dist/frontend/static/js/async/873.03a2ef6b.js +0 -2
  27. package/dist/frontend/static/js/async/987.89efa6cc.js +0 -2
  28. package/dist/frontend/static/js/index.3cfd4422.js +0 -88
  29. package/dist/frontend/static/js/lib-react.c59642e3.js +0 -2
  30. /package/dist/frontend/static/js/{465.8ad65aff.js.LICENSE.txt → 637.b47e0403af.js.LICENSE.txt} +0 -0
  31. /package/dist/frontend/static/js/async/{538.91f59a63.js.LICENSE.txt → 427.dbb8b74259.js.LICENSE.txt} +0 -0
  32. /package/dist/frontend/static/js/async/{987.89efa6cc.js.LICENSE.txt → 503.7bd056737e.js.LICENSE.txt} +0 -0
  33. /package/dist/frontend/static/js/{lib-react.c59642e3.js.LICENSE.txt → lib-react.7c43a84261.js.LICENSE.txt} +0 -0
  34. /package/dist/frontend/static/js/{lib-router.949393cc.js.LICENSE.txt → lib-router.5077a93d5a.js.LICENSE.txt} +0 -0
@@ -4,4 +4,4 @@ export declare function createServer(opts: {
4
4
  app: Hono<AppEnv>;
5
5
  port?: number;
6
6
  hostname?: string;
7
- }): import("@hono/node-server/.").ServerType;
7
+ }): import("node_modules/@hono/node-server/dist").ServerType;
package/dist/server.js CHANGED
@@ -11,11 +11,15 @@ var __webpack_require__ = {};
11
11
  };
12
12
  })();
13
13
  (()=>{
14
- __webpack_require__.d = (exports1, definition)=>{
15
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
16
- enumerable: true,
17
- get: definition[key]
18
- });
14
+ __webpack_require__.d = (exports1, getters, values)=>{
15
+ var define = (defs, kind)=>{
16
+ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
17
+ enumerable: true,
18
+ [kind]: defs[key]
19
+ });
20
+ };
21
+ define(getters, "get");
22
+ define(values, "value");
19
23
  };
20
24
  })();
21
25
  (()=>{
@@ -31,7 +35,7 @@ const UPLOADED_DIR = '_shared-tree-shaking';
31
35
  const external_pino_namespaceObject = require("pino");
32
36
  var external_pino_default = /*#__PURE__*/ __webpack_require__.n(external_pino_namespaceObject);
33
37
  const createLogger = (opts)=>external_pino_default()({
34
- level: (null == opts ? void 0 : opts.level) ?? 'info',
38
+ level: opts?.level ?? 'info',
35
39
  formatters: {
36
40
  level (label) {
37
41
  return {
@@ -86,9 +90,9 @@ class LocalObjectStore {
86
90
  constructor(opts){
87
91
  _define_property(this, "rootDir", void 0);
88
92
  _define_property(this, "publicBaseUrl", void 0);
89
- this.rootDir = (null == opts ? void 0 : opts.rootDir) ?? external_node_path_default().join(process.cwd(), 'log', 'static');
93
+ this.rootDir = opts?.rootDir ?? external_node_path_default().join(process.cwd(), 'log', 'static');
90
94
  const port = process.env.PORT || 3000;
91
- const base = (null == opts ? void 0 : opts.publicBaseUrl) === '/' ? `http://localhost:${port}/` : (null == opts ? void 0 : opts.publicBaseUrl) ?? '/';
95
+ const base = opts?.publicBaseUrl === '/' ? `http://localhost:${port}/` : opts?.publicBaseUrl ?? '/';
92
96
  this.publicBaseUrl = base.endsWith('/') ? base : `${base}/`;
93
97
  }
94
98
  }
@@ -174,7 +178,7 @@ async function serveLocalFile(c, rootDir) {
174
178
  }
175
179
  function createStaticRoute(opts) {
176
180
  const staticRoute = new external_hono_namespaceObject.Hono();
177
- const rootDir = (null == opts ? void 0 : opts.rootDir) ?? DEFAULT_STATIC_ROOT;
181
+ const rootDir = opts?.rootDir ?? DEFAULT_STATIC_ROOT;
178
182
  staticRoute.get('/tree-shaking-shared/*', async (c)=>serveLocalFile(c, rootDir));
179
183
  return staticRoute;
180
184
  }
@@ -241,7 +245,7 @@ const normalizedKey = (name, v)=>`${name}@${v}`;
241
245
  function normalizeConfig(config) {
242
246
  const { shared, plugins, target, libraryType, hostName, uploadOptions } = config;
243
247
  const commonNormalizedConfig = {
244
- plugins: (null == plugins ? void 0 : plugins.sort(([a], [b])=>a.localeCompare(b))) ?? [],
248
+ plugins: plugins?.sort(([a], [b])=>a.localeCompare(b)) ?? [],
245
249
  target: Array.isArray(target) ? [
246
250
  ...target
247
251
  ].sort() : [
@@ -521,7 +525,6 @@ const retrieveSharedFilepaths = async (projectDir, type)=>{
521
525
  stats.shared.forEach((s)=>{
522
526
  const { name, version, fallback, fallbackName } = s;
523
527
  if (fallback && fallbackName) {
524
- var _s_usedExports;
525
528
  const filepath = external_node_path_default().join(distDir, fallback);
526
529
  sharedFilepaths.push({
527
530
  name,
@@ -530,7 +533,7 @@ const retrieveSharedFilepaths = async (projectDir, type)=>{
530
533
  globalName: fallbackName,
531
534
  type: t,
532
535
  modules: s.usedExports,
533
- canTreeShaking: s.canTreeShaking ?? (null == (_s_usedExports = s.usedExports) ? void 0 : _s_usedExports.length) !== 0
536
+ canTreeShaking: s.canTreeShaking ?? s.usedExports?.length !== 0
534
537
  });
535
538
  }
536
539
  });
@@ -953,12 +956,11 @@ routes.route('/build', buildRoute);
953
956
  routes.route('/clean-cache', maintenanceRoute);
954
957
  const timeout_namespaceObject = require("hono/timeout");
955
958
  function createApp(deps, opts) {
956
- var _opts_appExtensions, _opts_frontendAdapters;
957
- if (null == opts ? void 0 : opts.logger) setLogger(opts.logger);
958
- setRuntimeEnv((null == opts ? void 0 : opts.runtimeEnv) ?? process.env);
959
+ if (opts?.logger) setLogger(opts.logger);
960
+ setRuntimeEnv(opts?.runtimeEnv ?? process.env);
959
961
  const app = new external_hono_namespaceObject.Hono();
960
- const corsOrigin = (null == opts ? void 0 : opts.corsOrigin) ?? '*';
961
- const staticRootDir = (null == opts ? void 0 : opts.staticRootDir) ?? DEFAULT_STATIC_ROOT;
962
+ const corsOrigin = opts?.corsOrigin ?? '*';
963
+ const staticRootDir = opts?.staticRootDir ?? DEFAULT_STATIC_ROOT;
962
964
  app.use('*', (0, cors_namespaceObject.cors)({
963
965
  origin: corsOrigin,
964
966
  allowMethods: [
@@ -974,7 +976,7 @@ function createApp(deps, opts) {
974
976
  app.use('*', loggerMiddleware);
975
977
  app.use('*', createDiMiddleware(deps));
976
978
  app.use('*', (0, timeout_namespaceObject.timeout)(60000));
977
- if (null == opts ? void 0 : null == (_opts_appExtensions = opts.appExtensions) ? void 0 : _opts_appExtensions.length) for (const extend of opts.appExtensions)extend(app);
979
+ if (opts?.appExtensions?.length) for (const extend of opts.appExtensions)extend(app);
978
980
  app.get('/tree-shaking-shared/healthz', (c)=>c.json({
979
981
  status: 'ok',
980
982
  timestamp: new Date().toISOString()
@@ -983,8 +985,8 @@ function createApp(deps, opts) {
983
985
  app.route('/', createStaticRoute({
984
986
  rootDir: staticRootDir
985
987
  }));
986
- if (null == opts ? void 0 : null == (_opts_frontendAdapters = opts.frontendAdapters) ? void 0 : _opts_frontendAdapters.length) for (const adapter of opts.frontendAdapters)adapter.register(app);
987
- startPeriodicPrune(null == opts ? void 0 : opts.pruneIntervalMs);
988
+ if (opts?.frontendAdapters?.length) for (const adapter of opts.frontendAdapters)adapter.register(app);
989
+ startPeriodicPrune(opts?.pruneIntervalMs);
988
990
  return app;
989
991
  }
990
992
  const defaultBasePath = '/tree-shaking';
@@ -1136,7 +1138,7 @@ main().catch((err)=>{
1136
1138
  console.error(err);
1137
1139
  process.exit(1);
1138
1140
  });
1139
- for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
1141
+ for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
1140
1142
  Object.defineProperty(exports, '__esModule', {
1141
1143
  value: true
1142
1144
  });