]> git.wincent.com - next.git/log
22 months agorefactor: consolidate two conditionals master
Greg Hurrell [Wed, 19 May 2021 21:21:03 +0000 (23:21 +0200)] 
refactor: consolidate two conditionals

First one I wrote because that's the natural order that it occurred to
me as I was writing it. Second one because I needed to keep TypeScript

But I can consolidate them into one thing, and TypeScript will still be

22 months agotest: add tick() implementation to skip time in integration tests
Greg Hurrell [Wed, 19 May 2021 15:01:55 +0000 (17:01 +0200)] 
test: add tick() implementation to skip time in integration tests

22 months agofix: correct TypeScript type annotation for custom matcher
Greg Hurrell [Wed, 19 May 2021 12:54:44 +0000 (14:54 +0200)] 
fix: correct TypeScript type annotation for custom matcher

TS was accepting this, but warning that my `await` on the matcher had no
effect. Obviously a bad annotation.

22 months agorefactor: move integration tests "table of contents" to top
Greg Hurrell [Wed, 19 May 2021 12:52:57 +0000 (14:52 +0200)] 
refactor: move integration tests "table of contents" to top

Seeing as everything that follows it is basically an "implementation
detail", we want it to be the first thing you see when you land in the

22 months agorefactor: sort functions alphabetically
Greg Hurrell [Wed, 19 May 2021 12:52:21 +0000 (14:52 +0200)] 
refactor: sort functions alphabetically

22 months agotest: teach integration tests how to save/check/update snapshots
Greg Hurrell [Wed, 19 May 2021 12:50:47 +0000 (14:50 +0200)] 
test: teach integration tests how to save/check/update snapshots

All pretty quickly hacked together but seems to work, at least in my
light manual testing of it.

22 months agofeat: actually record project UUID when creating tasks
Greg Hurrell [Fri, 14 May 2021 08:29:04 +0000 (10:29 +0200)] 
feat: actually record project UUID when creating tasks

22 months agochore: update dependencies
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:


Also note that I actually had to delete the `yarn.lock` and regenerate
it from scratch in order to silence a bunch of `yarn audit` warnings.

22 months agotest: add first basic test script
Greg Hurrell [Thu, 13 May 2021 16:46:56 +0000 (18:46 +0200)] 
test: add first basic test script

Just showing that we can parse commands and run them (not doing
comparison or auto-update yet).

22 months agofeat: add simple shell syntax tokenizer
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.

22 months agotest: prepare skeleton for running integration tests
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.

22 months agofeat: add mulberry32 PRNG
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).

22 months agostyle: fix formatting
Greg Hurrell [Sat, 8 May 2021 21:09:48 +0000 (23:09 +0200)] 
style: fix formatting

22 months agofix: don't overwrite existing tasks
Greg Hurrell [Sat, 8 May 2021 20:38:32 +0000 (22:38 +0200)] 
fix: don't overwrite existing tasks

22 months agofix: make sure newly created projects have metadata
Greg Hurrell [Sat, 8 May 2021 20:30:37 +0000 (22:30 +0200)] 
fix: make sure newly created projects have metadata

22 months agofix: correct a couple of random problems
Greg Hurrell [Sat, 8 May 2021 18:08:19 +0000 (20:08 +0200)] 
fix: correct a couple of random problems

- Eliminate lint errors about unexpected empty functions
- Make sure newly added items don't have a spurious completion date

2 years agofeat: teach Store some more stuff
Greg Hurrell [Fri, 15 Jan 2021 18:19:06 +0000 (19:19 +0100)] 
feat: teach Store some more stuff

File under "Great Commit Messages of Our Times".

2 years agofeat: continue fleshing out Store class
Greg Hurrell [Fri, 15 Jan 2021 00:52:04 +0000 (01:52 +0100)] 
feat: continue fleshing out Store class

2 years agofeat: start fleshing out "init" subcommand
Greg Hurrell [Sun, 10 Jan 2021 13:57:00 +0000 (14:57 +0100)] 
feat: start fleshing out "init" subcommand

