diff --git a/dashboard/.yarnrc.yml b/dashboard/.yarnrc.yml index e81d521..9bdeb26 100644 --- a/dashboard/.yarnrc.yml +++ b/dashboard/.yarnrc.yml @@ -4,4 +4,4 @@ enableGlobalCache: false nodeLinker: node-modules -npmRegistryServer: "https://registry.npmjs.org" +npmRegistryServer: "https://registry.npmmirror.com" diff --git a/dashboard/Makefile b/dashboard/Makefile index e2734cb..fa03da4 100644 --- a/dashboard/Makefile +++ b/dashboard/Makefile @@ -26,35 +26,35 @@ icon: @echo "✅ Icons generated successfully." init: - @echo "🔧 Installing dependencies for dashboard..." - @corepack enable && corepack prepare yarn@$(YARN_VERSION) --activate - @if [ -z "$(YARN)" ]; then \ - echo "⚠️ Yarn not found. Attempting to install..."; \ - if [ "$(OS)" = "Darwin" ]; then \ - if command -v brew >/dev/null 2>&1; then \ - brew install yarn; \ - else \ - echo "❌ Homebrew not found. Please install Yarn manually."; exit 1; \ - fi; \ - elif [ -f /etc/debian_version ]; then \ - curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \ - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \ - sudo apt update && sudo apt install -y yarn; \ - elif [ -f /etc/redhat-release ]; then \ - curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo && \ - sudo yum install -y yarn; \ + @echo "🔧 Installing dependencies for dashboard..." + @corepack enable && corepack prepare yarn@$(YARN_VERSION) --activate + @if [ -z "$(YARN)" ]; then \ + echo "⚠️ Yarn not found. Attempting to install..."; \ + if [ "$(OS)" = "Darwin" ]; then \ + if command -v brew >/dev/null 2>&1; then \ + brew install yarn; \ else \ - echo "❌ Unsupported OS. Please install Yarn manually."; exit 1; \ - fi; \ - fi - yarn config set npmRegistryServer https://registry.npmmirror.com - yarn install --immutable + echo "❌ Homebrew not found. Please install Yarn manually."; exit 1; \ + fi; \ + elif [ -f /etc/debian_version ]; then \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \ + sudo apt update && sudo apt install -y yarn; \ + elif [ -f /etc/redhat-release ]; then \ + curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo && \ + sudo yum install -y yarn; \ + else \ + echo "❌ Unsupported OS. Please install Yarn manually."; exit 1; \ + fi; \ + fi + yarn config set npmRegistryServer https://registry.npmmirror.com + yarn install --immutable ensure-deps: - @if [ ! -f .yarn/install-state.gz ] || [ ! -d node_modules ] || [ ! -d node_modules/sanitize-html ]; then \ - echo "📦 Installing dependencies..."; \ - yarn install --immutable; \ - fi + @if [ ! -f .yarn/install-state.gz ] || [ ! -d node_modules ] || [ ! -d node_modules/sanitize-html ]; then \ + echo "📦 Installing dependencies..."; \ + yarn install --immutable; \ + fi dev: ensure-deps @echo "🚀 Starting Next.js dev server (dashboard)..." @@ -80,10 +80,10 @@ test: @yarn test || echo "No tests configured" build: init - yarn config set npmRegistryServer https://registry.npmmirror.com - @if [ -z "$(SKIP_SYNC)" ]; then \ - $(MAKE) sync-dl-index; \ - fi + yarn config set npmRegistryServer https://registry.npmmirror.com + @if [ -z "$(SKIP_SYNC)" ]; then \ + $(MAKE) sync-dl-index; \ + fi @echo "🔨 Building dashboard..." yarn next build diff --git a/dashboard/next-env.d.ts b/dashboard/next-env.d.ts index c4b7818..9edff1c 100644 --- a/dashboard/next-env.d.ts +++ b/dashboard/next-env.d.ts @@ -1,6 +1,6 @@ /// /// -import "./.next/dev/types/routes.d.ts"; +import "./.next/types/routes.d.ts"; // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.