Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
9ca2d54
latest
Jul 15, 2025
b501260
latest
Jul 16, 2025
e27d62e
fix lint
Jul 17, 2025
99095de
Merge branch 'main' into sqlbox
davemarco Jul 17, 2025
bdfe59d
latest
Jul 18, 2025
bf9fae1
latest
Jul 18, 2025
f4757af
latest
Jul 18, 2025
7106e72
saving
Jul 18, 2025
b3db4a8
latest
Jul 18, 2025
1b50904
latest
Jul 18, 2025
487376a
latest
Jul 21, 2025
4b4834d
latest
Jul 21, 2025
37687cc
latest
Jul 21, 2025
01ef445
latest
Jul 21, 2025
85c557c
latest
Jul 21, 2025
50b9efc
latest
Jul 30, 2025
f29b93c
latest
Jul 31, 2025
b31bebc
latest
Aug 4, 2025
dbcf7ff
latest
Aug 4, 2025
71aab74
latest
Aug 11, 2025
b502c30
latest
Aug 11, 2025
9d0b7bb
latest
Aug 11, 2025
7b5a8f1
latest
Aug 11, 2025
d786687
tsconfig changes
Aug 14, 2025
6533417
Update components/webui/common/tsconfig.json
davemarco Aug 19, 2025
3b9a852
Update components/webui/server/tsconfig.json
davemarco Aug 19, 2025
b97cd7c
Update components/webui/server/package.json
davemarco Aug 19, 2025
be9ebee
Update components/webui/client/package.json
davemarco Aug 19, 2025
d8cb843
Update components/webui/client/package.json
davemarco Aug 19, 2025
f28b6f7
Update components/webui/server/package.json
davemarco Aug 19, 2025
8945f8a
latest
Aug 19, 2025
6da8f5e
Merge branch 'workspace' of https://github.com/davemarco/clp into wor…
Aug 19, 2025
a476023
Update components/webui/client/package.json
davemarco Aug 21, 2025
2550522
Update components/webui/client/package.json
davemarco Aug 21, 2025
21041bb
Update components/webui/common/package.json
davemarco Aug 21, 2025
be60997
latest
Aug 21, 2025
e5b2888
latest
Aug 21, 2025
73e87be
latest
Aug 21, 2025
0ab3bdb
latest
Aug 26, 2025
902f198
latest
Aug 26, 2025
a3e36f4
latest
Aug 26, 2025
51ccf03
latest
Aug 26, 2025
0ca50ed
fix lint
Aug 26, 2025
9741b66
latest
Aug 27, 2025
97de7ea
Update components/webui/client/package.json
davemarco Aug 28, 2025
817aab5
Update components/webui/client/tsconfig/tsconfig.app.json
davemarco Aug 28, 2025
44451b7
Update components/webui/package.json
davemarco Aug 28, 2025
9e81337
latest
Aug 28, 2025
4026fe9
Merge branch 'workspace' of https://github.com/davemarco/clp into wor…
Aug 28, 2025
bb868d9
latest
Aug 28, 2025
5873146
latest
Aug 28, 2025
3fee734
latest
Aug 28, 2025
171089d
merge main
Aug 28, 2025
fb79e16
lint
Aug 28, 2025
3039ab1
Merge branch 'main' into workspace
junhaoliao Sep 2, 2025
5e148d1
Merge branch 'main' into workspace
davemarco Sep 3, 2025
68880a7
Merge branch 'main' into workspace
davemarco Sep 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ def start_webui(
get_clp_home() / "var" / "www" / "webui" / "client" / "settings.json"
)
server_settings_json_path = (
get_clp_home() / "var" / "www" / "webui" / "server" / "dist" / "server" / "settings.json"
get_clp_home() / "var" / "www" / "webui" / "server" / "dist" / "settings.json"
)
Comment on lines +846 to 847
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Path correction to server settings.json looks right; verify dist packaging includes it

You removed the redundant "server" segment and now target .../webui/server/dist/settings.json. This aligns with the workspace/dist reshuffle. Please double‑check the server build produces and packages settings.json at dist root so this path won’t 404 at runtime.

Run:


🏁 Script executed:

#!/bin/bash
# Verify references to the new dist paths exist in the server sources/config.
rg -nC2 -e 'dist/settings\.json' -e 'dist/src/main\.js' components/webui/server || true

