Development for RF Touchstone
Setup Node.js environment
Download and install Node.js from the official website
Check the current version of Node.js
node -vEnable corepack
This is a one-time setup per computer. It activates the built-in managers so you don't need to use npm install -g yarn anymore.
corepack enableInstall newest version of yarn
yarn set version stableCheck the current version of yarn
yarn -vInstall packages
yarn installUpgrade packages (Optional/Maintenance)
yarn upgrade-interactiveSetup Python environment
Create and Use Virtual Environments
Install uv
uv is a fast Python package installer and virtual environment manager. You can install uv by running the following command:
# On macOS and Linux
curl -LsSf https://astral.sh/uv/install.sh | sh# On Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Add the uv executable to your system's PATH (Linux)
Source the appropriate environment file for your shell:
# On Bash, Zsh, or Sh:
source $HOME/.local/bin/env
# On Fish:
source $HOME/.local/bin/env.fishYou may need to restart your shell or open a new terminal session for the changes to take effect.
Check uv version
uv --versionCreate and Use Virtual Environments with uv
Create a new virtual environment:
uv venv .venvActivate the virtual environment
# On Windows:
.venv\Scripts\activate
# On MacOS/Linux:
source .venv/bin/activateTo confirm the virtual environment is activated, check the location of your Python interpreter:
# On Windows:
where python
# On MacOS/Linux:
which pythonCheck python version
python --versionInstall packages using uv
Install packages using a requirements file:
uv pip install -r requirements.txtCheck packages available for update
uv pip list --outdatedUpgrade packages
uv pip install -r requirements.txt --upgradeDeactivate a virtual environment
# On Windows:
.venv\Scripts\deactivate
# On MacOS/Linux:
deactivateDevelopment
Lint with ESLint
yarn lintFormat with Prettier
yarn formatUnit test with Vitest
Comparative Testing with scikit-rf
Our comprehensive test suite includes comparative tests that validate our library's results against scikit-rf. This ensures our parsing, unit scaling, and matrix manipulation logic remains consistent with industry-standard tools. To run these tests, you must have the Python environment correctly configured.
Interactive development
Runs the tests in interactive watch mode:
yarn test:watchCommand line
yarn test:unitCheck test coverage
yarn test:coverageAll tests
Convenient command includes: lint, format, unit:test, test:coverage, build, and generate API docs
yarn testCompile, build and minify for production
yarn buildDocumentation (using VitePress and TypeDoc)
Generate API documentation from TSDoc comments
This command uses TypeDoc to parse TSDoc comments in the TypeScript source files and generates markdown files in the docs/api directory.
yarn docs:mdStart local development server for documentation
This command starts the VitePress development server. You can view your documentation site locally, usually at http://localhost:5173.
yarn docs:devBuild documentation for deployment
This command builds the static HTML, CSS, and JavaScript files for the documentation site. The output will be in the docs/.vitepress/dist directory.
yarn docs:buildPreview the built documentation locally
After building the documentation, this command allows you to preview the production build locally before deploying it.
yarn docs:preview