Skip to content

perf: lazily load README when embedding publish manifest#12278

Merged
zkochan merged 5 commits into
mainfrom
chore/embed-readme-manifest-refactor
Jun 16, 2026
Merged

perf: lazily load README when embedding publish manifest#12278
zkochan merged 5 commits into
mainfrom
chore/embed-readme-manifest-refactor

Conversation

@btea

@btea btea commented Jun 9, 2026

Copy link
Copy Markdown
Member

PR Summary by Qodo

Perf: lazily read README only when embedding publish manifest needs it
✨ Enhancement 🧪 Tests 🕐 10-20 Minutes

Grey Divider

Walkthroughs

User Description

Even with the embedReadme configuration enabled, unnecessary file read operations are reduced.

AI Description
• Move README file I/O into exportable-manifest and guard it behind need-based checks.
• Avoid reading README.md when publish manifest already contains a readme field.
• Update exportable-manifest tests to validate README embedding via a temp project directory.
Diagram
graph TD
  Pack["publish/pack.ts"] --> Exportable["createExportableManifest"] --> Gate{"Embed README needed?"}
  Gate -->|"no"| Out["Exported manifest"]
  Gate -->|"yes"| Readme["readReadmeFile"] --> Disk["README.md (projectDir)"] --> Out
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Keep caller-side reading but make it conditional on manifest contents
  • ➕ No API change to exportable-manifest options (no new embedReadme/projectDir fields)
  • ➕ Avoids adding filesystem dependency/behavior inside exportable-manifest
  • ➖ Caller must duplicate logic to know whether publish manifest will already have readme after overrides
  • ➖ Harder to keep consistent across all call sites and future transformations
2. Pass a lazy loader callback (e.g. getReadme(): Promise)
  • ➕ Preserves laziness without exporting projectDir through options
  • ➕ Keeps filesystem details in the caller while avoiding eager reads
  • ➖ More complex public API (functions in options), potentially harder to serialize/debug
  • ➖ Still requires every caller to wire the callback correctly

Recommendation: The chosen approach (move README reading into createExportableManifest and gate it with publishManifest.readme ??=) is the simplest and most robust: it performs I/O only when the manifest actually needs a readme and keeps the decision co-located with publish-manifest construction. Ensure all callers that set embedReadme also provide projectDir (or consider defaulting projectDir to the dir parameter internally if they’re intended to match).

Grey Divider

File Changes

Enhancement (2)
pack.ts Stop eager README reads; pass embedReadme + projectDir to manifest builder +2/-10

Stop eager README reads; pass embedReadme + projectDir to manifest builder

• Removes the pack-layer README discovery/read and instead forwards 'embedReadme' and 'projectDir' into 'createExportableManifest'. This defers README I/O until the manifest builder can determine whether it’s actually needed.

releasing/commands/src/publish/pack.ts


index.ts Lazy README embedding inside createExportableManifest +13/-3

Lazy README embedding inside createExportableManifest

• Extends 'MakePublishManifestOptions' with 'embedReadme' and 'projectDir', adds a local 'readReadmeFile()' helper, and sets 'publishManifest.readme' via '??=' only when embedding is requested and the field is missing. This avoids unnecessary filesystem reads when readme is already present.

releasing/exportable-manifest/src/index.ts


Tests (1)
index.test.ts Update README embedding tests to use temp project README files +37/-16

Update README embedding tests to use temp project README files

• Replaces string-injection of README content with a temp directory containing a real README.md file. Adds a helper to create/cleanup the temp project dir and updates assertions to use the new 'embedReadme'/'projectDir' options.

releasing/exportable-manifest/test/index.test.ts


Grey Divider

Qodo Logo

Summary by CodeRabbit

  • Refactor
    • Improved README embedding during package publishing: README inclusion is now controlled by an embedReadme option, and when enabled it is discovered from README.md in the provided project directory.
    • Publishing avoids unnecessary disk reads when the publish manifest already contains a readme value.
  • Tests
    • Updated manifest/publishing tests to create a temporary project directory with a real README.md, enable embedReadme, and verify the embedded readme is present in the resulting manifest.

Copilot AI review requested due to automatic review settings June 9, 2026 03:32
@btea btea requested a review from zkochan as a code owner June 9, 2026 03:32
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jun 9, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (4) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0)

Grey Divider


Action required

1. Removed readmeFile option 🐞 Bug ⚙ Maintainability
Description
MakePublishManifestOptions no longer exposes readmeFile, so downstream consumers of the
published @pnpm/releasing.exportable-manifest package that pass readmeFile will break at compile
time and lose the ability to inject non-filesystem README content. The new `embedReadme +
projectDir` path only supports reading from disk.
Code