# Optionally, confirm the server package metadata aligns (main/exports/scripts) if present:
if [ -f components/webui/server/package.json ]; then
  cat components/webui/server/package.json
fi

Length of output: 2569


Ensure server build includes settings.json in dist

It looks like the server’s package.json defines the build step as just running tsc, with no provision to copy non-TS assets. Since TypeScript compilation alone won’t emit JSON files, settings.json won’t end up under dist/, causing a 404 at runtime when start_clp.py points to …/server/dist/settings.json.

Please address this by:

  • Updating the server’s build script (in components/webui/server/package.json) to copy settings.json into dist/.
    Example:
     "scripts": {
  • "build": "tsc",
  • "build": "tsc && cp src/settings.json dist/settings.json",

    }
- Alternatively, configure your build pipeline (or `tsconfig.json`) to include JSON assets so they’re emitted into `dist/`.
- After making this change, confirm that `components/webui/server/dist/settings.json` exists and that your CLP start-up script no longer 404s.



> Committable suggestion skipped: line range outside the PR's diff.

<details>
<summary>🤖 Prompt for AI Agents</summary>

In components/clp-package-utils/clp_package_utils/scripts/start_clp.py around
lines 845-846, the script expects server/dist/settings.json but the server build
only runs tsc and doesn't emit non-TS assets; update
components/webui/server/package.json build script to copy settings.json into
dist (or add a postbuild step or use a build tool to include JSON assets), or
configure tsconfig/build pipeline to include JSON files in the emitted output,
then run the build and verify components/webui/server/dist/settings.json exists
so start_clp.py will not 404.


</details>

<!-- fingerprinting:phantom:poseidon:chinchilla -->

<!-- This is an auto-generated comment by CodeRabbit -->


