This document describes the NPM package configuration and metadata defined in package.json for the git-merged-branches tool. It covers package identity, distribution settings, binary executable mappings, and integration points with the NPM registry and GitHub ecosystem.
For information about the NPM publishing automation process, see NPM Publishing. For details on installing and using the published package, see Installation and Setup.
The package is identified in the NPM registry through core metadata fields defined at the top level of package.json:
| Field | Value | Purpose |
|---|---|---|
name | "git-merged-branches" | Unique package identifier in NPM registry |
version | "0.5.0" | Current semantic version |
description | "CLI tool to list all Git branches merged into a base branch with issue link formatting" | Package purpose shown in NPM search |
license | "MIT" | Open source license type |
type | "module" | Specifies ES module format |
packageManager | "pnpm@10.34.1" | Enforces specific package manager version |
Sources: package.json2-11
The type: "module" declaration package.json3 ensures that the package is treated as an ES module, allowing the use of import/export syntax and the .mjs extension for the distributed executable. The engines field further restricts the runtime environment to node >=22.18.0 package.json35-37
The package uses keywords and descriptive metadata to improve discoverability in NPM search results:
Diagram: How Package Metadata Enables Discovery in NPM Registry
The keywords array package.json20-25 contains four strategic terms:
"git" - Associates with Git version control"cli" - Identifies as command-line tool"branch" - Indicates branch management functionality"issue-tracker" - Highlights integration capabilitySources: package.json5 package.json20-25
The package metadata establishes connections to external systems through URL fields:
Diagram: External System Integration via Package Metadata
| Metadata Field | URL Structure | Purpose |
|---|---|---|
author.url | https://github.com/VChet | Links to author's GitHub profile |
repository.url | git+https://github.com/VChet/git-merged-branches.git | Git clone URL for source code |
bugs.url | https://github.com/VChet/git-merged-branches/issues | Issue reporting endpoint |
homepage | https://github.com/VChet/git-merged-branches#readme | Documentation landing page |
Sources: package.json6-19
The bin field maps command-line executable names to the bundled JavaScript file:
Diagram: Binary Executable Mapping from package.json to System Paths
The tool provides two command aliases:
| Command | Target File | Usage |
|---|---|---|
git-merged-branches | dist/index.mjs | Full command name |
gmb | dist/index.mjs | Short alias for convenience |
Sources: package.json26-29
Both commands point to the same executable file dist/index.mjs. When installed globally, these commands become available in the system PATH.
The files field controls which files are included when the package is published to NPM:
Diagram: File Selection for NPM Distribution
The published package contains only essential files:
| Path | Purpose | Size Impact |
|---|---|---|
dist/ | Bundled executable and type definitions | Required for execution |
README.md | User documentation | Shown on NPM page |
LICENSE.md | License terms | Legal compliance |
package.json | Package metadata | Always included automatically |
Sources: package.json30-34
The scripts field defines development and release commands used locally and in CI/CD pipelines:
| Script | Command | Purpose |
|---|---|---|
build | tsdown | Compile TypeScript to executable bundle |
test | vitest --run | Run test suite in CI mode |
lint:ts | tsc | Type-check TypeScript |
lint:js | eslint . | Lint JavaScript/TypeScript files using neostandard |
lint:js:fix | npm run lint:js -- --fix | Auto-fix linting issues |
lint:all | npm run lint:ts && npm run lint:js | Run all linting checks |
release | commit-and-tag-version | Create new versioned release and changelog |
Sources: package.json38-46
The package defines development-time dependencies that are not included in the distributed package:
Diagram: Development Dependencies and Their Roles in Build Pipeline
Sources: package.json47-56
The pnpm.overrides section implements a strategy to replace standard polyfills with lighter alternatives from the @nolyfill project. This reduces the final bundle size and dependency tree complexity.
| Original Package | Override |
|---|---|
array-includes | npm:@nolyfill/array-includes@^1 |
array.prototype.findlast | npm:@nolyfill/array.prototype.findlast@^1 |
array.prototype.flat | npm:@nolyfill/array.prototype.flat@^1 |
array.prototype.flatmap | npm:@nolyfill/array.prototype.flatmap@^1 |
array.prototype.tosorted | npm:@nolyfill/array.prototype.tosorted@^1 |
es-iterator-helpers | npm:@nolyfill/es-iterator-helpers@^1 |
hasown | npm:@nolyfill/hasown@^1 |
is-core-module | npm:@nolyfill/is-core-module@^1 |
isarray | npm:@nolyfill/isarray@^1 |
object-keys | npm:@nolyfill/object-keys@^1 |
object.assign | npm:@nolyfill/object.assign@^1 |
object.entries | npm:@nolyfill/object.entries@^1 |
object.fromentries | npm:@nolyfill/object.fromentries@^1 |
object.values | npm:@nolyfill/object.values@^1 |
safe-buffer | npm:@nolyfill/safe-buffer@^1 |
string.prototype.matchall | npm:@nolyfill/string.prototype.matchall@^1 |
string.prototype.repeat | npm:@nolyfill/string.prototype.repeat@^1 |
typedarray | npm:@nolyfill/typedarray@^1 |
Sources: package.json57-78
The package.json file serves as the central configuration hub for the git-merged-branches package, defining its identity as an ES module package.json3 providing binary entry points package.json26-29 and specifying a strict Node.js engine requirement package.json36 It also manages the build and test lifecycle through scripts package.json38-46 and optimizes the dependency graph using pnpm overrides package.json57-78
Sources: package.json1-79