Contributors

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.

Keep the feedback loop short. For most changes, type-check and run the relevant tests while you work, then run the full test and build commands before considering the change complete.

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

1 · Editsrc/

Make the smallest change in the subsystem that owns the behavior.

2 · Checknpm run typechecknpm test

Catch type and behavioral regressions while the change is still small.

3 · Buildnpm run build

Verify the distributable bundles and declaration output still build.

Development commands

Use the repository scripts for type checking, testing, builds, documentation, and local experiments.

CommandUse it forWhat it checks or produces
npm run typecheckFast correctness check while editingRuns TypeScript without emitting files.
npx tscDirect TypeScript compiler workflowRuns the TypeScript compiler directly.
npm testBehavior and regression coverageRuns the Jest suite.
npm run build:modulesRefresh package API modulesRebuilds the generated module output used by the public package subpath imports.
npm run buildRelease-facing build validationBuilds the JavaScript bundle artifacts and TypeScript declarations.
npm run devScratch-driven developmentRuns tools/dev.ts through the development watcher.
npm run lintStatic code checksRuns 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

Code conventions

Implementation patterns for reuse, types, parser entities, return flow, constants, access modifiers, files, and regression tests.

Code conventions

Before 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
Nerdamer repository

The repository is the source for current code, commands, package entry points, and contributor documentation.

github.com/jiggzson/nerdamer
Need the code map first?

The Codebase Map shows how the major source areas relate before you decide where to edit.

Codebase map