validate_webui_config(clp_config, client_settings_json_path, server_settings_json_path)
Expand Down Expand Up @@ -964,7 +964,7 @@ def start_webui(

node_cmd = [
str(CONTAINER_CLP_HOME / "bin" / "node-22"),
str(container_webui_dir / "server" / "dist" / "server" / "src" / "main.js"),
str(container_webui_dir / "server" / "dist" / "src" / "main.js"),
]
Comment on lines 965 to 968
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Entrypoint path updated to dist/src/main.js; confirm server build emits this file

Pointing node to server/dist/src/main.js matches the ESM layout change. Please ensure the server’s tsconfig/build scripts emit main.js under dist/src and that any Docker image or packaging step copies it (and its sourcemap if needed).

If you have a local build, quickly sanity‑check:


🏁 Script executed:

#!/bin/bash
# After building the server locally, confirm the entrypoint exists:
test -f components/webui/server/dist/src/main.js && echo "OK: main.js exists" || (echo "Missing dist/src/main.js"; exit 1)

Length of output: 118


Server entrypoint missing: critical fix required

The verification script indicates that components/webui/server/dist/src/main.js does not exist after building the server. Without this file, the CLP startup will fail at runtime.

Please address the issue by either:

  • Updating the server’s build configuration (e.g. tsconfig.json, build scripts) so that main.js is emitted under dist/src/.
  • Or, if the file is output elsewhere, adjusting the entrypoint path in components/clp-package-utils/clp_package_utils/scripts/start_clp.py to match the actual location.

Next steps:

  • Inspect components/webui/server/tsconfig.json and build scripts to confirm the "outDir" and entry file settings.
  • Re-run the build locally and verify with:
    test -f components/webui/server/dist/src/main.js \
      && echo "OK: main.js exists" \
      || (echo "Missing dist/src/main.js"; exit 1)
  • Update start_clp.py once the correct path is determined.
🤖 Prompt for AI Agents
In components/clp-package-utils/clp_package_utils/scripts/start_clp.py around
lines 963-966, the node_cmd entrypoint points to
components/webui/server/dist/src/main.js which the build does not produce;
inspect components/webui/server/tsconfig.json and the server build scripts to
confirm the configured outDir and emitted entry file (or run a local build),
then either update the build config so main.js is emitted to dist/src/ or change
the node_cmd path to the actual built file location (e.g., dist/main.js or
dist/server/main.js as determined); after adjusting, rebuild and verify
existence with the provided test command before committing the path change.

cmd = container_cmd + node_cmd
subprocess.run(cmd, stdout=subprocess.DEVNULL, check=True)
Expand Down
9 changes: 5 additions & 4 deletions components/webui/client/package.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we update the "name" to be @webui/client?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this change hasn't been pushed?

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "webui-client",
"name": "@webui/client",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Good rename to scoped package; consider marking the package as private.

The new name @webui/client aligns with the workspace structure. To avoid accidental publishes from a leaf app package, add "private": true.

Outside-the-hunk example (apply near the top of the manifest):

{
  "name": "@webui/client",
  "private": true,
  ...
}
🤖 Prompt for AI Agents
In components/webui/client/package.json around line 2, the package was renamed
to the scoped name "@webui/client" but is not marked private; add a "private":
true field near the top-level of the manifest (alongside name and version) to
prevent accidental npm publishes from this leaf app package.

"version": "0.1.0",
"description": "",
"main": "src/main.tsx",
Expand All @@ -18,9 +18,10 @@
"@emotion/styled": "^11.14.0",
"@monaco-editor/react": "^4.7.0",
"@mui/joy": "^5.0.0-beta.51",
"@sinclair/typebox": "^0.34.25",
"@sinclair/typebox": "^0.34.38",
"@tanstack/react-query": "^5.81.5",
"@tanstack/react-query-devtools": "^5.81.5",
"@webui/common": "*",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Replace wildcard dependency on @webui/common with a pinned workspace range.

Using "*" risks pulling a registry version if it ever exists and hurts reproducibility. Prefer a pinned semver matching @webui/common’s version so npm links the workspace package deterministically.

Apply one of the following (recommended first):

  • If using npm workspaces (no workspace: protocol): set to the exact version range declared in components/webui/common/package.json (example shown).
-    "@webui/common": "*",
+    "@webui/common": "^0.1.0",
  • If your toolchain supports it (Yarn/pnpm), use the workspace protocol:
-    "@webui/common": "*",
+    "@webui/common": "workspace:*",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"@webui/common": "*",
"@webui/common": "^0.1.0",
🤖 Prompt for AI Agents
In components/webui/client/package.json around line 24, the dependency uses the
wildcard "*" for "@webui/common" which can pull a registry package and breaks
reproducibility; replace it with a pinned workspace range by reading the version
field from components/webui/common/package.json and setting "@webui/common" to
that exact semver (e.g. "1.2.3") or, if your toolchain supports workspace
protocol, set it to the workspace reference (e.g. "workspace:^1.2.3" or
"workspace:*"); ensure the selected form matches your monorepo package manager
(npm workspaces use the exact version range, Yarn/pnpm can use the workspace
protocol) and update package.json accordingly.

"antd": "^5.24.5",
"axios": "^1.7.9",
"chart.js": "^4.4.9",
Expand All @@ -43,8 +44,8 @@
"@types/react-dom": "^19.0.4",
"@types/react-syntax-highlighter": "^15.5.13",
"@vitejs/plugin-react": "^4.3.4",
"eslint-config-yscope": "latest",
"typescript": "~5.6.2",
"eslint-config-yscope": "1.1.1",
"typescript": "~5.7.3",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Confirm TS version alignment across workspace.
Ensure all packages use the same operator (~5.7.3) to avoid duplicate installs.


🏁 Script executed:

#!/bin/bash
rg -n --hidden --glob '!node_modules' -e '"typescript"\s*:\s*"[^"]+"' -g '*package.json' -C1

Length of output: 667


Align TypeScript specifier across all packages
In components/webui/common/package.json and components/webui/server/package.json, change

"typescript": "^5.7.3"

to

"typescript": "~5.7.3"

so all workspaces use the same operator and avoid duplicate installs.

🤖 Prompt for AI Agents
In components/webui/client/package.json around line 48, update the TypeScript
dependency specifier to match the other webui packages: change occurrences using
the caret operator to use the tilde operator so all workspaces declare
"typescript" with "~5.7.3" to ensure consistent versions and avoid duplicate
installs; modify the specifier in components/webui/common/package.json and
components/webui/server/package.json accordingly.

"vite": "^6.3.5"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
ClientToServerEvents,
ServerToClientEvents,
} from "@common/index.js";
} from "@webui/common";
import {Socket} from "socket.io-client";

