8 Commits

Author SHA1 Message Date
Koy Zhuang
4bc5062fc1
fix: auto header config heading generate func (#2474) 2024-07-28 16:14:41 +08:00
John Hildenbiddle
bb902f8997
refactor: event modernization and optimization (#2404)
- Refactor methods names and functionality
- Replace scroll listeners with observers
- Replace Tweezer-based scrolling with native scroll methods
- Remove tweezer.js dependency
- Remove redundant method calls
- Rename $resetEvents to onNavigate
- Rename __scrollActiveSidebar to onRender
- Remove __getAndActive
- Remove __sticky
- Add IntersectionObserver mock to Jest environment

Also included:

- Add e2e test “ui” and “chromium” scripts
- Rename "jest" script to "test:jest"
- Remove unused SSR code

---------

Co-authored-by: Koy Zhuang <koy@ko8e24.top>
2024-04-21 07:44:14 -05:00
Joe Pea
62d756c447 refactor: convert to ES Modules and remove traces of CommonJS except in Rollup config because some dependencies are still CommonJS
BREAKING: The new project layout might break in some tooling setups.

We've added an exports field to `package.json` to specify where
statements like `import ... from 'docsify'` will import from, and left
the `main` and `unpkg` fields as-is for backwards compatibility with the
global <script> import method. Most people who use a non-module
`<script>` tag to import Docsify will not notice a difference. Anyone
else who is importing Docsify into a specilized build setup using
`import` statements has a chance of being broken, so we've marked this
as BREAKING.
2023-06-29 19:02:08 -07:00
John Hildenbiddle
c49c39a4a2
refactor: Update test environments and lint configuration (#1736)
* Update test environments and lint configuration

Update Jest (unit + integration) and Playwright (e2e) test environments. Includes stability improvements for e2e tests using newer, more stable methods per the Playwright docs.

- Update Jest 26 => 27
- Update Jest-related libs (babel parser)
- Update Playwright 1.8 => Playwright Test 1.18
- Update GitHub CI (action versions, job parallelization, and matrices)
- Update ESLint 5 => 8
- Update ESLint-related libs (parser, prettier, Jest, Playwright)
- Fix test failures on M1-based Macs
- Fix e2e stability issues by replacing PW $ method calls
- Fix ESLint errors
- Fix incorrect CI flag on Jest runs (-ci => --ci)
- Refactor e2e test runner from Jest to Playwright Test
- Refactor e2e test files for Playwright Test
- Refactor fix-lint script name to lint:fix for consistency
- Refactor npm scripts order for readability
- Remove unnecessary configs and libs
- Remove example image snapshots
2022-01-30 21:40:21 -06:00
Joe Pea
5e0f68caf0 convert Docsify and mixins to ES classes 2021-12-07 18:23:06 -08:00
Matej Simek
dcf5a644eb
fix: sidebar active class and expand don't work as expect when use "space" in markdown filename (#1454)
* fix: decode href in sidebar (#1032)

* Create sidebar.test.js

Co-authored-by: 沈唁 <52o@qq52o.cn>
2020-12-20 12:49:36 +08:00
沈唁
ee550d0c51
fix: search on homepage test (#1398)
* fix: ci build

* reset

* test

* update

* fix test

* fix

* Add multi-page search test

* rename

Co-authored-by: John Hildenbiddle <jhildenbiddle@users.noreply.github.com>
2020-10-15 17:41:21 +08:00
沈唁
25bc9b7eb7
fix: Can't search homepage content (#1391)
* fix: Can't search homepage content

* fix: when pathNamespaces does not exist

* add test

* update test to fix windows ci
2020-10-14 12:39:56 +08:00