-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_htmlisp_for_npm.ts
43 lines (36 loc) · 1.07 KB
/
build_htmlisp_for_npm.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
import { build, emptyDir } from "https://deno.land/x/dnt@0.40.0/mod.ts";
import * as path from "node:path";
async function buildForNpm(name: string, version: string) {
if (!version) {
console.error("Missing version!");
return;
}
const outDir = `./${name}/npm`;
await emptyDir(outDir);
await build({
entryPoints: [`./${name}/mod.ts`],
outDir,
shims: {
deno: true,
},
test: false, // TODO: Re-enable when dnt works again
package: {
name,
version,
description: "HTML combined with Lisp for fun and profit",
license: "MIT",
repository: {
type: "git",
url: "git+https://github.com/survivejs/gustwind.git",
},
bugs: {
url: "https://github.com/survivejs/gustwind/issues",
},
homepage: "https://gustwind.js.org/",
keywords: ["templating", "html", "templating-engine"],
},
});
Deno.copyFileSync("LICENSE", path.join(outDir, "LICENSE"));
Deno.copyFileSync(`./${name}/README.md`, path.join(outDir, "README.md"));
}
buildForNpm("htmlisp", Deno.args[0]);