beakerandjake / advent-of-code-runner Goto Github PK
View Code? Open in Web Editor NEWNode.JS CLI solution generator and runner for advent of code.
License: GNU General Public License v3.0
Node.JS CLI solution generator and runner for advent of code.
License: GNU General Public License v3.0
Potential things to output:
Not sure if it's possible to set .env values from the command line. Need to allow this.
Ensure all tests pass before allowing merge.
This should probably be stored in an ignored file in the users repository instead of being checked into source control via the user data file. It's annoying to have git changes every time you fail a problem, also you can easily beat the rate limit by just reverting the file.
If user has submitted answers outside of CLI there isn't a way for cli to store the fact that the puzzle has been answered. Add command which lets the user manually set the correct answer for a puzzle.
Ensure the data file exists at least.
Get user input during the init command. Something interactive like eslint init or npm init. Probably need library like inquirer.
After solving a problem the message is displayed to the user as "error" not as "festive"
Clear all files the /inputs and /src folder.
If the user successfully answers the problem, store the execution time. Update this whenever the user re-solves the problem and gets a faster execution time.
Add decorator / chain of responsibility / builder ability to CLI actions. Instead of passing actual action to the command pass in a special function. The function takes a chain of validators / decorators as its first param and the actual command action as its second param.
The function will create an args object from whatever commander passes to it, then it will invoke each function in the chain of validators lineally. If a function is a validator it can throw an exception if a precondition is not met. A function can also mutate the args passed into it by returning an object, this object will be the args that is passed to the next function and finally to the actual action function.
If none of the validators in the chain throw an exception the action will be invoked with the args object.
Can probably lighten package size be removing some dependencies.
Getting a lot of error files, group them into similar files.
Need to break out response parsing and test.
adventofcode.com will ask the user to wait x amount of time on submission is wrong. Instead of using default timeout value in ratelimiting, use the amount requested.
When solving, output a clickable link to that problem.
Some errors we can provide a fix for. Errors like SolutionFileNotFound or SolutionFileMissingFunction. If these errors are raised, we can prompt the user asking them if they want to fix the problem.
For
Minimum needed is year / token. If these are not present bail.
Don't allow override via command line?
How handle multiple years in one user repo if add this?
Add a readme file with help for using this cli.
If user is solving current year, then ensure that they don't attempt to solve problems that haven't unlocked yet.
Need single source of parsing / validation for
Ensure the user has type module?
remove redundant solve.js file, clean up solution runner / worker, rename, and test.
Ensure using Resolve/Reject values instead of Return value
After getting a problem correct, the correct answer field is not set in the user data file, instead it is added to the incorrect answers array.
Need to publish this to npm
Add scripts to their npm file, add dependency to this package to their npm file.
Currently in order to run most commands a .env file with the auth token must be present, without this token the commands will fail. The .env file is secret and is not meant to be checked into source control. This creates an issue where a users repository can only be ran on their machine.
As a user solves problems their input files are downloaded and cached, and should be committed to source control. Since the input file is present an auth token is not required to solve a puzzle with a cached input file. If another user wants to download someone else's repository and run their solutions they will not be able to even though they technically should be able to.
Change the solve commands to not require auth immediately, instead only attempt to grab the auth token when downloading an input file.
Watches for changes in solution files and executes that file. Something like nodemon.
This can allow users to stick to a specific version for a year if the api changes in the future. Also reduces complexity of cli.
Whenever a problem is submitted, store the answer that was submitted and if it was correct or incorrect.
This command will re-execute every solution file which has a correct answer. It will compare the returned answer with the correct answer and fail the test if the answers do not match.
This can help them ensure that their code still works when they perform refactoring or changes.
Add way to configure log level via cli arg
Store version of application that the data was init with, this will help with potential migrations in the future if there are breaking changes.
Right now the node worker thread gets a copy of the parents environment variables. This could potentially be an issue because the users token is stored there. So to prevent any possible leaking pass a copy of the env to the worker without this token.
Lots of io when reading / writing to data store json file. Could potentially cache the contents and invalidate cache on write. Might need to watch file for changes too.
Could potentially move to a different solution like sqlite but that would increase module dependencies and size.
An api call is an api call, update the rate limit even if an error is thrown during the api call (for example a bad response)
Instead of the user having to specify which problem to answer, instead automatically choose the earliest unsolved problem and run that one.
Ex. If they have completed all parts of days 1,2,3,6,7,8 and only part 1 of day 4 and part 2 of day 5, then the command would choose day 4 part 2 because that's the earliest problem they have not solved.
Copy and pasting these errors usually makes me forget to do this.
If the user has a .gitignore file which does not include the required .env line, the init command will replace the entire file contents instead of appending.
Create template files for things like .env / .gitignore so can just copy files.
Run both part one and part two at the same time? This reduces the amount of args the user has to provide.
Currently only sync user functions are supported.
Get rid of relative import paths and use absolute instead.
Add output that the solution is still running and that the user can cancel it by pressing ctrl+c.
Also potentially add spinner?
If the user has already submitted an answer store that fact. Don't let them try that answer again.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.