Skip to content

Commit

Permalink
project repository is included to the final bundle file if available
Browse files Browse the repository at this point in the history
  • Loading branch information
wpdas committed Mar 7, 2024
1 parent 296f4e5 commit fa5fc44
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
File renamed without changes.
10 changes: 7 additions & 3 deletions lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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}
`;

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.9",
"version": "0.0.1-alpha.10",
"main": "main.js",
"types": "index.d.ts",
"author": "Wenderson Pires - wendersonpires.near",
Expand Down

0 comments on commit fa5fc44

Please sign in to comment.