Skip to content

sync: a project harness whose docs folder is built and git-ignored makes the lock depend on whether a build ran #54

Closed

Description

@tenphi

In short

  • A workspace's own harness can point docs at a folder that its build writes and git ignores.
  • sync then gives a different lock and different AGENTS.md blocks before and after a build, so sync --check fails on one side.
  • Excluding the docs unit in harnesspm.json makes the lock stable, but every sync without a build warns that the unit does not exist.
  • Seen on 0.9.0. Related: check: docs built at prepack go unchecked, and links to files the tarball leaves out pass #52, which asks check to read built docs. This issue is about sync only.

What happens

tenphi/cookbook ships a harness in its @tenphi/cookbook workspace (packages/facade). Its docs is ../docs. The build and prepack write that folder from the repository's docs/, and .gitignore lists /packages/facade/docs/. Two rules meet:

Step What harnesspm does Source
No build yet (fresh clone, CI after install) The folder is missing, so there is no cookbook:docs unit. src/manifest.ts, if (isDir(dir))
After pnpm build The unit appears. Git ignores the folder itself, so gitKeeps() keeps every page, as it does for an installed package. The lock gets a hash of about 75 pages, and each workspace that depends on @tenphi/cookbook gets a Docs: line. src/util.ts gitKeeps(), src/lock.ts docsHash()

So a sync after a build writes a lock and blocks that CI's sync --check, which runs before any build, rejects. A sync before a build fails --check on a machine that has built.

Workaround

"exclude": ["cookbook:docs"] in harnesspm.json. The lock is then the same with and without the build. But without a build, every sync, including the one the install runs, warns:

⚠️  harnesspm.json: exclude names cookbook:docs, which does not exist. It may have been renamed upstream.

Proposal

For sync (lock, index and blocks), make a project-layer docs unit independent of what was built on this machine. check keeps reading the built pages, as #52 asks. For example:

  • In the project layer, treat a docs folder that git ignores, or that does not exist yet, as no docs unit. The lock and the blocks are then the same everywhere, and no exclude is needed.
  • Or: skip the "does not exist" warning for an excluded docs unit of the project layer whose folder is missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions