Skip to content

Commit ef76392

Browse files
committed
HF-359: Address review on the hyperformula-ui import
- The tarball no longer ships dist/.tsbuildinfo, the incremental build cache tsc writes next to the declarations. - CI fails on a stale DOCS.md, the same way as on a stale stylesheet. - rspack.base.mjs drops its tsx option, which only the React adapters used. - The core's README says hyperformula is an optional peer, and what is off without it. - @hfe-demo/shared exports datasets.ts plainly. Its source condition pointed at the same file as the default, and nothing imported its shared.css export; the demo serves that file through a symlink. - A test pins the one input whose tokens the unterminated-string change did alter: a backslash before a line break. `.` does not match a line break, so a later quote can start a closed string there; it is now an error, as the quotes after any other unterminated string are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013iRJc4HBUpeRFDy1TxBzWe
1 parent 365e835 commit ef76392

6 files changed

Lines changed: 16 additions & 12 deletions

File tree

‎.github/workflows/hyperformula-ui.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ jobs:
4040
- name: Check the generated stylesheet is committed
4141
run: git diff --exit-code -- 'hyperformula-ui/**/cssText.ts'
4242

43+
- name: Check the generated API docs are committed
44+
run: |
45+
npm run docs --workspace=hyperformula-ui/packages/core
46+
git diff --exit-code -- hyperformula-ui/packages/core/DOCS.md
47+
4348
- name: Lint
4449
run: npm run lint --workspace=hyperformula-ui/packages/core
4550

‎hyperformula-ui/demo/shared/package.json‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99
"typecheck": "tsc -p tsconfig.json"
1010
},
1111
"exports": {
12-
".": {
13-
"hyperformula-ui-source": "./datasets.ts",
14-
"default": "./datasets.ts"
15-
},
16-
"./shared.css": "./shared.css"
12+
".": "./datasets.ts"
1713
},
1814
"dependencies": {
1915
"hyperformula": "^3.4.0"

‎hyperformula-ui/packages/core/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ It has no UI framework dependency. A grid connects to it through the `IGridAdapt
1010
npm install hyperformula-ui hyperformula
1111
```
1212

13-
`hyperformula` is a peer dependency: version 3.4.0 or later.
13+
`hyperformula` is an optional peer dependency: version 3.4.0 or later. Without it, the editor still edits and highlights formulas, but function autocomplete, function help and named-expression highlighting are off.
1414

1515
## Use
1616

‎hyperformula-ui/packages/core/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
},
2828
"files": [
2929
"dist",
30+
"!dist/.tsbuildinfo",
3031
"src",
3132
"DOCS.md"
3233
],

‎hyperformula-ui/packages/core/tests/lexer/lexer.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ describe("Lexer", () => {
4343
expect(values('="x" & "y')).toEqual(["=", '"x"', "&", '"', "y"]);
4444
});
4545

46+
it("an unterminated string ending in a backslash before a line break leaves later quotes as errors", () => {
47+
expect(values('="a\\\n"b"')).toEqual(["=", '"', "a", "\\", '"', "b", '"']);
48+
});
49+
4650
it("cell cellRefs absolute markers", () => {
4751
const tokens = lex.tokenize("A1 $A1 A$1 $A$1");
4852
const cellRefs = tokens.filter((token) => token.type === TokenType.CELL_REF);

‎hyperformula-ui/rspack.base.mjs‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
import { resolve } from "node:path";
22
import { fileURLToPath } from "node:url";
33

4-
export function createRspackConfig({ url, tsx = false, externals = {} }) {
4+
export function createRspackConfig({ url, externals = {} }) {
55
const packageDir = fileURLToPath(new URL(".", url));
6-
const scriptTest = tsx ? /\.tsx?$/ : /\.ts$/;
7-
const extensions = tsx ? [".ts", ".tsx", ".js"] : [".ts", ".js"];
6+
const extensions = [".ts", ".js"];
87

98
const swcOptions = {
109
jsc: {
11-
parser: tsx ? { syntax: "typescript", tsx: true } : { syntax: "typescript" },
10+
parser: { syntax: "typescript" },
1211
target: "es2022",
13-
...(tsx ? { transform: { react: { runtime: "automatic" } } } : {}),
1412
},
1513
};
1614

1715
const rules = [
1816
{
19-
test: scriptTest,
17+
test: /\.ts$/,
2018
exclude: /node_modules/,
2119
loader: "builtin:swc-loader",
2220
options: swcOptions,

0 commit comments

Comments
 (0)