Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions eduaid_web/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": false,
"tailwind": {
"config": "tailwind.config.js",
"css": "src/index.css",
"baseColor": "gray",
"cssVariables": true,
"prefix": ""
},
"iconLibrary": "lucide",
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
}
Comment on lines +14 to +20
Copy link

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 jsconfig path alias matches these aliases

Prevents broken imports like "@/lib/utils".


🏁 Script executed:

#!/bin/bash
set -euo pipefail
cat eduaid_web/jsconfig.json 2>/dev/null || echo "jsconfig.json missing under eduaid_web/"

Length of output: 210


Sync jsconfig.json paths with components.json aliases
In eduaid_web/jsconfig.json under compilerOptions.paths, add explicit mappings for:

  • components/* → components/*
  • utils/* → lib/utils/*
  • ui/* → components/ui/*
  • lib/* → lib/*
  • hooks/* → hooks/*

This ensures imports like import X from 'utils/helpers' resolve in editors.

🤖 Prompt for AI Agents
In eduaid_web/components.json around lines 14 to 20: the path aliases defined
here are not mirrored in eduaid_web/jsconfig.json, causing editor/module
resolution failures; open eduaid_web/jsconfig.json and under
compilerOptions.paths add explicit mappings: "components/*": ["components/*"],
"utils/*": ["lib/utils/*"], "ui/*": ["components/ui/*"], "lib/*": ["lib/*"], and
"hooks/*": ["hooks/*"] so imports like import X from 'utils/helpers' resolve
correctly; save the file and reload the editor/TS server.

}
10 changes: 10 additions & 0 deletions eduaid_web/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"baseUrl": "src",
"paths": {
"@/*": ["*"]
},
"jsx": "react-jsx"
},
"include": ["src", "postcss.config.js"]
}
Comment on lines +1 to +10
Copy link

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 alias requires bundler support—verify Vite/Webpack alias config

"paths": { "@/*": ["*"] } in jsconfig improves DX but doesn’t configure the bundler. Ensure vite.config.* (or Webpack) has a matching resolve.alias for @ -> src.


🏁 Script executed:

#!/bin/bash
# 1) Do we use '@/' imports?
rg -nP "from ['\"]@/" --type=js --type=jsx --type=ts --type=tsx src || true

# 2) Do we have bundler alias config?
fd -a "vite.config.*" -E node_modules
fd -a "webpack.config.*" -E node_modules

# 3) Try to spot alias usage in Vite config (if present)
if fd -q "vite.config.*" -E node_modules; then
  rg -nP "resolve\s*:\s*\{[^}]*alias" -C3 $(fd -a "vite.config.*" -E node_modules)
fi

Length of output: 490


Add @ path alias to Vite config
Vite currently has no resolve.alias mapping for @/*, so imports like @/components/... will fail at build time. In vite.config.js, under resolve, add:

import { defineConfig } from 'vite'
import path from 'path'

export default defineConfig({
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src'),
    },
  },
  // …
})
🤖 Prompt for AI Agents
In eduaid_web/jsconfig.json lines 1-10: Vite lacks a resolve.alias for the
"@/..." path defined here, so runtime/build imports using "@/..." will fail;
open eduaid_web/vite.config.js and under the top-level resolve setting add an
alias mapping that points '@' to the project's src directory (use path.resolve
with an imported path module) and ensure the file uses defineConfig export so
Vite picks up the configuration.

Loading