Skip to content

Commit

Permalink
chore(deps): update dependency prettier to v3 (#600)
Browse files Browse the repository at this point in the history
* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* style: prettier

* docs: update ToC for README.md

* Last word on trailing comma

---------

Co-authored-by: prettier-toc-me[bot] <56236715+prettier-toc-me[bot]@users.noreply.github.com>
Co-authored-by: Create or Update Pull Request Action <create-or-update-pull-request@users.noreply.github.com>
Co-authored-by: Keegan Campbell <me@kfcampbell.com>
  • Loading branch information
4 people authored Jul 6, 2023
1 parent 91beddd commit 60e9b57
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 47 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ const { data: app } = await requestWithAuth(
owner: "octocat",
repo: "hello-world",
title: "Hello from the engine room",
}
},
);
```

Expand Down Expand Up @@ -533,7 +533,7 @@ request(
authorization: `token 0000000000000000000000000000000000000001`,
},
data: "Hello, world!",
}
},
);
```

Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"glob": "^10.2.4",
"jest": "^29.0.0",
"lolex": "^6.0.0",
"prettier": "2.8.8",
"prettier": "3.0.0",
"semantic-release-plugin-update-version-in-files": "^1.0.0",
"string-to-arraybuffer": "^1.0.2",
"ts-jest": "^29.0.0",
Expand Down
10 changes: 5 additions & 5 deletions src/fetch-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import getBuffer from "./get-buffer-response";
export default function fetchWrapper(
requestOptions: ReturnType<EndpointInterface> & {
redirect?: "error" | "follow" | "manual";
}
},
) {
const log =
requestOptions.request && requestOptions.request.log
Expand All @@ -32,7 +32,7 @@ export default function fetchWrapper(

if (!fetch) {
throw new Error(
'Global "fetch" not found. Please provide `options.request.fetch` to octokit or upgrade to node@18 or newer.'
'Global "fetch" not found. Please provide `options.request.fetch` to octokit or upgrade to node@18 or newer.',
);
}

Expand All @@ -50,8 +50,8 @@ export default function fetchWrapper(
},
// `requestOptions.request.agent` type is incompatible
// see https://github.com/octokit/types.ts/pull/264
requestOptions.request as any
)
requestOptions.request as any,
),
)
.then(async (response) => {
url = response.url;
Expand All @@ -70,7 +70,7 @@ export default function fetchWrapper(
requestOptions.url
}" is deprecated. It is scheduled to be removed on ${headers.sunset}${
deprecationLink ? `. See ${deprecationLink}` : ""
}`
}`,
);
}

Expand Down
8 changes: 4 additions & 4 deletions src/with-defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import type {

export default function withDefaults(
oldEndpoint: EndpointInterface,
newDefaults: RequestParameters
newDefaults: RequestParameters,
): RequestInterface {
const endpoint = oldEndpoint.defaults(newDefaults);
const newApi = function (
route: Route | EndpointOptions,
parameters?: RequestParameters
parameters?: RequestParameters,
): Promise<OctokitResponse<any>> {
const endpointOptions = endpoint.merge(<Route>route, parameters);

Expand All @@ -25,10 +25,10 @@ export default function withDefaults(

const request = (
route: Route | EndpointOptions,
parameters?: RequestParameters
parameters?: RequestParameters,
) => {
return fetchWrapper(
endpoint.parse(endpoint.merge(<Route>route, parameters))
endpoint.parse(endpoint.merge(<Route>route, parameters)),
);
};

Expand Down
6 changes: 3 additions & 3 deletions test/defaults.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("endpoint.defaults()", () => {
authorization: "token 0000000000000000000000000000000000000001",
"user-agent": "myApp/1.2.3",
},
}
},
);

const myRequest = request.defaults({
Expand Down Expand Up @@ -52,7 +52,7 @@ describe("endpoint.defaults()", () => {
authorization: "token 0000000000000000000000000000000000000001",
"user-agent": "myApp/1.2.3",
},
}
},
);

const myProjectRequest = request.defaults({
Expand All @@ -77,7 +77,7 @@ describe("endpoint.defaults()", () => {
return myProjectRequestWithAuth(`GET /orgs/{org}/repos`).then(
(response) => {
expect(response.status).toEqual(200);
}
},
);
});
});
52 changes: 26 additions & 26 deletions test/request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
"user-agent": userAgent,
authorization: `bearer ${BEARER}`,
},
}
},
)
.postOnce(
"https://api.github.com/repos/octocat/hello-world/issues",
Expand All @@ -133,7 +133,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
"user-agent": userAgent,
authorization: `token secret123`,
},
}
},
);
const auth = createAppAuth({
appId: APP_ID,
Expand Down Expand Up @@ -238,7 +238,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==

return request(
`HEAD /repos/{owner}/{repo}/pulls/{number}`,
Object.assign(options, { number: 2 })
Object.assign(options, { number: 2 }),
);
})

