* added common code from vscode repo
lots of good utility functions and objects, especially around lifecycle and event management
* added datastore and logger services
* refactored bootstrap to consolidate behavior in foam-core
* tags treeview now updates when files are saved
* updated node engine version to match vscode's
* using new event model for foam graph events
* added support for graph middleware via local plugin
* added support for parsing extension points / plugins
* improved parser plugin and added docs
* improved name of parameter
* need to enable local plugins, and improved configuration system
For security reasons local plugins are off by default.
The feature can be enabled via a flag in the foam configuration, which has been expanded to support this case.
The configuration system now reads a `config.json` file inside the `.foam` directory as well as a `~/.foam/config.json` file to configure the system.
Only the user specific configuration file can be used to enable local plugins, as a security measure against malicious repos.
* added prettier configuration file
This ensures consistency across machines as well as an explicit source of truth
* decoupled ID from note slug
* added vscode debug configuration to work with vscode-jest extension
* made things prettier
* Add a test for parsing empty frontmatter
* Use astPositionToVsCodePosition util function
* fixed a TODOs around URIs and added tests
* added tests around notes querying
* removing unused imports
* Fix typo
* implemented PR feedback
* fixed lint warnings and renamed method for consistency
* removed unnecessary checks and fix compilation error in tests
Co-authored-by: Ankit Tiwari <ankitt255@gmail.com>
* Move applyTextEdit to core
* WIP: Add janitor command in foam-vscode
* basic janitor command done
* unsaved markdown janitor solved
* export bootstrap getConfig functions
* fixed multi unsaved files text edits
* Move applyTextEdit to core
* WIP: Add janitor command in foam-vscode
* basic janitor command done
* unsaved markdown janitor solved
* export bootstrap getConfig functions
* fixed multi unsaved files text edits
* Be less greedy about definitions, only include defs at end of file
* Use link reference definitions in janitor
* Add headers/footers to tests
* Ensure janitor doesn't touch unrelated reference definitions
* Format document, convert promise trampoline to async/await for readability
* Add error handling and friendly output
* Use workspace settings for extension
* Add flag to janitor
* Use note.eol
* Fix tests
Co-authored-by: Ankit Tiwari <ankitt255@gmail.com>
Co-authored-by: Jani Eväkallio <jani.evakallio@gmail.com>
* Add Note.definitions and Note.end
* Use stringifyMarkdownLinkReferenceDefinition in foam-vscode
This commit also applies prettier to previously badly formatted files, so the diff is larger than necessary
* Add Note.end and Note.definitions to foam-core tests
* Export stringifyMarkdownLinkReferenceDefinition from foam-core
* Implement first version of generateLinkReferenceDefinitions janitor method
* Add partial tests for generateLinkReferenceDefinitions
* Setup Jest
* Add remove link definitions test to generateLinkReferences janitor method
* Add update link definitions test to generateLinkReferences janitor method
* export TextEdit interface
* Implement first version of applyText method
* Add no change in link definitions test to generateLinkReferences janitor method
* Add partial tests for writeFileToDisk method
* Implement generateHeading janitor method
Co-authored-by: CHIRAG SINGHAL <csinghal208@gmail.com>
* Move noteGraph scaffolding to utils
* Implement basic foam-cli janitor command
* kebab case file names while running janitor
* added generate Heading function to janitor
* added tests for generateHeading in janitor
* PR changes
* Add ora spinner
* Store endOfLine inside Note
* Use note.eol to append line endings
* check if given path is valid directory
* minor fixes
* added glob as dependency
* ignore link refrences with no file
* added tests files for migration
* Solves issue with roam migration
* fixed core tests
* Replace dashify by github-slugger
* used github slagger instead of dashify
* Add foam-core as dependency
* added foam migrate command
* updated foam janitor command
* minor fixes
* removed extra test files
* removed excess white space
* Refactor (PR changes)
1. Renamed initializeNoteGraph.ts to initialize-note-graph.ts to be consistent with naming
2. Refactored code in janitor and migrate commands
* Mock fs for tests
* Use Promise.resolve(null)
* Make fs tests no blocking by using promises
* Refactor renameFile to use path module
* Propagate the error from writeFileToDisk method
* Remove posttest command
* Run prettier before merge to get a cleaner diff
* Fix typo in variable name
* yarn lint --fix
* Update markdown-provider tests to support new API
* Add missing includeExtension argument
Co-authored-by: Jani Eväkallio <jani.evakallio@gmail.com>
Co-authored-by: chirag-singhal <csinghal208@gmail.com>