Skip to main content
Module

x/oson/build.ts

oson structured object notation
Latest
File
import { build, emptyDir } from "https://deno.land/x/dnt@0.38.1/mod.ts";
const version = Deno.args[0];if (!version) { let previous: string | undefined = undefined; try { previous = JSON.parse(Deno.readTextFileSync("./npm/package.json")).version; } catch { // ignore } finally { previous ??= "unknown"; } throw new Error(`Provide a version number! Last one is: ${previous}`);}
await emptyDir("./npm");
await build({ entryPoints: ["./mod.ts"], outDir: "./npm", shims: { deno: true, custom: [{ globalNames: ["TextEncoder", "TextDecoder"], module: "util", }], }, package: { // package.json properties name: "o-son", version: Deno.args[0], description: "oson structured object notation", license: "MIT", repository: { type: "git", url: "git+https://github.com/KnorpelSenf/oson.git", }, bugs: { url: "https://github.com/KnorpelSenf/oson/issues", }, },});
// post build stepsDeno.copyFileSync("LICENSE", "npm/LICENSE");Deno.copyFileSync("README.md", "npm/README.md");const process = new Deno.Command("git", { args: ["tag", version] });await process.spawn().status;