import {MongoSocketCursor} from "./MongoSocketCursor.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
QueryId,
Response,
ServerToClientEvents,
} from "@common/index.js";
} from "@webui/common";
import {Socket} from "socket.io-client";

import {Nullable} from "../../typings/common";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
ClientToServerEvents,
ServerToClientEvents,
} from "@common/index.js";
} from "@webui/common";
import {
io,
Socket,
Expand Down
3 changes: 2 additions & 1 deletion components/webui/client/src/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {CLP_QUERY_ENGINES} from "../../../common/index.js";
import {CLP_QUERY_ENGINES} from "@webui/common";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Fix module resolution for @webui/common (import/no-unresolved).

ESLint can’t resolve the workspace package. Ensure the client declares and resolves the workspace dependency and that lint runs against the correct TS project.

  • Add @webui/common as a dependency of client (use "*" for npm workspaces).
  • Ensure the common package exposes compiled JS and types via "exports" and "types".
  • Point ESLint’s typescript resolver at the client tsconfig (or a root tsconfig.eslint.json that includes client).

Run this script to confirm the wiring:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Check client depends on @webui/common =="
jq -r '.dependencies["@webui/common"], .devDependencies["@webui/common"]' components/webui/client/package.json 2>/dev/null

echo "== Check common package exposes exports and types =="
jq '{name, main, module, types, exports}' components/webui/common/package.json

echo "== Confirm tsconfig path for client (module resolution) =="
jq '.compilerOptions | {moduleResolution, baseUrl, paths, types}' components/webui/client/tsconfig.json

echo "== Print ESLint config resolver hints (if present) =="
# These files are common; adapt if your repo uses a different path
for f in .eslintrc.cjs .eslintrc.js components/webui/client/.eslintrc.cjs components/webui/.eslintrc.cjs; do
  [ -f "$f" ] && { echo "--- $f ---"; cat "$f"; }
done

Length of output: 616


🏁 Script executed:

#!/bin/bash
set -u -o pipefail

echo "== Check client depends on @webui/common =="
jq -r '.dependencies["@webui/common"], .devDependencies["@webui/common"]' components/webui/client/package.json 2>/dev/null || echo "not found"

echo
echo "== Check common package exposes exports and types =="
jq '{name: .name, main: .main, module: .module, types: .types, exports: .exports}' components/webui/common/package.json 2>/dev/null || echo "failed to parse common/package.json"

echo
echo "== Confirm tsconfig path for client (module resolution) =="
jq '.compilerOptions | {moduleResolution: .moduleResolution, baseUrl: .baseUrl, paths: .paths, types: .types}' components/webui/client/tsconfig.json 2>/dev/null || echo "failed to parse client/tsconfig.json"

echo
echo "== Print ESLint resolver settings (if present) =="
for f in .eslintrc.cjs .eslintrc.js components/webui/client/.eslintrc.cjs components/webui/.eslintrc.cjs; do
  if [ -f "$f" ]; then
    echo "--- $f ---"
    sed -n '1,200p' "$f"
    echo
  fi
done

Length of output: 1732


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Check existence and permissions of tsconfig.json =="
ls -l components/webui/client/tsconfig.json || { echo "tsconfig.json not found"; exit 1; }

echo
echo "== Print first 200 lines of tsconfig.json =="
sed -n '1,200p' components/webui/client/tsconfig.json

Length of output: 729


Configure ESLint for TypeScript project resolution in client

The client already declares "@webui/common": "*" in its dependencies, and the common package exposes compiled JS and types via its "exports" field. However, ESLint’s import resolver isn’t pointed at the client’s TS project, so imports of workspace packages (e.g. @webui/common) trigger import/no-unresolved.

Actions:

  • Create or update components/webui/client/.eslintrc.cjs with:
    module.exports = {
      parserOptions: {
        project: ['./tsconfig/tsconfig.app.json']
      },
      settings: {
        'import/resolver': {
          typescript: {
            project: ['./tsconfig/tsconfig.app.json']
          }
        }
      }
    };
  • Or, in your root ESLint config (e.g. .eslintrc.cjs or .eslintrc.js), add the client’s TS project under both parserOptions.project and settings.import/resolver.typescript.project:
    parserOptions: {
    + project: ['components/webui/client/tsconfig/tsconfig.app.json', /* other projects */],
    },
    settings: {
      'import/resolver': {
        typescript: {
    +     project: ['components/webui/client/tsconfig/tsconfig.app.json', /* other projects */],
        }
      }
    }
  • Verify that components/webui/client/tsconfig/tsconfig.app.json includes any necessary compilerOptions.baseUrl or paths entries if you’re using custom path aliases for workspace packages.

These changes will allow ESLint to resolve workspace packages correctly and eliminate the import/no-unresolved errors.

🧰 Tools
🪛 GitHub Actions: clp-lint

[error] 1-1: ESLint: Unable to resolve path to module '@webui/common' (import/no-unresolved)

🤖 Prompt for AI Agents
components/webui/client/src/config/index.ts lines 1-1: ESLint is flagging
imports of workspace packages like "@webui/common" as unresolved because the
client's ESLint parser/import resolver isn't pointed at the client's TypeScript
project; update the client's ESLint config
(components/webui/client/.eslintrc.cjs) or the root ESLint config to set
parserOptions.project and settings.import/resolver.typescript.project to
['./tsconfig/tsconfig.app.json'] so the resolver uses the client tsconfig, and
ensure components/webui/client/tsconfig/tsconfig.app.json has any required
baseUrl/paths for workspace aliases.


import {settings} from "../settings";


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
useMemo,
} from "react";

