forked from neurosnap/starfx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnpm.ts
92 lines (88 loc) · 2.15 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
87
88
89
90
91
92
import { assert, build, emptyDir } from "./test.ts";
main().then(console.log).catch(console.error);
async function main() {
await emptyDir("./npm");
const version = Deno.env.get("NPM_VERSION");
assert(version, "NPM_VERSION is required to build npm package");
await build({
entryPoints: [
{
name: ".",
path: "mod.ts",
},
{
name: "./react",
path: "react.ts",
},
{
name: "./redux",
path: "redux/mod.ts",
},
{
name: "./query",
path: "./query/mod.ts",
},
],
mappings: {
"https://deno.land/x/effection@3.0.0-alpha.7/mod.ts": {
name: "effection",
version: "3.0.0-alpha.7",
},
"https://esm.sh/react@18.2.0": {
name: "react",
version: "^18.2.0",
peerDependency: true,
},
"https://esm.sh/robodux@15.0.1?pin=v122": {
name: "robodux",
version: "^15.0.1",
},
"https://esm.sh/@reduxjs/toolkit@1.9.5?pin=v122": {
name: "@reduxjs/toolkit",
version: "^1.9.5",
},
"https://esm.sh/redux-batched-actions@0.5.0?pin=v122": {
name: "redux-batched-actions",
version: "^0.5.0",
},
"https://esm.sh/react-redux@8.0.5?pin=v122": {
name: "react-redux",
version: "^8.0.5",
peerDependency: true,
},
},
outDir: "./npm",
shims: {
deno: false,
},
test: false,
typeCheck: true,
compilerOptions: {
target: "ES2020",
sourceMap: true,
lib: ["dom", "dom.iterable", "esnext"],
},
package: {
name: "starfx",
version,
description: "Supercharged async flow control library",
license: "MIT",
repository: {
author: "me@erock.io",
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");
},
});
}