Again, this is a very WIP thing just because I want to get something in
the repo (I don't trust this machine).

2 years agofeat: start fleshing out Store abstraction
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.

2 years agodocs: move subcommand docs into subfolder
Greg Hurrell [Thu, 7 Jan 2021 23:18:43 +0000 (00:18 +0100)] 
docs: move subcommand docs into subfolder

2 years agochore: add notes for how to initialize worktree with minimum fuss
Greg Hurrell [Thu, 7 Jan 2021 10:37:51 +0000 (11:37 +0100)] 
chore: add notes for how to initialize worktree with minimum fuss

2 years agodocs: add a couple more desired commands to docs/DESIGN.md
Greg Hurrell [Wed, 6 Jan 2021 20:01:46 +0000 (21:01 +0100)] 
docs: add a couple more desired commands to docs/DESIGN.md

2 years agofeat: add UUID()
Greg Hurrell [Tue, 5 Jan 2021 23:44:32 +0000 (00:44 +0100)] 
feat: add UUID()

2 years agofeat: pass richer context to subcommands
Greg Hurrell [Tue, 5 Jan 2021 00:06:45 +0000 (01:06 +0100)] 
feat: pass richer context to subcommands

Because I am going to need this very soon in order to access the data

2 years agofeat: add some Markdown formatting of sample docs
Greg Hurrell [Sun, 3 Jan 2021 23:10:30 +0000 (00:10 +0100)] 
feat: add some Markdown formatting of sample docs

2 years agofeat: wire up help logic
Greg Hurrell [Sun, 3 Jan 2021 12:45:57 +0000 (13:45 +0100)] 
feat: wire up help logic

"Wire" (chicken wire) being the operative word here.

2 years agofix: remove duplicate named exports
Greg Hurrell [Sun, 3 Jan 2021 12:05:29 +0000 (13:05 +0100)] 
fix: remove duplicate named exports

2 years agofeat: allow subcommands to specify additional options
Greg Hurrell [Sat, 2 Jan 2021 23:33:28 +0000 (00:33 +0100)] 
feat: allow subcommands to specify additional options

2 years agorefactor: use terser format for dynamic import
Greg Hurrell [Sat, 2 Jan 2021 21:02:11 +0000 (22:02 +0100)] 
refactor: use terser format for dynamic import

2 years agofeat: wire up initial sucbommands
Greg Hurrell [Sat, 2 Jan 2021 21:00:23 +0000 (22:00 +0100)] 
feat: wire up initial sucbommands

Although note, they don't do anything yet.

2 years agofeat: load config from -c/--config file, if specified
Greg Hurrell [Sat, 2 Jan 2021 19:43:04 +0000 (20:43 +0100)] 
feat: load config from -c/--config file, if specified

2 years agofeat: add simple option parsing
Greg Hurrell [Thu, 31 Dec 2020 13:07:10 +0000 (14:07 +0100)] 
feat: add simple option parsing

In preparation for running subcommands.

2 years agofeat: add `yarn build:force`
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.

2 years agorefactor: provide Config type to represent normalize rc-file contents
Greg Hurrell [Wed, 30 Dec 2020 22:58:46 +0000 (23:58 +0100)] 
refactor: provide Config type to represent normalize rc-file contents

2 years agochore: add repo to nextrc file
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.

2 years agofix: handle full range of `git worktree list --porcelain` output
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.

2 years agochore: turn on incremental compilation and add a watch mode
Greg Hurrell [Wed, 30 Dec 2020 11:52:37 +0000 (12:52 +0100)] 
chore: turn on incremental compilation and add a watch mode

2 years agotest: make sure jest doesn't run twice
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%.

2 years agofix: handle edge cases in StringScanner#location reporting
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.

2 years agofeat: add "clean" script
Greg Hurrell [Wed, 30 Dec 2020 10:54:32 +0000 (11:54 +0100)] 
feat: add "clean" script

2 years agotest: add test for subprocesses exiting due to a signal
Greg Hurrell [Wed, 30 Dec 2020 01:32:08 +0000 (02:32 +0100)] 
test: add test for subprocesses exiting due to a signal

Too lazy to do this before, but then had the idea for how to do this

2 years agofeat: plumb in basic check for git-worktree
Greg Hurrell [Tue, 29 Dec 2020 23:20:27 +0000 (00:20 +0100)] 
feat: plumb in basic check for git-worktree

With some TODOs and a missing `prompt()` implementation still to do.

2 years agotest: revert to previous fix
Greg Hurrell [Tue, 29 Dec 2020 18:02:27 +0000 (19:02 +0100)] 
test: revert to previous fix

Sigh; the uglier fix is apparently still necessary:


This reverts commit b360877f10c03c002360243264b5e8efab8aae26.

2 years agorefactor: apply neater fix for Node v10 failures on CI
Greg Hurrell [Tue, 29 Dec 2020 17:31:40 +0000 (18:31 +0100)] 
refactor: apply neater fix for Node v10 failures on CI

2 years agotest: attempt fix for CI failure on Node v10
Greg Hurrell [Tue, 29 Dec 2020 17:26:06 +0000 (18:26 +0100)] 
test: attempt fix for CI failure on Node v10

Example failure here:


2 years agofeat: add loadRC() function
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.

2 years agofeat: add dev-only helper to catch resource staleness
Greg Hurrell [Tue, 29 Dec 2020 15:18:09 +0000 (16:18 +0100)] 
feat: add dev-only helper to catch resource staleness

2 years agodocs: add `next init` to wishlist
Greg Hurrell [Tue, 29 Dec 2020 13:57:21 +0000 (14:57 +0100)] 
docs: add `next init` to wishlist

2 years agofeat: add basic INI parsing
Greg Hurrell [Tue, 29 Dec 2020 13:57:12 +0000 (14:57 +0100)] 
feat: add basic INI parsing

2 years agochore: configure Prettier to ignore built files
Greg Hurrell [Tue, 29 Dec 2020 10:20:37 +0000 (11:20 +0100)] 
chore: configure Prettier to ignore built files

2 years agodocs: add CI status badge to README.md
Greg Hurrell [Tue, 29 Dec 2020 10:20:14 +0000 (11:20 +0100)] 
docs: add CI status badge to README.md

2 years agofeat: add "ci" script
Greg Hurrell [Tue, 29 Dec 2020 10:17:33 +0000 (11:17 +0100)] 
feat: add "ci" script

For running basically the same tests locally (except the lockfile check)
that GitHub actions will run.

2 years agofeat: set up CI
Greg Hurrell [Tue, 29 Dec 2020 10:16:07 +0000 (11:16 +0100)] 
feat: set up CI

2 years agofeat: set up linting
Greg Hurrell [Tue, 29 Dec 2020 10:04:43 +0000 (11:04 +0100)] 
feat: set up linting

2 years agotest: set up basic test infra
Greg Hurrell [Tue, 29 Dec 2020 09:44:22 +0000 (10:44 +0100)] 
test: set up basic test infra

I hate the dependency footprint here, but it still seems like the best

As evident from the diff, the "blinking light" demo for the future
`parseINI()` module shows that we can run tests.

2 years agostyle: manually prepare tsconfig.json for future formatting
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.

2 years agostyle: format generated file
Greg Hurrell [Tue, 29 Dec 2020 09:22:39 +0000 (10:22 +0100)] 
style: format generated file

2 years agofeat: add stub executable
Greg Hurrell [Tue, 29 Dec 2020 09:21:59 +0000 (10:21 +0100)] 
feat: add stub executable

2 years agochore: add stub tsconfig.json file
Greg Hurrell [Tue, 29 Dec 2020 09:08:13 +0000 (10:08 +0100)] 
chore: add stub tsconfig.json file

Created with:

    yarn tsc --init

2 years agodocs: add initial seed of design draft document
Greg Hurrell [Tue, 29 Dec 2020 08:48:37 +0000 (09:48 +0100)] 
docs: add initial seed of design draft document

2 years agochore: set-up basic project dependencies
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).

2 years agochore: seed "master" branch with MIT license file
Greg Hurrell [Mon, 28 Dec 2020 16:51:47 +0000 (17:51 +0100)] 
chore: seed "master" branch with MIT license file