Jacky Zhao
2025-03-10 a8001e9554a319782d8557acb8f19358996b5828
quartz/build.ts
@@ -19,6 +19,7 @@
import { Mutex } from "async-mutex"
import DepGraph from "./depgraph"
import { getStaticResourcesFromPlugins } from "./plugins"
import { randomIdNonSecure } from "./util/random"
type Dependencies = Record<string, DepGraph<FilePath> | null>
@@ -38,13 +39,9 @@
type FileEvent = "add" | "change" | "delete"
function newBuildId() {
  return Math.random().toString(36).substring(2, 8)
}
async function buildQuartz(argv: Argv, mut: Mutex, clientRefresh: () => void) {
  const ctx: BuildCtx = {
    buildId: newBuildId(),
    buildId: randomIdNonSecure(),
    argv,
    cfg,
    allSlugs: [],
@@ -162,7 +159,7 @@
    return
  }
  const buildId = newBuildId()
  const buildId = randomIdNonSecure()
  ctx.buildId = buildId
  buildData.lastBuildMs = new Date().getTime()
  const release = await mut.acquire()
@@ -359,7 +356,7 @@
    toRemove.add(filePath)
  }
  const buildId = newBuildId()
  const buildId = randomIdNonSecure()
  ctx.buildId = buildId
  buildData.lastBuildMs = new Date().getTime()
  const release = await mut.acquire()