2024-12-14 11:51:28 +00:00
|
|
|
import { copy } from "https://deno.land/std@0.140.0/fs/mod.ts";
|
2024-12-07 18:45:01 +00:00
|
|
|
import { build, emptyDir } from "https://deno.land/x/dnt@0.37.0/mod.ts";
|
|
|
|
|
|
|
|
|
|
await emptyDir("./npm");
|
|
|
|
|
|
2024-12-14 11:51:28 +00:00
|
|
|
await copy("testdata", "npm/esm/testdata", { overwrite: true });
|
|
|
|
|
await copy("testdata", "npm/script/testdata", { overwrite: true });
|
|
|
|
|
|
2024-12-07 18:45:01 +00:00
|
|
|
await build({
|
|
|
|
|
entryPoints: ["./src/mod.ts"],
|
|
|
|
|
outDir: "./npm",
|
|
|
|
|
shims: {
|
|
|
|
|
deno: true,
|
|
|
|
|
},
|
|
|
|
|
package: {
|
2024-12-14 11:51:28 +00:00
|
|
|
name: "@farmtoad/farmtoad-msg-utils",
|
2024-12-07 18:45:01 +00:00
|
|
|
version: Deno.args[0],
|
|
|
|
|
description:
|
|
|
|
|
"A collection of utils to deserialize valid messages coming from our farmtoad devices",
|
|
|
|
|
license: "MIT",
|
|
|
|
|
repository: {
|
|
|
|
|
type: "git",
|
2024-12-14 11:51:28 +00:00
|
|
|
url: "https://repositories.communitynotfound.work/PoliBa-Software-Architecture/Typescript-MessageUtils.git",
|
2024-12-07 18:45:01 +00:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
postBuild() {
|
|
|
|
|
Deno.copyFileSync("LICENSE", "npm/LICENSE");
|
|
|
|
|
Deno.copyFileSync("README.md", "npm/README.md");
|
2024-12-14 11:51:28 +00:00
|
|
|
Deno.copyFileSync(".npmrc", "npm/.npmrc");
|
2024-12-07 18:45:01 +00:00
|
|
|
},
|
|
|
|
|
});
|