Skip to content

CSS and HTML headers get the folder name as @Project instead of the project's package.json name #70

Closed

Description

@Shinrai

Problem

@Project should be the name from the project's own config file: package.json for Node, pyproject.toml for Python, composer.json, go.mod, Cargo.toml and so on. The Node, JSON, YAML, Python, PHP, Go and Rust detectors do this. The CSS and HTML detectors don't:

  • css finds package.json as its marker but parseProjectName ignores the content and returns the folder name.
  • html doesn't look for package.json at all (markers: index.html, vite.config.*, next.config.*) and returns the folder name, which is the file's own folder when no marker is found.

Reproduced on next, project pn/ with package.json {"name":"@scope/real-name"} and pyproject.toml name = "py-real":

File @Project today Expected
src/m.mjs, src/c.yml @scope/real-name ✓
src/p.py py-real ✓
src/s.css pn @scope/real-name
src/i.html src @scope/real-name

So CSS and HTML files in any Node repo (for example slothlet) would be headed with the folder name instead of @cldmv/<pkg>.

Fix

  • CSS and HTML read the name from package.json when that is the project marker, exactly as the Node detector does; package.json is looked for first (a vite.config.* / postcss.config.* in the same folder must not win over it). Without a manifest they keep falling back to the project folder name.
  • Tests for both, including a package.json without a name, invalid JSON, and a non-package.json marker.
  • README: state the rule — @Project comes from the project's config file, the folder name only when there is none.

Activity

  1. added
    type: bug
    priority: high
    area: core
    status: in progress
    status: implemented
    and removed
    status: in progress
    on Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: corepriority: highstatus: implementedtype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions