@dogsbay/format-obsidian 0.2.0-beta.153 → 0.2.0-beta.154
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/dist/cli.js +8 -4
- package/package.json +5 -5
package/dist/cli.js
CHANGED
|
@@ -37,6 +37,8 @@ export const plugin = {
|
|
|
37
37
|
for (const mount of mounts ?? []) {
|
|
38
38
|
if (!existsSync(mount.dir))
|
|
39
39
|
continue;
|
|
40
|
+
// Folders the mount leaves out (VitePress: `public/`, a mount of its own)
|
|
41
|
+
const skipped = new Set((mount.skip ?? []).map((f) => join(mount.dir, f)));
|
|
40
42
|
// The mount carries the root its refs were rewritten to — `_assets`
|
|
41
43
|
// for an imported corpus, `images`/`assets` for hand-authored content.
|
|
42
44
|
// Hardcoding `_assets` here would copy the file somewhere the
|
|
@@ -50,10 +52,10 @@ export const plugin = {
|
|
|
50
52
|
// buries hundreds of duplicate .md/.mdx notes under _assets/. Take only
|
|
51
53
|
// the media, matching format-dogsbay-md's copyMediaTree.
|
|
52
54
|
if (mount.mediaOnly) {
|
|
53
|
-
copyMediaTree(mount.dir, dest);
|
|
55
|
+
copyMediaTree(mount.dir, dest, skipped);
|
|
54
56
|
continue;
|
|
55
57
|
}
|
|
56
|
-
cpSync(mount.dir, dest, { recursive: true });
|
|
58
|
+
cpSync(mount.dir, dest, { recursive: true, filter: (src) => !skipped.has(src) });
|
|
57
59
|
}
|
|
58
60
|
// Co-located images from the source docs directory (the mkdocs shape,
|
|
59
61
|
// where media sits next to the markdown rather than in its own tree).
|
|
@@ -261,11 +263,13 @@ const MEDIA_EXTS = new Set([
|
|
|
261
263
|
* mount theirs that way), so a recursive copy would bury every `.md`/`.mdx` in
|
|
262
264
|
* the source under `_assets/` as duplicate notes.
|
|
263
265
|
*/
|
|
264
|
-
function copyMediaTree(srcDir, destDir) {
|
|
266
|
+
function copyMediaTree(srcDir, destDir, skip) {
|
|
265
267
|
for (const entry of readdirSync(srcDir, { withFileTypes: true })) {
|
|
266
268
|
const full = join(srcDir, entry.name);
|
|
269
|
+
if (skip?.has(full))
|
|
270
|
+
continue;
|
|
267
271
|
if (entry.isDirectory()) {
|
|
268
|
-
copyMediaTree(full, join(destDir, entry.name));
|
|
272
|
+
copyMediaTree(full, join(destDir, entry.name), skip);
|
|
269
273
|
continue;
|
|
270
274
|
}
|
|
271
275
|
const dot = entry.name.lastIndexOf(".");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dogsbay/format-obsidian",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.154",
|
|
4
4
|
"description": "Obsidian format plugin for Dogsbay — import/export Obsidian vaults via TreeNode[]",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
"@types/node": "^25.9.5",
|
|
24
24
|
"typescript": "^5.9.3",
|
|
25
25
|
"vitest": "^4.1.10",
|
|
26
|
-
"@dogsbay/format-dogsbay-md": "0.2.0-beta.
|
|
27
|
-
"@dogsbay/format-openapi": "0.2.0-beta.
|
|
26
|
+
"@dogsbay/format-dogsbay-md": "0.2.0-beta.154",
|
|
27
|
+
"@dogsbay/format-openapi": "0.2.0-beta.154"
|
|
28
28
|
},
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@dogsbay/serialize-core": "0.2.0-beta.
|
|
32
|
-
"@dogsbay/types": "0.2.0-beta.
|
|
31
|
+
"@dogsbay/serialize-core": "0.2.0-beta.154",
|
|
32
|
+
"@dogsbay/types": "0.2.0-beta.154"
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|