Thanks for your interest in contributing! This guide explains how to set up your environment, run the project, add tests, and open pull requests.
If anything is unclear, please open a discussion or issue—we’re happy to help.
Please be respectful and keep a positive, collaborative tone. The following behaviors will not be tolerated:
- Offensive or disrespectful comments
- Spam or unauthorized advertising
- Non-constructive or destabilizing behavior
If you experience or witness unacceptable behavior, please contact us at smarkform@bitifet.net.
- Report bugs and propose enhancements via GitHub Issues
- Improve documentation and examples
- Add or improve tests
- Implement features or fixes (preferably after an issue/discussion)
Prerequisites:
- Node.js 18+ recommended
- Git
- Fork and clone (recommended workflow)
- On GitHub: click "Fork" on the repository page to create a copy under your account.
- Then clone your fork (replace <your_github_user> with your GitHub username):
git clone https://github.com/<your_github_user>/SmarkForm.git
cd SmarkForm
# origin now points to your fork (you can push to origin)
# Add the original repo as an upstream remote to stay in sync:
git remote add upstream https://github.com/bitifet/SmarkForm.git- Install dependencies
npm install- Install Playwright browsers
npx playwright install- Install system deps (Linux) to run browsers, if needed
# Linux-only (or when Playwright warns about missing packages)
sudo npx playwright install-depsTip: If Playwright prints a “Host system is missing dependencies to run browsers” banner, run the command it suggests (usually sudo npx playwright install-deps). On Debian/Ubuntu you may also need packages like libavif.
- Build the library (ESM and UMD bundles)
npm run buildOutputs:
-
dist/SmarkForm.esm.js (ESM)
-
dist/SmarkForm.umd.js (UMD)
-
Source maps are generated for both.
-
Develop with live rebuild and a simple HTTP server
npm run devThis:
- Builds ESM and UMD into dist
- Generates sourcemaps
- Watches files and rebuilds on change
- Serves a local site so you can open examples quickly
- Automatically stops any previously running instance before starting — so switching branches or worktrees and running
npm run devagain is safe: the old server is always cleanly terminated first
Stop it at any time with Ctrl+C in the terminal where it was started.
The test suite validates the library and also smoke-tests documentation examples.
- Full suite (build + collect docs examples + run Playwright):
npm test- Run Playwright directly (assumes build + collector already ran):
npx playwright test- Run a single browser (project):
npx playwright test --project=chromium- Filter tests by title (regex):
npx playwright test -g "some test title"- Reduce workers (useful on low-resource environments):
npx playwright test --workers=1- Headed/debug mode:
npm run test:headed
# or
npx playwright test --debug
# or
PWDEBUG=1 npx playwright test- View HTML report after a run:
npx playwright show-reportIf you see “Failed to load examples manifest” or an empty manifest, run:
node scripts/collect-docs-examples.jsFor more details about tests, see:
The documentation (docs/) is built with Jekyll and Just the Docs, and published via GitHub Pages.
Local build:
- Install Jekyll prerequisites (see official docs)
- Install bundler and gems via the script below
- Run the docs site
npm run docThen open http://localhost:4000 (or http://:4000).
More details are in docs/README.md.
- src/ Library source
- dist/ Build outputs (ESM/UMD)
- docs/ Documentation site (Jekyll / Just the Docs)
- test/ Playwright test suite and helpers
- scripts/ Build, docs, and test orchestration scripts
The project uses vim-style fold markers ({{{ / }}}) throughout source code
and documentation to keep large files navigable.
In JavaScript source files (src/), functions and logical blocks are
folded inline:
export function myHelper(arg) {//{{{
// implementation
};//}}}In documentation Markdown files (docs/), each {% capture %} block is
wrapped in markers embedded in HTML comments inside {% raw %} tags (so Jekyll
ignores them):
{% raw %} <!-- capture_name {{{ --> {% endraw %}
{% capture capture_name %}
...content...
{% endcapture %}{% raw %} <!-- }}} --> {% endraw %}With foldmethod=marker active (vim/neovim), each block collapses to a single
labelled line, making large documentation files easy to navigate.
Enabling fold markers in your editor:
- Vim/Neovim (native):
set foldmethod=marker— addautocmd FileType markdown setlocal foldmethod=markerto your vimrc. - VS Code: Install the Custom Folding extension.
- Emacs: configure
origami-modewith custom{{{/}}}markers.
Please preserve these markers when editing existing files and add them when creating new capture blocks. See AGENTS/Documentation-Guidelines.md for the full convention.
- For non-trivial changes, consider opening an issue/discussion first to align on the approach.
- Branch from the default branch (e.g., main) with a descriptive name:
- feature/list-reorder-keyboard
- fix/date-coercion-off-by-one
- docs/update-quick-start
- Keep commits focused and with clear messages. Conventional Commits are welcome but not required.
- Add or update tests:
- Unit/integration tests where applicable
- Documentation example tests when relevant (docs examples are auto-collected and validated)
- Ensure the project builds and tests pass locally:
npm run build npm test - In your PR description, link related issues (e.g., “Fixes #123”) and briefly explain what changed and why.
When filing an issue, please include:
- Steps to reproduce
- Expected vs. actual behavior
- Environment info (OS, browser, Node version)
- Minimal reproducible example if possible
If you find a security vulnerability, please email smarkform@bitifet.net. We will work with you to resolve the issue promptly.
- GitHub Discussions: https://github.com/bitifet/SmarkForm/discussions
- Contact: smarkform@bitifet.net
Thank you for contributing!