Skip to content

Commit ace186c

Browse files
committed
⬆️ update prettier
1 parent 79c2523 commit ace186c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+94
-94
lines changed

bun.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"name": "snk",
66
"devDependencies": {
77
"@types/bun": "1.2.2",
8-
"prettier": "2.8.8",
8+
"prettier": "3.5.1",
99
"typescript": "5.7.3",
1010
},
1111
},
@@ -1001,7 +1001,7 @@
10011001

10021002
"prepend-http": ["prepend-http@1.0.4", "", {}, "sha512-PhmXi5XmoyKw1Un4E+opM2KcsJInDvKyuOumcjjw3waw86ZNjHwVUOOWLc4bCzLdcKNaWBH9e99sbWzDQsVaYg=="],
10031003

1004-
"prettier": ["prettier@2.8.8", "", { "bin": { "prettier": "bin-prettier.js" } }, "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q=="],
1004+
"prettier": ["prettier@3.5.1", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-hPpFQvHwL3Qv5AdRvBFMhnKo4tYxp0ReXiPn2bxkiohEX6mBeBwEpBSQTkD458RaaDKQMYSp4hX4UtfUTA5wDw=="],
10051005

10061006
"pretty-error": ["pretty-error@4.0.0", "", { "dependencies": { "lodash": "^4.17.20", "renderkid": "^3.0.0" } }, "sha512-AoJ5YMAcXKYxKhuJGdcvse+Voc6v1RgnsR3nWcYU7q4t6z0Q6T86sv5Zq8VIRbOWWFpvdGE83LtdSMNd+6Y0xw=="],
10071007

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"repository": "github:platane/snk",
77
"devDependencies": {
88
"@types/bun": "1.2.2",
9-
"prettier": "2.8.8",
9+
"prettier": "3.5.1",
1010
"typescript": "5.7.3"
1111
},
1212
"workspaces": [

packages/action/__tests__/generateContributionSnake.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ it(
4141
fs.writeFileSync(outputs[1]!.filename, results[1]!);
4242
fs.writeFileSync(outputs[2]!.filename, results[2]!);
4343
}),
44-
{ timeout: 2 * 60 * 1000 }
44+
{ timeout: 2 * 60 * 1000 },
4545
);

packages/action/__tests__/outputsOptions.spec.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,42 @@ import { it, expect } from "bun:test";
33

44
it("should parse options as json", () => {
55
expect(
6-
parseEntry(`/out.svg {"color_snake":"yellow"}`)?.drawOptions
6+
parseEntry(`/out.svg {"color_snake":"yellow"}`)?.drawOptions,
77
).toHaveProperty("colorSnake", "yellow");
88

99
expect(
10-
parseEntry(`/out.svg?{"color_snake":"yellow"}`)?.drawOptions
10+
parseEntry(`/out.svg?{"color_snake":"yellow"}`)?.drawOptions,
1111
).toHaveProperty("colorSnake", "yellow");
1212

1313
expect(
1414
parseEntry(`/out.svg?{"color_dots":["#000","#111","#222","#333","#444"]}`)
15-
?.drawOptions.colorDots
15+
?.drawOptions.colorDots,
1616
).toEqual(["#000", "#111", "#222", "#333", "#444"]);
1717
});
1818

1919
it("should parse options as searchparams", () => {
2020
expect(parseEntry(`/out.svg?color_snake=yellow`)?.drawOptions).toHaveProperty(
2121
"colorSnake",
22-
"yellow"
22+
"yellow",
2323
);
2424

2525
expect(
2626
parseEntry(`/out.svg?color_dots=#000,#111,#222,#333,#444`)?.drawOptions
27-
.colorDots
27+
.colorDots,
2828
).toEqual(["#000", "#111", "#222", "#333", "#444"]);
2929
});
3030

3131
it("should parse filename", () => {
3232
expect(parseEntry(`/a/b/c.svg?{"color_snake":"yellow"}`)).toHaveProperty(
3333
"filename",
34-
"/a/b/c.svg"
34+
"/a/b/c.svg",
3535
);
3636
expect(
37-
parseEntry(`/a/b/out.svg?.gif.svg?{"color_snake":"yellow"}`)
37+
parseEntry(`/a/b/out.svg?.gif.svg?{"color_snake":"yellow"}`),
3838
).toHaveProperty("filename", "/a/b/out.svg?.gif.svg");
3939

4040
expect(
41-
parseEntry(`/a/b/{[-1].svg?.gif.svg?{"color_snake":"yellow"}`)
41+
parseEntry(`/a/b/{[-1].svg?.gif.svg?{"color_snake":"yellow"}`),
4242
).toHaveProperty("filename", "/a/b/{[-1].svg?.gif.svg");
4343
});
4444

@@ -57,5 +57,5 @@ it("should parse filename", () => {
5757
].forEach((entry) =>
5858
it(`should parse ${entry}`, () => {
5959
expect(parseEntry(entry)).toMatchSnapshot();
60-
})
60+
}),
6161
);

