solidjs/solid
Tooling
Active contributors: Ryan Carniato, Damian Tarnawski
A reference card for the build, test, and release toolchain used in this repository.
Package manager
pnpm 9.x — pinned via "packageManager": "pnpm@9.15.0" and the engines field in package.json. The root preinstall script runs npx only-allow pnpm so npm install and yarn will refuse to run. Use corepack enable (Node ≥ 16.10) to install the right pnpm version automatically.
Workspace orchestration
Turborepo — turbo.json defines the build pipeline. Key tasks:
| Task | Defined for | Notes |
|---|---|---|
build |
every package | dependsOn: ["^build"] so dependencies build first |
solid-js#build |
packages/solid |
outputs: ["dist/**", "**/dist/**"] (every entry-point's dist) |
solid-js#types |
packages/solid |
Generates .d.ts files into types/, web/types/, store/types/, etc. |
solid-js#link |
packages/solid |
Creates node_modules/solid-js symlink so other workspace packages can import "solid-js" during build |
solid-element#build |
packages/solid-element |
Depends on solid-js#types and solid-js#link |
test, coverage, test-types |
per package | Each package's package.json defines the script |
Turbo caches outputs in node_modules/.cache/turbo. Re-running pnpm build after no source changes is near-instant.
Bundler
Rollup 4 — single config at packages/solid/rollup.config.js. It produces 16 bundles, one per (entry × flavor) pair. The plugins, in order:
@rollup/plugin-node-resolve(.js,.tsextensions).@rollup/plugin-babel:babelrc: falsepresets: ["@babel/preset-typescript"]plugins: [["babel-plugin-transform-rename-import", { original: "rxcore", replacement: <web/src/core absolute path> }]]
rollup-plugin-cleanupto strip non-essential comments while preserving/*#__PURE__*/annotations.@rollup/plugin-replacefor the_SOLID_DEV_and_DX_DEV_flag substitution.
The babel-plugin-transform-rename-import step is what makes rxcore resolve to a real path. Different builds (browser DOM vs SSR vs custom universal) point rxcore at different files via the rollup config — see packages/solid/web/src/core.ts for the browser core and packages/solid/web/src/server-mock.ts for the browser-condition SSR shim.
The solid-element package uses tsc directly (packages/solid-element/package.json's build script is pnpm run clean && tsc) since it is a small TypeScript module without bundle complexity.
The solid-ssr package builds examples with rollup but does not itself need bundling — it only ships static/index.{js,cjs} which are committed source.
TypeScript
tsconfig.json at the root sets the baseline. Each entry point has its own tsconfig.build.json that extends it and narrows the input set so tsc only emits the right .d.ts files for that entry. Examples:
packages/solid/tsconfig.build.json→types/packages/solid/web/tsconfig.build.json→web/types/packages/solid/store/tsconfig.build.json→store/types/packages/solid/web/storage/tsconfig.build.json→web/storage/types/
Test types live in packages/solid/tsconfig.test.json, which extends the root tsconfig and adds test/*.type-tests.ts to its include list.
Test runner
Vitest 2 — config in packages/solid/vite.config.mjs. Notable:
environment: "jsdom"for DOM tests.threads: false,isolate: falseto keep all tests in one worker.transformMode: { web: [/\.[jt]sx?$/] }so JSX/TSX files are processed throughvite-plugin-solid.- The
resolve.aliasblock mapssolid-js,solid-js/web,solid-js/jsx-runtime, andrxcoreto source.
@vitest/coverage-v8 is the coverage provider. Coverage thresholds are not enforced — the CI uploads lcov.info to Coveralls but does not fail on regressions.
Compiler
Babel with babel-preset-solid for tests:
packages/solid/babel.config.cjsconfigures the test environment to use@babel/preset-env(Node target),@babel/preset-typescript, andbabel-plugin-jsx-dom-expressionspointed at the localweb/src/indexmodule. This is what the integration suite uses when it doesn't want to go through Vite.packages/test-integration/babel.config.cjssimilarly configures Babel for thetest-imports.mjssmoke check.
The published babel-preset-solid is packages/babel-preset-solid/index.js (35 lines). It hands babel-plugin-jsx-dom-expressions a default options object — see babel-preset-solid for the full breakdown.
Formatter
Prettier 3 — config in .prettierrc. The pre-commit hook runs pnpm run format (prettier --write --cache "**/*.[tj]s?(x)"). There is no separate ESLint config.
Code generation
The build copies handwritten JSX type definitions out of the dom-expressions package because Solid's runtime uses them but does not own them:
"types:copy": "ncp ../../node_modules/dom-expressions/src/jsx.d.ts ./src/jsx.d.ts && ...",
"types:copy-web": "ncp ../../node_modules/dom-expressions/src/client.d.ts ./web/types/client.d.ts && ..."ncp is the simple node copy helper. If you bump dom-expressions and the JSX surface changes, the types:copy* scripts will overwrite Solid's local jsx.d.ts with the new one. Re-run pnpm types to refresh.
Versioning and publishing
@changesets/cli — pnpm bump writes a markdown file under .changeset/. pnpm release:only runs changeset publish, which versions every package whose changeset bucket has pending entries and publishes to npm.
.changeset/config.json controls which packages are bumped together (typically solid-js and babel-preset-solid are pinned to the same version, e.g. both at 1.9.12).
CI
.github/workflows/main-ci.yml runs on every PR and on push to main:
pnpm install
pnpm run build
pnpm run test
pnpm run coverage
coverallsapp/github-action # uploads packages/solid/coverage/lcov.info
actions/upload-artifact # uploads dist/ + types/There is exactly one workflow file in .github/workflows/. There is no release workflow — releases are cut from a maintainer's machine.
Editor config
.editorconfig sets the indentation, line-ending, and final-newline rules. .gitignore excludes node_modules/, dist/, types/ (the generated ones), and a few test artifacts. .gitpod.yml exists as a one-click cloud dev environment but is not part of the CI loop.
Quick command index
| Command | What it does |
|---|---|
pnpm install |
Install workspace deps; runs simple-git-hooks postinstall |
pnpm build |
turbo run build across all packages |
pnpm test |
turbo run test test-types |
pnpm coverage |
turbo run coverage |
pnpm format |
Prettier across the repo |
pnpm bump |
Add a changeset |
pnpm publish |
Build → types → changeset publish |
pnpm --filter solid-js test |
Just the core test suite |
pnpm --filter solid-js bench |
Standalone benchmarks under packages/solid/bench/ |
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.