Skip to content

Commit

Permalink
Merge pull request #30 from nakasyou/refactor/use-import-maps
Browse files Browse the repository at this point in the history
refactor: use import maps for npm deps
  • Loading branch information
EdamAme-x authored Sep 13, 2024
2 parents beccea5 + f349ce0 commit 879e309
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 9 deletions.
6 changes: 5 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
]
},
"imports": {
"@std/assert": "jsr:@std/assert@^1.0.2"
"@std/assert": "jsr:@std/assert@^1.0.2",
"curve25519-js": "npm:curve25519-js@^0.0.4",
"node-bignumber": "npm:node-bignumber@^1.2.2",
"thrift": "npm:thrift@^0.20.0",
"tweetnacl": "npm:tweetnacl@^1.0.3"
},
"tasks": {
"format": "deno fmt & deno run -A npm:@biomejs/biome format --write ./packages/**/*.ts",
Expand Down
12 changes: 10 additions & 2 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/client/clients/e2ee/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//import CryptoJS from "npm:[email protected]";
import * as curve25519 from "npm:curve25519-js@0.0.4";
import * as curve25519 from "curve25519-js";
import * as crypto from "node:crypto";
import { Buffer } from "node:buffer";
import { TalkClient } from "../internal/talk-client.ts";
Expand All @@ -11,7 +11,7 @@ import {
type Message,
MIDType,
} from "../../libs/thrift/line_types.ts";
import nacl from "npm:tweetnacl@1.0.3";
import nacl from "tweetnacl";

class E2EE extends TalkClient {
public async getE2EESelfKeyData(mid: string): Promise<LooseType> {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/libs/rsa/rsa-verify.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Key } from "npm:node-bignumber@1.2.2";
import { Key } from "node-bignumber";
import type { RSAKey } from "../thrift/line_types.ts";

export function getRSACrypto(message: string, json: RSAKey) {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/libs/thrift/declares.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Buffer } from "node:buffer";
import { TBinaryProtocol, TCompactProtocol } from "npm:thrift@0.20.0";
import { TBinaryProtocol, TCompactProtocol } from "thrift";
import type { LooseType } from "../../entities/common.ts";

TBinaryProtocol.genHeader = (name: string) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/libs/thrift/read.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as thrift from "npm:thrift@0.20.0";
import * as thrift from "thrift";
import { Buffer } from "node:buffer";
import type { LooseType } from "../../entities/common.ts";

Expand Down
2 changes: 1 addition & 1 deletion packages/client/libs/thrift/write.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as thrift from "npm:thrift@0.20.0";
import * as thrift from "thrift";
import { Buffer } from "node:buffer";
import type { NestedArray, ProtocolKey, Protocols } from "./declares.ts";
import type { LooseType } from "../../entities/common.ts";
Expand Down

0 comments on commit 879e309

Please sign in to comment.