From d5cdb5871614a7f6d80bae6129bff38cfd6bff18 Mon Sep 17 00:00:00 2001 From: Ajitomi Daisuke Date: Sun, 1 Sep 2024 22:39:11 +0900 Subject: [PATCH] Rename npm-packages/x to npm/packages. --- .github/workflows/ci_browser.yml | 2 +- .github/workflows/ci_node.yml | 28 +-- .github/workflows/publish.yml | 14 +- .gitignore | 3 +- deno.json | 48 +++--- deno.lock | 16 +- npm-packages/package.json | 13 -- {npm-packages => npm}/package-lock.json | 162 ++++++++++++++++-- npm/package.json | 13 ++ packages/chacha20poly1305/deno.json | 2 +- packages/chacha20poly1305/dnt.ts | 10 +- packages/chacha20poly1305/tsconfig.json | 2 +- packages/core/deno.json | 2 +- packages/core/dnt.ts | 8 +- packages/dhkem-secp256k1/deno.json | 2 +- packages/dhkem-secp256k1/dnt.ts | 8 +- packages/dhkem-secp256k1/tsconfig.json | 2 +- packages/dhkem-x25519/deno.json | 2 +- packages/dhkem-x25519/dnt.ts | 8 +- packages/dhkem-x25519/tsconfig.json | 2 +- packages/dhkem-x448/deno.json | 2 +- packages/dhkem-x448/dnt.ts | 8 +- packages/dhkem-x448/tsconfig.json | 2 +- packages/hpke-js/deno.json | 2 +- packages/hpke-js/dnt.ts | 8 +- packages/hpke-js/tsconfig.json | 2 +- packages/hybridkem-x25519-kyber768/deno.json | 2 +- packages/hybridkem-x25519-kyber768/dnt.ts | 8 +- .../hybridkem-x25519-kyber768/tsconfig.json | 2 +- 29 files changed, 255 insertions(+), 128 deletions(-) delete mode 100644 npm-packages/package.json rename {npm-packages => npm}/package-lock.json (64%) create mode 100644 npm/package.json diff --git a/.github/workflows/ci_browser.yml b/.github/workflows/ci_browser.yml index c8ff77c8b..6054f294f 100644 --- a/.github/workflows/ci_browser.yml +++ b/.github/workflows/ci_browser.yml @@ -28,7 +28,7 @@ jobs: - name: Run dnt run: deno task dnt - name: Run npm install - working-directory: ./npm-packages + working-directory: ./npm run: npm install - name: Create pages directory working-directory: ./packages/hpke-js diff --git a/.github/workflows/ci_node.yml b/.github/workflows/ci_node.yml index ede8fa14a..72d7d1f8a 100644 --- a/.github/workflows/ci_node.yml +++ b/.github/workflows/ci_node.yml @@ -29,55 +29,55 @@ jobs: working-directory: ./packages/core run: | deno task dnt - deno task minify > ../../npm-packages/x/core/hpke-core.min.js + deno task minify > ../../npm/packages/core/hpke-core.min.js - name: Publish to npm (dry) for /packages/core - working-directory: ./npm-packages/x/core + working-directory: ./npm/packages/core run: npm publish --dry-run - name: Run dnt & minify for /packages/chacha20poly1305 working-directory: ./packages/chacha20poly1305 run: | deno task dnt - deno task minify > ../../npm-packages/x/chacha20poly1305/hpke-chacha20poly1305.min.js + deno task minify > ../../npm/packages/chacha20poly1305/hpke-chacha20poly1305.min.js - name: Publish to npm (dry) for /packages/chacha20poly1305 - working-directory: ./npm-packages/x/chacha20poly1305 + working-directory: ./npm/packages/chacha20poly1305 run: npm publish --dry-run - name: Run dnt & minify for /packages/dhkem-x25519 working-directory: ./packages/dhkem-x25519 run: | deno task dnt - deno task minify > ../../npm-packages/x/dhkem-x25519/hpke-dhkem-x25519.min.js + deno task minify > ../../npm/packages/dhkem-x25519/hpke-dhkem-x25519.min.js - name: Publish to npm (dry) for /packages/dhkem-x25519 - working-directory: ./npm-packages/x/dhkem-x25519 + working-directory: ./npm/packages/dhkem-x25519 run: npm publish --dry-run - name: Run dnt & minify for /packages/dhkem-x448 working-directory: ./packages/dhkem-x448 run: | deno task dnt - deno task minify > ../../npm-packages/x/dhkem-x448/hpke-dhkem-x448.min.js + deno task minify > ../../npm/packages/dhkem-x448/hpke-dhkem-x448.min.js - name: Publish to npm (dry) for /packages/dhkem-x448 - working-directory: ./npm-packages/x/dhkem-x448 + working-directory: ./npm/packages/dhkem-x448 run: npm publish --dry-run - name: Run dnt & minify for /packages/hybridkem-x25519-kyber768 working-directory: ./packages/hybridkem-x25519-kyber768 run: | deno task dnt - deno task minify > ../../npm-packages/x/hybridkem-x25519-kyber768/hpke-hybridkem-x25519-kyber768.min.js + deno task minify > ../../npm/packages/hybridkem-x25519-kyber768/hpke-hybridkem-x25519-kyber768.min.js - name: Publish to npm (dry) for /packages/hybridkem-x25519-kyber768 - working-directory: ./npm-packages/x/hybridkem-x25519-kyber768 + working-directory: ./npm/packages/hybridkem-x25519-kyber768 run: npm publish --dry-run - name: Run dnt & minify for /packages/dhkem-secp256k1 working-directory: ./packages/dhkem-secp256k1 run: | deno task dnt - deno task minify > ../../npm-packages/x/dhkem-secp256k1/hpke-dhkem-secp256k1.min.js + deno task minify > ../../npm/packages/dhkem-secp256k1/hpke-dhkem-secp256k1.min.js - name: Publish to npm (dry) for /packages/dhkem-secp256k1 - working-directory: ./npm-packages/x/dhkem-secp256k1 + working-directory: ./npm/packages/dhkem-secp256k1 run: npm publish --dry-run - name: Run dnt & minify for /packages/hpke-js working-directory: ./packages/hpke-js run: | deno task dnt - deno task minify > ../../npm-packages/x/hpke-js/hpke.min.js + deno task minify > ../../npm/packages/hpke-js/hpke.min.js - name: Publish to npm (dry) for /packages/hpke-js - working-directory: ./npm-packages/x/hpke-js + working-directory: ./npm/packages/hpke-js run: npm publish --dry-run \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2238d1b6b..abfdd4c15 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -35,7 +35,7 @@ jobs: npm install -g esbuild deno task dnt - name: Publish to npm - working-directory: ./npm-packages/x/core + working-directory: ./npm/packages/core run: npm publish env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} @@ -58,7 +58,7 @@ jobs: npm install -g esbuild deno task dnt - name: Publish to npm - working-directory: ./npm-packages/x/chacha20poly1305 + working-directory: ./npm/packages/chacha20poly1305 run: npm publish env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} @@ -81,7 +81,7 @@ jobs: npm install -g esbuild deno task dnt - name: Publish to npm - working-directory: ./npm-packages/x/dhkem-x25519 + working-directory: ./npm/packages/dhkem-x25519 run: npm publish env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} @@ -104,7 +104,7 @@ jobs: npm install -g esbuild deno task dnt - name: Publish to npm - working-directory: ./npm-packages/x/dhkem-x448 + working-directory: ./npm/packages/dhkem-x448 run: npm publish env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} @@ -127,7 +127,7 @@ jobs: npm install -g esbuild deno task dnt - name: Publish to npm - working-directory: ./npm-packages/x/hybridkem-x25519-kyber768 + working-directory: ./npm/packages/hybridkem-x25519-kyber768 run: npm publish env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} @@ -150,7 +150,7 @@ jobs: npm install -g esbuild deno task dnt - name: Publish to npm - working-directory: ./npm-packages/x/dhkem-secp256k1 + working-directory: ./npm/packages/dhkem-secp256k1 run: npm publish env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} @@ -173,7 +173,7 @@ jobs: npm install -g esbuild deno task dnt - name: Publish to npm - working-directory: ./npm-packages/x/hpke-js + working-directory: ./npm/packages/hpke-js run: npm publish env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/.gitignore b/.gitignore index 1e8498bf2..b944a1b6f 100644 --- a/.gitignore +++ b/.gitignore @@ -80,8 +80,7 @@ typings/ docs/ # npm files generated by dnt -npm/ -npm-packages/x +npm/packages # Gatsby files .cache/ diff --git a/deno.json b/deno.json index 91736804a..4b850fa14 100644 --- a/deno.json +++ b/deno.json @@ -22,7 +22,7 @@ }, "fmt": { "exclude": [ - "npm-packages/", + "npm/", "**/*/*.js", "**/*/npm/", "coverage/*.json" @@ -30,7 +30,7 @@ }, "lint": { "exclude": [ - "npm-packages/", + "npm/", "**/*/*.js", "**/*/npm/", "coverage/*.json" @@ -38,7 +38,7 @@ }, "test": { "exclude": [ - "npm-packages/", + "npm/", "**/*/*.js", "**/*/npm/", "coverage/*.json" @@ -57,28 +57,28 @@ "dnt:hybridkem-x25519-kyber768": "cd packages/hybridkem-x25519-kyber768 && deno task dnt", "dnt:hpke-js": "cd packages/hpke-js && deno task dnt", "npm-link": "deno task npm-link:core && deno task npm-link:chacha20poly1305 && deno task npm-link:dhkem-x25519 && deno task npm-link:dhkem-x448 && deno task npm-link:dhkem-secp256k1 && deno task npm-link:hybridkem-x25519-kyber768 && deno task npm-link:hpke-js", - "npm-link:core": "cd npm-packages/x/core && npm link", - "npm-link:chacha20poly1305": "cd npm-packages/x/chacha20poly1305 && npm link", - "npm-link:dhkem-x25519": "cd npm-packages/x/dhkem-x25519 && npm link", - "npm-link:dhkem-x448": "cd npm-packages/x/dhkem-x448 && npm link", - "npm-link:dhkem-secp256k1": "cd npm-packages/x/dhkem-secp256k1 && npm link", - "npm-link:hybridkem-x25519-kyber768": "cd npm-packages/x/hybridkem-x25519-kyber768 && npm link", - "npm-link:hpke-js": "cd npm-packages/x/hpke-js && npm link", + "npm-link:core": "cd npm/packages/core && npm link", + "npm-link:chacha20poly1305": "cd npm/packages/chacha20poly1305 && npm link", + "npm-link:dhkem-x25519": "cd npm/packages/dhkem-x25519 && npm link", + "npm-link:dhkem-x448": "cd npm/packages/dhkem-x448 && npm link", + "npm-link:dhkem-secp256k1": "cd npm/packages/dhkem-secp256k1 && npm link", + "npm-link:hybridkem-x25519-kyber768": "cd npm/packages/hybridkem-x25519-kyber768 && npm link", + "npm-link:hpke-js": "cd npm/packages/hpke-js && npm link", "npm-pack": "deno task npm-pack:core && deno task npm-pack:chacha20poly1305 && deno task npm-pack:dhkem-x25519 && deno task npm-pack:dhkem-x448 && deno task npm-pack:dhkem-secp256k1 && deno task npm-pack:hybridkem-x25519-kyber768 && deno task npm-pack:hpke-js", - "npm-pack:core": "cd npm-packages/x/core && npm pack --dry-run", - "npm-pack:chacha20poly1305": "cd npm-packages/x/chacha20poly1305 && npm pack --dry-run", - "npm-pack:dhkem-x25519": "cd npm-packages/x/dhkem-x25519 && npm pack --dry-run", - "npm-pack:dhkem-x448": "cd npm-packages/x/dhkem-x448 && npm pack --dry-run", - "npm-pack:dhkem-secp256k1": "cd npm-packages/x/dhkem-secp256k1 && npm pack --dry-run", - "npm-pack:hybridkem-x25519-kyber768": "cd npm-packages/x/hybridkem-x25519-kyber768 && npm pack --dry-run", - "npm-pack:hpke-js": "cd npm-packages/x/hpke-js && npm pack --dry-run", + "npm-pack:core": "cd npm/packages/core && npm pack --dry-run", + "npm-pack:chacha20poly1305": "cd npm/packages/chacha20poly1305 && npm pack --dry-run", + "npm-pack:dhkem-x25519": "cd npm/packages/dhkem-x25519 && npm pack --dry-run", + "npm-pack:dhkem-x448": "cd npm/packages/dhkem-x448 && npm pack --dry-run", + "npm-pack:dhkem-secp256k1": "cd npm/packages/dhkem-secp256k1 && npm pack --dry-run", + "npm-pack:hybridkem-x25519-kyber768": "cd npm/packages/hybridkem-x25519-kyber768 && npm pack --dry-run", + "npm-pack:hpke-js": "cd npm/packages/hpke-js && npm pack --dry-run", "bun-link": "deno task bun-link:core && deno task bun-link:chacha20poly1305 && deno task bun-link:dhkem-x25519 && deno task bun-link:dhkem-x448 && deno task bun-link:dhkem-secp256k1 && deno task bun-link:hybridkem-x25519-kyber768 && deno task bun-link:hpke-js", - "bun-link:core": "cd npm-packages/x/core && bun link", - "bun-link:chacha20poly1305": "cd npm-packages/x/chacha20poly1305 && bun link", - "bun-link:dhkem-x25519": "cd npm-packages/x/dhkem-x25519 && bun link", - "bun-link:dhkem-x448": "cd npm-packages/x/dhkem-x448 && bun link", - "bun-link:dhkem-secp256k1": "cd npm-packages/x/dhkem-secp256k1 && bun link", - "bun-link:hybridkem-x25519-kyber768": "cd npm-packages/x/hybridkem-x25519-kyber768 && bun link", - "bun-link:hpke-js": "cd npm-packages/x/hpke-js && bun link" + "bun-link:core": "cd npm/packages/core && bun link", + "bun-link:chacha20poly1305": "cd npm/packages/chacha20poly1305 && bun link", + "bun-link:dhkem-x25519": "cd npm/packages/dhkem-x25519 && bun link", + "bun-link:dhkem-x448": "cd npm/packages/dhkem-x448 && bun link", + "bun-link:dhkem-secp256k1": "cd npm/packages/dhkem-secp256k1 && bun link", + "bun-link:hybridkem-x25519-kyber768": "cd npm/packages/hybridkem-x25519-kyber768 && bun link", + "bun-link:hpke-js": "cd npm/packages/hpke-js && bun link" } } diff --git a/deno.lock b/deno.lock index 66b05966c..b7cd79b21 100644 --- a/deno.lock +++ b/deno.lock @@ -248,47 +248,47 @@ "jsr:@std/testing@^1.0.0" ], "members": { - "x/chacha20poly1305": { + "packages/chacha20poly1305": { "dependencies": [ "npm:@noble/ciphers@^0.5.3" ] }, - "x/chacha20poly1305/samples/deno": { + "packages/chacha20poly1305/samples/deno": { "dependencies": [ "jsr:@hpke/chacha20poly1305@^1.3.0", "jsr:@hpke/core@^1.3.0" ] }, - "x/core": { + "packages/core": { "dependencies": [ "jsr:@deno/dnt@^0.41.2", "jsr:@std/assert@1.0.0", "jsr:@std/testing@^1.0.0" ] }, - "x/dhkem-secp256k1": { + "packages/dhkem-secp256k1": { "dependencies": [ "npm:@noble/curves@^1.4.2" ] }, - "x/dhkem-x25519": { + "packages/dhkem-x25519": { "dependencies": [ "npm:@noble/curves@^1.4.2", "npm:@noble/hashes@^1.4.0" ] }, - "x/dhkem-x448": { + "packages/dhkem-x448": { "dependencies": [ "npm:@noble/curves@^1.4.2", "npm:@noble/hashes@^1.4.0" ] }, - "x/hpke-js": { + "packages/hpke-js": { "dependencies": [ "npm:@noble/hashes@^1.4.0" ] }, - "x/hybridkem-x25519-kyber768": { + "packages/hybridkem-x25519-kyber768": { "dependencies": [ "npm:@noble/hashes@^1.4.0" ] diff --git a/npm-packages/package.json b/npm-packages/package.json deleted file mode 100644 index 02218852d..000000000 --- a/npm-packages/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "hpke-js", - "private": true, - "workspaces": [ - "x/core", - "x/chacha20poly1305", - "x/dhkem-x25519", - "x/dhkem-x448", - "x/dhkem-secp256k1", - "x/hybridkem-x25519-kyber768", - "x/hpke-js" - ] -} diff --git a/npm-packages/package-lock.json b/npm/package-lock.json similarity index 64% rename from npm-packages/package-lock.json rename to npm/package-lock.json index 53dd97c4b..17e589e40 100644 --- a/npm-packages/package-lock.json +++ b/npm/package-lock.json @@ -6,13 +6,13 @@ "": { "name": "hpke-js", "workspaces": [ - "x/core", - "x/chacha20poly1305", - "x/dhkem-x25519", - "x/dhkem-x448", - "x/dhkem-secp256k1", - "x/hybridkem-x25519-kyber768", - "x/hpke-js" + "packages/core", + "packages/chacha20poly1305", + "packages/dhkem-x25519", + "packages/dhkem-x448", + "packages/dhkem-secp256k1", + "packages/hybridkem-x25519-kyber768", + "packages/hpke-js" ] }, "node_modules/@deno/shim-deno": { @@ -34,27 +34,27 @@ "license": "MIT" }, "node_modules/@hpke/chacha20poly1305": { - "resolved": "x/chacha20poly1305", + "resolved": "packages/chacha20poly1305", "link": true }, "node_modules/@hpke/core": { - "resolved": "x/core", + "resolved": "packages/core", "link": true }, "node_modules/@hpke/dhkem-secp256k1": { - "resolved": "x/dhkem-secp256k1", + "resolved": "packages/dhkem-secp256k1", "link": true }, "node_modules/@hpke/dhkem-x25519": { - "resolved": "x/dhkem-x25519", + "resolved": "packages/dhkem-x25519", "link": true }, "node_modules/@hpke/dhkem-x448": { - "resolved": "x/dhkem-x448", + "resolved": "packages/dhkem-x448", "link": true }, "node_modules/@hpke/hybridkem-x25519-kyber768": { - "resolved": "x/hybridkem-x25519-kyber768", + "resolved": "packages/hybridkem-x25519-kyber768", "link": true }, "node_modules/@noble/ciphers": { @@ -67,9 +67,9 @@ } }, "node_modules/@noble/curves": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", - "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.5.0.tgz", + "integrity": "sha512-J5EKamIHnKPyClwVrzmaf5wSdQXgdHcPZIZLu3bwnbeCx8/7NPK5q2ZBWF+5FvYGByjiQQsJYX6jfgB2wDPn3A==", "license": "MIT", "dependencies": { "@noble/hashes": "1.4.0" @@ -101,7 +101,7 @@ } }, "node_modules/hpke-js": { - "resolved": "x/hpke-js", + "resolved": "packages/hpke-js", "link": true }, "node_modules/isexe": { @@ -144,9 +144,131 @@ "node": "^16.13.0 || >=18.0.0" } }, + "packages/chacha20poly1305": { + "name": "@hpke/chacha20poly1305", + "version": "1.3.1", + "license": "MIT", + "dependencies": { + "@hpke/core": "^1.3.0", + "@noble/ciphers": "^0.5.3" + }, + "devDependencies": { + "@deno/shim-deno": "~0.18.0", + "@types/node": "^20.9.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "packages/core": { + "name": "@hpke/core", + "version": "1.3.1", + "license": "MIT", + "devDependencies": { + "@deno/shim-deno": "~0.18.0", + "@types/node": "^20.9.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "packages/dhkem-secp256k1": { + "name": "@hpke/dhkem-secp256k1", + "version": "1.3.1", + "license": "MIT", + "dependencies": { + "@hpke/core": "^1.3.0", + "@hpke/dhkem-x25519": "^1.3.0", + "@noble/curves": "^1.4.2" + }, + "devDependencies": { + "@deno/shim-deno": "~0.18.0", + "@types/node": "^20.9.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "packages/dhkem-x25519": { + "name": "@hpke/dhkem-x25519", + "version": "1.3.1", + "license": "MIT", + "dependencies": { + "@hpke/core": "^1.3.0", + "@noble/curves": "^1.4.2", + "@noble/hashes": "^1.4.0" + }, + "devDependencies": { + "@deno/shim-deno": "~0.18.0", + "@types/node": "^20.9.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "packages/dhkem-x448": { + "name": "@hpke/dhkem-x448", + "version": "1.3.1", + "license": "MIT", + "dependencies": { + "@hpke/core": "^1.3.0", + "@noble/curves": "^1.4.2", + "@noble/hashes": "^1.4.0" + }, + "devDependencies": { + "@deno/shim-deno": "~0.18.0", + "@types/node": "^20.9.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "packages/hpke-js": { + "version": "1.3.1", + "license": "MIT", + "dependencies": { + "@hpke/chacha20poly1305": "^1.3.0", + "@hpke/core": "^1.3.0", + "@hpke/dhkem-x25519": "^1.3.0", + "@hpke/dhkem-x448": "^1.3.0", + "@noble/hashes": "^1.4.0" + }, + "devDependencies": { + "@deno/shim-deno": "~0.18.0", + "@types/node": "^20.9.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "packages/hybridkem-x25519-kyber768": { + "name": "@hpke/hybridkem-x25519-kyber768", + "version": "1.3.1", + "license": "MIT", + "dependencies": { + "@hpke/core": "^1.3.0", + "@hpke/dhkem-x25519": "^1.3.0", + "@noble/hashes": "^1.4.0" + }, + "devDependencies": { + "@deno/shim-deno": "~0.18.0", + "@types/node": "^20.9.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, "x/chacha20poly1305": { "name": "@hpke/chacha20poly1305", "version": "1.3.1", + "extraneous": true, "license": "MIT", "dependencies": { "@hpke/core": "^1.3.0", @@ -164,6 +286,7 @@ "x/core": { "name": "@hpke/core", "version": "1.3.1", + "extraneous": true, "license": "MIT", "devDependencies": { "@deno/shim-deno": "~0.18.0", @@ -177,6 +300,7 @@ "x/dhkem-secp256k1": { "name": "@hpke/dhkem-secp256k1", "version": "1.3.1", + "extraneous": true, "license": "MIT", "dependencies": { "@hpke/core": "^1.3.0", @@ -195,6 +319,7 @@ "x/dhkem-x25519": { "name": "@hpke/dhkem-x25519", "version": "1.3.1", + "extraneous": true, "license": "MIT", "dependencies": { "@hpke/core": "^1.3.0", @@ -213,6 +338,7 @@ "x/dhkem-x448": { "name": "@hpke/dhkem-x448", "version": "1.3.1", + "extraneous": true, "license": "MIT", "dependencies": { "@hpke/core": "^1.3.0", @@ -230,6 +356,7 @@ }, "x/hpke-js": { "version": "1.3.1", + "extraneous": true, "license": "MIT", "dependencies": { "@hpke/chacha20poly1305": "^1.3.0", @@ -250,6 +377,7 @@ "x/hybridkem-x25519-kyber768": { "name": "@hpke/hybridkem-x25519-kyber768", "version": "1.3.1", + "extraneous": true, "license": "MIT", "dependencies": { "@hpke/core": "^1.3.0", diff --git a/npm/package.json b/npm/package.json new file mode 100644 index 000000000..7e1792a80 --- /dev/null +++ b/npm/package.json @@ -0,0 +1,13 @@ +{ + "name": "hpke-js", + "private": true, + "workspaces": [ + "packages/core", + "packages/chacha20poly1305", + "packages/dhkem-x25519", + "packages/dhkem-x448", + "packages/dhkem-secp256k1", + "packages/hybridkem-x25519-kyber768", + "packages/hpke-js" + ] +} diff --git a/packages/chacha20poly1305/deno.json b/packages/chacha20poly1305/deno.json index 56c1c7200..6a9e7cb6f 100644 --- a/packages/chacha20poly1305/deno.json +++ b/packages/chacha20poly1305/deno.json @@ -50,6 +50,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", - "minify": "esbuild ../../npm-packages/x/chacha20poly1305/esm/chacha20poly1305/mod.js --bundle --format=esm --minify" + "minify": "esbuild ../../npm/packages/chacha20poly1305/esm/chacha20poly1305/mod.js --bundle --format=esm --minify" } } diff --git a/packages/chacha20poly1305/dnt.ts b/packages/chacha20poly1305/dnt.ts index 728c1687a..934b18d89 100644 --- a/packages/chacha20poly1305/dnt.ts +++ b/packages/chacha20poly1305/dnt.ts @@ -1,6 +1,6 @@ import { build, emptyDir } from "@deno/dnt"; -await emptyDir("../../npm-packages/x/chacha20poly1305"); +await emptyDir("../../npm/packages/chacha20poly1305"); await emptyDir("test/runtimes/browsers/node_modules"); await emptyDir("test/runtimes/bun/node_modules"); await emptyDir("test/runtimes/cloudflare/node_modules"); @@ -9,7 +9,7 @@ const denoPkg = JSON.parse(await Deno.readTextFile("./deno.json")); await build({ entryPoints: ["./mod.ts"], - outDir: "../../npm-packages/x/chacha20poly1305", + outDir: "../../npm/packages/chacha20poly1305", typeCheck: "both", test: true, declaration: true, @@ -31,7 +31,7 @@ await build({ url: "git+https://github.com/dajiaji/hpke-js.git", }, homepage: - "https://github.com/dajiaji/hpke-js/tree/main/x/chacha20poly1305#readme", + "https://github.com/dajiaji/hpke-js/tree/main/packages/chacha20poly1305#readme", license: "MIT", module: "./esm/chacha20poly1305/mod.js", main: "./script/chacha20poly1305/mod.js", @@ -64,8 +64,8 @@ await build({ }); // post build steps -Deno.copyFileSync("LICENSE", "../../npm-packages/x/chacha20poly1305/LICENSE"); +Deno.copyFileSync("LICENSE", "../../npm/packages/chacha20poly1305/LICENSE"); Deno.copyFileSync( "README.md", - "../../npm-packages/x/chacha20poly1305/README.md", + "../../npm/packages/chacha20poly1305/README.md", ); diff --git a/packages/chacha20poly1305/tsconfig.json b/packages/chacha20poly1305/tsconfig.json index 731e85d25..dc935c69b 100644 --- a/packages/chacha20poly1305/tsconfig.json +++ b/packages/chacha20poly1305/tsconfig.json @@ -4,7 +4,7 @@ "target": "es2022", "paths": { "@hpke/core": ["../core/mod.ts"], - "@noble/*": ["../../npm-packages/node_modules/@noble/*"] + "@noble/*": ["../../npm/node_modules/@noble/*"] }, "noEmit": true, "allowImportingTsExtensions": true diff --git a/packages/core/deno.json b/packages/core/deno.json index f8f312998..f0ae6eda2 100644 --- a/packages/core/deno.json +++ b/packages/core/deno.json @@ -51,6 +51,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", - "minify": "esbuild ../../npm-packages/x/core/esm/mod.js --bundle --format=esm --minify" + "minify": "esbuild ../../npm/packages/core/esm/mod.js --bundle --format=esm --minify" } } diff --git a/packages/core/dnt.ts b/packages/core/dnt.ts index 53b85fa3b..ec5f92efa 100644 --- a/packages/core/dnt.ts +++ b/packages/core/dnt.ts @@ -1,6 +1,6 @@ import { build, emptyDir } from "@deno/dnt"; -await emptyDir("../../npm-packages/x/core"); +await emptyDir("../../npm/packages/core"); await emptyDir("test/runtimes/browsers/node_modules"); await emptyDir("test/runtimes/bun/node_modules"); await emptyDir("test/runtimes/cloudflare/node_modules"); @@ -9,7 +9,7 @@ const denoPkg = JSON.parse(await Deno.readTextFile("./deno.json")); await build({ entryPoints: ["./mod.ts"], - outDir: "../../npm-packages/x/core", + outDir: "../../npm/packages/core", typeCheck: "both", test: true, declaration: true, @@ -62,5 +62,5 @@ await build({ }); // post build steps -Deno.copyFileSync("LICENSE", "../../npm-packages/x/core/LICENSE"); -Deno.copyFileSync("README.md", "../../npm-packages/x/core/README.md"); +Deno.copyFileSync("LICENSE", "../../npm/packages/core/LICENSE"); +Deno.copyFileSync("README.md", "../../npm/packages/core/README.md"); diff --git a/packages/dhkem-secp256k1/deno.json b/packages/dhkem-secp256k1/deno.json index c606776f3..dbdc62c11 100644 --- a/packages/dhkem-secp256k1/deno.json +++ b/packages/dhkem-secp256k1/deno.json @@ -50,6 +50,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", - "minify": "esbuild ../../npm-packages/x/dhkem-secp256k1/esm/dhkem-secp256k1/mod.js --bundle --format=esm --minify" + "minify": "esbuild ../../npm/packages/dhkem-secp256k1/esm/dhkem-secp256k1/mod.js --bundle --format=esm --minify" } } diff --git a/packages/dhkem-secp256k1/dnt.ts b/packages/dhkem-secp256k1/dnt.ts index 8d18ab140..b1ad22475 100644 --- a/packages/dhkem-secp256k1/dnt.ts +++ b/packages/dhkem-secp256k1/dnt.ts @@ -1,6 +1,6 @@ import { build, emptyDir } from "@deno/dnt"; -await emptyDir("../../npm-packages/x/dhkem-secp256k1"); +await emptyDir("../../npm/packages/dhkem-secp256k1"); await emptyDir("test/runtimes/browsers/node_modules"); await emptyDir("test/runtimes/bun/node_modules"); await emptyDir("test/runtimes/cloudflare/node_modules"); @@ -9,7 +9,7 @@ const denoPkg = JSON.parse(await Deno.readTextFile("./deno.json")); await build({ entryPoints: ["./mod.ts"], - outDir: "../../npm-packages/x/dhkem-secp256k1", + outDir: "../../npm/packages/dhkem-secp256k1", typeCheck: "both", test: true, declaration: true, @@ -64,8 +64,8 @@ await build({ }); // post build steps -Deno.copyFileSync("LICENSE", "../../npm-packages/x/dhkem-secp256k1/LICENSE"); +Deno.copyFileSync("LICENSE", "../../npm/packages/dhkem-secp256k1/LICENSE"); Deno.copyFileSync( "README.md", - "../../npm-packages/x/dhkem-secp256k1/README.md", + "../../npm/packages/dhkem-secp256k1/README.md", ); diff --git a/packages/dhkem-secp256k1/tsconfig.json b/packages/dhkem-secp256k1/tsconfig.json index 73380663c..086f69a0c 100644 --- a/packages/dhkem-secp256k1/tsconfig.json +++ b/packages/dhkem-secp256k1/tsconfig.json @@ -5,7 +5,7 @@ "paths": { "@hpke/core": ["../core/mod.ts"], "@hpke/dhkem-x25519": ["../dhkem-x25519/mod.ts"], - "@noble/*": ["../../npm-packages/node_modules/@noble/*"] + "@noble/*": ["../../npm/node_modules/@noble/*"] }, "noEmit": true, "allowImportingTsExtensions": true diff --git a/packages/dhkem-x25519/deno.json b/packages/dhkem-x25519/deno.json index 373d30aa1..83c998d29 100644 --- a/packages/dhkem-x25519/deno.json +++ b/packages/dhkem-x25519/deno.json @@ -51,6 +51,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", - "minify": "esbuild ../../npm-packages/x/dhkem-x25519/esm/dhkem-x25519/mod.js --bundle --format=esm --minify" + "minify": "esbuild ../../npm/packages/dhkem-x25519/esm/dhkem-x25519/mod.js --bundle --format=esm --minify" } } diff --git a/packages/dhkem-x25519/dnt.ts b/packages/dhkem-x25519/dnt.ts index 7efb22d52..28b5c32fa 100644 --- a/packages/dhkem-x25519/dnt.ts +++ b/packages/dhkem-x25519/dnt.ts @@ -1,6 +1,6 @@ import { build, emptyDir } from "@deno/dnt"; -await emptyDir("../../npm-packages/x/dhkem-x25519"); +await emptyDir("../../npm/packages/dhkem-x25519"); await emptyDir("test/runtimes/browsers/node_modules"); await emptyDir("test/runtimes/bun/node_modules"); await emptyDir("test/runtimes/cloudflare/node_modules"); @@ -9,7 +9,7 @@ const denoPkg = JSON.parse(await Deno.readTextFile("./deno.json")); await build({ entryPoints: ["./mod.ts"], - outDir: "../../npm-packages/x/dhkem-x25519", + outDir: "../../npm/packages/dhkem-x25519", typeCheck: "both", test: true, declaration: true, @@ -64,5 +64,5 @@ await build({ }); // post build steps -Deno.copyFileSync("LICENSE", "../../npm-packages/x/dhkem-x25519/LICENSE"); -Deno.copyFileSync("README.md", "../../npm-packages/x/dhkem-x25519/README.md"); +Deno.copyFileSync("LICENSE", "../../npm/packages/dhkem-x25519/LICENSE"); +Deno.copyFileSync("README.md", "../../npm/packages/dhkem-x25519/README.md"); diff --git a/packages/dhkem-x25519/tsconfig.json b/packages/dhkem-x25519/tsconfig.json index 731e85d25..dc935c69b 100644 --- a/packages/dhkem-x25519/tsconfig.json +++ b/packages/dhkem-x25519/tsconfig.json @@ -4,7 +4,7 @@ "target": "es2022", "paths": { "@hpke/core": ["../core/mod.ts"], - "@noble/*": ["../../npm-packages/node_modules/@noble/*"] + "@noble/*": ["../../npm/node_modules/@noble/*"] }, "noEmit": true, "allowImportingTsExtensions": true diff --git a/packages/dhkem-x448/deno.json b/packages/dhkem-x448/deno.json index 5b80c90f3..c0646a8ca 100644 --- a/packages/dhkem-x448/deno.json +++ b/packages/dhkem-x448/deno.json @@ -51,6 +51,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", - "minify": "esbuild ../../npm-packages/x/dhkem-x448/esm/dhkem-x448/mod.js --bundle --format=esm --minify" + "minify": "esbuild ../../npm/packages/dhkem-x448/esm/dhkem-x448/mod.js --bundle --format=esm --minify" } } diff --git a/packages/dhkem-x448/dnt.ts b/packages/dhkem-x448/dnt.ts index bd004c62f..3764e4e66 100644 --- a/packages/dhkem-x448/dnt.ts +++ b/packages/dhkem-x448/dnt.ts @@ -1,6 +1,6 @@ import { build, emptyDir } from "@deno/dnt"; -await emptyDir("../../npm-packages/x/dhkem-x448"); +await emptyDir("../../npm/packages/dhkem-x448"); await emptyDir("test/runtimes/browsers/node_modules"); await emptyDir("test/runtimes/bun/node_modules"); await emptyDir("test/runtimes/cloudflare/node_modules"); @@ -9,7 +9,7 @@ const denoPkg = JSON.parse(await Deno.readTextFile("./deno.json")); await build({ entryPoints: ["./mod.ts"], - outDir: "../../npm-packages/x/dhkem-x448", + outDir: "../../npm/packages/dhkem-x448", typeCheck: "both", test: true, declaration: true, @@ -64,5 +64,5 @@ await build({ }); // post build steps -Deno.copyFileSync("LICENSE", "../../npm-packages/x/dhkem-x448/LICENSE"); -Deno.copyFileSync("README.md", "../../npm-packages/x/dhkem-x448/README.md"); +Deno.copyFileSync("LICENSE", "../../npm/packages/dhkem-x448/LICENSE"); +Deno.copyFileSync("README.md", "../../npm/packages/dhkem-x448/README.md"); diff --git a/packages/dhkem-x448/tsconfig.json b/packages/dhkem-x448/tsconfig.json index 731e85d25..dc935c69b 100644 --- a/packages/dhkem-x448/tsconfig.json +++ b/packages/dhkem-x448/tsconfig.json @@ -4,7 +4,7 @@ "target": "es2022", "paths": { "@hpke/core": ["../core/mod.ts"], - "@noble/*": ["../../npm-packages/node_modules/@noble/*"] + "@noble/*": ["../../npm/node_modules/@noble/*"] }, "noEmit": true, "allowImportingTsExtensions": true diff --git a/packages/hpke-js/deno.json b/packages/hpke-js/deno.json index c1a1a0a31..9dfe55a2b 100644 --- a/packages/hpke-js/deno.json +++ b/packages/hpke-js/deno.json @@ -50,6 +50,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", - "minify": "esbuild ../../npm-packages/x/hpke-js/esm/hpke-js/mod.js --bundle --format=esm --minify" + "minify": "esbuild ../../npm/packages/hpke-js/esm/hpke-js/mod.js --bundle --format=esm --minify" } } diff --git a/packages/hpke-js/dnt.ts b/packages/hpke-js/dnt.ts index 78e0e69fb..c0d1f7c1d 100644 --- a/packages/hpke-js/dnt.ts +++ b/packages/hpke-js/dnt.ts @@ -1,6 +1,6 @@ import { build, emptyDir } from "@deno/dnt"; -await emptyDir("../../npm-packages/x/hpke-js"); +await emptyDir("../../npm/packages/hpke-js"); await emptyDir("test/runtimes/browsers/node_modules"); await emptyDir("test/runtimes/bun/node_modules"); await emptyDir("test/runtimes/cloudflare/node_modules"); @@ -9,7 +9,7 @@ const denoPkg = JSON.parse(await Deno.readTextFile("./deno.json")); await build({ entryPoints: ["./mod.ts"], - outDir: "../../npm-packages/x/hpke-js", + outDir: "../../npm/packages/hpke-js", typeCheck: "both", test: true, declaration: "inline", @@ -68,5 +68,5 @@ await build({ }); // post build steps -Deno.copyFileSync("LICENSE", "../../npm-packages/x/hpke-js/LICENSE"); -Deno.copyFileSync("README.md", "../../npm-packages/x/hpke-js/README.md"); +Deno.copyFileSync("LICENSE", "../../npm/packages/hpke-js/LICENSE"); +Deno.copyFileSync("README.md", "../../npm/packages/hpke-js/README.md"); diff --git a/packages/hpke-js/tsconfig.json b/packages/hpke-js/tsconfig.json index 2400af044..e9893b531 100644 --- a/packages/hpke-js/tsconfig.json +++ b/packages/hpke-js/tsconfig.json @@ -7,7 +7,7 @@ "@hpke/chacha20poly1305": ["../chacha20poly1305/mod.ts"], "@hpke/dhkem-x25519": ["../dhkem-x25519/mod.ts"], "@hpke/dhkem-x448": ["../dhkem-x448/mod.ts"], - "@noble/*": ["../../npm-packages/node_modules/@noble/*"] + "@noble/*": ["../../npm/node_modules/@noble/*"] }, "noEmit": true, "allowImportingTsExtensions": true diff --git a/packages/hybridkem-x25519-kyber768/deno.json b/packages/hybridkem-x25519-kyber768/deno.json index b18fd8645..dc1fad173 100644 --- a/packages/hybridkem-x25519-kyber768/deno.json +++ b/packages/hybridkem-x25519-kyber768/deno.json @@ -50,6 +50,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", - "minify": "esbuild ../../npm-packages/x/hybridkem-x25519-kyber768/esm/hybridkem-x25519-kyber768/mod.js --bundle --format=esm --minify" + "minify": "esbuild ../../npm/packages/hybridkem-x25519-kyber768/esm/hybridkem-x25519-kyber768/mod.js --bundle --format=esm --minify" } } diff --git a/packages/hybridkem-x25519-kyber768/dnt.ts b/packages/hybridkem-x25519-kyber768/dnt.ts index 59ab400f8..c1cbcd722 100644 --- a/packages/hybridkem-x25519-kyber768/dnt.ts +++ b/packages/hybridkem-x25519-kyber768/dnt.ts @@ -1,6 +1,6 @@ import { build, emptyDir } from "@deno/dnt"; -await emptyDir("../../npm-packages/x/hybridkem-x25519-kyber768"); +await emptyDir("../../npm/packages/hybridkem-x25519-kyber768"); await emptyDir("test/runtimes/browsers/node_modules"); await emptyDir("test/runtimes/bun/node_modules"); await emptyDir("test/runtimes/cloudflare/node_modules"); @@ -9,7 +9,7 @@ const denoPkg = JSON.parse(await Deno.readTextFile("./deno.json")); await build({ entryPoints: ["./mod.ts"], - outDir: "../../npm-packages/x/hybridkem-x25519-kyber768", + outDir: "../../npm/packages/hybridkem-x25519-kyber768", typeCheck: "both", test: true, declaration: true, @@ -66,9 +66,9 @@ await build({ // post build steps Deno.copyFileSync( "LICENSE", - "../../npm-packages/x/hybridkem-x25519-kyber768/LICENSE", + "../../npm/packages/hybridkem-x25519-kyber768/LICENSE", ); Deno.copyFileSync( "README.md", - "../../npm-packages/x/hybridkem-x25519-kyber768/README.md", + "../../npm/packages/hybridkem-x25519-kyber768/README.md", ); diff --git a/packages/hybridkem-x25519-kyber768/tsconfig.json b/packages/hybridkem-x25519-kyber768/tsconfig.json index 73380663c..086f69a0c 100644 --- a/packages/hybridkem-x25519-kyber768/tsconfig.json +++ b/packages/hybridkem-x25519-kyber768/tsconfig.json @@ -5,7 +5,7 @@ "paths": { "@hpke/core": ["../core/mod.ts"], "@hpke/dhkem-x25519": ["../dhkem-x25519/mod.ts"], - "@noble/*": ["../../npm-packages/node_modules/@noble/*"] + "@noble/*": ["../../npm/node_modules/@noble/*"] }, "noEmit": true, "allowImportingTsExtensions": true