Match schema based on existence of a root file

Open
#3,965 0 comments 2 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, json, yaml
Domain
tooling

Research direction

Start by locating the schema glob precedence and project or monorepo detection entry points in the repository. Trace how root files are currently discovered, then define completion as root-file-aware precedence for non-monorepos without changing monorepo behavior; add or update focused tests for these cases.

Written by the indexing model from the issue text.

Description

Build Server
Description of the feature / enhancement.

The existence of a root file should be able to change the precedence of globs associated with schemas. As seen #3948, a project customarily looks for YAML files in directories like **/models/**.yaml. While this is too generic to apply to all situations, it would be useful for this glob to apply if and only if there is some sort of $MYPROJECTNAME.yaml file at the root directory.

In monorepos, the logic of detecting this file may increase code complexity or decrease performance too much, so at least initially, I propose that this logic only runs in "non-monorepos".

Related: #4961

Are you making a PR for this?

Yes, I will create a PR.

Dominant language
JavaScript
Stars
3.9k
Forks
2.4k
Avg merge
12h 34m
Merged PRs (30d)
134

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SchemaStore/schemastore

All issues in SchemaStore/schemastore

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.