-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdnt.ts
More file actions
102 lines (99 loc) · 2.49 KB
/
dnt.ts
File metadata and controls
102 lines (99 loc) · 2.49 KB
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 "jsr:@deno/dnt@0.42.3";
const AUTHOR = "Paul Loffredo";
const HOMEPAGE = "https://github.com/ploffredo/inputkit";
const BUGS = "https://github.com/ploffredo/inputkit/issues";
const REPO = { type: "git", url: "https://github.com/ploffredo/inputkit" };
// Build @inputkit/core
console.log("Building @inputkit/core...");
await emptyDir("./npm/core");
await build({
entryPoints: ["./core/mod.ts"],
outDir: "./npm/core",
shims: { deno: false },
test: false,
compilerOptions: {
lib: ["ES2022"],
target: "ES2022",
},
package: {
name: "@inputkit/core",
version: "0.2.0",
description:
"Framework-agnostic utilities for formatted inputs: card type detection, Luhn validation, formatters, and validators.",
author: AUTHOR,
license: "MIT",
homepage: HOMEPAGE,
bugs: { url: BUGS },
repository: REPO,
keywords: [
"payment",
"credit-card",
"formatting",
"validation",
"luhn",
"card-detection",
],
},
postBuild() {
Deno.copyFileSync("LICENSE", "npm/core/LICENSE");
Deno.copyFileSync("core/README.md", "npm/core/README.md");
},
});
console.log("@inputkit/core built successfully.\n");
// Build @inputkit/react
console.log("Building @inputkit/react...");
await emptyDir("./npm/react");
await build({
entryPoints: ["./react/mod.ts"],
outDir: "./npm/react",
shims: { deno: false },
test: false,
compilerOptions: {
lib: ["ES2022", "DOM", "DOM.Iterable"],
target: "ES2022",
jsx: "react-jsx",
},
importMap: "./dnt-import-map.json",
mappings: {
"./core/mod.ts": {
name: "@inputkit/core",
version: "^0.2.0",
},
},
package: {
name: "@inputkit/react",
version: "0.2.0",
description:
"React hooks for formatted inputs: payment cards, TOTP/OTP codes, and custom formatted fields.",
author: AUTHOR,
license: "MIT",
homepage: HOMEPAGE,
bugs: { url: BUGS },
repository: REPO,
keywords: [
"react",
"hooks",
"payment",
"credit-card",
"otp",
"totp",
"formatted-input",
"input-mask",
"shadcn",
],
peerDependencies: {
react: ">=18.0.0",
},
dependencies: {
"@inputkit/core": "^0.2.0",
},
devDependencies: {
"@types/react": "^18.0.0",
},
},
postBuild() {
Deno.copyFileSync("LICENSE", "npm/react/LICENSE");
Deno.copyFileSync("react/README.md", "npm/react/README.md");
},
});
console.log("@inputkit/react built successfully.");