import type {PrestoSearchResult} from "../../../../../../../../common/index.js";
import type {PrestoSearchResult} from "@webui/common";

import VirtualTable from "../../../../../../components/VirtualTable";
import useSearchStore from "../../../../SearchState/index";
import {usePrestoSearchResults} from "./usePrestoSearchResults";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type {PrestoSearchResult} from "../../../../../../../../common/index.js";
import type {PrestoSearchResult} from "@webui/common";

import MongoSocketCollection from "../../../../../../api/socket/MongoSocketCollection";
import {useCursor} from "../../../../../../api/socket/useCursor";
import useSearchStore, {SEARCH_STATE_DEFAULT} from "../../../../SearchState/index";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type {PrestoSearchResult} from "@webui/common";
import {TableProps} from "antd";

import type {PrestoSearchResult} from "../../../../../../../../common/index.js";


/**
* Generates dynamic columns configuration for Presto query engine.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {SearchResultsMetadataDocument} from "@common/index.js";
import {SearchResultsMetadataDocument} from "@webui/common";

import MongoSocketCollection from "../../../api/socket/MongoSocketCollection";
import {useCursor} from "../../../api/socket/useCursor";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {useEffect} from "react";
import {
PRESTO_SEARCH_SIGNAL,
SEARCH_SIGNAL,
} from "@common/index.js";
} from "@webui/common";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

import/no-unresolved for @webui/common breaks type-aware lint; fix ESLint resolver and workspace install order

The unresolved import causes a cascade of “error typed value” diagnostics; once resolution is fixed, those vanish. Ensure ESLint resolves workspace packages and runs after workspace install.

Actions:

  • Make sure the repo’s root package.json defines workspaces that include components/webui/common, client, and server.
  • Configure ESLint import resolvers to understand TS projects and Node packages in a workspace.

If you keep a root ESLint config, add:

 // .eslintrc.cjs (at repository or components/webui root)
 module.exports = {
   settings: {
     'import/resolver': {
       node: {
         extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
       },
       typescript: {
-        // default
+        alwaysTryTypes: true,
+        project: [
+          'components/webui/common/tsconfig.json',
+          'components/webui/client/tsconfig/tsconfig.app.json',
+          'components/webui/server/tsconfig.json'
+        ],
       },
     },
   },
 };

Also ensure CI runs npm/pnpm/yarn install from the workspace root before linting the client/server packages.


🏁 Script executed:

#!/bin/bash
# Verify workspace + resolver prerequisites in-tree.
set -euo pipefail

echo "Checking that @webui/common is a workspace package and named correctly…"
rg -n '"name":\s*"@webui/common"' components/webui/common/package.json

echo "Checking that workspaces are declared at the root…"
rg -n '"workspaces"' package.json || rg -n '"workspaces"' components/webui/package.json || true

echo "Searching for ESLint resolver configuration…"
rg -n "'import/resolver'|\"import/resolver\"" -C2 --glob '**/.eslintrc.*' || true