Expand All @@ -260,13 +260,13 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
status: 200,
body: Buffer.from(
"1f8b0800000000000003cb4f2ec9cfce2cd14dcbac28292d4ad5cd2f4ad74d4f2dd14d2c4acec82c4bd53580007d060a0050bfb9b9a90203c428741ac2313436343307222320dbc010a8dc5c81c194124b8905a5c525894540a714e5e797e05347481edd734304e41319ff41ae8e2ebeae7ab92964d801d46f66668227fe0d4d51e3dfc8d0c8d808284f75df6201233cfe951590627ba01d330a46c1281805a3806e000024cb59d6000a0000",
"hex"
"hex",
),
headers: {
"content-type": "application/x-gzip",
"content-length": "172",
},
}
},
);

return request("GET /repos/{owner}/{repo}/{archive_format}/{ref}", {
Expand Down Expand Up @@ -295,13 +295,13 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
// body: Buffer.from('1f8b0800000000000003cb4f2ec9cfce2cd14dcbac28292d4ad5cd2f4ad74d4f2dd14d2c4acec82c4bd53580007d060a0050bfb9b9a90203c428741ac2313436343307222320dbc010a8dc5c81c194124b8905a5c525894540a714e5e797e05347481edd734304e41319ff41ae8e2ebeae7ab92964d801d46f66668227fe0d4d51e3dfc8d0c8d808284f75df6201233cfe951590627ba01d330a46c1281805a3806e000024cb59d6000a0000', 'hex'),
body: Buffer.from(
"1f8b0800000000000003cb4f2ec9cfce2cd14dcbac28292d4ad5cd2f4ad74d4f2dd14d2c4acec82c4bd53580007d060a0050bfb9b9a90203c428741ac2313436343307222320dbc010a8dc5c81c194124b8905a5c525894540a714e5e797e05347481edd734304e41319ff41ae8e2ebeae7ab92964d801d46f66668227fe0d4d51e3dfc8d0c8d808284f75df6201233cfe951590627ba01d330a46c1281805a3806e000024cb59d6000a0000",
"hex"
"hex",
),
headers: {
"content-type": "application/x-gzip",
"content-length": "172",
},
}
},
);

return request(
Expand All @@ -310,7 +310,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
request: {
fetch: mock,
},
}
},
);
});

Expand Down Expand Up @@ -396,7 +396,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
}
globalThis.fetch = originalFetch;
expect(error?.message).toEqual(
'Global "fetch" not found. Please provide `options.request.fetch` to octokit or upgrade to node@18 or newer.'
'Global "fetch" not found. Please provide `options.request.fetch` to octokit or upgrade to node@18 or newer.',
);
});

Expand Down Expand Up @@ -445,7 +445,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
.get(
(_url, { headers }) =>
(headers as ResponseHeaders)["user-agent"] === "funky boom boom pow",
200
200,
);

return request("GET /", {
Expand Down Expand Up @@ -491,7 +491,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
expect(error.status).toEqual(422);
expect(error.response.headers["x-foo"]).toEqual("bar");
expect(error.response.data.documentation_url).toEqual(
"https://developer.github.com/v3/issues/labels/#create-a-label"
"https://developer.github.com/v3/issues/labels/#create-a-label",
);
expect(error.response.data.errors).toEqual([
{ resource: "Label", code: "invalid", field: "color" },
Expand Down Expand Up @@ -531,7 +531,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
},
}).catch((error) => {
expect(error.request.url).toEqual(
"https://api.github.com/?client_id=123&client_secret=[REDACTED]"
"https://api.github.com/?client_id=123&client_secret=[REDACTED]",
);
});
});
Expand All @@ -557,7 +557,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
return request("https://www.githubstatus.com/api/v2/status.json").then(
({ url }) => {
expect(url).toEqual("https://www.githubstatus.com/api/v2/status.json");
}
},
);
});

