From 67989ae6f5e7cb1fe5e1a8d30e9167f1aeb9e96a Mon Sep 17 00:00:00 2001 From: digoarthur Date: Thu, 25 Dec 2025 12:38:46 +0000 Subject: [PATCH 1/6] chore(npm): enforce publish restriction to main branch --- package.json | 18 +++++++++++------- scripts/guard-npm-publish.js | 37 ++++++++++++++++++------------------ 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/package.json b/package.json index 1965601..d33ec4b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "github-automated-repos-cli", - "version": "1.0.0", + "version": "1.0.1", "description": "CLI para gerar pΓ‘gina de exemplo usando github-automated-repos em projetos Next.js, React ou Vite.", "type": "module", "bin": { @@ -11,7 +11,7 @@ "setup": "git update-index --skip-worktree CHANGELOG.md", "start": "node ./bin/index.js", "changelog": "conventional-changelog --config changelog-config.cjs -i CHANGELOG.md -s -r 0", - "prepublishOnly": "node ./scripts/validate-publish-branch.js" + "prepublishOnly": "node ./scripts/guard-npm-publish.js" }, "author": "Digo Arthur", "license": "MIT", @@ -22,11 +22,15 @@ "ora": "^9.0.0", "prompts": "^2.4.2" }, - "files": [ - "bin", - "example", - "README.md" - ], + "files": [ + "bin", + "commands", + "utils", + "scripts", + "pageExample", + "README.md", + "LICENSE" +], "devDependencies": { "conventional-changelog-cli": "^5.0.0" } diff --git a/scripts/guard-npm-publish.js b/scripts/guard-npm-publish.js index ff23c1f..f917a8e 100644 --- a/scripts/guard-npm-publish.js +++ b/scripts/guard-npm-publish.js @@ -1,26 +1,25 @@ -import { execSync } from "child_process"; +import { execSync } from "node:child_process"; -try { - const branch = execSync("git branch --show-current", { - stdio: ["pipe", "pipe", "ignore"], - }) +function getCurrentBranch() { + return execSync("git branch --show-current", { stdio: ["ignore", "pipe", "ignore"] }) .toString() .trim(); +} + +const branch = getCurrentBranch(); +const registry = process.env.npm_config_registry; - if (branch !== "main") { - console.error(""); - console.error("❌ NPM PUBLISH BLOCKED"); - console.error("--------------------------------"); - console.error("You are not allowed to publish from this branch."); - console.error(""); - console.error(`Current branch: ${branch}`); - console.error("Allowed branch: main"); - console.error(""); - process.exit(1); - } +// πŸ”“ Allow local publishes (yalc, tests, local registry) +if (!registry || !registry.includes("registry.npmjs.org")) { + console.log("ℹ️ Local publish detected (yalc or non-npm registry). Skipping guard."); + process.exit(0); +} - console.log("βœ… Branch validation passed. Publishing from main."); -} catch (error) { - console.error("❌ Failed to detect git branch."); +// πŸ”’ Block real npm publish outside main +if (branch !== "main") { + console.error("❌ npm publish is only allowed from the 'main' branch."); + console.error(`Current branch: ${branch}`); process.exit(1); } + +console.log("βœ… npm publish allowed from main branch."); \ No newline at end of file From ba4b2dad75a2b4cac475755c0539f6e6a15ee578 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 25 Dec 2025 12:39:49 +0000 Subject: [PATCH 2/6] chore(changelog): update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3634cc6..9801504 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ + +# 1.0.1 (2025-12-25) + # 1.0.0 (2025-12-22) From 08b8a9a4bb2f8cf6b4d312003205f81a53bb8b39 Mon Sep 17 00:00:00 2001 From: Diego Arthur Date: Thu, 25 Dec 2025 21:45:47 +0000 Subject: [PATCH 3/6] docs: update README.md Added project banner, shields, and description to README. --- README.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..1890ec3 --- /dev/null +++ b/README.md @@ -0,0 +1,48 @@ + + + + + + +banner_logo_github-automated-repos-cli + +
+
+ + + + + +
+ +![GitHub](https://img.shields.io/github/license/digoarthur/github-automated-repos-cli?color=9F9FAC) +![NPM Package](https://img.shields.io/npm/v/github-automated-repos-cli?color=blue&label=NPM%20package&logo=npm&logoColor=CB3837) +![CodeFactor](https://img.shields.io/codefactor/grade/github/digoarthur/github-automated-repos-cli?color=brightgreen&label=Code%20Quality&logo=codefactor) +[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)]() + +
+ + + + + +

+
+ πŸš€ github-automated-repos-cli is a command-line tool designed to bootstrap and automate example pages + using github-automated-repos + in modern frontend projects. +

+ + > It helps you quickly generate interactive demo pages for GitHub repositories without manually wiring APIs, + editing repetitive files, or handling complex setup steps. + +

+ +--- +dashgo_layout + + + From 91b80632a3fe4f9ed847cfe6ed56ba2c8e143028 Mon Sep 17 00:00:00 2001 From: Diego Arthur Date: Sun, 28 Dec 2025 17:56:04 +0000 Subject: [PATCH 4/6] docs: update README.md Updated project banner image and enhanced documentation for usage instructions. --- README.md | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 124 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1890ec3..642f1fc 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,13 @@ + banner_logo_github-automated-repos-cli
@@ -31,9 +32,9 @@


- πŸš€ github-automated-repos-cli is a command-line tool designed to bootstrap and automate example pages + github-automated-repos-cli is a command-line tooldesigned to bootstrap and automate example pages using github-automated-repos - in modern frontend projects. + library in modern frontend projects.

> It helps you quickly generate interactive demo pages for GitHub repositories without manually wiring APIs, @@ -42,7 +43,126 @@

--- -dashgo_layout + + + + +## Documentation + +This CLI works on top of the **github-automated-repos** library. + +- πŸ“¦ [github-automated-repos](https://github.com/digoarthur/github-automated-repos). + +--- + + + + + +# Getting Started + + +## 1. Run Command + + +```bash +npx github-automated-repos-cli init + +``` + +## 2. Enter data + +#### πŸ¦‘ GitHub Username + +You will be prompted to enter your GitHub username. + +This is used to fetch your public repositories directly from GitHub. + +```yaml +βœ” GitHub username: xxxxxx + +``` + +#### πŸ”‘ Keyword (Repository Filter) + +Next, you’ll choose a keyword (for example: attached , portfolio , featured ). + +This keyword will be used to filter repositories via the GitHub Topics field. + +```yaml +βœ” Keyword to filter (e.g. 'attached'): attached +``` + +> [!IMPORTANT] +> Don't forget to enter your Keyword in the Topics field of each project so it appears on the generated page. + + +![image](https://github.com/DIGOARTHUR/github-automated-repos/assets/59892368/9a0a0aaf-02e8-4a7f-8390-6e7fb4a3ea53) + + + +## 3. Page Generation + + Once confirmed, the CLI will: +- Generate the project page +- Inject the correct logic +- Connect it to github-automated-repos +- Finalize the template + +## 4. Result + +Your project page is now ready πŸŽ‰ + +```arduino +✨ Your project page is ready! +πŸ”— http://localhost:3000/projects +``` +--- + +## Supported Framework Paths + + ### Group 43 Next.js (App Router) + + +```arduino +app/projects/page.tsx +``` + +### dashgo_layout ViteJS + +```arduino +src/pages/projects.tsx +``` + + + + + + + +
+ + +--- + +
+ + + +**Love github-automated-repos CLI? Give our repo a star ⭐ [⬆️](https://github.com/DIGOARTHUR/github-automated-repos-cli) .** + + +`based in:` [Api Github](https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#get-a-repository) + +`by`: [@digoarthur](https://www.linkedin.com/in/digoarthur/) Brazil Flag + + +
+ +**[github-automated-repos](https://github.com/digoarthur/github-automated-repos)** + +
+ From 05bb4b08c70022f3190103239b11a5190ccbe3ec Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 28 Dec 2025 17:56:19 +0000 Subject: [PATCH 5/6] chore(changelog): update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9801504..ae851d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ -# 1.0.1 (2025-12-25) +# 1.0.1 (2025-12-28) # 1.0.0 (2025-12-22) From d8acd6a2240d45a14395f84deef68a617cdeb8e2 Mon Sep 17 00:00:00 2001 From: digoarthur Date: Sun, 28 Dec 2025 18:02:25 +0000 Subject: [PATCH 6/6] chore(package): update package.json description --- package.json | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index d33ec4b..87428ee 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,18 @@ { "name": "github-automated-repos-cli", "version": "1.0.1", - "description": "CLI para gerar pΓ‘gina de exemplo usando github-automated-repos em projetos Next.js, React ou Vite.", + "description": "CLI that automates the creation of GitHub project pages by integrating github-automated-repos Library into Next.js, React, and Vite workflows.", + + "author": { + "name": "Diego Arthur (@digoarthur)", + "url": "https://www.linkedin.com/in/digoarthur/", + "github": "https://github.com/DIGOARTHUR" + }, + "repository": { + "type": "github", + "url": "https://github.com/digoarthur/github-automated-repos-cli" + }, + "homepage": "https://github-automated-repos.vercel.app", "type": "module", "bin": { "github-automated-repos-cli": "./bin/index.js" @@ -13,7 +24,6 @@ "changelog": "conventional-changelog --config changelog-config.cjs -i CHANGELOG.md -s -r 0", "prepublishOnly": "node ./scripts/guard-npm-publish.js" }, - "author": "Digo Arthur", "license": "MIT", "dependencies": { "chalk": "^5.6.2", @@ -22,15 +32,15 @@ "ora": "^9.0.0", "prompts": "^2.4.2" }, - "files": [ - "bin", - "commands", - "utils", - "scripts", - "pageExample", - "README.md", - "LICENSE" -], + "files": [ + "bin", + "commands", + "utils", + "scripts", + "pageExample", + "README.md", + "LICENSE" + ], "devDependencies": { "conventional-changelog-cli": "^5.0.0" }