This repository has been archived by the owner on Jan 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build_npm.ts
102 lines (99 loc) · 2.55 KB
/
build_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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import { build, emptyDir } from "https://deno.land/x/dnt@0.22.0/mod.ts";
await emptyDir("npm");
await build({
entryPoints: ["./mod.node.ts"],
outDir: "./npm",
shims: {
deno: true,
weakRef: true,
timers: true,
custom: [
{
package: {
name: "node-fetch",
version: "2.6.6",
},
typesPackage: {
name: "@types/node-fetch",
version: "2.5.12",
},
globalNames: [
{ name: "Headers", exportName: "Headers" },
{
name: "fetch",
exportName: "default",
},
{ name: "Request", exportName: "Request" },
{ name: "Response", exportName: "Response" },
],
},
{
package: {
name: "@sgwilym/urlpattern-polyfill",
version: "1.0.0-rc8",
},
globalNames: [{
name: "URLPattern",
exportName: "URLPattern",
}],
},
{
package: {
name: "node-abort-controller",
version: "3.0.1",
},
globalNames: [{
name: "AbortController",
exportName: "AbortController",
}],
},
],
},
mappings: {
"https://deno.land/std@0.135.0/node/http.ts": "http",
"https://deno.land/std@0.135.0/node/buffer.ts": "buffer",
"https://deno.land/x/earthstar_streaming_rpc@v5.0.1/mod.ts": {
name: "earthstar-streaming-rpc",
version: "5.0.1",
},
"https://deno.land/x/earthstar@v9.3.2/mod.ts": {
name: "earthstar",
version: "9.3.2",
},
"https://deno.land/x/earthstar@v9.3.2/src/replica/replica-driver-sqlite.deno.ts":
{
name: "earthstar",
subPath: "node",
version: "9.3.2",
},
"https://esm.sh/micromark@3.0.10": {
name: "micromark",
version: "3.0.10",
},
},
compilerOptions: {
// ES2020 for Node v14 support
target: "ES2020",
},
package: {
// package.json properties
name: "@earthstar-project/replica-server",
version: Deno.args[0],
description: "Create replica servers to sync your Earthstar shares.",
license: "LGPL-3.0-only",
repository: {
type: "git",
url: "git+https://github.com/earthstar-project/replica-server.git",
},
bugs: {
url: "https://github.com/earthstar-project/replica-server/issues",
},
devDependencies: {
"@types/node-fetch": "2.5.12",
"@types/better-sqlite3": "7.4.2",
},
},
});
// post build steps
Deno.copyFileSync("LICENSE", "npm/LICENSE");
Deno.copyFileSync("README.md", "npm/README.md");