Expand Down Expand Up @@ -608,7 +608,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
headers: {
"x-foo": "bar",
},
}
},
);

const hook = (request: RequestInterface, options: EndpointOptions) => {
Expand Down Expand Up @@ -728,7 +728,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
accept: "application/vnd.github.v3+json",
authorization: "token secret123",
},
}
},
);

return request("PUT /repos/{owner}/{repo}/branches/{branch}/protection", {
Expand Down Expand Up @@ -758,7 +758,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
.catch((error) => {
expect(error).toHaveProperty(
"message",
`Validation failed: "Only organization repositories can have users and team restrictions", {"resource":"Search","field":"q","code":"invalid"}`
`Validation failed: "Only organization repositories can have users and team restrictions", {"resource":"Search","field":"q","code":"invalid"}`,
);
});
});
Expand All @@ -782,7 +782,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
authorization: "token 0000000000000000000000000000000000000001",
"user-agent": userAgent,
},
}
},
);

const warn = jest.fn();
Expand All @@ -797,7 +797,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
expect(response.data).toEqual({ id: 123 });
expect(warn).toHaveBeenCalledTimes(1);
expect(warn).toHaveBeenCalledWith(
'[@octokit/request] "GET https://api.github.com/teams/123" is deprecated. It is scheduled to be removed on Mon, 01 Feb 2021 00:00:00 GMT. See https://developer.github.com/changes/2020-01-21-moving-the-team-api-endpoints/'
'[@octokit/request] "GET https://api.github.com/teams/123" is deprecated. It is scheduled to be removed on Mon, 01 Feb 2021 00:00:00 GMT. See https://developer.github.com/changes/2020-01-21-moving-the-team-api-endpoints/',
);
});
});
Expand All @@ -820,7 +820,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
authorization: "token 0000000000000000000000000000000000000001",
"user-agent": userAgent,
},
}
},
);

const warn = jest.fn();
Expand All @@ -835,7 +835,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
expect(response.data).toEqual({ id: 123 });
expect(warn).toHaveBeenCalledTimes(1);
expect(warn).toHaveBeenCalledWith(
'[@octokit/request] "GET https://api.github.com/teams/123" is deprecated. It is scheduled to be removed on Mon, 01 Feb 2021 00:00:00 GMT'
'[@octokit/request] "GET https://api.github.com/teams/123" is deprecated. It is scheduled to be removed on Mon, 01 Feb 2021 00:00:00 GMT',
);
});
});
Expand All @@ -861,7 +861,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
expect(error.status).toEqual(404);
expect(error.response.data.message).toEqual("Not Found");
expect(error.response.data.documentation_url).toEqual(
"https://docs.github.com/en/rest/reference/repos#get-a-repository"
"https://docs.github.com/en/rest/reference/repos#get-a-repository",
);
});
});
Expand Down Expand Up @@ -908,7 +908,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
"https://api.github.com/repos/octokit-fixture-org/release-assets/releases/v1.0.0/assets",
{
status: 200,
}
},
);

return request("POST /repos/{owner}/{repo}/releases/{release_id}/assets", {
Expand Down Expand Up @@ -939,7 +939,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
"https://api.github.com/repos/octokit-fixture-org/release-assets/releases/tags/v1.0.0",
{
status: 200,
}
},
);

return request("POST /repos/{owner}/{repo}/releases/tags/{tag}", {
Expand Down Expand Up @@ -969,7 +969,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
"https://api.github.com/repos/octokit-fixture-org/release-assets/releases/tags/v1.0.0",
{
status: 200,
}
},
);

return request("POST /repos/{owner}/{repo}/releases/tags/{tag}", {
Expand All @@ -988,7 +988,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
}).then((response) => {
expect(response.status).toEqual(200);
expect(mock.lastOptions()?.body).toEqual(
stringToArrayBuffer("Hello, world!\n")
stringToArrayBuffer("Hello, world!\n"),
);
expect(mock.done()).toBe(true);
});
Expand Down Expand Up @@ -1019,7 +1019,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
"https://api.github.com/repos/octokit-fixture-org/release-assets/releases/tags/v1.0.0",
new Promise(() => {
abortController.abort();
})
}),
);

return request("POST /repos/{owner}/{repo}/releases/tags/{tag}", {
Expand Down

0 comments on commit 60e9b57

Please sign in to comment.