Developing Nerdamer
This is the practical path from cloning the repository to making and validating a change. The Nerdamer repository and its main development line are the source for current commands, file locations, and contributor guidance.
Set up the repository
git clone https://github.com/jiggzson/nerdamer.git
cd nerdamer
npm install
The source is TypeScript. The build produces JavaScript bundle artifacts and generated TypeScript declarations for consumers.
The normal contributor loop
src/Make the smallest change in the subsystem that owns the behavior.
npm run typechecknpm testCatch type and behavioral regressions while the change is still small.
npm run buildVerify the distributable bundles and declaration output still build.
Development commands
Use the repository scripts for type checking, testing, builds, documentation, and local experiments.
| Command | Use it for | What it checks or produces |
|---|---|---|
| npm run typecheck | Fast correctness check while editing | Runs TypeScript without emitting files. |
| npx tsc | Direct TypeScript compiler workflow | Runs the TypeScript compiler directly. |
| npm test | Behavior and regression coverage | Runs the Jest suite. |
| npm run build:modules | Refresh package API modules | Rebuilds the generated module output used by the public package subpath imports. |
| npm run build | Release-facing build validation | Builds the JavaScript bundle artifacts and TypeScript declarations. |
| npm run dev | Scratch-driven development | Runs tools/dev.ts through the development watcher. |
| npm run lint | Static code checks | Runs ESLint over the TypeScript source. |
Use the development scratch file
tools/dev.ts is available for experiments, debugging, and quick local checks.
import nerdamer from '../src';
console.log(nerdamer('factor(x^4-1)').text());
If tools/dev.ts imports through one of the public API package paths, such as nerdamer/core, nerdamer/calculus, or nerdamer/structures, refresh the generated module output after changing the source:
npm run build:modules
Those package paths resolve through the generated module output, so without rebuilding them the scratch file can execute stale code.
Run the development watcher with:
npm run dev
Where should the change go?
src/core
Parser behavior, symbolic representation, shared operations, converters, settings, rationals, matrices, vectors, and common infrastructure.
src/algebra
Factoring, simplification, polynomial work, GCD/LCM, partial fractions, and related algebra algorithms.
src/calculus
Differentiation, integration, limits, sums/products, and transforms.
src/solve
Single-equation, polynomial, function, and multivariate/system solving.
src/math
Mathematical functions and lower-level numerical/symbolic helpers used by the higher layers.
spec
Targeted behavior specs and regression coverage. Add a reproducer here when a bug fix needs permanent protection.
Read the code conventions
Implementation patterns for reuse, types, parser entities, return flow, constants, access modifiers, files, and regression tests.
Code conventionsBefore you finish
A change that works in one scratch example is not enough. Check the surrounding subsystem, add a targeted regression when fixing a bug, and run the full validation commands before handing the change off.
npm run typecheck
npm test
npm run build
The repository is the source for current code, commands, package entry points, and contributor documentation.
github.com/jiggzson/nerdamerThe Codebase Map shows how the major source areas relate before you decide where to edit.
Codebase map