-
Notifications
You must be signed in to change notification settings - Fork 3
/
npm.ts
86 lines (83 loc) · 2.01 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import { build, emptyDir } from "https://deno.land/x/dnt@0.38.1/mod.ts";
const [version] = Deno.args;
if (!version) {
throw new Error("a version argument is required to build the npm package");
}
init().then(console.log).catch(console.error);
async function init() {
await emptyDir("./npm");
await build({
declaration: "inline",
scriptModule: "cjs",
entryPoints: [
{
name: ".",
path: "mod.ts",
},
{
name: "./react",
path: "react.ts",
},
],
mappings: {
"https://deno.land/x/effection@3.0.0-beta.3/mod.ts": {
name: "effection",
version: "3.0.0-beta.3",
},
"https://esm.sh/react@18.2.0?pin=v135": {
name: "react",
version: "^18.2.0",
peerDependency: true,
},
"https://esm.sh/react-redux@8.0.5?pin=v135": {
name: "react-redux",
version: "^8.0.5",
},
"https://esm.sh/immer@10.0.2?pin=v135": {
name: "immer",
version: "^10.0.2",
},
"https://esm.sh/reselect@4.1.8?pin=v135": {
name: "reselect",
version: "^4.1.8",
},
},
outDir: "./npm",
shims: {
deno: false,
},
test: false,
typeCheck: "both",
compilerOptions: {
target: "ES2020",
sourceMap: true,
lib: ["DOM", "DOM.Iterable", "ESNext"],
},
package: {
name: "starfx",
version,
description:
"Async flow control and state management system for deno, node, and browser",
license: "MIT",
author: {
name: "Eric Bower",
email: "me@erock.io",
},
repository: {
type: "git",
url: "git+https://github.com/neurosnap/starfx.git",
},
bugs: {
url: "https://github.com/neurosnap/starfx/issues",
},
engines: {
node: ">= 18",
},
sideEffects: false,
},
postBuild() {
Deno.copyFileSync("LICENSE.md", "npm/LICENSE.md");
Deno.copyFileSync("README.md", "npm/README.md");
},
});
}