Skip to content

Commit

Permalink
Remove deno deps
Browse files Browse the repository at this point in the history
  • Loading branch information
ogzhanolguncu committed Oct 26, 2023
1 parent 1f85f1e commit cc9a7df
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 184 deletions.
40 changes: 0 additions & 40 deletions .github/workflows/prerelease.yaml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ jobs:

- name: Install bun
run: npm i -g bun

- name: Set package version
run: |
bun run ./scripts/set-version.js . ${{ env.VERSION }}
echo "export const VERSION='${{ env.VERSION }}'" > ./src/version.ts
echo "export const VERSION='${{ env.VERSION }}'" > ./version.ts
- name: Install Dependencies
run: bun install

- name: Build
run: bun run build

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,12 @@ jobs:
- name: Setup repo
uses: actions/checkout@v3

- name: Install bun
run: npm install -g bun

- name: Install Dependencies
run: bun install

- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
Expand All @@ -228,7 +234,7 @@ jobs:


- name: Test
run: deno test -A ./main.test.ts
run: bun test main.test.ts
working-directory: examples/deno
env:
DEPLOYMENT_URL: https://upstash-redis-70jbfgxwz310.deno.dev
Expand Down
22 changes: 0 additions & 22 deletions Taskfile.yml

This file was deleted.

1 change: 0 additions & 1 deletion deps.ts

This file was deleted.

12 changes: 6 additions & 6 deletions examples/deno/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
import { test, expect } from "bun:test";

const deploymentURL = Deno.env.get("DEPLOYMENT_URL");
const deploymentURL = process.env.DEPLOYMENT_URL;
if (!deploymentURL) {
throw new Error("DEPLOYMENT_URL not set");
}

Deno.test("works", async () => {
test("works", async () => {
console.log({ deploymentURL });
const res = await fetch(deploymentURL);
const body = await res.text();
console.log({ body });
assertEquals(res.status, 200);
expect(res.status).toBe(200);
const json = JSON.parse(body) as { counter: number };
assertEquals(typeof json.counter, "number");
});
expect(typeof json.counter).toBe("number");
});
2 changes: 1 addition & 1 deletion examples/deno/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ serve(async (_req: Request) => {
const counter = await redis.incr("deno deploy counter");

return new Response(JSON.stringify({ counter }), { status: 200 });
});
});
14 changes: 0 additions & 14 deletions examples/fastly/ci.test.ts

This file was deleted.

92 changes: 0 additions & 92 deletions mod.ts

This file was deleted.

6 changes: 3 additions & 3 deletions platforms/nodejs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,16 @@ export class Redis extends core.Redis {
// @ts-ignore process will be defined in node
if (typeof process?.env === "undefined") {
throw new Error(
'Unable to get environment variables, `process.env` is undefined. If you are deploying to cloudflare, please import from "@upstash/redis/cloudflare" instead',
'Unable to get environment variables, `process.env` is undefined. If you are deploying to cloudflare, please import from "@upstash/redis/cloudflare" instead'
);
}
// @ts-ignore process will be defined in node
const url = process?.env["UPSTASH_REDIS_REST_URL"];
const url = process?.env.UPSTASH_REDIS_REST_URL;
if (!url) {
throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_URL`");
}
// @ts-ignore process will be defined in node
const token = process?.env["UPSTASH_REDIS_REST_TOKEN"];
const token = process?.env.UPSTASH_REDIS_REST_TOKEN;
if (!token) {
throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_TOKEN`");
}
Expand Down

0 comments on commit cc9a7df

Please sign in to comment.