Skip to content

Commit 24526a3

Browse files
committed
Move branch-slug to @getpaseo/protocol
The app must not import @getpaseo/server. Moving the slug validation and slugify helpers into @getpaseo/protocol (already a shared dep of app, client, server) gives every package a legitimate home for the import. Drops the corresponding ./utils/branch-slug subpath from @getpaseo/server's exports map. Unblocks the Deploy App workflow, which only builds protocol/client/ audio for the app — server's dist never exists in that pipeline.
1 parent 6d1aa1f commit 24526a3

6 files changed

Lines changed: 4 additions & 24 deletions

File tree

packages/app/src/components/sidebar-workspace-list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from "react-native";
1414
import * as Haptics from "expo-haptics";
1515
import { useMutation, useQueries, useQueryClient } from "@tanstack/react-query";
16-
import { slugify, validateBranchSlug, MAX_SLUG_LENGTH } from "@getpaseo/server/utils/branch-slug";
16+
import { slugify, validateBranchSlug, MAX_SLUG_LENGTH } from "@getpaseo/protocol/branch-slug";
1717
import { AdaptiveRenameModal } from "@/components/rename-modal";
1818
import { invalidateCheckoutGitQueriesForClient } from "@/git/query-keys";
1919
import {

packages/server/src/utils/branch-slug.test.ts renamed to packages/protocol/src/branch-slug.test.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,6 @@ describe("branch slug utilities", () => {
4040
});
4141
});
4242

43-
it("is exported through the package subpath", () => {
44-
const currentDir = dirname(fileURLToPath(import.meta.url));
45-
const packageJson = JSON.parse(
46-
readFileSync(join(currentDir, "..", "..", "package.json"), "utf8"),
47-
) as {
48-
exports?: Record<string, { types?: string; source?: string; default?: string }>;
49-
};
50-
51-
expect(packageJson.exports?.["./utils/branch-slug"]).toEqual({
52-
types: "./dist/server/utils/branch-slug.d.ts",
53-
source: "./src/utils/branch-slug.ts",
54-
default: "./dist/server/utils/branch-slug.js",
55-
});
56-
});
57-
5843
it("does not import server-only modules", () => {
5944
const currentDir = dirname(fileURLToPath(import.meta.url));
6045
const source = readFileSync(join(currentDir, "branch-slug.ts"), "utf8");

packages/server/package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
"types": "./dist/server/utils/tool-call-parsers.d.ts",
2323
"source": "./src/utils/tool-call-parsers.ts",
2424
"default": "./dist/server/utils/tool-call-parsers.js"
25-
},
26-
"./utils/branch-slug": {
27-
"types": "./dist/server/utils/branch-slug.d.ts",
28-
"source": "./src/utils/branch-slug.ts",
29-
"default": "./dist/server/utils/branch-slug.js"
3025
}
3126
},
3227
"publishConfig": {

packages/server/src/server/session.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ import {
199199
createPullRequest,
200200
renameCurrentBranch,
201201
} from "../utils/checkout-git.js";
202-
import { validateBranchSlug } from "../utils/branch-slug.js";
202+
import { validateBranchSlug } from "@getpaseo/protocol/branch-slug";
203203
import { getProjectIcon } from "../utils/project-icon.js";
204204
import { expandTilde } from "../utils/path.js";
205205
import { searchHomeDirectories, searchWorkspaceEntries } from "../utils/directory-suggestions.js";

packages/server/src/utils/worktree.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ import { spawnProcess } from "./spawn.js";
3030
import { resolvePaseoHome } from "../server/paseo-home.js";
3131
import { createExternalProcessEnv } from "../server/paseo-env.js";
3232
import { parseGitRevParsePath, resolveGitRevParsePath } from "./git-rev-parse-path.js";
33-
import { validateBranchSlug } from "./branch-slug.js";
33+
import { validateBranchSlug } from "@getpaseo/protocol/branch-slug";
3434

35-
export { slugify, validateBranchSlug } from "./branch-slug.js";
35+
export { slugify, validateBranchSlug } from "@getpaseo/protocol/branch-slug";
3636

3737
const execFileAsync = promisify(execFile);
3838
const READ_ONLY_GIT_ENV = {

0 commit comments

Comments
 (0)