Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine deno task sample:node. #439

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ docs/

# npm files generated by dnt
npm/packages
npm/samples

# Gatsby files
.cache/
Expand Down
14 changes: 7 additions & 7 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@
"sample:deno:hybridkem-x25519-kyber768": "cd packages/hybridkem-x25519-kyber768 && deno task sample:deno",
"sample:deno:hpke-js": "cd packages/hpke-js && deno task sample:deno",
"sample:node": "deno task sample:node:core && deno task sample:node:chacha20poly1305 && deno task sample:node:dhkem-x25519 && deno task sample:node:dhkem-x448 && deno task sample:node:dhkem-secp256k1 && deno task sample:node:hybridkem-x25519-kyber768 && deno task sample:node:hpke-js",
"sample:node:core": "cd packages/core && deno task sample:node",
"sample:node:chacha20poly1305": "cd packages/chacha20poly1305 && deno task sample:node",
"sample:node:dhkem-x25519": "cd packages/dhkem-x25519 && deno task sample:node",
"sample:node:dhkem-x448": "cd packages/dhkem-x448 && deno task sample:node",
"sample:node:dhkem-secp256k1": "cd packages/dhkem-secp256k1 && deno task sample:node",
"sample:node:hybridkem-x25519-kyber768": "cd packages/hybridkem-x25519-kyber768 && deno task sample:node",
"sample:node:hpke-js": "cd packages/hpke-js && deno task sample:node",
"sample:node:core": "cd npm && npm run test -w samples/core",
"sample:node:chacha20poly1305": "cd npm && npm run test -w samples/chacha20poly1305",
"sample:node:dhkem-x25519": "cd npm && npm run test -w samples/dhkem-x25519",
"sample:node:dhkem-x448": "cd npm && npm run test -w samples/dhkem-x448",
"sample:node:dhkem-secp256k1": "cd npm && npm run test -w samples/dhkem-secp256k1",
"sample:node:hybridkem-x25519-kyber768": "cd npm && npm run test -w samples/hybridkem-x25519-kyber768",
"sample:node:hpke-js": "cd npm && npm run test -w samples/hpke-js",
"update:cloudflare": "deno task update:cloudflare:core || deno task update:cloudflare:chacha20poly1305 || deno task update:cloudflare:dhkem-x25519 || deno task update:cloudflare:dhkem-x448 || deno task update:cloudflare:dhkem-secp256k1 || deno task update:cloudflare:hybridkem-x25519-kyber768 || deno task update:cloudflare:hpke-js",
"update:cloudflare:core": "cd packages/core/test/runtimes/cloudflare && npm audit fix",
"update:cloudflare:chacha20poly1305": "cd packages/chacha20poly1305/test/runtimes/cloudflare && npm audit fix",
Expand Down
141 changes: 69 additions & 72 deletions npm/package-lock.json

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

2 changes: 1 addition & 1 deletion npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"packages/dhkem-secp256k1",
"packages/hybridkem-x25519-kyber768",
"packages/hpke-js",
"../**/*/samples/node"
"samples/**/*"
]
}
1 change: 0 additions & 1 deletion packages/chacha20poly1305/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"cov": "deno coverage ./coverage --lcov --exclude='test'",
"dnt": "deno run --import-map=../../npm/import_map.json -A dnt.ts",
"sample:deno": "cd samples/deno && deno run main.ts",
"sample:node": "cd samples/node && npm install && node app.js",
"minify": "esbuild ../../npm/packages/chacha20poly1305/esm/mod.js --bundle --format=esm --minify"
}
}
9 changes: 9 additions & 0 deletions packages/chacha20poly1305/dnt.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { build, emptyDir } from "@deno/dnt";

