-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(cli): @fern-api/api-workspace-commons is browser compatible (#5294
- Loading branch information
Showing
22 changed files
with
66 additions
and
38 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
export { getBasename } from "./getBasename"; | ||
export { getPackageName } from "./getPackageName"; | ||
export { getSdkVersion } from "./getSdkVersion"; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
packages/cli/workspace-commons/src/utils/getAllDefinitionFiles.ts
This file contains 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
2 changes: 1 addition & 1 deletion
2
packages/cli/workspace-commons/src/utils/getAllNamedDefinitionFiles.ts
This file contains 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
2 changes: 1 addition & 1 deletion
2
packages/cli/workspace-commons/src/utils/getAllPackageMarkers.ts
This file contains 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
packages/cli/workspace-commons/src/utils/visitAllDefinitionFiles.ts
This file contains 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
2 changes: 1 addition & 1 deletion
2
packages/cli/workspace-commons/src/utils/visitAllPackageMarkers.ts
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function basename(path: string): string { | ||
return path.split("/").pop() ?? ""; | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { AbsoluteFilePath } from "./AbsoluteFilePath"; | ||
import { RelativeFilePath } from "./RelativeFilePath"; | ||
|
||
export function dirname(filepath: RelativeFilePath): RelativeFilePath; | ||
export function dirname(filepath: AbsoluteFilePath): AbsoluteFilePath; | ||
export function dirname(filepath: string): string { | ||
const trimmed = filepath.replace(/\/+$/, ""); | ||
const lastSlashIndex = trimmed.lastIndexOf("/"); | ||
if (lastSlashIndex === -1) { | ||
return "."; | ||
} | ||
if (lastSlashIndex === 0) { | ||
return "/"; | ||
} | ||
return filepath.slice(0, lastSlashIndex); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
export { AbsoluteFilePath } from "./AbsoluteFilePath"; | ||
export { RelativeFilePath } from "./RelativeFilePath"; | ||
export { basename } from "./basename"; | ||
export { convertToOsPath } from "./convertToOsPath"; | ||
export { dirname } from "./dirname"; | ||
export { join } from "./join"; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { AbsoluteFilePath } from "./AbsoluteFilePath"; | ||
import { RelativeFilePath } from "./RelativeFilePath"; | ||
|
||
export function join(first: RelativeFilePath, ...parts: RelativeFilePath[]): RelativeFilePath; | ||
export function join(first: AbsoluteFilePath, ...parts: RelativeFilePath[]): AbsoluteFilePath; | ||
export function join(...parts: RelativeFilePath[]): RelativeFilePath; | ||
export function join(...parts: string[]): string { | ||
const stack: string[] = []; | ||
for (const part of parts.flatMap((segment) => segment.split("/")).filter(Boolean)) { | ||
if (part === "." || part === "") { | ||
continue; | ||
} | ||
if (part === "..") { | ||
if (stack.length > 0 && stack[stack.length - 1] !== "..") { | ||
stack.pop(); | ||
} else { | ||
stack.push(part); | ||
} | ||
} else { | ||
stack.push(part); | ||
} | ||
} | ||
return (parts[0]?.startsWith("/") ? "/" : "") + stack.join("/"); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.