-
Notifications
You must be signed in to change notification settings - Fork 126
chore: add jsdocs + extension docs auto-gen #783
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
Merged
harbournick
merged 20 commits into
develop
from
feature/har-10244-4-superdoc-docs-automate-documentation-generation-for
Aug 22, 2025
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
b86c547
docs: add GitHub Actions workflow to trigger documentation updates on…
caiopizzol cdbc138
chore: add ESLint configuration for JSDoc validation in documentation…
caiopizzol 7c22fd7
chore: update ESLint configuration for JSDoc and enhance type definit…
caiopizzol 2414d83
chore: refine field annotation file structure and suppress TypeScript…
caiopizzol aaebb57
docs: enhance Editor type definition in SuperDoc.js for improved clar…
caiopizzol a475730
docs: enhance JSDoc comments for field annotation methods to improve …
caiopizzol b2e10cb
chore: disable checkJs in tsconfig and enable JSDoc checking in field…
caiopizzol 04fa6c1
chore: remove redundant JSDoc type definitions in SuperDoc.js and cle…
caiopizzol d7524ce
chore: remove TypeScript ignore comments from various files to improv…
caiopizzol 16fd224
chore: remove TypeScript ignore comments from FieldAnnotationPlugin.j…
caiopizzol e38c76a
chore: refactor build scripts and remove unused TypeScript type defin…
caiopizzol 8a89578
chore: update build configuration and improve TypeScript output struc…
caiopizzol 053e146
docs: enhance JSDoc comments and type definitions for DocumentSection…
caiopizzol 088f98c
docs: add @category Command tag to JSDoc comments in DocumentSection …
caiopizzol f0b0f23
docs: refine JSDoc comments and type definitions for section creation…
caiopizzol 11fb9d7
chore: remove outDir option from tsconfig.build.json in super-editor
caiopizzol 4cc1e6c
chore: refactor initPagination method to private and update tsconfig …
caiopizzol bdfb9d4
refactor: replace initPagination calls with private method #initPagin…
caiopizzol af49374
fix: correct syntax in catch blocks for better error handling in Edit…
caiopizzol 0e28a97
Doc gen: Add aliases to tsconfig, remove ts-ignore in document sectio…
harbournick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Trigger Documentation Update | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| # Trigger when extensions change | ||
| - 'packages/super-editor/src/extensions/**/*.js' | ||
| # - 'packages/super-editor/src/core/**/*.js' | ||
| # - 'packages/super-editor/src/components/**/*.js' | ||
| workflow_dispatch: # Manual trigger | ||
|
|
||
| jobs: | ||
| trigger-docs: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Trigger Documentation Repository Update | ||
| run: | | ||
| # Set the required variables | ||
| repo_owner="Harbour-Enterprises" | ||
|
caio-pizzol marked this conversation as resolved.
|
||
| repo_name="SuperDoc-Docs" | ||
|
caio-pizzol marked this conversation as resolved.
|
||
| event_type="docs-update" | ||
|
|
||
| curl -L \ | ||
| -X POST \ | ||
| -H "Accept: application/vnd.github+json" \ | ||
| -H "Authorization: Bearer ${{ secrets.SUPERDOC_PAT }}" \ | ||
| -H "X-GitHub-Api-Version: 2022-11-28" \ | ||
| https://api.github.com/repos/$repo_owner/$repo_name/dispatches \ | ||
| -d "{\"event_type\": \"$event_type\"}" | ||
|
|
||
| - name: Notify Success | ||
| if: success() | ||
| run: echo "✅ Documentation update triggered successfully" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ dist-ssr | |
| .env | ||
| .npmrc | ||
| .eslintcache | ||
| types/ | ||
|
|
||
| npm-debug.log* | ||
| yarn-debug.log* | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| import jsdoc from 'eslint-plugin-jsdoc'; | ||
|
|
||
| export default [ | ||
| { | ||
| files: ['packages/super-editor/src/extensions/**/*.js'], | ||
| plugins: { | ||
| jsdoc | ||
| }, | ||
| rules: { | ||
| // Require minimal JSDoc for extensions | ||
| 'jsdoc/require-jsdoc': ['warn', { | ||
| publicOnly: true, | ||
| require: { | ||
| FunctionDeclaration: false, | ||
| MethodDefinition: false, | ||
| ClassDeclaration: false, | ||
| ArrowFunctionExpression: false, | ||
| FunctionExpression: false | ||
| }, | ||
| contexts: [ | ||
| // Document the extension module | ||
| 'ExportNamedDeclaration > VariableDeclaration > VariableDeclarator > CallExpression[callee.property.name="create"]' | ||
|
|
||
| // Note: We document commands/helpers with @param/@returns | ||
| // inside addCommands/addHelpers, not with require-jsdoc | ||
| ] | ||
| }], | ||
|
|
||
| // When JSDoc exists, validate it's correct | ||
| 'jsdoc/require-param': 'error', // All params must be documented | ||
| 'jsdoc/require-param-type': 'error', // @param must have {Type} | ||
| 'jsdoc/check-param-names': 'error', // @param names must match | ||
| 'jsdoc/check-types': 'error', // Valid type syntax (string not String) | ||
|
|
||
| // Optional - we use @returns {Function} or skip it | ||
| 'jsdoc/require-returns': 'off', | ||
| 'jsdoc/require-returns-type': 'off', | ||
|
|
||
| // Don't require descriptions if obvious | ||
| 'jsdoc/require-param-description': 'off', | ||
| 'jsdoc/require-returns-description': 'off', | ||
| 'jsdoc/require-description': 'off', | ||
|
|
||
| // Don't require examples - nice to have but not essential | ||
| 'jsdoc/require-example': 'off', | ||
|
|
||
| // Simple formatting | ||
| 'jsdoc/require-hyphen-before-param-description': 'off', // Optional: @param {Type} name - Description | ||
|
|
||
| // Allow types from our .d.ts files and common types | ||
| 'jsdoc/no-undefined-types': ['warn', { | ||
| definedTypes: [ | ||
| // Allow any type that starts with capital letter (likely imported) | ||
| '/^[A-Z]/', | ||
|
|
||
| // Common utility types | ||
| 'Partial', 'Required', 'Readonly', 'Pick', 'Omit', | ||
|
|
||
| // Built-in types | ||
| 'Function', 'Object', 'Array', 'Promise', | ||
|
|
||
| // DOM | ||
| 'HTMLElement', 'Element', 'Event' | ||
| ] | ||
| }], | ||
|
|
||
| // Don't enforce these | ||
| 'jsdoc/valid-types': 'off', // We use TypeScript syntax | ||
| 'jsdoc/check-tag-names': 'off', // Allow @module, @typedef, etc. | ||
| 'jsdoc/check-alignment': 'off', // Don't worry about alignment | ||
| 'jsdoc/multiline-blocks': 'off' // Allow single or multi-line | ||
| }, | ||
| settings: { | ||
| jsdoc: { | ||
| mode: 'typescript', // Understand TypeScript syntax in JSDoc | ||
| preferredTypes: { | ||
| object: 'Object', // Use Object not object | ||
| array: 'Array', // Use Array not array | ||
| 'Array.<>': 'Array<>', // Use Array<Type> not Array.<Type> | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ]; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.