/
githubmirror
/
marktext
Обзор
Документация
Войти
/
githubmirror
/
marktext
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v0.19.0
scripts/thirdPartyChecker.ts
43 строки
1 KB
Jocs
refactor(test,scripts): port tests and build scripts to TypeScript
22 май 2026, 10:52
22 май 2026, 10:52
2e3999b
Код
Авторство
О чём код?
/* eslint-disable @typescript-eslint/ban-ts-comment, @typescript-eslint/no-require-imports */ // @ts-nocheck 'use strict' const checker = require('license-checker') const getLicenses = (rootDir, callback) => { checker.init( { start: rootDir, production: true, development: false, direct: true, excludePackages: '@marktext/file-icons', // MIT licensed but license-checker may not detect it json: true, onlyAllow: 'Unlicense;WTFPL;ISC;MIT;BSD;Apache-2.0;MIT*;Apache;Apache*;BSD*;CC0-1.0;CC-BY-4.0;CC-BY-3.0' }, function(err, packages) { callback(err, packages, checker) } ) } // Check that all production dependencies are allowed. const validateLicenses = (rootDir) => { getLicenses(rootDir, (err, packages, checker) => { if (err) { console.log(`[ERROR] ${err}`) process.exit(1) } if (!packages || Object.keys(packages).length === 0) { console.log('[ERROR] No packages found — check your start path and filters.') process.exit(1) } console.log(checker.asSummary(packages)) }) } module.exports = { getLicenses, validateLicenses }