Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new file mode, add usage and library docs #3

Merged
merged 9 commits into from
May 2, 2024
Merged

Conversation

kanaka
Copy link
Collaborator

@kanaka kanaka commented May 2, 2024

  • Add support for file deps data from files (JSON).
  • Refactor library functions to make them more externally usable
  • Add guide/examples to README with 9 CLI example
  • Document library functions with Clojure usage examples
  • Add comma separation for paths (in addition to colon).
  • Add map format for alternate/or deps

kanaka added 5 commits April 30, 2024 19:43
For order/weak dependencies, the dependency node format is:
`{:after SEQUENCE}`. Add a similar format for alternative/logical or
dependencies (in addition to the existing sequence format):
`{:or SEQUENCE}`.

This only applies to `resolve-dep-order`. The other dependency functions
are not aware of weak/order only dependencies.
If the component of the path specifier refers to a file rather than
a directory, then treat it as a JSON file containing a dependency
specification. The JSON file uses the full dependency map/graph format
rather than the user dep string format of deps file within dep
directories. For example, the following JSON file specifies that "a"
depends on both "b" and "c", that "c" depends on either "d" of "e", and
that "f" must come after "c" if it required:

```
{
    "a": ["b", "c"],
    "c": [{"or": ["d", "e"]}],
    "f": [{:after "c"}]
}
```

If a path component is "-", then dependencies will be read as a JSON
string from stdin.

Also add equivalent JSON files for each dependency directory under
`./tests/`.
- Rename `tests/resolve-deps.sh` to `tests/runtest.sh`.
- Add second optional argument that specifies the mode:
  - dir:  default and prior behavior that uses dep dirs
  - json: use JSON dep files
- Track passing count. Report final pass, fail, and total tests.
- Update GHA push workflow to run both dir and json modes for each
  implementation.
@kanaka kanaka requested a review from jonsmock May 2, 2024 16:58
README.md Outdated Show resolved Hide resolved
@jonsmock
Copy link
Collaborator

jonsmock commented May 2, 2024

Awesome work! Examples are excellent.

kanaka added 3 commits May 2, 2024 11:16
- Add a guide/examples section to the README that covers 9 different use
  cases.
- Add 6 example JSON files that are used for the first 5 examples in the
  README.
- Add README section on running the tests.
Extract the full-to-alt-graph and alt-to-kahn-graph functions so that
they can be called by users of the library functions since they are
needed to fully utilitize the functions.

Change the order of arguments to the python alt_set_covers function so
that the pending argument is first. This allows direct calling of
alt_set_covers with two position arguments (instead of requiring the
pending argument to be passed by name).
@kanaka kanaka force-pushed the file-mode-and-docs branch from dab44a1 to ab64a32 Compare May 2, 2024 18:17
Update the middle version since there are some changes to API and CLI.
But not a full major bump since they are backwards compatible.
@kanaka kanaka merged commit 3d4233f into main May 2, 2024
1 check passed
@kanaka
Copy link
Collaborator Author

kanaka commented May 2, 2024

@jonsmock Thanks! I've added another commit to bump to 0.1.0 and merged. When you get a chance (no hurry) can you npm publish this new version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants