From 4be55c9a8da664dd85933237a800cc2755f15877 Mon Sep 17 00:00:00 2001 From: Ajitomi Daisuke Date: Thu, 27 Jul 2023 13:47:04 +0900 Subject: [PATCH] Rename scoped pacakage to @hpke. --- .github/workflows/ci.yml | 4 ++-- .github/workflows/ci_browser.yml | 12 ++++++------ .github/workflows/ci_bun.yml | 12 ++++++------ .github/workflows/ci_cloudflare.yml | 12 ++++++------ .github/workflows/ci_node.yml | 6 +++--- .github/workflows/publish.yml | 8 ++++---- .../README.md | 0 .../deno.json | 2 +- .../deno.lock | 0 .../dnt.ts | 10 +++++----- x/dhkem-secp256k1/mod.ts | 1 + .../src/dhkem-secp256k1.ts} | 0 .../test/dhkem-secp256k1.test.ts} | 2 +- .../test/runtimes/browsers/dhkem-secp256k1.spec.ts} | 0 .../test/runtimes/browsers/package.json | 0 .../test/runtimes/browsers/pages/index.html | 0 .../test/runtimes/browsers/pages/src/.gitkeep | 0 .../test/runtimes/browsers/playwright.config.ts | 0 .../test/runtimes/bun/dhkem-secp256k1.spec.ts} | 0 .../test/runtimes/bun/src/index.js | 0 .../runtimes/cloudflare/dhkem-secp256k1.spec.ts} | 0 .../test/runtimes/cloudflare/package.json | 0 .../test/runtimes/cloudflare/src/index.js | 0 .../test/runtimes/cloudflare/wrangler.toml | 0 .../test/runtimes/server.js | 2 +- x/dhkemSecp256k1HkdfSha256/mod.ts | 1 - 26 files changed, 36 insertions(+), 36 deletions(-) rename x/{dhkemSecp256k1HkdfSha256 => dhkem-secp256k1}/README.md (100%) rename x/{dhkemSecp256k1HkdfSha256 => dhkem-secp256k1}/deno.json (89%) rename x/{dhkemSecp256k1HkdfSha256 => dhkem-secp256k1}/deno.lock (100%) rename x/{dhkemSecp256k1HkdfSha256 => dhkem-secp256k1}/dnt.ts (79%) create mode 100644 x/dhkem-secp256k1/mod.ts rename x/{dhkemSecp256k1HkdfSha256/src/dhkemSecp256k1HkdfSha256.ts => dhkem-secp256k1/src/dhkem-secp256k1.ts} (100%) rename x/{dhkemSecp256k1HkdfSha256/test/dhkemSecp256k1HkdfSha256.test.ts => dhkem-secp256k1/test/dhkem-secp256k1.test.ts} (99%) rename x/{dhkemSecp256k1HkdfSha256/test/runtimes/browsers/dhkemSecp256k1HkdfSha256.spec.ts => dhkem-secp256k1/test/runtimes/browsers/dhkem-secp256k1.spec.ts} (100%) rename x/{dhkemSecp256k1HkdfSha256 => dhkem-secp256k1}/test/runtimes/browsers/package.json (100%) rename x/{dhkemSecp256k1HkdfSha256 => dhkem-secp256k1}/test/runtimes/browsers/pages/index.html (100%) rename x/{dhkemSecp256k1HkdfSha256 => dhkem-secp256k1}/test/runtimes/browsers/pages/src/.gitkeep (100%) rename x/{dhkemSecp256k1HkdfSha256 => dhkem-secp256k1}/test/runtimes/browsers/playwright.config.ts (100%) rename x/{dhkemSecp256k1HkdfSha256/test/runtimes/bun/dhkemSecp256k1HkdfSha256.spec.ts => dhkem-secp256k1/test/runtimes/bun/dhkem-secp256k1.spec.ts} (100%) rename x/{dhkemSecp256k1HkdfSha256 => dhkem-secp256k1}/test/runtimes/bun/src/index.js (100%) rename x/{dhkemSecp256k1HkdfSha256/test/runtimes/cloudflare/dhkemSecp256k1HkdfSha256.spec.ts => dhkem-secp256k1/test/runtimes/cloudflare/dhkem-secp256k1.spec.ts} (100%) rename x/{dhkemSecp256k1HkdfSha256 => dhkem-secp256k1}/test/runtimes/cloudflare/package.json (100%) rename x/{dhkemSecp256k1HkdfSha256 => dhkem-secp256k1}/test/runtimes/cloudflare/src/index.js (100%) rename x/{dhkemSecp256k1HkdfSha256 => dhkem-secp256k1}/test/runtimes/cloudflare/wrangler.toml (100%) rename x/{dhkemSecp256k1HkdfSha256 => dhkem-secp256k1}/test/runtimes/server.js (95%) delete mode 100644 x/dhkemSecp256k1HkdfSha256/mod.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6bff9647..2ebfef4e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,8 +27,8 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} files: ./coverage.lcov flags: unittests - - name: Run deno test for /x/dhkemSecp256k1HkdfSha256 - working-directory: ./x/dhkemSecp256k1HkdfSha256 + - name: Run deno test for /x/dhkem-secp256k1 + working-directory: ./x/dhkem-secp256k1 run: | deno fmt --check deno task test diff --git a/.github/workflows/ci_browser.yml b/.github/workflows/ci_browser.yml index 7190e33d6..4b4b433a9 100644 --- a/.github/workflows/ci_browser.yml +++ b/.github/workflows/ci_browser.yml @@ -24,13 +24,13 @@ jobs: npm install -g esbuild deno task dnt deno task minify > test/runtimes/browsers/pages/src/hpke.js - mkdir test/runtimes/browsers/pages/dhkemSecp256k1HkdfSha256 - cp -rf x/dhkemSecp256k1HkdfSha256/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/dhkemSecp256k1HkdfSha256 - deno task minify > test/runtimes/browsers/pages/dhkemSecp256k1HkdfSha256/src/hpke.js - - working-directory: ./x/dhkemSecp256k1HkdfSha256 + mkdir test/runtimes/browsers/pages/dhkem-secp256k1 + cp -rf x/dhkem-secp256k1/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/dhkem-secp256k1 + deno task minify > test/runtimes/browsers/pages/dhkem-secp256k1/src/hpke.js + - working-directory: ./x/dhkem-secp256k1 run: | deno task dnt - deno task minify > ../../test/runtimes/browsers/pages/dhkemSecp256k1HkdfSha256/src/hpke-dhkemSecp256k1HkdfSha256.js + deno task minify > ../../test/runtimes/browsers/pages/dhkem-secp256k1/src/hpke-dhkem-secp256k1.js - uses: peaceiris/actions-gh-pages@v3 with: deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} @@ -48,5 +48,5 @@ jobs: npm ci npx playwright install --with-deps npx playwright test - - working-directory: ./x/dhkemSecp256k1HkdfSha256/test/runtimes/browsers + - working-directory: ./x/dhkem-secp256k1/test/runtimes/browsers run: npm install && npx playwright install && npx playwright test diff --git a/.github/workflows/ci_bun.yml b/.github/workflows/ci_bun.yml index 918da0143..809f7878f 100644 --- a/.github/workflows/ci_bun.yml +++ b/.github/workflows/ci_bun.yml @@ -29,11 +29,11 @@ jobs: npm install -g esbuild deno task dnt deno task minify > test/runtimes/hpke.js - deno task minify > x/dhkemSecp256k1HkdfSha256/test/runtimes/hpke.js - - working-directory: ./x/dhkemSecp256k1HkdfSha256/ + deno task minify > x/dhkem-secp256k1/test/runtimes/hpke.js + - working-directory: ./x/dhkem-secp256k1/ run: | deno task dnt - deno task minify > test/runtimes/hpke-dhkemSecp256k1HkdfSha256.js + deno task minify > test/runtimes/hpke-dhkem-secp256k1.js - uses: antongolub/action-setup-bun@v1 with: bun-version: ${{ matrix.bun-version }} @@ -43,9 +43,9 @@ jobs: nohup bun src/index.js & sleep 3 deno test hpke.spec.ts --allow-net - - name: Run test for dhkemSecp256k1HkdfSha256 - working-directory: ./x/dhkemSecp256k1HkdfSha256/test/runtimes/bun + - name: Run test for dhkem-secp256k1 + working-directory: ./x/dhkem-secp256k1/test/runtimes/bun run: | nohup bun src/index.js & sleep 3 - deno test dhkemSecp256k1HkdfSha256.spec.ts --allow-net \ No newline at end of file + deno test dhkem-secp256k1.spec.ts --allow-net \ No newline at end of file diff --git a/.github/workflows/ci_cloudflare.yml b/.github/workflows/ci_cloudflare.yml index 3da61ef7a..8ded627b4 100644 --- a/.github/workflows/ci_cloudflare.yml +++ b/.github/workflows/ci_cloudflare.yml @@ -24,11 +24,11 @@ jobs: npm install -g esbuild deno task dnt deno task minify > test/runtimes/hpke.js - deno task minify > x/dhkemSecp256k1HkdfSha256/test/runtimes/hpke.js - - working-directory: ./x/dhkemSecp256k1HkdfSha256/ + deno task minify > x/dhkem-secp256k1/test/runtimes/hpke.js + - working-directory: ./x/dhkem-secp256k1/ run: | deno task dnt - deno task minify > test/runtimes/hpke-dhkemSecp256k1HkdfSha256.js + deno task minify > test/runtimes/hpke-dhkem-secp256k1.js - name: Run test working-directory: ./test/runtimes/cloudflare run: | @@ -36,10 +36,10 @@ jobs: nohup npm start & sleep 3 deno test hpke.spec.ts --allow-net - - name: Run test for dhkemSecp256k1HkdfSha256 - working-directory: ./x/dhkemSecp256k1HkdfSha256/test/runtimes/cloudflare + - name: Run test for dhkem-secp256k1 + working-directory: ./x/dhkem-secp256k1/test/runtimes/cloudflare run: | npm install nohup npm start & sleep 3 - deno test dhkemSecp256k1HkdfSha256.spec.ts --allow-net + deno test dhkem-secp256k1.spec.ts --allow-net diff --git a/.github/workflows/ci_node.yml b/.github/workflows/ci_node.yml index f697e0c4e..6367032be 100644 --- a/.github/workflows/ci_node.yml +++ b/.github/workflows/ci_node.yml @@ -27,8 +27,8 @@ jobs: npm install -g esbuild deno task dnt deno task minify > ./npm/hpke.min.js - - name: Run dnt & minify for /x/dhkemSecp256k1HkdfSha256 - working-directory: ./x/dhkemSecp256k1HkdfSha256 + - name: Run dnt & minify for /x/dhkem-secp256k1 + working-directory: ./x/dhkem-secp256k1 run: | deno task dnt - deno task minify > ./npm/hpke-dhkemSecp256k1.min.js + deno task minify > ./npm/hpke-dhkem-secp256k1.min.js diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ed851b0f3..6e79fb332 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -26,7 +26,7 @@ jobs: env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - publish-dhkemSecp256k1HkdfSha256: + publish-dhkem-secp256k1: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -38,12 +38,12 @@ jobs: with: deno-version: v1.x - name: Run dnt & minify - working-directory: ./x/dhkemSecp256k1HkdfSha256 + working-directory: ./x/dhkem-secp256k1 run: | npm install -g esbuild deno task dnt - deno task minify > ./npm/hpke-dhkemSecp256k1HkdfSha256.min.js - - working-directory: ./x/dhkemSecp256k1HkdfSha256/npm + deno task minify > ./npm/hpke-dhkem-secp256k1.min.js + - working-directory: ./x/dhkem-secp256k1/npm run: npm publish env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/x/dhkemSecp256k1HkdfSha256/README.md b/x/dhkem-secp256k1/README.md similarity index 100% rename from x/dhkemSecp256k1HkdfSha256/README.md rename to x/dhkem-secp256k1/README.md diff --git a/x/dhkemSecp256k1HkdfSha256/deno.json b/x/dhkem-secp256k1/deno.json similarity index 89% rename from x/dhkemSecp256k1HkdfSha256/deno.json rename to x/dhkem-secp256k1/deno.json index 352588424..89042053f 100644 --- a/x/dhkemSecp256k1HkdfSha256/deno.json +++ b/x/dhkem-secp256k1/deno.json @@ -29,6 +29,6 @@ "test": "deno fmt && deno lint && deno test test -A --fail-fast --doc --coverage=coverage --parallel --allow-read", "cov": "deno coverage ./coverage --lcov --exclude='test'", "dnt": "deno run -A dnt.ts $(git describe --tags $(git rev-list --tags --max-count=1))", - "minify": "esbuild npm/esm/x/dhkemSecp256k1HkdfSha256/mod.js --bundle --format=esm --minify" + "minify": "esbuild npm/esm/x/dhkem-secp256k1/mod.js --bundle --format=esm --minify" } } diff --git a/x/dhkemSecp256k1HkdfSha256/deno.lock b/x/dhkem-secp256k1/deno.lock similarity index 100% rename from x/dhkemSecp256k1HkdfSha256/deno.lock rename to x/dhkem-secp256k1/deno.lock diff --git a/x/dhkemSecp256k1HkdfSha256/dnt.ts b/x/dhkem-secp256k1/dnt.ts similarity index 79% rename from x/dhkemSecp256k1HkdfSha256/dnt.ts rename to x/dhkem-secp256k1/dnt.ts index 51249b51e..be493d3e9 100644 --- a/x/dhkemSecp256k1HkdfSha256/dnt.ts +++ b/x/dhkem-secp256k1/dnt.ts @@ -17,7 +17,7 @@ await build({ deno: "dev", }, package: { - name: "@hpke-js/dhkemSecp256k1HkdfSha256", + name: "@hpke/dhkem-secp256k1", version: Deno.args[0], description: "A Hybrid Public Key Encryption (HPKE) module extension for secp256k1 curve", @@ -27,12 +27,12 @@ await build({ }, homepage: "https://github.com/dajiaji/hpke-js#readme", license: "MIT", - main: "./script/x/dhkemSecp256k1HkdfSha256/mod.js", - types: "./script/x/dhkemSecp256k1HkdfSha256/mod.d.ts", + main: "./script/x/dhkem-secp256k1/mod.js", + types: "./script/x/dhkem-secp256k1/mod.d.ts", exports: { ".": { - "import": "./esm/x/dhkemSecp256k1HkdfSha256/mod.js", - "require": "./script/x/dhkemSecp256k1HkdfSha256/mod.js", + "import": "./esm/x/dhkem-secp256k1/mod.js", + "require": "./script/x/dhkem-secp256k1/mod.js", }, "./package.json": "./package.json", }, diff --git a/x/dhkem-secp256k1/mod.ts b/x/dhkem-secp256k1/mod.ts new file mode 100644 index 000000000..427db6b52 --- /dev/null +++ b/x/dhkem-secp256k1/mod.ts @@ -0,0 +1 @@ +export { DhkemSecp256k1HkdfSha256 } from "./src/dhkem-secp256k1.ts"; diff --git a/x/dhkemSecp256k1HkdfSha256/src/dhkemSecp256k1HkdfSha256.ts b/x/dhkem-secp256k1/src/dhkem-secp256k1.ts similarity index 100% rename from x/dhkemSecp256k1HkdfSha256/src/dhkemSecp256k1HkdfSha256.ts rename to x/dhkem-secp256k1/src/dhkem-secp256k1.ts diff --git a/x/dhkemSecp256k1HkdfSha256/test/dhkemSecp256k1HkdfSha256.test.ts b/x/dhkem-secp256k1/test/dhkem-secp256k1.test.ts similarity index 99% rename from x/dhkemSecp256k1HkdfSha256/test/dhkemSecp256k1HkdfSha256.test.ts rename to x/dhkem-secp256k1/test/dhkem-secp256k1.test.ts index 2901426e1..583e5a3cd 100644 --- a/x/dhkemSecp256k1HkdfSha256/test/dhkemSecp256k1HkdfSha256.test.ts +++ b/x/dhkem-secp256k1/test/dhkem-secp256k1.test.ts @@ -8,7 +8,7 @@ import { KemId, } from "https://deno.land/x/hpke/mod.ts"; -import { DhkemSecp256k1HkdfSha256 } from "../src/dhkemSecp256k1HkdfSha256.ts"; +import { DhkemSecp256k1HkdfSha256 } from "../src/dhkem-secp256k1.ts"; const isBrowser = () => typeof window !== "undefined"; diff --git a/x/dhkemSecp256k1HkdfSha256/test/runtimes/browsers/dhkemSecp256k1HkdfSha256.spec.ts b/x/dhkem-secp256k1/test/runtimes/browsers/dhkem-secp256k1.spec.ts similarity index 100% rename from x/dhkemSecp256k1HkdfSha256/test/runtimes/browsers/dhkemSecp256k1HkdfSha256.spec.ts rename to x/dhkem-secp256k1/test/runtimes/browsers/dhkem-secp256k1.spec.ts diff --git a/x/dhkemSecp256k1HkdfSha256/test/runtimes/browsers/package.json b/x/dhkem-secp256k1/test/runtimes/browsers/package.json similarity index 100% rename from x/dhkemSecp256k1HkdfSha256/test/runtimes/browsers/package.json rename to x/dhkem-secp256k1/test/runtimes/browsers/package.json diff --git a/x/dhkemSecp256k1HkdfSha256/test/runtimes/browsers/pages/index.html b/x/dhkem-secp256k1/test/runtimes/browsers/pages/index.html similarity index 100% rename from x/dhkemSecp256k1HkdfSha256/test/runtimes/browsers/pages/index.html rename to x/dhkem-secp256k1/test/runtimes/browsers/pages/index.html diff --git a/x/dhkemSecp256k1HkdfSha256/test/runtimes/browsers/pages/src/.gitkeep b/x/dhkem-secp256k1/test/runtimes/browsers/pages/src/.gitkeep similarity index 100% rename from x/dhkemSecp256k1HkdfSha256/test/runtimes/browsers/pages/src/.gitkeep rename to x/dhkem-secp256k1/test/runtimes/browsers/pages/src/.gitkeep diff --git a/x/dhkemSecp256k1HkdfSha256/test/runtimes/browsers/playwright.config.ts b/x/dhkem-secp256k1/test/runtimes/browsers/playwright.config.ts similarity index 100% rename from x/dhkemSecp256k1HkdfSha256/test/runtimes/browsers/playwright.config.ts rename to x/dhkem-secp256k1/test/runtimes/browsers/playwright.config.ts diff --git a/x/dhkemSecp256k1HkdfSha256/test/runtimes/bun/dhkemSecp256k1HkdfSha256.spec.ts b/x/dhkem-secp256k1/test/runtimes/bun/dhkem-secp256k1.spec.ts similarity index 100% rename from x/dhkemSecp256k1HkdfSha256/test/runtimes/bun/dhkemSecp256k1HkdfSha256.spec.ts rename to x/dhkem-secp256k1/test/runtimes/bun/dhkem-secp256k1.spec.ts diff --git a/x/dhkemSecp256k1HkdfSha256/test/runtimes/bun/src/index.js b/x/dhkem-secp256k1/test/runtimes/bun/src/index.js similarity index 100% rename from x/dhkemSecp256k1HkdfSha256/test/runtimes/bun/src/index.js rename to x/dhkem-secp256k1/test/runtimes/bun/src/index.js diff --git a/x/dhkemSecp256k1HkdfSha256/test/runtimes/cloudflare/dhkemSecp256k1HkdfSha256.spec.ts b/x/dhkem-secp256k1/test/runtimes/cloudflare/dhkem-secp256k1.spec.ts similarity index 100% rename from x/dhkemSecp256k1HkdfSha256/test/runtimes/cloudflare/dhkemSecp256k1HkdfSha256.spec.ts rename to x/dhkem-secp256k1/test/runtimes/cloudflare/dhkem-secp256k1.spec.ts diff --git a/x/dhkemSecp256k1HkdfSha256/test/runtimes/cloudflare/package.json b/x/dhkem-secp256k1/test/runtimes/cloudflare/package.json similarity index 100% rename from x/dhkemSecp256k1HkdfSha256/test/runtimes/cloudflare/package.json rename to x/dhkem-secp256k1/test/runtimes/cloudflare/package.json diff --git a/x/dhkemSecp256k1HkdfSha256/test/runtimes/cloudflare/src/index.js b/x/dhkem-secp256k1/test/runtimes/cloudflare/src/index.js similarity index 100% rename from x/dhkemSecp256k1HkdfSha256/test/runtimes/cloudflare/src/index.js rename to x/dhkem-secp256k1/test/runtimes/cloudflare/src/index.js diff --git a/x/dhkemSecp256k1HkdfSha256/test/runtimes/cloudflare/wrangler.toml b/x/dhkem-secp256k1/test/runtimes/cloudflare/wrangler.toml similarity index 100% rename from x/dhkemSecp256k1HkdfSha256/test/runtimes/cloudflare/wrangler.toml rename to x/dhkem-secp256k1/test/runtimes/cloudflare/wrangler.toml diff --git a/x/dhkemSecp256k1HkdfSha256/test/runtimes/server.js b/x/dhkem-secp256k1/test/runtimes/server.js similarity index 95% rename from x/dhkemSecp256k1HkdfSha256/test/runtimes/server.js rename to x/dhkem-secp256k1/test/runtimes/server.js index cae6382e3..82359a068 100644 --- a/x/dhkemSecp256k1HkdfSha256/test/runtimes/server.js +++ b/x/dhkem-secp256k1/test/runtimes/server.js @@ -1,5 +1,5 @@ import * as hpke from "./hpke.js"; -import * as secp256k1 from "./hpke-dhkemSecp256k1HkdfSha256.js"; +import * as secp256k1 from "./hpke-dhkem-secp256k1.js"; export async function testServer(request) { const url = new URL(request.url); diff --git a/x/dhkemSecp256k1HkdfSha256/mod.ts b/x/dhkemSecp256k1HkdfSha256/mod.ts deleted file mode 100644 index 3b21062ae..000000000 --- a/x/dhkemSecp256k1HkdfSha256/mod.ts +++ /dev/null @@ -1 +0,0 @@ -export { DhkemSecp256k1HkdfSha256 } from "./src/dhkemSecp256k1HkdfSha256.ts";