From 2c56a41e5ed2895beb50d6d1bc9ee1784a888cec Mon Sep 17 00:00:00 2001 From: Ion Gireada Date: Sun, 2 Nov 2025 20:35:07 +0200 Subject: [PATCH] docs(config): Add detailed descriptions and normalize file paths Add comprehensive descriptions for project files and update README.md. Standardize file paths in configuration and description logic. Remove redundant package-name from CI release workflow. --- .github/workflows/release.yml | 1 - CHANGELOG.md | 5 ++--- README.md | 27 ++++++++++++------------- md.config.js | 37 ++++++++++++++++++++++------------- package.json | 1 - src/describe.js | 30 ++++++++++++++-------------- 6 files changed, 53 insertions(+), 48 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b5da3ed..3ba1035 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,6 +23,5 @@ jobs: id: release with: release-type: node - package-name: repo-description target-branch: main token: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index db132ff..1f67f8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,10 @@ ## [1.0.1](https://github.com/ioncakephper/repo-description/compare/v1.0.0...v1.0.1) (2025-11-02) - ### Bug Fixes -* **ci:** correct npm token secret name capitalization ([10f0b09](https://github.com/ioncakephper/repo-description/commit/10f0b098068a4cc018c0f1e450d21bb139b60319)) -* **release:** configure release-please permissions and token ([d1019cb](https://github.com/ioncakephper/repo-description/commit/d1019cbaa588461fdf4d087e918b9e613d260a11)) +- **ci:** correct npm token secret name capitalization ([10f0b09](https://github.com/ioncakephper/repo-description/commit/10f0b098068a4cc018c0f1e450d21bb139b60319)) +- **release:** configure release-please permissions and token ([d1019cb](https://github.com/ioncakephper/repo-description/commit/d1019cbaa588461fdf4d087e918b9e613d260a11)) ## 1.0.0 (2025-11-02) diff --git a/README.md b/README.md index 5e9990b..9426395 100644 --- a/README.md +++ b/README.md @@ -245,7 +245,6 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file - [@eslint/js](https://www.npmjs.com/package/%40eslint%2Fjs) — ESLint JavaScript language implementation - [babel-jest](https://www.npmjs.com/package/babel-jest) — Jest plugin to use babel for transformation. - [commander](https://www.npmjs.com/package/commander) — the complete solution for node.js command-line programs -- [conventional-changelog-cli](https://www.npmjs.com/package/conventional-changelog-cli) — No description available - [dotenv](https://www.npmjs.com/package/dotenv) — Loads environment variables from .env file - [eslint](https://www.npmjs.com/package/eslint) — An AST-based pattern checker for JavaScript. - [eslint-config-prettier](https://www.npmjs.com/package/eslint-config-prettier) — Turns off all rules that are unnecessary or might conflict with Prettier. @@ -273,24 +272,24 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file repo-description/ ├── __tests__ │ ├── .gitkeep -│ └── cli.test.js +│ └── cli.test.js # Description unavailable. ├── .qodo │ ├── agents │ └── workflows ├── src -│ ├── cli.js -│ ├── describe.js -│ ├── index.js -│ └── utils.js -├── .env # Description unavailable. +│ ├── cli.js # Description unavailable. +│ ├── describe.js # Description unavailable. +│ ├── index.js # Description unavailable. +│ └── utils.js # Description unavailable. +├── .env # Configure... the environment by setting the `GROQ_API_KEY` variable to provide authentication for Groq API access. ├── .gitignore -├── .prettierrc.json # Description unavailable. -├── babel.config.js # Description unavailable. -├── CHANGELOG.md -├── CONTRIBUTING.md # Description unavailable. -├── eslint.config.js # Description unavailable. -├── LICENSE # Description unavailable. -├── md.config.js # Description unavailable. +├── .prettierrc.json # Configure Prettier to enforce single quotes, trailing commas (es5), an 80‑character print width, and a specific ordering of fields in package.json via the prettier‑plugin‑packagejson. +├── babel.config.js # [configure] Babel to use @babel/preset‑env with the target set to the current Node version… +├── CHANGELOG.md # Documenting the project's version history by listing each release’s features, bug fixes, and related metadata in a Keep‑a‑Changelog format. +├── CONTRIBUTING.md # Guide contributors on how to report bugs, suggest enhancements, and submit code via pull requests. +├── eslint.config.js # Configure ESLint with global browser, node, and jest globals, recommended core and Prettier rules, and custom JSON/JSONC and YAML parsers and plugins for those file types. +├── LICENSE # Granting permission to use, copy, modify, merge, publish, distribute, sublicense, and sell the software freely under the MIT License. +├── md.config.js # [Exports] a configuration object that defines default settings (like file descriptions and badge style) and registers the markdown‑magic transform modules used to generate and augment the project’s documentation. ├── package-lock.json # Description unavailable. ├── package.json # Description unavailable. ├── README.md # Description unavailable. diff --git a/md.config.js b/md.config.js index 9b92fd6..4b3d56a 100644 --- a/md.config.js +++ b/md.config.js @@ -2,24 +2,33 @@ module.exports = { transformDefaults: { fileTreeExtended: { descriptions: { - '.env': 'Description unavailable.', - '.prettierrc.json': 'Description unavailable.', - '.vscode\\launch.json': 'Description unavailable.', - 'babel.config.js': 'Description unavailable.', - 'CONTRIBUTING.md': 'Description unavailable.', - 'eslint.config.js': 'Description unavailable.', - LICENSE: 'Description unavailable.', - 'md.config.js': 'Description unavailable.', + '.env': + 'Configure... the environment by setting the `GROQ_API_KEY` variable to provide authentication for Groq API access.', + '.prettierrc.json': + 'Configure Prettier to enforce single quotes, trailing commas (es5), an 80‑character print width, and a specific ordering of fields in package.json via the prettier‑plugin‑packagejson.', + '.vscode/launch.json': + 'Configure launch configurations for debugging Node.js programs in VS Code.', + 'babel.config.js': + '[configure] Babel to use @babel/preset‑env with the target set to the current Node version…', + 'CHANGELOG.md': + "Documenting the project's version history by listing each release’s features, bug fixes, and related metadata in a Keep‑a‑Changelog format.", + 'CONTRIBUTING.md': + 'Guide contributors on how to report bugs, suggest enhancements, and submit code via pull requests.', + 'eslint.config.js': + 'Configure ESLint with global browser, node, and jest globals, recommended core and Prettier rules, and custom JSON/JSONC and YAML parsers and plugins for those file types.', + LICENSE: + 'Granting permission to use, copy, modify, merge, publish, distribute, sublicense, and sell the software freely under the MIT License.', + 'md.config.js': + '[Exports] a configuration object that defines default settings (like file descriptions and badge style) and registers the markdown‑magic transform modules used to generate and augment the project’s documentation.', 'package-lock.json': 'Description unavailable.', 'package.json': 'Description unavailable.', 'README.md': 'Description unavailable.', 'RULES_OF_CONDUCT.md': 'Description unavailable.', - 'src\\cli.js': 'Description unavailable.', - 'src\\describe.js': 'Description unavailable.', - 'src\\index.js': 'Description unavailable.', - 'src\\refactor-package.js': 'Description unavailable.', - 'src\\utils.js': 'Description unavailable.', - '__tests__\\cli.test.js': 'Description unavailable.', + 'src/cli.js': 'Description unavailable.', + 'src/describe.js': 'Description unavailable.', + 'src/index.js': 'Description unavailable.', + 'src/utils.js': 'Description unavailable.', + '__tests__/cli.test.js': 'Description unavailable.', }, }, BADGES: { diff --git a/package.json b/package.json index b1cfc9d..69d54ba 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,6 @@ "@babel/preset-env": "^7.28.5", "@eslint/js": "^9.38.0", "babel-jest": "^30.2.0", - "eslint": "^9.39.0", "eslint-config-prettier": "^10.1.8", "eslint-plugin-jsonc": "^2.21.0", diff --git a/src/describe.js b/src/describe.js index 49a3d68..e5ce5f7 100644 --- a/src/describe.js +++ b/src/describe.js @@ -108,7 +108,20 @@ ${content}`; descriptions[path.relative(repoPath, file)] = await queryGroq(prompt); } - return descriptions; + const transformDescriptions = (inputDescriptions) => { + const outputDescriptions = {}; + for (const key in inputDescriptions) { + if (Object.prototype.hasOwnProperty.call(inputDescriptions, key)) { + const newKey = key.replace(/\\/g, '/'); + outputDescriptions[newKey] = inputDescriptions[key]; + } + } + return outputDescriptions; + }; + + const formattedDescriptions = transformDescriptions(descriptions); + + return formattedDescriptions; } /** @@ -158,25 +171,12 @@ async function updateMarkdownMagicConfig( * @param {boolean} [table=false] - Whether to use a table format for markdown output. */ function saveOutput( - inputDescriptions, + descriptions, outputFile, format = 'json', summary = false, table = false ) { - const transformDescriptions = (inputDescriptions) => { - const outputDescriptions = {}; - for (const key in inputDescriptions) { - if (Object.prototype.hasOwnProperty.call(inputDescriptions, key)) { - const newKey = key.replace(/\\/g, '/'); - outputDescriptions[newKey] = inputDescriptions[key]; - } - } - return outputDescriptions; - }; - - const descriptions = transformDescriptions(inputDescriptions); - if (format === 'json') { fs.writeFileSync(outputFile, JSON.stringify(descriptions, null, 2)); } else if (format === 'markdown') {