chore: Build and publish v4 lib/ and themes/ folders for backwards compatibility while users transition to v5. (#2667)

* Build and publish v4 lib/ and themes/ folders for backwards compatibility while users transition to v5.

- add a script to build the legacy v4 lib/ and themes/ folders
- append deprecation console warnings to the v4 JS files during the v4 build
- add a script to clean v4 build outputs
- hook the v4 build/clean scripts into the release.sh script
- test the v4 build and clean in CI

* fix: update repository field format in package.json

---------

Co-authored-by: Luffy <52o@qq52o.cn>
This commit is contained in:
Joe Pea
2026-02-04 23:38:39 -08:00
committed by GitHub
parent 8553ef83af
commit 7e29ca092f
5 changed files with 60 additions and 9 deletions
+19
View File
@@ -72,6 +72,25 @@ jobs:
run: npx playwright install --with-deps
- name: E2E Tests (Playwright)
run: npm run test:e2e
# In the interest of not having to modify GitHub settings to update required
# builds for passing, I stuck this test here.
- name: Test v4 build
run: |
git fetch --tags
npm run build:v4
# ensure v4 build files exist:
test -f lib/docsify.js
test -f themes/pure.css
# ensure no git changes after building v4:
git diff --exit-code
npm run clean:v4
# ensure v4 build files are removed:
test ! -f lib/docsify.js
test ! -f themes/pure.css
# ensure no git changes after cleaning v4:
git diff --exit-code
- name: Store artifacts
uses: actions/upload-artifact@v6
if: failure()