@animxyz/core

中文文档
0.6.7发布于 2026/07/15MIT零依赖近 30 天下载 1.3万

AnimXYZ is a composable animation library that makes your site shine

原始使用文档

@animxyz/core

AnimXYZ is a composable animation library that makes your site shine.

See animxyz.com for full documentation.

Testing

Tests live in test/ and run on the plain Node.js test runner (node:test, no extra framework). From this package directory:

npm test

or from the repo root:

npm test -w @animxyz/core
# or
turbo run test

turbo run test builds this package first (the test task depends on ^build in turbo.json), so the snapshot and size-budget tests always run against freshly built output.

What's covered:

  • Compile test (test/compile.test.js) — build.scss compiles without errors, and without any Sass deprecation warnings (build.scss uses @use, not @import).

  • Mixin API tests (test/mixin-api.test.js) — small fixture .scss files under test/fixtures/ @use the source directly and invoke the public mixins/functions (xyz-utility, xyz-var, xyz-set-all, xyz-animation, xyz-make-keyframes), asserting they compile and spot checking emitted declarations. test/fixtures/xyz-apply.scss documents a known bug (tracked by work brief A2, fix/xyz-apply): the mixin currently always errors due to swapped constructor arguments. Once A2 lands, flip that test from asserting the @error to asserting a successful compile. test/fixtures/xyz-time-levels-override.scss proves that $xyz-duration-levels / $xyz-delay-levels / $xyz-stagger-levels remain independently !default-overridable after being derived from the shared $xyz-time-levels map (work brief A3).

  • Snapshot test (test/snapshot.test.js) — compiles build.scss (expanded), normalizes it (strips comments, collapses whitespace, reflows to one declaration per line for reviewable diffs), and compares it against the committed test/__snapshots__/animxyz.css. If you intentionally change compiled output, regenerate the snapshot with:

    npm run test:update-snapshot
    

    then review the resulting git diff and explain the change in your PR description — don't just regenerate and commit blindly.

  • Size budget (test/size-budget.test.js) — asserts the gzipped size of dist/animxyz.min.css stays under a fixed byte budget (measured size + 10% headroom). If a change intentionally grows the output, remeasure and update BUDGET_BYTES in that file with justification in the PR.

Building from source

This package requires Dart Sass to compile src/*.scss (see sass in devDependencies).

Minimum Dart Sass version: 1.57.0. The source uses sass:string's string.split(), which was added in Dart Sass 1.57. If you @use this package's src/*.scss directly (rather than consuming the prebuilt dist/animxyz.css), make sure your own Sass compiler is at least 1.57.

版本与发布记录

@animxyz/core 共发布 34 个版本,首次发布于 2020/05/06;过去 12 个月发布了 1 个版本。

版本发布日期距今
0.6.7latest2026/07/153 个月前
0.6.62022/01/124 年前
0.6.42021/06/305 年前
0.6.32021/06/305 年前
0.6.22021/06/305 年前
0.6.02021/06/235 年前

关于 @animxyz/core 的常见问题

@animxyz/core 是什么?

AnimXYZ is a composable animation library that makes your site shine

如何安装 @animxyz/core?

在项目目录运行 npm install @animxyz/core,或使用 pnpm add / yarn add / bun add。

@animxyz/core 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/animxyz__core 是否存在。

@animxyz/core 可以商用吗?

@animxyz/core 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@animxyz/core 的下载量有多少?

根据 npm 官方下载统计,@animxyz/core 在 2026/10/06 – 2026/11/04 这 30 天内被下载 12,743 次,日均约 425 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@animxyz/core 还在维护吗?

最新版本 0.6.7 发布于 2026/07/15(3 个月前);至今共发布 34 个版本,其中过去 12 个月发布了 1 个;首次发布于 2020/05/06。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。