Skip to content

Commit 4831b5c

Browse files
committed
Merge branch 'develop' into programmatic-text-selection-example
2 parents d8e80f3 + 4186627 commit 4831b5c

52 files changed

Lines changed: 1906 additions & 133 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Trigger Documentation Update
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
# Trigger when extensions change
9+
- 'packages/super-editor/src/extensions/**/*.js'
10+
# - 'packages/super-editor/src/core/**/*.js'
11+
# - 'packages/super-editor/src/components/**/*.js'
12+
workflow_dispatch: # Manual trigger
13+
14+
jobs:
15+
trigger-docs:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Trigger Documentation Repository Update
19+
run: |
20+
# Set the required variables
21+
repo_owner="Harbour-Enterprises"
22+
repo_name="SuperDoc-Docs"
23+
event_type="docs-update"
24+
25+
curl -L \
26+
-X POST \
27+
-H "Accept: application/vnd.github+json" \
28+
-H "Authorization: Bearer ${{ secrets.SUPERDOC_PAT }}" \
29+
-H "X-GitHub-Api-Version: 2022-11-28" \
30+
https://api.github.com/repos/$repo_owner/$repo_name/dispatches \
31+
-d "{\"event_type\": \"$event_type\"}"
32+
33+
- name: Notify Success
34+
if: success()
35+
run: echo "✅ Documentation update triggered successfully"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dist-ssr
1010
.env
1111
.npmrc
1212
.eslintcache
13+
types/
1314

1415
npm-debug.log*
1516
yarn-debug.log*

eslint.config.docs.mjs

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import jsdoc from 'eslint-plugin-jsdoc';
2+
3+
export default [
4+
{
5+
files: ['packages/super-editor/src/extensions/**/*.js'],
6+
plugins: {
7+
jsdoc
8+
},
9+
rules: {
10+
// Require minimal JSDoc for extensions
11+
'jsdoc/require-jsdoc': ['warn', {
12+
publicOnly: true,
13+
require: {
14+
FunctionDeclaration: false,
15+
MethodDefinition: false,
16+
ClassDeclaration: false,
17+
ArrowFunctionExpression: false,
18+
FunctionExpression: false
19+
},
20+
contexts: [
21+
// Document the extension module
22+
'ExportNamedDeclaration > VariableDeclaration > VariableDeclarator > CallExpression[callee.property.name="create"]'
23+
24+
// Note: We document commands/helpers with @param/@returns
25+
// inside addCommands/addHelpers, not with require-jsdoc
26+
]
27+
}],
28+
29+
// When JSDoc exists, validate it's correct
30+
'jsdoc/require-param': 'error', // All params must be documented
31+
'jsdoc/require-param-type': 'error', // @param must have {Type}
32+
'jsdoc/check-param-names': 'error', // @param names must match
33+
'jsdoc/check-types': 'error', // Valid type syntax (string not String)
34+
35+
// Optional - we use @returns {Function} or skip it
36+
'jsdoc/require-returns': 'off',
37+
'jsdoc/require-returns-type': 'off',
38+
39+
// Don't require descriptions if obvious
40+
'jsdoc/require-param-description': 'off',
41+
'jsdoc/require-returns-description': 'off',
42+
'jsdoc/require-description': 'off',
43+
44+
// Don't require examples - nice to have but not essential
45+
'jsdoc/require-example': 'off',
46+
47+
// Simple formatting
48+
'jsdoc/require-hyphen-before-param-description': 'off', // Optional: @param {Type} name - Description
49+
50+
// Allow types from our .d.ts files and common types
51+
'jsdoc/no-undefined-types': ['warn', {
52+
definedTypes: [
53+
// Allow any type that starts with capital letter (likely imported)
54+
'/^[A-Z]/',
55+
56+
// Common utility types
57+
'Partial', 'Required', 'Readonly', 'Pick', 'Omit',
58+
59+
// Built-in types
60+
'Function', 'Object', 'Array', 'Promise',
61+
62+
// DOM
63+
'HTMLElement', 'Element', 'Event'
64+
]
65+
}],
66+
67+
// Don't enforce these
68+
'jsdoc/valid-types': 'off', // We use TypeScript syntax
69+
'jsdoc/check-tag-names': 'off', // Allow @module, @typedef, etc.
70+
'jsdoc/check-alignment': 'off', // Don't worry about alignment
71+
'jsdoc/multiline-blocks': 'off' // Allow single or multi-line
72+
},
73+
settings: {
74+
jsdoc: {
75+
mode: 'typescript', // Understand TypeScript syntax in JSDoc
76+
preferredTypes: {
77+
object: 'Object', // Use Object not object
78+
array: 'Array', // Use Array not array
79+
'Array.<>': 'Array<>', // Use Array<Type> not Array.<Type>
80+
}
81+
}
82+
}
83+
}
84+
];

package-lock.json

Lines changed: 129 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
"format:check": "prettier --check \"**/*.{js,jsx,vue,css,scss,json,md}\"",
2626
"lint": "eslint",
2727
"lint:fix": "eslint --fix",
28+
"lint:jsdoc": "eslint packages/super-editor/src/extensions/field-annotation/field-annotation.js --config eslint.config.docs.mjs",
29+
"lint:jsdoc:fix": "eslint packages/super-editor/src/extensions/field-annotation/field-annotation.js --config eslint.config.docs.mjs --fix",
2830
"docs:dev": "vuepress dev docs",
2931
"docs:build": "vuepress build docs",
3032
"pack": "npm run build:super-editor && npm --prefix ./packages/superdoc run pack",
@@ -54,6 +56,7 @@
5456
"@vuepress/theme-default": "^2.0.0-rc.60",
5557
"eslint": "^9.31.0",
5658
"eslint-config-prettier": "^9.1.0",
59+
"eslint-plugin-jsdoc": "^54.1.0",
5760
"husky": "^9.1.7",
5861
"lint-staged": "^16.1.4",
5962
"prettier": "3.3.3",

0 commit comments

Comments
 (0)