Skip to content

Commit

Permalink
Merge pull request #385 from dajiaji/refine-dependencies
Browse files Browse the repository at this point in the history
Refine dependencies.
  • Loading branch information
dajiaji authored Sep 6, 2024
2 parents 577b7f9 + 1dd966d commit d3474e8
Show file tree
Hide file tree
Showing 25 changed files with 88 additions and 129 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci_bun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,46 +40,46 @@ jobs:
bun install
nohup bun src/index.ts &
sleep 3
deno test core.spec.ts --allow-net --config ../../../deno.json
deno test --import-map=../../../../../import_map.json core.spec.ts --allow-net --config ../../../deno.json
- name: Run test for ./packages/chacha20poly1305
working-directory: ./packages/chacha20poly1305/test/runtimes/bun
run: |
bun install
nohup bun src/index.ts &
sleep 3
deno test chacha20poly1305.spec.ts --allow-net --config ../../../deno.json
deno test --import-map=../../../../../import_map.json chacha20poly1305.spec.ts --allow-net --config ../../../deno.json
- name: Run test for ./packages/dhkem-x25519
working-directory: ./packages/dhkem-x25519/test/runtimes/bun
run: |
bun install
nohup bun src/index.ts &
sleep 3
deno test dhkem-x25519.spec.ts --allow-net --config ../../../deno.json
deno test --import-map=../../../../../import_map.json dhkem-x25519.spec.ts --allow-net --config ../../../deno.json
- name: Run test for ./packages/dhkem-x448
working-directory: ./packages/dhkem-x448/test/runtimes/bun
run: |
bun install
nohup bun src/index.ts &
sleep 3
deno test dhkem-x448.spec.ts --allow-net --config ../../../deno.json
deno test --import-map=../../../../../import_map.json dhkem-x448.spec.ts --allow-net --config ../../../deno.json
- name: Run test for ./packages/dhkem-secp256k1
working-directory: ./packages/dhkem-secp256k1/test/runtimes/bun
run: |
bun install
nohup bun src/index.ts &
sleep 3
deno test dhkem-secp256k1.spec.ts --allow-net --config ../../../deno.json
deno test --import-map=../../../../../import_map.json dhkem-secp256k1.spec.ts --allow-net --config ../../../deno.json
- name: Run test for ./packages/hybridkem-x25519-kyber768
working-directory: ./packages/hybridkem-x25519-kyber768/test/runtimes/bun
run: |
bun install
nohup bun src/index.ts &
sleep 3
deno test hybridkem-x25519-kyber768.spec.ts --allow-net --config ../../../deno.json
deno test --import-map=../../../../../import_map.json hybridkem-x25519-kyber768.spec.ts --allow-net --config ../../../deno.json
- name: Run test for ./packages/hpke-js
working-directory: ./packages/hpke-js/test/runtimes/bun
run: |
bun install
nohup bun run src/index.ts &
sleep 3
deno test hpke.spec.ts --allow-net --config ../../../deno.json
deno test --import-map=../../../../../import_map.json hpke.spec.ts --allow-net --config ../../../deno.json
14 changes: 7 additions & 7 deletions .github/workflows/ci_cloudflare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
npm link @hpke/core
nohup npm start &
sleep 3
deno test core.spec.ts --allow-net --config ../../../deno.json
deno test --import-map=../../../../../import_map.json core.spec.ts --allow-net --config ../../../deno.json
- name: Run test for ./packages/chacha20poly1305
working-directory: ./packages/chacha20poly1305/test/runtimes/cloudflare
run: |
Expand All @@ -40,7 +40,7 @@ jobs:
npm link @hpke/chacha20poly1305
nohup npm start &
sleep 3
deno test chacha20poly1305.spec.ts --allow-net --config ../../../deno.json
deno test --import-map=../../../../../import_map.json chacha20poly1305.spec.ts --allow-net --config ../../../deno.json
- name: Run test for ./packages/dhkem-x25519
working-directory: ./packages/dhkem-x25519/test/runtimes/cloudflare
run: |
Expand All @@ -49,7 +49,7 @@ jobs:
npm link @hpke/dhkem-x25519
nohup npm start &
sleep 3
deno test dhkem-x25519.spec.ts --allow-net --config ../../../deno.json
deno test --import-map=../../../../../import_map.json dhkem-x25519.spec.ts --allow-net --config ../../../deno.json
- name: Run test for ./packages/dhkem-x448
working-directory: ./packages/dhkem-x448/test/runtimes/cloudflare
run: |
Expand All @@ -58,7 +58,7 @@ jobs:
npm link @hpke/dhkem-x448
nohup npm start &
sleep 3
deno test dhkem-x448.spec.ts --allow-net --config ../../../deno.json
deno test --import-map=../../../../../import_map.json dhkem-x448.spec.ts --allow-net --config ../../../deno.json
- name: Run test for ./packages/dhkem-secp256k1
working-directory: ./packages/dhkem-secp256k1/test/runtimes/cloudflare
run: |
Expand All @@ -67,7 +67,7 @@ jobs:
npm link @hpke/dhkem-secp256k1
nohup npm start &
sleep 3
deno test dhkem-secp256k1.spec.ts --allow-net --config ../../../deno.json
deno test --import-map=../../../../../import_map.json dhkem-secp256k1.spec.ts --allow-net --config ../../../deno.json
- name: Run test for ./packages/hybridkem-x25519-kyber768
working-directory: ./packages/hybridkem-x25519-kyber768/test/runtimes/cloudflare
run: |
Expand All @@ -76,12 +76,12 @@ jobs:
npm link @hpke/hybridkem-x25519-kyber768
nohup npm start &
sleep 3
deno test hybridkem-x25519-kyber768.spec.ts --allow-net --config ../../../deno.json
deno test --import-map=../../../../../import_map.json hybridkem-x25519-kyber768.spec.ts --allow-net --config ../../../deno.json
- name: Run test for ./packages/hpke-js
working-directory: ./packages/hpke-js/test/runtimes/cloudflare
run: |
npm install
npm link hpke-js
nohup npm start &
sleep 3
deno test hpke.spec.ts --allow-net --config ../../../deno.json
deno test --import-map=../../../../../import_map.json hpke.spec.ts --allow-net --config ../../../deno.json
8 changes: 1 addition & 7 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@
"./packages/hybridkem-x25519-kyber768/samples/deno",
"./packages/hpke-js/samples/deno"
],
"imports": {
"@deno/dnt": "jsr:@deno/dnt@^0.41.3",
"@std/assert": "jsr:@std/assert@^1.0.3",
"@std/path": "jsr:@std/path@^1.0.3",
"@std/testing": "jsr:@std/testing@^1.0.0"
},
"fmt": {
"exclude": [
"npm/",
Expand All @@ -46,7 +40,7 @@
]
},
"tasks": {
"test": "deno fmt && deno lint && deno test -A --fail-fast --doc --coverage=coverage --parallel --allow-read",
"test": "deno fmt && deno lint && deno test --import-map=./import_map.json -A --fail-fast --doc --coverage=coverage --parallel --allow-read",
"cov": "deno coverage ./coverage --lcov --exclude='test'",
"dnt": "deno task dnt:core && deno task dnt:chacha20poly1305 && deno task dnt:dhkem-x25519 && deno task dnt:dhkem-x448 && deno task dnt:dhkem-secp256k1 && deno task dnt:hybridkem-x25519-kyber768 && deno task dnt:hpke-js",
"npm": "deno task dnt && deno task npm-link && deno task npm-pack",
Expand Down
46 changes: 32 additions & 14 deletions deno.lock

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

20 changes: 20 additions & 0 deletions import_map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"imports": {
"@deno/dnt": "jsr:@deno/dnt@^0.41.3",
"@hpke/core": "npm:@hpke/core@^1.3.0",
"@hpke/chacha20poly1305": "npm:@hpke/chacha20poly1305@^1.3.0",
"@hpke/dhkem-x25519": "npm:@hpke/dhkem-x25519@^1.3.0",
"@hpke/dhkem-x448": "npm:@hpke/dhkem-x448@^1.3.0",
"@noble/ciphers/chacha": "npm:@noble/ciphers@^0.5.3/chacha",
"@noble/curves/ed25519": "npm:@noble/curves@^1.4.2/ed25519",
"@noble/curves/ed448": "npm:@noble/curves@^1.4.2/ed448",
"@noble/curves/secp256k1": "npm:@noble/curves@^1.4.2/secp256k1",
"@noble/hashes/hmac": "npm:@noble/hashes@^1.4.0/hmac",
"@noble/hashes/sha256": "npm:@noble/hashes@^1.4.0/sha256",
"@noble/hashes/sha512": "npm:@noble/hashes@^1.4.0/sha512",
"@noble/hashes/sha3": "npm:@noble/hashes@^1.4.0/sha3",
"@std/assert": "jsr:@std/assert@1.0.0",
"@std/path": "jsr:@std/path@^1.0.3",
"@std/testing/bdd": "jsr:@std/testing@^1.0.0/bdd"
}
}
5 changes: 2 additions & 3 deletions packages/chacha20poly1305/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"publish": {
"exclude": [
"dnt.ts",
"import_map.json",
"samples/",
"test/",
"tsconfig.json"
Expand Down Expand Up @@ -47,9 +46,9 @@
]
},
"tasks": {
"test": "deno fmt && deno lint && deno test test -A --fail-fast --doc --coverage=coverage --parallel --allow-read",
"test": "deno fmt && deno lint && deno test --import-map=../../import_map.json -A --fail-fast --doc --coverage=coverage --parallel --allow-read",
"cov": "deno coverage ./coverage --lcov --exclude='test'",
"dnt": "deno run -A dnt.ts",
"dnt": "deno run --import-map=../../import_map.json -A dnt.ts",
"minify": "esbuild ../../npm/packages/chacha20poly1305/esm/chacha20poly1305/mod.js --bundle --format=esm --minify"
}
}
2 changes: 1 addition & 1 deletion packages/chacha20poly1305/dnt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ await build({
test: true,
declaration: true,
scriptModule: "umd",
importMap: "./import_map.json",
importMap: "../../import_map.json",
compilerOptions: {
lib: ["ES2022", "DOM"],
},
Expand Down
9 changes: 0 additions & 9 deletions packages/chacha20poly1305/import_map.json

This file was deleted.

9 changes: 2 additions & 7 deletions packages/core/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
"name": "@hpke/core",
"version": "1.3.1",
"exports": "./mod.ts",
"imports": {
"@deno/dnt": "jsr:@deno/dnt@^0.41.2",
"@std/assert": "jsr:@std/assert@1.0.0",
"@std/testing": "jsr:@std/testing@^1.0.0"
},
"publish": {
"exclude": [
"dnt.ts",
Expand Down Expand Up @@ -48,9 +43,9 @@
]
},
"tasks": {
"test": "deno fmt && deno lint && deno test test -A --fail-fast --doc --coverage=coverage --parallel --allow-read",
"test": "deno fmt && deno lint && deno test --import-map=../../import_map.json test -A --fail-fast --doc --coverage=coverage --parallel --allow-read",
"cov": "deno coverage ./coverage --lcov --exclude='test'",
"dnt": "deno run -A dnt.ts",
"dnt": "deno run --import-map=../../import_map.json -A dnt.ts",
"minify": "esbuild ../../npm/packages/core/esm/mod.js --bundle --format=esm --minify"
}
}
2 changes: 1 addition & 1 deletion packages/core/dnt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ await build({
test: true,
declaration: true,
scriptModule: "umd",
importMap: "./deno.json",
importMap: "../../import_map.json",
compilerOptions: {
lib: ["ES2022", "DOM"],
},
Expand Down
5 changes: 2 additions & 3 deletions packages/dhkem-secp256k1/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"publish": {
"exclude": [
"dnt.ts",
"import_map.json",
"samples/",
"test/",
"tsconfig.json"
Expand Down Expand Up @@ -47,9 +46,9 @@
]
},
"tasks": {
"test": "deno fmt && deno lint && deno test test -A --fail-fast --doc --coverage=coverage --parallel --allow-read",
"test": "deno fmt && deno lint && deno test --import-map=../../import_map.json -A --fail-fast --doc --coverage=coverage --parallel --allow-read",
"cov": "deno coverage ./coverage --lcov --exclude='test'",
"dnt": "deno run -A dnt.ts",
"dnt": "deno run --import-map=../../import_map.json -A dnt.ts",
"minify": "esbuild ../../npm/packages/dhkem-secp256k1/esm/dhkem-secp256k1/mod.js --bundle --format=esm --minify"
}
}
2 changes: 1 addition & 1 deletion packages/dhkem-secp256k1/dnt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ await build({
test: true,
declaration: true,
scriptModule: "umd",
importMap: "./import_map.json",
importMap: "../../import_map.json",
compilerOptions: {
lib: ["ES2022", "DOM"],
},
Expand Down
10 changes: 0 additions & 10 deletions packages/dhkem-secp256k1/import_map.json

This file was deleted.

3 changes: 1 addition & 2 deletions packages/dhkem-x25519/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"publish": {
"exclude": [
"dnt.ts",
"import_map.json",
"samples/",
"test/",
"tsconfig.json"
Expand Down Expand Up @@ -48,7 +47,7 @@
]
},
"tasks": {
"test": "deno fmt && deno lint && deno test test -A --fail-fast --doc --coverage=coverage --parallel --allow-read",
"test": "deno fmt && deno lint && deno test --import-map=../../import_map.json -A --fail-fast --doc --coverage=coverage --parallel --allow-read",
"cov": "deno coverage ./coverage --lcov --exclude='test'",
"dnt": "deno run -A dnt.ts",
"minify": "esbuild ../../npm/packages/dhkem-x25519/esm/dhkem-x25519/mod.js --bundle --format=esm --minify"
Expand Down
4 changes: 2 additions & 2 deletions packages/dhkem-x25519/dnt.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { build, emptyDir } from "@deno/dnt";
import { build, emptyDir } from "jsr:@deno/dnt";

await emptyDir("../../npm/packages/dhkem-x25519");
await emptyDir("test/runtimes/browsers/node_modules");
Expand All @@ -14,7 +14,7 @@ await build({
test: true,
declaration: true,
scriptModule: "umd",
importMap: "./import_map.json",
importMap: "../../import_map.json",
compilerOptions: {
lib: ["ES2022", "DOM"],
},
Expand Down
10 changes: 0 additions & 10 deletions packages/dhkem-x25519/import_map.json

This file was deleted.

Loading

0 comments on commit d3474e8

Please sign in to comment.