Skip to content

Commit 09662e9

Browse files
committed
update
1 parent 9734f32 commit 09662e9

File tree

5 files changed

+26
-27
lines changed

5 files changed

+26
-27
lines changed

packages/backend/script/ci.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import fs from "node:fs/promises";
1+
import fs from "fs/promises";
22
if (process.env.CI) {
3-
const content = [
4-
...Object.entries(process.env)
5-
.filter(([k]) => k.startsWith("NITRO"))
6-
.map(([k, v]) => `${k}="${v}"`),
7-
"NITRO_TEST=true",
8-
"GITHUB_TOKEN=" + process.env.GITHUB_TOKEN!,
9-
].join("\n");
3+
const content = Object.entries(process.env)
4+
.filter(([k]) => k.startsWith("NITRO"))
5+
.map(([k, v]) => `${k}="${v}"`)
6+
.concat(["NITRO_TEST=true", "GITHUB_TOKEN=" + process.env.GITHUB_TOKEN!])
7+
.join("\n");
108
await fs.writeFile(".dev.vars", content);
11-
}
9+
}

packages/backend/server/octokit.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ type Constructor<T> = new (...args: any[]) => T;
3737

3838
type OctokitType<TOptions extends Options> =
3939
TOptions["Octokit"] extends typeof OctokitCore
40-
? InstanceType<TOptions["Octokit"]>
41-
: OctokitCore;
40+
? InstanceType<TOptions["Octokit"]>
41+
: OctokitCore;
4242

4343
type OctokitClassType<TOptions extends Options> =
4444
TOptions["Octokit"] extends typeof OctokitCore
45-
? TOptions["Octokit"]
46-
: typeof OctokitCore;
45+
? TOptions["Octokit"]
46+
: typeof OctokitCore;
4747

4848
export class App<TOptions extends Options = Options> {
4949
static defaults<
@@ -90,9 +90,9 @@ export class App<TOptions extends Options = Options> {
9090
},
9191
options.oauth
9292
? {
93-
clientId: options.oauth.clientId,
94-
clientSecret: options.oauth.clientSecret,
95-
}
93+
clientId: options.oauth.clientId,
94+
clientSecret: options.oauth.clientSecret,
95+
}
9696
: {},
9797
);
9898

@@ -104,8 +104,8 @@ export class App<TOptions extends Options = Options> {
104104

105105
this.log = Object.assign(
106106
{
107-
debug: () => {},
108-
info: () => {},
107+
debug: () => { },
108+
info: () => { },
109109
warn: console.warn.bind(console),
110110
error: console.error.bind(console),
111111
},
@@ -177,10 +177,11 @@ export function webhooks(
177177
return new auth.octokit.constructor({
178178
...auth.octokitOptions,
179179
authStrategy: createAppAuth,
180-
181-
auth: {
182-
...auth,
183-
installationId,
180+
...{
181+
auth: {
182+
...auth,
183+
installationId,
184+
},
184185
},
185186
});
186187
},

packages/backend/server/routes/[owner]/[repo]/[packageAndRefOrSha].get.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ export default eventHandler(async (event) => {
8484
});
8585
});
8686

87-
const sha1Regex = /^[\da-f]{40}$/i;
88-
const sha256Regex = /^[\da-f]{64}$/i;
87+
const sha1Regex = /^[a-f0-9]{40}$/i;
88+
const sha256Regex = /^[a-f0-9]{64}$/i;
8989

9090
function isValidGitHash(hash: string): boolean {
9191
return sha1Regex.test(hash) || sha256Regex.test(hash);

packages/backend/server/routes/publish.post.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default eventHandler(async (event) => {
6666
k.startsWith("template:"),
6767
);
6868

69-
if (packages.length === 0) {
69+
if (!packages.length) {
7070
throw createError({
7171
statusCode: 400,
7272
message: "No packages",
@@ -183,7 +183,7 @@ export default eventHandler(async (event) => {
183183

184184
let checkRunUrl = check_runs[0]?.html_url ?? "";
185185

186-
if (check_runs.length === 0) {
186+
if (!check_runs.length) {
187187
const {
188188
data: { html_url },
189189
} = await installation.request("POST /repos/{owner}/{repo}/check-runs", {

packages/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { PackageManifest } from "query-registry";
22

33
const githubUrlRegex =
4-
/^(?:git\+)?https?:\/\/github\.com\/([^/]+)\/([^/]+)\.git$/;
4+
/^(?:git\+)?https?:\/\/github\.com\/([^\/]+)\/([^\/]+)\.git$/;
55

66
export function extractOwnerAndRepo(
77
repositoryUrl: string,

0 commit comments

Comments
 (0)