Skip to content

Commit

Permalink
chore: prepared 2023 day 25
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexAegis committed Dec 20, 2023
1 parent 2820a02 commit 4494e21
Show file tree
Hide file tree
Showing 15 changed files with 306 additions and 0 deletions.
31 changes: 31 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions solutions/typescript/2023/25/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# managed-by-autotool

package-lock.json
node_modules
vite.config.ts.*
vitest.config.ts.*
shims
typedoc

# sveltekit
.svelte-kit
.vercel
build
6 changes: 6 additions & 0 deletions solutions/typescript/2023/25/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// managed-by-autotool

/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: ['../../../../.eslintrc.cjs', '@alexaegis/eslint-config-vitest'],
};
39 changes: 39 additions & 0 deletions solutions/typescript/2023/25/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# managed-by-autotool
# Add files here to ignore them from prettier formatting

# node
node_modules
package-lock.json
pnpm-lock.yaml
yarn.lock

# build artifacts
dist
public/build
build
.svelte-kit
.vercel
typedoc
**/.vitepress/cache

# test artifacts
coverage
.vscode/chrome
.nyc_output
vite.config.ts.*
vitest.config.ts.*

# turbo
.turbo

# rust
target
*.lock

# python
.pytest_cache

# others
.cache
.benchmark
CHANGELOG.md
79 changes: 79 additions & 0 deletions solutions/typescript/2023/25/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"name": "@alexaegis/advent-of-code-2023-25",
"description": "Advent of Code 2023 25 solutions",
"version": "1.0.0",
"license": "mit",
"private": true,
"archetype": {
"platform": "node",
"framework": "adventofcode",
"language": "ts"
},
"keywords": [
"advent-of-code",
"javascript",
"js",
"managed-by-autotool",
"ts",
"typescript"
],
"type": "module",
"aoc": {
"day": 25,
"year": 2023
},
"scripts": {
"lint:depcheck": "turbo run lint:depcheck_ --concurrency 16 --cache-dir .cache/turbo --filter @alexaegis/advent-of-code-2023-25",
"lint:depcheck_": "depcheck",
"lint:es": "turbo run lint:es_ --concurrency 16 --cache-dir .cache/turbo --filter @alexaegis/advent-of-code-2023-25",
"lint:es_": "eslint --max-warnings=0 --fix --no-error-on-unmatched-pattern .",
"lint:format": "turbo run lint:format_ --concurrency 16 --cache-dir .cache/turbo --filter @alexaegis/advent-of-code-2023-25",
"lint:format_": "prettier --cache-location .cache/prettier --plugin prettier-plugin-svelte --plugin prettier-plugin-tailwindcss --check .",
"lint:md": "turbo run lint:md_ --concurrency 16 --cache-dir .cache/turbo --filter @alexaegis/advent-of-code-2023-25",
"lint:md_": "remark --frail --no-stdout --silently-ignore .",
"lint:tsc": "turbo run lint:tsc_ --concurrency 16 --cache-dir .cache/turbo --filter @alexaegis/advent-of-code-2023-25",
"lint:tsc_": "tsc --noEmit",
"test": "turbo run test_ --concurrency 16 --cache-dir .cache/turbo --filter @alexaegis/advent-of-code-2023-25",
"test_": "vitest --passWithNoTests --coverage --run",
"test:watch": "vitest --passWithNoTests --coverage",
"all": "BUILD_REASON='publish' turbo run all_ --concurrency 16 --cache-dir .cache/turbo --filter @alexaegis/advent-of-code-2023-25",
"bench": "ts-node-esm src/bench.ts",
"build": "turbo run build-lib_ --concurrency 16 --cache-dir .cache/turbo --filter @alexaegis/advent-of-code-2023-25",
"build-lib_": "vite build",
"format": "turbo run format_ --concurrency 16 --cache-dir .cache/turbo --filter @alexaegis/advent-of-code-2023-25",
"format_": "prettier --cache-location .cache/prettier --plugin prettier-plugin-svelte --plugin prettier-plugin-tailwindcss --write .",
"p1": "RUN=1 NODE_NO_WARNINGS=1 ts-node-esm src/p1.ts",
"p2": "RUN=1 NODE_NO_WARNINGS=1 ts-node-esm src/p2.ts"
},
"exports": {
"./bench": {
"types": "./src/bench.ts",
"import": "./dist/bench.js",
"default": "./dist/bench.js"
},
"./p1": {
"types": "./src/p1.ts",
"import": "./dist/p1.js",
"default": "./dist/p1.js"
},
"./p2": {
"types": "./src/p2.ts",
"import": "./dist/p2.js",
"default": "./dist/p2.js"
},
"./readme": "./readme.md"
},
"dependencies": {
"@alexaegis/advent-of-code-lib": "workspace:^"
},
"devDependencies": {
"@alexaegis/eslint-config-vitest": "^0.9.2",
"@alexaegis/ts": "^0.9.2",
"@alexaegis/vite": "^0.9.2",
"@alexaegis/vitest": "^0.9.2",
"@types/node": "^20.10.5",
"benny": "^3.7.1",
"vite": "^5.0.10",
"vitest": "^1.1.0"
}
}
9 changes: 9 additions & 0 deletions solutions/typescript/2023/25/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# [Day 25](https://adventofcode.com/2023/day/25)

