KonghaYao / cn-font-split

划时代的字体切割工具,CJK与任何字符!支持 otf、ttf、woff2 字体多线程切割,完美地细颗粒度地进行包大小控制。A revolutionary font subetter that supports CJK and any characters! It enables multi-threaded subset of otf, ttf, and woff2 fonts, allowing for precise control over package size.
https://chinese-font.netlify.app/
Apache License 2.0
442 stars 15 forks source link

Refactor/build/vite #81

Closed KonghaYao closed 1 month ago

KonghaYao commented 1 month ago

Summary by Sourcery

Refactor build configuration to use Vite, update import paths and module declarations, and add scripts for build and test enhancements.

Enhancements:

Build:

Tests:

Chores:

sourcery-ai[bot] commented 1 month ago

Reviewer's Guide by Sourcery

This pull request refactors the build system to use Vite, updates asset management for browser and node environments, and removes obsolete configuration files. Key changes include updating import paths, renaming plugins, and adding new utility scripts.

File-Level Changes

Files Changes
packages/subsets/src/adapter/AssetsMap.ts
packages/subsets/src/adapter/assets.ts
packages/subsets/src/adapter/browser/browserPresets.ts
packages/subsets/src/adapter/node/nodeAssets.json
Refactored asset management to use browser and node presets.
packages/subsets/index.html
packages/subsets/test/deno.onlne.test.js
packages/subsets/test/deno.test.js
Updated import paths and path transformations for fontSplit and Assets.
packages/vite/rspack.config.js
packages/vite/src/unplugin.ts
packages/vite/vite.config.mts
Refactored Vite and Rspack configurations, including plugin renaming and new Vite config files.
packages/subsets/src/useSubset/calcContoursBorder.ts
packages/subsets/src/convert/convert.manager.ts
packages/subsets/src/env.d.ts
Fixed and updated various utility functions and configurations.
packages/subsets/test/checkResultHash.mjs
script/fix_vite_lib_assets.mjs
Added new utility scripts for hash checking and Vite asset fixing.
packages/subsets/rollup.config.browser.mjs
packages/subsets/vitest.config.ts
packages/subsets/rollup.config.js
packages/subsets/scripts/common.config.mjs
packages/vite/tsup.config.ts
Removed obsolete configuration files.

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.