* fix#442 - link to known-issues replaced
* formatted settings + enable format on save + improved jest config
* removed editorconfig in foam-cli
* formatted foam-vscode
* removed author in package.json files
* minor changes to readme files
* fixed husky pre-commit hook
* add windows-2019 to CI os matrix
* use actual URI object instead of strings to represent paths/uris
* added datastore tests
* chore: make Foam IDisposable
* Improved logging
- using classes instead of functions (feels like it fits better the use case)
- using singleton global to not pass logging service around
* Added vscode logger, command to change level, and settings
* improved bootstrap logging
* build foam-core before running tests in github workflows
* 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>
* revise vscode task and launch configs
- Removed commands from sub-package:
same can be achieved from the root
- Added build and no-build variants.
In case separate watcher is already running,
no need to build.
- Changed watch to build (no hot-reload in vscode by default)
- Show the build in console
Didn't update yarn.lock, seems to want to add
foam-core@0.3.0-alpha.0, but not really
related to this change
Note: the extension tests are failing due to
`Cannot find module '...foam-vscode/out/test/suite/index'`.
However that shouldn't be related to this change either.
* Simplify VS Code launch tasks (shift work to typescript compiler)
* Fix circular dependency index->janitor/index->index
* Use --build flag to use TSC in Build Mode
https://www.typescriptlang.org/docs/handbook/project-references.html#build-mode-for-typescript
This configures tsc to use multiple project roots (vscode, core) and run incremental builds on
changes to each projects. This will necessitate us running the core in commonjs build mode,
which is fine for testing and deployment to node environments, but won't work in the browser,
so foam-core will need a separate build config for UMD builds
* Build foam-core in commonjs mode by default (+cleanup unnecessary config)
* Create ES6 build config for distribution builds
* Cleanup yarn.lock
* Build package before running
* Fix missing lint paths and fix lint error
* Remove redundant .vscode settings files from foam-vscode project
* Add core test launch task
Co-authored-by: jojanaho <janne.ojanaho@iki.fi>
* 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>
Thanks to moving to monorepo (great idea, me!) we landed in a bit of a mess
where we had conflicting test runners and types from two version of mocha
(foam-vscode and foam-cli) and jest (foam-workspace-manager via tsdx)
To unbreak the tsc builds, I've removed the unused mocha tests (since there
were no tests anyway, with the goal to moving to jest tests across all packages)
For vscode jest tests, see:
https://medium.com/@soloydenko/end-to-end-testing-vs-code-extensions-via-jest-828e5edfeb75