await emptyDir("../../npm/packages/chacha20poly1305");
await emptyDir("../../npm/samples/chacha20poly1305");
await emptyDir("test/runtimes/browsers/node_modules");
await emptyDir("test/runtimes/bun/node_modules");
await emptyDir("test/runtimes/cloudflare/node_modules");
Expand Down Expand Up @@ -70,3 +71,11 @@ Deno.copyFileSync(
"README.md",
"../../npm/packages/chacha20poly1305/README.md",
);
Deno.copyFileSync(
"samples/node/app.js",
"../../npm/samples/chacha20poly1305/app.js",
);
Deno.copyFileSync(
"samples/node/package.json",
"../../npm/samples/chacha20poly1305/package.json",
);
3 changes: 3 additions & 0 deletions packages/chacha20poly1305/samples/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"main": "app.js",
"author": "Ajitomi Daisuke <[email protected]> (https://github.com/dajiaji)",
"license": "MIT",
"scripts": {
"test": "node app.js"
},
"dependencies": {
"@hpke/chacha20poly1305": "^1.4.3",
"@hpke/core": "^1.4.3"
Expand Down
6 changes: 6 additions & 0 deletions packages/core/dnt.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { build, emptyDir } from "@deno/dnt";

await emptyDir("../../npm/packages/core");
await emptyDir("../../npm/samples/core");
await emptyDir("test/runtimes/browsers/node_modules");
await emptyDir("test/runtimes/bun/node_modules");
await emptyDir("test/runtimes/cloudflare/node_modules");
Expand Down Expand Up @@ -65,3 +66,8 @@ await build({
// post build steps
Deno.copyFileSync("LICENSE", "../../npm/packages/core/LICENSE");
Deno.copyFileSync("README.md", "../../npm/packages/core/README.md");
Deno.copyFileSync("samples/node/app.js", "../../npm/samples/core/app.js");
Deno.copyFileSync(
"samples/node/package.json",
"../../npm/samples/core/package.json",
);
3 changes: 3 additions & 0 deletions packages/core/samples/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"main": "app.js",
"author": "Ajitomi Daisuke <[email protected]> (https://github.com/dajiaji)",
"license": "MIT",
"scripts": {
"test": "node app.js"
},
"dependencies": {
"@hpke/core": "^1.5.0"
}
Expand Down
9 changes: 9 additions & 0 deletions packages/dhkem-secp256k1/dnt.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { build, emptyDir } from "@deno/dnt";

await emptyDir("../../npm/packages/dhkem-secp256k1");
await emptyDir("../../npm/samples/dhkem-secp256k1");
await emptyDir("test/runtimes/browsers/node_modules");
await emptyDir("test/runtimes/bun/node_modules");
await emptyDir("test/runtimes/cloudflare/node_modules");
Expand Down Expand Up @@ -70,3 +71,11 @@ Deno.copyFileSync(
"README.md",
"../../npm/packages/dhkem-secp256k1/README.md",
);
Deno.copyFileSync(
"samples/node/app.js",
"../../npm/samples/dhkem-secp256k1/app.js",
);
Deno.copyFileSync(
"samples/node/package.json",
"../../npm/samples/dhkem-secp256k1/package.json",
);
3 changes: 3 additions & 0 deletions packages/dhkem-secp256k1/samples/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"main": "app.js",
"author": "Ajitomi Daisuke <[email protected]> (https://github.com/dajiaji)",
"license": "MIT",
"scripts": {
"test": "node app.js"
},
"dependencies": {
"@hpke/core": "^1.5.0",
"@hpke/dhkem-secp256k1": "^1.5.0"
Expand Down
9 changes: 9 additions & 0 deletions packages/dhkem-x25519/dnt.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { build, emptyDir } from "jsr:@deno/dnt";

await emptyDir("../../npm/packages/dhkem-x25519");
await emptyDir("../../npm/samples/dhkem-x25519");
await emptyDir("test/runtimes/browsers/node_modules");
await emptyDir("test/runtimes/bun/node_modules");
await emptyDir("test/runtimes/cloudflare/node_modules");
Expand Down Expand Up @@ -67,3 +68,11 @@ await build({
// post build steps
Deno.copyFileSync("LICENSE", "../../npm/packages/dhkem-x25519/LICENSE");
Deno.copyFileSync("README.md", "../../npm/packages/dhkem-x25519/README.md");
Deno.copyFileSync(
"samples/node/app.js",
"../../npm/samples/dhkem-x25519/app.js",
);
Deno.copyFileSync(
"samples/node/package.json",
"../../npm/samples/dhkem-x25519/package.json",
);
3 changes: 3 additions & 0 deletions packages/dhkem-x25519/samples/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"main": "app.js",
"author": "Ajitomi Daisuke <[email protected]> (https://github.com/dajiaji)",
"license": "MIT",
"scripts": {
"test": "node app.js"
},
"dependencies": {
"@hpke/core": "^1.5.0",
"@hpke/dhkem-x25519": "^1.5.0"
Expand Down
6 changes: 6 additions & 0 deletions packages/dhkem-x448/dnt.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { build, emptyDir } from "@deno/dnt";

await emptyDir("../../npm/packages/dhkem-x448");
await emptyDir("../../npm/samples/dhkem-x448");
await emptyDir("test/runtimes/browsers/node_modules");
await emptyDir("test/runtimes/bun/node_modules");
await emptyDir("test/runtimes/cloudflare/node_modules");
Expand Down Expand Up @@ -67,3 +68,8 @@ await build({
// post build steps
Deno.copyFileSync("LICENSE", "../../npm/packages/dhkem-x448/LICENSE");
Deno.copyFileSync("README.md", "../../npm/packages/dhkem-x448/README.md");
Deno.copyFileSync("samples/node/app.js", "../../npm/samples/dhkem-x448/app.js");
Deno.copyFileSync(
"samples/node/package.json",
"../../npm/samples/dhkem-x448/package.json",
);
3 changes: 3 additions & 0 deletions packages/dhkem-x448/samples/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"main": "app.js",
"author": "Ajitomi Daisuke <[email protected]> (https://github.com/dajiaji)",
"license": "MIT",
"scripts": {
"test": "node app.js"
},
"dependencies": {
"@hpke/core": "^1.4.3",
"@hpke/dhkem-x448": "^1.4.3"
Expand Down
6 changes: 6 additions & 0 deletions packages/hpke-js/dnt.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { build, emptyDir } from "@deno/dnt";

await emptyDir("../../npm/packages/hpke-js");
await emptyDir("../../npm/samples/hpke-js");
await emptyDir("test/runtimes/browsers/node_modules");
await emptyDir("test/runtimes/bun/node_modules");
await emptyDir("test/runtimes/cloudflare/node_modules");
Expand Down Expand Up @@ -71,3 +72,8 @@ await build({
// post build steps
Deno.copyFileSync("LICENSE", "../../npm/packages/hpke-js/LICENSE");
Deno.copyFileSync("README.md", "../../npm/packages/hpke-js/README.md");
Deno.copyFileSync("samples/node/app.js", "../../npm/samples/hpke-js/app.js");
Deno.copyFileSync(
"samples/node/package.json",
"../../npm/samples/hpke-js/package.json",
);
3 changes: 3 additions & 0 deletions packages/hpke-js/samples/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"main": "app.js",
"author": "Ajitomi Daisuke <[email protected]> (https://github.com/dajiaji)",
"license": "MIT",
"scripts": {
"test": "node app.js"
},
"dependencies": {
"hpke-js": "^1.5.0"
}
Expand Down
Loading
Loading