estruyf / vscode-front-matter

Front Matter is a CMS running straight in Visual Studio Code. Can be used with static site generators like Hugo, Jekyll, Hexo, NextJs, Gatsby, and many more...
https://frontmatter.codes
MIT License
1.93k stars 75 forks source link

Issue: Frontmatter starts indexing node_modules #832

Closed davidsneighbour closed 2 months ago

davidsneighbour commented 2 months ago

I did not (knowingly) change anything on my configuration recently, but today, I am opening VSCode and FrontMatter shows me 42k posts in my website (with 150 posts before):

image

It seems to index the node_modules directory all of a sudden. I did not change anything (well, not knowingly), but I remember clicking on the reload button right of the "Create Content" button, and nothing happened, so I closed the dashboard after a while.

Device:

estruyf commented 2 months ago

I believe it concerns the change to async globs #802.

I changed the folder retrieval method, as I believe it's happening there. Feel free to try the latest beta version (10.3.1002872) to see if it still occurs.

davidsneighbour commented 2 months ago

It's now about 300 posts :) It still indexes non-content markdown files like README.md, CHANGELOG.md, etc. in the root directory. It does not index node_modules anymore.

Could anything in my config make FM trying to find all markdown files in the repo?

10.3.9994028-beta

davidsneighbour commented 2 months ago

It also feels like there is a loop involved because CHANGELOG.md and README.md (root markdown files) are coming up multiple times.

image

Those CHANGELOG.md boxes are pointing to the same file.

estruyf commented 2 months ago

That is what I also saw in the stable version, but in beta, I cannot reproduce it anymore, as the folder paths should now be correct.

Can you run the diagnostic logging command to see which folders you get? Normally, all your module folders should end with documentation.

