forked from erfanium/fetch-typebox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hammer.mjs
22 lines (21 loc) · 904 Bytes
/
hammer.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { readFileSync } from "fs";
// -------------------------------------------------------------------------------
// Build
// -------------------------------------------------------------------------------
export async function build(target = "dist") {
await folder(target).delete();
await shell(`tsc -p ./src/tsconfig.json --outDir ${target}`);
await folder(target).add("package.json");
await folder(target).add("README.md");
await folder(target).add("license");
await shell(`cd ${target} && npm pack`);
}
// -------------------------------------------------------------
// Publish
// -------------------------------------------------------------
export async function publish(target = "dist") {
const { version } = JSON.parse(readFileSync("package.json", "utf8"));
await shell(
`cd ${target} && npm publish danielsoheil-csv-parse-typebox-${version}.tgz --access=public`
);
}