{"_id":"@aockit/cli","_rev":"3-a71718d310b0b8269478f7f29345355b","name":"@aockit/cli","dist-tags":{"latest":"0.0.6"},"versions":{"0.0.2":{"name":"@aockit/cli","version":"0.0.2","keywords":["aoc","adventofcode"],"author":{"name":"taskylizard"},"license":"MIT","_id":"@aockit/cli@0.0.2","maintainers":[{"name":"taskylizard","email":"taskylizard@fmhy.net"}],"homepage":"https://github.com/aockit/aockit#readme","bugs":{"url":"https://github.com/aockit/aockit/issues"},"bin":{"aoc":"dist/cli.mjs"},"dist":{"shasum":"b88eda912feb92930ff2f12c8a9a923b0854fd55","tarball":"https://registry.npmjs.org/@aockit/cli/-/cli-0.0.2.tgz","fileCount":14,"integrity":"sha512-wOmtgy3x/aULddPNyLjAivweEx08pPiYA+3T9/6AEtxO+/+Poedu0fJygPUyoEAeA0enjK+3vqFzFwvk0yt3YA==","signatures":[{"sig":"MEQCIAZbSMav0agNk8AVX0pd9YC+3SVYyvMupMLIrNQ5zbLIAiBUAmr2h9V1H+eI1mwy2RKSJ4LZhfJse26LO2TDaBrwmg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":30271},"type":"module","_from":"file:aockit-cli-0.0.2.tgz","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.mjs"}},"scripts":{"build":"unbuild"},"_npmUser":{"name":"taskylizard","email":"taskylizard@fmhy.net"},"_resolved":"/tmp/4eba0b7732cb9dcb88b836c5e97c8b0f/aockit-cli-0.0.2.tgz","_integrity":"sha512-wOmtgy3x/aULddPNyLjAivweEx08pPiYA+3T9/6AEtxO+/+Poedu0fJygPUyoEAeA0enjK+3vqFzFwvk0yt3YA==","repository":{"url":"git+https://github.com/aockit/aockit.git","type":"git","directory":"packages/kit"},"_npmVersion":"10.9.0","description":"Polyglot CLI for Advent of Code","directories":{},"_nodeVersion":"22.8.0","dependencies":{"jiti":"^2.4.1","aocjs":"^1.0.0","citty":"^0.1.6","execa":"^9.5.1","pathe":"^1.1.2","dotenv":"^16.4.5","consola":"^3.2.3","esbuild":"^0.24.0","chokidar":"^4.0.1","rolldown":"0.14.0","@antfu/utils":"^0.7.10","perfect-debounce":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/cli_0.0.2_1733123641658_0.2597736797710428","host":"s3://npm-registry-packages"}},"0.0.4":{"name":"@aockit/cli","version":"0.0.4","keywords":["aoc","adventofcode"],"author":{"name":"taskylizard"},"license":"MIT","_id":"@aockit/cli@0.0.4","maintainers":[{"name":"taskylizard","email":"taskylizard@fmhy.net"}],"homepage":"https://github.com/aockit/aockit#readme","bugs":{"url":"https://github.com/aockit/aockit/issues"},"bin":{"aoc":"dist/cli.mjs"},"dist":{"shasum":"a1f9a72689867e5579a1128e1a096f5fccdb92a4","tarball":"https://registry.npmjs.org/@aockit/cli/-/cli-0.0.4.tgz","fileCount":9,"integrity":"sha512-BnnExmEvG4zUmfQWOHCmEWMWAI0KDFaHgawQn4tQu/VBfF9YQ0doWFZFEQiGMUgu0FCWhUWEmElwzRndGhbWhQ==","signatures":[{"sig":"MEQCICFOHJdKbx3NxNi8+AD4Qym9unKNrVGzeFIkoY3Nco+rAiB5W2d5nNmXFMqTFHWhitZgLHdwXmNhaI2RA4HN8kUHaw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24563},"type":"module","_from":"file:aockit-cli-0.0.4.tgz","scripts":{"build":"unbuild"},"_npmUser":{"name":"taskylizard","email":"taskylizard@fmhy.net"},"_resolved":"/tmp/5a19337169df425976995bddb853b963/aockit-cli-0.0.4.tgz","_integrity":"sha512-BnnExmEvG4zUmfQWOHCmEWMWAI0KDFaHgawQn4tQu/VBfF9YQ0doWFZFEQiGMUgu0FCWhUWEmElwzRndGhbWhQ==","repository":{"url":"git+https://github.com/aockit/aockit.git","type":"git","directory":"packages/kit"},"_npmVersion":"10.9.0","description":"Polyglot CLI for Advent of Code","directories":{},"_nodeVersion":"22.8.0","dependencies":{"jiti":"^2.4.1","aocjs":"^1.0.0","citty":"^0.1.6","execa":"^9.5.1","pathe":"^1.1.2","consola":"^3.2.3","esbuild":"^0.24.0","chokidar":"^4.0.1","rolldown":"0.14.0","tinyexec":"^0.3.1","@aockit/core":"^0.0.4","perfect-debounce":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"jiti":"^2.4.1","esbuild":"^0.24.0","rolldown":"^0.14.0"},"peerDependenciesMeta":{"jiti":{"optional":true},"esbuild":{"optional":true},"rolldown":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/cli_0.0.4_1733129986732_0.424853065761301","host":"s3://npm-registry-packages"}},"0.0.5":{"name":"@aockit/cli","version":"0.0.5","keywords":["aoc","adventofcode"],"author":{"name":"taskylizard"},"license":"MIT","_id":"@aockit/cli@0.0.5","maintainers":[{"name":"taskylizard","email":"taskylizard@fmhy.net"}],"homepage":"https://github.com/aockit/aockit#readme","bugs":{"url":"https://github.com/aockit/aockit/issues"},"bin":{"aoc":"dist/cli.mjs"},"dist":{"shasum":"7385fd810c507de0e09a15632123f66e9ece764c","tarball":"https://registry.npmjs.org/@aockit/cli/-/cli-0.0.5.tgz","fileCount":8,"integrity":"sha512-BAaUGmxGRv+aw/jqXoR8Ef6heHQps4oUAtz7aZIriZW5VAl3Ld4FiaJBYWqxONHvskM72x1AtWjYDle/Yr/ROQ==","signatures":[{"sig":"MEYCIQC6OmWEPhw4/MDv9v5lIhh/Uo5auS6Nq/kaNUOl1YtiDgIhAPXKcw2OVD6jIPom/qj3pLryE0PRWWNDYrjXeQvrrJ4U","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":32210},"type":"module","_from":"file:aockit-cli-0.0.5.tgz","scripts":{"build":"unbuild"},"_npmUser":{"name":"taskylizard","email":"taskylizard@fmhy.net"},"_resolved":"/tmp/31069fcdf3d9b685a4ae4b1f2460e143/aockit-cli-0.0.5.tgz","_integrity":"sha512-BAaUGmxGRv+aw/jqXoR8Ef6heHQps4oUAtz7aZIriZW5VAl3Ld4FiaJBYWqxONHvskM72x1AtWjYDle/Yr/ROQ==","repository":{"url":"git+https://github.com/aockit/aockit.git","type":"git","directory":"packages/kit"},"_npmVersion":"10.9.0","description":"Polyglot CLI for Advent of Code","directories":{},"_nodeVersion":"22.8.0","dependencies":{"jiti":"^2.4.1","aocjs":"^1.0.3","citty":"^0.1.6","execa":"^9.5.1","pathe":"^1.1.2","consola":"^3.2.3","esbuild":"^0.24.0","rolldown":"0.14.0","tinyexec":"^0.3.1","@aockit/core":"^0.0.5","@clack/prompts":"^0.8.2","@parcel/watcher":"^2.5.0","perfect-debounce":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"jiti":"^2.4.1","esbuild":"^0.24.0","rolldown":"^0.14.0"},"peerDependenciesMeta":{"jiti":{"optional":true},"esbuild":{"optional":true},"rolldown":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/cli_0.0.5_1733473104299_0.33533073575109174","host":"s3://npm-registry-packages"}},"0.0.6":{"name":"@aockit/cli","version":"0.0.6","description":"Polyglot CLI for Advent of Code","repository":{"type":"git","url":"git+https://github.com/aockit/aockit.git","directory":"packages/kit"},"bugs":{"url":"https://github.com/aockit/aockit/issues"},"homepage":"https://github.com/aockit/aockit#readme","publishConfig":{"access":"public"},"type":"module","bin":{"aoc":"dist/cli.mjs"},"keywords":["aoc","adventofcode"],"author":{"name":"taskylizard"},"license":"MIT","dependencies":{"@clack/prompts":"^0.8.2","@parcel/watcher":"^2.5.0","citty":"^0.1.6","consola":"^3.2.3","esbuild":"^0.24.0","execa":"^9.5.1","jiti":"^2.4.1","pathe":"^1.1.2","perfect-debounce":"^1.0.0","rolldown":"0.14.0","tinyexec":"^0.3.1","@aockit/core":"^0.0.5","aocjs":"^1.0.3"},"peerDependencies":{"esbuild":">=0.24.0","jiti":">=2.4.1","rolldown":">=0.14.0"},"peerDependenciesMeta":{"jiti":{"optional":true},"esbuild":{"optional":true},"rolldown":{"optional":true}},"scripts":{"build":"unbuild"},"_id":"@aockit/cli@0.0.6","_integrity":"sha512-k3qnPqglnAzsyassJhv4zSdnTl+LWPXGVf+pR5YnAY2t0y++CxSXD02uBcyAFTRPkjJDwydHsyngAKAYwUT53w==","_resolved":"/tmp/aab4afaf9643a8f1bfe5f3dded54eb46/aockit-cli-0.0.6.tgz","_from":"file:aockit-cli-0.0.6.tgz","_nodeVersion":"22.8.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-k3qnPqglnAzsyassJhv4zSdnTl+LWPXGVf+pR5YnAY2t0y++CxSXD02uBcyAFTRPkjJDwydHsyngAKAYwUT53w==","shasum":"6172be0be5c35a32a69b2fc6afd5bc57a87de150","tarball":"https://registry.npmjs.org/@aockit/cli/-/cli-0.0.6.tgz","fileCount":8,"unpackedSize":31326,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDAE1sFTBla0WuO4UBwGcc6cz9m+9Yu9beoVtgnGPV2TwIhAPT5XHqq7pbVl9Ahq/Rt3ivP8GxZJkDg9QkWoNgUu100"}]},"_npmUser":{"name":"taskylizard","email":"taskylizard@fmhy.net"},"directories":{},"maintainers":[{"name":"taskylizard","email":"taskylizard@fmhy.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cli_0.0.6_1733481811512_0.10251004298067246"},"_hasShrinkwrap":false}},"time":{"created":"2024-12-02T07:14:01.514Z","modified":"2024-12-06T10:43:31.937Z","0.0.2":"2024-12-02T07:14:01.851Z","0.0.4":"2024-12-02T08:59:46.888Z","0.0.5":"2024-12-06T08:18:24.631Z","0.0.6":"2024-12-06T10:43:31.744Z"},"bugs":{"url":"https://github.com/aockit/aockit/issues"},"author":{"name":"taskylizard"},"license":"MIT","homepage":"https://github.com/aockit/aockit#readme","keywords":["aoc","adventofcode"],"repository":{"type":"git","url":"git+https://github.com/aockit/aockit.git","directory":"packages/kit"},"description":"Polyglot CLI for Advent of Code","maintainers":[{"name":"taskylizard","email":"taskylizard@fmhy.net"}],"readme":"# 🎄 aockit\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href] [![jsDocs][jsdocs-src]][jsdocs-href]\n\naockit is an polyglot CLI for [Advent of Code](https://adventofcode.com).\n\n- Scaffolds a minimal setup for Advent of Code with the folder structure: `<root>/<year>/<day>`\n- Downloads your input file and saves it locally\n- [Template support for other languages](#templates)\n- [Testing support](#testing)\n- Supports both JavaScript and TypeScript, powered by ESBuild (or experimentally other [builders](#builders))\n- Provides an elegant `run()` function and utilities\n\n🚧 This project is under heavy development.\n\n## Usage\n\nSetup:\n\n```sh\n[pnpm|npm|yarn|bun] init\n[pnpm|npm|yarn|bun] install -D @aockit/cli @aockit/core esbuild@0.24.0\n```\n\nThen run `pnpm aoc init` (you may have to check the specifics for other package managers, or just add `aoc` as a package.json script.)\n\nThis will scaffold a year folder for your current year by default.\n\nAt this point, you'll need to add your Advent of Code browser session key, which requires a few more steps:\n\n1. Open [adventofcode.com](https://adventofcode.com) and log in.\n2. Open your Chrome or Firefox DevTools (F12).\n3. Go to the Application tab.\n4. On the sidebar, under the Storage section, expand Cookies and click on https://adventofcode.com.\n5. Find the cookie named \"session\" and copy its value.\n6. Export this value in your shell's config file with the name `AOC_SESSION`.\n   e.g. `export AOC_SESSION=\"your_session_key\"`\n\nNow, to start a day, run: `pnpm aoc start <day>`.\n\nThis will scaffold your day folder, download your input and instructions, save them locally, generate a minimal TypeScript file, and start the development server.\n\n## Utilities\n\n### `run()`\n\nRuns your solutions with utilities and pretty formatting. It will also measure your performance using `node:perf_hooks`.\n\nThe most commonly used functions are `part1` and `part2`.\n\nYou can destructure context to use utilities like `readInput`, `sum`, `product`, `asc`, `desc`, `by`.\n\n#### `readInput()`\n\nThis is a convenient abstraction for reading your input file as we execute built files directly in a worker thread from dist.\n\nIt takes a single parameter, `lines` or `groups`, and returns a list.\n\n- `lines` splits your input by newlines. (`\\n`)\n- `groups` splits your input by groups. (`\\n\\n`)\n\n#### `input`\n\nThis is the raw input file, unmodified.\n\n#### `sum()` and `product()`\n\nAdds or multiplies two numbers.\n\n#### `asc` and `desc`\n\nThese are `compareFn`s for `Array.sort()`.\n\n- `asc` sorts your list in ascending order.\n- `desc` sorts your list in descending order.\n\n## Testing\n\nWe also provide a minimal testing framework for testing your solutions. You can add as many tests as you want. It works similarly to your logic for `part1` or `part2`, but you must provide your own input, most likely the example inputs.\n\nThis includes a pretty logger similar to Vitest or Jest for pass and fail tests.\n\nExample:\n\n```ts\nconst exampleInput = `.|...\\\\....\n|.-.\\\\.....\n.....|-...\n........|.\n..........\n.........\\\\\n..../.\\\\\\\\..\n.-.-/..|..\n.|....-|.\\\\\n..//.|....`;\n\nrun({\n  part1({ input }) {\n    return part1(_(input));\n  },\n  part2({ input }) {\n    return part2(_(input));\n  },\n  tests: [\n    {\n      name: \"Part 1 example\",\n      input: exampleInput,\n      expected: 46,\n      solution({ input }) {\n        return part1(parseInput(input));\n      },\n    },\n    {\n      name: \"Part 2 example\",\n      input: exampleInput,\n      expected: 52,\n      solution({ input }) {\n        return part2(parseInput(input));\n      },\n    },\n  ],\n});\n```\n\n## Templates\n\nYou can create custom templates for different languages by placing them in the `templates/` folder at the root.\n\nFor example, a Rust template could look like this:\n\n```sh\n.\n├── 2023\n└── templates\n    └── rust\n        ├── .aockit.json\n        ├── Cargo.toml\n        └── src\n            └── main.rs\n```\n\nThe contents of your `.aockit.json` are important:\n\n```json\n{\n  \"runner\": \"cargo run\"\n}\n```\n\nThis gets removed in the end, and the runner script is added to your year's runner.\n\nNow, you can start with `pnpm aoc start -d 1 -t rust`, where `-t`/`--template` is the name of your template folder.\n\nThe next time, it will remember and run your runner command on file changes.\n\n## Builders\n\n### Rolldown\n\nRolldown is an upcoming reimplementation of Rollup, written in Rust, by the same team behind Vite.\n\nIt's still experimental and may not work perfectly.\n\nTo use it, install the `rolldown@0.14.0` package and set the builder to `rolldown` in your `.aockit.json`.\n\n```json\n{\n  \"builder\": \"rolldown\"\n}\n```\n\nOr add the builder flag to your `aoc start` command:\n\n```sh\npnpm aoc start -d 1 -b rolldown\n```\n\n### jiti\n\nUses [unjs/jiti](https;//github.com/unjs/jiti).\n\nTo use it, install the `jiti@2.4.1` package and set the builder to `jiti` in your `.aockit.json`.\n\n```json\n{\n  \"builder\": \"jiti\"\n}\n```\n\nOr add the builder flag to your `aoc start` command:\n\n```sh\npnpm aoc start -d 1 -b jiti\n```\n\n## License\n\nCopyright (c) 2024 taskylizard. MIT Licensed.\n\n<!-- Badges -->\n\n[npm-version-src]: https://img.shields.io/npm/v/aockit?style=flat&labelColor=f38ba8&color=585b70&logoColor=white\n[npm-version-href]: https://npmjs.com/package/aockit\n[npm-downloads-src]: https://img.shields.io/npm/dm/aockit?style=flat&labelColor=f38ba8&color=585b70&logoColor=white\n[npm-downloads-href]: https://npmjs.com/package/aockit\n[jsdocs-src]: https://img.shields.io/badge/jsDocs.io-reference-18181B?style=flat&labelColor=f38ba8&color=585b70&logoColor=white\n[jsdocs-href]: https://www.jsdocs.io/package/aockit\n```\n","readmeFilename":"README.md"}