Skip to content

Commit 22e0da0

Browse files
committed
chore: prepare day 4 5 6 7
1 parent 5d93156 commit 22e0da0

Some content is hidden

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

61 files changed

+1236
-4
lines changed

pnpm-lock.yaml

Lines changed: 124 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

solutions/typescript/2024/02/src/p1.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe, expect, it } from 'vitest';
33
import packageJson from '../package.json' assert { type: 'json' };
44
import { p1 } from './p1.js';
55

6-
describe('2024 01 p1', () => {
6+
describe('2024 02 p1', () => {
77
describe('the input', () => {
88
it('should solve the input', async () => {
99
const resources = await loadTaskResources(packageJson.aoc);

solutions/typescript/2024/02/src/p2.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe, expect, it } from 'vitest';
33
import packageJson from '../package.json' assert { type: 'json' };
44
import { p2 } from './p2.js';
55

6-
describe('2024 01 p2', () => {
6+
describe('2024 02 p2', () => {
77
describe('the input', () => {
88
it('should solve the input', async () => {
99
const { input } = await loadTaskResources(packageJson.aoc);

solutions/typescript/2024/03/src/p1.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe, expect, it } from 'vitest';
33
import packageJson from '../package.json' assert { type: 'json' };
44
import { p1 } from './p1.js';
55

6-
describe('2024 01 p1', () => {
6+
describe('2024 03 p1', () => {
77
describe('the input', () => {
88
it('should solve the input', async () => {
99
const resources = await loadTaskResources(packageJson.aoc);

solutions/typescript/2024/03/src/p2.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe, expect, it } from 'vitest';
33
import packageJson from '../package.json' assert { type: 'json' };
44
import { p2 } from './p2.js';
55

6-
describe('2024 01 p2', () => {
6+
describe('2024 03 p2', () => {
77
describe('the input', () => {
88
it('should solve the input', async () => {
99
const { input } = await loadTaskResources(packageJson.aoc);
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# managed-by-autotool
2+
# Add files here to ignore them from prettier formatting
3+
4+
# node
5+
node_modules
6+
package-lock.json
7+
pnpm-lock.yaml
8+
yarn.lock
9+
10+
# build artifacts
11+
dist
12+
public/build
13+
build
14+
.svelte-kit
15+
.vercel
16+
typedoc
17+
**/.vitepress/cache
18+
19+
# test artifacts
20+
coverage
21+
.vscode/chrome
22+
.nyc_output
23+
vite.config.ts.*
24+
vitest.config.ts.*
25+
26+
# turbo
27+
.turbo
28+
29+
# rust
30+
target
31+
*.lock
32+
33+
# python
34+
.pytest_cache
35+
36+
# others
37+
.cache
38+
.benchmark
39+
CHANGELOG.md
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// managed-by-autotool
2+
3+
import eslintConfigCore from '@alexaegis/eslint-config-core';
4+
import eslintConfigVitest from '@alexaegis/eslint-config-vitest';
5+
6+
export default [...eslintConfigCore, ...eslintConfigVitest];
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
"name": "@alexaegis/advent-of-code-2024-04",
3+
"description": "Advent of Code 2024 04 solutions",
4+
"version": "1.0.0",
5+
"license": "mit",
6+
"private": true,
7+
"archetype": {
8+
"platform": "node",
9+
"framework": "adventofcode",
10+
"language": "ts"
11+
},
12+
"keywords": [
13+
"advent-of-code",
14+
"javascript",
15+
"js",
16+
"managed-by-autotool",
17+
"ts",
18+
"typescript"
19+
],
20+
"type": "module",
21+
"aoc": {
22+
"day": 3,
23+
"year": 2024
24+
},
25+
"scripts": {
26+
"lint:depcheck": "turbo run lint:depcheck_ --concurrency 16 --filter @alexaegis/advent-of-code-2024-04",
27+
"lint:depcheck_": "depcheck",
28+
"lint:es": "turbo run lint:es_ --concurrency 16 --filter @alexaegis/advent-of-code-2024-04",
29+
"lint:es_": "eslint --max-warnings=0 --fix --no-error-on-unmatched-pattern .",
30+
"lint:format": "turbo run lint:format_ --concurrency 16 --filter @alexaegis/advent-of-code-2024-04",
31+
"lint:format_": "prettier --cache-location .cache/prettier --plugin prettier-plugin-svelte --plugin prettier-plugin-tailwindcss --check .",
32+
"lint:md": "turbo run lint:md_ --concurrency 16 --filter @alexaegis/advent-of-code-2024-04",
33+
"lint:md_": "remark --frail --no-stdout --silently-ignore .",
34+
"lint:tsc": "turbo run lint:tsc_ --concurrency 16 --filter @alexaegis/advent-of-code-2024-04",
35+
"lint:tsc_": "tsc --noEmit",
36+
"test": "turbo run test_ --concurrency 16 --cache-dir .cache/turbo --filter @alexaegis/advent-of-code-2024-04",
37+
"test_": "vitest --passWithNoTests --coverage --run",
38+
"test:watch": "vitest --passWithNoTests --coverage",
39+
"all": "BUILD_REASON='publish' turbo run all_ --concurrency 16 --filter @alexaegis/advent-of-code-2024-04",
40+
"bench": "tsx src/bench.ts",
41+
"build": "turbo run build-lib_ --concurrency 16 --cache-dir .cache/turbo --filter @alexaegis/advent-of-code-2024-04",
42+
"build-lib_": "vite build",
43+
"format": "turbo run format_ --concurrency 16 --filter @alexaegis/advent-of-code-2024-04",
44+
"format_": "prettier --cache-location .cache/prettier --plugin prettier-plugin-svelte --plugin prettier-plugin-tailwindcss --write .",
45+
"p1": "RUN=1 NODE_NO_WARNINGS=1 tsx src/p1.ts",
46+
"p1:example": "RUN=1 NODE_NO_WARNINGS=1 RESOURCE=example.1.txt tsx src/p1.ts",
47+
"p2": "RUN=1 NODE_NO_WARNINGS=1 tsx src/p2.ts",
48+
"p2:example": "RUN=1 NODE_NO_WARNINGS=1 RESOURCE=example.2.txt tsx src/p2.ts"
49+
},
50+
"exports": {
51+
"./bench": {
52+
"types": "./src/bench.ts",
53+
"import": "./dist/bench.js",
54+
"default": "./dist/bench.js"
55+
},
56+
"./p1": {
57+
"types": "./src/p1.ts",
58+
"import": "./dist/p1.js",
59+
"default": "./dist/p1.js"
60+
},
61+
"./p2": {
62+
"types": "./src/p2.ts",
63+
"import": "./dist/p2.js",
64+
"default": "./dist/p2.js"
65+
},
66+
"./package.json": "./package.json",
67+
"./readme": "./readme.md"
68+
},
69+
"dependencies": {
70+
"@alexaegis/advent-of-code-lib": "workspace:^"
71+
},
72+
"devDependencies": {
73+
"@alexaegis/eslint-config-vitest": "^0.12.0",
74+
"@alexaegis/ts": "^0.12.0",
75+
"@alexaegis/vite": "^0.12.0",
76+
"@alexaegis/vitest": "^0.12.0",
77+
"@types/node": "^22.10.1",
78+
"benny": "^3.7.1",
79+
"vite": "^6.0.1",
80+
"vitest": "^2.1.6"
81+
}
82+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# [Day 4](https://adventofcode.com/2024/day/4)
2+
3+
## [Part One](https://adventofcode.com/2024/day/4#part1)
4+
5+
## [Part Two](https://adventofcode.com/2024/day/4#part2)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { loadTaskResources } from '@alexaegis/advent-of-code-lib';
2+
import { defaultBench } from '@alexaegis/advent-of-code-lib/benchmark';
3+
import { add } from 'benny';
4+
import packageJson from '../package.json' assert { type: 'json' };
5+
import { p1 } from './p1.js';
6+
import { p2 } from './p2.js';
7+
8+
await defaultBench(
9+
'2024 - Day 4',
10+
add('Part One', async () => {
11+
const { input } = await loadTaskResources(packageJson.aoc);
12+
return () => p1(input);
13+
}),
14+
add('Part Two', async () => {
15+
const { input } = await loadTaskResources(packageJson.aoc);
16+
return () => p2(input);
17+
}),
18+
);

0 commit comments

Comments
 (0)