forked from izu/student-web-if-development-kit
chore: remove verification scripts
This commit is contained in:
+1
-3
@@ -6,9 +6,7 @@
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"test:netlify-build": "node scripts/verify-netlify-build.mjs",
|
||||
"test:mobile-layout": "node scripts/verify-mobile-layout.mjs"
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vite": "^7.1.0"
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
|
||||
const rodaPage = readFileSync('groups/RODA/index.html', 'utf8');
|
||||
|
||||
const gridMatch = rodaPage.match(/<div id="dosen-grid" class="([^"]+)"/);
|
||||
|
||||
if (!gridMatch) {
|
||||
throw new Error('Missing dosen-grid container.');
|
||||
}
|
||||
|
||||
const gridClasses = gridMatch[1].split(/\s+/);
|
||||
|
||||
if (gridClasses.includes('sm:grid-cols-2')) {
|
||||
throw new Error('Dosen cards must stay single-column at the 390px mobile breakpoint.');
|
||||
}
|
||||
|
||||
if (!gridClasses.includes('grid-cols-1') || !gridClasses.includes('md:grid-cols-2')) {
|
||||
throw new Error('Dosen cards must use one mobile column and switch to two columns at md.');
|
||||
}
|
||||
|
||||
const viewMembersMatch = rodaPage.match(/<span class="([^"]+)"[^>]*>\s*\$\{translations\[currentLang\]\.viewMembers\}/);
|
||||
|
||||
if (!viewMembersMatch) {
|
||||
throw new Error('Missing view members link in dosen card template.');
|
||||
}
|
||||
|
||||
if (viewMembersMatch[1].split(/\s+/).includes('whitespace-nowrap')) {
|
||||
throw new Error('View members link must be allowed to wrap instead of clipping on narrow cards.');
|
||||
}
|
||||
|
||||
console.log('Mobile layout classes keep dosen cards readable on phone viewports.');
|
||||
@@ -1,48 +0,0 @@
|
||||
import { existsSync, readdirSync, statSync } from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
const root = process.cwd();
|
||||
const dist = path.join(root, 'dist');
|
||||
const excludedDirs = new Set(['.git', 'dist', 'node_modules']);
|
||||
|
||||
function collectFiles(dir, predicate = () => true) {
|
||||
const entries = readdirSync(dir, { withFileTypes: true });
|
||||
const files = [];
|
||||
|
||||
for (const entry of entries) {
|
||||
const fullPath = path.join(dir, entry.name);
|
||||
|
||||
if (entry.isDirectory()) {
|
||||
if (!excludedDirs.has(entry.name)) {
|
||||
files.push(...collectFiles(fullPath, predicate));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (entry.isFile() && predicate(fullPath)) {
|
||||
files.push(fullPath);
|
||||
}
|
||||
}
|
||||
|
||||
return files;
|
||||
}
|
||||
|
||||
if (!existsSync(dist) || !statSync(dist).isDirectory()) {
|
||||
throw new Error('Missing dist directory. Run `npm run build` first.');
|
||||
}
|
||||
|
||||
const missingHtmlFiles = collectFiles(root, (file) => file.endsWith('.html'))
|
||||
.map((file) => path.relative(root, file))
|
||||
.filter((relativePath) => !existsSync(path.join(dist, relativePath)));
|
||||
|
||||
const missingAssetFiles = collectFiles(path.join(root, 'assets'))
|
||||
.map((file) => path.relative(root, file))
|
||||
.filter((relativePath) => !existsSync(path.join(dist, relativePath)));
|
||||
|
||||
const missingFiles = [...missingHtmlFiles, ...missingAssetFiles];
|
||||
|
||||
if (missingFiles.length > 0) {
|
||||
throw new Error(`Missing built files:\n${missingFiles.join('\n')}`);
|
||||
}
|
||||
|
||||
console.log('All source HTML and static asset files are present in dist.');
|
||||
Reference in New Issue
Block a user