Skip to content

fix(npm): use scoped package name and fix installer tar import#5

Merged
Miss-you merged 2 commits intomainfrom
fix/npm-scoped-package-name
Feb 19, 2026
Merged

fix(npm): use scoped package name and fix installer tar import#5
Miss-you merged 2 commits intomainfrom
fix/npm-scoped-package-name

Conversation

@Miss-you
Copy link
Owner

Summary

  • Switch npm package identity from codetok to @yousali/codetok to align with publish permissions.
  • Fix npm postinstall runtime failure caused by invalid ESM import from tar.

Changes

  • npm/package.json
    • set package name to @yousali/codetok
    • keep default repo version at 0.0.0-dev (CI still sets publish version from tag)
  • npm/scripts/install.mjs
    • replace import tar from 'tar' with import { x as extractTar } from 'tar'
    • update extraction call to extractTar(...)
  • npm/bin/codetok.js
    • update reinstall hint to scoped install command
  • README.md, README_zh.md, npm/README.md
    • update npm install command to npm install -g @yousali/codetok

Validation

  • make test
  • make lint
  • make vet
  • make build
  • npm pack --dry-run (in npm/)
  • postinstall path verified via local packed install and binary execution

Why this PR

  • Prior release workflow failed at npm publish for unscoped codetok due to permission restrictions.
  • Even after scoped canary publish succeeded, installation failed because tar had no default export in ESM mode.
  • This PR resolves both distribution path correctness and install-time runtime stability.

Copilot AI review requested due to automatic review settings February 18, 2026 17:42
Copy link

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

This PR fixes npm distribution by moving the package to the scoped name @yousali/codetok (to match publish permissions) and resolving an ESM import issue in the postinstall installer that was causing runtime failures.

Changes:

  • Rename npm package from codetok to @yousali/codetok.
  • Fix installer extraction by switching from tar default import to the named x export and updating the call site.
  • Update user-facing install/reinstall commands in READMEs and the npm wrapper error message.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
npm/scripts/install.mjs Fixes tar extraction import/call to work under ESM and prevent postinstall failures.
npm/package.json Updates published npm package name to the scoped identity.
npm/bin/codetok.js Updates missing-binary reinstall hint to the scoped npm package name.
npm/README.md Updates npm install instructions to the scoped package name.
README.md Updates npm install instructions to the scoped package name.
README_zh.md Updates npm install instructions to the scoped package name.

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

@Miss-you Miss-you merged commit 0ab65d6 into main Feb 19, 2026
7 checks passed
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.

2 participants