Skip to content

feat(pkg): optimize attw and publint packing#736

Merged
sxzz merged 6 commits intomainfrom
sxzz/publint-pack
Jan 29, 2026
Merged

feat(pkg): optimize attw and publint packing#736
sxzz merged 6 commits intomainfrom
sxzz/publint-pack

Conversation

@sxzz
Copy link
Member

@sxzz sxzz commented Jan 29, 2026

  • This PR contains AI-generated code, but I have carefully reviewed it myself. Otherwise, my PR may be closed.

Description

Use @publint/pack instead of hardcoded npm pack to pack tarballs for attw and publint checks. When both features are enabled, the tarball is packed only once and shared between them.

  • Add @publint/pack and package-manager-detector as inlined dev dependencies
  • Auto-detect the package manager via package-manager-detector and pass it to @publint/pack
  • Simplify attw by removing its temporary npm pack logic; accept pre-packed tarball instead
  • Update publint to receive a pre-packed tarball via pack: { tarball } option

Linked Issues

Closes #733

Additional context

This removes the hard dependency on npm CLI for packing and ensures both linters work with an identical tarball.

sxzz and others added 2 commits January 30, 2026 03:32
- Add @publint/pack to deps and package-manager-detector for smart pack detection
- Create tarball once and share buffer between publint and attw
- Remove duplicate npm pack logic from attw, use createPackageFromTarballData
- Detect package manager to optimize packing for npm, yarn, pnpm, bun
- Use @publint/pack instead of npm pack for consistent packing across package managers
- Detect package manager with package-manager-detector and pass to pack
- Pack tarball once when both publint and attw are enabled, share buffer between them
- Simplify attw implementation by removing temporary npm pack logic
- Update publint to accept pre-packed tarball instead of pkgDir

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@netlify
Copy link

netlify bot commented Jan 29, 2026

Deploy Preview for tsdown failed.

Name Link
🔨 Latest commit 513fa68
🔍 Latest deploy log https://app.netlify.com/projects/tsdown/deploys/697bb9198937e30008e8dfd3

autofix-ci bot and others added 4 commits January 29, 2026 19:39
If packTarball throws, ctx.resolve() must still run so other
bundles awaiting ctx.promise don't hang indefinitely.
Error is now caught by the outer try/catch in bundleDone.
@sxzz sxzz merged commit 375cfe7 into main Jan 29, 2026
10 of 16 checks passed
@sxzz sxzz deleted the sxzz/publint-pack branch January 29, 2026 19:48
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.

AreTheTypesWrong (attw) integration doesn't work with publishConfig / devExports

1 participant