From be560496b526f615aa710d2218fd1f8e8b12eff1 Mon Sep 17 00:00:00 2001 From: Enes Akar Date: Tue, 31 May 2022 17:09:25 -0700 Subject: [PATCH 1/8] Update README.md --- README.md | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 5b7629d7..eaf9a731 100644 --- a/README.md +++ b/README.md @@ -23,23 +23,6 @@ See [the list of APIs](https://docs.upstash.com/features/restapi#rest---redis-api-compatibility) supported. -## Upgrading to v1.4.0 **(ReferenceError: fetch is not defined)** - -If you are running on nodejs v17 and earlier, `fetch` will not be natively -supported. Platforms like Vercel, Netlify, Deno, Fastly etc. provide a polyfill -for you. But if you are running on bare node, you need to either specify a -polyfill yourself or change the import path to: - -```typescript -import { Redis } from "@upstash/redis/with-fetch"; -``` - -## Upgrading from v0.2.0? - -Please read the -[migration guide](https://docs.upstash.com/redis/sdks/javascriptsdk/migration). -For further explanation we wrote a -[blog post](https://blog.upstash.com/upstash-redis-sdk-v1). ## Quick Start @@ -99,6 +82,25 @@ data = await redis.spop('animals', 1) console.log(data) ``` +### Upgrading to v1.4.0 **(ReferenceError: fetch is not defined)** + +If you are running on nodejs v17 and earlier, `fetch` will not be natively +supported. Platforms like Vercel, Netlify, Deno, Fastly etc. provide a polyfill +for you. But if you are running on bare node, you need to either specify a +polyfill yourself or change the import path to: + +```typescript +import { Redis } from "@upstash/redis/with-fetch"; +``` + +### Upgrading from v0.2.0? + +Please read the +[migration guide](https://docs.upstash.com/redis/sdks/javascriptsdk/migration). +For further explanation we wrote a +[blog post](https://blog.upstash.com/upstash-redis-sdk-v1). + + ## Docs See [the documentation](https://docs.upstash.com/features/javascriptsdk) for From 82463a24276e6f0be2348a692957ac431cff9d20 Mon Sep 17 00:00:00 2001 From: Andreas Thomas Date: Wed, 1 Jun 2022 09:22:17 +0200 Subject: [PATCH 2/8] style: fmt --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index eaf9a731..faa022ce 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,6 @@ See [the list of APIs](https://docs.upstash.com/features/restapi#rest---redis-api-compatibility) supported. - ## Quick Start ### Install @@ -100,7 +99,6 @@ Please read the For further explanation we wrote a [blog post](https://blog.upstash.com/upstash-redis-sdk-v1). - ## Docs See [the documentation](https://docs.upstash.com/features/javascriptsdk) for From 16c6f2b24a12ceb05406a89ed77e6e7092858ca9 Mon Sep 17 00:00:00 2001 From: Andreas Thomas Date: Wed, 1 Jun 2022 09:32:05 +0200 Subject: [PATCH 3/8] style: fmt --- cmd/build.ts | 2 +- deno.json | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cmd/build.ts b/cmd/build.ts index 329b2221..79d2cb0e 100644 --- a/cmd/build.ts +++ b/cmd/build.ts @@ -1,4 +1,4 @@ -import { build, emptyDir } from "https://deno.land/x/dnt/mod.ts"; +import { build, emptyDir } from "https://deno.land/x/dnt@0.23.0/mod.ts"; const packageManager = "npm"; const outDir = "./dist"; diff --git a/deno.json b/deno.json index 54369f57..f87cdc2e 100644 --- a/deno.json +++ b/deno.json @@ -1,8 +1,19 @@ { + "compilerOptions": { + "lib": ["deno.window"] + }, "lint": { + "files": { + "exclude": ["**/node_modules/**"] + }, "rules": { "tags": ["recommended"], "exclude": ["no-explicit-any"] } + }, + "fmt": { + "files": { + "exclude": ["**/node_modules/**"] + } } } From 6fd63d18a4f16f624fa6081186e22511d6f98327 Mon Sep 17 00:00:00 2001 From: Andreas Thomas Date: Wed, 1 Jun 2022 09:35:08 +0200 Subject: [PATCH 4/8] build: add dom --- deno.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deno.json b/deno.json index f87cdc2e..bad61d08 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "lib": ["deno.window"] + "lib": ["deno.window", "dom"] }, "lint": { "files": { From 86f4682200b9e239cddfe2ed9e0d7ee3fddb9c47 Mon Sep 17 00:00:00 2001 From: Andreas Thomas Date: Wed, 1 Jun 2022 09:35:31 +0200 Subject: [PATCH 5/8] build: remove build settings --- deno.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/deno.json b/deno.json index bad61d08..d87edf19 100644 --- a/deno.json +++ b/deno.json @@ -1,7 +1,5 @@ { - "compilerOptions": { - "lib": ["deno.window", "dom"] - }, + "lint": { "files": { "exclude": ["**/node_modules/**"] From cb7db5c2251b6c699b939c842551c42a80b303bc Mon Sep 17 00:00:00 2001 From: Andreas Thomas Date: Wed, 1 Jun 2022 09:37:30 +0200 Subject: [PATCH 6/8] build: readd build settings --- deno.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deno.json b/deno.json index d87edf19..f87cdc2e 100644 --- a/deno.json +++ b/deno.json @@ -1,5 +1,7 @@ { - + "compilerOptions": { + "lib": ["deno.window"] + }, "lint": { "files": { "exclude": ["**/node_modules/**"] From b5e132a6c5240ea03d919f4cc603cd1b81934042 Mon Sep 17 00:00:00 2001 From: Andreas Thomas Date: Wed, 1 Jun 2022 09:44:10 +0200 Subject: [PATCH 7/8] chore: add format and lint exclude patterns --- cmd/build.ts | 2 +- deno.json | 4 ++-- deps.ts | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 deps.ts diff --git a/cmd/build.ts b/cmd/build.ts index 79d2cb0e..1feb1c5d 100644 --- a/cmd/build.ts +++ b/cmd/build.ts @@ -1,4 +1,4 @@ -import { build, emptyDir } from "https://deno.land/x/dnt@0.23.0/mod.ts"; +import { dnt } from "../deps.ts"; const packageManager = "npm"; const outDir = "./dist"; diff --git a/deno.json b/deno.json index f87cdc2e..99065e9f 100644 --- a/deno.json +++ b/deno.json @@ -4,7 +4,7 @@ }, "lint": { "files": { - "exclude": ["**/node_modules/**"] + "exclude": ["node_modules", "dist", ".next"] }, "rules": { "tags": ["recommended"], @@ -13,7 +13,7 @@ }, "fmt": { "files": { - "exclude": ["**/node_modules/**"] + "exclude": ["node_modules", "dist", ".next"] } } } diff --git a/deps.ts b/deps.ts new file mode 100644 index 00000000..a52251ca --- /dev/null +++ b/deps.ts @@ -0,0 +1 @@ +export * as dnt from "https://deno.land/x/dnt@0.23.0/mod.ts"; From 930e1aae3c9fb4f5908c15a9593ef17b05583110 Mon Sep 17 00:00:00 2001 From: Andreas Thomas Date: Wed, 1 Jun 2022 09:46:11 +0200 Subject: [PATCH 8/8] fix: use imports --- cmd/build.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/build.ts b/cmd/build.ts index 1feb1c5d..6d3bd9f8 100644 --- a/cmd/build.ts +++ b/cmd/build.ts @@ -3,9 +3,9 @@ import { dnt } from "../deps.ts"; const packageManager = "npm"; const outDir = "./dist"; -await emptyDir(outDir); +await dnt.emptyDir(outDir); -await build({ +await dnt.build({ packageManager, entryPoints: [ "platforms/nodejs.ts",