Allow non repo root package.json workspace files for build skipping

Build skipping requires the workspace package.json to be at the repository root.
We have a monorepo with multiple languages and one top-level directory for different languages (products/services).
Our next.js apps are in /typescript/apps/... and /typescript is the workspace root with a package.json.
The build skipping logic should figure out if a project root dir is inside a workspace dir by looking at parent directories, instead of just relying on the top-level directory.