Skip to content

Commit b107ae3

Browse files
committed
ci: build npm
1 parent b0f8add commit b107ae3

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

scripts/build_npm.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { build, emptyDir } from "@deno/dnt";
2+
import { bgGreen } from "@std/fmt/colors";
3+
import denoJson from "../deno.json" with { type: "json" };
4+
5+
const version = denoJson.version;
6+
7+
console.log(bgGreen(`version: ${version}`));
8+
9+
await emptyDir("./.npm");
10+
11+
await build({
12+
entryPoints: ["./mod.ts"],
13+
outDir: "./.npm",
14+
shims: {
15+
deno: false,
16+
},
17+
test: false,
18+
compilerOptions: {
19+
lib: ["ES2021", "DOM"],
20+
},
21+
package: {
22+
name: "timerider",
23+
version,
24+
description: "Accurate timers with drift correction, pause/resume, and long delay support.",
25+
keywords: [
26+
"timer",
27+
"timeout",
28+
"interval",
29+
"drift-correction",
30+
"pause",
31+
"resume",
32+
"long-delay",
33+
"deno",
34+
"npm",
35+
],
36+
license: "MIT",
37+
repository: {
38+
type: "git",
39+
url: "git+https://github.com/denostack/timerider.git",
40+
},
41+
bugs: {
42+
url: "https://github.com/denostack/timerider/issues",
43+
},
44+
},
45+
postBuild() {
46+
Deno.copyFileSync("LICENSE", ".npm/LICENSE");
47+
Deno.copyFileSync("README.md", ".npm/README.md");
48+
},
49+
});

0 commit comments

Comments
 (0)