Skip to content

Commit

Permalink
Refactored URI for Foam API v1 (#537)
Browse files Browse the repository at this point in the history
* refactored URI to be less dependent on VS Code implementation
* moved uri tests in own file, and added test case from #507
* added license info for VS Code inspired code
* moved URI utility methods in abstract class for namespacing
* better names for some methods

Co-authored-by: Jonathan <[email protected]>
  • Loading branch information
riccardoferretti and ingalless authored Apr 5, 2021
1 parent 5fa04c7 commit 531bdab
Show file tree
Hide file tree
Showing 47 changed files with 798 additions and 1,142 deletions.
17 changes: 15 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT Licence (MIT)

Copyright 2020 Jani Eväkallio <[email protected]>
Copyright 2020 - present Jani Eväkallio <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand All @@ -17,4 +17,17 @@ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Where noted, some code uses the following license:

MIT License

Copyright (c) 2015 - present Microsoft Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
4 changes: 2 additions & 2 deletions packages/foam-core/src/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FoamConfig, Foam, IDataStore } from './index';
import { loadPlugins } from './plugins';
import { isSome } from './utils';
import { Logger } from './utils/log';
import { isMarkdownFile } from './utils/uri';
import { URI } from './model/uri';
import { FoamWorkspace } from './model/workspace';

export const bootstrap = async (config: FoamConfig, dataStore: IDataStore) => {
Expand All @@ -17,7 +17,7 @@ export const bootstrap = async (config: FoamConfig, dataStore: IDataStore) => {
await Promise.all(
files.map(async uri => {
Logger.info('Found: ' + uri);
if (isMarkdownFile(uri)) {
if (URI.isMarkdownFile(uri)) {
const content = await dataStore.read(uri);
if (isSome(content)) {
workspace.set(parser.parse(uri, content));
Expand Down
Loading

0 comments on commit 531bdab

Please sign in to comment.