diff --git a/README.md b/README.md index 491a4e7..3d0c8a0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# generative-art +# layered-generative-art An easy-to-use library to generate random images from a set of layers. ## Installation diff --git a/build.mjs b/build.mjs index 0134dbb..ee25717 100644 --- a/build.mjs +++ b/build.mjs @@ -3,6 +3,7 @@ import dts from "bun-plugin-dts"; await Bun.build({ entrypoints: ["./src/index.ts"], outdir: "./dist", + target: "node", minify: true, plugins: [dts()], }); diff --git a/package.json b/package.json index 9cce532..b5a6ceb 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "module": "index.ts", "license": "MIT", "files": [ - "dist" + "dist/*.js", + "dist/*.d.ts" ], "keywords": [ "generative", @@ -25,6 +26,10 @@ "url": "git+https://github.com/4-0-9/layered-generative-art.git" }, "bugs": "https://github.com/4-0-9/layered-generative-art/issues", + "scripts": { + "build": "bun run build.mjs", + "publish": "bun run build && npm publish" + }, "dependencies": { "sharp": "^0.33.2" }, diff --git a/src/index.ts b/src/index.ts index ff1787e..6d01317 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,7 +6,7 @@ import { type Layer, type TraitOption } from './layers'; * @param orderedLayers - The layers to choose from in ascending order * @returns A buffer containing the newly generated image */ -async function generateRandomImage(baseShapePath: string, orderedLayers: Layer[]): Promise { +export async function generateRandomImage(baseShapePath: string, orderedLayers: Layer[]): Promise { const layers: OverlayOptions[] = []; const choices: Record = {};