Skip to content

Commit 96033a7

Browse files
authored
Merge pull request #8 from handsontable/develop
Deploy to staging: develop
2 parents e9770b7 + 308b2d5 commit 96033a7

107 files changed

Lines changed: 5321 additions & 1579 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ module.exports = {
66
'@typescript-eslint',
77
'license-header',
88
'jsdoc',
9+
'jasmine',
10+
'jest',
911
],
12+
env: {
13+
jasmine: true,
14+
'jest/globals': true,
15+
},
1016
parserOptions: {
1117
tsconfigRootDir: __dirname,
1218
project: './tsconfig.test.json',
@@ -17,6 +23,9 @@ module.exports = {
1723
'plugin:@typescript-eslint/eslint-recommended',
1824
'plugin:@typescript-eslint/recommended',
1925
'plugin:@typescript-eslint/recommended-requiring-type-checking',
26+
'plugin:jasmine/recommended',
27+
'plugin:jest/recommended',
28+
'plugin:jest/style',
2029
],
2130
rules: {
2231
// Automatic fixers
@@ -113,6 +122,13 @@ module.exports = {
113122
MethodDefinition: true,
114123
}
115124
}],
125+
'jest/no-jasmine-globals': 'off',
126+
'jest/no-alias-methods': 'off',
127+
'jest/no-conditional-expect': 'warn',
128+
'jest/no-standalone-expect': 'warn',
129+
'jest/no-test-prefixes': 'off',
130+
'jest/prefer-to-be': 'warn',
131+
'jest/prefer-to-have-length': 'off',
116132
},
117133
overrides: [
118134
{
@@ -127,5 +143,11 @@ module.exports = {
127143
'sort-keys': ['error', 'asc'],
128144
}
129145
},
146+
{
147+
files: ['**/*.spec.ts'],
148+
rules: {
149+
'@typescript-eslint/no-non-null-assertion': 'off',
150+
}
151+
}
130152
],
131153
}

.github/workflows/audit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ jobs:
3232