## [Part One](https://adventofcode.com/2023/day/25#part1)

> [TypeScript](/solutions/typescript/2023/25/src/p1.ts)
## [Part Two](https://adventofcode.com/2023/day/25#part2)

> [TypeScript](/solutions/typescript/2023/25/src/p2.ts)
18 changes: 18 additions & 0 deletions solutions/typescript/2023/25/src/bench.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { loadTaskResources } from '@alexaegis/advent-of-code-lib';
import { defaultBench } from '@alexaegis/advent-of-code-lib/benchmark';
import { add } from 'benny';
import packageJson from '../package.json';
import { p1 } from './p1.js';
import { p2 } from './p2.js';

await defaultBench(
'2023 - Day 25',
add('Part One', async () => {
const { input } = await loadTaskResources(packageJson.aoc);
return () => p1(input);
}),
add('Part Two', async () => {
const { input } = await loadTaskResources(packageJson.aoc);
return () => p2(input);
}),
);
20 changes: 20 additions & 0 deletions solutions/typescript/2023/25/src/p1.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { loadTaskResources } from '@alexaegis/advent-of-code-lib';
import { describe, expect, it } from 'vitest';
import packageJson from '../package.json';
import { p1 } from './p1.js';

describe.skip('2023 25 p1', () => {
describe('the input', () => {
it('should solve the input', async () => {
const resources = await loadTaskResources(packageJson.aoc);
expect(p1(resources.input)).toEqual(0);
});
});

describe('example 1', () => {
it('should be solved', async () => {
const resources = await loadTaskResources(packageJson.aoc, 'example.1.txt');
expect(p1(resources.input)).toEqual(0);
});
});
});
8 changes: 8 additions & 0 deletions solutions/typescript/2023/25/src/p1.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { task } from '@alexaegis/advent-of-code-lib';
import packageJson from '../package.json';

export const p1 = (_input: string): number => {
return 0;
};

await task(p1, packageJson.aoc); // 0 ~0ms
20 changes: 20 additions & 0 deletions solutions/typescript/2023/25/src/p2.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { loadTaskResources } from '@alexaegis/advent-of-code-lib';
import { describe, expect, it } from 'vitest';
import packageJson from '../package.json';
import { p2 } from './p2.js';

describe.skip('2023 25 p2', () => {
describe('the input', () => {
it('should solve the input', async () => {
const { input } = await loadTaskResources(packageJson.aoc);
expect(p2(input)).toEqual(0);
});
});

describe('example 1', () => {
it('should be solved', async () => {
const { input } = await loadTaskResources(packageJson.aoc, 'example.1.txt');
expect(p2(input)).toEqual(0);
});
});
});
8 changes: 8 additions & 0 deletions solutions/typescript/2023/25/src/p2.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { task } from '@alexaegis/advent-of-code-lib';
import packageJson from '../package.json';

export const p2 = (_input: string): number => {
return 0;
};

await task(p2, packageJson.aoc); // 0 ~0ms
28 changes: 28 additions & 0 deletions solutions/typescript/2023/25/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"$schema": "https://json.schemastore.org/tsconfig?mark=managed-by-autotool",
"extends": "@alexaegis/ts/node",
"compilerOptions": {
"rootDir": "../../../../",
"outDir": ".cache/tsc"
},
"files": ["package.json", "../../../../package.json"],
"include": [
"src/**/*",
"static/**/*",
"__mocks__/**/*",
"*",
".*",
"*.json",
".*.json",
"**/*.json"
],
"exclude": [
"node_modules",
"dist",
"coverage",
"typedoc",
".turbo",
".cache",
"vite*.config.ts.timestamp-*"
]
}
5 changes: 5 additions & 0 deletions solutions/typescript/2023/25/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://typedoc.org/schema.json?mark=managed-by-autotool",
"extends": ["../../../../.config/typedoc.base.json"],
"entryPoints": ["src/*"]
}
19 changes: 19 additions & 0 deletions solutions/typescript/2023/25/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// managed-by-autotool

import { pakk } from '@alexaegis/vite';
import { defineConfig } from 'vite';

export default defineConfig({
build: {
target: 'es2022',
lib: {
entry: [],
formats: ['es'],
},
},
plugins: [
pakk({
dts: false,
}),
],
});
3 changes: 3 additions & 0 deletions solutions/typescript/2023/25/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// managed-by-autotool

export { vitestNodeConfig as default } from '@alexaegis/vitest';

0 comments on commit 4494e21

Please sign in to comment.