-
Notifications
You must be signed in to change notification settings - Fork 0
feat(description): Add config update command and split generation scripts #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -179,43 +179,49 @@ Options: | |
|
|
||
| <!-- doc-gen COMMANDS format=list --> | ||
|
|
||
| - `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. | ||
|
Comment on lines
+285
to
+296
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's an inconsistency in the generated file tree under "Project Structure". The |
||
| ``` | ||
|
|
||
| <!-- end-doc-gen --> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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.', | ||
|
Comment on lines
+7
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The file paths in the |
||
| }, | ||
| }, | ||
| 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'), | ||
| }, | ||
| }; | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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." | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
85
to
93
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For better readability and easier maintenance of the
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new
describecommand and its workflow could be improved for efficiency and clarity. As it stands, bothnpm run describe:fileandnpm run describecall the AI to generate descriptions, which is redundant if a user wants to both save descriptions to a file and update themd.config.js. This is inefficient as it results in extra API calls.A more efficient workflow would be to separate generation from updating:
describe:filegenerates descriptions from the AI and saves them to a file (e.g.,descriptions.json).describereads this generated file to updatemd.config.js, without making new AI calls.This could be achieved by adding an option to the CLI (e.g.,
--input <file>) to allow the update command to read descriptions from a file instead of generating them on the fly.