Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Refactor code and simplify file processing #48
Refactor code and simplify file processing #48
Changes from 7 commits
c878a75
2dc1cc8
89aac13
2d55645
15e4f2e
a2d6109
532b933
8348585
3a9602d
a5c2f42
f7ef9d5
6712e30
41e1714
e2b9d19
adbe8d9
1f33626
1655f74
e56be54
b285d2d
7dc9400
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Check failure on line 23 in src/bin/index.ts
GitHub Actions / Lint & format check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead, let's maybe change
"module": "es2020"
to"module": "esnext"
intsconfig.lib.json
? What do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I used that to ignore this error while I was working on the issue but used this approach for compatibility concerns...
Check failure on line 26 in src/bin/index.ts
GitHub Actions / Lint & format check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a hacky solution, but without it, the process doesn't seem to terminate on its own. So until we figure this out, I'd leave it so that users don't need to force it with SIGINT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend avoiding refactoring the DB here - let's just focus on
process.ts
as discussed in the issue.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd leave the refactoring done so far in this PR. It makes the code much easier to reason about.
Check warning on line 8 in src/lib/indexFolderToObjects.ts
GitHub Actions / Lint & format check
Check warning on line 59 in src/lib/indexFolderToObjects.ts
GitHub Actions / Lint & format check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit weird that
markdownToObject
takes "folderPath" as a first argument 🤔Also, thinking from the "perspective" of
markdownToObject
function 😅, why am I receivingfilePathsToIndex
? What "I" actually need are "permalinks" that can be used to correctly resolve wikilinks.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, so I renamed this function to better reflect what id does...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And below you don't need to create another one (see comment below).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check failure on line 68 in src/lib/markdownToObject.ts
GitHub Actions / Lint & format check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parseFile
and destructured like links? Not sure...fileObject
object. Use the one you created above and add properties on it. Then return.A bit more tidy?:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should consider making the function asynchronous in a separate pull request, as I believe it would require a few modifications.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree
Check warning on line 177 in src/lib/markdowndb.spec.ts
GitHub Actions / Lint & format check
Check warning on line 182 in src/lib/markdowndb.spec.ts
GitHub Actions / Lint & format check
Check warning on line 184 in src/lib/markdowndb.spec.ts
GitHub Actions / Lint & format check
Check warning on line 212 in src/lib/markdowndb.spec.ts
GitHub Actions / Lint & format check
Check warning on line 215 in src/lib/markdowndb.spec.ts
GitHub Actions / Lint & format check
Check warning on line 224 in src/lib/markdowndb.spec.ts
GitHub Actions / Lint & format check
Check warning on line 229 in src/lib/markdowndb.spec.ts
GitHub Actions / Lint & format check
Check warning on line 230 in src/lib/markdowndb.spec.ts
GitHub Actions / Lint & format check