Skip to content

Commit 8a2f793

Browse files
committed
Merge develop (HF-65 in-repo dev docs cleanup) into docs/astro-migration
Brings in `00e5c730a` "Clean up in-repo dev docs (HF-65) (#1682)" which adds root-level `DEV_DOCS.md`, `AGENTS.md`, `.cursor/rules/main.mdc`, and re-points root `CLAUDE.md` / `CONTRIBUTING.md` as symlinks. Those files live at the repo root and govern library development, separate from the docs-site governance files this PR adds under `docs/` (`docs/CLAUDE.md`, `docs/AGENTS.md`, `docs/README-EDITING.md`, `docs/README-DEPLOYMENT.md`). Git's rename detection auto-applied develop's edits to `docs/guide/building.md` to the migrated location at `docs/src/content/docs/guide/building.md` — no conflicts.
2 parents 44028e7 + 00e5c73 commit 8a2f793

6 files changed

Lines changed: 161 additions & 169 deletions

File tree

.cursor/rules/main.mdc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
description: Project-wide guidance for AI agents working in this repository
3+
alwaysApply: true
4+
---
5+
6+
All guidance for AI agents working in this repository lives in [AGENTS.md](mdc:AGENTS.md) at the repository root. Read it first.

AGENTS.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# AGENTS.md
2+
3+
Instructions for AI coding agents (Cursor, Claude Code, Codex, Aider, and any other AI tool) working in this repository.
4+
5+
## Start here
6+
7+
Whatever you do, start by reading entire [DEV_DOCS.md](DEV_DOCS.md). Only then proceed to your task.
8+
9+
## Other important resources
10+
11+
- the repository [README.md](README.md) — high-level project description and quick install/usage
12+
- the markdown files in [`docs/guide/`](docs/guide/) — user-facing guides (installation, configuration, built-in functions, custom functions, integrations, etc.)
13+
- the markdown files in [`docs/api/`](docs/api/) — API reference (generated from JSDoc; run `npm run docs:build` if the folder is missing)
14+
15+
Prefer reading these local files over fetching the rendered documentation from the web.
16+
17+
## Response style
18+
19+
- Be concise by default. Use as few words as possible unless the user asks for more detail.
20+
- When the user asks for specific content, lead the response with the requested information.
21+
- Structure answers with bullet lists, numbered lists, tables, or code blocks where useful.
22+
- Ask clarifying questions when the request is ambiguous rather than guessing.
23+
- If you do not know something, say so and ask for help.
24+
- When answering from project documentation, quote the exact relevant fragments to support your claim.
25+
26+
## Common ways agents fail
27+
28+
This section is maintained by the team. Whenever an AI agent makes a mistake worth flagging, an item is added here describing what the agent did wrong and what it should have done instead. Read this list before starting any non-trivial task.
29+
30+
<!-- Add new items to the top of the list. Use the format:
31+
- **Short title** &mdash; What the agent did wrong. What it should have done instead.
32+
-->
33+
34+
_No items yet._
35+
36+
## Skills, MCPs, and other agent tools
37+
38+
This section is maintained by the team. Skills, MCP servers, and other tools vetted as useful for AI agents working on this codebase are listed here.
39+
40+
<!-- Add new items here. Use the format:
41+
- **Name** &mdash; What it provides and when to use it.
42+
-->
43+
44+
_No items yet._

CLAUDE.md

Lines changed: 0 additions & 95 deletions
This file was deleted.

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md

CONTRIBUTING.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs/guide/contributing.md

DEV_DOCS.md

Lines changed: 94 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,104 @@
1-
# Dev Docs
1+
# Developer documentation
22

3-
Random notes and things to know useful for maintainers and contributors.
3+
Canonical reference for everyone working on the HyperFormula source code: maintainers, the internal team, and AI agents triggered by them. Everything a developer needs to know lives here or is linked from here.
44

5-
## Definition of Done for the code changes
5+
## Quick links
66

