* Added VS Code mock to turn e2e into unit/integration tests
* Provide fallback to editor directory when creating new note with relative path
* Added `clear` function to `FoamWorkspace`
* Fixed tests for dated notes by providing configuration defaults
* Using different workspace directory when resetting mock
* tweaked test suite configuration to manage vscode mock
* Tweaked test scripts to allow running specs in "unit" mode with mock vscode environment
* Marked spec files that can be run in unit mode
* Added testing documentation
* removed --stream flag
* updated @types/node to match engine's version
* Fixing open-resource tests
* Using nodemon for watch task
* Added documentation and generator pattern to support getting some data from multiple sources
* asAbsoluteUrl can now take URI or string
* Tweaked daily note computation
* Replacing URI.withFragment with generic URI.with
* Removed URI.file from non-testing code
* fixed asAbsoluteUri
* Various tweaks and fixes
* Fixed create-note command
* moved `foam-core` inside `foam-vscode`
* updated contribution guide to reflect new modules setup
* improved testing
* consolidate to root yarn.lock files
* tweaking CI workflow && using github secrets to force cache refresh
* improved linting configuration. `core` module cannot depend on other parts of the `foam-vscode` package
* Add the functionality to include notes in a note
* Add proposal of embedding
* Add tests for including notes
* Add documentation for inclusion feature
* extracted graph from workspace
* refactored datastore
* dataviz to use URI for placeholder detection
* graph uses uris, not resources
* adding placeholder in graph
* link completion to use graph
* API v1 - Resource refactoring (#595)
* aside: tweaked jest extension configuration
* added provider for markdown
* removed file check in URI
the problem is that it makes the URI dependent on the disk, which makes testing harder.
The change was originally introduced to prevent Foam from treating directories ending in .md as markdown files, but the check needs to probably happen somewhere else, e.g. in `FileDataStore.list` - or directories should be expressed with a trailing slash (to check whether that breaks the URI convention)
* Various changes
- `resolveLink` now delegates to providers
- added `read` method in providers and `FoamWorkspace`
- improved `Matcher` API
- updated tests to use workspace with providers
- delegating more to workspace now it can read files (simplifies wiring and exposed API surface)
- provider init returns a promise, so it can be awaited on
- `IDataStore` now has `list` method, to encapsulate all access to FS
* improved windows support in URI and matcher
* improved grouped resources interface
* added readAsMarkdown in provider, useful for tooltip generation with preview in vscode
* `FoamWorkspace.find` to return `null` when no reference is provided for relative path
* turning wikilinks into browsable links in markdown preview
* moved preview styles in css file and reorganized code in static folder
Static was previous used only for the dataviz graph. Now we have 2 subdirectories: dataviz for the graph, and preview for the markdown preview.
For now the css style is a bit of an overkill, but sets up the right foundation for further customization down the line.
* chore: explicitly disabling gitdoc extension, removing unnecessary async keyword
* fix: fixed test utility fn (and linter warning)
* test: added tests for preview link generation
* changed launch configuration to support both foam-core and foam-vscode packages
* improved delta logic in graph.js
fixes a bug that was due to using object.splice inside a forEach loop (sometimes stackoverflow is wrong - removing the element inside the loop will actually reduce the iterations and not all elements in the array will be visited!)
* various fixes to live update of workspace model + tests
* added tab size option in settings.json
* 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 graph style to VSCode settings
* Update default to an empty object
* Add function to retrieve the graph style from the settings
* Implement the graph custom styling setting
The implementation makes use of the webview communication mechanism to
switch messages between the webview and the graph.
It works as follows:
- When the webview is loaded, it now sends a single request to VSCode,
the request asks VSCode for the graph style
- When VSCode answers with the style, the graph style is updated and
the webview loading process continues as normal.
The style change does not modify the API, in fact it makes use of the
shadiest programming tatic ever, *global variables* to remain
compatible.
The style object *currently* supports four base fields:
- background: string
- fontSize: int
- highlightedForeground: string
- node: object
- note: string
- nonExistingNote: string
- unknown: string
* Simplify null handling logic
* Remove debug logs
* Rename style setting
* Rename message style type
* Remove forgotten debug log
* Refactor the code to match model & action
* Add missing break
* Allow for dynamic style updates
* Fix the window loading bug
* Implement a permanent fix to the bug
* Replace `nonExistingNote` with `placeholder`
* Include the new graph style feature in the docs
* Remove unnecessary async
* Remove unused case
* 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>
This commit updates the git instructions
To use the built-in VS Code git integration instead of Git Automator.
- Automatically stage all changes
"git.enableSmartCommit": true,
- Automatically push & pull changes to the remote after committing
"git.postCommitCommand": "sync"
Updates the settings in this project to dogfood the new defaults.
This feature could be improved further
By setting a default key-binding to Git: Commit All,
And/or by automatically committing on save or focus change
For the most SaaS-like experience.
Part of issue #30 along with a PR to foambubble/foam-template.