This repository was archived by the owner on Mar 24, 2026. It is now read-only.
Split git and path utilities into packages - #179
Closed
ecraig12345 wants to merge 1 commit into
Closed
Conversation
ecraig12345
force-pushed
the
ecraig/split-git
branch
from
September 15, 2022 22:23
c27060e to
a3500d5
Compare
ecraig12345
commented
Sep 15, 2022
| const gitRoot = findGitRoot(cwd); | ||
|
|
||
| let packageJson: Partial<PackageInfo> = {}; | ||
| let packageJson: { repository?: string | { url?: string } } = {}; |
Member
Author
There was a problem hiding this comment.
Removed the PackageInfo type since that's now defined in a different package (which consumes this one)
| * Throws if `cwd` is not in a Git repository. | ||
| */ | ||
| export function findGitRoot(cwd: string) { | ||
| const result = spawnSync("git", ["rev-parse", "--show-toplevel"], { cwd }); |
Member
Author
There was a problem hiding this comment.
This now uses spawnSync directly since the git() utility is defined in another package (which consumes this one). I didn't bother with changing the maxBuffer here since the output should be very short.
| return workspaceRoot || findGitRoot(cwd); | ||
| } | ||
|
|
||
| /** @deprecated */ |
Member
Author
There was a problem hiding this comment.
This was included in the initial repo creation but seems to be unused in workspace-tools, beachball, backfill, and lage
ecraig12345
force-pushed
the
ecraig/split-git
branch
2 times, most recently
from
September 17, 2022 01:54
54dd56b to
6dd9059
Compare
ecraig12345
force-pushed
the
ecraig/split-git
branch
from
September 17, 2022 01:59
6dd9059 to
f2ed33e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Start splitting utilities into packages:
workspace-tools-gitcontains git helpersworkspace-tools-pathscontains very basic path helpersFor now,
findProjectRootis staying inworkspace-toolssince it uses the more complex workspace implementation helpers. Later I'll factor out the core path logic (without extra deps) so it can be moved into the paths package.I also moved the fixtures frommoved to #185packages/workspace-tools/src/__fixtures__toscripts/jest/__fixtures__, along with the fixture setup helper. This is so that multiple packages can use the fixtures.