davidsneighbour commented 2 months ago
Diagnostic Logging # Front Matter CMS (BETA) - Diagnostics Beta: `true` Version: `10.3.9994028` ## Project name kollitsch.dev ## Workspace folder `/home/patrick/github.com/davidsneighbour/kollitsch.dev` ## Total files Total files found: 9051 ## Folders | Title | Path | | ----- | ---- | | Blog Posts | `/home/patrick/github.com/davidsneighbour/kollitsch.dev/content/blog` | | Tags | `/home/patrick/github.com/davidsneighbour/kollitsch.dev/content/tags` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/youtube) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/youtube` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/shortcodes) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/shortcodes` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/sitemap) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/sitemap` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/seo) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/seo` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/schema) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/schema` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/security) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/security` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/robots) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/robots` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/renderhooks) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/renderhooks` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/pwa) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/pwa` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/pictures) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/pictures` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/publisher) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/publisher` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/netlification) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/netlification` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/opensearch) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/opensearch` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/internals) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/internals` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/modder) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/modder` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/iliad) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/iliad` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/icons) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/icons` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/social) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/social` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/headerimage) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/headerimage` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/head) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/head` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/hooks) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/hooks` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/giscus) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/giscus` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/functions) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/functions` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/feeds) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/feeds` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/errors) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/errors` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/devtools) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/devtools` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/debug) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/debug` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/auditor) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/auditor` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/aesop) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/aesop` | | Components (/home/patrick/github.com/davidsneighbour/hugo-modules/modules/functions/bin/repo/release) | `/home/patrick/github.com/davidsneighbour/hugo-modules/modules/functions/bin/repo/release` | ### Files in folders | Project start length | Search in | md | mdx | markdown | |--- | --- | --- | --- | --- | | 12 | `content/blog/**/*.*` | 137 | 0 | 0 | | 12 | `content/tags/**/*.*` | 3 | 0 | 0 | | 68 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/youtube/**/*.*` | 0 | 0 | 0 | | 71 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/shortcodes/**/*.*` | 0 | 0 | 0 | | 68 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/sitemap/**/*.*` | 0 | 0 | 0 | | 64 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/seo/**/*.*` | 0 | 0 | 0 | | 67 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/schema/**/*.*` | 0 | 0 | 0 | | 69 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/security/**/*.*` | 0 | 0 | 0 | | 67 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/robots/**/*.*` | 0 | 0 | 0 | | 72 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/renderhooks/**/*.*` | 0 | 0 | 0 | | 64 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/pwa/**/*.*` | 0 | 0 | 0 | | 69 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/pictures/**/*.*` | 0 | 0 | 0 | | 70 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/publisher/**/*.*` | 0 | 0 | 0 | | 74 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/netlification/**/*.*` | 0 | 0 | 0 | | 71 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/opensearch/**/*.*` | 0 | 0 | 0 | | 70 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/internals/**/*.*` | 0 | 0 | 0 | | 67 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/modder/**/*.*` | 0 | 0 | 0 | | 66 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/iliad/**/*.*` | 0 | 0 | 0 | | 66 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/icons/**/*.*` | 0 | 0 | 0 | | 67 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/social/**/*.*` | 0 | 0 | 0 | | 72 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/headerimage/**/*.*` | 0 | 0 | 0 | | 65 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/head/**/*.*` | 0 | 0 | 0 | | 66 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/hooks/**/*.*` | 0 | 0 | 0 | | 67 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/giscus/**/*.*` | 0 | 0 | 0 | | 70 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/functions/**/*.*` | 0 | 0 | 0 | | 66 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/feeds/**/*.*` | 0 | 0 | 0 | | 67 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/errors/**/*.*` | 0 | 0 | 0 | | 69 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/devtools/**/*.*` | 0 | 0 | 0 | | 66 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/debug/**/*.*` | 0 | 0 | 0 | | 68 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/auditor/**/*.*` | 0 | 0 | 0 | | 66 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/aesop/**/*.*` | 0 | 0 | 0 | | 87 | `home/patrick/github.com/davidsneighbour/hugo-modules/modules/functions/bin/repo/release/**/*.*` | 0 | 0 | 0 | ## Complete frontmatter.json config ```json { "$schema": "https://frontmatter.codes/frontmatter.schema.json", "frontMatter.config.dynamicFilePath": "[[workspace]]/frontmatter.config.cjs", "frontMatter.site.baseURL": "https://kollitsch.dev/", "frontMatter.content.pageFolders": [ { "$schema": "https://frontmatter.codes/config/content.pagefolders.schema.json", "title": "Blog Posts", "path": "[[workspace]]/content/blog", "contentTypes": [ "blog", "music2program2", "notes-from-the-laboratory" ], "extended": true }, { "$schema": "https://frontmatter.codes/config/content.pagefolders.schema.json", "title": "Components", "path": "[[workspace]]/../hugo-modules/modules/**/documentation", "contentTypes": [ "component" ], "extended": true }, { "$schema": "https://frontmatter.codes/config/content.pagefolders.schema.json", "title": "Tags", "path": "[[workspace]]/content/tags", "contentTypes": [ "tag" ], "extended": true } ], "frontMatter.content.placeholders": [ { "$schema": "https://frontmatter.codes/config/content.placeholders.schema.json", "id": "permalink", "value": "/blog/{{year}}/{{slug}}/index.md" } ], "frontMatter.content.snippets": { "caption": { "$schema": "https://frontmatter.codes/config/content.snippets.schema.json", "snippet": "{{< caption \"{mediaUrl}\" \"Description\" >}}", "sourcePath": "/home/patrick/github.com/davidsneighbour/kollitsch.dev/.frontmatter/config/content/snippets/caption.json" } }, "frontMatter.custom.scripts": [ { "$schema": "https://frontmatter.codes/config/custom.scripts.schema.json", "command": "~/.nvm/versions/node/v20.4.0/bin/node", "script": "./.frontmatter/scripts/screenshot-header-image.cjs", "title": "Retrieve Screenshot" }, { "$schema": "https://frontmatter.codes/config/custom.scripts.schema.json", "command": "~/.nvm/versions/node/v20.4.0/bin/node", "script": "./.frontmatter/scripts/retrieve-unsplash-header-image-info.cjs", "title": "Retrieve Unsplash image" }, { "$schema": "https://frontmatter.codes/config/custom.scripts.schema.json", "title": "Generate social image for Youtube", "script": "./.frontmatter/scripts/create-youtube-header-image.cjs", "command": "~/.nvm/versions/node/v20.9.0/bin/node", "type": "content" } ], "frontMatter.data.files": [ { "$schema": "https://frontmatter.codes/config/data.files.schema.json", "id": "kurzschnitte", "title": "Kurzschnitte", "file": "[[workspace]]/data/dnb/kollitsch/kurzschnitte.json", "fileType": "json", "labelField": "title", "singleEntry": false, "schema": { "title": "Kurzschnitte", "type": "object", "required": [ "title", "link", "slug" ], "properties": { "title": { "type": "string", "title": "Title" }, "link": { "type": "string", "title": "Link" }, "description": { "type": "string", "multiline": true, "title": "Description" }, "labels": { "type": "array", "items": { "type": "string" } }, "slug": { "type": "string", "title": "Kurzschnitt-Post" } } } }, { "$schema": "https://frontmatter.codes/config/data.files.schema.json", "id": "music2program2", "title": "Music to program to", "file": "[[workspace]]/data/dnb/kollitsch/music.json", "fileType": "json", "labelField": "name", "schema": { "title": "Sponsors", "type": "object", "required": [ "name", "link", "slug" ], "properties": { "slug": { "type": "string", "title": "Slug" }, "name": { "type": "string", "title": "Name" }, "link": { "type": "string", "title": "Link" }, "description": { "type": "string", "multiline": true, "title": "Description" }, "genre": { "type": "array", "items": { "type": "string" } } } } } ], "frontMatter.data.folders": [ { "$schema": "https://frontmatter.codes/config/data.folders.schema.json" } ], "frontMatter.data.types": [ { "$schema": "https://frontmatter.codes/config/data.types.schema.json" } ], "frontMatter.taxonomy.contentTypes": [ { "$schema": "https://frontmatter.codes/config/taxonomy.contenttypes.schema.json", "name": "blog", "previewPath": "yyyy/{{permalink}}", "pageBundle": true, "filetype": "md", "fieldGroup": [ "resources" ], "fields": [ { "title": "Title", "name": "title", "type": "string", "single": true }, { "title": "Description", "name": "description", "type": "string" }, { "title": "Publishing date", "name": "date", "type": "datetime", "default": "{{now}}", "format": "yyyy-MM-dd'T'HH:mm:ssxxx", "isPublishDate": true }, { "title": "Last modified date", "name": "lastmod", "type": "datetime", "default": "{{now}}", "format": "yyyy-MM-dd'T'HH:mm:ssxxx", "isModifiedDate": true }, { "title": "Draft", "name": "draft", "type": "draft" }, { "title": "Tags", "name": "tags", "type": "tags" }, { "title": "Categories", "name": "categories", "type": "categories" }, { "title": "Resources", "name": "resources", "type": "block", "multiple": true, "fieldGroup": [ "resources" ] } ] }, { "$schema": "https://frontmatter.codes/config/taxonomy.contenttypes.schema.json", "fields": [] }, { "$schema": "https://frontmatter.codes/config/taxonomy.contenttypes.schema.json", "name": "default", "previewPath": "{{permalink}}", "pageBundle": true, "fields": [ { "title": "Title", "name": "title", "type": "string", "single": true }, { "title": "Description", "name": "description", "type": "string", "single": true }, { "title": "Publishing date", "name": "date", "type": "datetime", "default": "{{now}}", "format": "yyyy-MM-dd'T'HH:mm:ssxxx", "isPublishDate": true }, { "title": "Last modified date", "name": "lastmod", "type": "datetime", "default": "{{now}}", "format": "yyyy-MM-dd'T'HH:mm:ssxxx", "isModifiedDate": true }, { "title": "Draft", "name": "draft", "type": "draft" }, { "title": "Tags", "name": "tags", "type": "tags" }, { "title": "Categories", "name": "categories", "type": "categories" }, { "title": "Resources", "name": "resources", "type": "block", "fieldGroup": [ "resources" ] } ] }, { "$schema": "https://frontmatter.codes/config/taxonomy.contenttypes.schema.json", "fields": [] }, { "$schema": "https://frontmatter.codes/config/taxonomy.contenttypes.schema.json", "fields": [] }, { "$schema": "https://frontmatter.codes/config/taxonomy.contenttypes.schema.json", "fields": [] } ], "frontMatter.taxonomy.fieldGroups": [ { "schema": "https://frontmatter.codes/config/taxonomy.fieldgroups.schema.json", "id": "author", "labelField": "name", "fields": [ { "title": "Author Name", "name": "name", "type": "string", "single": true }, { "title": "Social link", "name": "social", "type": "string", "single": true } ] }, { "schema": "https://frontmatter.codes/config/taxonomy.fieldgroups.schema.json", "id": "resources", "labelField": "src", "fields": [ { "title": "Path/Filename", "name": "src", "type": "image", "isPreviewImage": true, "required": true }, { "title": "Title", "name": "title", "type": "string", "single": true }, { "title": "Identifier", "name": "name", "type": "string", "single": true } ] } ], "frontMatter.extends": [ "https://dnbhub.xyz/frontmatter/settings.global.json" ], "frontMatter.preview.host": "https://gugin:1313" } ```
estruyf commented 2 months ago

Thanks @davidsneighbour, it seems the glob patterns ignore the documentation part on your machine. That is the reason why you see those change logs.

On my end the paths all end with documentation, so I'll need to find a way to reproduce it.

estruyf commented 2 months ago

@davidsneighbour, I just noticed the version number; it is from three days ago, and it doesn't include the fix. I just fixed the versioning in the pipeline for the beta version, now you should be able to install version v10.3.100305645.

~Apparently, something is wrong with the VSCode marketplace API, as it doesn't provide the latest version.~

~I just checked, and the version is available, but it is just not returned from the API. If you want, you can manually download it to test it, or it might be that this gets solved in a couple of hours: https://marketplace.visualstudio.com/_apis/public/gallery/publishers/eliostruyf/vsextensions/vscode-front-matter-beta/10.3.1003040/vspackage~

davidsneighbour commented 2 months ago

That's right, with the latest beta all is back to the normal number of posts. Thank you!