Length of output: 882


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Searching for ESLint resolver configuration in all ESLint config files (including hidden)…"
rg -n "'import/resolver'|\"import/resolver\"" -C2 -uu --glob "**/.eslintrc.*"

Length of output: 443


#!/bin/bash
set -euo pipefail

echo "1. Show workspace definitions in components/webui/package.json"
sed -n '1,200p' components/webui/package.json

echo -e "\n2. Find all tsconfig JSON files under components/webui"
find components/webui -type f -iname 'tsconfig*.json'

echo -e "\n3. Locate any ESLint config files in the repo"
find . -type f \( -iname '.eslintrc*' -o -iname 'eslint.config.*' -o -iname '.eslintignore' \)

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "1. Checking for root-level package.json:"
find . -maxdepth 1 -type f -name "package.json" -print

echo -e "\n2. Showing first 30 lines of root package.json (if present):"
find . -maxdepth 1 -type f -name "package.json" -exec sed -n '1,30p' {} \;

echo -e "\n3. Checking for pnpm or Yarn workspace config at root:"
find . -maxdepth 1 -type f \( -name "pnpm-workspace.yaml" -o -name "yarn.workspaces" \) -print

echo -e "\n4. Showing first 30 lines of components/webui/package.json:"
sed -n '1,30p' components/webui/package.json

echo -e "\n5. Locating ESLint config files in the repository:"
find . -type f \( -iname ".eslintrc*" -o -iname "eslint.config.*" \) -print

echo -e "\n6. Finding all tsconfig JSON files under components/webui:"
find components/webui -type f -iname "tsconfig*.json"

Length of output: 2068


Update ESLint resolver configuration and CI install path

Your workspace is correctly set up under components/webui (the workspaces field in its package.json lists common, client, and server), but ESLint isn’t picking up @webui/common because the import resolver isn’t configured. To fix:

• Add import resolver settings to your ESLint configs
 – In each of components/webui/{common,client,server}/eslint.config.mjs, include:

export default {
  settings: {
    'import/resolver': {
      node: {
        extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
      },
      typescript: {
        alwaysTryTypes: true,
        project: [
          // adjust paths relative to components/webui
          './common/tsconfig.json',
          './client/tsconfig/tsconfig.app.json',
          './server/tsconfig.json',
        ],
      },
    },
  },
  // …your existing rules/plugins
};

• Ensure CI installs dependencies from the monorepo root (components/webui) before linting:

steps:
  - run: cd components/webui && npm ci
  - run: cd components/webui && npm run lint:check

After this, import/no-unresolved errors for @webui/common should disappear when running lint from components/webui.

🧰 Tools
🪛 GitHub Actions: clp-lint

[error] 6-6: ESLint: Unable to resolve path to module '@webui/common' (import/no-unresolved)

🤖 Prompt for AI Agents
In
components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts
around line 6, ESLint is flagging imports from @webui/common because the import
resolver isn't configured for the monorepo workspace; update each
components/webui/{common,client,server}/eslint.config.mjs to add settings for
'import/resolver' with node (include .js/.jsx/.ts/.tsx/.json) and typescript
(alwaysTryTypes: true and project paths pointing to the local tsconfig files
under components/webui), and update CI lint steps to run npm ci and the lint
command from components/webui (e.g., cd components/webui && npm ci && npm run
lint:check) so import/no-unresolved for @webui/common is resolved.

import {notification} from "antd";

import useSearchStore from "./index";
Expand Down
6 changes: 1 addition & 5 deletions components/webui/client/tsconfig/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "./tsconfig.base.json",
"include": [
"../src",
"../common/**/*"
"../src/**/*",
],

