Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1b5286946 | ||
|
|
bd2cfa5a26 | ||
|
|
afd2b3333c | ||
|
|
05b0a1af72 | ||
|
|
5b0a394216 | ||
|
|
2709181557 | ||
|
|
6745fcdc3f | ||
|
|
2f80b96a95 | ||
|
|
cf29d44ff8 | ||
|
|
c97498a2ae | ||
|
|
69bdaf0113 | ||
|
|
8eee3242bf | ||
|
|
4405097f56 |
No files matched your search
@@ -18,6 +18,9 @@
|
|||||||
.claude
|
.claude
|
||||||
skills
|
skills
|
||||||
|
|
||||||
|
# unused design candidates (not referenced by the app)
|
||||||
|
/public/CandidatesIMages
|
||||||
|
|
||||||
# project meta / docs
|
# project meta / docs
|
||||||
memory-bank
|
memory-bank
|
||||||
docs
|
docs
|
||||||
|
|||||||
@@ -13,23 +13,20 @@ jobs:
|
|||||||
deploy:
|
deploy:
|
||||||
runs-on: local-host
|
runs-on: local-host
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout and deploy on the VPS
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: "22"
|
||||||
|
cache: npm
|
||||||
|
|
||||||
|
- name: Build Next.js standalone (host; npm cache reused between runs)
|
||||||
env:
|
env:
|
||||||
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
NEXT_PUBLIC_SITE_URL: https://edu.mstaut.ir
|
||||||
REPO_ACTOR: ${{ github.actor }}
|
run: bash scripts/ci-build-prebuilt.sh
|
||||||
REPO_NAME: ${{ github.repository }}
|
|
||||||
DEPLOY_SHA: ${{ github.sha }}
|
- name: Roll out (runtime image, backup, migrate, smoke, swap)
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
TARGET=/opt/prod/Aut.ManagementFaculty
|
rm -rf prebuilt/static
|
||||||
mkdir -p "$TARGET"
|
PREBUILT_DIR="$GITHUB_WORKSPACE/prebuilt" bash scripts/deploy-production.sh
|
||||||
if [ ! -d "$TARGET/.git" ]; then
|
|
||||||
git -C "$TARGET" init
|
|
||||||
git -C "$TARGET" remote add origin "http://127.0.0.1:8301/$REPO_NAME.git"
|
|
||||||
fi
|
|
||||||
# Supply the job token only for fetch; never store it in .git/config.
|
|
||||||
AUTH=$(printf '%s:%s' "$REPO_ACTOR" "$REPO_TOKEN" | base64 -w0)
|
|
||||||
git -C "$TARGET" -c "http.extraHeader=Authorization: Basic $AUTH" fetch --depth=1 origin "$DEPLOY_SHA"
|
|
||||||
unset AUTH REPO_TOKEN
|
|
||||||
git -C "$TARGET" checkout --detach --force FETCH_HEAD
|
|
||||||
bash "$TARGET/scripts/deploy-production.sh"
|
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
|
# syntax=docker/dockerfile:1
|
||||||
# ---- Dependencies ----
|
# ---- Dependencies ----
|
||||||
FROM node:22-alpine AS deps
|
FROM node:22-alpine AS deps
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
RUN npm ci
|
# Skip audit/fund in image builds (saves ~30–60s); keep npm cache across deploys.
|
||||||
|
RUN --mount=type=cache,target=/root/.npm \
|
||||||
|
npm ci --no-audit --no-fund
|
||||||
|
|
||||||
# ---- Builder ----
|
# ---- Builder ----
|
||||||
FROM node:22-alpine AS builder
|
FROM node:22-alpine AS builder
|
||||||
|
|||||||
@@ -74,16 +74,16 @@ async function main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const tables = await client.query(`
|
const tables = await client.query(`
|
||||||
SELECT table_name
|
SELECT count(*)::int AS n
|
||||||
FROM information_schema.tables
|
FROM information_schema.tables
|
||||||
WHERE table_schema = 'public' AND table_type = 'BASE TABLE'
|
WHERE table_schema = 'public' AND table_type = 'BASE TABLE'
|
||||||
ORDER BY table_name
|
|
||||||
`);
|
`);
|
||||||
|
|
||||||
console.log(`applied_count: ${appliedCount}`);
|
console.log(`applied_count: ${appliedCount}`);
|
||||||
console.log(`skipped (already applied): ${skipped.length ? skipped.join(", ") : "none"}`);
|
if (skipped.length) {
|
||||||
console.log(`tables_count: ${tables.rows.length}`);
|
console.log(`skipped_count: ${skipped.length}`);
|
||||||
console.log(JSON.stringify(tables.rows.map((r) => r.table_name)));
|
}
|
||||||
|
console.log(`tables_count: ${tables.rows[0].n}`);
|
||||||
} finally {
|
} finally {
|
||||||
await client.end().catch(() => {});
|
await client.end().catch(() => {});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Rich HTML fields for course detail: ad lead under hero title + main body.
|
||||||
|
ALTER TABLE courses
|
||||||
|
ADD COLUMN IF NOT EXISTS lead_html TEXT NOT NULL DEFAULT '',
|
||||||
|
ADD COLUMN IF NOT EXISTS body_html TEXT NOT NULL DEFAULT '';
|
||||||
@@ -121,7 +121,8 @@ async function main() {
|
|||||||
|
|
||||||
await upsert("courses", courses.map(courseToRow), [
|
await upsert("courses", courses.map(courseToRow), [
|
||||||
"id", "slug", "title", "summary", "duration_hours", "format", "price",
|
"id", "slug", "title", "summary", "duration_hours", "format", "price",
|
||||||
"registration_url", "poster_image_url", "brochure_image_url", "image_url", "seo_description", "published",
|
"registration_url", "poster_image_url", "brochure_image_url", "image_url",
|
||||||
|
"lead_html", "body_html", "seo_description", "published",
|
||||||
]);
|
]);
|
||||||
const courseIds = courses.map((c) => c.id);
|
const courseIds = courses.map((c) => c.id);
|
||||||
await client.query(
|
await client.query(
|
||||||
|
|||||||
@@ -39,3 +39,16 @@
|
|||||||
- [x] 19. سرچ آیکونی؛ با انیمیشن جایگزین دسته/تگ (هدر بدون دسته)
|
- [x] 19. سرچ آیکونی؛ با انیمیشن جایگزین دسته/تگ (هدر بدون دسته)
|
||||||
- [x] 20. کل کارت دوره قابل کلیک
|
- [x] 20. کل کارت دوره قابل کلیک
|
||||||
- [x] 21. لیبل دسته/تگ روی کارت و جزئیات دوره کلیکپذیر (فیلتر)
|
- [x] 21. لیبل دسته/تگ روی کارت و جزئیات دوره کلیکپذیر (فیلتر)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## قفلکنندهٔ نسخههای بعدی (الان نکن)
|
||||||
|
|
||||||
|
منبع: لاگ دیپلوی پروداکشن `69bdaf0` (2026-10-16). وضعیت فعلی دیپلوی سالم است؛ اینها بدهی/بهروزرسانی اختیاریاند و نباید وسط فیچر جاری باز شوند.
|
||||||
|
|
||||||
|
- [ ] **V-LOCK npm audit** — در `npm ci` داخل Docker: ۱۲ vulnerability (۱۱ high + ۱ critical). در نسخهٔ بعدی: `npm audit` / `npm audit fix` (بدون `--force` مگر بعد از تست)، سپس بیلد+دیپلوی استیجینگ.
|
||||||
|
- [ ] **V-LOCK ESLint EOL** — هشدار `eslint@9.39.5` deprecated / version-support. در نسخهٔ بعدی: ارتقا به خط پشتیبانیشدهٔ ESLint و همتراز کردن config/پلاگینها.
|
||||||
|
- [ ] **V-LOCK npm toolchain** — notice: npm داخل ایمیج `10.9.9` → پیشنهاد `12.x`. در نسخهٔ بعدی: تصمیم pinned (packageManager / image tag) و تست `npm ci` روی همان نسخه.
|
||||||
|
- [ ] **V-LOCK deploy checkout noise** — git detach روی `/opt/prod/...` هشدار «leaving 1 commit behind» میدهد (طبیعی برای shallow+detach). در نسخهٔ بعدی: در ورکفلو `fetch --prune` / پاکسازی refهای یتیم یا ساکتکردن هشدار غیرضروری تا لاگ تمیزتر شود.
|
||||||
|
- [ ] **V-LOCK Docker build context size** — transfer context حدود ۵۵MB در بیلد. در نسخهٔ بعدی: بازبینی `.dockerignore` و داراییهای سنگین `public/` تا کش deps کمتر invalidate شود و بیلد سبکتر شود.
|
||||||
|
- [ ] **V-LOCK Docker build wall-time** — بیلد پروداکشن ~۱۵–۲۰ دقیقه (npm ci + copy node_modules + Next webpack/TS با ۱ worker). در نسخهٔ بعدی: کش لایه/registry، کاهش دارایی در context، و در صورت امکان افزایش CPU برای workerهای Next.
|
||||||
@@ -1,10 +1,16 @@
|
|||||||
# Production deployment
|
# Production deployment
|
||||||
|
|
||||||
The production site is https://edu.mstaut.ir. Gitea runs on the same VPS.
|
The production site is https://edu.mstaut.ir. Gitea runs on the same VPS.
|
||||||
Pushes to `master` run `.gitea/workflows/deploy.yml` on the existing
|
|
||||||
`local-host` runner. The checkout lives at `/opt/prod/Aut.ManagementFaculty`.
|
|
||||||
|
|
||||||
`scripts/deploy-production.sh` builds a Next.js standalone Docker image,
|
**Normal releases are fully automatic:** a push to `master` (or
|
||||||
|
*workflow_dispatch* in Gitea) runs `.gitea/workflows/deploy.yml` on the
|
||||||
|
`local-host` runner — checkout, `npm ci` + `next build` on the runner host
|
||||||
|
(with npm cache), then `scripts/deploy-production.sh` with a prebuilt tree
|
||||||
|
(`Dockerfile.prebuilt`: no second `npm ci` / compile inside Docker). Backup,
|
||||||
|
migrations, smoke checks, and container swap need no manual steps.
|
||||||
|
|
||||||
|
`scripts/deploy-production.sh` builds the Docker image from `PREBUILT_DIR` in CI
|
||||||
|
(or from the full root `Dockerfile` only for emergency/local use without CI),
|
||||||
backs up the database to `/opt/backups/edu`, applies versioned migrations
|
backs up the database to `/opt/backups/edu`, applies versioned migrations
|
||||||
(`node db/migrate.mjs` — idempotent via `schema_migrations`), checks a
|
(`node db/migrate.mjs` — idempotent via `schema_migrations`), checks a
|
||||||
candidate container, and replaces `aut-management-faculty`. It retains the
|
candidate container, and replaces `aut-management-faculty`. It retains the
|
||||||
@@ -30,15 +36,6 @@ port 443, with `edu.mstaut.ir` as the origin host name. Leave the ACME
|
|||||||
challenge path accessible for certificate renewal and bypass caching for
|
challenge path accessible for certificate renewal and bypass caching for
|
||||||
admin pages, API requests, and authenticated traffic.
|
admin pages, API requests, and authenticated traffic.
|
||||||
|
|
||||||
To deploy manually on the VPS:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cd /opt/prod/Aut.ManagementFaculty
|
|
||||||
git fetch origin master
|
|
||||||
git checkout --detach origin/master
|
|
||||||
bash scripts/deploy-production.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
To inspect a deployment:
|
To inspect a deployment:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@@ -46,3 +43,5 @@ docker logs --tail 100 aut-management-faculty
|
|||||||
curl --resolve edu.mstaut.ir:443:127.0.0.1 https://edu.mstaut.ir/
|
curl --resolve edu.mstaut.ir:443:127.0.0.1 https://edu.mstaut.ir/
|
||||||
certbot renew --cert-name edu.mstaut.ir --dry-run
|
certbot renew --cert-name edu.mstaut.ir --dry-run
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@@ -25,6 +25,11 @@ const nextConfig: NextConfig = {
|
|||||||
destination: "https://mst.aut.ac.ir/content/31094/شبکه-اساتید",
|
destination: "https://mst.aut.ac.ir/content/31094/شبکه-اساتید",
|
||||||
permanent: true,
|
permanent: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
source: "/images/faculty/placeholder.png",
|
||||||
|
destination: "/images/faculty/placeholder.webp",
|
||||||
|
permanent: true,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
"class-variance-authority": "^0.7.1",
|
"class-variance-authority": "^0.7.1",
|
||||||
"cn": "^0.3.2",
|
"cn": "^0.3.2",
|
||||||
"embla-carousel-react": "^8.6.0",
|
"embla-carousel-react": "^8.6.0",
|
||||||
|
"isomorphic-dompurify": "^4.6.0",
|
||||||
"lucide-react": "^1.47.0",
|
"lucide-react": "^1.47.0",
|
||||||
"next": "16.3.5",
|
"next": "16.3.5",
|
||||||
"next-intl": "^4.14.6",
|
"next-intl": "^4.14.6",
|
||||||
@@ -25,6 +26,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tailwindcss/postcss": "^4",
|
"@tailwindcss/postcss": "^4",
|
||||||
|
"@types/dompurify": "^3.0.5",
|
||||||
"@types/node": "^20",
|
"@types/node": "^20",
|
||||||
"@types/pg": "^8.23.1",
|
"@types/pg": "^8.23.1",
|
||||||
"@types/react": "^19",
|
"@types/react": "^19",
|
||||||
@@ -49,6 +51,55 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@asamuzakjp/css-color": {
|
||||||
|
"version": "7.1.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-7.1.7.tgz",
|
||||||
|
"integrity": "sha512-Q7ioeear07HwixdIitIn9KS1LZi97CEDFCSjPNm9v+y8KNbsu9q4Lrd4zUQW4faED+E7qxvfeVnbNRW46wFKuw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@csstools/css-calc": "^3.4.3",
|
||||||
|
"@csstools/css-color-parser": "^4.2.6",
|
||||||
|
"@csstools/css-parser-algorithms": "^4.0.2",
|
||||||
|
"@csstools/css-tokenizer": "^4.0.2",
|
||||||
|
"lru-cache": "^11.5.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^22.22.2 || ^24.15.0 || >=26.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@asamuzakjp/css-color/node_modules/lru-cache": {
|
||||||
|
"version": "11.5.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz",
|
||||||
|
"integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==",
|
||||||
|
"license": "BlueOak-1.0.0",
|
||||||
|
"engines": {
|
||||||
|
"node": "20 || >=22"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@asamuzakjp/dom-selector": {
|
||||||
|
"version": "10.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@asamuzakjp/dom-selector/-/dom-selector-10.0.4.tgz",
|
||||||
|
"integrity": "sha512-A6f1nKy99I6tyoK82U6kBHvQQZmdHmTmPzJYPY/0eaOW0r8/qPmEOwjGHs+hL/vCgOwQTupu4LT1XtXNUuDruA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"bidi-js": "^1.1.0",
|
||||||
|
"css-tree": "^3.2.1",
|
||||||
|
"is-potential-custom-element-name": "^1.0.1",
|
||||||
|
"lru-cache": "^11.5.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^22.22.2 || ^24.15.0 || >=26.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@asamuzakjp/dom-selector/node_modules/lru-cache": {
|
||||||
|
"version": "11.5.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz",
|
||||||
|
"integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==",
|
||||||
|
"license": "BlueOak-1.0.0",
|
||||||
|
"engines": {
|
||||||
|
"node": "20 || >=22"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@babel/code-frame": {
|
"node_modules/@babel/code-frame": {
|
||||||
"version": "7.29.7",
|
"version": "7.29.7",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz",
|
||||||
@@ -523,6 +574,152 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@bramus/specificity": {
|
||||||
|
"version": "2.4.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@bramus/specificity/-/specificity-2.4.3.tgz",
|
||||||
|
"integrity": "sha512-0GEz8qJWokkUVYQYRukmkSHIFNoBH8QTreeHrAFbvz1XFYc3Y+puhMs8PQ5x8GNugiC2l5jvDBXKLbBIByeSBw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"css-tree": "^3.2.1"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"specificity": "bin/cli.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@csstools/color-helpers": {
|
||||||
|
"version": "6.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-6.1.2.tgz",
|
||||||
|
"integrity": "sha512-grhRy3OKmniaAEKXMjua5z/EODX0MSqBGjunw8+j/3HQjOnahs2AGhvEOIYVUWcU6ScApbhLhVrQTX8XqrMrow==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/csstools"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/csstools"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT-0",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20.19.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@csstools/css-calc": {
|
||||||
|
"version": "3.4.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-3.4.3.tgz",
|
||||||
|
"integrity": "sha512-iex20d8CHVkyvg6B7UKV7uHnI2Bqo9g+EFfT9E0y+GvTvhZ/DwONJ+9aKb1dlqm0ZiGsL5RXjp0fCoJYnkeDjA==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/csstools"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/csstools"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20.19.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@csstools/css-parser-algorithms": "^4.0.2",
|
||||||
|
"@csstools/css-tokenizer": "^4.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@csstools/css-color-parser": {
|
||||||
|
"version": "4.2.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-4.2.6.tgz",
|
||||||
|
"integrity": "sha512-iiPQ3iRWwnJkeEn6RIu6SJPr7hYrLz6XZ9s/QZl+2/LI5KQVjpl2fdmDSZKuD4xP6GMmMPgHFFXg6k1Wkz0Trg==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/csstools"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/csstools"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@csstools/color-helpers": "^6.1.2",
|
||||||
|
"@csstools/css-calc": "^3.4.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20.19.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@csstools/css-parser-algorithms": "^4.0.2",
|
||||||
|
"@csstools/css-tokenizer": "^4.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@csstools/css-parser-algorithms": {
|
||||||
|
"version": "4.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-4.0.2.tgz",
|
||||||
|
"integrity": "sha512-40cSKyMvK+tq4qz6Awrlye2WGuOKt3FwPgtGg6KTfbHOWNw+Rk1rzbAtZnZ6IBhsY491HLRnDXwoyBAijmmILA==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/csstools"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/csstools"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20.19.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@csstools/css-tokenizer": "^4.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@csstools/css-syntax-patches-for-csstree": {
|
||||||
|
"version": "1.1.15",
|
||||||
|
"resolved": "https://registry.npmjs.org/@csstools/css-syntax-patches-for-csstree/-/css-syntax-patches-for-csstree-1.1.15.tgz",
|
||||||
|
"integrity": "sha512-J0u7HkVl2nzSlhsiTOp4AmwcUQ3D+mGEEKfBy/7To5/y7F2OHwyLrXfrhR0SMgr4p5Lo+eaMVSeai24zUcBIxA==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/csstools"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/csstools"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT-0",
|
||||||
|
"peerDependencies": {
|
||||||
|
"css-tree": "^3.2.1"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"css-tree": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@csstools/css-tokenizer": {
|
||||||
|
"version": "4.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-4.0.2.tgz",
|
||||||
|
"integrity": "sha512-OoKoR0f76dCY666JlcbhmVTs2drYj1GUXZTYTcbUgJjh9Nv41aFfZ21bPQTERm5+L5cBDo466NltB2lplS5GBw==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/csstools"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/csstools"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20.19.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@dotenvx/dotenvx": {
|
"node_modules/@dotenvx/dotenvx": {
|
||||||
"version": "1.75.1",
|
"version": "1.75.1",
|
||||||
"resolved": "https://registry.npmjs.org/@dotenvx/dotenvx/-/dotenvx-1.75.1.tgz",
|
"resolved": "https://registry.npmjs.org/@dotenvx/dotenvx/-/dotenvx-1.75.1.tgz",
|
||||||
@@ -959,6 +1156,23 @@
|
|||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@exodus/bytes": {
|
||||||
|
"version": "1.16.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@exodus/bytes/-/bytes-1.16.0.tgz",
|
||||||
|
"integrity": "sha512-IcpW84uEn3N7ETtNZMlxKhfl6Pec8rUNGOTBtWbK1FKhJxIFAptZyVrvVRVBimAJxJCgc3PxepxkdWWG4DVzfA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": "^20.19.0 || ^22.12.0 || >=24.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@noble/hashes": "^1.8.0 || ^2.0.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@noble/hashes": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@floating-ui/core": {
|
"node_modules/@floating-ui/core": {
|
||||||
"version": "1.8.0",
|
"version": "1.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.8.0.tgz",
|
||||||
@@ -2995,6 +3209,16 @@
|
|||||||
"tslib": "^2.4.0"
|
"tslib": "^2.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/dompurify": {
|
||||||
|
"version": "3.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/dompurify/-/dompurify-3.0.5.tgz",
|
||||||
|
"integrity": "sha512-1Wg0g3BtQF7sSb27fJQAKck1HECM6zV1EB66j8JH9i3LCjYabJa0FSdiSgsD5K/RbrsR0SiraKacLB+T8ZVYAg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/trusted-types": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@types/estree": {
|
"node_modules/@types/estree": {
|
||||||
"version": "1.0.9",
|
"version": "1.0.9",
|
||||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz",
|
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz",
|
||||||
@@ -3058,6 +3282,13 @@
|
|||||||
"@types/react": "^19.3.0"
|
"@types/react": "^19.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/trusted-types": {
|
||||||
|
"version": "2.0.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz",
|
||||||
|
"integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==",
|
||||||
|
"devOptional": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/@types/validate-npm-package-name": {
|
"node_modules/@types/validate-npm-package-name": {
|
||||||
"version": "4.0.2",
|
"version": "4.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/@types/validate-npm-package-name/-/validate-npm-package-name-4.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@types/validate-npm-package-name/-/validate-npm-package-name-4.0.2.tgz",
|
||||||
@@ -4118,6 +4349,15 @@
|
|||||||
"node": ">=6.0.0"
|
"node": ">=6.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/bidi-js": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/bidi-js/-/bidi-js-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-fX1Onk0tdVPC7obPWB5EbJ1z7NVhLq4m2xZLq2YXBkxzMXIGRpNMU88n0EPgWseKl12J7zXs7qrDxPK4sRs2fg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"require-from-string": "^2.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/body-parser": {
|
"node_modules/body-parser": {
|
||||||
"version": "2.3.0",
|
"version": "2.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz",
|
||||||
@@ -4621,6 +4861,19 @@
|
|||||||
"node": ">= 8"
|
"node": ">= 8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/css-tree": {
|
||||||
|
"version": "3.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-3.2.1.tgz",
|
||||||
|
"integrity": "sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"mdn-data": "2.27.1",
|
||||||
|
"source-map-js": "^1.2.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/cssesc": {
|
"node_modules/cssesc": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
|
||||||
@@ -4647,6 +4900,19 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "BSD-2-Clause"
|
"license": "BSD-2-Clause"
|
||||||
},
|
},
|
||||||
|
"node_modules/data-urls": {
|
||||||
|
"version": "8.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/data-urls/-/data-urls-8.0.0.tgz",
|
||||||
|
"integrity": "sha512-JQUCCK+/CAGbGGx618PlFZMXH81Jtj7t73CHv9dd/zVWvxgGT2zLFRjnKb+Ng46GIwcy+f7f88qd4duqllK+WQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"whatwg-mimetype": "^5.0.0",
|
||||||
|
"whatwg-url": "^17.1.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^22.14.0 || >=24.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/data-view-buffer": {
|
"node_modules/data-view-buffer": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz",
|
||||||
@@ -4733,6 +4999,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/decimal.js": {
|
||||||
|
"version": "10.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz",
|
||||||
|
"integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/dedent": {
|
"node_modules/dedent": {
|
||||||
"version": "1.7.2",
|
"version": "1.7.2",
|
||||||
"resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.2.tgz",
|
"resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.2.tgz",
|
||||||
@@ -4879,6 +5151,15 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/dompurify": {
|
||||||
|
"version": "3.4.17",
|
||||||
|
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.17.tgz",
|
||||||
|
"integrity": "sha512-B/pSlYVHQ58kqISD/yDjuJ1yfzI34m1gF4lAod2bwSRhiN4K5Cl3H8Af7hqB2PmTL911tdEudnnXn5FnhRoz0w==",
|
||||||
|
"license": "(MPL-2.0 OR Apache-2.0)",
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@types/trusted-types": "^2.0.7"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/dot-prop": {
|
"node_modules/dot-prop": {
|
||||||
"version": "6.0.1",
|
"version": "6.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
|
||||||
@@ -5003,6 +5284,18 @@
|
|||||||
"node": ">=8.6"
|
"node": ">=8.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/entities": {
|
||||||
|
"version": "8.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/entities/-/entities-8.1.0.tgz",
|
||||||
|
"integrity": "sha512-kxL7msIffSuh9aaFAMD7rxAIuTRMAHMeBtgHW2yUdWw732ZNh4MehkF2gdjvtdmikkaIP9bFDDJOPlsvm7avrA==",
|
||||||
|
"license": "BSD-2-Clause",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20.19.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/fb55/entities?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/env-paths": {
|
"node_modules/env-paths": {
|
||||||
"version": "2.2.1",
|
"version": "2.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz",
|
||||||
@@ -6360,6 +6653,18 @@
|
|||||||
"node": ">=16.9.0"
|
"node": ">=16.9.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/html-encoding-sniffer": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-UikN5yr7xsCDAq87Or5or0PAlD3HJJOKVzM05az588WnpDJ4Ux7a2A53Qi6gofGg2/EtvF/H4hCi/TXfCW4Y6w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@exodus/bytes": "^1.15.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^22.13.0 || >=24.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/http-errors": {
|
"node_modules/http-errors": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
|
||||||
@@ -6886,6 +7191,12 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/is-potential-custom-element-name": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/is-promise": {
|
"node_modules/is-promise": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",
|
||||||
@@ -7101,6 +7412,19 @@
|
|||||||
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
|
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
|
"node_modules/isomorphic-dompurify": {
|
||||||
|
"version": "4.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/isomorphic-dompurify/-/isomorphic-dompurify-4.6.0.tgz",
|
||||||
|
"integrity": "sha512-ZLYxxq2efNUsaUMViQXML/HMBkaJSd8WAFcNJQfWOGi+KLGQyZA8Ewpcj7yWur6KzMHlrZNXTXr8trbx/bkZRw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"dompurify": "^3.4.17",
|
||||||
|
"jsdom": "^30.1.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^22.22.2 || ^24.15.0 || >=26.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/iterator.prototype": {
|
"node_modules/iterator.prototype": {
|
||||||
"version": "1.1.5",
|
"version": "1.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.5.tgz",
|
||||||
@@ -7166,6 +7490,63 @@
|
|||||||
"js-yaml": "bin/js-yaml.js"
|
"js-yaml": "bin/js-yaml.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/jsdom": {
|
||||||
|
"version": "30.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-30.1.3.tgz",
|
||||||
|
"integrity": "sha512-hQMUPvRgN7KxsfIytDQji7bimuJeRQa6Qo5+iuiZQk5CafeRxLIA10/cG5YCBFNpD9RO3oqIiN4CO1Y44kxqXg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@asamuzakjp/css-color": "^7.1.3",
|
||||||
|
"@asamuzakjp/dom-selector": "^10.0.3",
|
||||||
|
"@bramus/specificity": "^2.4.2",
|
||||||
|
"@csstools/css-syntax-patches-for-csstree": "^1.1.15",
|
||||||
|
"@exodus/bytes": "^1.16.0",
|
||||||
|
"css-tree": "^3.2.1",
|
||||||
|
"data-urls": "^8.0.0",
|
||||||
|
"decimal.js": "^10.6.0",
|
||||||
|
"html-encoding-sniffer": "^7.0.0",
|
||||||
|
"is-potential-custom-element-name": "^1.0.1",
|
||||||
|
"lru-cache": "^11.5.3",
|
||||||
|
"parse5": "^8.0.1",
|
||||||
|
"saxes": "^6.0.0",
|
||||||
|
"tough-cookie": "^6.0.2",
|
||||||
|
"undici": "^8.12.1",
|
||||||
|
"w3c-xmlserializer": "^6.0.0",
|
||||||
|
"webidl-conversions": "^8.0.1",
|
||||||
|
"whatwg-mimetype": "^5.0.0",
|
||||||
|
"whatwg-url": "^17.2.0",
|
||||||
|
"xml-name-validator": "^5.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^22.22.2 || ^24.15.0 || >=26.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"canvas": "^3.2.3"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"canvas": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/jsdom/node_modules/lru-cache": {
|
||||||
|
"version": "11.5.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz",
|
||||||
|
"integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==",
|
||||||
|
"license": "BlueOak-1.0.0",
|
||||||
|
"engines": {
|
||||||
|
"node": "20 || >=22"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/jsdom/node_modules/undici": {
|
||||||
|
"version": "8.12.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/undici/-/undici-8.12.3.tgz",
|
||||||
|
"integrity": "sha512-+fdndUTwBP86cVjihTp21hZHo7d6oj1c/47XPA3lL8mM0XHs+C4EkcjmgRsFnFk2f/UONGDy9ItBItmXsLOQHw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=22.19.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/jsesc": {
|
"node_modules/jsesc": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
|
||||||
@@ -7696,6 +8077,12 @@
|
|||||||
"node": ">= 0.4"
|
"node": ">= 0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/mdn-data": {
|
||||||
|
"version": "2.27.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.27.1.tgz",
|
||||||
|
"integrity": "sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==",
|
||||||
|
"license": "CC0-1.0"
|
||||||
|
},
|
||||||
"node_modules/media-typer": {
|
"node_modules/media-typer": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.1.tgz",
|
||||||
@@ -8447,6 +8834,18 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/parse5": {
|
||||||
|
"version": "8.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/parse5/-/parse5-8.0.1.tgz",
|
||||||
|
"integrity": "sha512-z1e/HMG90obSGeidlli3hj7cbocou0/wa5HacvI3ASx34PecNjNQeaHNo5WIZpWofN9kgkqV1q5YvXe3F0FoPw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"entities": "^8.0.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/inikulin/parse5?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/parseurl": {
|
"node_modules/parseurl": {
|
||||||
"version": "1.3.3",
|
"version": "1.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
|
||||||
@@ -8875,7 +9274,6 @@
|
|||||||
"version": "2.3.1",
|
"version": "2.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
|
||||||
"integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
|
"integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
@@ -9244,6 +9642,18 @@
|
|||||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/saxes": {
|
||||||
|
"version": "6.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz",
|
||||||
|
"integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"xmlchars": "^2.2.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=v12.22.7"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/scheduler": {
|
"node_modules/scheduler": {
|
||||||
"version": "0.27.0",
|
"version": "0.27.0",
|
||||||
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz",
|
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz",
|
||||||
@@ -10125,6 +10535,24 @@
|
|||||||
"url": "https://github.com/sponsors/jonschlinkert"
|
"url": "https://github.com/sponsors/jonschlinkert"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/tldts": {
|
||||||
|
"version": "7.4.18",
|
||||||
|
"resolved": "https://registry.npmjs.org/tldts/-/tldts-7.4.18.tgz",
|
||||||
|
"integrity": "sha512-somxA8xKAUzlAxl0TX/jMSYIbRNFIVGnI96pVGJPeMc5BsHmfVXn6mOJT6U++ELnl04eGfzpfcEuZe8WiASkXg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"tldts-core": "^7.4.18"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"tldts": "bin/cli.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/tldts-core": {
|
||||||
|
"version": "7.4.18",
|
||||||
|
"resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-7.4.18.tgz",
|
||||||
|
"integrity": "sha512-KI2PKvCmvQI/xD6ypPqkU0i7oxNXR/O58RLRaHR4svsgVUQ2JE/XC8BtMbG6PSehD27I8sZJRcC1ASnCy6lp3g==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/to-regex-range": {
|
"node_modules/to-regex-range": {
|
||||||
"version": "5.0.1",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||||
@@ -10146,6 +10574,30 @@
|
|||||||
"node": ">=0.6"
|
"node": ">=0.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/tough-cookie": {
|
||||||
|
"version": "6.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-6.0.2.tgz",
|
||||||
|
"integrity": "sha512-exgYmnmL/sJpR3upZfXG5PoatXQii55xAiXGXzY+sROLZ/Y+SLcp9PgJNI9Vz37HpQ74WvDcLT8eqm+kV3FzrA==",
|
||||||
|
"license": "BSD-3-Clause",
|
||||||
|
"dependencies": {
|
||||||
|
"tldts": "^7.0.5"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/tr46": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/tr46/-/tr46-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-BcDSDW+SIGWVOns1Zm6Yg91q9AEj7eaID0QDY9oIqJD1A8dscNwMcl9Sms2DeuWCNov1X0/oXanHGYQBSLwZsg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"punycode": "^2.3.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^22.14.0 || >=24.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/ts-api-utils": {
|
"node_modules/ts-api-utils": {
|
||||||
"version": "2.5.0",
|
"version": "2.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz",
|
||||||
@@ -10572,6 +11024,50 @@
|
|||||||
"integrity": "sha512-fbjNc0CMjazZpIegWzz9OHGzI1APFboT+x7ZecXlUCtDe/nkyx7gtCTZnWS/+eeXG7fbfXymCPKJI8EsnM3iqw==",
|
"integrity": "sha512-fbjNc0CMjazZpIegWzz9OHGzI1APFboT+x7ZecXlUCtDe/nkyx7gtCTZnWS/+eeXG7fbfXymCPKJI8EsnM3iqw==",
|
||||||
"license": "OFL"
|
"license": "OFL"
|
||||||
},
|
},
|
||||||
|
"node_modules/w3c-xmlserializer": {
|
||||||
|
"version": "6.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-6.0.0.tgz",
|
||||||
|
"integrity": "sha512-4Nsy8K5Tr6SPDH9jhKJOHf7ChDrc1zufZTVSF7x72hwuEXBqxqk9G6cK+K2NRUtB3iELRJqjXb4JPDMBjMTl2Q==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"xml-name-validator": "^5.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^22.22.2 || ^24.15.0 || >=26.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/webidl-conversions": {
|
||||||
|
"version": "8.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-8.0.1.tgz",
|
||||||
|
"integrity": "sha512-BMhLD/Sw+GbJC21C/UgyaZX41nPt8bUTg+jWyDeg7e7YN4xOM05YPSIXceACnXVtqyEw/LMClUQMtMZ+PGGpqQ==",
|
||||||
|
"license": "BSD-2-Clause",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/whatwg-mimetype": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-sXcNcHOC51uPGF0P/D4NVtrkjSU2fNsm9iog4ZvZJsL3rjoDAzXZhkm2MWt1y+PUdggKAYVoMAIYcs78wJ51Cw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/whatwg-url": {
|
||||||
|
"version": "17.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-17.3.0.tgz",
|
||||||
|
"integrity": "sha512-KwOAJrpf+GTgBvcBQJcP38sMF0DsQKdwtG+TxM2pW44P6E5k0hDbWrDmyuJDIF0Uef0aQq0ZoJs+5oI+k8ddhg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@exodus/bytes": "^1.16.0",
|
||||||
|
"tr46": "^7.0.0",
|
||||||
|
"webidl-conversions": "^8.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^22.14.0 || >=24.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/which": {
|
"node_modules/which": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||||
@@ -10720,6 +11216,21 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/xml-name-validator": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/xmlchars": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/xtend": {
|
"node_modules/xtend": {
|
||||||
"version": "4.0.2",
|
"version": "4.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
"class-variance-authority": "^0.7.1",
|
"class-variance-authority": "^0.7.1",
|
||||||
"cn": "^0.3.2",
|
"cn": "^0.3.2",
|
||||||
"embla-carousel-react": "^8.6.0",
|
"embla-carousel-react": "^8.6.0",
|
||||||
|
"isomorphic-dompurify": "^4.6.0",
|
||||||
"lucide-react": "^1.47.0",
|
"lucide-react": "^1.47.0",
|
||||||
"next": "16.3.5",
|
"next": "16.3.5",
|
||||||
"next-intl": "^4.14.6",
|
"next-intl": "^4.14.6",
|
||||||
@@ -30,6 +31,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tailwindcss/postcss": "^4",
|
"@tailwindcss/postcss": "^4",
|
||||||
|
"@types/dompurify": "^3.0.5",
|
||||||
"@types/node": "^20",
|
"@types/node": "^20",
|
||||||
"@types/pg": "^8.23.1",
|
"@types/pg": "^8.23.1",
|
||||||
"@types/react": "^19",
|
"@types/react": "^19",
|
||||||
|
|||||||
|
After Width: | Height: | Size: 181 KiB |
|
After Width: | Height: | Size: 230 KiB |
|
After Width: | Height: | Size: 116 KiB |
|
After Width: | Height: | Size: 430 KiB |
|
After Width: | Height: | Size: 158 KiB |
|
After Width: | Height: | Size: 276 KiB |
|
After Width: | Height: | Size: 324 KiB |
|
After Width: | Height: | Size: 296 KiB |
|
After Width: | Height: | Size: 258 KiB |
|
After Width: | Height: | Size: 153 KiB |
|
After Width: | Height: | Size: 255 KiB |
|
After Width: | Height: | Size: 276 KiB |
|
Before Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 232 KiB |
|
After Width: | Height: | Size: 130 KiB |
|
Before Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 153 KiB |
|
Before Width: | Height: | Size: 1.8 MiB |
|
After Width: | Height: | Size: 230 KiB |
|
Before Width: | Height: | Size: 766 KiB |
|
After Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 1.9 MiB |
|
After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 2.5 MiB |
|
After Width: | Height: | Size: 204 KiB |
|
Before Width: | Height: | Size: 2.0 MiB |
|
After Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 2.0 MiB |
|
After Width: | Height: | Size: 194 KiB |
|
Before Width: | Height: | Size: 2.9 MiB |
|
After Width: | Height: | Size: 342 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 92 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 177 KiB |
|
After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 2.0 MiB |
|
After Width: | Height: | Size: 158 KiB |
|
Before Width: | Height: | Size: 2.2 MiB |
|
After Width: | Height: | Size: 223 KiB |
|
Before Width: | Height: | Size: 2.6 MiB |
|
After Width: | Height: | Size: 256 KiB |
|
Before Width: | Height: | Size: 2.3 MiB |
|
After Width: | Height: | Size: 236 KiB |
|
Before Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 2.7 MiB |
|
After Width: | Height: | Size: 184 KiB |
|
After Width: | Height: | Size: 5.9 MiB |
|
Before Width: | Height: | Size: 725 KiB After Width: | Height: | Size: 698 KiB |
|
After Width: | Height: | Size: 6.3 MiB |
|
Before Width: | Height: | Size: 541 KiB After Width: | Height: | Size: 769 KiB |
|
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 6.3 MiB |
|
Before Width: | Height: | Size: 655 KiB After Width: | Height: | Size: 730 KiB |
|
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 4.6 MiB |
|
Before Width: | Height: | Size: 602 KiB After Width: | Height: | Size: 625 KiB |
|
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 4.6 MiB |
|
Before Width: | Height: | Size: 1.1 MiB |
|
After Width: | Height: | Size: 5.4 KiB |
@@ -0,0 +1,39 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Assemble a Next.js standalone tree ready for Dockerfile.prebuilt (runtime-only image).
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
|
OUT="${1:-$ROOT/prebuilt}"
|
||||||
|
|
||||||
|
test -f "$ROOT/.next/standalone/server.js"
|
||||||
|
test -f "$ROOT/.next/BUILD_ID"
|
||||||
|
|
||||||
|
rm -rf "$OUT"
|
||||||
|
mkdir -p "$OUT"
|
||||||
|
|
||||||
|
cp -a "$ROOT/.next/standalone/." "$OUT/"
|
||||||
|
|
||||||
|
rm -rf "$OUT/static" "$OUT/.next/static"
|
||||||
|
mkdir -p "$OUT/.next"
|
||||||
|
cp -a "$ROOT/.next/static/." "$OUT/.next/static/"
|
||||||
|
|
||||||
|
if [ -d "$ROOT/public" ]; then
|
||||||
|
rm -rf "$OUT/public"
|
||||||
|
cp -a "$ROOT/public" "$OUT/public"
|
||||||
|
else
|
||||||
|
mkdir -p "$OUT/public"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp "$ROOT/Dockerfile.prebuilt" "$OUT/Dockerfile"
|
||||||
|
printf '%s\n' 'Dockerfile' '.dockerignore' > "$OUT/.dockerignore"
|
||||||
|
|
||||||
|
test -f "$OUT/server.js"
|
||||||
|
test -f "$OUT/.next/BUILD_ID"
|
||||||
|
test -d "$OUT/.next/static"
|
||||||
|
test -d "$OUT/node_modules"
|
||||||
|
if [ -e "$OUT/static" ]; then
|
||||||
|
echo "ERROR: root-level static/ must not exist" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Prebuilt tree ready at $OUT"
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
|
export DISABLE_REACT_COMPILER=1
|
||||||
|
export NEXT_TELEMETRY_DISABLED=1
|
||||||
|
export NEXT_PUBLIC_SITE_URL="${NEXT_PUBLIC_SITE_URL:-https://edu.mstaut.ir}"
|
||||||
|
export NODE_OPTIONS="${NODE_OPTIONS:---max-old-space-size=3072}"
|
||||||
|
|
||||||
|
npm ci --no-audit --no-fund
|
||||||
|
npm run build
|
||||||
|
test -f .next/standalone/server.js
|
||||||
|
test -f .next/BUILD_ID
|
||||||
|
|
||||||
|
bash scripts/assemble-prebuilt.sh "$(pwd)/prebuilt"
|
||||||
@@ -18,7 +18,18 @@ docker inspect insaight-postgres --format '{{json .NetworkSettings.Networks}}' |
|
|||||||
docker volume create "$UPLOAD_VOLUME" >/dev/null
|
docker volume create "$UPLOAD_VOLUME" >/dev/null
|
||||||
|
|
||||||
# Keep the current app running throughout the build.
|
# Keep the current app running throughout the build.
|
||||||
docker build --build-arg NEXT_PUBLIC_SITE_URL=https://edu.mstaut.ir -t "$IMAGE" .
|
# PREBUILT_DIR: CI-assembled standalone tree (Dockerfile.prebuilt). Skips npm ci + next build on VPS (~1–2 min).
|
||||||
|
PREBUILT_DIR="${PREBUILT_DIR:-}"
|
||||||
|
if [ -n "$PREBUILT_DIR" ]; then
|
||||||
|
test -f "$PREBUILT_DIR/server.js"
|
||||||
|
test -f "$PREBUILT_DIR/Dockerfile"
|
||||||
|
rm -rf "$PREBUILT_DIR/static"
|
||||||
|
DOCKER_BUILDKIT=1 docker build -t "$IMAGE" "$PREBUILT_DIR"
|
||||||
|
else
|
||||||
|
DOCKER_BUILDKIT=1 docker build \
|
||||||
|
--build-arg NEXT_PUBLIC_SITE_URL=https://edu.mstaut.ir \
|
||||||
|
-t "$IMAGE" .
|
||||||
|
fi
|
||||||
|
|
||||||
# Back up before applying the repository's transactional, versioned migrations.
|
# Back up before applying the repository's transactional, versioned migrations.
|
||||||
# Migrations are forward-only and idempotent (schema_migrations); dump is the safety net.
|
# Migrations are forward-only and idempotent (schema_migrations); dump is the safety net.
|
||||||
@@ -30,7 +41,7 @@ test -s "$BACKUP"
|
|||||||
docker run --rm --network "$NETWORK" --env-file "$ENV_FILE" \
|
docker run --rm --network "$NETWORK" --env-file "$ENV_FILE" \
|
||||||
-v "$PWD/db:/app/db:ro" --entrypoint node "$IMAGE" db/migrate.mjs
|
-v "$PWD/db:/app/db:ro" --entrypoint node "$IMAGE" db/migrate.mjs
|
||||||
|
|
||||||
# Check the database and rendered pages before switching the public upstream.
|
# Check the database and a minimal page set before switching the public upstream.
|
||||||
CANDIDATE="edu-candidate-${REVISION:0:12}"
|
CANDIDATE="edu-candidate-${REVISION:0:12}"
|
||||||
docker run -d --name "$CANDIDATE" --network "$NETWORK" --env-file "$ENV_FILE" \
|
docker run -d --name "$CANDIDATE" --network "$NETWORK" --env-file "$ENV_FILE" \
|
||||||
-e UPLOAD_DIR=/app/public/uploads \
|
-e UPLOAD_DIR=/app/public/uploads \
|
||||||
@@ -39,24 +50,34 @@ docker run -d --name "$CANDIDATE" --network "$NETWORK" --env-file "$ENV_FILE" \
|
|||||||
cleanup_candidate() { docker rm -f "$CANDIDATE" >/dev/null 2>&1 || true; }
|
cleanup_candidate() { docker rm -f "$CANDIDATE" >/dev/null 2>&1 || true; }
|
||||||
trap cleanup_candidate EXIT
|
trap cleanup_candidate EXIT
|
||||||
READY=false
|
READY=false
|
||||||
for attempt in $(seq 1 60); do
|
for attempt in $(seq 1 24); do
|
||||||
if docker exec "$CANDIDATE" node -e '
|
if docker exec "$CANDIDATE" node -e '
|
||||||
(async () => {
|
(async () => {
|
||||||
const { Pool } = require("pg");
|
const { Pool } = require("pg");
|
||||||
const pool = new Pool({connectionString: process.env.DATABASE_URL, connectionTimeoutMillis: 5000});
|
const pool = new Pool({
|
||||||
await pool.query("SELECT 1"); await pool.end();
|
connectionString: process.env.DATABASE_URL,
|
||||||
for (const route of ["/", "/programs", "/professional", "/admin/login"]) {
|
connectionTimeoutMillis: 3000,
|
||||||
|
});
|
||||||
|
await pool.query("SELECT 1");
|
||||||
|
await pool.end();
|
||||||
|
|
||||||
|
// Minimal smoke: home + admin login (path moved from /admin).
|
||||||
|
for (const route of ["/", "/mstcontroller/login"]) {
|
||||||
const response = await fetch("http://127.0.0.1:3000" + route);
|
const response = await fetch("http://127.0.0.1:3000" + route);
|
||||||
if (!response.ok) throw new Error(route + ": " + response.status);
|
if (!response.ok) throw new Error(route + ": " + response.status);
|
||||||
}
|
}
|
||||||
for (const resource of ["courses", "programs", "events", "articles"]) {
|
|
||||||
const response = await fetch("http://127.0.0.1:3000/api/" + resource);
|
const api = await fetch("http://127.0.0.1:3000/api/courses");
|
||||||
const body = await response.json();
|
const body = await api.json();
|
||||||
if (!response.ok || !Array.isArray(body.data)) throw new Error("API check failed: " + resource);
|
if (!api.ok || !Array.isArray(body.data)) {
|
||||||
|
throw new Error("API check failed: courses");
|
||||||
}
|
}
|
||||||
})().catch(error => { console.error(error.message); process.exit(1); });
|
})().catch((error) => {
|
||||||
|
console.error(error.message || error);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
'; then READY=true; break; fi
|
'; then READY=true; break; fi
|
||||||
sleep 2
|
sleep 1
|
||||||
done
|
done
|
||||||
if [ "$READY" != true ]; then docker logs --tail 50 "$CANDIDATE"; exit 1; fi
|
if [ "$READY" != true ]; then docker logs --tail 50 "$CANDIDATE"; exit 1; fi
|
||||||
cleanup_candidate
|
cleanup_candidate
|
||||||
@@ -84,11 +105,11 @@ docker run -d --name "$CONTAINER" --restart unless-stopped \
|
|||||||
-v "$UPLOAD_VOLUME:/app/public/uploads" \
|
-v "$UPLOAD_VOLUME:/app/public/uploads" \
|
||||||
-p 127.0.0.1:3000:3000 "$IMAGE"
|
-p 127.0.0.1:3000:3000 "$IMAGE"
|
||||||
READY=false
|
READY=false
|
||||||
for attempt in $(seq 1 30); do
|
for attempt in $(seq 1 20); do
|
||||||
if curl -fsS --max-time 5 --resolve edu.mstaut.ir:443:127.0.0.1 https://edu.mstaut.ir/ >/dev/null; then
|
if curl -fsS --max-time 5 --resolve edu.mstaut.ir:443:127.0.0.1 https://edu.mstaut.ir/ >/dev/null; then
|
||||||
READY=true; break
|
READY=true; break
|
||||||
fi
|
fi
|
||||||
sleep 2
|
sleep 1
|
||||||
done
|
done
|
||||||
test "$READY" = true
|
test "$READY" = true
|
||||||
trap - ERR
|
trap - ERR
|
||||||
|
|||||||
@@ -170,11 +170,13 @@ async function main() {
|
|||||||
const publicFaculty = path.join(root, "public", "images", "faculty");
|
const publicFaculty = path.join(root, "public", "images", "faculty");
|
||||||
mkdirSync(publicFaculty, { recursive: true });
|
mkdirSync(publicFaculty, { recursive: true });
|
||||||
|
|
||||||
if (filesDir && existsSync(path.join(filesDir, "johndoe.png"))) {
|
const destPlaceholder = path.join(publicFaculty, "placeholder.webp");
|
||||||
copyFileSync(
|
if (
|
||||||
path.join(filesDir, "johndoe.png"),
|
filesDir &&
|
||||||
path.join(publicFaculty, "placeholder.png"),
|
existsSync(path.join(filesDir, "johndoe.png")) &&
|
||||||
);
|
!existsSync(destPlaceholder)
|
||||||
|
) {
|
||||||
|
copyFileSync(path.join(filesDir, "johndoe.png"), destPlaceholder);
|
||||||
}
|
}
|
||||||
|
|
||||||
const { Client } = pg;
|
const { Client } = pg;
|
||||||
@@ -200,7 +202,7 @@ async function main() {
|
|||||||
byName.get(p.name.replace(/\s+/g, " ").trim().toLowerCase());
|
byName.get(p.name.replace(/\s+/g, " ").trim().toLowerCase());
|
||||||
const id = match?.id ?? facultyId(p);
|
const id = match?.id ?? facultyId(p);
|
||||||
|
|
||||||
let imageUrl = match?.image_url || "/images/faculty/placeholder.png";
|
let imageUrl = match?.image_url || "/images/faculty/placeholder.webp";
|
||||||
const fileBase = p.imageSrc.split(/[/\\]/).pop() || "";
|
const fileBase = p.imageSrc.split(/[/\\]/).pop() || "";
|
||||||
const isPlaceholder =
|
const isPlaceholder =
|
||||||
!fileBase ||
|
!fileBase ||
|
||||||
|
|||||||
@@ -0,0 +1,143 @@
|
|||||||
|
/**
|
||||||
|
* Convert fixed static assets (brand/logos) to compact WebP.
|
||||||
|
* Skips course uploads, faculty photos (except placeholder), and favicon PNGs.
|
||||||
|
*/
|
||||||
|
import fs from "node:fs";
|
||||||
|
import path from "node:path";
|
||||||
|
import sharp from "sharp";
|
||||||
|
|
||||||
|
const ROOT = process.cwd();
|
||||||
|
|
||||||
|
const SKIP_DIR_PARTS = [
|
||||||
|
path.join("public", "images", "courses"),
|
||||||
|
path.join("public", "brand", "icons"),
|
||||||
|
];
|
||||||
|
|
||||||
|
const SKIP_FILES = new Set(
|
||||||
|
[
|
||||||
|
"public/icon-192.png",
|
||||||
|
"public/icon-512.png",
|
||||||
|
"public/apple-touch-icon.png",
|
||||||
|
"src/app/icon.png",
|
||||||
|
"src/app/apple-icon.png",
|
||||||
|
].map((p) => path.normalize(p)),
|
||||||
|
);
|
||||||
|
|
||||||
|
const LOGO_NAMES = new Set([
|
||||||
|
"mst-faculty.png",
|
||||||
|
"mst-faculty-icon.png",
|
||||||
|
"mst-faculty-full-with-text.png",
|
||||||
|
"MstAutIcon_horizontal.png",
|
||||||
|
"MstAutIcon.png",
|
||||||
|
"logo_fa.png",
|
||||||
|
"logo_fa_w.png",
|
||||||
|
"amirkabir.png",
|
||||||
|
"amirkabir-black-bg.png",
|
||||||
|
]);
|
||||||
|
|
||||||
|
function walk(dir, acc = []) {
|
||||||
|
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
||||||
|
const full = path.join(dir, entry.name);
|
||||||
|
if (entry.isDirectory()) walk(full, acc);
|
||||||
|
else if (/\.(png|jpe?g)$/i.test(entry.name)) acc.push(full);
|
||||||
|
}
|
||||||
|
return acc;
|
||||||
|
}
|
||||||
|
|
||||||
|
function shouldSkip(abs) {
|
||||||
|
const rel = path.relative(ROOT, abs);
|
||||||
|
const norm = path.normalize(rel);
|
||||||
|
if (SKIP_FILES.has(norm)) return true;
|
||||||
|
if (SKIP_DIR_PARTS.some((d) => norm.startsWith(d))) return true;
|
||||||
|
// Faculty photos from admin/sync — keep. Convert only the fixed placeholder.
|
||||||
|
if (norm.startsWith(path.join("public", "images", "faculty"))) {
|
||||||
|
return path.basename(norm) !== "placeholder.png";
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function presetFor(rel, meta) {
|
||||||
|
const base = path.basename(rel);
|
||||||
|
const isLogo = LOGO_NAMES.has(base);
|
||||||
|
const isHorizontal = base === "MstAutIcon_horizontal.png";
|
||||||
|
const isPlaceholder = base === "placeholder.png";
|
||||||
|
|
||||||
|
if (isHorizontal) {
|
||||||
|
return { lossless: true };
|
||||||
|
}
|
||||||
|
if (isLogo) {
|
||||||
|
return { lossless: true };
|
||||||
|
}
|
||||||
|
if (isPlaceholder) {
|
||||||
|
return { maxEdge: 640, quality: 58, alphaQuality: 70 };
|
||||||
|
}
|
||||||
|
// Decorative / hero illustrations (often under overlays)
|
||||||
|
return { maxEdge: 1080, quality: 48, alphaQuality: 65 };
|
||||||
|
}
|
||||||
|
|
||||||
|
function destPath(abs) {
|
||||||
|
return abs.replace(/\.(png|jpe?g)$/i, ".webp");
|
||||||
|
}
|
||||||
|
|
||||||
|
const candidates = [
|
||||||
|
...walk(path.join(ROOT, "public", "brand")),
|
||||||
|
...walk(path.join(ROOT, "public", "CandidatesIMages")),
|
||||||
|
path.join(ROOT, "public", "MstAutIcon_horizontal.png"),
|
||||||
|
path.join(ROOT, "public", "MstAutIcon.png"),
|
||||||
|
path.join(ROOT, "public", "images", "faculty", "placeholder.png"),
|
||||||
|
].filter((f) => fs.existsSync(f) && !shouldSkip(f));
|
||||||
|
|
||||||
|
let before = 0;
|
||||||
|
let after = 0;
|
||||||
|
|
||||||
|
for (const abs of candidates) {
|
||||||
|
const rel = path.relative(ROOT, abs);
|
||||||
|
const srcSize = fs.statSync(abs).size;
|
||||||
|
before += srcSize;
|
||||||
|
|
||||||
|
const img = sharp(abs);
|
||||||
|
const meta = await img.metadata();
|
||||||
|
const cfg = presetFor(rel, meta);
|
||||||
|
let pipeline = img;
|
||||||
|
|
||||||
|
const w = meta.width ?? 0;
|
||||||
|
const h = meta.height ?? 0;
|
||||||
|
if (cfg.maxHeight && h > cfg.maxHeight) {
|
||||||
|
pipeline = pipeline.resize({ height: cfg.maxHeight, withoutEnlargement: true });
|
||||||
|
} else if (cfg.maxEdge) {
|
||||||
|
const edge = Math.max(w, h);
|
||||||
|
if (edge > cfg.maxEdge) {
|
||||||
|
pipeline = pipeline.resize({
|
||||||
|
width: w >= h ? cfg.maxEdge : undefined,
|
||||||
|
height: h > w ? cfg.maxEdge : undefined,
|
||||||
|
withoutEnlargement: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const out = destPath(abs);
|
||||||
|
await pipeline
|
||||||
|
.webp(
|
||||||
|
cfg.lossless
|
||||||
|
? { lossless: true, effort: 6 }
|
||||||
|
: {
|
||||||
|
quality: cfg.quality,
|
||||||
|
alphaQuality: cfg.alphaQuality,
|
||||||
|
effort: 6,
|
||||||
|
smartSubsample: true,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.toFile(out);
|
||||||
|
|
||||||
|
const outSize = fs.statSync(out).size;
|
||||||
|
after += outSize;
|
||||||
|
fs.unlinkSync(abs);
|
||||||
|
const pct = ((1 - outSize / srcSize) * 100).toFixed(0);
|
||||||
|
console.log(
|
||||||
|
`${(srcSize / 1024).toFixed(0).padStart(6)}KB → ${(outSize / 1024).toFixed(0).padStart(5)}KB (-${pct}%) ${rel}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
`\nTOTAL ${(before / 1024 / 1024).toFixed(2)} MB → ${(after / 1024 / 1024).toFixed(2)} MB (${candidates.length} files)`,
|
||||||
|
);
|
||||||
@@ -28,7 +28,7 @@ export default async function AlumniPage() {
|
|||||||
<PageHero
|
<PageHero
|
||||||
title={t("alumniTitle")}
|
title={t("alumniTitle")}
|
||||||
intro={t("alumniIntro")}
|
intro={t("alumniIntro")}
|
||||||
imageUrl="/brand/graduation-cap-neural.png"
|
imageUrl="/brand/graduation-cap-neural.webp"
|
||||||
/>
|
/>
|
||||||
<Section tone="subtle">
|
<Section tone="subtle">
|
||||||
<Container>
|
<Container>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export default async function InsightsPage() {
|
|||||||
<PageHero
|
<PageHero
|
||||||
title={t("insightsTitle")}
|
title={t("insightsTitle")}
|
||||||
intro={t("insightsIntro")}
|
intro={t("insightsIntro")}
|
||||||
imageUrl="/brand/neural-open-book.png"
|
imageUrl="/brand/neural-open-book.webp"
|
||||||
/>
|
/>
|
||||||
<Section tone="subtle">
|
<Section tone="subtle">
|
||||||
<Container>
|
<Container>
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export default async function ProgramsPage() {
|
|||||||
<PageHero
|
<PageHero
|
||||||
title={t("programsTitle")}
|
title={t("programsTitle")}
|
||||||
intro={t("programsIntro")}
|
intro={t("programsIntro")}
|
||||||
imageUrl="/brand/neural-tree-knowledge.png"
|
imageUrl="/brand/neural-tree-knowledge.webp"
|
||||||
/>
|
/>
|
||||||
<Section tone="subtle">
|
<Section tone="subtle">
|
||||||
<Container className="space-y-16">
|
<Container className="space-y-16">
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export default async function ValuesPage() {
|
|||||||
eyebrow={valuesContent.eyebrow}
|
eyebrow={valuesContent.eyebrow}
|
||||||
title={valuesContent.title}
|
title={valuesContent.title}
|
||||||
intro={valuesContent.intro}
|
intro={valuesContent.intro}
|
||||||
imageUrl="/brand/collective-intelligence.png"
|
imageUrl="/brand/collective-intelligence.webp"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Section tone="subtle">
|
<Section tone="subtle">
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ const COURSE_COLUMNS: Record<string, string> = {
|
|||||||
registrationUrl: "registration_url",
|
registrationUrl: "registration_url",
|
||||||
posterImageUrl: "poster_image_url",
|
posterImageUrl: "poster_image_url",
|
||||||
brochureImageUrl: "brochure_image_url",
|
brochureImageUrl: "brochure_image_url",
|
||||||
|
leadHtml: "lead_html",
|
||||||
|
bodyHtml: "body_html",
|
||||||
seoDescription: "seo_description",
|
seoDescription: "seo_description",
|
||||||
published: "published",
|
published: "published",
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -64,8 +64,9 @@ export async function POST(request: NextRequest) {
|
|||||||
await query(
|
await query(
|
||||||
`INSERT INTO courses
|
`INSERT INTO courses
|
||||||
(id, slug, title, summary, duration_hours, format, price,
|
(id, slug, title, summary, duration_hours, format, price,
|
||||||
registration_url, poster_image_url, brochure_image_url, image_url, seo_description, published)
|
registration_url, poster_image_url, brochure_image_url, image_url,
|
||||||
VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13)`,
|
lead_html, body_html, seo_description, published)
|
||||||
|
VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15)`,
|
||||||
[
|
[
|
||||||
id,
|
id,
|
||||||
d.slug,
|
d.slug,
|
||||||
@@ -78,6 +79,8 @@ export async function POST(request: NextRequest) {
|
|||||||
d.posterImageUrl,
|
d.posterImageUrl,
|
||||||
d.brochureImageUrl,
|
d.brochureImageUrl,
|
||||||
d.posterImageUrl,
|
d.posterImageUrl,
|
||||||
|
d.leadHtml,
|
||||||
|
d.bodyHtml,
|
||||||
d.seoDescription,
|
d.seoDescription,
|
||||||
d.published,
|
d.published,
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export async function generateMetadata(): Promise<Metadata> {
|
|||||||
title: t("homeTitle"),
|
title: t("homeTitle"),
|
||||||
description: t("homeDescription"),
|
description: t("homeDescription"),
|
||||||
images: [
|
images: [
|
||||||
{ url: "/brand/mst-faculty.png", alt: "دانشکده مدیریت، علم و فناوری دانشگاه صنعتی امیرکبیر" },
|
{ url: "/brand/mst-faculty.webp", alt: "دانشکده مدیریت، علم و فناوری دانشگاه صنعتی امیرکبیر" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
twitter: {
|
twitter: {
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ function LoginForm() {
|
|||||||
<CardHeader className="space-y-3 text-center">
|
<CardHeader className="space-y-3 text-center">
|
||||||
<div className="mx-auto relative size-14">
|
<div className="mx-auto relative size-14">
|
||||||
<Image
|
<Image
|
||||||
src="/brand/mst-faculty.png"
|
src="/brand/mst-faculty.webp"
|
||||||
alt="دانشگاه صنعتی امیرکبیر"
|
alt="دانشگاه صنعتی امیرکبیر"
|
||||||
fill
|
fill
|
||||||
sizes="56px"
|
sizes="56px"
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ import Link from "next/link";
|
|||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
/** Faculty seal mark (transparent). Source: MST icon with side text removed. */
|
/** Faculty seal mark (transparent). Source: MST icon with side text removed. */
|
||||||
const MARK_SRC = "/brand/mst-faculty.png";
|
const MARK_SRC = "/brand/mst-faculty.webp";
|
||||||
/** Horizontal wordmark with faculty + university name baked in. */
|
/** Horizontal wordmark with faculty + university name baked in. */
|
||||||
const HORIZONTAL_SRC = "/MstAutIcon_horizontal.png";
|
const HORIZONTAL_SRC = "/MstAutIcon_horizontal.webp";
|
||||||
|
|
||||||
type BrandLogoProps = {
|
type BrandLogoProps = {
|
||||||
href?: string;
|
href?: string;
|
||||||
@@ -37,25 +37,17 @@ export function BrandLogo({
|
|||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
href={href}
|
href={href}
|
||||||
className={cn(
|
className={cn("inline-flex h-full shrink-0 items-center", className)}
|
||||||
// Clip 2× logo inside the header slot so it never bleeds into page content.
|
|
||||||
"group inline-flex min-w-0 items-center overflow-hidden",
|
|
||||||
compact ? "h-16" : "h-full",
|
|
||||||
className,
|
|
||||||
)}
|
|
||||||
aria-label={ariaLabel}
|
aria-label={ariaLabel}
|
||||||
>
|
>
|
||||||
<Image
|
{/* Native img: no fixed width/height attrs; ratio comes from the asset. */}
|
||||||
|
<img
|
||||||
src={HORIZONTAL_SRC}
|
src={HORIZONTAL_SRC}
|
||||||
alt={ariaLabel}
|
alt={ariaLabel}
|
||||||
width={1888}
|
decoding="async"
|
||||||
height={607}
|
fetchPriority="high"
|
||||||
priority
|
|
||||||
sizes="(max-width:640px) 28rem, 36rem"
|
|
||||||
className={cn(
|
className={cn(
|
||||||
// ~2.35× slot height; overflow clipped by the link (and header).
|
"h-[75%] w-auto max-w-none",
|
||||||
"h-[235%] w-auto max-w-none object-contain object-right",
|
|
||||||
// Asset is white-on-black; blend so the plate disappears into the header.
|
|
||||||
onDark ? "mix-blend-screen" : "invert mix-blend-multiply",
|
onDark ? "mix-blend-screen" : "invert mix-blend-multiply",
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export function HeroFeatured({
|
|||||||
<header className="home-hero relative isolate overflow-hidden bg-primary text-primary-foreground">
|
<header className="home-hero relative isolate overflow-hidden bg-primary text-primary-foreground">
|
||||||
<div className="pointer-events-none absolute inset-0 z-[1]" aria-hidden>
|
<div className="pointer-events-none absolute inset-0 z-[1]" aria-hidden>
|
||||||
<Image
|
<Image
|
||||||
src="/brand/amirkabir-arches.png"
|
src="/brand/amirkabir-arches.webp"
|
||||||
alt=""
|
alt=""
|
||||||
fill
|
fill
|
||||||
priority
|
priority
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import type { ReactNode } from "react";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { Container } from "@/components/atoms/Container";
|
import { Container } from "@/components/atoms/Container";
|
||||||
import { Heading } from "@/components/atoms/Heading";
|
import { Heading } from "@/components/atoms/Heading";
|
||||||
@@ -14,7 +15,8 @@ export function PageHero({
|
|||||||
showField = true,
|
showField = true,
|
||||||
}: {
|
}: {
|
||||||
title: string;
|
title: string;
|
||||||
intro?: string;
|
/** Plain string or rich content (e.g. sanitized HTML) under the title. */
|
||||||
|
intro?: ReactNode;
|
||||||
eyebrow?: string;
|
eyebrow?: string;
|
||||||
imageUrl?: string;
|
imageUrl?: string;
|
||||||
actions?: React.ReactNode;
|
actions?: React.ReactNode;
|
||||||
@@ -34,7 +36,7 @@ export function PageHero({
|
|||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Image
|
<Image
|
||||||
src={imageUrl ?? "/brand/neural-learning-wave.png"}
|
src={imageUrl ?? "/brand/neural-learning-wave.webp"}
|
||||||
alt=""
|
alt=""
|
||||||
fill
|
fill
|
||||||
priority
|
priority
|
||||||
@@ -71,9 +73,13 @@ export function PageHero({
|
|||||||
{title}
|
{title}
|
||||||
</Heading>
|
</Heading>
|
||||||
{intro ? (
|
{intro ? (
|
||||||
<p className="mt-5 max-w-2xl border-t border-secondary/50 pt-5 text-base leading-7 text-pretty text-primary-foreground/70 sm:text-lg sm:leading-8">
|
<div className="mt-5 max-w-2xl border-t border-secondary/50 pt-5 text-pretty text-primary-foreground/70">
|
||||||
{intro}
|
{typeof intro === "string" ? (
|
||||||
</p>
|
<p className="text-base leading-7 sm:text-lg sm:leading-8">{intro}</p>
|
||||||
|
) : (
|
||||||
|
intro
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
{actions ? (
|
{actions ? (
|
||||||
<div className="mt-8 flex flex-wrap gap-3">{actions}</div>
|
<div className="mt-8 flex flex-wrap gap-3">{actions}</div>
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
import { sanitizeCourseHtml } from "@/lib/sanitize-html";
|
||||||
|
|
||||||
|
type RichHtmlTone = "default" | "onPrimary";
|
||||||
|
|
||||||
|
const toneClass: Record<RichHtmlTone, string> = {
|
||||||
|
default: cn(
|
||||||
|
"max-w-none text-base leading-7 text-foreground/90",
|
||||||
|
"[&_h2]:mt-8 [&_h2]:mb-3 [&_h2]:text-lg [&_h2]:font-bold [&_h2]:text-foreground",
|
||||||
|
"[&_h3]:mt-6 [&_h3]:mb-2 [&_h3]:text-base [&_h3]:font-bold [&_h3]:text-foreground",
|
||||||
|
"[&_h4]:mt-4 [&_h4]:mb-2 [&_h4]:text-sm [&_h4]:font-semibold",
|
||||||
|
"[&_p]:mb-3 [&_p:last-child]:mb-0",
|
||||||
|
"[&_ul]:my-3 [&_ul]:list-disc [&_ul]:ps-5 [&_ul]:space-y-1.5",
|
||||||
|
"[&_ol]:my-3 [&_ol]:list-decimal [&_ol]:ps-5 [&_ol]:space-y-1.5",
|
||||||
|
"[&_li]:leading-7",
|
||||||
|
"[&_a]:font-medium [&_a]:text-primary [&_a]:underline [&_a]:underline-offset-4",
|
||||||
|
"[&_strong]:font-semibold [&_strong]:text-foreground",
|
||||||
|
"[&_hr]:my-6 [&_hr]:border-border",
|
||||||
|
),
|
||||||
|
onPrimary: cn(
|
||||||
|
"max-w-none text-base leading-7 text-primary-foreground/75 sm:text-lg sm:leading-8",
|
||||||
|
"[&_h2]:mt-4 [&_h2]:mb-2 [&_h2]:text-lg [&_h2]:font-bold [&_h2]:text-primary-foreground",
|
||||||
|
"[&_h3]:mt-3 [&_h3]:mb-2 [&_h3]:text-base [&_h3]:font-bold [&_h3]:text-primary-foreground",
|
||||||
|
"[&_p]:mb-3 [&_p:last-child]:mb-0",
|
||||||
|
"[&_ul]:my-3 [&_ul]:list-disc [&_ul]:ps-5 [&_ul]:space-y-1.5",
|
||||||
|
"[&_ol]:my-3 [&_ol]:list-decimal [&_ol]:ps-5 [&_ol]:space-y-1.5",
|
||||||
|
"[&_li]:leading-7",
|
||||||
|
"[&_a]:font-medium [&_a]:text-secondary [&_a]:underline [&_a]:underline-offset-4",
|
||||||
|
"[&_strong]:font-semibold [&_strong]:text-primary-foreground",
|
||||||
|
"[&_br]:leading-8",
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Renders sanitized HTML with typography styles. */
|
||||||
|
export function RichHtmlContent({
|
||||||
|
html,
|
||||||
|
tone = "default",
|
||||||
|
className,
|
||||||
|
}: {
|
||||||
|
html: string;
|
||||||
|
tone?: RichHtmlTone;
|
||||||
|
className?: string;
|
||||||
|
}) {
|
||||||
|
const clean = sanitizeCourseHtml(html);
|
||||||
|
if (!clean) return null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={cn(toneClass[tone], className)}
|
||||||
|
dangerouslySetInnerHTML={{ __html: clean }}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -37,7 +37,7 @@ export function AdminShell({
|
|||||||
<div className="flex min-w-0 items-center gap-2">
|
<div className="flex min-w-0 items-center gap-2">
|
||||||
<span className="relative size-6 shrink-0 md:hidden">
|
<span className="relative size-6 shrink-0 md:hidden">
|
||||||
<Image
|
<Image
|
||||||
src="/brand/mst-faculty.png"
|
src="/brand/mst-faculty.webp"
|
||||||
alt=""
|
alt=""
|
||||||
fill
|
fill
|
||||||
sizes="24px"
|
sizes="24px"
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ export function AdminSidebar({ userName }: { userName: string }) {
|
|||||||
>
|
>
|
||||||
<span className="relative size-8 shrink-0">
|
<span className="relative size-8 shrink-0">
|
||||||
<Image
|
<Image
|
||||||
src="/brand/mst-faculty.png"
|
src="/brand/mst-faculty.webp"
|
||||||
alt=""
|
alt=""
|
||||||
fill
|
fill
|
||||||
sizes="32px"
|
sizes="32px"
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ type Payload = {
|
|||||||
registrationUrl: string;
|
registrationUrl: string;
|
||||||
posterImageUrl: string;
|
posterImageUrl: string;
|
||||||
brochureImageUrl: string;
|
brochureImageUrl: string;
|
||||||
|
leadHtml: string;
|
||||||
|
bodyHtml: string;
|
||||||
seoDescription: string;
|
seoDescription: string;
|
||||||
published: boolean;
|
published: boolean;
|
||||||
};
|
};
|
||||||
@@ -73,6 +75,8 @@ export function CourseForm({
|
|||||||
registrationUrl: initial?.registrationUrl ?? "/register/",
|
registrationUrl: initial?.registrationUrl ?? "/register/",
|
||||||
posterImageUrl: initial?.posterImageUrl ?? "",
|
posterImageUrl: initial?.posterImageUrl ?? "",
|
||||||
brochureImageUrl: initial?.brochureImageUrl ?? "",
|
brochureImageUrl: initial?.brochureImageUrl ?? "",
|
||||||
|
leadHtml: initial?.leadHtml ?? "",
|
||||||
|
bodyHtml: initial?.bodyHtml ?? "",
|
||||||
seoDescription: initial?.seoDescription ?? "",
|
seoDescription: initial?.seoDescription ?? "",
|
||||||
published: initial?.published ?? true,
|
published: initial?.published ?? true,
|
||||||
});
|
});
|
||||||
@@ -176,7 +180,7 @@ export function CourseForm({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="space-y-1.5 sm:col-span-2">
|
<div className="space-y-1.5 sm:col-span-2">
|
||||||
<Label htmlFor="summary">خلاصه *</Label>
|
<Label htmlFor="summary">خلاصه کارت *</Label>
|
||||||
<Textarea
|
<Textarea
|
||||||
id="summary"
|
id="summary"
|
||||||
value={form.summary}
|
value={form.summary}
|
||||||
@@ -184,6 +188,33 @@ export function CourseForm({
|
|||||||
required
|
required
|
||||||
rows={3}
|
rows={3}
|
||||||
/>
|
/>
|
||||||
|
<p className="text-xs text-muted-foreground">
|
||||||
|
متن کوتاه برای کارتهای فهرست؛ آگهی زیر عنوان جداگانه است.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="space-y-1.5 sm:col-span-2">
|
||||||
|
<Label htmlFor="leadHtml">آگهی زیر عنوان (HTML)</Label>
|
||||||
|
<Textarea
|
||||||
|
id="leadHtml"
|
||||||
|
value={form.leadHtml}
|
||||||
|
onChange={(e) => set("leadHtml", e.target.value)}
|
||||||
|
rows={8}
|
||||||
|
className="font-mono text-xs"
|
||||||
|
placeholder="<p><strong>شعار</strong></p><p>متن آگهی…</p>"
|
||||||
|
dir="ltr"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="space-y-1.5 sm:col-span-2">
|
||||||
|
<Label htmlFor="bodyHtml">بدنه دوره (HTML)</Label>
|
||||||
|
<Textarea
|
||||||
|
id="bodyHtml"
|
||||||
|
value={form.bodyHtml}
|
||||||
|
onChange={(e) => set("bodyHtml", e.target.value)}
|
||||||
|
rows={12}
|
||||||
|
className="font-mono text-xs"
|
||||||
|
placeholder="<h2>درباره</h2><p>…</p><h2>سرفصلها</h2><ol><li>…</li></ol>"
|
||||||
|
dir="ltr"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||