Skip to content

Commit

Permalink
chore(deps): update dependency prettier to v3 (#656)
Browse files Browse the repository at this point in the history
Co-authored-by: wolfy1339 <webmaster@wolfy1339.com>
  • Loading branch information
renovate[bot] and wolfy1339 authored Jul 9, 2023
1 parent ecf360f commit a13839b
Show file tree
Hide file tree
Showing 12 changed files with 926 additions and 925 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ octokit.rest.packages.getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUse
{
package_type,
package_name,
}
},
);
```

Expand Down
11 changes: 6 additions & 5 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 @@ -44,7 +44,7 @@
"lodash.upperfirst": "^4.3.1",
"mustache": "^4.0.0",
"npm-run-all": "^4.1.5",
"prettier": "2.8.8",
"prettier": "3.0.0",
"semantic-release-plugin-update-version-in-files": "^1.0.0",
"sort-keys": "^4.2.0",
"string-to-jsdoc-comment": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion scripts/update-endpoints/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ async function generateRoutes() {

writeFileSync(
ROUTES_PATH,
prettier.format(
await prettier.format(
`import type { EndpointsDefaultsAndDecorations } from "../types";
const Endpoints: EndpointsDefaultsAndDecorations = ${JSON.stringify(
sortKeys(newRoutes, { deep: true })
Expand Down
6 changes: 3 additions & 3 deletions scripts/update-endpoints/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ async function generateRoutes() {

for (const endpoint of endpoints) {
const path = `docs/${endpoint.scope}/${endpoint.id}.md`;
outputFileSync(path, template(endpoint));
outputFileSync(path, await template(endpoint));
console.log(`${path} written`);
}
}

function template(endpoint) {
async function template(endpoint) {
const deprecationNotice = endpoint.isDeprecated
? "**This method is deprecated.**"
: "";
Expand Down Expand Up @@ -96,7 +96,7 @@ ${parameters}
See also: [GitHub Developer Guide documentation](${endpoint.documentationUrl}).`;

return prettier.format(content, {
return await prettier.format(content, {
parser: "markdown",
});
}
2 changes: 1 addition & 1 deletion scripts/update-endpoints/fetch-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async function main() {

writeFileSync(
path.resolve(__dirname, "generated", "endpoints.json"),
prettier.format(JSON.stringify(endpoints), {
await prettier.format(JSON.stringify(endpoints), {
parser: "json",
})
);
Expand Down
4 changes: 2 additions & 2 deletions scripts/update-endpoints/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async function generateTypes() {
}`);
}

const methodTypesSource = prettier.format(
const methodTypesSource = await prettier.format(
[
`import type { EndpointInterface, RequestInterface } from "@octokit/types";`,
`import type { RestEndpointMethodTypes } from "./parameters-and-response-types";`,
Expand All @@ -93,7 +93,7 @@ async function generateTypes() {
parser: "typescript",
}
);
const parametersAndResponsesTypes = prettier.format(
const parametersAndResponsesTypes = await prettier.format(
[
`import type { Endpoints, RequestParameters } from "@octokit/types";`,
"",
Expand Down
12 changes: 6 additions & 6 deletions src/endpoints-to-methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ for (const [scope, endpoints] of Object.entries(ENDPOINTS)) {
method,
url,
},
defaults
defaults,
);

if (!endpointMethodsMap.has(scope)) {
Expand Down Expand Up @@ -63,7 +63,7 @@ const handler = {
scope,
methodName,
endpointDefaults,
decorations
decorations,
);
} else {
cache[methodName] = octokit.request.defaults(endpointDefaults);
Expand All @@ -88,7 +88,7 @@ function decorate(
scope: string,
methodName: string,
defaults: EndpointOptions,
decorations: EndpointDecorations
decorations: EndpointDecorations,
) {
const requestWithDefaults = octokit.request.defaults(defaults);

Expand All @@ -111,7 +111,7 @@ function decorate(
if (decorations.renamed) {
const [newScope, newMethodName] = decorations.renamed;
octokit.log.warn(
`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`
`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`,
);
}
if (decorations.deprecated) {
Expand All @@ -123,11 +123,11 @@ function decorate(
const options = requestWithDefaults.endpoint.merge(...args);

for (const [name, alias] of Object.entries(
decorations.renamedParameters
decorations.renamedParameters,
)) {
if (name in options) {
octokit.log.warn(
`"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
`"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`,
);
if (!(alias in options)) {
options[alias] = options[name];
Expand Down
Loading

0 comments on commit a13839b

Please sign in to comment.