UNPKG

sdin

Version:

JavaScript package builder.

2 lines 996 B
import{getDependenceVersion as o}from"../../utils/npm";import{cyan as r,printInfo as n}from"../../utils/print";import{ms2s as t}from"../../utils/unit";import{deepRead as i}from"../../utils/read";import{isSdinFileName as a,FILE_NAME_EXP as s}from"../../tools/check";import{SdinCheckingError as c}from"../../tools/errors";async function e(e){var o=Date.now();await Promise.all([l(e),m(e)]),n("Project files are qualified, checking took ".concat(r(t(Date.now()-o))," s."))}async function l(e){e=e.project;if(!o(e.pkg,"@babel/runtime"))throw new c(c.PACKAGE_DEPENDENCE_ABSENT,"Please install @babel/runtime dependence.")}async function m(e){var o,e=e.project;let r=[],n={};for(o of e.modules)await i({source:o.src,includeDir:!0,handler:e=>{n[e.current]||a(e.name)||r.push(e.current),n[e.current]=!0}});if(0<r.length)throw new c(c.FILE_NAME_FORMAT_ILLEGAL,['The name of following files does not match expression "'.concat(s,'"'),...r])}export{e as checkSdinProject}; //# sourceMappingURL=check.js.map