@bleedingdev/modern-js-runtime-extensions 3.9.3-ultramodern.1 → 3.9.3-ultramodern.10
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/dist/cjs/server-config/serverSource.js +18 -0
- package/dist/esm/server-config/serverSource.mjs +0 -0
- package/dist/esm-node/server-config/serverSource.mjs +1 -0
- package/dist/types/request-policy/browser.d.ts +5 -1
- package/dist/types/request-policy/node.d.ts +5 -1
- package/dist/types/server-config/index.d.ts +1 -0
- package/dist/types/server-config/serverSource.d.ts +16 -0
- package/package.json +11 -11
- package/src/server-config/index.ts +1 -0
- package/src/server-config/serverSource.ts +23 -0
|
@@ -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";
|
|
@@ -4,7 +4,11 @@ export declare const createClient: () => {
|
|
|
4
4
|
createRequest: import("./types.js").RequestCreator<typeof fetch>;
|
|
5
5
|
createUploader: import("./types.js").UploadCreator;
|
|
6
6
|
};
|
|
7
|
-
export declare const configure
|
|
7
|
+
export declare const { configure, createRequest, createUploader }: {
|
|
8
|
+
configure: (options: import("./types.js").IOptions<typeof fetch>) => void;
|
|
9
|
+
createRequest: import("./types.js").RequestCreator<typeof fetch>;
|
|
10
|
+
createUploader: import("./types.js").UploadCreator;
|
|
11
|
+
};
|
|
8
12
|
export { CrossOriginEnvelopePolicyError, IdentityBindingViolationError, OperationContractViolationError, ProducerClientNotInitializedError, ProducerDomainNotConfiguredError, } from './policyCore.js';
|
|
9
13
|
export * from './requestContext.js';
|
|
10
14
|
export * from './types.js';
|
|
@@ -4,7 +4,11 @@ export declare const createClient: () => {
|
|
|
4
4
|
createRequest: import("./types.js").RequestCreator<typeof fetch>;
|
|
5
5
|
createUploader: import("./types.js").UploadCreator;
|
|
6
6
|
};
|
|
7
|
-
export declare const configure
|
|
7
|
+
export declare const { configure, createRequest, createUploader }: {
|
|
8
|
+
configure: (options: import("./types.js").IOptions<typeof fetch>) => void;
|
|
9
|
+
createRequest: import("./types.js").RequestCreator<typeof fetch>;
|
|
10
|
+
createUploader: import("./types.js").UploadCreator;
|
|
11
|
+
};
|
|
8
12
|
export { CrossOriginEnvelopePolicyError, IdentityBindingViolationError, OperationContractViolationError, ProducerClientNotInitializedError, ProducerDomainNotConfiguredError, } from './policyCore.js';
|
|
9
13
|
export * from './requestContext.js';
|
|
10
14
|
export * from './types.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,9 +11,9 @@
|
|
|
11
11
|
"directory": "packages/runtime/runtime-extensions"
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"version": "3.9.3-ultramodern.
|
|
14
|
+
"version": "3.9.3-ultramodern.10",
|
|
15
15
|
"engines": {
|
|
16
|
-
"node": ">=26.
|
|
16
|
+
"node": ">=26.12.0"
|
|
17
17
|
},
|
|
18
18
|
"types": "./dist/types/index.d.ts",
|
|
19
19
|
"main": "./dist/cjs/index.js",
|
|
@@ -262,19 +262,19 @@
|
|
|
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.
|
|
266
|
-
"@rsbuild/core": "2.2.
|
|
265
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.3-ultramodern.10",
|
|
266
|
+
"@rsbuild/core": "2.2.13",
|
|
267
267
|
"@rslib/core": "1.0.3",
|
|
268
268
|
"@scripts/rstest-config": "2.66.0",
|
|
269
269
|
"@testing-library/dom": "^10.4.2",
|
|
270
270
|
"@testing-library/react": "^16.3.3",
|
|
271
|
-
"@types/node": "^26.6.
|
|
271
|
+
"@types/node": "^26.6.5",
|
|
272
272
|
"@types/react": "^19.3.0",
|
|
273
273
|
"@types/react-dom": "^19.3.0",
|
|
274
274
|
"esbuild": "^0.28.2",
|
|
275
|
-
"nock": "^
|
|
276
|
-
"react": "^19.3.
|
|
277
|
-
"react-dom": "^19.3.
|
|
275
|
+
"nock": "^15.0.1",
|
|
276
|
+
"react": "^19.3.1",
|
|
277
|
+
"react-dom": "^19.3.1",
|
|
278
278
|
"react-helmet-async": "3.0.0",
|
|
279
279
|
"typescript": "7.0.2"
|
|
280
280
|
},
|
|
@@ -283,7 +283,7 @@
|
|
|
283
283
|
"access": "public"
|
|
284
284
|
},
|
|
285
285
|
"peerDependencies": {
|
|
286
|
-
"react": "^19.
|
|
286
|
+
"react": "^19.3.1",
|
|
287
287
|
"react-helmet-async": "3.0.0"
|
|
288
288
|
},
|
|
289
289
|
"peerDependenciesMeta": {
|
|
@@ -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.
|
|
299
|
-
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.3-ultramodern.
|
|
298
|
+
"@modern-js/create-request": "npm:@bleedingdev/modern-js-create-request@3.9.3-ultramodern.10",
|
|
299
|
+
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.3-ultramodern.10"
|
|
300
300
|
},
|
|
301
301
|
"files": [
|
|
302
302
|
"dist",
|
|
@@ -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
|
+
}
|