Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f6ffc04
output type definitions and adjust package.json so that types are pic…
trusktr Mar 28, 2024
2387399
ignore dist in prettierignore
trusktr Mar 28, 2024
1a352af
deprecate globals and global script data-* attributes, and set up the…
trusktr Apr 1, 2024
355469f
add dist to eslintignore
trusktr Apr 2, 2024
4a867ad
fix typo
trusktr Apr 2, 2024
c860c65
Merge branch 'develop' into type-definitions
trusktr Nov 16, 2025
482297a
fix many type errors by adding type declarations, suppress ~600 error…
trusktr Nov 16, 2025
6aa8831
update DocsifyConfig types and docs, improve/fix a few types, and add…
trusktr Nov 17, 2025
a0a3b78
hook the consume-types test into CI
trusktr Nov 17, 2025
585b7d3
quotes messing windows up?
trusktr Nov 17, 2025
da6f92b
fix e2e tests that failed on the added deprecation messages
trusktr Nov 17, 2025
4b6f2d3
fix formatting
trusktr Nov 17, 2025
a042aca
remove deprecation messages from global API
trusktr Nov 17, 2025
f672341
Update src/core/event/index.js
trusktr Nov 18, 2025
cb41307
remove unnecessary boolean type from `repo` option
trusktr Nov 18, 2025
08d4a65
Merge branch 'type-definitions' of github.com:docsifyjs/docsify into …
trusktr Nov 18, 2025
512ab8d
Fix spelling error in test/consume-types/README.md (#2630)
Copilot Nov 18, 2025
dedc3b8
Remove dead code in getNode Vue detection (#2631)
Copilot Nov 18, 2025
73fd804
fix type error
trusktr Nov 18, 2025
97472a7
Merge branch 'develop' into type-definitions
trusktr Nov 20, 2025
71a7db4
Merge branch 'develop' into type-definitions
trusktr Nov 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/_playwright-report
/_playwright-results
/lib
/dist
/node_modules
/.husky/_

Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ lib/
themes/
_playwright-*/
emoji-data.*

# for some reason this is needed in CI, although locally Prettier ignored dist/ already.
dist/
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"cSpell.words": ["coverpage"]
"cSpell.words": ["coverpage"],
"typescript.tsdk": "node_modules/typescript/lib"
}
21 changes: 18 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,37 @@
"type": "module",
"// The 'main' and 'unpkg' fields will remain as legacy for backwards compatibility for now. We will add deprectaion warnings to these outputs to give people time to see the warnings in their apps in a non-breaking way, and eventually we can remove the legacy stuff.": "",
"main": "lib/docsify.js",
"types": "dist/core/Docsify.d.ts",
"unpkg": "lib/docsify.min.js",
"// We're using the 'exports' field as an override of the 'main' field to provide the new ESM setup. Once we remove legacy 'main', we will remove the 'exports' field and have a simple ESM setup with only a 'main' field.": "",
"// These exports require moduleResolution:NodeNext to be enabled in the consumer.": "",
"// TODO native ESM (in browsers) does not work yet because prismjs is not ESM and Docsify source imports it as CommonJS": "",
"exports": {
".": "./src/Docsify.js",
"./*": "./*"
"./*": "./*",
".": {
"types": "./dist/core/Docsify.d.ts",
"default": "./src/core/Docsify.js"
}
},
"files": [
"lib",
"themes"
],
"// Using 'typesVersions' here is the only way we could figure out how to get types working for imports of any subpath without any of the problems other approaches have when not using modeResolution:NodeNext (listed in https://stackoverflow.com/questions/77856692/how-to-publish-plain-jsjsdoc-library-for-typescript-consumers)": "",
"typesVersions": {
"*": {
"src/*": [
"dist/*"
]
}
},
"scripts": {
"build:cover": "node build/cover.js",
"build:css:min": "node build/mincss.js",
"build:css": "mkdirp lib/themes && node build/css -o lib/themes",
"build:emoji": "node ./build/emoji.js",
"build:js": "cross-env NODE_ENV=production node build/build.js",
"build:js": "npm run build:types && cross-env NODE_ENV=production node build/build.js",
"build:types": "tsc -p tsconfig.json || true",
"build:test": "npm run build && npm test",
"build": "rimraf lib themes && run-s build:js build:css build:css:min build:cover build:emoji",
"dev": "run-p serve:dev watch:*",
Expand Down
25 changes: 25 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"allowJs": true,
"checkJs": true,

"module": "NodeNext",
"moduleResolution": "NodeNext",
"target": "ESNext",
"lib": ["DOM", "ESNext"],
"declaration": true,
"emitDeclarationOnly": true,
"resolveJsonModule": true,
"outDir": "dist/"
},
"include": ["src/**/*.js"],
"exclude": [
// "./**/*.test.js",
// "test/",
// "jest.config.js",
// "middleware.js",
// "playwright.config.js",
// "server.configs.js",
// "server.js"
]
}