Skip to content

chore(use-url-state): rename package and add migration notices#2922

Merged
crazylxr merged 2 commits intomasterfrom
crazylxr/use-url-state-republish
Mar 29, 2026
Merged

chore(use-url-state): rename package and add migration notices#2922
crazylxr merged 2 commits intomasterfrom
crazylxr/use-url-state-republish

Conversation

@crazylxr
Copy link
Copy Markdown
Collaborator

@crazylxr crazylxr commented Mar 28, 2026

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (包名迁移与重发)

🔗 Related issue link

暂无(因 npm 发布权限变更触发的包重发与迁移)

💡 Background and solution

由于当前维护账号对 @ahooksjs/use-url-state 的持续发布权限受限,无法继续稳定更新该包。
为保证 use-url-state 独立包可持续发布,本次将包名迁移为:

  • @ahooks.js/use-url-state

本次改动包括:

  1. 包配置与构建配置更新(packages/use-url-state

    • package.json 包名改为 @ahooks.js/use-url-state
    • unpkg 产物名同步调整
    • webpack.config.js 输出文件名与 library 名称同步调整
    • tsconfig.json 路径别名同步调整
  2. 使用侧代码与文档同步

    • README 安装与导入示例更新为新包名
    • 中英文文档安装与导入示例更新为新包名
    • demos 中的 import 路径更新为新包名
  3. 迁移公告补充(提升可见性)

    • 根目录 README.md / README.zh-CN.md
    • 升级文档 docs/guide/upgrade.en-US.md / docs/guide/upgrade.zh-CN.md
    • 包文档 packages/use-url-state/README.mduse-url-state.en-US.mduse-url-state.zh-CN.md
  4. 站点构建别名修复

    • config/config.ts 中的 alias 更新为 @ahooks.js/use-url-state,确保 demo/docs 本地构建正确解析
    • tsconfig.pro.jsoncompilerOptions.paths 更新为 @ahooks.js/use-url-state,确保 TypeScript 编译时路径正确

📝 Changelog

Language Changelog
🇺🇸 English Rename standalone package from @ahooksjs/use-url-state to @ahooks.js/use-url-state due to publish permission changes; update demos/docs, add migration notices, and fix site build aliases in config/config.ts and tsconfig.pro.json.
🇨🇳 Chinese 由于发布权限调整,use-url-state 独立包由 @ahooksjs/use-url-state 迁移为 @ahooks.js/use-url-state;同步更新示例与文档,新增迁移公告,并修复 config/config.tstsconfig.pro.json 中的站点构建别名。

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

@crazylxr crazylxr requested a review from Copilot March 28, 2026 15:43
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 28, 2026

npm i https://pkg.pr.new/ahooks@2922
npm i https://pkg.pr.new/@ahooks.js/use-url-state@2922

commit: ab708f0

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Renames the standalone use-url-state package from @ahooksjs/use-url-state to @ahooks.js/use-url-state, and updates associated build outputs, demos, and documentation with migration notices to reflect the new publish location.

Changes:

  • Update packages/use-url-state package metadata, TS path alias, and UMD/unpkg build output naming for the new package name.
  • Update demos and package docs to import/install @ahooks.js/use-url-state.
  • Add migration notices to root READMEs and upgrade guides (EN/ZH).

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/use-url-state/webpack.config.js Renames UMD output filename and global library name to match new package name.
packages/use-url-state/use-url-state.zh-CN.md Updates install/import examples and adds migration notice (ZH).
packages/use-url-state/use-url-state.en-US.md Updates install/import examples and adds migration notice (EN).
packages/use-url-state/tsconfig.json Updates TS paths alias for the new scoped package name.
packages/use-url-state/package.json Renames package and updates unpkg entry file name.
packages/use-url-state/demo/demo1.tsx Updates demo import to new package name.
packages/use-url-state/demo/demo2.tsx Updates demo import to new package name.
packages/use-url-state/demo/demo3.tsx Updates demo import to new package name.
packages/use-url-state/demo/demo4.tsx Updates demo import to new package name.
packages/use-url-state/README.md Updates install/import examples and adds migration notice.
docs/guide/upgrade.zh-CN.md Adds upgrade guide note for the standalone package rename (ZH).
docs/guide/upgrade.en-US.md Adds upgrade guide note for the standalone package rename (EN).
README.zh-CN.md Adds top-level migration notice (ZH).
README.md Adds top-level migration notice (EN).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

*/

import useUrlState from '@ahooksjs/use-url-state';
import useUrlState from '@ahooks.js/use-url-state';
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new import path will not resolve in the repo’s local docs/demo build because the site alias and TS path mappings still point to the old package name (@ahooksjs/use-url-state). Please update config/config.ts (alias) and tsconfig.pro.json (compilerOptions.paths) to use @ahooks.js/use-url-state so demos compile correctly.

Suggested change
import useUrlState from '@ahooks.js/use-url-state';
import useUrlState from '@ahooksjs/use-url-state';

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已经更新了 config/config.ts (alias) and tsconfig.pro.json (compilerOptions.paths),你再重新 review 一下 @copilot

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已确认,config/config.tstsconfig.pro.json 均已正确更新为 @ahooks.js/use-url-state(commit ab708f0),所有 demo 的 import 路径也一致。本地 docs/demo 构建的别名解析已对齐,无需进一步修改。

@crazylxr crazylxr merged commit a773b76 into master Mar 29, 2026
18 of 19 checks passed
@crazylxr crazylxr deleted the crazylxr/use-url-state-republish branch March 29, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants