public-transport / friendly-public-transport-format

A format for APIs, libraries and datasets containing and working with public transport data.
Creative Commons Attribution Share Alike 4.0 International
125 stars 1 forks source link

indicating fptf version in js modules #32

Closed juliuste closed 6 years ago

juliuste commented 6 years ago

@derhuerst and I were just briefly discussing on how to indicate the "supported" version of FPTF in JavaScript public transport libraries.

We thought of three different options, but feel free to share any other ideas:

  1. Require the fptf module (at a specific version) in the devDependencies.
  2. Require the validate-fptf module (at a specific version) in the devDependencies.
  3. Add a custom fptf key to the package.json file, which indicates the version (similar to the browserify key)
juliuste commented 6 years ago
  1. Doesn't seem perfect to me, since there could be bugfixes in validate-fptf which would probably result in a disparity between fptf and validate-fptf versions. (Which would be bad if validate-fptf is used to infer the fptf version…)
juliuste commented 6 years ago

@derhuerst Opinions?

juliuste commented 6 years ago

To encourage people to test their modules using validate-fptf and because people would probably forget to set/update an fptf key in their own module's package.json, setting the fptf key in validate-fptf's package.json instead seems to be the most elegant way to do this.

You would then get the FPTF version of a module by looking directly at the version of validate-fptf required in the module's dependencies or devDependencies.

juliuste commented 6 years ago

Should we mention this somewhere in the docs (or, since it's language-specific, at some special JS-FPTF-module-writing-guide-like-place)?

derhuerst commented 6 years ago

Should we mention this somewhere in the docs (or, since it's language-specific, at some special JS-FPTF-module-writing-guide-like-place)?

Maybe we can use the wiki for that.

pros:

cons:

another proposal: docs/js.md

juliuste commented 6 years ago

Closing in favour of the fpti-js standard.