From fb8d8d147317efa255f893c02dd7f3d771421a77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roger=20Sch=C3=B6nb=C3=A4chler?= <42278642+schoero@users.noreply.github.com> Date: Sun, 1 Oct 2023 14:06:46 +0200 Subject: [PATCH] refactor: serve output directory --- .cspell.json | 1 + examples/node-cjs-javascript/package.json | 4 ++++ examples/node-cjs-javascript/src/svg.js | 2 +- examples/node-esm-javascript/package.json | 4 ++++ examples/node-esm-javascript/src/svg.js | 2 +- package.json | 2 +- 6 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.cspell.json b/.cspell.json index cb3ff9d..a90d467 100644 --- a/.cspell.json +++ b/.cspell.json @@ -20,6 +20,7 @@ "linebreak", "linebreaker", "pdfkit", + "postgenerate", "qrcodegen", "qriban", "QRIBAN", diff --git a/examples/node-cjs-javascript/package.json b/examples/node-cjs-javascript/package.json index 4e53bc8..0f7b0c3 100644 --- a/examples/node-cjs-javascript/package.json +++ b/examples/node-cjs-javascript/package.json @@ -5,10 +5,14 @@ "scripts": { "generate": "npm run pdf && npm run svg", "pdf": "node ./src/pdf.js", + "postgenerate": "serve output", "svg": "node ./src/svg.js" }, "dependencies": { "pdfkit": "^0.13.0", "swissqrbill": "^4.0.0-alpha.3" + }, + "devDependencies": { + "serve": "^14.2.1" } } diff --git a/examples/node-cjs-javascript/src/svg.js b/examples/node-cjs-javascript/src/svg.js index 2b8ae72..dc0399e 100644 --- a/examples/node-cjs-javascript/src/svg.js +++ b/examples/node-cjs-javascript/src/svg.js @@ -5,4 +5,4 @@ const data = require("./data.js"); const qrBill = new SwissQRBill(data); -writeFileSync("./swissqrbill.svg", qrBill.toString()); +writeFileSync("./output/swissqrbill.svg", qrBill.toString()); diff --git a/examples/node-esm-javascript/package.json b/examples/node-esm-javascript/package.json index d25de70..aaf127a 100644 --- a/examples/node-esm-javascript/package.json +++ b/examples/node-esm-javascript/package.json @@ -5,10 +5,14 @@ "scripts": { "generate": "npm run pdf && npm run svg", "pdf": "node ./src/pdf.js", + "postgenerate": "serve output", "svg": "node ./src/svg.js" }, "dependencies": { "pdfkit": "^0.13.0", "swissqrbill": "alpha" + }, + "devDependencies": { + "serve": "^14.2.1" } } diff --git a/examples/node-esm-javascript/src/svg.js b/examples/node-esm-javascript/src/svg.js index b8646f9..dce6bc0 100644 --- a/examples/node-esm-javascript/src/svg.js +++ b/examples/node-esm-javascript/src/svg.js @@ -5,4 +5,4 @@ import { data } from "./data.js"; const qrBill = new SwissQRBill(data); -writeFileSync("./swissqrbill.svg", qrBill.toString()); +writeFileSync("./output/swissqrbill.svg", qrBill.toString()); diff --git a/package.json b/package.json index d5b1a0d..b633cd0 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha.7", + "version": "4.0.0-alpha.9", "type": "module", "name": "swissqrbill", "description": "Swiss QR Bill generation in Node.js and browsers",