[TRI-1333] : Upgrade all packages to use Node18 and use fetch instead node-fetch (#581)

* [TRI-1333] : Upgrade all packages to use Node18 and use fetch instead of node-fetch

* Changeset Added

* Update pnpm-lock to compatible pnpm v7.18.1

* Restored pnpm-lock to the last known good point compatible with pnpm v7.18.1

* Update chilled-plants-exercise.md

---------

Co-authored-by: Eric Allam <eallam@icloud.com>
This commit is contained in:
Rutam Prita Mishra
2023-10-10 16:12:02 +05:30
committed by GitHub
parent 916ed4e366
commit 975c5f1d3c
14 changed files with 26 additions and 38 deletions
+14
View File
@@ -0,0 +1,14 @@
---
"@trigger.dev/integration-kit": minor
"@trigger.dev/eslint-plugin": minor
"@trigger.dev/sdk": minor
"@trigger.dev/sveltekit": minor
"@trigger.dev/express": minor
"@trigger.dev/nestjs": minor
"@trigger.dev/nextjs": minor
"@trigger.dev/astro": minor
"@trigger.dev/core": minor
"@trigger.dev/cli": minor
---
Drop support for Node v16, require Node >= 18. This allows us to use native fetch in our SDK which paves the way for multi-platform support.
+1 -1
View File
@@ -33,7 +33,7 @@
"typescript": "^4.8.4"
},
"engines": {
"node": ">=16.8.0"
"node": ">=18.0.0"
},
"license": "MIT",
"publishConfig": {
+1 -1
View File
@@ -84,6 +84,6 @@
"zod": "3.22.3"
},
"engines": {
"node": ">=16.8.0"
"node": ">=18.0.0"
}
}
+1 -1
View File
@@ -42,6 +42,6 @@
"typescript": "^4.9.4"
},
"engines": {
"node": ">=16.8.0"
"node": ">=18.0.0"
}
}
+1 -1
View File
@@ -29,7 +29,7 @@
"npm-run-all": "^4.1.5"
},
"engines": {
"node": "^14.17.0 || ^16.0.0 || >= 18.0.0"
"node": ">=18.0.0"
},
"peerDependencies": {
"eslint": ">=7"
+1 -1
View File
@@ -41,6 +41,6 @@
"express": "^4.18.2"
},
"engines": {
"node": ">=16.8.0"
"node": ">=18.0.0"
}
}
+1 -3
View File
@@ -21,7 +21,6 @@
"devDependencies": {
"@trigger.dev/tsconfig": "workspace:*",
"@types/node": "18",
"@types/node-fetch": "2.6.x",
"@types/uuid": "^9.0.0",
"rimraf": "^3.0.2",
"tsup": "^6.5.0",
@@ -35,10 +34,9 @@
"typecheck": "tsup --dts-resolve --no-dts"
},
"dependencies": {
"node-fetch": "2.6.x",
"uuid": "^9.0.0"
},
"engines": {
"node": ">=16.8.0"
"node": ">=18.0.0"
}
}
+2 -2
View File
@@ -1,7 +1,6 @@
import fs, { promises } from "fs";
import path from "path";
import { v4 as uuidv4 } from "uuid";
import fetch from "node-fetch";
export async function fileFromString(contents: string | Buffer, fileName: string): Promise<File> {
const directory = path.join("tmp", uuidv4());
@@ -13,7 +12,8 @@ export async function fileFromString(contents: string | Buffer, fileName: string
export async function fileFromUrl(url: string) {
const response = await fetch(url);
const content = await response.buffer();
const arrayBuffer = await response.arrayBuffer();
const content = Buffer.from(arrayBuffer);
const fileName = path.basename(url);
return fileFromString(content, fileName);
+1 -1
View File
@@ -43,6 +43,6 @@
"debug": "^4.3.4"
},
"engines": {
"node": ">=16.8.0"
"node": ">=18.0.0"
}
}
+1 -1
View File
@@ -41,6 +41,6 @@
"debug": "^4.3.4"
},
"engines": {
"node": ">=16.8.0"
"node": ">=18.0.0"
}
}
+1 -1
View File
@@ -39,6 +39,6 @@
"debug": "^4.3.4"
},
"engines": {
"node": ">=16.8.0"
"node": ">=18.0.0"
}
}
+1 -3
View File
@@ -33,7 +33,6 @@
"get-caller-file": "^2.0.5",
"git-remote-origin-url": "^4.0.0",
"git-repo-info": "^2.1.1",
"node-fetch": "2.6.x",
"slug": "^6.0.0",
"terminal-link": "^3.0.0",
"ulid": "^2.3.0",
@@ -45,7 +44,6 @@
"@trigger.dev/tsconfig": "workspace:*",
"@types/debug": "^4.1.7",
"@types/node": "18",
"@types/node-fetch": "2.6.x",
"@types/slug": "^5.0.3",
"@types/uuid": "^9.0.0",
"@types/ws": "^8.5.3",
@@ -56,6 +54,6 @@
"typescript": "^4.8.4"
},
"engines": {
"node": ">=16.8.0"
"node": ">=18.0.0"
}
}
-1
View File
@@ -31,7 +31,6 @@ import {
API_VERSIONS,
} from "@trigger.dev/core";
import fetch, { type RequestInit } from "node-fetch";
import { z } from "zod";
export type ApiClientOptions = {
-21
View File
@@ -867,21 +867,17 @@ importers:
specifiers:
'@trigger.dev/tsconfig': workspace:*
'@types/node': '18'
'@types/node-fetch': 2.6.x
'@types/uuid': ^9.0.0
node-fetch: 2.6.x
rimraf: ^3.0.2
tsup: ^6.5.0
tsx: ^3.12.1
typescript: ^4.8.4
uuid: ^9.0.0
dependencies:
node-fetch: 2.6.12
uuid: 9.0.0
devDependencies:
'@trigger.dev/tsconfig': link:../../config-packages/tsconfig
'@types/node': 18.15.13
'@types/node-fetch': 2.6.2
'@types/uuid': 9.0.0
rimraf: 3.0.2
tsup: 6.6.3_typescript@4.9.5
@@ -1040,7 +1036,6 @@ importers:
'@trigger.dev/tsconfig': workspace:*
'@types/debug': ^4.1.7
'@types/node': '18'
'@types/node-fetch': 2.6.x
'@types/slug': ^5.0.3
'@types/uuid': ^9.0.0
'@types/ws': ^8.5.3
@@ -1052,7 +1047,6 @@ importers:
get-caller-file: ^2.0.5
git-remote-origin-url: ^4.0.0
git-repo-info: ^2.1.1
node-fetch: 2.6.x
rimraf: ^3.0.2
slug: ^6.0.0
terminal-link: ^3.0.0
@@ -1072,7 +1066,6 @@ importers:
get-caller-file: 2.0.5
git-remote-origin-url: 4.0.0
git-repo-info: 2.1.1
node-fetch: 2.6.12_encoding@0.1.13
slug: 6.1.0
terminal-link: 3.0.0
ulid: 2.3.0
@@ -1083,7 +1076,6 @@ importers:
'@trigger.dev/tsconfig': link:../../config-packages/tsconfig
'@types/debug': 4.1.7
'@types/node': 18.14.0
'@types/node-fetch': 2.6.4
'@types/slug': 5.0.3
'@types/uuid': 9.0.0
'@types/ws': 8.5.4
@@ -25073,19 +25065,6 @@ packages:
dependencies:
whatwg-url: 5.0.0
/node-fetch/2.6.12_encoding@0.1.13:
resolution: {integrity: sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==}
engines: {node: 4.x || >=6.0.0}
peerDependencies:
encoding: ^0.1.0
peerDependenciesMeta:
encoding:
optional: true
dependencies:
encoding: 0.1.13
whatwg-url: 5.0.0
dev: false
/node-fetch/2.6.7:
resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==}
engines: {node: 4.x || >=6.0.0}