Skip to content

Refactor project structure#262

Merged
ruibaby merged 10 commits intomainfrom
refactor/project
Mar 30, 2026
Merged

Refactor project structure#262
ruibaby merged 10 commits intomainfrom
refactor/project

Conversation

@ruibaby
Copy link
Copy Markdown
Member

@ruibaby ruibaby commented Mar 28, 2026

Introduce the https://github.com/halo-sigs/vite-plugin-halo-theme plugin to refactor the theme project, switching to fully ESM-based resource loading. This allows us to control the JS and CSS loaded for each page, reducing the overall page payload size.

None

ruibaby added 8 commits March 13, 2026 23:18
Signed-off-by: Ryan Wang <i@ryanc.cc>
Signed-off-by: Ryan Wang <i@ryanc.cc>
Signed-off-by: Ryan Wang <i@ryanc.cc>
Move frontend assets into src/assets, add many template/partial HTML modules and public default assets (images, styles, qrious, qrcode page). Rename env.d.ts to project root and remove src/main.ts. Update package.json scripts and tooling: replace packaging command with theme-package, remove tsc from build-only, bump alpinejs and @iconify/json, add @halo-dev/theme-package-cli and @halo-dev/vite-plugin-halo-theme, and bump packageManager to pnpm@10.33.0. Regenerate pnpm-lock.yaml to reflect new/updated packages and transitive dependencies. Misc: adjust .gitignore to ignore templates and update tailwind/vite/tsconfig changes.
Delete numerous theme templates and associated static assets. This removes multiple files under templates/ (pages, modules, and partials) and related assets such as images (default avatars/backgrounds/gongan_beian), qrious JS, qrcode-share, and github-markdown.css — cleaning up or replacing the theme's template layer and static resources.
Introduce modular asset entrypoints and split styles into per-feature SCSS files for better bundling. Added new TS entry files (src/assets/doc.ts, moment.ts, page.ts, post.ts) and new SCSS modules (doc.scss, markdown-body.scss, moment.scss, prose.scss), and relocated github-markdown.css into src/assets/styles. Refactored src/assets/styles/main.scss to remove markdown/moment/docsme-specific rules now moved to dedicated files. Updated templates (doc*, docs, doc-catalog, moments, page, post) to load the new module entry scripts instead of inlining stylesheet links. Added build code-splitting configuration in vite.config.ts to group vendor modules for optimized bundles.
Use Node 24 in the GitHub Actions CD workflow. Remove author metadata from package.json, replace @iconify/json with scoped @iconify-json packages, and bump @types/node to 24.12.0. pnpm lockfile regenerated to reflect these dependency updates.
Integrate OverlayScrollbars: add dependency and lockfile entry, import and initialize the library (with plugins) in a new src/assets/utils/overlayscrollbars.ts, and register it from main.ts. Mark body as hidden by default in layout and doc templates to avoid FOUC until the scrollbar instance is ready, and add a <noscript> fallback to ensure visibility when JS is disabled. Also set body overflow to auto in styles to accommodate the custom scrollbars.
@f2c-ci-robot f2c-ci-robot bot added the release-note-none Denotes a PR that doesn't merit a release note. label Mar 28, 2026
@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot bot commented Mar 28, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign guqing for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

ruibaby added 2 commits March 28, 2026 11:59
Change generateToc signature to take a separate tocContainerSelector and use it when removing the container if no headings are found. Also update the post.html call site to pass the new third argument. This ensures the correct DOM element is targeted for removal when the content has no h1–h4 headings.
Update lockfile with multiple dependency/version bumps and new platform bindings. Key changes: vite-plus and related voidzero packages bumped to 0.1.14, added @oxc-project/runtime@0.121.0 and bumped @oxc-project/types to 0.122.0, oxfmt platform bindings updated to 0.42.0, oxlint and tsgolint bindings bumped to 1.57.0/0.17.3, cac -> 7.0.0 (node engine requirement updated), lightningcss platform packages updated to 1.32.0 (including new android-arm64 entry), and small peerDependency/peerDependenciesMeta adjustments (e.g. @vitest/ui -> 4.1.1). Integrity hashes and engine/cpu/os metadata were updated accordingly.
@ruibaby ruibaby merged commit 202285f into main Mar 30, 2026
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note-none Denotes a PR that doesn't merit a release note.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant