LearnNewsExamplesServices
Frontmatter
id8444
titleAutomate .npmignore synchronization with .gitignore in prepareRelease script
stateClosed
labels
enhancementaibuild
assigneestobiu
createdAtJan 8, 2026, 10:29 PM
updatedAtJan 8, 2026, 10:33 PM
githubUrlhttps://github.com/neomjs/neo/issues/8444
authortobiu
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 8, 2026, 10:33 PM

Automate .npmignore synchronization with .gitignore in prepareRelease script

Closed v11.19.0 enhancementaibuild
tobiu
tobiu commented on Jan 8, 2026, 10:29 PM

Update buildScripts/prepareRelease.mjs to automate the synchronization of .npmignore.

Logic:

  1. Read the current .npmignore file.
  2. Preserve the first 7 lines (containing the specific npm-only ignore rules).
  3. Read the .gitignore file.
  4. Append the entire content of .gitignore to the preserved .npmignore header.
  5. Write the result back to .npmignore.

Rationale: This ensures that .npmignore stays in sync with .gitignore automatically, preventing it from becoming stale while preserving the necessary npm-specific rules.

tobiu added the enhancement label on Jan 8, 2026, 10:29 PM
tobiu added the ai label on Jan 8, 2026, 10:29 PM
tobiu added the build label on Jan 8, 2026, 10:29 PM
tobiu referenced in commit f2261ea - "enhancement: Automate .npmignore synchronization (#8444)" on Jan 8, 2026, 10:30 PM
tobiu assigned to @tobiu on Jan 8, 2026, 10:30 PM
tobiu
tobiu Jan 8, 2026, 10:30 PM

Input from Gemini 3 Pro:

✦ Implemented the synchronization logic in buildScripts/prepareRelease.mjs.

Changes:

  • Added logic to read .npmignore and .gitignore inside the insideNeo block.
  • Keeps the first 7 lines of .npmignore (npm specific rules).
  • Appends the full content of .gitignore.
  • Writes the result back to .npmignore.
  • Confirmed that this runs before createReleaseIndex.

Verified by checking the diff and committing the change.

tobiu referenced in commit ad416ba - "enhancement: Use marker to sync .npmignore (#8444)" on Jan 8, 2026, 10:33 PM
tobiu
tobiu Jan 8, 2026, 10:33 PM

Input from Gemini 3 Pro:

✦ Refined the implementation to use a marker string # Original content of the .gitignore file instead of a hardcoded line count.

  • If the marker is found, it preserves everything up to and including that line.
  • If not found, it falls back to the first 7 lines. This approach allows for adding more npm-specific rules above the marker without breaking the script.

Changes committed and pushed.

tobiu closed this issue on Jan 8, 2026, 10:33 PM