chore(dashboard): switch yarn registry to npmmirror; tidy Makefile; fix next-env types path
This commit is contained in:
parent
c3534ad274
commit
88d66b4c00
@ -4,4 +4,4 @@ enableGlobalCache: false
|
||||
|
||||
nodeLinker: node-modules
|
||||
|
||||
npmRegistryServer: "https://registry.npmjs.org"
|
||||
npmRegistryServer: "https://registry.npmmirror.com"
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
2
dashboard/next-env.d.ts
vendored
2
dashboard/next-env.d.ts
vendored
@ -1,6 +1,6 @@
|
||||
/// <reference types="next" />
|
||||
/// <reference types="next/image-types/global" />
|
||||
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.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user