releasing/exportable-manifest/src/index.ts[R30-35]

hooks?: Hooks
modulesDir?: string
skipManifestObfuscation?: boolean
-  readmeFile?: string
+  embedReadme?: boolean
+  projectDir?: string
+}
Evidence
The public options type for createExportableManifest no longer includes readmeFile, and the
package is published under @pnpm/releasing.exportable-manifest, so external callers using the
removed option will break.

releasing/exportable-manifest/src/index.ts[28-35]
releasing/exportable-manifest/src/index.ts[83-90]
releasing/exportable-manifest/package.json[1-22]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`@pnpm/releasing.exportable-manifest` is a published package, and this PR removes the public `readmeFile` option from `MakePublishManifestOptions`. This is a breaking change for external TypeScript consumers and also removes the capability to inject generated/virtual README content (the new API only supports reading a README from disk).
### Issue Context
The new implementation gates README I/O behind `embedReadme` and `projectDir`, but there is no longer an option to provide README content directly.
### Fix Focus Areas
- releasing/exportable-manifest/src/index.ts[28-90]
### Suggested fix
1. Re-introduce `readmeFile?: string` to `MakePublishManifestOptions` (keep it optional).
2. Update the embed logic to prefer the explicitly-provided `readmeFile` when `publishManifest.readme == null`:
- If `opts.readmeFile != null`, set `publishManifest.readme ??= opts.readmeFile`.
- Else, if `opts.embedReadme && (opts.projectDir ?? dir)`, read from disk.
3. (Optional) Mark `readmeFile` as deprecated in JSDoc if you want to migrate callers to lazy embedding over time, but keep it functional for compatibility.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Symlink test not portable 🐞 Bug ☼ Reliability
Description
The new test unconditionally calls fs.promises.symlink(), which can throw on
platforms/environments that restrict symlink creation and will fail the test suite. This repo
already has platform-guarded filesystem tests, but this new test lacks such a guard.
Code

releasing/exportable-manifest/test/index.test.ts[R162-183]

