From fa5fc44a39dc3df6997c1ee95b65d42ead31bd8a Mon Sep 17 00:00:00 2001 From: Wenderson Pires Date: Thu, 7 Mar 2024 17:53:07 -0300 Subject: [PATCH] project repository is included to the final bundle file if available --- docs/{config.file.md => config-file.md} | 0 lib/build.js | 10 +++++++--- package.json | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) rename docs/{config.file.md => config-file.md} (100%) diff --git a/docs/config.file.md b/docs/config-file.md similarity index 100% rename from docs/config.file.md rename to docs/config-file.md diff --git a/lib/build.js b/lib/build.js index 6b87381..aa2c85f 100644 --- a/lib/build.js +++ b/lib/build.js @@ -9,7 +9,7 @@ const { parseOptions, } = require("./parse.js"); const { read_bos_config } = require("./config"); -const pkg = require("../package.json"); +const alemPkg = require("../package.json"); const path = require("path"); const fs = require("fs"); const { @@ -130,9 +130,13 @@ function process_dist() { // Mimify fileBundleBody = mimify(fileBundleBody); - // Add Alem signature + // Add Alem signature + repository info if available + const projectPkg = JSON.parse( + fs.readFileSync(path.join("package.json"), "utf-8"), + ); fileBundleBody = ` - /** Bundle generated by Alem Library v${pkg.version} - See more here: https://github.com/wpdas/alem */ + /** Bundle generated by Além Library v${alemPkg.version} - See more here: https://github.com/wpdas/alem */ + ${projectPkg.repository?.url ? `/** Project repository: ${projectPkg.repository.url.replaceAll("git+", "").replaceAll(".git", "")} */` : ""} ${fileBundleBody} `; diff --git a/package.json b/package.json index 9c45e34..805074c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "alem", "description": "Create web3 applications for NEAR BOS with a focus on performance while using concepts that are based on ReactJS.", - "version": "0.0.1-alpha.9", + "version": "0.0.1-alpha.10", "main": "main.js", "types": "index.d.ts", "author": "Wenderson Pires - wendersonpires.near",