1
0
Fork 0
mirror of https://github.com/classchartsapi/classcharts-api-js.git synced 2026-05-14 11:58:13 +00:00
classcharts-api-js/scripts/build_npm.ts

59 lines
1.2 KiB
TypeScript
Raw Normal View History

2024-05-28 14:32:57 +01:00
import { build, emptyDir } from "@deno/dnt";
2023-08-30 12:28:49 +01:00
2024-01-10 10:57:33 +00:00
if (!Deno.args[0]) {
throw new Error("No version specified");
}
2023-08-30 12:28:49 +01:00
await emptyDir("./npm");
await build({
entryPoints: [
{
name: ".",
path: "./mod.ts",
},
{
name: "./types",
path: "./src/types.ts",
},
],
outDir: "./npm",
importMap: "./deno.jsonc",
shims: {
deno: true,
},
packageManager: "pnpm",
compilerOptions: {
lib: ["DOM", "ESNext"],
},
typeCheck: "both",
package: {
name: "classcharts-api",
version: String(Deno.args[0]).replace("v", ""),
author: {
name: "James Cook",
email: "james@jaminit.co.uk",
},
description:
"A Typescript wrapper for getting information from the ClassCharts API",
license: "ISC",
keywords: ["node", "typescript", "classcharts", "class charts"],
bugs: {
url: "https://github.com/classchartsapi/classcharts-api-js/issues",
},
repository: {
type: "git",
url: "https://github.com/classchartsapi/classcharts-api-js.git",
},
homepage: "https://classchartsapi.github.io/classcharts-api-js/",
engines: {
2023-11-29 00:13:15 +00:00
node: ">=20",
},
sideEffects: false,
},
postBuild() {
Deno.copyFileSync("LICENSE", "npm/LICENSE");
Deno.copyFileSync("README.md", "npm/README.md");
},
2023-08-30 12:28:49 +01:00
});