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

fix(cache): can not mkdir multilevel folder #45

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
67b964a
chore: add logo to readme
oysandvik94 Jun 30, 2024
9385b64
chore: add video to readme
oysandvik94 Jun 30, 2024
ede23c6
fix: use correct paths for lua modules
oysandvik94 Jun 30, 2024
7a18d1c
feat: add highlighting to commands that are executed
oysandvik94 Jun 30, 2024
703d31d
fix: json could not be commented out if there was preceeding whitespace
oysandvik94 Jun 30, 2024
98a509e
doc: write out the readme to include examlpes
oysandvik94 Jun 30, 2024
596b88c
doc: fix typo, and add emojis
oysandvik94 Jun 30, 2024
4c42693
doc: formatting in readme
oysandvik94 Jun 30, 2024
7747cbb
doc: move stuff around in readme
oysandvik94 Jun 30, 2024
2d25ed8
fix: test had wrong expected output
oysandvik94 Jun 30, 2024
46134e0
ci: give write permission to auto-commit
oysandvik94 Jun 30, 2024
24cb78e
chore(build): auto-generate vimdoc
github-actions[bot] Jun 30, 2024
19029b9
chore: add information about bug report
oysandvik94 Jun 30, 2024
2637172
chore(build): auto-generate vimdoc
github-actions[bot] Jun 30, 2024
8604114
fix: prevent non-curl commands from being executed
oysandvik94 Jun 30, 2024
259eb67
fix: avoid error on CurlClose
oysandvik94 Jul 1, 2024
f355296
chore(build): auto-generate vimdoc
github-actions[bot] Jul 1, 2024
eded3ec
feat: add healthcheck to verify dependencies
oysandvik94 Jul 1, 2024
068d4bf
chore(build): auto-generate vimdoc
github-actions[bot] Jul 1, 2024
becd370
docs: added documentation for using auth headers
oysandvik94 Jul 1, 2024
1e3d7a9
docs: fixed wrong closing tag in details
oysandvik94 Jul 1, 2024
68e310a
chore(build): auto-generate vimdoc
github-actions[bot] Jul 1, 2024
dc946b2
refactor: modules should be local
oysandvik94 Jul 2, 2024
8c7e60c
chore(build): auto-generate vimdoc
github-actions[bot] Jul 2, 2024
a1afa10
fix: fixed an error preventing some error to be printed to the output
oysandvik94 Jul 3, 2024
c4e185b
chore(build): auto-generate vimdoc
github-actions[bot] Jul 3, 2024
df1dea8
feat: add support for global and custom command buffers
oysandvik94 Jul 3, 2024
947f195
chore(build): auto-generate vimdoc
github-actions[bot] Jul 3, 2024
df9b6a3
feat: add configuration for adding default headers that apply to all
oysandvik94 Jul 3, 2024
1acfa8a
chore(build): auto-generate vimdoc
github-actions[bot] Jul 3, 2024
44756ec
docs: update curl example
EricDriussi Jul 12, 2024
6bd2aad
docs: update lazy setup
EricDriussi Jul 12, 2024
7a0ea74
chore(build): auto-generate vimdoc
github-actions[bot] Jul 12, 2024
58c7950
feat: introduce curl filetype
oysandvik94 Jul 4, 2024
9c4583d
chore(build): auto-generate vimdoc
github-actions[bot] Jul 13, 2024
686d41b
docs: update similar plugin section
gorillamoe Jul 15, 2024
109b386
chore(build): auto-generate vimdoc
github-actions[bot] Jul 15, 2024
137cb56
feat!: implement scoped custom buffers
oysandvik94 Jul 15, 2024
5185703
chore(build): auto-generate vimdoc
github-actions[bot] Jul 16, 2024
6821f81
docs: example configuration was missing setup function
oysandvik94 Jul 16, 2024
f5f00b4
chore(build): auto-generate vimdoc
github-actions[bot] Jul 16, 2024
c6e70c5
fix: running CurlClose after running CurlOpen twice failed
oysandvik94 Jul 16, 2024
8892bc0
feat: select collections from a picker
oysandvik94 Jul 16, 2024
6ae246d
chore(build): auto-generate vimdoc
github-actions[bot] Jul 16, 2024
1036325
feat: add config option to specify alternative curl binary
oysandvik94 Jul 16, 2024
d575106
chore(build): auto-generate vimdoc
github-actions[bot] Jul 16, 2024
9b5deea
fix: qol changes to improve workflow with nvim-dap
oysandvik94 Jul 26, 2024
cf4316b
ci: fix tests in github actions
oysandvik94 Jul 26, 2024
68f9a23
fix: dont crash if bash treesitter parser is not installed
oysandvik94 Jul 28, 2024
cafd091
chore(build): auto-generate vimdoc
github-actions[bot] Jul 28, 2024
dfc0c18
fix: fixed error when aborting creating of new collection
oysandvik94 Aug 21, 2024
4576324
chore(build): auto-generate vimdoc
github-actions[bot] Aug 21, 2024
b826067
feat: dont open result buffer automatically when opening Curl tab, wa…
oysandvik94 Aug 26, 2024
a1d700d
chore(build): auto-generate vimdoc
github-actions[bot] Aug 26, 2024
c7a18d4
fix: not work in gitbash
Aug 27, 2024
046f00b
chore(build): auto-generate vimdoc
github-actions[bot] Aug 27, 2024
5087494
fix(parser): Unable to parse json in one line
Aug 27, 2024
2f084c4
fix(cache): can not mkdir multilevel folder
iamxiaojianzheng Aug 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
[ ! -d tests ] && exit 0
./tests/run
docs:
if: github.ref == 'refs/heads/main'
permissions:
contents: write
runs-on: ubuntu-latest
needs: tests
steps:
Expand Down
55 changes: 54 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,59 @@ Very little should be abstracted a way.
As a rule, any valid curl command in the shell should be able to be pasted in
to the curl buffer, and be run.

## Bugs

If you fix a bug, please provide a test that reproduces the bug, and that would fail if one
were to revert your changes. This ensures no regressions, and makes it clear how the bug was caused.

## Project

Todo: Describe project structure
- api.lua
- Lua functions that the user should be able to access
- buffers.lua
- Logic related to opening the correct buffers, and outputting
content to the correct buffers
- cache.lua
- Logic related to caching curl commands between sessions
- config.lua
- Things that are configurable goes here
- init.lua
- Setup code that should be run once goes here, such as highlight groups, usercommands and so on
- notifications.lua
- Unified way to show notifications for the user
- output_parser.lua
- Logic for parsing the output from curl commands. Takes care of running jq, and seperating headers and json output
- parser.lua
- See [parser](CONTRIBUTING#Parser)

### Parser

This is where most of the complex logic lives, and takes care
of the qol features in the scratch buffer.

The parses works on simple text instead of using i.e. treesitter,
as the legal format of commands in the scratch buffer is not
valid bash.

The parsing logic aims to be simple rather than complex.
`format_command_for_curl` removes any trailing forward-slashes and adds missing quotes to json bodies.

Adding missing quotes works by finding the first character of a valid
json body, either "{" or "[", then uses a stack to keep track of
nested objects and arrays. When the stack is empty, we know that we
found the closer of the json body, which we can append a closing
quote to.

After cleaning up the json body, we look for the curl command
in the document to execute based on the cursor position.
First we go upwards until we find either a newline, or
another curl command.
We do the same downwards.

The first and last line is the boundary for the curl command.

## Tests

Tests can be run like this:

`./test/run`
Loading