INNER CODE UNIT · TypeScript
TOTAL_STAGE_WEIGHT
akirarika/milkio · packages/cookbook/src/watcher/index.ts:36
const TOTAL_STAGE_WEIGHT = SCAN_WEIGHT + DECLARES_WEIGHT + ASYNC_GROUP_WEIGHT + STAGE_WEIGHTS.reduce((a, b) => a + b, 0);
const allFiles: Map<string, Map<string, CookbookWatcherFile>> = new Map();
const dependencyCache = new Map<string, Set<string>>();
const reverseDependencyGraph = new Map<string, Set<string>>();
export async function initWatcher(options: CookbookOptions, mode: string, watch: boolean) {
const watchers: FSWatcher[] = [];
const dispose = () => {
for (const watcher of watchers) watcher.close();
};
let processedProjectCount = 0;
for (const projectName in options.projects ?? []) {
const project = options.projects[projectName];
if (project.type !== "milkio") continue;
const root = join(cwd(), "projects", projectName);
if (!(await exists(join(root, "app")))) continue;
processedProjectCount++;