New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@farmfe/runtime

Package Overview
Dependencies
Maintainers
2
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@farmfe/runtime - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

6

CHANGELOG.md
# @farmfe/runtime
## 0.3.4
### Patch Changes
- Auto external node native module when reading farm.config.ts
## 0.3.3

@@ -4,0 +10,0 @@

2

package.json
{
"name": "@farmfe/runtime",
"version": "0.3.3",
"version": "0.3.4",
"description": "Runtime of Farm",

@@ -5,0 +5,0 @@ "author": {

import { Module } from './module';
import { FarmRuntimePlugin, FarmRuntimePluginContainer } from './plugin';
import { Resource, ResourceLoader } from './resource-loader';
import { Resource, ResourceLoader, targetEnv } from './resource-loader';

@@ -52,2 +52,19 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

// if running on node, using native require to load node built-in modules
if (targetEnv === 'node') {
const { __farmNodeRequire, __farmNodeBuiltinModules } =
// TODO: polyfill globalThis
globalThis as unknown as {
__farmNodeRequire: (id: string) => any;
__farmNodeBuiltinModules: string[];
};
if (moduleId.startsWith('node:')) {
const nodeModuleId = moduleId.slice(5);
return __farmNodeRequire(nodeModuleId);
} else if (__farmNodeBuiltinModules.includes(moduleId)) {
return __farmNodeRequire(moduleId);
}
}
const initializer = this.modules[moduleId];

@@ -54,0 +71,0 @@

@@ -8,5 +8,6 @@ // using native ability to load resources if target env is node.

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore do not check type here
const targetEnv = (globalThis || global || window || self).__FARM_TARGET_ENV__;
export const targetEnv =
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore do not check type here
(globalThis || global || window || self).__FARM_TARGET_ENV__ || 'node';

@@ -13,0 +14,0 @@ /**

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc