socket-function 0.146.0 → 0.147.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "socket-function",
3
- "version": "0.146.0",
3
+ "version": "0.147.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -420,6 +420,9 @@ async function compressCached(bufferKey: string, buffer: () => Buffer): Promise<
420
420
 
421
421
  export function getIsAllowClient(module: NodeJS.Module) {
422
422
  // IMPORTANT! We do not allow everything in node modules by default, as most things in node modules, you don't want to import client-side, and it will break if you import it client-side. Many of these are imported, but will never end up being called client-side, so it's fine to exclude them.
423
+ if (allowAllNodeModulesFlag && module.filename.includes("node_modules")) {
424
+ return true;
425
+ }
423
426
  return module.allowclient && !module.serveronly;
424
427
  }
425
428
 
@@ -441,6 +444,11 @@ export function setRequireBootRequire(dir: string) {
441
444
  baseController.rootResolvePath = dir;
442
445
  }
443
446
 
447
+ let allowAllNodeModulesFlag = false;
448
+ export function allowAllNodeModules() {
449
+ allowAllNodeModulesFlag = true;
450
+ }
451
+
444
452
  export const RequireController = SocketFunction.register(
445
453
  "RequireController-e2f811f3-14b8-4759-b0d6-73f14516cf1d",
446
454
  baseController,
@@ -457,6 +465,7 @@ export const RequireController = SocketFunction.register(
457
465
  injectHTMLBeforeStartup,
458
466
  addMapGetModules,
459
467
  addStaticRoot,
468
+ allowAllNodeModules,
460
469
  }
461
470
  }
462
471
  );