+test('readme is not embedded when README.md is a symlink pointing outside the project', async () => {
+  const tmpDir = await fs.promises.mkdtemp(path.join(os.tmpdir(), 'pnpm-readme-'))
+  try {
+    const secretFile = path.join(tmpDir, 'secret.txt')
+    await fs.promises.writeFile(secretFile, 'secret content', 'utf8')
+    const projectDir = path.join(tmpDir, 'project')
+    await fs.promises.mkdir(projectDir)
+    await fs.promises.symlink(secretFile, path.join(projectDir, 'README.md'))
+
+    expect(await createExportableManifest(projectDir, {
+      name: 'foo',
+      version: '1.0.0',
+    }, {
+      ...defaultOpts,
+      embedReadme: true,
+    })).toStrictEqual({
+      name: 'foo',
+      version: '1.0.0',
+    })
+  } finally {
+    await fs.promises.rm(tmpDir, { recursive: true, force: true })
+  }
Evidence
The new test directly creates a symlink with no platform/permission guard, while other tests in this
repo explicitly skip on Windows when filesystem capabilities differ.

releasing/exportable-manifest/test/index.test.ts[162-184]
releasing/commands/test/publish/pack.ts[370-373]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A newly added Jest test creates a symlink via `fs.promises.symlink(...)` without accounting for environments where symlink creation is disallowed (commonly Windows without Developer Mode/admin). This can make CI fail or tests flaky.
### Issue Context
The repo already uses platform guards for filesystem-behavior tests (e.g. skipping on win32).
### Fix Focus Areas
- releasing/exportable-manifest/test/index.test.ts[162-184]
### Suggested fix
- Skip the test on `process.platform === 'win32'`, **or**
- Attempt symlink creation and `test.skip()` (or early-return) when it fails with permission-related errors (e.g. `EPERM`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. README symlink exfiltration 🐞 Bug ⛨ Security
Description
readReadmeFile() reads the first *readme.md match with fs.promises.readFile() without
verifying it is a regular file inside the project directory, so a README.md symlink can cause
arbitrary file contents to be embedded into publishManifest.readme. Since packPkg writes the
resulting manifest into package/package.json in the tarball, this can leak CI/local filesystem
data into the published artifact when embedReadme is enabled.
Code

releasing/exportable-manifest/src/index.ts[R36-41]

+async function readReadmeFile (projectDir: string): Promise<string | undefined> {
+  const files = await fs.promises.readdir(projectDir)
+  const readmePath = files.find(name => /readme\.md$/i.test(name))
+  const readmeFile = readmePath ? await fs.promises.readFile(path.join(projectDir, readmePath), 'utf8') : undefined
+
+  return readmeFile
Evidence
The README embedding path reads a filesystem entry without checking for symlinks/regular-file and
then places that content into the manifest, which is later written into the tarball's
package/package.json. This creates a concrete data-flow from disk file -> publishManifest.readme
-> published tarball manifest.

releasing/exportable-manifest/src/index.ts[36-41]
releasing/exportable-manifest/src/index.ts[84-89]
releasing/commands/src/publish/pack.ts[371-379]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`readReadmeFile()` selects a README candidate from `readdir()` and reads it via `readFile(path.join(projectDir, readmePath))` without validating the resolved target is a regular file under `projectDir`. A `README.md` symlink (or a directory named `README.md`) can therefore cause unexpected reads and potentially leak content into the published `package.json` (because `packPkg` serializes the manifest into the tarball).
### Issue Context
This code runs only when `opts.embedReadme` is enabled and `publishManifest.readme` is missing, but in that case its output is embedded into the published tarball manifest.
### Fix Focus Areas
- releasing/exportable-manifest/src/index.ts[36-41]
- releasing/exportable-manifest/src/index.ts[84-89]
### Suggested fix
- Resolve and validate the README entry before reading:
- `const candidate = path.join(projectDir, readmePath)`
- Use `lstat()` to ensure it’s a regular file (and not a symlink). If you want to allow symlinks safely, resolve `realpath()` and ensure it stays within `realpath(projectDir)`.
- If invalid or unreadable (ENOENT/EISDIR), treat as “no README” (return `undefined`) rather than throwing, so `embedReadme` remains best-effort.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. EmbedReadme needs projectDir 🐞 Bug ≡ Correctness
Description
createExportableManifest embeds README only when opts.embedReadme is true and opts.projectDir is
set, even though it already receives the package directory as the first argument. Because projectDir
is optional in MakePublishManifestOptions, callers can enable embedReadme and still silently get no
embedded README.
Code

releasing/exportable-manifest/src/index.ts[R85-87]

+  if (opts?.embedReadme && opts.projectDir) {
+    publishManifest.readme ??= await readReadmeFile(opts.projectDir)
}
Evidence
The README embedding logic requires opts.projectDir, but that field is optional in the options
type; meanwhile, the function already has dir available and pack.ts now passes the same directory
twice, indicating the API is easy to misuse and can silently skip embedding.

releasing/exportable-manifest/src/index.ts[28-35]
releasing/exportable-manifest/src/index.ts[45-48]
releasing/exportable-manifest/src/index.ts[85-87]
releasing/commands/src/publish/pack.ts[390-408]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`createExportableManifest(dir, ...)` currently gates README embedding on `opts.projectDir`, which is optional, so `embedReadme: true` can be silently ignored.
### Issue Context
The function already receives `dir` and uses it for dependency conversions and hooks, but README reading uses only `opts.projectDir`.
### Fix Focus Areas
- releasing/exportable-manifest/src/index.ts[28-35]
- releasing/exportable-manifest/src/index.ts[45-48]
- releasing/exportable-manifest/src/index.ts[85-87]
### Suggested fix
- Prefer `dir` as the source of truth for README loading:
- `if (opts.embedReadme) { ... await readReadmeFile(dir) ... }`
- If you need a separate directory, make it non-optional when `embedReadme` is true (e.g., validate and throw if missing), or default to `opts.projectDir ?? dir`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (1)
5. readme set undefined ✓ Resolved 🐞 Bug ≡ Correctness
Description
When embedReadme is enabled and no README.md exists, readReadmeFile returns undefined and
publishManifest.readme ??= ... assigns that undefined, creating an own readme property. This can
break downstream/hook logic that relies on property existence checks (e.g. 'readme' in pkg) to
decide whether to generate or inject a README.
Code

releasing/exportable-manifest/src/index.ts[86]

+    publishManifest.readme ??= await readReadmeFile(opts.projectDir)
Evidence
readReadmeFile explicitly returns undefined when no README is found, and the nullish assignment runs
whenever embedReadme+projectDir are set, so an undefined value can be assigned to the readme field.

releasing/exportable-manifest/src/index.ts[37-43]
releasing/exportable-manifest/src/index.ts[85-87]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`publishManifest.readme ??= await readReadmeFile(...)` can assign `undefined` when no README is present, creating an explicit `readme: undefined` property.
### Issue Context
`readReadmeFile()` returns `undefined` when no matching README is found; `??=` will still perform the assignment when the LHS is nullish.
### Fix Focus Areas
- releasing/exportable-manifest/src/index.ts[37-43]
- releasing/exportable-manifest/src/index.ts[85-87]
### Suggested fix
Use a temporary variable and only assign when a string was read:

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6e7bf5c7-aa1a-402f-b034-27ba2a0f2edf

📥 Commits

Reviewing files that changed from the base of the PR and between f7925b7 and 9aad19e.

📒 Files selected for processing (1)
  • releasing/exportable-manifest/test/index.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • releasing/exportable-manifest/test/index.test.ts

📝 Walkthrough

Walkthrough

README embedding is refactored so createExportableManifest reads README.md from the project directory when called with embedReadme: true; pack.ts no longer reads the README itself and tests create temporary README files to validate the new flow.

Changes

README Embedding Refactoring

Layer / File(s) Summary
Manifest contract and filesystem README reading
releasing/exportable-manifest/src/index.ts
MakePublishManifestOptions replaces readmeFile?: string with embedReadme?: boolean; adds a readReadmeFile(projectDir) helper that finds a case-insensitive README.md file and reads it as UTF-8; createExportableManifest populates publishManifest.readme from the discovered file when embedReadme is true and readme is unset.
Update pack.ts to new manifest contract
releasing/commands/src/publish/pack.ts
Local readReadmeFile(projectDir) helper removed; createPublishManifest now passes embedReadme and projectDir into createExportableManifest instead of a pre-read readmeFile string.
Test updates for filesystem-based README
releasing/exportable-manifest/test/index.test.ts
Adds fs and os imports; introduces withTempProjectReadme helper to create and clean up temporary README.md files; updates README embedding tests to call createExportableManifest with embedReadme: true and projectDir to validate embedded readme behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • zkochan

Poem

🐰 I nibble at README bits today,
Moving reading into the library's way.
Temp files sprout for tests to see,
Manifests grow lines of MD.
Hooray for cleaner passing play!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'perf: lazily load README when embedding publish manifest' accurately and concisely describes the main change in the changeset—deferring README file I/O operations until actually needed during publish manifest embedding.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/embed-readme-manifest-refactor

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 refactors README embedding during publish-manifest creation to reduce unnecessary filesystem reads by only loading README content when needed (and moving the README-loading logic into @pnpm/releasing.exportable-manifest).

Changes:

  • Replace readmeFile option with embedReadme + project directory based README loading in createExportableManifest.
  • Remove the local README-reading helper from the pack command and delegate to createExportableManifest.
  • Update exportable-manifest tests to exercise README embedding via a temporary project directory/README file.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
releasing/exportable-manifest/src/index.ts Adds README discovery/reading and embeds it into the exportable manifest when configured.
releasing/commands/src/publish/pack.ts Removes in-file README reading and passes embed configuration through to exportable-manifest.
releasing/exportable-manifest/test/index.test.ts Updates tests to use temp project README files and the new embed options.

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

Comment thread releasing/exportable-manifest/src/index.ts Outdated
Comment thread releasing/exportable-manifest/test/index.test.ts Outdated
Comment thread releasing/exportable-manifest/test/index.test.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@releasing/exportable-manifest/src/index.ts`:
- Around line 39-40: The README discovery should match the exact filename and
ensure the entry is a file; replace the loose predicate in files.find with a
check like path.basename(name).toLowerCase() === 'readme.md' (referencing
readmePath and files.find) and before reading (readmeFile creation using
fs.promises.readFile and path.join) verify the entry is a file via
fs.promises.lstat(path.join(projectDir, readmePath)).then(stat => stat.isFile())
— only call fs.promises.readFile when isFile() is true, otherwise treat
readmeFile as undefined.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d2dda2ae-5283-493c-a725-1bea6f6224ce

📥 Commits

Reviewing files that changed from the base of the PR and between 7006bfa and 6e1b158.

📒 Files selected for processing (3)
  • releasing/commands/src/publish/pack.ts
  • releasing/exportable-manifest/src/index.ts
  • releasing/exportable-manifest/test/index.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: copilot-pull-request-reviewer
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Compile & Lint
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Use Standard Style with trailing commas, prefer functions over classes, declare functions after they are used (relying on hoisting), limit functions to no more than two or three arguments, and use a single options object for functions needing more parameters
Follow import order: standard libraries first, then external dependencies (sorted alphabetically), then relative imports
Do not write comments that restate what the code already says; rename variables, split helpers, or move checks to more obvious places instead
Do not repeat documentation at call sites that already lives on the callee; update the JSDoc once and let every call site benefit
Use JSDoc for the function's contract (preconditions, postconditions, edge cases, why the function exists), not for re-narrating the function body
Do not record past implementation shape, refactor history, or removed code in comments; use git log and git blame for that information instead
Write comments only when the reason for code is non-obvious, a hidden invariant exists, a workaround for a known bug is needed, or an exception to surrounding pattern is deliberate

Files:

  • releasing/exportable-manifest/test/index.test.ts
  • releasing/exportable-manifest/src/index.ts
  • releasing/commands/src/publish/pack.ts
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not use instanceof Error for checking if a caught error is an Error object in Jest tests; use util.types.isNativeError() instead to work across realms

Files:

  • releasing/exportable-manifest/test/index.test.ts
🧠 Learnings (3)
📚 Learning: 2026-05-14T09:04:00.133Z
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11622
File: resolving/npm-resolver/test/publishedBy.test.ts:350-354
Timestamp: 2026-05-14T09:04:00.133Z
Learning: In the pnpm/pnpm repository, ESLint is the authoritative style linter. Do not raise review findings for missing trailing commas in multiline function calls (e.g., `fs.writeFileSync(...)`) when this repo’s ESLint configuration does not report them and lint passes. Prefer deferring to the ESLint results for this specific trailing-comma rule rather than enforcing it manually in code review.

Applied to files:

  • releasing/exportable-manifest/test/index.test.ts
  • releasing/exportable-manifest/src/index.ts
  • releasing/commands/src/publish/pack.ts
📚 Learning: 2026-06-05T13:47:05.929Z
Learnt from: vsumner
Repo: pnpm/pnpm PR: 12190
File: installing/deps-installer/test/install/frozenStore.ts:2-17
Timestamp: 2026-06-05T13:47:05.929Z
Learning: In the pnpm/pnpm repository, the shared Jest preset keeps `injectGlobals` at its default (`true`), so `test` and `expect` are available as Jest globals. Therefore, reviewers should not flag (or treat as TypeScript/compilation errors) missing `import { test, expect } from 'jest/globals'` when a test file uses `test`/`expect` without importing them. Importing from `jest/globals` may still be used for consistency with sibling files, but it is not required for execution in this repo unless a Jest preset is explicitly configured with `injectGlobals: false`.

Applied to files:

  • releasing/exportable-manifest/test/index.test.ts
📚 Learning: 2026-06-05T13:47:26.046Z
Learnt from: vsumner
Repo: pnpm/pnpm PR: 12190
File: installing/deps-installer/src/install/index.ts:2337-2343
Timestamp: 2026-06-05T13:47:26.046Z
Learning: In the pnpm/pnpm codebase, `PnpmError` automatically prefixes `err.code` with `ERR_PNPM_` when you pass a code that does not already start with `ERR_PNPM_` (it normalizes `this.code` via `code.startsWith('ERR_PNPM_') ? code : `ERR_PNPM_${code}``). Therefore, during code review you should NOT flag `new PnpmError(...)` call sites for passing a bare error code (e.g., `new PnpmError('FROZEN_STORE_INCOMPATIBLE_WITH_PNPR', ...)`); the resulting `err.code` will still be `ERR_PNPM_FROZEN_STORE_INCOMPATIBLE_WITH_PNPR`.

Applied to files:

  • releasing/exportable-manifest/test/index.test.ts
  • releasing/exportable-manifest/src/index.ts
  • releasing/commands/src/publish/pack.ts
🔇 Additional comments (2)
releasing/commands/src/publish/pack.ts (1)

403-404: LGTM!

releasing/exportable-manifest/test/index.test.ts (1)

2-3: LGTM!

Also applies to: 124-135, 148-160, 164-172

Comment thread releasing/exportable-manifest/src/index.ts Outdated
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jun 9, 2026

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit f444962

Comment thread releasing/exportable-manifest/src/index.ts
Copilot AI review requested due to automatic review settings June 16, 2026 08:11
@zkochan zkochan force-pushed the chore/embed-readme-manifest-refactor branch from f444962 to 7817f29 Compare June 16, 2026 08:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jun 16, 2026

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 7817f29

Comment thread releasing/exportable-manifest/src/index.ts Outdated
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jun 16, 2026

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit f7925b7

Comment thread releasing/exportable-manifest/test/index.test.ts Outdated
Copilot AI review requested due to automatic review settings June 16, 2026 08:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jun 16, 2026

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 9aad19e

@zkochan zkochan merged commit e85aea2 into main Jun 16, 2026
23 checks passed
@zkochan zkochan deleted the chore/embed-readme-manifest-refactor branch June 16, 2026 09:42
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.

3 participants