packages/action/generateContributionSnake.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const generateContributionSnake = async (
1313
drawOptions: DrawOptions;
1414
animationOptions: AnimationOptions;
1515
} | null)[],
16-
options: { githubToken: string }
16+
options: { githubToken: string },
1717
) => {
1818
console.log("🎣 fetching github user contribution");
1919
const cells = await getGithubUserContribution(userName, options);
@@ -43,10 +43,10 @@ export const generateContributionSnake = async (
4343
cells,
4444
chain,
4545
drawOptions,
46-
animationOptions
46+
animationOptions,
4747
);
4848
}
4949
}
50-
})
50+
}),
5151
);
5252
};

packages/action/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { parseOutputsOption } from "./outputsOptions";
1010
core.getMultilineInput("outputs") ?? [
1111
core.getInput("gif_out_path"),
1212
core.getInput("svg_out_path"),
13-
]
13+
],
1414
);
1515
const githubToken =
1616
process.env.GITHUB_TOKEN ?? core.getInput("github_token");

packages/demo/canvas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const createCanvas = ({
7676
snake0: Snake,
7777
snake1: Snake,
7878
stack: Color[],
79-
k: number
79+
k: number,
8080
) => {
8181
ctx.clearRect(0, 0, 9999, 9999);
8282
drawLerpWorld(ctx, grid, null, snake0, snake1, stack, k, drawOptions);

packages/demo/demo.getBestTunnel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const tunnels = ones.map(({ x, y }) => ({
2626
x,
2727
y,
2828
3 as Color,
29-
getSnakeLength(snake)
29+
getSnakeLength(snake),
3030
),
3131
}));
3232

packages/demo/demo.getPathToPose.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const { canvas, ctx, draw, highlightCell } = createCanvas(grid);
88
canvas.style.pointerEvents = "auto";
99

1010
const target = createSnakeFromCells(
11-
snakeToCells(snake).map((p) => ({ ...p, x: p.x - 1 }))
11+
snakeToCells(snake).map((p) => ({ ...p, x: p.x - 1 })),
1212
);
1313

1414
let chain = [snake, ...getPathToPose(snake, target)!];

packages/demo/demo.interactive.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ const createViewer = ({
253253
: "") +
254254
`<a href="${svgLink.href}" download="github-user-contribution.svg">` +
255255
svgString +
256-
"<a/>"
256+
"<a/>",
257257
);
258258
e.preventDefault();
259259
});
@@ -277,7 +277,7 @@ const createViewer = ({
277277

278278
const onSubmit = async (userName: string) => {
279279
const res = await fetch(
280-
process.env.GITHUB_USER_CONTRIBUTION_API_ENDPOINT + userName
280+
process.env.GITHUB_USER_CONTRIBUTION_API_ENDPOINT + userName,
281281
);
282282
const cells = (await res.json()) as Res;
283283

@@ -294,8 +294,8 @@ const worker = new Worker(
294294
new URL(
295295
"./demo.interactive.worker.ts",
296296
// @ts-ignore
297-
import.meta.url
298-
)
297+
import.meta.url,
298+
),
299299
);
300300

301301
const { getChain } = createRpcClient<WorkerAPI>(worker);

packages/demo/menu.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const onChange = () => {
2525

2626
const url = new URL(
2727
config.demo + ".html?" + search,
28-
window.location.href
28+
window.location.href,
2929
).toString();
3030

3131
window.location.href = url;

packages/demo/springUtils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const stepSpringOne = (
1515
maxVelocity = Infinity,
1616
}: { tension: number; friction: number; maxVelocity?: number },
1717
target: number,
18-
dt = 1 / 60
18+
dt = 1 / 60,
1919
) => {
2020
const a = -tension * (s.x - target) - friction * s.v;
2121

@@ -31,13 +31,13 @@ const stepSpringOne = (
3131
export const isStable = (
3232
s: { x: number; v: number },
3333
target: number,
34-
dt = 1 / 60
34+
dt = 1 / 60,
3535
) => Math.abs(s.x - target) < epsilon && Math.abs(s.v * dt) < epsilon;
3636

3737
export const isStableAndBound = (
3838
s: { x: number; v: number },
3939
target: number,
40-
dt?: number
40+
dt?: number,
4141
) => {
4242
const stable = isStable(s, target, dt);
4343
if (stable) {
@@ -51,7 +51,7 @@ export const stepSpring = (
5151
s: { x: number; v: number },
5252
params: { tension: number; friction: number; maxVelocity?: number },
5353
target: number,
54-
dt = 1 / 60
54+
dt = 1 / 60,
5555
) => {
5656
const interval = 1 / 60;
5757

packages/demo/webpack.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ const webpackDevServerConfiguration: WebpackDevServerConfiguration = {
1818
...ms,
1919
(async (req, res, next) => {
2020
const userName = req.url.match(
21-
/\/api\/github-user-contribution\/(\w+)/
21+
/\/api\/github-user-contribution\/(\w+)/,
2222
)?.[1];
2323
if (userName)
2424
res.send(
2525
await getGithubUserContribution(userName, {
2626
githubToken: process.env.GITHUB_TOKEN!,
27-
})
27+
}),
2828
);
2929
else next();
3030
}) as ExpressRequestHandler,
@@ -34,7 +34,7 @@ const webpackDevServerConfiguration: WebpackDevServerConfiguration = {
3434
const webpackConfiguration: WebpackConfiguration = {
3535
mode: "development",
3636
entry: Object.fromEntries(
37-
demos.map((demo: string) => [demo, `./demo.${demo}`])
37+
demos.map((demo: string) => [demo, `./demo.${demo}`]),
3838
),
3939
target: ["web", "es2019"],
4040
resolve: { extensions: [".ts", ".js"] },
@@ -65,7 +65,7 @@ const webpackConfiguration: WebpackConfiguration = {
6565
title: "snk - " + demo,
6666
filename: `${demo}.html`,
6767
chunks: [demo],
68-
})
68+
}),
6969
),
7070
new HtmlWebpackPlugin({
7171
title: "snk - " + demos[0],

packages/demo/worker-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ export const createRpcClient = <API_ extends API>(worker: Worker) => {
5454
worker.addEventListener("terminate", onTerminate);
5555
worker.postMessage({ symbol, key, methodName, args });
5656
}),
57-
}
57+
},
5858
);
5959
};

packages/draw/drawCircleStack.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ export const getCircleSize = (n: number) => {
5959
export const drawCircleStack = (
6060
ctx: CanvasRenderingContext2D,
6161
stack: Color[],
62-
o: Options
62+
o: Options,
6363
) => {
6464
for (let i = stack.length; i--; ) {
6565
const { x, y } = cellPath[i];
6666

6767
ctx.save();
6868
ctx.translate(
6969
x * o.sizeCell + (o.sizeCell - o.sizeDot) / 2,
70-
y * o.sizeCell + (o.sizeCell - o.sizeDot) / 2
70+
y * o.sizeCell + (o.sizeCell - o.sizeDot) / 2,
7171
);
7272

7373
//@ts-ignore

packages/draw/drawGrid.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const drawGrid = (
1616
ctx: CanvasRenderingContext2D,
1717
grid: Grid,
1818
cells: Point[] | null,
19-
o: Options
19+
o: Options,
2020
) => {
2121
for (let x = grid.width; x--; )
2222
for (let y = grid.height; y--; ) {
@@ -27,7 +27,7 @@ export const drawGrid = (
2727
ctx.save();
2828
ctx.translate(
2929
x * o.sizeCell + (o.sizeCell - o.sizeDot) / 2,
30-
y * o.sizeCell + (o.sizeCell - o.sizeDot) / 2
30+
y * o.sizeCell + (o.sizeCell - o.sizeDot) / 2,
3131
);
3232

3333
ctx.fillStyle = color;

packages/draw/drawSnake.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type Options = {
1010
export const drawSnake = (
1111
ctx: CanvasRenderingContext2D,
1212
snake: Snake,
13-
o: Options
13+
o: Options,
1414
) => {
1515
const cells = snakeToCells(snake);
1616

@@ -25,7 +25,7 @@ export const drawSnake = (
2525
ctx,
2626
o.sizeCell - u * 2,
2727
o.sizeCell - u * 2,
28-
(o.sizeCell - u * 2) * 0.25
28+
(o.sizeCell - u * 2) * 0.25,
2929
);
3030
ctx.fill();
3131
ctx.restore();
@@ -40,7 +40,7 @@ export const drawSnakeLerp = (
4040
snake0: Snake,
4141
snake1: Snake,
4242
k: number,
43-
o: Options
43+
o: Options,
4444
) => {
4545
const m = 0.8;
4646
const n = snake0.length / 2;
@@ -61,7 +61,7 @@ export const drawSnakeLerp = (
6161
ctx,
6262
o.sizeCell - u * 2,
6363
o.sizeCell - u * 2,
64-
(o.sizeCell - u * 2) * 0.25
64+
(o.sizeCell - u * 2) * 0.25,
6565
);
6666
ctx.fill();
6767
ctx.restore();

packages/draw/drawWorld.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const drawStack = (
1919
stack: Color[],
2020
max: number,
2121
width: number,
22-
o: { colorDots: Record<Color, string> }
22+
o: { colorDots: Record<Color, string> },
2323
) => {
2424
ctx.save();
2525

@@ -39,7 +39,7 @@ export const drawWorld = (
3939
cells: Point[] | null,
4040
snake: Snake,
4141
stack: Color[],
42-
o: Options
42+
o: Options,
4343
) => {
4444
ctx.save();
4545

@@ -73,7 +73,7 @@ export const drawLerpWorld = (
7373
snake1: Snake,
7474
stack: Color[],
7575
k: number,
76-
o: Options
76+
o: Options,
7777
) => {
7878
ctx.save();
7979

packages/draw/pathRoundedRect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export const pathRoundedRect = (
22
ctx: CanvasRenderingContext2D,
33
width: number,
44
height: number,
5-
borderRadius: number
5+
borderRadius: number,
66
) => {
77
ctx.moveTo(borderRadius, 0);
88
ctx.arcTo(width, 0, width, height, borderRadius);

0 commit comments

Comments
 (0)