@skedulo/react-devtools-core-stub
v1.0.0
Published
No-op stand-in for react-devtools-core, aliased into ink via yarn resolutions to keep ~17MB of devtools bundles out of the Skedulo CLI installers
Maintainers
Keywords
Readme
@skedulo/react-devtools-core-stub
A no-op stand-in for react-devtools-core.
Why this exists
[email protected] declares react-devtools-core as a regular dependency, but only loads it from
build/devtools.js, behind a process.env.DEV === "true" check in build/reconciler.js. It
therefore never runs during a normal sked interactive, sked logs, or sked http session — yet
every install pays for it. The package is roughly 17MB on disk, almost all of it bundled
.js.map sourcemaps, and it ships inside the macOS, Windows, and Linux standalone installers.
Ink's dependency is aliased to this package with a resolutions entry:
"resolutions": {
"react-devtools-core": "npm:@skedulo/[email protected]"
}The entry has to be declared in two manifests, and both are load-bearing:
- the repo root
package.json, which covers the development workspace plugins/cli/package.json, which covers the standalone installers —oclif packnpm-packs that directory and runsyarn --productionwith the packed copy as the project root, so a root-levelresolutionsblock is invisible to it
The pinned version has to match this package's version field, and nothing enforces that from
inside this package. Bumping the version here without updating both manifests is the quiet failure:
the alias still resolves the last published version, yarn install succeeds, and the installers
ship a stale stub. Updating the manifests first is the loud one — the alias points at a version that
is not on the registry yet, so yarn install fails until it is published.
connectToDevTools is the only symbol ink calls. It is a no-op here rather than absent, so running
with DEV=true degrades to "devtools do not connect" instead of crashing.
Why there is no build or lint step
Every other package in this repo compiles TypeScript from src/ and runs eslint. This one
deliberately does neither: its whole purpose is to be a few hundred bytes inside every installer,
and three lines of plain CommonJS do not need a dist/, a tsconfig, a turbo build edge, or a
lint config. index.d.ts is hand-written and covers the type story. test/tsconfig.json is test-
harness plumbing the shared mocha config requires at registration time, not a build step — nothing
here ever gets compiled.
What this does not cover
resolutions are ignored when a package is installed as a dependency rather than as the project
root, so yarn global add @skedulo/cli still pulls the real react-devtools-core. Closing that gap
needs either a republished ink fork or an upgrade to ink 4 or later, which moves
react-devtools-core out of dependencies and into an optional peerDependency — the same shape
this stub fakes, done upstream.
That upgrade is also what retires this package. It exists only because ink 3 declares the dependency
outright: once ink resolves react-devtools-core as an optional peer, delete this directory along
with both resolutions entries. Nothing else in the repo depends on it.
Only the package's main entry point is stubbed. The real package also ships standalone.js, the
devtools frontend, so require("react-devtools-core/standalone") resolves to nothing here. Ink
never reaches for it and neither does anything in this repo.
Verifying it still works
With both resolutions entries in place:
yarn install
du -sh node_modules/react-devtools-core # expect ~8K, not ~17M
node -p "require('react-devtools-core').connectToDevTools.name" # expect "noop"The name is noop, not connectToDevTools: every export is bound to the same shared no-op, so
noop is the signal that the alias took effect. Without it the command prints no name at all —
requiring the real package under plain Node throws ReferenceError: self is not defined, because
its entry point is a browser bundle.
