Greg Hurrell [Thu, 13 May 2021 18:53:14 +0000 (20:53 +0200)]
chore: update dependencies
Note minor formatting changes for compatibility with the newer version
of the `prettier` package, and also a config tweak needed due to changes
in the ESLint plug-in:
Greg Hurrell [Thu, 13 May 2021 16:40:53 +0000 (18:40 +0200)]
feat: add simple shell syntax tokenizer
Yeah, maybe should have called this `tokenizeShell()` but seeing as I
already have some functions named `parseSomething()` I maintained the
pattern here. It really isn't doing anything fancy (like parameter
expansion, for obvious reasons); rather, it is just breaking the input
up into words in the "shell" sense.
Will be using this to process our integration test scripts.
Greg Hurrell [Thu, 13 May 2021 09:54:17 +0000 (11:54 +0200)]
test: prepare skeleton for running integration tests
Seeing as `next` interacts so heavily with the file system I want to
write some "full stack" integration tests to exercise the whole thing
and then inspect the results on the file system. Not really doing
anything in here yet, but this is the basis for being able to invoke the
command-line (kind of -- we're actually just importing `main` and
calling it) in a temporary directory.
I still need to think about how I want these "scripts" to actually look.
Greg Hurrell [Thu, 13 May 2021 07:26:45 +0000 (09:26 +0200)]
feat: add mulberry32 PRNG
Going to need this in integration test suite, because I want to be able
to generate fake (not truly random) UUIDs based on a fixed seed (ie.
always get the same results on every run).
Greg Hurrell [Fri, 8 Jan 2021 13:37:57 +0000 (14:37 +0100)]
feat: start fleshing out Store abstraction
So this is a bit of a mess but I wants to show a rough sketch of the
direction I'm heading in with the data directory layout and subcommands
to interact with it. Current status: it runs, and that is about the only
nice thing I have to say about it.
Greg Hurrell [Wed, 30 Dec 2020 23:15:13 +0000 (00:15 +0100)]
feat: add `yarn build:force`
Seems that with incremental compilation and/or `--watch` (I am not sure
which), `tsc` will sometimes consider that there is nothing to do, even
if you blow away the buildinfo file. So add this "nuclear option" script
to force it to build no matter what.
Greg Hurrell [Wed, 30 Dec 2020 12:43:01 +0000 (13:43 +0100)]
chore: add repo to nextrc file
To support two main use cases:
1. In a project with tasks on a branch in a worktree:
branch = todos
repo = .
worktree = todos
2. Global TODOs set up in home directory:
branch = master
repo = ~/school/todos
In practice, I think repo can default to "." and branch to "master" if
not specified. Not sure whether we should assume use of worktree in case
1 (eg. infer it from branch?); it's probably better to just make it
always explicit.
Greg Hurrell [Wed, 30 Dec 2020 12:41:06 +0000 (13:41 +0100)]
fix: handle full range of `git worktree list --porcelain` output
- Drop `HEAD`, which doesn't seem to be useful.
- Explicitly support `detached` and `bare`.
- Keep `path` and `branch`; gracefully accept (and ignore) everything
else in the name of future-proofness.
Greg Hurrell [Wed, 30 Dec 2020 11:41:21 +0000 (12:41 +0100)]
test: make sure jest doesn't run twice
It was running on source files in "src"/ and also on built files in
"lib/", which could yield the confusing situation of seeing "src/" tests
pass (because they've been fixed) but "lib/" tests fail (because you
haven't run `yarn build` yet). This is particularly confusing if running
the tests with `yarn test --watch`, because it drives up the odds of
running the tests before you've done a build to near 100%.
Greg Hurrell [Wed, 30 Dec 2020 10:55:07 +0000 (11:55 +0100)]
fix: handle edge cases in StringScanner#location reporting
Literal edge cases at beginning of start and end of string.
While testing `git worktree list --porcelain` output in order to handle
all the possibilities mentioned in `man git-worktree`, noticed my
reporting was off by one line when the expected token was not found at
the start of the line.
After I fixed that and started looking at error reporting for INI
parsing, noticed an edge case at the opposite end (ie. the end of the
input string).
Finally, found one more edge case and fixed that. Added a regression
test for each one.
Greg Hurrell [Tue, 29 Dec 2020 17:19:10 +0000 (18:19 +0100)]
feat: add loadRC() function
Note that I made it take a `from` parameter because I thought that
might make it easier to test, but in the end I didn't make real use of
it; I might remove it in the future.
Greg Hurrell [Tue, 29 Dec 2020 09:23:49 +0000 (10:23 +0100)]
style: manually prepare tsconfig.json for future formatting
Because any directive I uncomment in the future will have Prettier
moving the trailing comment on the next format run, I may as well do
them all ahead of time.
Greg Hurrell [Tue, 29 Dec 2020 08:45:52 +0000 (09:45 +0100)]
chore: set-up basic project dependencies
We don't want any runtime deps beyond NodeJS itself, and we want the
number of dev-time deps to be very small; Prettier to keep the code and
docs looking nice, and TypeScript to actually build from source. At a
later time I will probably add a test runner (could be Jest, although it
has an annoyingly enormous dependency graph, so I might end up picking
something more minimal, at least to start with).