"compilerOptions": {
Expand All @@ -17,9 +16,6 @@
"tsBuildInfoFile": "../node_modules/.tmp/tsconfig.app.tsbuildinfo",
"useDefineForClassFields": true,
"baseUrl": "../",
"paths": {
"@common/*": ["../common/*"], // Map imports from "@common/*" to the shared folder
},

/* Bundler mode */
"isolatedModules": true,
Expand Down
11 changes: 0 additions & 11 deletions components/webui/client/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import path from "node:path";

import react from "@vitejs/plugin-react";
import {defineConfig} from "vite";

Expand All @@ -21,11 +19,6 @@ export default defineConfig({
react(),
],
publicDir: "public",
resolve: {
alias: {
"@common": path.resolve(__dirname, "../common"),
},
},
server: {
port: 8080,
proxy: {
Expand All @@ -41,9 +34,5 @@ export default defineConfig({
ws: true,
},
},
fs: {
// allow serving files from one level up (common folder)
allow: [".."],
},
},
});
19 changes: 19 additions & 0 deletions components/webui/common/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import CommonConfig from "eslint-config-yscope/CommonConfig.mjs";
import StylisticConfigArray from "eslint-config-yscope/StylisticConfigArray.mjs";
import TsConfigArray from "eslint-config-yscope/TsConfigArray.mjs";


const EslintConfig = [
{
ignores: [
"dist/",
"node_modules/",
],
},
CommonConfig,
...TsConfigArray,
...StylisticConfigArray,
];


export default EslintConfig;
25 changes: 24 additions & 1 deletion components/webui/common/package.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
{
"type": "module"
"name": "@webui/common",
"version": "0.1.0",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
Comment on lines +4 to +9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify export resolution and artefacts exist

Double‑check that exports point to real files after build.

Run:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "common/package.json exports:"
jq '.exports' components/webui/common/package.json

echo "Listing dist artefacts..."
ls -la components/webui/common/dist/ || true
test -f components/webui/common/dist/index.js && echo "OK: dist/index.js" || echo "MISSING: dist/index.js"
test -f components/webui/common/dist/index.d.ts && echo "OK: dist/index.d.ts" || echo "MISSING: dist/index.d.ts"

Length of output: 616


Dist directory missing – exports are broken

The components/webui/common/package.json declares exports pointing to ./dist/index.js and ./dist/index.d.ts, but the dist/ directory (and its artefacts) is entirely absent:

• No components/webui/common/dist/ folder found
index.js and index.d.ts are missing under dist/

Please ensure the build process outputs these files (or adjust the export paths accordingly) before publishing this package.

🤖 Prompt for AI Agents
In components/webui/common/package.json around lines 4 to 9, the package exports
reference ./dist/index.js and ./dist/index.d.ts but the dist/ directory and
those files are missing; update the build or package config so the exported
paths exist by either (a) modifying the build script to emit the compiled JS and
type definitions into components/webui/common/dist/ (ensure index.js and
index.d.ts are produced), or (b) changing the export paths to point to the
actual output location (for example src/ or lib/), and verify package.json
"files" and .npmignore include the dist/ artifacts before publishing.

"scripts": {
"build": "tsc",
"build:watch": "npm run build -- -w --preserveWatchOutput",
"lint:check": "eslint . --max-warnings 0",
"lint:fix": "npm run lint:check -- --fix"
},
"author": "YScope Inc. <dev@yscope.com>",
"license": "Apache-2.0",
"type": "module",
"dependencies": {
"@sinclair/typebox": "^0.34.38"
},
"devDependencies": {
"eslint-config-yscope": "1.1.1",
"typescript": "^5.7.3"
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import {Type} from "@sinclair/typebox";


/**
* Unique ID for each active unique query. Multiple clients can subscribe to the same ID if the
* queries are identical. The ID is also used to represent the socket room, and MongoDB
Expand Down Expand Up @@ -61,6 +64,7 @@ interface ServerToClientEvents {
/**
* Empty but required by Socket IO.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface InterServerEvents {
}
Comment on lines +67 to 69
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Replace empty interface with a type alias to satisfy linters (Biome) and remove the disable.

An empty interface is equivalent to {} and is flagged by Biome. Prefer a type alias and drop the eslint-disable line.

Apply this diff:

-// eslint-disable-next-line @typescript-eslint/no-empty-object-type
-interface InterServerEvents {
-}
+// Empty by design; Socket.IO requires a map of inter-server events (none used here).
+type InterServerEvents = Record<string, never>;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface InterServerEvents {
}
// Empty by design; Socket.IO requires a map of inter-server events (none used here).
type InterServerEvents = Record<string, never>;
🧰 Tools
🪛 Biome (2.1.2)

[error] 67-69: An empty interface is equivalent to {}.

Safe fix: Use a type alias instead.

(lint/suspicious/noEmptyInterface)

🤖 Prompt for AI Agents
components/webui/common/src/index.ts around lines 67 to 69: the file currently
defines an empty interface with a preceding eslint-disable comment; replace the
empty interface with an equivalent type alias (e.g., type InterServerEvents =
{}) and remove the eslint-disable-next-line line so linters (Biome) are
satisfied; ensure the rest of the code imports/uses InterServerEvents unchanged
so only the declaration is modified.


Expand Down Expand Up @@ -144,20 +148,30 @@ interface PrestoSearchResult extends PrestoRowObject {
_id: string;
}

/**
* Test TypeBox schema for testing dependency.
*/
// eslint-disable-next-line no-warning-comments
// TODO: Will be removed once shared server/client route types are migrated into common.
const TestTypeBoxSchema = Type.Object({
type: Type.String(),
});
Comment on lines +154 to +158
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Mark TestTypeBoxSchema as temporary with @deprecated instead of disabling warning comments.

This keeps intent clear for consumers and avoids “warning-comments” suppressions.

Apply this diff:

-// eslint-disable-next-line no-warning-comments
-// TODO: Will be removed once shared server/client route types are migrated into common.
-const TestTypeBoxSchema = Type.Object({
+/**
+ * @deprecated Temporary helper to validate dependency wiring.
+ * Will be removed once shared server/client route types are migrated into @webui/common.
+ */
+const TestTypeBoxSchema = Type.Object({
     type: Type.String(),
 });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// eslint-disable-next-line no-warning-comments
// TODO: Will be removed once shared server/client route types are migrated into common.
const TestTypeBoxSchema = Type.Object({
type: Type.String(),
});
/**
* @deprecated Temporary helper to validate dependency wiring.
* Will be removed once shared server/client route types are migrated into @webui/common.
*/
const TestTypeBoxSchema = Type.Object({
type: Type.String(),
});
🤖 Prompt for AI Agents
In components/webui/common/src/index.ts around lines 112 to 116, instead of
using an eslint-disable comment for a TODO, mark TestTypeBoxSchema as temporary
by adding a JSDoc @deprecated annotation above its declaration with a short note
(e.g., "@deprecated Temporary; will be removed once shared server/client route
types are migrated into common."), and remove the eslint-disable-next-line
no-warning-comments line so the intent is clear to consumers without suppressing
lint warnings.


export {
CLP_QUERY_ENGINES,
PRESTO_SEARCH_SIGNAL,
SEARCH_SIGNAL,
TestTypeBoxSchema,
};
export type {
PrestoRowObject,
PrestoSearchResult,
SearchResultsMetadataDocument,
ClientToServerEvents,
Err,
InterServerEvents,
PrestoRowObject,
PrestoSearchResult,
QueryId,
Response,
SearchResultsMetadataDocument,
ServerToClientEvents,
SocketData,
QueryId
};
34 changes: 34 additions & 0 deletions components/webui/common/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"compilerOptions": {
"esModuleInterop": true,
"lib": [
"DOM",
"ES2022",
],
"target": "ES2022",
"module": "esnext",
"moduleResolution": "bundler",
"declaration": true,
"declarationMap": true,
"outDir": "dist",
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"alwaysStrict": true,
"exactOptionalPropertyTypes": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"noUncheckedSideEffectImports": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"strict": true,
"useUnknownInCatchVariables": true,
},
"include": [
"src/**/*"
]
}
Comment on lines +30 to +34
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Exclude build artefacts to avoid accidental re-compilation

Keep TypeScript from traversing generated output or dependencies.

   "include": [
     "src/**/*"
-  ]
+  ],
+  "exclude": ["dist", "node_modules"]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
},
"include": [
"src/**/*"
]
}
},
"include": [
"src/**/*"
],
"exclude": ["dist", "node_modules"]
}
🤖 Prompt for AI Agents
In components/webui/common/tsconfig.json around lines 29 to 33, the config only
specifies "include" and does not exclude build artifacts or dependency folders;
add an "exclude" array to prevent TypeScript from traversing generated output
and dependencies (e.g. node_modules, dist, build, .next, out, and other
build/test artifacts) so the compiler only processes source files and avoids
accidental re-compilation or slowdowns.

Loading
Loading