Skip to content

Commit

Permalink
fix bundle git repository signature
Browse files Browse the repository at this point in the history
  • Loading branch information
wpdas committed Mar 7, 2024
1 parent b4c5736 commit 65b3f9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
`;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 65b3f9a

Please sign in to comment.