3333
- name: Run audit
3434
run: |
35-
npm audit --omit='dev'
35+
npm run audit

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Fixed an issue where cells were not recalculated after adding, removing and renaming sheets. [#1116](https://github.com/handsontable/hyperformula/issues/1116)
13+
- Fixed an issue where overwriting a non-computed cell caused the `Value of the formula cell is not computed` error. [#1194](https://github.com/handsontable/hyperformula/issues/1194)
14+
1015
## [3.1.0] - 2025-10-14
1116

1217
### Changed

docs/guide/basic-operations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ consists of a sheet ID, column ID, and row ID, like this:
228228

229229
Alternatively, you can work with the **A1 notation** known from
230230
spreadsheets like Excel or Google Sheets. The API provides the helper
231-
function [`simpleCellAddressFromString`](../api/globals.md#simplecelladdressfromstring) which you can use to retrieve
231+
function [`simpleCellAddressFromString`](../api/classes/hyperformula.md#simplecelladdressfromstring) which you can use to retrieve
232232
the [`SimpleCellAddress`](../api/interfaces/simplecelladdress) .
233233
:::
234234

docs/guide/compatibility-with-microsoft-excel.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ That said, there are cases when HyperFormula can't be compatible with all three
1313

1414
Still, with the right configuration, you can achieve nearly full compatibility.
1515

16+
### Excel function coverage
17+
18+
HyperFormula implements **350 out of 515 Excel functions** (68% coverage), as of version 3.1.0 and Excel 2024. This means that **165 Excel functions** (32%) are not yet available in HyperFormula.
19+
20+
Additionally, HyperFormula includes some functions that are not part of Excel's standard function set, bringing the total number of available functions to **{{ $page.functionsCount }}**.
21+
22+
For a complete list of supported functions, see the [built-in functions](built-in-functions.md) page.
23+
24+
If you need any of the missing Excel functions, you can [contact us](contact.md) or implement them as [custom functions](custom-functions.md), extending HyperFormula's capabilities to meet your specific requirements.
25+
26+
1627
## Configure compatibility with Microsoft Excel
1728

1829
### String comparison rules

jest.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,11 @@ module.exports = {
5050
transform: {
5151
"^.+\\.(ts|tsx)$": "ts-jest"
5252
},
53+
54+
watchPathIgnorePatterns: [
55+
'/node_modules/',
56+
'/dist/',
57+
'/commonjs/',
58+
'/es/',
59+
]
5360
};

package-lock.json

Lines changed: 67 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"test": "npm-run-all lint test:unit test:browser test:compatibility",
7979
"test:unit": "cross-env NODE_ICU_DATA=node_modules/full-icu jest",
8080
"test:watch": "cross-env NODE_ICU_DATA=node_modules/full-icu jest --watch",
81-
"test:tdd": "cross-env NODE_ICU_DATA=node_modules/full-icu jest --watch custom-functions",
81+
"test:tdd": "cross-env NODE_ICU_DATA=node_modules/full-icu jest --watch adding-sheet",
8282
"test:coverage": "npm run test:unit -- --coverage",
8383
"test:logMemory": "cross-env NODE_ICU_DATA=node_modules/full-icu jest --runInBand --logHeapUsage",
8484
"test:unit.ci": "cross-env NODE_ICU_DATA=node_modules/full-icu node --expose-gc ./node_modules/jest/bin/jest --forceExit",
@@ -93,6 +93,7 @@
9393
"benchmark:compare-benchmarks": "npm run tsnode test/performance/compare-benchmarks.ts",
9494
"lint": "eslint . --ext .js,.ts",
9595
"lint:fix": "eslint . --ext .js,.ts --fix",
96+
"audit": "npm audit --omit=dev",
9697
"clean": "rimraf coverage/ commonjs/ dist/ es/ languages/ lib/ typings/ test-jasmine/",
9798
"compile": "tsc",
9899
"check:licenses": "license-checker --production --excludePackages=\"hyperformula@3.0.1\" --onlyAllow=\"MIT; Apache-2.0; BSD-3-Clause; BSD-2-Clause; ISC; BSD; Unlicense\"",
@@ -133,6 +134,8 @@
133134
"env-cmd": "^10.1.0",
134135
"eslint": "^8.57.1",
135136
"eslint-config-prettier": "^9.1.0",
137+
"eslint-plugin-jasmine": "^4.2.2",
138+
"eslint-plugin-jest": "^27.9.0",
136139
"eslint-plugin-jsdoc": "^50.5.0",
137140
"eslint-plugin-license-header": "^0.6.1",
138141
"eslint-plugin-prettier": "^5.2.1",

src/BuildEngineFactory.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,17 @@ export class BuildEngineFactory {
8787
throw new SheetSizeLimitExceededError()
8888
}
8989
const sheetId = sheetMapping.addSheet(sheetName)
90-
addressMapping.autoAddSheet(sheetId, boundaries)
90+
addressMapping.addSheetAndSetStrategyBasedOnBoundaries(sheetId, boundaries, { throwIfSheetAlreadyExists: true })
9191
}
9292
}
9393

94-
const parser = new ParserWithCaching(config, functionRegistry, sheetMapping.get)
94+
const parser = new ParserWithCaching(
95+
config,
96+
functionRegistry,
97+
dependencyGraph.sheetReferenceRegistrar.ensureSheetRegistered.bind(dependencyGraph.sheetReferenceRegistrar)
98+
)
9599
lazilyTransformingAstService.parser = parser
96-
const unparser = new Unparser(config, buildLexerConfig(config), sheetMapping.fetchDisplayName, namedExpressions)
100+
const unparser = new Unparser(config, sheetMapping, namedExpressions)
97101
const dateTimeHelper = new DateTimeHelper(config)
98102
const numberLiteralHelper = new NumberLiteralHelper(config)
99103
const arithmeticHelper = new ArithmeticHelper(config, dateTimeHelper, numberLiteralHelper)
@@ -106,7 +110,7 @@ export class BuildEngineFactory {
106110
const clipboardOperations = new ClipboardOperations(config, dependencyGraph, operations)
107111
const crudOperations = new CrudOperations(config, operations, undoRedo, clipboardOperations, dependencyGraph, columnSearch, parser, cellContentParser, lazilyTransformingAstService, namedExpressions)
108112

109-
const exporter = new Exporter(config, namedExpressions, sheetMapping.fetchDisplayName, lazilyTransformingAstService)
113+
const exporter = new Exporter(config, namedExpressions, sheetMapping, lazilyTransformingAstService)
110114
const serialization = new Serialization(dependencyGraph, unparser, exporter)
111115

112116
const interpreter = new Interpreter(config, dependencyGraph, columnSearch, stats, arithmeticHelper, functionRegistry, namedExpressions, serialization, arraySizePredictor, dateTimeHelper)

src/Cell.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* Copyright (c) 2025 Handsoncode. All rights reserved.
44
*/
55

6-
import {ArrayVertex, CellVertex, FormulaCellVertex, ParsingErrorVertex, ValueCellVertex} from './DependencyGraph'
7-
import {FormulaVertex} from './DependencyGraph/FormulaCellVertex'
6+
import {ArrayFormulaVertex, CellVertex, ScalarFormulaVertex, ParsingErrorVertex, ValueCellVertex} from './DependencyGraph'
7+
import {FormulaVertex} from './DependencyGraph/FormulaVertex'
88
import {ErrorMessage} from './error-message'
99
import {
1010
EmptyValue,
@@ -59,14 +59,14 @@ export enum CellType {
5959
}
6060

6161
export const getCellType = (vertex: Maybe<CellVertex>, address: SimpleCellAddress): CellType => {
62-
if (vertex instanceof ArrayVertex) {
62+
if (vertex instanceof ArrayFormulaVertex) {
6363
if (vertex.isLeftCorner(address)) {
6464
return CellType.ARRAYFORMULA
6565
} else {
6666
return CellType.ARRAY
6767
}
6868
}
69-
if (vertex instanceof FormulaCellVertex || vertex instanceof ParsingErrorVertex) {
69+
if (vertex instanceof ScalarFormulaVertex || vertex instanceof ParsingErrorVertex) {
7070
return CellType.FORMULA
7171
}
7272
if (vertex instanceof ValueCellVertex) {
@@ -196,7 +196,12 @@ export interface SimpleCellAddress {
196196
}
197197

198198
export const simpleCellAddress = (sheet: number, col: number, row: number): SimpleCellAddress => ({sheet, col, row})
199-
export const invalidSimpleCellAddress = (address: SimpleCellAddress): boolean => (address.col < 0 || address.row < 0)
199+
200+
/**
201+
* Checks if the column or row id is negative.
202+
*/
203+
export const isColOrRowInvalid = (address: SimpleCellAddress): boolean => (address.col < 0 || address.row < 0)
204+
200205
export const movedSimpleCellAddress = (address: SimpleCellAddress, toSheet: number, toRight: number, toBottom: number): SimpleCellAddress => {
201206
return simpleCellAddress(toSheet, address.col + toRight, address.row + toBottom)
202207
}

0 commit comments

Comments
 (0)