You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ npm install
61
61
```
62
62
63
63
#### `npm start`
64
-
This is the command to run the program for development. It runs a the `scripts/start.js` file.
64
+
This is the command to run the program for development. It runs the `scripts/start.js` file.
65
65
66
66
This file contains some logic to ensure local development is easy:
67
67
- A working directory is created (if it does not exist) at the root of the repository called `development`. This folder acts as the cwd when running commands, it is ignored by git.
@@ -130,7 +130,7 @@ The chain runs these links in order:
130
130
3.`getNextUnsolvedPuzzle` - Searches the user data file for the first puzzle the user has not solved, the puzzle day and level are added to the chain args.
131
131
4.`outputPuzzleLink` - Prints a link to the puzzle in the terminal.
132
132
133
-
The order of the links is very important. Some links expect certain args to be present and will fail if those ars are missing. For instance `outputPuzzleLink` requires an args object like `{ year, day, level }`. These fields are added to the args object by the earlier links `getYear` and `getNextUnsolvedPuzzle`.
133
+
Since the links in a chain are executed sequentially, the order of the links is very important. Some links expect certain args to be present and will fail if those ars are missing. For instance `outputPuzzleLink` requires an args object like `{ year, day, level }`. These fields are added to the args object by the earlier links `getYear` and `getNextUnsolvedPuzzle`.
134
134
135
135
## Tests
136
136
[Jest](https://github.com/facebook/jest) is used for unit testing. There is no set coverage target, but the goal is to have as many quality tests as possible.
Copy file name to clipboardExpand all lines: README.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ A Node.Js CLI solution generator and runner for [advent of code](https://advento
18
18
- Stores and outputs statistics to the CLI or your README file.
19
19
- Rate limits submissions to prevent timeout penalties.
20
20
- Tracks your progress and knows which puzzle to run.
21
-
- Uses modern ECMAScript modules (ESM).
21
+
- Uses ECMAScript modules (ESM).
22
22
23
23
## :deer: Table of Contents
24
24
-[Installation](#milk_glass-installation)
@@ -63,7 +63,7 @@ your-repository-folder/
63
63
advent of code generates puzzle inputs unique to your account. In order to download inputs and submit answers this CLI needs to store your advent of code authentication token. The token will be stored in a .env file in your project directory. This .env file ***should not*** be committed to source control. When you run the `init` command a .gitignore file is generated which ignores .env files, so *your token is safe by default*.
64
64
65
65
#### Finding your Authentication Token
66
-
The authentication token is stored in a advent of code cookie. Navigate to [advent of code](https://adventofcode.com/), and sign in to your account. Once signed in open up your browsers development tools, find the cookies for adventofcode.com and copy the value of the "session" cookie.
66
+
The authentication token is stored in an advent of code cookie. Navigate to [advent of code](https://adventofcode.com/), and sign in to your account. Once signed in open up your browsers development tools, find the cookies for adventofcode.com and copy the value of the "session" cookie.
@@ -161,10 +161,10 @@ If you run the command with the `--save` argument then the table will be saved t
161
161
```
162
162
npm run stats -- --save
163
163
```
164
-
Note you must add `--`seperator between the command name and the `--save` argument. See this [stackoverflow question](https://stackoverflow.com/q/11580961) for more info.
164
+
Note you must add `--`separator between the command name and the `--save` argument. See this [stackoverflow question](https://stackoverflow.com/q/11580961) for more info.
165
165
166
166
### `auth`
167
-
Creates or updates the `.env` file with your advent of code authentication token. This is a useful command if you checkout your repository on a new machine, since the `.env` file is not commited to source control and wont be present on the new machine.
167
+
Creates or updates the `.env` file with your advent of code authentication token. This is a useful command if you checkout your repository on a new machine, since the `.env` file is not committed to source control and wont be present on the new machine.
168
168
169
169
```
170
170
npm run auth
@@ -191,7 +191,7 @@ These functions:
191
191
### Arguments
192
192
Solution functions are invoked with a single argument, an object containing the following fields:
193
193
-`input: string`: A string containing the raw, unprocessed puzzle input. Provided for flexibility and custom parsing.
194
-
-`lines: string[]`: An array of strings containing the each line of the puzzle input. Provided for convience and speed.
194
+
-`lines: string[]`: An array of strings containing the each line of the puzzle input. Provided for convenience and speed.
195
195
196
196
Depending on the puzzle and its input you might need to [parse string values into integers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt).
197
197
@@ -202,10 +202,10 @@ This CLI downloads puzzles inputs only once and saves them to the `inputs/` fold
202
202
## :gift: Misc File Information
203
203
204
204
#### `aocr-data.json`
205
-
This file stores your progress. Every time you submit an answer, it is stored in this file to prevent duplicate submissions and track statistics. Additionally it stores the fastest recorded runtime for each puzzle. You should not edit this file manually. This file should be commited to source control.
205
+
This file stores your progress. Every time you submit an answer, it is stored in this file to prevent duplicate submissions and track statistics. Additionally it stores the fastest recorded runtime for each puzzle. You should not edit this file manually. This file should be committed to source control.
206
206
207
207
#### `.ratelimits.json`
208
-
This file stores rate limit information used when querying the advent of code website. The creator of the website has requested automated tools such as this CLI are conservative in the number of requests made to the website. This file tracks when the last request was made and the CLI uses this data to prevent requests from occuring too frequently. This file is ignored in source control.
208
+
This file stores rate limit information used when querying the advent of code website. The creator of the website has requested automated tools such as this CLI are conservative in the number of requests made to the website. This file tracks when the last request was made and the CLI uses this data to prevent requests from occurring too frequently. This file is ignored in source control.
209
209
210
210
#### `.env`
211
211
This file stores your authentication token, it ***should not be committed to source control***. See the [Authentication Token](https://github.com/beakerandjake/advent-of-code-runner#authentication-token) section for more information.
0 commit comments