diff --git a/CHANGELOG.md b/CHANGELOG.md index 24611ad..a561dfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,20 @@ All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines. - - - +## v0.1.3 - 2025-04-14 +#### Bug Fixes +- use raw string to prevent quote issues - (a1b480f) - aleidk +#### Documentation +- fix example - (f6077d4) - aleidk + +- - - + +## v0.1.2 - 2025-04-11 +#### Bug Fixes +- add shebang to entrypoint - (b4a5514) - aleidk + +- - - + ## v0.1.1 - 2025-04-11 #### Bug Fixes - remove unecesary dependency - (cf7bf3f) - aleidk diff --git a/README.md b/README.md index 6be599e..dd2d336 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ fn main() { let output = Command::new("bun") .args([ "run", - "scripts/build.ts", + "tmpl-build-and-load", "--outdir", out_dir.as_str(), "--globs", diff --git a/index.ts b/index.ts index a664a4d..d65cc97 100644 --- a/index.ts +++ b/index.ts @@ -1,3 +1,5 @@ +#!/usr/bin/env bun + import sassPlugin from "@alecodes/bun-plugin-sass"; import { parseArgs } from "node:util"; import path from "node:path"; @@ -54,11 +56,9 @@ out += "|env: &mut minijinja::Environment| {\n"; for (const res of result.outputs) { // Can be consumed as blobs - let asset_text = await res.text(); - asset_text = asset_text.replaceAll(/\n/g, "\\n"); - asset_text = asset_text.replaceAll(/"/g, `\\"`); + const asset_text = await res.text(); const asset_path = path.normalize(res.path); - out += `env.add_template("${asset_path}", "${asset_text}").expect("Embedded an invalid template");\n`; + out += `env.add_template("${asset_path}", r##"${asset_text}"##).expect("Embedded an invalid template");\n`; } out += "}"; @@ -69,4 +69,3 @@ Bun.write( ); console.log("Assets compiled!"); - diff --git a/package.json b/package.json index 5555037..a3afe23 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "0.1.1", + "version": "0.1.3", "name": "@alecodes/tmpl-build-and-load", "module": "index.ts", "type": "module",