From e4d1cd9e48c5bee3de0fe36afb6e762c5ac760ec Mon Sep 17 00:00:00 2001 From: Ion Gireada Date: Sun, 2 Nov 2025 19:11:31 +0200 Subject: [PATCH] feat(description): Add config update command and split generation scripts --- CONTRIBUTING.md | 2 +- README.md | 44 +++++++++++++++++++++++++------------------- md.config.js | 29 +++++++++++++++++++++++++---- package.json | 8 +++++--- 4 files changed, 56 insertions(+), 27 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6e8193d..39e0dfd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ Please note that this project is released with a [Code of Conduct](RULES_OF_COND ## How Can I Contribute? -### Reporting Bugs +### Reporting Bugs If you find a bug, please open an issue on our [GitHub Issues page](https://github.com/IonGireada/repo-description/issues). When reporting a bug, please include: diff --git a/README.md b/README.md index 4126a5a..947612d 100644 --- a/README.md +++ b/README.md @@ -179,43 +179,49 @@ Options: -- `describe` — Generates AI-powered descriptions for repository files and outputs them in various formats. (line [85](./package.json#L85)) +- `describe` — Update repository descriptions in md.config.js transformDefaults for fileTreeExtended. (line [92](./package.json#L92)) ```bash - node src/cli.js . descriptions.json && node src/cli.js . descriptions.md --format markdown && node src/cli.js . descriptions-table.md --format markdown --table && node src/cli.js . descriptions-summary.md --format markdown --summary && node src/cli.js . descriptions-table-summary.md --format markdown --table --summary + node src/cli.js . --update-config md.config.js --transform-name fileTreeExtended ``` -- `docs` — Generates documentation by processing Markdown files with markdown-magic. (line [90](./package.json#L90)) +- `describe:file` — Generates AI-powered descriptions for repository files and outputs them in various formats. (line [86](./package.json#L86)) + + ```bash + node src/cli.js . --output descriptions.json + ``` + +- `docs` — Generates documentation by processing Markdown files with markdown-magic. (line [91](./package.json#L91)) ```bash npx markdown-magic@3.7.0 **/*.md -c md.config.js ``` -- `format` — Formats the codebase using Prettier. (line [88](./package.json#L88)) +- `format` — Formats the codebase using Prettier. (line [89](./package.json#L89)) ```bash prettier --write . ``` -- `lint` — Lints the codebase for potential errors and style violations. (line [86](./package.json#L86)) +- `lint` — Lints the codebase for potential errors and style violations. (line [87](./package.json#L87)) ```bash eslint src/ **/*.js **/*.json ``` -- `lint:fix` — Lints the codebase and automatically fixes fixable issues. (line [87](./package.json#L87)) +- `lint:fix` — Lints the codebase and automatically fixes fixable issues. (line [88](./package.json#L88)) ```bash eslint --fix src/ **/*.js **/*.json ``` -- `prep` — Prepares the codebase by generating documentation, linting, and formatting. (line [89](./package.json#L89)) +- `prep` — Prepares the codebase by generating documentation, linting, and formatting. (line [90](./package.json#L90)) ```bash npm run docs && npm run lint:fix && npm run format ``` -- `test` — Runs the test suite using Jest. (line [84](./package.json#L84)) +- `test` — Runs the test suite using Jest. (line [85](./package.json#L85)) ```bash jest --passWithNoTests @@ -276,18 +282,18 @@ repo-description/ │ ├── index.js │ ├── refactor-package.js │ └── utils.js -├── .env +├── .env # Description unavailable. ├── .gitignore -├── .prettierrc.json -├── babel.config.js -├── CONTRIBUTING.md -├── eslint.config.js -├── LICENSE -├── md.config.js -├── package-lock.json -├── package.json -├── README.md -└── RULES_OF_CONDUCT.md +├── .prettierrc.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. +├── package-lock.json # Description unavailable. +├── package.json # Description unavailable. +├── README.md # Description unavailable. +└── RULES_OF_CONDUCT.md # Description unavailable. ``` diff --git a/md.config.js b/md.config.js index b1fe59d..9b92fd6 100644 --- a/md.config.js +++ b/md.config.js @@ -1,15 +1,36 @@ module.exports = { transformDefaults: { - fileTreeExtended: {}, + 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.', + '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.', + }, + }, BADGES: { style: 'for-the-badge', }, }, transforms: { - INSTALL: require('markdown-magic-install-extended'), - COMMANDS: require('markdown-magic-scripts'), - BADGES: require('markdown-magic-transform-badges'), fileTreeExtended: require('markdown-magic-transform-treefile-extended'), + BADGES: require('markdown-magic-transform-badges'), + INSTALL: require('markdown-magic-install-extended'), ACKNOWLEDGEMENTS: require('markdown-magic-transform-acknowledgements'), + COMMANDS: require('markdown-magic-scripts'), }, }; diff --git a/package.json b/package.json index 47f5c07..3d1e749 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,8 @@ "README.md" ], "scripts": { - "describe": "node src/cli.js . descriptions.json && node src/cli.js . descriptions.md --format markdown && node src/cli.js . descriptions-table.md --format markdown --table && node src/cli.js . descriptions-summary.md --format markdown --summary && node src/cli.js . descriptions-table-summary.md --format markdown --table --summary", + "describe": "node src/cli.js . --update-config md.config.js --transform-name fileTreeExtended", + "describe:file": "node src/cli.js . --output descriptions.json", "docs": "npx markdown-magic@3.7.0 **/*.md -c md.config.js", "format": "prettier --write .", "lint": "eslint src/ **/*.js **/*.json", @@ -82,11 +83,12 @@ }, "scriptsMeta": { "test": "Runs the test suite using Jest.", - "describe": "Generates AI-powered descriptions for repository files and outputs them in various formats.", + "describe:file": "Generates AI-powered descriptions for repository files and outputs them in various formats.", "lint": "Lints the codebase for potential errors and style violations.", "lint:fix": "Lints the codebase and automatically fixes fixable issues.", "format": "Formats the codebase using Prettier.", "prep": "Prepares the codebase by generating documentation, linting, and formatting.", - "docs": "Generates documentation by processing Markdown files with markdown-magic." + "docs": "Generates documentation by processing Markdown files with markdown-magic.", + "describe": "Update repository descriptions in md.config.js transformDefaults for fileTreeExtended." } }