301 Commits

Author SHA1 Message Date
Joe Pea
60ccf09086 initial SSR working independently without a seconds server
Many things work. What doesn't work (needs work):

- Any dynamic config options (f.e. any that use functions) need to be specified in the HTML by augmenting the injected config object. This includes plugins, Vue components, and similar.
- Plugins and Vue don't work on initial SSR render. Switch pages dynamically and they work during the dynamic markdown handling.
- Cover page causes an error
- Search plugin causes an error
2021-05-17 23:40:00 -07:00
Joe Pea
1bbc84642f as we're not using package-lock files, tell Lerna not to use 'npm ci' 2021-05-04 02:23:52 -07:00
Joe Pea
136e666e78 Merge branch 'develop' into fix-validating-remote-content-2
* develop: (104 commits)
  chore: bump ssri from 6.0.1 to 6.0.2 (#1563)
  chore: Update Edit Document using develop branch (#1541)
  fix: Add escapeHtml for search (#1551)
  docs: link with plugin Pagination (#1554)
  fix: Upgrade dompurify from 2.2.6 to 2.2.7 (#1553)
  fix: upgrade dompurify from 2.2.6 to 2.2.7 (#1552)
  chore: bump y18n from 4.0.0 to 4.0.1 (#1548)
  chore: Fix search for missing pathNamespaces (#1547)
  fix: Upgrade docsify from 4.12.0 to 4.12.1 (#1544)
  docs:Update deploy, change Zeit to Vercel (#1540)
  fix: Cannot read property 'classList' of null (#1527)
  chore: fix microsoft/playwright-github-action error (#1534)
  Update PULL_REQUEST_TEMPLATE.md
  chore: Update CHANGELOG and Update test snapshots
  chore: add changelog 4.12.1
  [build] 4.12.1
  feat: Support search when there is no title (#1519)
  test(unit): add test cases on isExternal. (#1515)
  docs: Update Vercel logo link (#1520)
  fix: Upgrade docsify from 4.11.6 to 4.12.0 (#1518)
  ...
2021-05-04 01:59:38 -07:00
Joe Pea
27b2e32468 WIP: update use native Node ESM for server code, update config files to specifically use .cjs (those tools don't support Node ESM files yet), use a single eslintrc file, all test code uses ESM import/export syntax instead of require (WIP) 2021-05-04 00:08:36 -07:00
Snyk bot
93c48f3d61
fix: Upgrade dompurify from 2.2.6 to 2.2.7 (#1553)
* fix: upgrade dompurify from 2.2.6 to 2.2.7

Snyk has created this PR to upgrade dompurify from 2.2.6 to 2.2.7.

See this package in npm:
https://www.npmjs.com/package/dompurify

See this project in Snyk:
https://app.snyk.io/org/anikethsaha/project/836f877b-b98e-47ed-89fc-554e9b2e146d?utm_source=github&utm_medium=upgrade-pr

* fix: missing vue

Co-authored-by: sy-records <52o@qq52o.cn>
2021-04-10 13:32:30 +08:00
sy-records
cea7765901 chore: add changelog 4.12.1 2021-03-07 11:00:43 +08:00
sy-records
a2132c89ea chore: add changelog 4.12.0 2021-02-08 09:21:43 +08:00
沈唁
716a7fa777
fix: upgrade marked from 1.2.4 to 1.2.9 (#1486) 2021-02-05 10:41:08 +08:00
John Hildenbiddle
743bb64d0a chore: update playwright to 1.8.0
Required for testing on ARM-based Macs.
2021-02-04 11:11:11 -06:00
沈唁
eee9507d43
fix: upgrade dompurify from 2.2.2 to 2.2.6 (#1483) 2021-02-04 08:30:53 +08:00
Anix
5f29cde84c
fix: upgrade prismjs from 1.22.0 to 1.23.0 (#1481)
* fix: upgrade prismjs from 1.22.0 to 1.23.0

Snyk has created this PR to upgrade prismjs from 1.22.0 to 1.23.0.

See this package in npm:
https://www.npmjs.com/package/prismjs

See this project in Snyk:
https://app.snyk.io/org/anikethsaha/project/836f877b-b98e-47ed-89fc-554e9b2e146d?utm_source=github&utm_medium=upgrade-pr

* fix: vue

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: sy-records <52o@qq52o.cn>
2021-01-28 17:33:22 +08:00
dependabot[bot]
e04e268a54
chore(deps-dev): bump axios from 0.20.0 to 0.21.1 (#1471)
Bumps [axios](https://github.com/axios/axios) from 0.20.0 to 0.21.1.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v0.21.1/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.20.0...v0.21.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-06 18:22:42 +08:00
Snyk bot
da6e8d90c8
[Snyk] Upgrade marked from 1.2.3 to 1.2.4 (#1441)
* fix: upgrade marked from 1.2.3 to 1.2.4

Snyk has created this PR to upgrade marked from 1.2.3 to 1.2.4.

See this package in npm:
https://www.npmjs.com/package/marked

See this project in Snyk:
https://app.snyk.io/org/anikethsaha/project/836f877b-b98e-47ed-89fc-554e9b2e146d?utm_source=github&utm_medium=upgrade-pr

* Update vue dependences

Co-authored-by: sy-records <52o@qq52o.cn>
2020-12-11 09:13:27 +08:00
Snyk bot
ae4abec47f
[Snyk] Upgrade marked from 1.2.2 to 1.2.3 (#1430)
* fix: upgrade marked from 1.2.2 to 1.2.3

Snyk has created this PR to upgrade marked from 1.2.2 to 1.2.3.

See this package in npm:
https://www.npmjs.com/package/marked

See this project in Snyk:
https://app.snyk.io/org/anikethsaha/project/836f877b-b98e-47ed-89fc-554e9b2e146d?utm_source=github&utm_medium=upgrade-pr

* Fix vue

Co-authored-by: sy-records <52o@qq52o.cn>
2020-11-30 17:33:28 +08:00
沈唁
7c3bf98df8
fix: duplicate search content when /README or / exists in the sidebar (#1403)
* fix: duplicate search content when `/readme` or `/` exists in the sidebar

* Update

* add test

* Reset local storage before each e2e test

* Reset Playwright context instead of page

* Update playwright dependencies

Co-authored-by: John Hildenbiddle <john@hildenbiddle.com>
2020-11-28 16:35:43 +08:00
John Hildenbiddle
7878c60988
Merge branch 'develop' into feat/vue-options 2020-11-19 17:16:40 -06:00
Snyk bot
0806f48531
fix: upgrade prismjs from 1.21.0 to 1.22.0 (#1415)
Snyk has created this PR to upgrade prismjs from 1.21.0 to 1.22.0.

See this package in npm:
https://www.npmjs.com/package/prismjs

See this project in Snyk:
https://app.snyk.io/org/anikethsaha/project/836f877b-b98e-47ed-89fc-554e9b2e146d?utm_source=github&utm_medium=upgrade-pr

Co-authored-by: 沈唁 <52o@qq52o.cn>
2020-11-18 08:03:53 +08:00
沈唁
43a73bb036
Merge branch 'develop' into feat/vue-options 2020-11-16 14:23:49 +08:00
Snyk bot
69b6907c86
fix: package.json & package-lock.json to reduce vulnerabilities (#1419)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-DOMPURIFY-1035544

Co-authored-by: 沈唁 <52o@qq52o.cn>
2020-11-16 14:18:03 +08:00
Snyk bot
e75a19ca05
[Snyk] Upgrade marked from 1.2.0 to 1.2.2 (#1425)
* fix: upgrade marked from 1.2.0 to 1.2.2

Snyk has created this PR to upgrade marked from 1.2.0 to 1.2.2.

See this package in npm:
https://www.npmjs.com/package/marked

See this project in Snyk:
https://app.snyk.io/org/anikethsaha/project/836f877b-b98e-47ed-89fc-554e9b2e146d?utm_source=github&utm_medium=upgrade-pr

* Update vue

Co-authored-by: sy-records <52o@qq52o.cn>
2020-11-14 17:06:59 +08:00
Joe Pea
c354bceb92 WIP adding tests for SSR 2020-11-01 23:45:36 -08:00
John Hildenbiddle
cafdd62dae Remove —runInBand flag from test script 2020-10-26 02:23:34 -05:00
John Hildenbiddle
b135f8417d Add Vue 3 compatibility
- Update docs
- Update tests
- Add Vue 2 to docs site
- Add Vue 2 & 3 dependencies for tests
2020-10-07 13:13:03 -05:00
John Hildenbiddle
7f0c42eda5
Jest + Playwright Testing (#1276)
* Initial Jest+Playwright setup

* Fix eslint warnings

* Add placeholder for common options

* Fix load order of scriptURLs

* Add docsifyURL and waitForSelector options

* Add executeScript scenarios

* Enable firefox and webkit tests by default

* Prevent prettier from reformatting browsers list

* Update options and add JSDoc comments

* Initial commit

* Complete initial example tests

* Minor tweaks

* Change suite name

* Rename file

* Add npm script to run jest+playwright example test

* Clean up server properties

* Isolate e2e, integration, and unit test environments

- Setup projects for e2e, integration, and unit tests in Jest configuration
- Setup /tests/e2e/ tests for Jest+PlayWright
- Setup /tests/integration/ tests for Jest
- Setup /tests/unit/ tests for Jest
- Setup eslint for Jest and Jest+Playwright environments
- Move e2e configuration files into separate folder
- Update e2e example tests
- Update unit example tests
- Update HTML fixtures

* Update docsifyInit helper

- Add `debug` option
- Append `Markdown` suffix to markdown-related options
- Reorder options alphabetically

* Add jestPlaywright.debug() to e2e examples

* Removed need to pass page as arg to docsifyInit()

* Add VSCode debug configurations

* Change test server port from 8080 to 3001

* Clean up test names and expect() order

* Update npm scripts to ignore example tests

* Add CLI commands and resources section

* Add Jest unit test snapshot example

* Added Jest unit and e2e tests to Github workflows

* Add npm script to run Jest examples

Added for new devs who are exploring the examples, as the need for passing --testPathIgnorePatterns is not obvious. This flag is required because the example tests are excluded by default.

* Remove node 10.x and add 14.x from tests

Required for jest+playwright testitng

* Temporarily disable testPathIgnorePatterns for ci

* Temporarily remove node 14 from matrix

Cypress fails on node 14.x

* Alternate workflow setup for new test env

* Update workflow platforms and node versions

Also cleaning up naming

* Restoring original workflow names

* Remove Cypress tests

* Remove/Reset GitHub actions

* Restore/reset workflows

* Bump actions/checkout@v1 to v2

* Use playright GH action

* Update playwright GH action configuration

* Remove unnecessary steps and update checkout version

* Add install step

* Add --ignore-scripts flag

Linting does not require running scripts automatically executred after install.

* Swicth from ci to i for install

* Add new Build & Test workflow

* Add OS tests

* Wait for network idle for more reliable ready state

* Configure image snapshot testing and add example

* Remove example fixture file

* Adjust image snapshot threshold for local & CI tests

* Upload diff-output artifact

* Add failure() check to upload-artifact

* Bump image snapshot threshold for local & CI tests

* Set diffDirection

* Fix XHR caching in playwright tests

* Update image snapshot example and theshold

* Bump image snapshot threshold for local & CI tests

* Remove old workflows

* Bump image snapshot threshold for local & CI tests

* Bump image snapshot failureThreshold for local & CI tests

* Set failureThresholdType to percent

* Change image snapshot comparisonMethod to ssim

* Remove pixelMatch options (incompatible with ssim)

* Bump image snapshot failureThreshold

* Bump image snapshot failureThreshold

* Disable fast-fail to allow all checks to complete

* Rename workflow

* Disable fast-fail to allow all checks to complete

* Store pixel and ssim comparison configs

* Add link to image snapshot test

* Fix CI errors on Windows due to image size mismatch

* Attempt to fix macos e2e exit code 134 issue

* Update test.yml

* Update test.yml

* Update test.yml

* Fix --ci flag

* Set Jets to use --runInBand for macOS e2e

* Remove unnecessary macOS check

* Set image snapshot to runInProcess (macOS CI fix)

* Update test.yml

* Temporary failureThreshold change for debugging

* Upload os+node-specific diff artifacts

* Remove node version from diff artifact

* Revert "Remove node version from diff artifact"

This reverts commit 9cfcc4342bb22f18da30363a4c52758f13ba0cc9.

* Revert "Revert "Remove node version from diff artifact""

This reverts commit ad6c1891e48c70c9973a5c0d7b876b2d4621f3b9.

* Restoring failureThreshold after debugging

* Remove runInProcess option

* Revert "Remove runInProcess option"

This reverts commit 667ed6c870fc56f0349fc5eccc2cdeead3eff4ea.

* Add node-specific artifact uploads

* Set ssim mode to fast and restore runInProcess

* Set failureThreshold to 0.01

* Updating to playwright@next for webkit fix

* Restore optimal ssim configuration

* Testing pixel vs. ssim image comparison

* Move shared test setup to unit/int/e2e setups

* Refactor test server setup

* Replace live-server with browser-sync

* Update script for running local docs site

- Only init GA plugin on public site
- Only init Gitter plugin on public site
- Only init Matomo plugin on public site

NOTE: Large diff is a result of initial Prettier formatting. Actual change limited to last <script> block on page.

* Allow launching test server preview with --start

* Add integration tests and refactor unit + e2e

* Unify docsifyInit() and cleanup

- Create unified docsifyInit() for jest and playwright
- Move shared helpers to /tests/helpers
- Update tests
- Update globals

* Fixed webkit routes by specifying ContentType

* Update snapshot

* Update dependencies

* Update tests to use unified docsifyInit()

* Remove Cypress (old e2e test environment)

* Update tests to run (unit/integration/e2e)

- Add new integration tests (Jest)
- Remove old unit tests (mocha+jsdom)
- Remove old e2e tests (Cypress)

* Remove Cypress-related dependency

* Remove mocha+chai+jsdom (old unit/int test env)

* Rename testing directories and scripts

- Rename /tests/ directory to /test/
- Rename script/task names by removing “jest” identifier
- Remove “test:jest-examples” script

* - Configure test server for availability with all tests (previously e2e only)
- Create identical docsifyInit() tests using Jest (integration) and Playwright (e2e)
- Update docsifyInit() to convert relative URLs to absolute URLs to work in both JSDOM and Playwright
- Update docsifyInit() to append style- and js-related tags using createElement instead of insertAdjacentHTML
- Update paths in test files to use unified docsifyInit()
- Added option to docsifyInit() to enable/disable formatted HTML output to console
- Removed vue.css as default docsify theme from docsifyInit()
- Removed outdated files

* Reorganize test files

* Fix basePath option

* Replace do-mock-ajax with xhr-mock

- Allows mocking all XMLHttpRequests instead of just those initiated via /src/core/fetch/ajax.js
- Allows JSDOM tests to use /lib/docsify.js instead of /src/core/index.js (same as Playwright tests)
- Allows JSDOM tests to use /docs site as test content

* Added new waitFor helpers

* Clean up globals

- Import globals from various files instead of manually adding them to ensure they are availability in Jest and eslint configurations
- Add middleware to server configuration for serving virtual “_blank.html” file
- Add BLANK_URL
- Rename TEST_URL to TEST_HOST
- Removed ./test/fixtures/ directory (blank page now served via server.js middleware)
- Added page.goto(BLANK_URL) call to global Playwright beforeEach() setup

* Add try/catch for waitForFunction callback

* Move playwright config into jest.config.js

* Add runInBand option to tests for reliability

* Remove unnecessary XHR Mock teardown

* Add —runInBand to test script

* Merge develop

* Cleanup

- Relocate carbon plugin script with other scripts
- Update zh-cn docs URL to align with other translatins (GitHub, not jsdelivr)
- Add major version locks to URLs

* Removed fixed host value from docs

* Updated test after merge (docsify version change)

* Added startPath for manual instance

* Remove Node 10 from CI tests

* Remove Node 10 from CI lint tests
2020-10-05 14:10:30 -05:00
sy-records
d3482aca46 chore: add changelog 4.11.6 2020-08-22 19:37:04 +08:00
sy-records
e474ea86d4 chore: add changelog 4.11.5 2020-08-21 19:15:39 +08:00
沈唁
5037f0b4e6
chore: Remove the src directory from packages.json's files (#1344) 2020-08-20 11:36:45 +05:30
Snyk bot
59d090fe90
fix: upgrade tinydate from 1.2.0 to 1.3.0 (#1341)
Snyk has created this PR to upgrade tinydate from 1.2.0 to 1.3.0.

See this package in npm:
https://www.npmjs.com/package/tinydate

See this project in Snyk:
https://app.snyk.io/org/anikethsaha/project/836f877b-b98e-47ed-89fc-554e9b2e146d?utm_source=github&utm_medium=upgrade-pr
2020-08-18 22:04:44 +08:00
snyk-bot
3beaa6666b fix: upgrade medium-zoom from 1.0.5 to 1.0.6
Snyk has created this PR to upgrade medium-zoom from 1.0.5 to 1.0.6.

See this package in npm:
https://www.npmjs.com/package/medium-zoom

See this project in Snyk:
https://app.snyk.io/org/anikethsaha/project/836f877b-b98e-47ed-89fc-554e9b2e146d?utm_source=github&utm_medium=upgrade-pr
2020-08-17 08:39:14 +00:00
Snyk bot
086c2859ad
[Snyk] Security upgrade marked from 0.7.0 to 1.1.1 (#1313)
* fix: package.json & package-lock.json to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-MARKED-584281

* fix: fix CompileError

* fix: embed files error

Co-authored-by: Koy <369491420@qq.com>
Co-authored-by: 沈唁 <52o@qq52o.cn>
2020-08-14 07:53:23 +08:00
anikethsaha
13f91a4fcb chore: add changelog 4.11.4 2020-06-18 23:48:00 +05:30
Anix
714ef29afe
feat: added html sanitizer for remote rendering (#1128)
Co-authored-by: Joe Pea <joe@trusktr.io>
2020-06-17 23:55:59 +05:30
Joe Pea
8f3f263cee Merge branch 'develop' into allow-config-function
* develop:
  chore: update auto format config
2020-06-12 21:37:46 -07:00
Joe Pea
63f1b88a41 Revert "ensure that the test script runs a prod build"
This reverts commit 41dc2c7d106e655e86bfd2f96a81167348d389ed because the
GitHub Action (unit.yml) already run `npm run build`.
2020-06-07 13:24:47 -07:00
Joe Pea
41dc2c7d10 ensure that the test script runs a prod build 2020-06-07 11:59:52 -07:00
Joe Pea
7e002bf939 feat: update src/core/index.js to export all global APIs, deprecate old globals in favor of a single global DOCSIFY, and add tests for this 2020-05-23 14:10:00 -07:00
jamesgeorge007
96d5b19a96 chore: update auto format config 2020-04-09 10:35:59 +05:30
anikethsaha
ab597ca8e0 v4.11.3 2020-03-24 20:08:55 +05:30
Anix
b62a0c8f3e chore: add changelog 4.11.2 2020-03-09 21:15:00 +05:30
Anix
9afa66607d chore: removed circular dep and css.escape 2020-03-09 20:33:07 +05:30
Anix
1811842979 chore: add changelog 4.11.1 2020-03-09 18:11:20 +05:30
Anix
86df3bb32d chore: add changelog 4.11.0 2020-03-09 17:12:15 +05:30
snyk-bot
9981c4361a fix: upgrade prismjs from 1.17.1 to 1.19.0
Snyk has created this PR to upgrade prismjs from 1.17.1 to 1.19.0.

See this package in NPM:
https://www.npmjs.com/package/prismjs

See this project in Snyk:
https://app.snyk.io/org/anikethsaha/project/836f877b-b98e-47ed-89fc-554e9b2e146d?utm_source=github&utm_medium=upgrade-pr
2020-03-09 14:30:21 +05:30
snyk-bot
39ebd73021 fix: upgrade medium-zoom from 1.0.4 to 1.0.5
Snyk has created this PR to upgrade medium-zoom from 1.0.4 to 1.0.5.

See this package in NPM:
https://www.npmjs.com/package/medium-zoom

See this project in Snyk:
https://app.snyk.io/org/anikethsaha/project/836f877b-b98e-47ed-89fc-554e9b2e146d?utm_source=github&utm_medium=upgrade-pr
2020-03-09 14:29:10 +05:30
Anix
75c72e917b
chore: added new linter config (#1028)
* chore: added new linter config

* chore: linting fixes

* chore: refactore in linting config and minor linting fixes
2020-02-20 14:01:04 +05:30
Anix
a111df9980
chore: documented __colon__ tip (#1025) 2020-02-14 20:41:53 +05:30
Anix
5f7464af48
chore: migrate CI to github, refactore CI and npm scripts, linting fixes (#1023) 2020-02-14 15:22:53 +05:30
Atsushi Tanaka
90a35ab952
Fix #895 (#896)
* Don't replace leading digit

* Install css.escape

* Escape leading digit of the anchor id
2020-02-05 22:23:05 +05:30
Anix
0e54ea1177
[Test] : e2e tests using cypress (#999)
* chore: added cypresss

* chore: added sidebar tests

* chore: script update

* chore: removed cypress examples

* chore: added lib to eslintignore

* chore: script fixes

* chore: updated the snapshot
2020-01-30 17:44:13 +05:30
Joe Pea
e566e9c6e7
Merge branch 'develop' into prepare-script 2020-01-27 23:18:22 -08:00