Skip to content

Commit

Permalink
fix(Code Node): Switch over to vm2 fork (#7018)
Browse files Browse the repository at this point in the history
[Fork is here](https://github.com/n8n-io/vm2). Currently there are no
modifications in it.
  • Loading branch information
netroy committed Aug 30, 2023
1 parent 9ca990b commit dfe0fa6
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 159 deletions.
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Code/JavaScriptSandbox.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NodeVM, makeResolverFromLegacyOptions } from 'vm2';
import { NodeVM, makeResolverFromLegacyOptions } from '@n8n/vm2';
import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';

import { ValidationError } from './ValidationError';
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Code/test/Code.node.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { anyNumber, mock } from 'jest-mock-extended';
import { NodeVM } from 'vm2';
import { NodeVM } from '@n8n/vm2';
import type { IExecuteFunctions, IWorkflowDataProxyData } from 'n8n-workflow';
import { NodeHelpers } from 'n8n-workflow';
import { normalizeItems } from 'n8n-core';
Expand Down
4 changes: 2 additions & 2 deletions packages/nodes-base/nodes/Function/Function.node.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { NodeVMOptions } from 'vm2';
import { NodeVM } from 'vm2';
import type { NodeVMOptions } from '@n8n/vm2';
import { NodeVM } from '@n8n/vm2';
import type {
IExecuteFunctions,
IBinaryKeyData,
Expand Down
4 changes: 2 additions & 2 deletions packages/nodes-base/nodes/FunctionItem/FunctionItem.node.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-loop-func */
import type { NodeVMOptions } from 'vm2';
import { NodeVM } from 'vm2';
import type { NodeVMOptions } from '@n8n/vm2';
import { NodeVM } from '@n8n/vm2';
import type {
IExecuteFunctions,
IBinaryKeyData,
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/ItemLists/V3/helpers/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NodeVM } from 'vm2';
import { NodeVM } from '@n8n/vm2';
import {
NodeOperationError,
type IDataObject,
Expand Down
4 changes: 2 additions & 2 deletions packages/nodes-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,7 @@
},
"dependencies": {
"@kafkajs/confluent-schema-registry": "1.0.6",
"@n8n/vm2": "^3.9.19",
"amqplib": "^0.10.3",
"aws4": "^1.8.0",
"basic-auth": "^2.0.1",
Expand Down Expand Up @@ -861,11 +862,10 @@
"semver": "^7.5.4",
"showdown": "^2.0.3",
"simple-git": "^3.17.0",
"snowflake-sdk": "^1.6.23",
"snowflake-sdk": "^1.8.0",
"ssh2-sftp-client": "^7.0.0",
"tmp-promise": "^3.0.2",
"uuid": "^8.3.2",
"vm2": "^3.9.19",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.19.3/xlsx-0.19.3.tgz",
"xml2js": "^0.5.0"
}
Expand Down
Loading

0 comments on commit dfe0fa6

Please sign in to comment.