-
Notifications
You must be signed in to change notification settings - Fork 4
/
dnt.ts
74 lines (70 loc) · 1.93 KB
/
dnt.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import { build, emptyDir } from "@deno/dnt";
await emptyDir("./npm/" + Deno.args[0]);
await emptyDir("test/runtimes/browsers/node_modules");
await emptyDir("test/runtimes/bun/node_modules");
await emptyDir("test/runtimes/cloudflare/node_modules");
const denoPkg = JSON.parse(await Deno.readTextFile("./deno.json"));
await build({
entryPoints: ["./mod.ts"],
outDir: "./npm/" + Deno.args[0],
typeCheck: "both",
test: true,
declaration: true,
scriptModule: "umd",
importMap: "./import_map.json",
compilerOptions: {
lib: ["ES2022", "DOM"],
},
shims: {
deno: "dev",
},
testPattern: "test/**/*.test.ts",
package: {
name: Deno.args[0],
version: denoPkg.version,
description:
"An ML-KEM/CRYSTALS-KYBER implementation written in TypeScript for various JavaScript runtimes",
repository: {
type: "git",
url: "git+https://github.com/dajiaji/crystals-kyber-js.git",
},
homepage: "https://github.com/dajiaji/crystals-kyber-js#readme",
license: "MIT",
module: "./esm/mod.js",
main: "./script/mod.js",
types: "./esm/mod.d.ts",
sideEffects: false,
exports: {
".": {
"import": "./esm/mod.js",
"require": "./script/mod.js",
},
"./package.json": "./package.json",
},
keywords: [
"crystals-kyber",
"ml-kem",
"mlkem",
"fips203",
"kyber",
"kem",
"security",
"encryption",
"pqc",
"post-quantum",
],
engines: {
"node": ">=16.0.0",
},
author: "Ajitomi Daisuke",
bugs: {
url: "https://github.com/dajiaji/crystals-kyber-js/issues",
},
},
});
// post build steps
Deno.copyFileSync("LICENSE", "npm/" + Deno.args[0] + "/LICENSE");
Deno.copyFileSync("README.md", "npm/" + Deno.args[0] + "/README.md");
await emptyDir("./npm/" + Deno.args[0] + "/src");
await emptyDir("./npm/" + Deno.args[0] + "/esm/test");
await emptyDir("./npm/" + Deno.args[0] + "/script/test");