Coder Social home page Coder Social logo

Comments (9)

domoritz avatar domoritz commented on May 29, 2024 2

Sweet. 2.1.1 works again. Thanks for digging into the issue.

from ts-json-schema-generator.

ReneWerner87 avatar ReneWerner87 commented on May 29, 2024 2

thx its solved

image

working with v18, v20 ....

from ts-json-schema-generator.

domoritz avatar domoritz commented on May 29, 2024 1

Oh weird. I didn't test the other versions (but should have). I'll bump the minimum requirement to make it correct. Thanks for trying the different versions!

from ts-json-schema-generator.

domoritz avatar domoritz commented on May 29, 2024

Works for me. Make sure you have a new enough node version. I have v20.12.2.

❯ npx ts-json-schema-generator --help
Need to install the following packages:
[email protected]
Ok to proceed? (y) y
(node:17662) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Usage: ts-json-schema-generator [options]

Options:
  -p, --path <path>              Source file path
  -t, --type <name>              Type name
  -i, --id <name>                $id for generated schema
  -f, --tsconfig <path>          Custom tsconfig.json path
  -e, --expose <expose>          Type exposing (choices: "all", "none", "export", default: "export")
  -j, --jsDoc <extended>         Read JsDoc annotations (choices: "none", "basic", "extended", default: "extended")
  --markdown-description         Generate `markdownDescription` in addition to `description`.
  --functions <functions>        How to handle functions. `fail` will throw an error. `comment` will add a comment. `hide` will treat the function like a NeverType or HiddenType. (choices: "fail",
                                 "comment", "hide", default: "comment")
  --minify                       Minify generated schema (default: false)
  --unstable                     Do not sort properties
  --strict-tuples                Do not allow additional items on tuples
  --no-top-ref                   Do not create a top-level $ref definition
  --no-type-check                Skip type checks to improve performance
  --no-ref-encode                Do not encode references
  -o, --out <file>               Set the output file (default: stdout)
  --validation-keywords [value]  Provide additional validation keywords to include (default: [])
  --additional-properties        Allow additional properties for objects with no index signature (default: false)
  -V, --version                  output the version number
  -h, --help                     display help for command

from ts-json-schema-generator.

ReneWerner87 avatar ReneWerner87 commented on May 29, 2024

@domoritz
in your package json you say that the software should be usable with node 18 and higher

i think you should also adapt the package json if you can only use the software with the latest version

"engines": {
"node": ">=18.0.0"
},

it also does not work with version 20
not working with v20.4.0
image

working with v21.4.0
image

from ts-json-schema-generator.

ReneWerner87 avatar ReneWerner87 commented on May 29, 2024

v2.0.1...v2.1.0#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519

Unknown file extension "" for ../node_modules/ts-json-schema-generator/bin/ts-json-schema-generator. 
Loading extensionless files is not supported inside of "type":"module" package.json contexts. 
The package.json file ../node_modules/ts-json-schema-generator/package.json caused this "type":"module" context. 
Try changing ../node_modules/ts-json-schema-generator/bin/ts-json-schema-generator to have a file extension. 
Note the "bin" field of package.json can point to a file with an extension, for example {"type":"module","bin":{"ts-json-schema-generator":"./bin/ts-json-schema-generator.js"}}

means that if type: module is used, all files with extensions must be used

"bin": {
"ts-json-schema-generator": "./bin/ts-json-schema-generator"
},

so why not link the js file from the dist
../dist/ts-json-schema-generator.js

from ts-json-schema-generator.

ReneWerner87 avatar ReneWerner87 commented on May 29, 2024

actually npm is only bothered by the missing extension for the binary resource

from ts-json-schema-generator.

domoritz avatar domoritz commented on May 29, 2024

https://github.com/vega/ts-json-schema-generator/blob/fbb72f4e4267b428f9135e03a2f0f5bc39a0a6e9/bin/ts-json-schema-generator doesn't have an extension but imports a file with an extension. Are you saying we might fix the issue by adding the extension?

from ts-json-schema-generator.

ReneWerner87 avatar ReneWerner87 commented on May 29, 2024

https://github.com/vega/ts-json-schema-generator/blob/fbb72f4e4267b428f9135e03a2f0f5bc39a0a6e9/bin/ts-json-schema-generator doesn't have an extension but imports a file with an extension. Are you saying we might fix the issue by adding the extension?

yes excatly, thats what the error message is saying

from ts-json-schema-generator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.