diff --git a/lib/build.js b/lib/build.js index aa2c85f..45a253e 100644 --- a/lib/build.js +++ b/lib/build.js @@ -131,12 +131,19 @@ function process_dist() { fileBundleBody = mimify(fileBundleBody); // Add Alem signature + repository info if available + // TODO: abstract this in a separated file const projectPkg = JSON.parse( fs.readFileSync(path.join("package.json"), "utf-8"), ); + + const projectRepositoryLink = + projectPkg?.repository && typeof projectPkg?.repository === "string" + ? projectPkg?.repository + : projectPkg.repository?.url || ""; + fileBundleBody = ` /** 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", "")} */` : ""} + ${projectRepositoryLink ? `/** Project repository: ${projectRepositoryLink.replaceAll("git+", "").replaceAll(".git", "")} */` : ""} ${fileBundleBody} `; diff --git a/package.json b/package.json index 805074c..d017e6f 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.10", + "version": "0.0.1-alpha.11", "main": "main.js", "types": "index.d.ts", "author": "Wenderson Pires - wendersonpires.near",