Skip to content

Commit ae95c8f

Browse files
CopilotAddono
andcommitted
refactor: fixes lint/format breakage from missing Web API global (#32)
* Initial plan * fix: resolve CI lint and format failures Co-authored-by: Addono <15435678+Addono@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Addono <15435678+Addono@users.noreply.github.com>
1 parent c3fcfe7 commit ae95c8f

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const nodeGlobals = {
2020
URL: "readonly",
2121
fetch: "readonly",
2222
FormData: "readonly",
23+
Response: "readonly",
2324
NodeJS: "readonly",
2425
};
2526

src/cli/commands/upload.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ import { createReleaseAssetStrategy } from "../../core/strategies/releaseAsset.j
55
import { createBrowserSessionStrategy } from "../../core/strategies/browserSession.js";
66
import { createCookieExtractionStrategy } from "../../core/strategies/cookieExtraction.js";
77
import { createRepoBranchStrategy } from "../../core/strategies/repoBranch.js";
8-
import { getSessionCookies, getSessionToken, loadSession } from "../../core/session.js";
8+
import {
9+
getSessionCookies,
10+
getSessionToken,
11+
loadSession,
12+
} from "../../core/session.js";
913
import { parseTarget } from "../../core/target.js";
1014
import { validateFile } from "../../core/validation.js";
1115
import { upload } from "../../core/upload.js";
@@ -38,14 +42,16 @@ const DEFAULT_STRATEGY_ORDER = [
3842
function createStrategy(name: string): UploadStrategy | null {
3943
const token = process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
4044
const session = loadSession();
41-
const cookies =
42-
process.env.GH_ATTACH_COOKIES ?? getSessionCookies(session);
45+
const cookies = process.env.GH_ATTACH_COOKIES ?? getSessionCookies(session);
4346
const sessionToken = getSessionToken(session);
4447

4548
switch (name) {
4649
case "browser-session":
4750
if (cookies || sessionToken) {
48-
return createBrowserSessionStrategy({ cookies: cookies ?? undefined, token: sessionToken ?? undefined });
51+
return createBrowserSessionStrategy({
52+
cookies: cookies ?? undefined,
53+
token: sessionToken ?? undefined,
54+
});
4955
}
5056
return null;
5157
case "cookie-extraction":

test/unit/cli/commands/login.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,7 @@ describe("loginCommand unit tests", () => {
181181
it("throws AuthenticationError when gh auth token returns empty string", async () => {
182182
setupGhTokenMock("");
183183

184-
await expect(loginCommand({})).rejects.toThrow(
185-
/empty token/,
186-
);
184+
await expect(loginCommand({})).rejects.toThrow(/empty token/);
187185
});
188186

189187
it("passes statePath option through to session saver", async () => {

0 commit comments

Comments
 (0)