@cueloop/integration-obsidian 0.1.0-alpha.2 → 0.1.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -5
- package/src/detect.ts +2 -2
- package/src/filename.ts +1 -1
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cueloop/integration-obsidian",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.21",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./src/index.ts"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@cueloop/extension-api": "0.1.0-alpha.
|
|
11
|
-
"@cueloop/schema": "0.1.0-alpha.
|
|
10
|
+
"@cueloop/extension-api": "0.1.0-alpha.21",
|
|
11
|
+
"@cueloop/schema": "0.1.0-alpha.21"
|
|
12
12
|
},
|
|
13
13
|
"publishConfig": {
|
|
14
14
|
"access": "public"
|
|
@@ -24,5 +24,10 @@
|
|
|
24
24
|
"type": "git",
|
|
25
25
|
"url": "git+https://github.com/mmurakaru/cueloop.git",
|
|
26
26
|
"directory": "packages/integrations/obsidian"
|
|
27
|
-
}
|
|
28
|
-
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/mmurakaru/cueloop#readme",
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/mmurakaru/cueloop/issues"
|
|
31
|
+
},
|
|
32
|
+
"description": "Export reviewed cueloop plans into an Obsidian vault"
|
|
33
|
+
}
|
package/src/detect.ts
CHANGED
|
@@ -26,8 +26,8 @@ export function detectVaults(configPath: string = obsidianConfigPath()): string[
|
|
|
26
26
|
vaults?: Record<string, { path?: string }>;
|
|
27
27
|
};
|
|
28
28
|
return Object.values(raw.vaults ?? {})
|
|
29
|
-
.map((
|
|
30
|
-
.filter((
|
|
29
|
+
.map((vault) => vault.path)
|
|
30
|
+
.filter((path): path is string => typeof path === "string" && existsSync(path));
|
|
31
31
|
} catch {
|
|
32
32
|
// no Obsidian install, or an unreadable registry: no vaults
|
|
33
33
|
return [];
|
package/src/filename.ts
CHANGED
|
@@ -32,7 +32,7 @@ export function titleFrom(content: string, fallback?: string): string {
|
|
|
32
32
|
* run in the result becomes the configured separator.
|
|
33
33
|
*/
|
|
34
34
|
export function formatFilename(format: string, title: string, date: Date, separator: Separator = "space"): string {
|
|
35
|
-
const pad = (
|
|
35
|
+
const pad = (value: number) => String(value).padStart(2, "0");
|
|
36
36
|
const name = format
|
|
37
37
|
.replaceAll("{YYYY}", String(date.getFullYear()))
|
|
38
38
|
.replaceAll("{MM}", pad(date.getMonth() + 1))
|