diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..91b29aa --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: CI + +on: + push: + branches: [main] + tags: ["v*"] + pull_request: + +permissions: + contents: read + +jobs: + check: + name: Node ${{ matrix.node }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # engines.node is ">=20": test the floor plus current releases. + node: [20, 22, 24] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - run: npm run check + - run: npm run pack:check + + astro: + name: Astro ${{ matrix.astro }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # Mirrors peerDependencies.astro ("^5 || ^6 || ^7"). + astro: [5, 6, 7] + defaults: + run: + working-directory: test/fixtures/astro + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + - run: npm install --no-audit --no-fund + - run: npm run verify:astro${{ matrix.astro }} diff --git a/CHANGELOG.md b/CHANGELOG.md index e50b894..5bdbc2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,39 @@ 版本策略见 [README 的「升级与版本策略」](README.md#升级与版本策略)。每条变更都标注**调用方是否需要改配置**,升级时只读这一列即可。 +## 0.1.2 - 2026-09-30 + +需要改配置:否。兼容性与健壮性加固,现有 `items` / `tracking` 配置原样可用。只有此前就会静默出错的输入会改为构建期报错(见最后三条)。 + +行为变化(无需改配置,但升级后数据或输出可能不同): + +- 归因:`?from=` 的值会去掉首尾空白并忽略大小写匹配 allowlist,上报时统一使用配置里的写法。此前 `?from=GitHub`、`?from=blog%20` 会被归为 `other`。 +- 归因:中键点击(“在新标签页打开”)现在也会上报。此前浏览器不为中键触发 `click`,这部分访问会漏记;右键不上报。 +- 渲染:所有条目都 `enabled: false` 时 `renderPromotionLinks()` 返回空字符串,不再输出一个空的、带名字的 `