@bleedingdev/modern-js-runtime-extensions 3.9.3-ultramodern.1 → 3.9.3-ultramodern.2

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.
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.r = (exports1)=>{
5
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
6
+ value: 'Module'
7
+ });
8
+ Object.defineProperty(exports1, '__esModule', {
9
+ value: true
10
+ });
11
+ };
12
+ })();
13
+ var __webpack_exports__ = {};
14
+ __webpack_require__.r(__webpack_exports__);
15
+ for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
16
+ Object.defineProperty(exports, '__esModule', {
17
+ value: true
18
+ });
File without changes
@@ -0,0 +1 @@
1
+ import "node:module";
@@ -1,2 +1,3 @@
1
1
  export type * from './bffRuntime.js';
2
+ export type * from './serverSource.js';
2
3
  export type * from './serverTelemetry.js';
@@ -0,0 +1,16 @@
1
+ /** Context passed to function items of a server `source.globalVars` chain. */
2
+ export interface ServerGlobalVarsContext {
3
+ env: string;
4
+ target: 'web' | 'node' | 'web-worker';
5
+ }
6
+ export type ServerGlobalVars = Record<string, unknown>;
7
+ type ServerGlobalVarsChainItem = ServerGlobalVars | ((config: ServerGlobalVars, context: ServerGlobalVarsContext) => ServerGlobalVars | void);
8
+ /** Source options that server code reads from the application config. */
9
+ export interface ServerSourceConfigExtension {
10
+ /**
11
+ * Compile-time constants replaced in server code, such as BFF handlers.
12
+ * Server code resolves the chain with `{ env: 'server', target: 'node' }`.
13
+ */
14
+ globalVars?: ServerGlobalVarsChainItem | ServerGlobalVarsChainItem[];
15
+ }
16
+ export {};
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "directory": "packages/runtime/runtime-extensions"
12
12
  },
13
13
  "license": "MIT",
14
- "version": "3.9.3-ultramodern.1",
14
+ "version": "3.9.3-ultramodern.2",
15
15
  "engines": {
16
16
  "node": ">=26.10.0"
17
17
  },
@@ -262,7 +262,7 @@
262
262
  },
263
263
  "devDependencies": {
264
264
  "@loadable/component": "5.16.7",
265
- "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.3-ultramodern.1",
265
+ "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.3-ultramodern.2",
266
266
  "@rsbuild/core": "2.2.11",
267
267
  "@rslib/core": "1.0.3",
268
268
  "@scripts/rstest-config": "2.66.0",
@@ -295,8 +295,8 @@
295
295
  }
296
296
  },
297
297
  "dependencies": {
298
- "@modern-js/create-request": "npm:@bleedingdev/modern-js-create-request@3.9.3-ultramodern.1",
299
- "@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.3-ultramodern.1"
298
+ "@modern-js/create-request": "npm:@bleedingdev/modern-js-create-request@3.9.3-ultramodern.2",
299
+ "@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.3-ultramodern.2"
300
300
  },
301
301
  "files": [
302
302
  "dist",
@@ -1,2 +1,3 @@
1
1
  export type * from './bffRuntime';
2
+ export type * from './serverSource';
2
3
  export type * from './serverTelemetry';
@@ -0,0 +1,23 @@
1
+ /** Context passed to function items of a server `source.globalVars` chain. */
2
+ export interface ServerGlobalVarsContext {
3
+ env: string;
4
+ target: 'web' | 'node' | 'web-worker';
5
+ }
6
+
7
+ export type ServerGlobalVars = Record<string, unknown>;
8
+
9
+ type ServerGlobalVarsChainItem =
10
+ | ServerGlobalVars
11
+ | ((
12
+ config: ServerGlobalVars,
13
+ context: ServerGlobalVarsContext,
14
+ ) => ServerGlobalVars | void);
15
+
16
+ /** Source options that server code reads from the application config. */
17
+ export interface ServerSourceConfigExtension {
18
+ /**
19
+ * Compile-time constants replaced in server code, such as BFF handlers.
20
+ * Server code resolves the chain with `{ env: 'server', target: 'node' }`.
21
+ */
22
+ globalVars?: ServerGlobalVarsChainItem | ServerGlobalVarsChainItem[];
23
+ }