Commit Graph

57 Commits

Author SHA1 Message Date
Cell bfee4041d6 refactor(encrypt): rename post-encrypt to encrypt
- Rename package from @hugo-fixit/post-encrypt to @hugo-fixit/encrypt
- Rename bin from post-encrypt to fixit-encrypt
- Update all i18n translations (16 files) to use npx @hugo-fixit/encrypt
- Update CI workflow, publish script, code comments, and docs
- Rewrite README with performance benchmarks and other implementations
2026-07-19 13:15:57 +08:00
Cell c6b5c825ed feat(post-encrypt): add GitHub Actions workflow for publishing and versioning 2026-07-06 00:03:06 +08:00
dependabot[bot] 575499d7db chore(deps): bump actions/checkout from 6 to 7 (#797) 2026-07-01 09:30:41 +08:00
dependabot[bot] 3c2fb3ec54 chore(deps): bump actions/setup-node from 4 to 6 (#784) 2026-07-01 09:29:39 +08:00
Cell[bot] 43dd1c72d9 chore(deps): bump @waline/client from 3.15.0 to 3.15.2 (#782) 2026-06-11 17:02:51 +08:00
Cell c7ed62c51e chore(workflows): add token for bot authentication in gen-lexers and librarybot workflows 2026-06-11 11:13:42 +08:00
Cell 03ca90b49f feat(assets): add helpers package for chroma lexer map generation (#781)
- Add `packages/helpers` with CLI dispatcher pattern for code generation
- Add `chroma-lexers` helper that fetches lexer definitions from alecthomas/chroma
- Rename `$code-type-map` to `$chroma-lexers`, `_code-type.scss` to `_chroma-lexers.scss`
- Fix `fi-var` and `set-fi-var` to preserve quotes for string fallbacks
- Add `capitalize` utility to `packages/shared`
- Replace `console.*` with `consola` in packages
- Add `pnpm gen:lexers` script and CI workflow for auto-regeneration
- Update CLAUDE.md and CONTRIBUTING.md
2026-06-03 16:41:07 +08:00
Cell 14a965f9c1 refactor(assets): migrate JavaScript to TypeScript service architecture (#766)
* refactor: add TypeScript support and refactor utility functions

* docs: add CLAUDE.md for Claude Code guidance

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* refactor(assets): replace factory-function pattern with service classes and DI container

Introduce typed service container, event bus, and service interfaces to replace
the shared FixItContext factory-function pattern. Each module is now a standalone
class implementing a typed interface, with explicit constructor-injected
dependencies. The window.fixit backward-compatibility facade is built via a
publicAPI() helper that extracts class methods.

Also removes unnecessary setTimeout/afterPaint deferred execution wrappers
from init sequences, and improves module header comments.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* refactor: replace private properties with class fields in modules

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* refactor(assets): rewrite link page script in TypeScript

Rename pages/link.js to link.ts with proper type annotations and update
the Hugo template reference accordingly.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* docs: rewrite CLAUDE.md and copilot-instructions.md in English

Update both files to reflect the new service-class architecture with
DI container, typed event bus, and ES6 # private fields.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix: update event handling to use CustomEvent for better type safety

* refactor: enhance theme switching by adding isChanged flag to event details

* refactor(assets): refactor Mermaid module structure and event wiring

* refactor(assets): align lib integrations with TypedEventBus and add module overviews

* chore(assets): remove vite-specific import ignore comments

* refactor(assets): remove deprecated forEach utility and use native forEach

Replace custom forEach wrapper with native .forEach() on NodeList, HTMLCollection (via querySelectorAll), and arrays. The utility was already marked @deprecated and all 30+ call sites use synchronous handlers, making the wrapper unnecessary. Also replace getElementsByClassName/getElementsByTagName with querySelectorAll for consistency.

- Delete utils/array.ts (no longer needed)
- Remove forEach export from utils/index.ts
- Refactor 11 module files to use native .forEach()
- Switch getElementsByClassName to querySelectorAll in theme.ts and charts.ts

* refactor(assets): split ChartsModule into independent lib files

Move ECharts, Mapbox GL, and TypeIt integrations from the ServiceContainer-managed ChartsModule into three standalone lib files (echarts.ts, mapbox.ts, typeit.ts). Each lib:
- Instantiates its own TypedEventBus
- Reads config from window.config.*
- Self-initializes on DOMContentLoaded
- Handles decrypt/re-init events independently
- Uses implicit idempotency via DOM element queries

Key improvements:
- Reduces ServiceContainer complexity
- Makes chart libs independently loadable
- Fixes partial decryption handling in echarts (only re-inits decrypted portion)
- Maintains consistency with aplayer/file-tree lib pattern

* refactor(assets): extract third-party libraries to standalone lib files

Extract twemoji, pangu, cookieconsent, watermark, lightgallery, and json-viewer
from modules into separate lib files for better separation of concerns. Each lib
is loaded conditionally via assets.html and handles its own initialization and
event lifecycle independently.

Additionally, unify fixit event handling by replacing document.addEventListener
calls with TypedEventBus.on() in EncryptionModule and MiscModule for consistent
event architecture.

Remove unused MiscService dependency from ContentModule.

* refactor(assets): unify js.Build pipeline and defaults

- extract shared helper partial function/js-build.html for js.Build + minify

- make plugin script renderer and Mermaid use the same js.Build logic

- default Build.minify to hugo.IsProduction when unset

- default Build.sourceMap to cond hugo.IsDevelopment "linked" "none"

- remove duplicated sourceMap branching in layout templates

- update js targetPath naming to .js (no explicit .min.js suffix)

* refactor(assets): extract comment systems to independent lib files

Extract comment system initialization logic from CommentModule into 7 independent
lib files (artalk, gitalk, valine, waline, utterances, twikoo, giscus). Each lib:
- Conditionally loads based on window.config.comment configuration
- Handles backend-specific initialization via DOMContentLoaded
- Manages its own theme synchronization and event listeners
- Is loaded conditionally in assets.html only when enabled

Simplify CommentModule to handle only:
- Comment section UI display and visibility toggle
- Shared lightGallery initialization utility (used by Artalk and Twikoo)
- Comment expiration handling

This reduces module complexity and enables per-backend lazy loading.

* refactor(assets): unify js.Build pipeline and consolidate PWA config

Enhance js-build.html to accept Build as bool/dict, auto-derive
targetPath from resource name (.ts → .js), and skip js.Build when
Build is false/omit. Simplify assets.html by removing explicit
targetPath dicts for all .ts lib builds. Consolidate enablePWA and
serviceWorkerURL into a PWA config object.

* refactor(assets): decouple toc from content module and add JSDoc headers

- Remove TocService dependency from ContentModule, toc now self-manages
- Rename initContent() → setup(), init() → setup() for toc
- Make initFootnotes private (#initFootnotes)
- Add multi-line JSDoc headers with Responsibilities to all modules,
  main.ts, pages/link.ts, and head/color-scheme.ts

* refactor(assets): split types.ts into types/ directory module

* refactor(assets): simplify JS module architecture and expose typed window.fixit API

- Remove DI container (core/container.ts), use direct constructor calls
- Export shared eventBus singleton from core/event-bus.ts, remove 16 redundant instances
- Merge thin modules: SvgModule/CommentModule/LinkGuardModule into ContentModule/MiscModule
- Trim service interfaces to externally-used methods only
- Replace publicAPI() reflection with minimal typed window.fixit facade
- Expose public APIs: setThemeMode, eventBus, initContent, mask overlay, scroll state
- Extract setThemeMode from initSwitchTheme closure as public method
- Rename fixit:reset to fixit:re-encrypt, remove dead events
- Replace custom.js.example with custom.ts.example
- Update CLAUDE.md and copilot-instructions.md

* style(i18n): use semantic names for comment dividers instead of file paths

Replace file-path-based comment dividers (e.g. partials/base/header.html)
with semantic names (e.g. Header) across all 16 i18n files for consistency.

* chore(workflow): update cron schedule for library updates

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 12:43:42 +08:00
dependabot[bot] 26b0556b9e chore(deps): bump pnpm/action-setup from 4 to 6 (#740)
Bumps [pnpm/action-setup](https://github.com/pnpm/action-setup) from 4 to 6.
- [Release notes](https://github.com/pnpm/action-setup/releases)
- [Commits](https://github.com/pnpm/action-setup/compare/v4...v6)

---
updated-dependencies:
- dependency-name: pnpm/action-setup
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-11 02:43:32 +08:00
dependabot[bot] e90a249375 chore(deps): bump softprops/action-gh-release from 2 to 3 (#739)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2 to 3.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2...v3)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: '3'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-11 02:42:59 +08:00
Cell d45f6b1550 chore: add librarybot workflow for automated npm library updates (#726) 2026-04-08 17:52:52 +08:00
Cell 6986044dbc chore: update release workflow to install fixit-cli and handle config files separately 2026-01-06 15:35:32 +08:00
dependabot[bot] c1071077ae chore(deps): bump peter-evans/create-pull-request from 7 to 8 (#673) 2026-01-01 10:23:12 +08:00
Cell 0ae4f63595 chore(workflow): add step to split theme configuration and package it for release 2025-12-30 12:25:54 +08:00
dependabot[bot] d1c016269a chore(deps): bump actions/checkout from 5 to 6 (#662) 2025-12-01 09:29:56 +08:00
dependabot[bot] 5fc14ff16f chore(deps): bump actions/setup-node from 5 to 6 (#645)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 5 to 6.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-14 15:08:07 +08:00
dependabot[bot] 70c3124e98 chore(deps): bump github/codeql-action from 3 to 4 (#644)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3 to 4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-14 15:07:22 +08:00
Cell 944295052b chore: update release workflow and changelog generation command 2025-09-13 01:53:47 +08:00
dependabot[bot] 1c1ec7e2ed chore(deps): bump actions/checkout from 4 to 5 (#630)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-31 15:11:32 +08:00
Cell d8624386c7 chore: structure refactor, linting, and monorepo setup (#629)
* chore: use monorepo to manage demo, test and other applications and internal packages

* style: add eslint support and lint code

* chore: refactor project structure and add versioning package replace of fixit-releaser

* chore(deps-dev): replace husky with simple-git-hooks

* Potential fix for code scanning alert no. 13: Shell command built from environment values

* chore(deps-dev): update the final fixit-releaser version

* docs: update contributing guidelines for new structure and commands

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-08-31 15:07:00 +08:00
Cell 0cc7882d22 ci: standardize commit message format for component list updates 2025-08-27 10:54:03 +08:00
Cell 93acf8ea79 🚀 Chore(ci/cd): improve the joint construction and deployment of Demo and Test content
- Demo: https://demo.fixit.lruihao.cn/
- Test: https://demo.fixit.lruihao.cn/test/
2025-08-19 17:40:25 +08:00
Cell 57d920244b 🔧 Chore: update CodeQL configuration, add Hugo test build workflow (#625) 2025-08-18 12:51:47 +08:00
Cell 92d0a857c1 🔧 Chore(i): add conditional check for repository in component list generation workflow 2025-07-03 14:33:37 +08:00
Cell 5b0a27125c 🔧 Feat(workflow): replace auto commit with pull request in actions 2025-05-21 10:46:44 +08:00
Cell 8b4021295f 💥 Feat: default branch has been renamed to main 2025-01-19 04:34:24 +08:00
Cell d6bd1ce697 🔧 Chore: use hugo-fixit/action-component-list to generate content 2025-01-18 22:07:56 +08:00
Cell 409d6c8894 🔧 Chore(CI): update release workflow 2025-01-05 18:19:55 +08:00
Cell 0e7dc99319 🔧 Chore: use environment variable HUGO_VERSION to control Hugo version 2024-12-17 18:11:37 +08:00
Cell 0af0b136ba 🔧 Chore: update build command 2024-11-19 09:55:44 +08:00
Cell 069355cc70 📝 Docs: repalce of contributos workflow with GitHub contributors link 2024-05-23 12:18:48 +08:00
dependabot[bot] c881715c2a ⬆️ Chore(deps): bump peaceiris/actions-hugo from 2 to 3 (#441)
Bumps [peaceiris/actions-hugo](https://github.com/peaceiris/actions-hugo) from 2 to 3.
- [Release notes](https://github.com/peaceiris/actions-hugo/releases)
- [Changelog](https://github.com/peaceiris/actions-hugo/blob/main/CHANGELOG.md)
- [Commits](https://github.com/peaceiris/actions-hugo/compare/v2...v3)

---
updated-dependencies:
- dependency-name: peaceiris/actions-hugo
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-06 16:43:27 +08:00
Cell 5f5d019f09 🔧 Chore: update release workflow 2024-04-25 13:12:02 +08:00
Cell 429698a096 🔧 Chore: add changelog template and workflow 2024-04-22 17:38:56 +08:00
Cell 594c89eb1e 🔧 Chore: remove atomic-algolia (#404) 2024-01-11 11:13:35 +08:00
dependabot[bot] 8789f6eaff chore(deps): bump github/codeql-action from 2 to 3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-01 14:43:25 +08:00
dependabot[bot] fa952dfac7 chore(deps): bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-03 14:57:43 +08:00
Cell 40cb2e412a 🔧 Chore: update repo checkout config in GitHub worlkflows 2023-03-19 16:20:18 +08:00
dependabot[bot] 7fa59dba79 chore(deps): bump actions/checkout from 2 to 3 (#273)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-29 12:26:15 +08:00
dependabot[bot] d61f060f9a chore(deps): bump wow-actions/auto-assign from 1 to 3 (#272)
Bumps [wow-actions/auto-assign](https://github.com/wow-actions/auto-assign) from 1 to 3.
- [Release notes](https://github.com/wow-actions/auto-assign/releases)
- [Changelog](https://github.com/wow-actions/auto-assign/blob/master/CHANGELOG.md)
- [Commits](https://github.com/wow-actions/auto-assign/compare/v1...v3)

---
updated-dependencies:
- dependency-name: wow-actions/auto-assign
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-29 12:25:54 +08:00
Cell 54650f62db 🔧 Chore: update contributors.yml 2022-10-21 11:30:23 +08:00
Cell 12cd2847f0 🔧 Chore: to fix HttpError: Resource not accessible by integration 2022-10-01 10:03:48 +08:00
Cell ea1e62419c 🔧 Chore: fix file name error 2022-09-08 15:27:38 +08:00
Cell 5102f8e526 🔧 Chore: add workflow auo-asign 2022-09-08 15:03:48 +08:00
Cell 1292d517b5 Revert "🔧 Chore: use on.push.paths-ignore can prevent Code Scanning annotating new alerts in your pull requests"
This reverts commit 6c585b34b1.
2022-09-08 14:16:03 +08:00
Cell 6c585b34b1 🔧 Chore: use on.push.paths-ignore can prevent Code Scanning annotating new alerts in your pull requests 2022-09-08 14:04:17 +08:00
Cell 1da9407ee3 🔧 Chore: fix CodeQL config error 2022-09-08 13:58:16 +08:00
Cell a4556a728e 🔧 Chore: add CodeQL config 2022-09-08 13:54:11 +08:00
Cell fef069d7f6 🔧 Chore: add paths-ignore for codeql-action 2022-09-08 12:56:57 +08:00
Cell 8da0d0f299 🔧 Chore: update codeql-action workflow to v2 2022-09-08 12:34:28 +08:00