Implementation:21st dev Magic mcp Package Lock
| Knowledge Sources | |
|---|---|
| Domains | Build, Configuration |
| Last Updated | 2026-10-19 16:40 GMT |
Overview
Concrete lockfile pinning the transitive dependency tree of `@21st-dev/magic` for reproducible installs, provided by npm.
Description
The package-lock.json file is npm's lockfileVersion 3 manifest for the `@21st-dev/magic@0.2.3` package. It records the exact resolved version, integrity hash, and license of every package that the project's declared dependencies transitively require, so that `npm ci` installs a byte-identical `node_modules` tree across machines and CI runs.
Notably, the lockfile pins only devDependencies (`@types/node@22.13.4`, `shx@0.3.4`, `typescript@5.8.2`) and their transitive sub-deps (e.g. `balanced-match`, `brace-expansion`, `concat-map`, `fs.realpath`, `undici-types`). The package declares no runtime dependencies, so the lockfile's small size (315 lines) is a direct artifact of the zero-runtime-dependency design that keeps the stdio proxy tiny and portable. The root entry also records the `magic` bin (`dist/index.js`), the `node >= 18.0.0` engine constraint, and the `ISC` license.
Usage
Consult this file when:
- Reproducing a build — run `npm ci` to install the exact pinned dev toolchain before `npm run build`.
- Auditing a dependency — find the resolved version and integrity hash of any pinned package, including transitive dev-only sub-deps.
- Verifying the zero-runtime-dependency claim — confirm that no `node_modules/<pkg>` entry is a runtime dependency (all are marked `"dev": true`).
- Updating the toolchain — edit `package.json` devDependencies, then regenerate this lockfile with `npm install` to capture new resolved versions and integrity hashes.
Code Reference
Source Location
- Repository: magic-mcp
- File: package-lock.json
- Lines: L1-315
Signature
{
"name": "@21st-dev/magic",
"version": "0.2.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@21st-dev/magic",
"version": "0.2.3",
"license": "ISC",
"bin": { "magic": "dist/index.js" },
"devDependencies": {
"@types/node": "^22.13.4",
"shx": "^0.3.4",
"typescript": "^5.8.2"
},
"engines": { "node": ">=18.0.0" }
},
"node_modules/@types/node": {
"version": "22.13.4",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.4.tgz",
"integrity": "sha512-...",
"dev": true,
"license": "MIT"
}
/* ... remaining pinned packages ... */
}
}
Import
# No import — this is a declarative data file consumed by the npm CLI.
# Install the pinned tree exactly:
npm ci
# Or regenerate after changing package.json devDependencies:
npm install
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| package.json | JSON manifest | Yes (sibling file) | Declares the devDependencies whose ranges this lockfile pins |
| npm registry | HTTP | Yes | Source of the `resolved` URLs and `integrity` hashes recorded for each package |
| lockfileVersion | number (3) | Yes | Schema version this file is written in; npm must support it |
Outputs
| Name | Type | Description |
|---|---|---|
| node_modules/ | directory tree | The exact, reproducible module tree produced by `npm ci` |
| resolved version | string | The pinned version of each package (e.g. `22.13.4`) |
| integrity hash | string (sha512) | Subresource integrity hash used to verify each tarball on install |
| dev flag | boolean | `true` on every pinned package, confirming dev-only status (no runtime deps) |
Usage Examples
Reproducible CI build
# 1. Install the exact pinned dev toolchain (fails if lockfile is out of sync)
npm ci
# 2. Build the TypeScript proxy
npm run build # runs: tsc && shx chmod +x dist/*.js
# 3. Run the compiled proxy
npm start # runs: node dist/index.js
Auditing a pinned dependency
# Find the resolved version and integrity hash of a transitive dep
npm ls --package-lock-only
# or inspect package-lock.json directly:
jq '.packages."node_modules/balanced-match" | {version, integrity, dev}' package-lock.json
# {"version": "1.0.2", "integrity": "sha512-...", "dev": true}
Confirming zero runtime dependencies
# Every entry should report "dev": true — confirming no runtime deps
jq '.packages | to_entries | map(select(.key | startswith("node_modules/"))) | map({pkg: .key, dev: .value.dev}) | map(select(.dev != true))' package-lock.json
# [] ← empty means all are dev-only; no runtime dependencies
Related Pages
Implements Principle
Requires Environment
Notes
- Companion to the Implementation:21st_dev_Magic_mcp_resolveApiKey and Implementation:21st_dev_Magic_mcp_forward pages, which document the code this lockfile helps build.
- The lockfile's small size is itself evidence of the zero-runtime-dependency design documented in `package.json`.