Skip to content

Commit

Permalink
Added NPM build script
Browse files Browse the repository at this point in the history
  • Loading branch information
karelklima committed May 12, 2023
1 parent 8434212 commit 0b1b08a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm
43 changes: 43 additions & 0 deletions _npm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* This script builds the NPM package from Deno source
*/
import { build, emptyDir } from "https://deno.land/x/dnt@0.35.0/mod.ts";

await emptyDir("./npm");

await build({
entryPoints: ["./mod.ts"],
outDir: "./npm",
shims: {
// see JS docs for overview and more options
deno: true,
undici: true,
crypto: true,
},
package: {
// package.json properties
name: "workflowy",
version: Deno.args[0],
description: "WorkFlowy client for reading and updating of lists",
author: "Karel Klima <karelklima@gmail.com> (https://karelklima.com)",
license: "MIT",
repository: {
type: "git",
url: "git+https://github.com/karelklima/workflowy.git",
},
bugs: {
url: "https://github.com/karelklima/workflowy/issues",
},
mappings: {
"https://deno.land/x/zod@v3.21.4/mod.ts": {
package: "zod",
version: "^3.21.4",
},
},
},
postBuild() {
// steps to run after building and before running the tests
Deno.copyFileSync("LICENSE", "npm/LICENSE");
Deno.copyFileSync("README.md", "npm/README.md");
},
});

0 comments on commit 0b1b08a

Please sign in to comment.