Skip to content

Providing glob pattern to input flag in cli does not produce TS .d.ts files in the same directory of the respective schema file #360

@neophyt3

Description

@neophyt3

How to reproduce

I copied the below snippet and pasted in package json

{
  "scripts": {
    "compile-schemas": "json2ts -i src/**/*.schema.json"
  }
}

My project folder structure is like

|-src
  |-controllers
  |-plugins
    |-env
      |-some_schema.schema.json
  |-otherDIRs...

I ran npm run compile-schemas and I get the compiled types in console output

Expected Output

As per the help menu of CLI, it is mentioned
With no OUT_FILE and when IN_FILE is specified, create .d.ts file in the same directory.
so I was expecting types definitions to be produced in the env folder but it did not create any files and instead it printed in STDOUT
Is this intentional? coz I could raise PR but I got confused whether this is intentional or bug when I looked into the source code.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions