chore(deps): bump prettier from 2.8.0 to 3.3.3 (#480)
* Bump prettier from 2.8.0 to 3.3.3 Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 3.3.3. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.0...3.3.3) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * run fmt Signed-off-by: Rui Chen <rui@chenrui.dev> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Rui Chen <rui@chenrui.dev> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Rui Chen <rui@chenrui.dev>
This commit is contained in:
parent
62060560e3
commit
25849b1326
@ -14,9 +14,9 @@ describe("util", () => {
|
|||||||
it("strips template", () => {
|
it("strips template", () => {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
uploadUrl(
|
uploadUrl(
|
||||||
"https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets{?name,label}"
|
"https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets{?name,label}",
|
||||||
),
|
),
|
||||||
"https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets"
|
"https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets",
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -30,7 +30,7 @@ describe("util", () => {
|
|||||||
it("parses newline and comma-delimited (and then some)", () => {
|
it("parses newline and comma-delimited (and then some)", () => {
|
||||||
assert.deepStrictEqual(
|
assert.deepStrictEqual(
|
||||||
parseInputFiles("foo,bar\nbaz,boom,\n\ndoom,loom "),
|
parseInputFiles("foo,bar\nbaz,boom,\n\ndoom,loom "),
|
||||||
["foo", "bar", "baz", "boom", "doom", "loom"]
|
["foo", "bar", "baz", "boom", "doom", "loom"],
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -53,7 +53,7 @@ describe("util", () => {
|
|||||||
input_discussion_category_name: undefined,
|
input_discussion_category_name: undefined,
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it("uses input body path", () => {
|
it("uses input body path", () => {
|
||||||
@ -74,7 +74,7 @@ describe("util", () => {
|
|||||||
input_discussion_category_name: undefined,
|
input_discussion_category_name: undefined,
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it("defaults to body path when both body and body path are provided", () => {
|
it("defaults to body path when both body and body path are provided", () => {
|
||||||
@ -95,7 +95,7 @@ describe("util", () => {
|
|||||||
input_discussion_category_name: undefined,
|
input_discussion_category_name: undefined,
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -129,7 +129,7 @@ describe("util", () => {
|
|||||||
input_discussion_category_name: undefined,
|
input_discussion_category_name: undefined,
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ describe("util", () => {
|
|||||||
input_discussion_category_name: undefined,
|
input_discussion_category_name: undefined,
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it("supports discussion category names", () => {
|
it("supports discussion category names", () => {
|
||||||
@ -180,7 +180,7 @@ describe("util", () => {
|
|||||||
input_discussion_category_name: "releases",
|
input_discussion_category_name: "releases",
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -206,7 +206,7 @@ describe("util", () => {
|
|||||||
input_discussion_category_name: undefined,
|
input_discussion_category_name: undefined,
|
||||||
input_generate_release_notes: true,
|
input_generate_release_notes: true,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -235,7 +235,7 @@ describe("util", () => {
|
|||||||
input_discussion_category_name: undefined,
|
input_discussion_category_name: undefined,
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it("uses input token as the source of GITHUB_TOKEN by default", () => {
|
it("uses input token as the source of GITHUB_TOKEN by default", () => {
|
||||||
@ -262,7 +262,7 @@ describe("util", () => {
|
|||||||
input_discussion_category_name: undefined,
|
input_discussion_category_name: undefined,
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it("parses basic config with draft and prerelease", () => {
|
it("parses basic config with draft and prerelease", () => {
|
||||||
@ -288,7 +288,7 @@ describe("util", () => {
|
|||||||
input_discussion_category_name: undefined,
|
input_discussion_category_name: undefined,
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it("parses basic config where make_latest is passed", () => {
|
it("parses basic config where make_latest is passed", () => {
|
||||||
@ -313,7 +313,7 @@ describe("util", () => {
|
|||||||
input_discussion_category_name: undefined,
|
input_discussion_category_name: undefined,
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: "false",
|
input_make_latest: "false",
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it("parses basic config with append_body", () => {
|
it("parses basic config with append_body", () => {
|
||||||
@ -338,7 +338,7 @@ describe("util", () => {
|
|||||||
input_discussion_category_name: undefined,
|
input_discussion_category_name: undefined,
|
||||||
input_generate_release_notes: false,
|
input_generate_release_notes: false,
|
||||||
input_make_latest: undefined,
|
input_make_latest: undefined,
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -355,7 +355,7 @@ describe("util", () => {
|
|||||||
it("resolves files given a set of paths", async () => {
|
it("resolves files given a set of paths", async () => {
|
||||||
assert.deepStrictEqual(
|
assert.deepStrictEqual(
|
||||||
paths(["tests/data/**/*", "tests/data/does/not/exist/*"]),
|
paths(["tests/data/**/*", "tests/data/does/not/exist/*"]),
|
||||||
["tests/data/foo/bar.txt"]
|
["tests/data/foo/bar.txt"],
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -364,7 +364,7 @@ describe("util", () => {
|
|||||||
it("returns the patterns that don't match any files", async () => {
|
it("returns the patterns that don't match any files", async () => {
|
||||||
assert.deepStrictEqual(
|
assert.deepStrictEqual(
|
||||||
unmatchedPatterns(["tests/data/**/*", "tests/data/does/not/exist/*"]),
|
unmatchedPatterns(["tests/data/**/*", "tests/data/does/not/exist/*"]),
|
||||||
["tests/data/does/not/exist/*"]
|
["tests/data/does/not/exist/*"],
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
12
package-lock.json
generated
12
package-lock.json
generated
@ -23,7 +23,7 @@
|
|||||||
"@vercel/ncc": "^0.38.1",
|
"@vercel/ncc": "^0.38.1",
|
||||||
"jest": "^29.3.1",
|
"jest": "^29.3.1",
|
||||||
"jest-circus": "^29.3.1",
|
"jest-circus": "^29.3.1",
|
||||||
"prettier": "2.8.0",
|
"prettier": "3.3.3",
|
||||||
"ts-jest": "^29.2.2",
|
"ts-jest": "^29.2.2",
|
||||||
"typescript": "^5.5.3",
|
"typescript": "^5.5.3",
|
||||||
"typescript-formatter": "^7.2.2"
|
"typescript-formatter": "^7.2.2"
|
||||||
@ -3854,15 +3854,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/prettier": {
|
"node_modules/prettier": {
|
||||||
"version": "2.8.0",
|
"version": "3.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz",
|
||||||
"integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==",
|
"integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"prettier": "bin-prettier.js"
|
"prettier": "bin/prettier.cjs"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.13.0"
|
"node": ">=14"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/prettier/prettier?sponsor=1"
|
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
"@vercel/ncc": "^0.38.1",
|
"@vercel/ncc": "^0.38.1",
|
||||||
"jest": "^29.3.1",
|
"jest": "^29.3.1",
|
||||||
"jest-circus": "^29.3.1",
|
"jest-circus": "^29.3.1",
|
||||||
"prettier": "2.8.0",
|
"prettier": "3.3.3",
|
||||||
"ts-jest": "^29.2.2",
|
"ts-jest": "^29.2.2",
|
||||||
"typescript": "^5.5.3",
|
"typescript": "^5.5.3",
|
||||||
"typescript-formatter": "^7.2.2"
|
"typescript-formatter": "^7.2.2"
|
||||||
|
@ -121,7 +121,7 @@ export class GitHubReleaser implements Releaser {
|
|||||||
}): AsyncIterableIterator<{ data: Release[] }> {
|
}): AsyncIterableIterator<{ data: Release[] }> {
|
||||||
const updatedParams = { per_page: 100, ...params };
|
const updatedParams = { per_page: 100, ...params };
|
||||||
return this.github.paginate.iterator(
|
return this.github.paginate.iterator(
|
||||||
this.github.rest.repos.listReleases.endpoint.merge(updatedParams)
|
this.github.rest.repos.listReleases.endpoint.merge(updatedParams),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -144,7 +144,7 @@ export const upload = async (
|
|||||||
github: GitHub,
|
github: GitHub,
|
||||||
url: string,
|
url: string,
|
||||||
path: string,
|
path: string,
|
||||||
currentAssets: Array<{ id: number; name: string }>
|
currentAssets: Array<{ id: number; name: string }>,
|
||||||
): Promise<any> => {
|
): Promise<any> => {
|
||||||
const [owner, repo] = config.github_repository.split("/");
|
const [owner, repo] = config.github_repository.split("/");
|
||||||
const { name, size, mime, data: body } = asset(path);
|
const { name, size, mime, data: body } = asset(path);
|
||||||
@ -152,7 +152,7 @@ export const upload = async (
|
|||||||
// note: GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "List release assets" endpoint lists the renamed filenames.
|
// note: GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "List release assets" endpoint lists the renamed filenames.
|
||||||
// due to this renaming we need to be mindful when we compare the file name we're uploading with a name github may already have rewritten for logical comparison
|
// due to this renaming we need to be mindful when we compare the file name we're uploading with a name github may already have rewritten for logical comparison
|
||||||
// see https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-asset
|
// see https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-asset
|
||||||
({ name: currentName }) => currentName == name.replace(" ", ".")
|
({ name: currentName }) => currentName == name.replace(" ", "."),
|
||||||
);
|
);
|
||||||
if (currentAsset) {
|
if (currentAsset) {
|
||||||
console.log(`♻️ Deleting previously uploaded asset ${name}...`);
|
console.log(`♻️ Deleting previously uploaded asset ${name}...`);
|
||||||
@ -180,7 +180,7 @@ export const upload = async (
|
|||||||
throw new Error(
|
throw new Error(
|
||||||
`Failed to upload release asset ${name}. received status code ${
|
`Failed to upload release asset ${name}. received status code ${
|
||||||
resp.status
|
resp.status
|
||||||
}\n${json.message}\n${JSON.stringify(json.errors)}`
|
}\n${json.message}\n${JSON.stringify(json.errors)}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return json;
|
return json;
|
||||||
@ -189,7 +189,7 @@ export const upload = async (
|
|||||||
export const release = async (
|
export const release = async (
|
||||||
config: Config,
|
config: Config,
|
||||||
releaser: Releaser,
|
releaser: Releaser,
|
||||||
maxRetries: number = 3
|
maxRetries: number = 3,
|
||||||
): Promise<Release> => {
|
): Promise<Release> => {
|
||||||
if (maxRetries <= 0) {
|
if (maxRetries <= 0) {
|
||||||
console.log(`❌ Too many retries. Aborting...`);
|
console.log(`❌ Too many retries. Aborting...`);
|
||||||
@ -234,13 +234,13 @@ export const release = async (
|
|||||||
repo,
|
repo,
|
||||||
discussion_category_name,
|
discussion_category_name,
|
||||||
generate_release_notes,
|
generate_release_notes,
|
||||||
maxRetries
|
maxRetries,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
let existingRelease: Release = _release!;
|
let existingRelease: Release = _release!;
|
||||||
console.log(
|
console.log(
|
||||||
`Found release ${existingRelease.name} (with id=${existingRelease.id})`
|
`Found release ${existingRelease.name} (with id=${existingRelease.id})`,
|
||||||
);
|
);
|
||||||
|
|
||||||
const release_id = existingRelease.id;
|
const release_id = existingRelease.id;
|
||||||
@ -250,7 +250,7 @@ export const release = async (
|
|||||||
config.input_target_commitish !== existingRelease.target_commitish
|
config.input_target_commitish !== existingRelease.target_commitish
|
||||||
) {
|
) {
|
||||||
console.log(
|
console.log(
|
||||||
`Updating commit from "${existingRelease.target_commitish}" to "${config.input_target_commitish}"`
|
`Updating commit from "${existingRelease.target_commitish}" to "${config.input_target_commitish}"`,
|
||||||
);
|
);
|
||||||
target_commitish = config.input_target_commitish;
|
target_commitish = config.input_target_commitish;
|
||||||
} else {
|
} else {
|
||||||
@ -301,7 +301,7 @@ export const release = async (
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.status !== 404) {
|
if (error.status !== 404) {
|
||||||
console.log(
|
console.log(
|
||||||
`⚠️ Unexpected error fetching GitHub release for tag ${config.github_ref}: ${error}`
|
`⚠️ Unexpected error fetching GitHub release for tag ${config.github_ref}: ${error}`,
|
||||||
);
|
);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
@ -314,7 +314,7 @@ export const release = async (
|
|||||||
repo,
|
repo,
|
||||||
discussion_category_name,
|
discussion_category_name,
|
||||||
generate_release_notes,
|
generate_release_notes,
|
||||||
maxRetries
|
maxRetries,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -327,7 +327,7 @@ async function createRelease(
|
|||||||
repo: string,
|
repo: string,
|
||||||
discussion_category_name: string | undefined,
|
discussion_category_name: string | undefined,
|
||||||
generate_release_notes: boolean | undefined,
|
generate_release_notes: boolean | undefined,
|
||||||
maxRetries: number
|
maxRetries: number,
|
||||||
) {
|
) {
|
||||||
const tag_name = tag;
|
const tag_name = tag;
|
||||||
const name = config.input_name || tag;
|
const name = config.input_name || tag;
|
||||||
@ -341,7 +341,7 @@ async function createRelease(
|
|||||||
commitMessage = ` using commit "${target_commitish}"`;
|
commitMessage = ` using commit "${target_commitish}"`;
|
||||||
}
|
}
|
||||||
console.log(
|
console.log(
|
||||||
`👩🏭 Creating new GitHub release for tag ${tag_name}${commitMessage}...`
|
`👩🏭 Creating new GitHub release for tag ${tag_name}${commitMessage}...`,
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
let release = await releaser.createRelease({
|
let release = await releaser.createRelease({
|
||||||
@ -366,7 +366,7 @@ async function createRelease(
|
|||||||
switch (error.status) {
|
switch (error.status) {
|
||||||
case 403:
|
case 403:
|
||||||
console.log(
|
console.log(
|
||||||
"Skip retry — your GitHub token/PAT does not have the required permission to create a release"
|
"Skip retry — your GitHub token/PAT does not have the required permission to create a release",
|
||||||
);
|
);
|
||||||
throw error;
|
throw error;
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ async function run() {
|
|||||||
throttle: {
|
throttle: {
|
||||||
onRateLimit: (retryAfter, options) => {
|
onRateLimit: (retryAfter, options) => {
|
||||||
console.warn(
|
console.warn(
|
||||||
`Request quota exhausted for request ${options.method} ${options.url}`
|
`Request quota exhausted for request ${options.method} ${options.url}`,
|
||||||
);
|
);
|
||||||
if (options.request.retryCount === 0) {
|
if (options.request.retryCount === 0) {
|
||||||
// only retries once
|
// only retries once
|
||||||
@ -57,7 +57,7 @@ async function run() {
|
|||||||
onAbuseLimit: (retryAfter, options) => {
|
onAbuseLimit: (retryAfter, options) => {
|
||||||
// does not retry, only logs a warning
|
// does not retry, only logs a warning
|
||||||
console.warn(
|
console.warn(
|
||||||
`Abuse detected for request ${options.method} ${options.url}`
|
`Abuse detected for request ${options.method} ${options.url}`,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -81,11 +81,11 @@ async function run() {
|
|||||||
gh,
|
gh,
|
||||||
uploadUrl(rel.upload_url),
|
uploadUrl(rel.upload_url),
|
||||||
path,
|
path,
|
||||||
currentAssets
|
currentAssets,
|
||||||
);
|
);
|
||||||
delete json.uploader;
|
delete json.uploader;
|
||||||
return json;
|
return json;
|
||||||
})
|
}),
|
||||||
).catch((error) => {
|
).catch((error) => {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
|
@ -47,7 +47,7 @@ export const parseInputFiles = (files: string): string[] => {
|
|||||||
.concat(line.split(","))
|
.concat(line.split(","))
|
||||||
.filter((pat) => pat)
|
.filter((pat) => pat)
|
||||||
.map((pat) => pat.trim()),
|
.map((pat) => pat.trim()),
|
||||||
[]
|
[],
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ export const parseConfig = (env: Env): Config => {
|
|||||||
export const paths = (patterns: string[]): string[] => {
|
export const paths = (patterns: string[]): string[] => {
|
||||||
return patterns.reduce((acc: string[], pattern: string): string[] => {
|
return patterns.reduce((acc: string[], pattern: string): string[] => {
|
||||||
return acc.concat(
|
return acc.concat(
|
||||||
glob.sync(pattern).filter((path) => statSync(path).isFile())
|
glob.sync(pattern).filter((path) => statSync(path).isFile()),
|
||||||
);
|
);
|
||||||
}, []);
|
}, []);
|
||||||
};
|
};
|
||||||
@ -90,7 +90,7 @@ export const unmatchedPatterns = (patterns: string[]): string[] => {
|
|||||||
return acc.concat(
|
return acc.concat(
|
||||||
glob.sync(pattern).filter((path) => statSync(path).isFile()).length == 0
|
glob.sync(pattern).filter((path) => statSync(path).isFile()).length == 0
|
||||||
? [pattern]
|
? [pattern]
|
||||||
: []
|
: [],
|
||||||
);
|
);
|
||||||
}, []);
|
}, []);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user