7-
Each change to the production code (bugfixes, new features, improvements) must include these elements. They must be present in the pull request BEFORE requesting the code review.
7+
- **[Building, testing, and linting](docs/guide/building.md)** &mdash; all `npm` commands and build outputs
8+
- **[Test suite](test/README.md)** &mdash; smoke tests and how to attach the private test suite
9+
- **[Public docs portal](https://hyperformula.handsontable.com/docs)** &mdash; main documentation
10+
- **[Docs README](docs/README.md)** &mdash; how to run the docs portal locally
11+
- **[Changelog](CHANGELOG.md)**
12+
- **[Pull request template](.github/pull_request_template.md)**
813

9-
- changes to the production code
10-
- including changes to all supported language packs in `src/i18n/languages` directory (if applicable)
11-
- automatic tests
12-
- for bugfixes: at least one test reproducing the bug
13-
- for new features: a set of tests describing the feature specification precisely
14-
- pull requests from external contributors should include tests in `tests/` directory (they will be moved to the private repository by the internal team)
15-
- internal team adds tests directly to the private repository (through a separate pull request)
16-
- updates to documentation related to the change
14+
## Repository layout
15+
16+
```
17+
.
18+
├── src/ # Source code
19+
│ ├── HyperFormula.ts # Main engine class, public API entry point
20+
│ ├── parser/ # Formula parsing (uses Chevrotain parser generator)
21+
│ ├── interpreter/ # Formula evaluation engine
22+
│ │ └── plugin/ # Built-in spreadsheet function plugins
23+
│ ├── DependencyGraph/ # Cell dependency tracking and recalculation order
24+
│ ├── CrudOperations.ts # Create/read/update/delete operations on sheets and cells
25+
│ └── i18n/ # Function-name translations per language
26+
├── test/ # Test suite
27+
├── docs/ # Public documentation portal (VuePress)
28+
│ ├── guide/ # Markdown guides (building, contributing, usage…)
29+
│ ├── api/ # API reference (generated from JSDoc)
30+
│ ├── .vuepress/ # VuePress configuration, theme, components
31+
│ └── README.md # How to run the docs portal locally
32+
├── script/ # Maintenance and release scripts
33+
├── .github/ # CI workflows, issue and PR templates
34+
├── DEV_DOCS.md # Canonical developer documentation (this file)
35+
├── AGENTS.md # Guidance for AI agents
36+
├── CONTRIBUTING.md # Guide for external contributors
37+
├── README.md # Project overview
38+
├── CHANGELOG.md
39+
├── LICENSE.txt
40+
├── package.json
41+
└── tsconfig.json
42+
```
43+
44+
## Architecture
45+
46+
### Core modules
47+
48+
- `src/HyperFormula.ts` &mdash; main engine class, public API entry point
49+
- `src/parser/` &mdash; formula parsing (uses the [Chevrotain](https://chevrotain.io/) parser generator)
50+
- `src/interpreter/` &mdash; formula evaluation engine
51+
- `src/DependencyGraph/` &mdash; cell dependency tracking and recalculation order
52+
- `src/CrudOperations.ts` &mdash; create/read/update/delete operations on sheets and cells
53+
54+
### Function plugins (`src/interpreter/plugin/`)
55+
56+
All spreadsheet functions are implemented as plugins extending `FunctionPlugin`. Each plugin:
57+
58+
- declares an `implementedFunctions` static property mapping function names to metadata
59+
- uses the `runFunction()` helper for argument validation, coercion, and array handling
60+
- registers function translations in `src/i18n/languages/`
61+
62+
## How to add a new function
63+
64+
Adding a built-in function is similar to adding a [custom function](docs/guide/custom-functions.md), so that guide is a useful reference for the function-implementation patterns (argument metadata, return types, array handling). The built-in flow on top of that is:
65+
66+
1. Create or modify a plugin in `src/interpreter/plugin/`.
67+
2. Add function metadata to `implementedFunctions`.
68+
3. Implement the function method.
69+
4. Add translations to all language files in `src/i18n/languages/`.
70+
5. Add tests in `test/unit/interpreter/`.
71+
72+
## Code style
73+
74+
- Prefer a functional approach where possible (`filter`, `map`, `reduce`).
75+
- Write self-documenting code: use meaningful names for classes, functions, and variables. Add code comments only when they explain intent the code itself cannot.
76+
- Add JSDoc to all classes and functions.
77+
- ESLint is the source of truth for formatting and code rules. Run `npm run lint` before submitting changes (see [building](docs/guide/building.md#run-the-linter)).
78+
79+
## Definition of Done
80+
81+
Each change to the production code (bugfix, new feature, or improvement) must include the following elements **before** requesting a code review:
82+
83+
- Changes to the production code
84+
- including changes to all supported language packs in `src/i18n/languages` (if applicable)
85+
- Automatic tests
86+
- for bug fixes: at least one test reproducing the bug
87+
- for new features: a set of tests precisely describing the feature
88+
- pull requests from external contributors should include tests in the `test/` directory (they will be moved to the private repository by the internal team)
89+
- the internal team adds tests directly to the private repository (through a separate pull request)
90+
- Updates to documentation related to the change
1791
- for breaking changes: a section in the migration guide
18-
- technical documentation in the form of the jsdoc comments (high-level description of the concepts used in the more complex code fragments)
19-
- changelog entry
20-
- pull request description
92+
- Technical documentation in the form of JSDoc comments (high-level description of the concepts used in more complex code fragments)
93+
- Changelog entry
94+
- Pull request description
95+
96+
## Internationalization and function translations
97+
98+
HyperFormula supports internationalization and provides localized function names for all built-in languages. Translation files live in `src/i18n/languages/`. New functions must include translations for all built-in languages.
2199

22-
## Sources of the function translations
100+
When looking for the valid translations for new functions, try these sources:
23101

24-
HF supports internationalization and provides the localized function names for all built-in languages. When looking for the valid translations for the new functions, try these sources:
25102
- https://support.microsoft.com/en-us/office/excel-functions-translator-f262d0c0-991c-485b-89b6-32cc8d326889
26103
- http://dolf.trieschnigg.nl/excel/index.php
27104

docs/src/content/docs/guide/building.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@ The build process uses Webpack and Babel, as well as npm tasks
77
listed in package.json. During this process, the source located in
88
the `src/*` directory is transformed into the output files.
99

10+
The library is developed in TypeScript and the exact configuration
11+
options can be found in `tsconfig.json`. To run the commands you need
12+
to set up your environment to have `npm` or `yarn` properly installed.
13+
After that, navigate to the project and run `npm install`.
14+
15+
## Output formats
16+
17+
The build produces the following output formats, all declared as
18+
entry points in `package.json`:
19+
20+
* `commonjs/` - CommonJS modules (main entry, used by Node.js and bundlers)
21+
* `es/` - ES modules (`.mjs` files, used by tree-shaking bundlers)
22+
* `dist/` - UMD bundles for direct use in the browser
23+
* `typings/` - TypeScript declaration files (`.d.ts`)
24+
1025
**For UMD versions which reside in CDN:**
1126

1227
* `./dist/hyperformula.js` - a full version which does not have
@@ -17,16 +32,6 @@ have dependencies, they need to be added manually
1732
* `./dist/hyperformula.full.min.js` - a minified version with
1833
dependencies
1934

20-
There are also versions of builds in CommonJS, ES6, and TypeScript
21-
definitions. They are marked in the package.json file. Based on
22-
the tools used (Webpack, parsers, etc.), a proper build will be
23-
respectively chosen.
24-
25-
The library is developed in TypeScript and the exact configuration
26-
options can be found in `tsconfig.json`. To run the commands you need
27-
to set up your environment to have `npm` or `yarn` properly installed.
28-
After that, navigate to the project and run `npm install`.
29-
3035
## Build the project
3136

3237
To build the project you can use the following commands:

0 commit comments

Comments
 (0)