Skip to content

Commit d71304e

Browse files
committed
Migrate from bun to deno
1 parent 84442ad commit d71304e

27 files changed

+114
-301
lines changed

.github/workflows/publish.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Publish
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
contents: read
13+
id-token: write
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: denoland/setup-deno@v2
18+
with:
19+
deno-version: v2.x
20+
21+
- name: Run tests
22+
run: deno test

.gitignore

-175
This file was deleted.

.npmrc

-1
This file was deleted.

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"deno.enable": true
3+
}

bun.lock

-43
This file was deleted.

deno.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"workspace": ["packages/*"]
3+
}

deno.lock

+39
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-10
This file was deleted.

packages/crypto/cipher.test.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { describe, expect, it } from "bun:test";
2-
import { decrypt, encrypt } from "./cipher";
3-
import { deriveKey, generateSalt } from "./utils";
1+
import { expect } from "jsr:@std/expect";
2+
import { describe, it } from "jsr:@std/testing/bdd";
3+
import { decrypt, encrypt } from "./cipher.ts";
4+
import { deriveKey, generateSalt } from "./utils.ts";
45

56
describe("encrypt and decrypt", () => {
67
it("should encrypt and decrypt data correctly", async () => {

packages/crypto/deno.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "@razr/crypto",
3+
"version": "0.0.0",
4+
"exports": "./mod.ts",
5+
"license": "MIT"
6+
}

packages/crypto/hash.test.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { describe, expect, it } from "bun:test";
2-
import { hash, verify } from "./hash";
3-
import { generateSalt } from "./utils";
1+
import { expect } from "jsr:@std/expect";
2+
import { describe, it } from "jsr:@std/testing/bdd";
3+
import { hash, verify } from "./hash.ts";
4+
import { generateSalt } from "./utils.ts";
45

56
describe("hash", () => {
67
it("should hash a password with a given salt", async () => {
@@ -11,7 +12,7 @@ describe("hash", () => {
1112
expect(hashedPassword.length).toBe(32); // 256 bits = 32 bytes
1213
});
1314

14-
it("should throw an error if the salt is less than 16 bytes", async () => {
15+
it("should throw an error if the salt is less than 16 bytes", () => {
1516
const password = "mySecurePassword";
1617
const salt = new Uint8Array(15); // Invalid salt length
1718
expect(hash(password, salt)).rejects.toThrow(

packages/crypto/index.ts

-3
This file was deleted.

packages/crypto/mod.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from "./cipher.ts";
2+
export * from "./hash.ts";
3+
export * from "./utils.ts";

packages/crypto/package.json

-5
This file was deleted.

packages/crypto/utils.test.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { describe, expect, it } from "bun:test";
2-
import { fromBase64, generateSalt, toBase64 } from "./utils";
1+
import { expect } from "jsr:@std/expect";
2+
import { describe, it } from "jsr:@std/testing/bdd";
3+
import { fromBase64, generateSalt, toBase64 } from "./utils.ts";
34

45
describe("toBase64", () => {
56
it("should encode a Uint8Array to a Base64 string", () => {

packages/formdata/deno.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "@razr/formdata",
3+
"version": "0.0.0",
4+
"exports": "./mod.ts",
5+
"license": "MIT"
6+
}

packages/formdata/index.test.ts packages/formdata/mod.test.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { describe, expect, it } from "bun:test";
2-
import { decode, encode } from ".";
1+
import { expect } from "jsr:@std/expect";
2+
import { describe, it } from "jsr:@std/testing/bdd";
3+
import { decode, encode } from "./mod.ts";
34

45
describe("encode", () => {
56
it("should handle numbers", () => {
File renamed without changes.

packages/formdata/package.json

-8
This file was deleted.

packages/schema/deno.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "@razr/schema",
3+
"version": "0.0.0",
4+
"exports": "./mod.ts",
5+
"license": "MIT"
6+
}

0 commit comments

Comments
 (0)