-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
_npm.ts
63 lines (59 loc) · 1.52 KB
/
_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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
* This script builds the NPM package from Deno source
*/
import { build, emptyDir } from "jsr:@deno/dnt@^0.41.3";
await emptyDir("./npm");
await build({
entryPoints: ["./mod.ts"],
outDir: "./npm",
shims: {
deno: "dev",
weakRef: "dev",
undici: true,
crypto: true,
},
compilerOptions: {
lib: ["ES2023"],
target: "ES2022",
},
package: {
// package.json properties
name: "workflowy",
version: Deno.args[0],
description: "WorkFlowy client for reading and updating of lists",
author: "Karel Klima <[email protected]> (https://karelklima.com)",
license: "MIT",
repository: {
type: "git",
url: "git+https://github.com/karelklima/workflowy.git",
},
bugs: {
url: "https://github.com/karelklima/workflowy/issues",
},
},
postBuild() {
// steps to run after building and before running the tests
Deno.copyFileSync("LICENSE", "npm/LICENSE");
Deno.copyFileSync("README.md", "npm/README.md");
const testMocks = [
"export_string_all.txt",
"export_string_partial.txt",
"export_plaintext_all.txt",
"export_plaintext_partial.txt",
"export_json_all.json",
"export_json_partial.json",
"export_opml_all.xml",
"export_opml_partial.xml",
];
for (const mock of testMocks) {
Deno.copyFileSync(
`tests/mocks/${mock}`,
`npm/script/tests/mocks/${mock}`,
);
Deno.copyFileSync(
`tests/mocks/${mock}`,
`npm/esm/tests/mocks/${mock}`,
);
}
},
});