.ai/STACK.md
Primary:
handsontable/src/), all source files are .tshandsontable/src/**/*.scss, handsontable/styles/)Secondary:
wrappers/react-wrapper/src/, wrappers/angular-wrapper/, wrappers/vue3/src/)handsontable/src/3rdparty/walkontable/), excluded from the main tsconfig.json (has its own separate build/test pipeline)handsontable/test/E2ERunner.html, handsontable/src/3rdparty/walkontable/test/SpecRunner.html)Important: Type declarations are auto-generated by tsc --emitDeclarationOnly (build:types task in scripts/tasks.json, uses tsconfig.build-types.json) and output directly to handsontable/tmp/*.d.ts. Do not hand-edit them. tsconfig.json uses strict: false, noImplicitAny: true. Walkontable (src/3rdparty/walkontable/) is also TypeScript, with its own separate build/test pipeline. Central shared types live in src/core/settings.ts (GridSettings, Events, HookKey) and src/core/types.ts (HotInstance).
Environment:
.nvmrc)Package Manager:
package.json packageManager field)corepack enable && corepack prepare [email protected] --activatepnpm-lock.yaml presentpnpm-workspace.yamlCore:
handsontable/src/3rdparty/walkontable/src/)Framework Wrappers:
wrappers/react-wrapper/ (@handsontable/react-wrapper)wrappers/angular-wrapper/ (@handsontable/angular-wrapper)wrappers/vue3/ (@handsontable/vue3)Testing:
handsontable/jest.config.js, *.unit.js files, jsdom environment, jest-jasmine2 runner)*.spec.js files, run via Puppeteer)visual-tests/)@testing-library/react 14 - React wrapper tests@vue/test-utils 2.0.0-rc.16 - Vue 3 wrapper testsjest-preset-angular 14 - Angular wrapper tests (requires NODE_OPTIONS=--openssl-legacy-provider)Build/Dev:
@rspack/core, @rspack/cli) - Core library bundling (handsontable/rspack.config.js + handsontable/.config/). Migrated from Webpack 5; the .config/ folder name is kept for historical reasons.@swc/core, @swc/helpers) - TypeScript/JavaScript transpilation for all builds: Rspack uses builtin:swc-loader with separate rules for .js (ecmascript) and .ts/.tsx (typescript), and file-per-file transpilation runs through handsontable/scripts/swc-transpile.mjs which handles .ts/.tsx in addition to .js (used by build:commonjs, build:es, build:languages.es)babel-jest (see handsontable/babel.config.js); no longer used for production or test bundlesbuild:types script using tsconfig.build-types.json), 5.1.6 (Angular), 4.x (Vue 3)Critical (runtime):
Intl.NumberFormat API. HTML sanitization is user-provided via the sanitizer option.User-supplied (bring your own):
hyperformula ^3.0.0 - Spreadsheet formula engine (devDependency for tests only; users must install it themselves to use the Formulas plugin)Angular wrapper runtime:
rxjs ^7.8.1 - Reactive extensions for Angulartslib ^2.3.0 - TypeScript runtime helperszone.js ~0.13.0 - Angular change detectionBuild tooling (key devDependencies):
eslint ^8.57.1 (core) / 8 (wrappers) - Linting with Airbnb base configeslint-plugin-handsontable - Custom ESLint rules (handsontable/.config/plugin/eslint/)eslint-plugin-compat - Browser API compatibility enforcementstylelint 16 - CSS/SCSS lintingenv-cmd 9 - Injects environment variables from hot.config.js during buildcross-env 7 - Cross-platform environment variable settingrspack.CssExtractRspackPlugin - CSS extraction from Rspack bundles (drop-in replacement for the former mini-css-extract-plugin)rspack.LightningCssMinimizerRspackPlugin - CSS minification via Lightning CSS (replaces the former css-minimizer-webpack-plugin)Environment:
hot.config.js (root): HOT_FILENAME, HOT_VERSION, HOT_PACKAGE_NAME, HOT_BUILD_DATE, HOT_RELEASE_DATEenv-cmd -f ../hot.config.js in all build/test scripts.env files in the repository (air-gapped environment support)Rspack configs (handsontable/.config/): (folder name predates the Webpack→Rspack migration)
base.js - Base configuration (UMD output, library name Handsontable, builtin:swc-loader for JS/TS with separate rules for .js ecmascript and .ts/.tsx typescript)development.js / production.js - Dev and production UMD build configswatch.js - Dev watcher config (used by npm run watch)styles-development.js / styles-production.js - CSS build configsthemes-css-development.js / themes-css-production.js - Theme CSS buildsthemes-umd-development.js / themes-umd-production.js - Theme UMD buildslanguages-development.js / languages-production.js - i18n language pack buildswalkontable.js - Walkontable standalone buildtest-e2e.js / test-e2e-esm-cjs.js / test-mobile.js / test-production.js / test-walkontable.js - Test bundle configs (consumed by test:*.dump scripts)loader/forbidden-imports-loader.js - Custom Rspack loader that replaces the former babel-plugin-forbidden-imports (enforces the E2E allow-list in test-e2e.js)plugin/eslint/ - In-repo ESLint plugin (eslint-plugin-handsontable), linked via file:.config/plugin/eslintBabel environments (handsontable/babel.config.js):
commonjs - used by Jest unit tests via babel-jest (@babel/plugin-transform-runtime + @babel/plugin-transform-modules-commonjs). Every other former env (commonjs_dist, es, es_languages, commonjs_e2e) was removed when Babel was swapped out for SWC; the babel.config.js header comment states this explicitly.BABEL_ENV=commonjs / BABEL_ENV=commonjs_e2e still appear in several package.json scripts that invoke rspack. Those assignments are effectively dead — Rspack uses builtin:swc-loader and ignores BABEL_ENV. They are kept to avoid churn in scripts but do not select a Babel environment.SWC pipeline (replaces Babel for everything except Jest):
rspack.config.js + .config/*) - JS/TS transpiled by builtin:swc-loader using targets from browser-targets.jshandsontable/scripts/swc-transpile.mjs - File-per-file transpiler driven by @swc/core; produces the tmp/ output consumed by wrappers. Handles .ts/.tsx in addition to .js. Covers CJS (build:commonjs), ESM (build:es, .mjs output), and i18n language packs with auto-registration (build:languages.es --lang-registration)handsontable/scripts/run.mjs - Unified dispatcher for all npm run scripts; reads task definitions and pipeline graphs from handsontable/scripts/tasks.json; runs tasks quietly with spinner on TTY, supports --parallel (DAG scheduler) and --sequential modeshandsontable/scripts/tasks.json - Single source of truth for all build/lint/test task commands, their deps, mode, and cwd; also defines named pipelines (ordered step sequences). Edit this file to add, remove, or change any build/lint/test step — do not add raw shell commands to package.json scripts for the core packageLinting:
.eslintrc.js (root) - Monorepo-level ESLint confighandsontable/.eslintrc.js - Core-specific ESLint with custom ruleshandsontable/.config/plugin/eslint/ with rules:
no-native-error-throw - Must use throwWithCause() from src/helpers/errors.tsrestricted-module-imports - No imports from barrel index filesrequire-async-in-it - it() callbacks in spec files must be asyncrequire-await - Specific HOT API calls must be await-edTesting:
handsontable/jest.config.js - Jest config (jsdom environment, jest-jasmine2 runner, *.unit.js pattern)handsontable -> src/, walkontable -> src/3rdparty/walkontable/src/handsontable/test/__mocks__/styleMock.js| Output | Path | Format |
|---|---|---|
| UMD bundles | handsontable/dist/handsontable.js, handsontable/dist/handsontable.full.js | UMD |
| Minified bundles | handsontable/dist/handsontable.min.js, handsontable/dist/handsontable.full.min.js | UMD (minified) |
| CommonJS modules | handsontable/tmp/*.js | CJS |
| ES modules | handsontable/tmp/*.mjs | ESM |
| Compiled CSS | handsontable/styles/ | CSS |
| Language packs | handsontable/dist/languages/, handsontable/languages/ | UMD + ESM |
| Theme bundles | handsontable/dist/themes/ | UMD + CSS |
Two build variants:
handsontable.js - Base build, external dependencies not bundledhandsontable.full.js - Includes HyperFormula bundled inWrappers consume tmp/ output via pnpm workspace linking ("handsontable": "workspace:^" override in root package.json).
ht-theme-main - Default modern themeht-theme-classic - Legacy Handsontable themeht-theme-horizon - Alternative design theme-no-icons variantDevelopment:
.nvmrc)Production (browser targets):
eslint-plugin-compatCDN distribution:
dist/handsontable.full.min.jsdist/handsontable.full.min.jsPlatform: GitHub Actions (.github/workflows/)
Key workflows:
test.yml - Main test pipeline (unit, E2E, Walkontable, wrapper tests)build-all.yml - Full build verificationcode-quality.yml - Linting and code quality checkslinter.yml - ESLint checkspublish.yml - Package publishing pipeline to npmdocs-staging.yml / docs-production.yml - Documentation deployment (Netlify)docs-visual-tests.yml - Visual regression testing for docschangelog.yml - Changelog verificationaudit.yml - Security auditpkg-pr-new.yml - PR package preview