/
githubmirror
/
tabler
Обзор
Документация
Войти
/
githubmirror
/
tabler
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
.build/zip-package.ts
32 строки
977 B
Paweł Kuna
Add quality gates: Prettier for Astro, astro check for shared, unused SCSS variable lint (#2749)
03 авг 2026, 01:47
Не верифицирован
03 авг 2026, 01:47
8962710
Код
Авторство
О чём код?
#!/usr/bin/env node import AdmZip from 'adm-zip' import path from 'node:path' import { fileURLToPath } from 'node:url' import { readFileSync } from 'node:fs' // Get __dirname in ESM const __dirname = path.dirname(fileURLToPath(import.meta.url)) interface PackageJson { version: string [key: string]: unknown } const pkg: PackageJson = JSON.parse(readFileSync(path.join(__dirname, '../core', 'package.json'), 'utf8')) // Create zip instance and add folder const zip = new AdmZip() zip.addLocalFolder(path.join(__dirname, '../preview/dist'), 'dashboard') zip.addLocalFile(path.join(__dirname, '../shared/static', 'og.png'), '.', 'preview.png') zip.addFile('documentation.url', Buffer.from('[InternetShortcut]\nURL = https://tabler.io/docs')) // Folder to zip and output path const outputZipPath = path.join(__dirname, '../packages-zip', `tabler-${pkg.version}.zip`) // Write the zip file zip.writeZip(outputZipPath) console.log(`Zipped folder to ${outputZipPath}`)