Skip to content

Conversation

@alumni
Copy link
Collaborator

@alumni alumni commented Jun 22, 2025

Description of change

Fix pkg-pr-new failing because of husky.

When using npm, pack is a protected command that cannot be changed. If you add a script called pack, you can run it only with npm run pack.

The built-in npm pack command will invoke the prepare script, which in our case was setting up husky. But husky fails to be setup because there's no .git folder in <root>/build/package, where npm pack was being executed.

With pnpm it was working because pnpm pack will run the pack script if it is defined instead of the pack command, so the prepare script was not run.

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • This pull request links relevant issues as Fixes #00000
  • There are new or updated unit tests validating the change
  • Documentation has been updated to reflect this change

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 22, 2025

Walkthrough

Removed pnpm preparation from the PR preview GitHub Actions workflow. Updated package.json: conditioned Husky install for non-CI via is-ci, removed the --pnpm flag from the preview publish script, and added is-ci as a devDependency.

Changes

Cohort / File(s) Summary
CI workflow adjustments
\.github/workflows/preview.yml
Removed the "Prepare pnpm for preview publishing" step; pipeline now proceeds from Build directly to Release preview version.
NPM scripts and dev deps
package.json
Updated prepare script to `is-ci

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as Developer
  participant GH as GitHub Actions (preview.yml)
  participant Build as Build Step
  participant Rel as Release Preview

  Dev->>GH: Open PR / push
  GH->>Build: Run build
  note over GH,Build: Previously: pnpm prep step ran here (removed)
  Build-->>GH: Build artifacts
  GH->>Rel: Publish preview (uses configured package manager)
  Rel-->>GH: Preview release completed
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • naorpeled
  • gioboa

Poem

I thump my paws on CI ground,
No pnpm prep—still humming sound.
Husky naps when CI’s nigh,
Wakes for devs beneath the sky.
Preview hops with lighter pack—
Carrots cached, no extra stack.
Merge, and hear the pipelines crack! 🥕🐇

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "chore: fix package preview" succinctly and accurately conveys the primary intent of the changeset: adjusting the package preview behavior. The modifications (removing pnpm preparation in the preview workflow and updating package.json scripts and devDependencies) directly relate to "fix[ing] package preview," and the title is concise and clear for repository history. It avoids noise and is appropriate for a chore-scoped change.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coveralls
Copy link

coveralls commented Jun 22, 2025

Coverage Status

coverage: 76.427%. remained the same
when pulling d4c35d3 on alumni:chore/update-pkg-preview
into c16ef63 on typeorm:master.

@alumni alumni force-pushed the chore/update-pkg-preview branch from a2fdb10 to 324dd0f Compare June 22, 2025 16:36
Copy link
Collaborator

@gioboa gioboa left a comment

Choose a reason for hiding this comment

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

Hi @alumni is this PR still valid?

@alumni
Copy link
Collaborator Author

alumni commented Sep 19, 2025

I didn't manage to fix the issues with package preview yet. Will try to come back when I have some time, if not I'll decline it.

@alumni alumni force-pushed the chore/update-pkg-preview branch 3 times, most recently from d7b5e34 to b4ef7ad Compare September 19, 2025 18:10
@alumni alumni force-pushed the chore/update-pkg-preview branch from b4ef7ad to d4c35d3 Compare September 19, 2025 18:18
@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 19, 2025

typeorm-sql-js-example

npm i https://pkg.pr.new/typeorm/typeorm@11542

commit: d4c35d3

@alumni alumni requested a review from naorpeled September 19, 2025 18:19
@alumni alumni marked this pull request as ready for review September 19, 2025 18:19
@alumni alumni requested a review from gioboa September 19, 2025 18:21
@alumni
Copy link
Collaborator Author

alumni commented Sep 19, 2025

@gioboa @naorpeled I finally figured it out, the explanation is in the PR description. Basically husky is run when it should not be.

Copy link
Collaborator

@gioboa gioboa left a comment

Choose a reason for hiding this comment

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

Thanks for you help @alumni

@alumni alumni changed the title chore: update package preview chore: fix package preview Sep 19, 2025
@naorpeled
Copy link
Member

🔥

@alumni alumni merged commit d4f7b44 into typeorm:master Sep 20, 2025
62 checks passed
ThbltLmr pushed a commit to ThbltLmr/typeorm that referenced this pull request Dec 2, 2025
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