Giter VIP home page Giter VIP logo

schemastore-updater's Introduction

schemastore-updater

Load schema files from @SchemaStore/schemastore, convert them to TypeScript definitions with json-schema-to-typescript and publish them on npm.

Usage

Usage: schemastore-updater [options] [command]

Options:
  -V, --version           output the version number
  -s, --settings <file>   Specify a settings file (default: "settings.json")
  -d, --source-dir <dir>  Specify a source dir (will disable cloning)
  -h, --help              output usage information

Commands:
  update [options]
  check-disabled
  check-versions
  fix-lockfile
Usage: schemastore-updater update [options]

Options:
  -f, --force  Force re-generating all schemas (default: false)
  -h, --help   output usage information

schemastore-updater's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

phibar smmccabe

schemastore-updater's Issues

@schemastore npm scope

Hi @ffflorian,

First of all, thank you so much for what you've put together here. I'm glad to see someone else that values and utilizes JSON Schema as much as I do.

I am going to be implementing some automation using GitHub actions for the SchemaStore repo: SchemaStore/schemastore#1274

I would like to build off the work you have here with a tighter integration with SchemaStore. One of the thoughts I have is to use GitHub actions to automatically publish the schemas to npm, with TypeScript types included by utilizing https://github.com/bcherny/json-schema-to-typescript.

Once this is all setup and ready to go, would you consider transferring the schemastore npm scope to @madskristensen (the founder of SchemaStore)?

@schemastore/package types are invalid

v0.0.7 has now this:

/**
 * Used to specify conditional exports, note that Conditional exports are unsupported in older environments, so it's recommended to use the fallback array option if support for those environments is a concern.
 */
export interface PackageExportsEntryObject {
  /**
   * The module path that is resolved when this specifier is imported as a CommonJS module using the `require(...)` function.
   */
  require?: PackageExportsEntry | PackageExportsFallback;
  /**
   * The module path that is resolved when this specifier is imported as an ECMAScript module using an `import` declaration or the dynamic `import(...)` function.
   */
  import?: PackageExportsEntry | PackageExportsFallback;
  /**
   * The module path that is resolved when this environment is Node.js.
   */
  node?: PackageExportsEntry | PackageExportsFallback;
  /**
   * The module path that is resolved when no other export type matches.
   */
  default?: PackageExportsEntry | PackageExportsFallback;
  /**
   * The module path that is resolved when this environment matches the property name.
   *
   * This interface was referenced by `PackageExportsEntryObject`'s JSON-Schema definition
   * via the `patternProperty` "^(?![\.0-9]).".
   *
   * This interface was referenced by `PackageExportsEntryObject1`'s JSON-Schema definition
   * via the `patternProperty` "^(?![\.0-9]).".
   */
  [k: string]: PackageExportsEntry | PackageExportsFallback;
}
/**
 * Used to specify conditional exports, note that Conditional exports are unsupported in older environments, so it's recommended to use the fallback array option if support for those environments is a concern.
 */
export interface PackageExportsEntryObject1 {
  /**
   * The module path that is resolved when this specifier is imported as a CommonJS module using the `require(...)` function.
   */
  require?: PackageExportsEntry | PackageExportsFallback;
  /**
   * The module path that is resolved when this specifier is imported as an ECMAScript module using an `import` declaration or the dynamic `import(...)` function.
   */
  import?: PackageExportsEntry | PackageExportsFallback;
  /**
   * The module path that is resolved when this environment is Node.js.
   */
  node?: PackageExportsEntry | PackageExportsFallback;
  /**
   * The module path that is resolved when no other export type matches.
   */
  default?: PackageExportsEntry | PackageExportsFallback;
  /**
   * The module path that is resolved when this environment matches the property name.
   *
   * This interface was referenced by `PackageExportsEntryObject`'s JSON-Schema definition
   * via the `patternProperty` "^(?![\.0-9]).".
   *
   * This interface was referenced by `PackageExportsEntryObject1`'s JSON-Schema definition
   * via the `patternProperty` "^(?![\.0-9]).".
   */
  [k: string]: PackageExportsEntry | PackageExportsFallback;
}

Which is not valid because the index type does not allow undefined - the easiest and most accurate fix would be to drop the properties.

TS playground link

package definition errors

I don't know the proper place to make this issue, as I don't know where the actual fault lies.

The typings for package are not compilable, due to this block at the end of the main interface:

[k: string]: {
[k: string]: any;
};

It should have | any at the end, to support top level properties that are primitive types (such as module, esnext, etc).

This is also the same for this line:

[k: string]: string;

Update publish to NPM

Hello!

I know this project has been on ice for a while, but would it be possible to get an up-to-date set of schemas published to NPM please?

Thank you very much,
James.

Person type is too abstract

Hello!

Thank you for this great library!

However, the Person type is pretty abstract:

type Person =
  | {
      [k: string]: any;
    }
  | string;

It would be nice, to specify the fields, like name, email, website etc.

Here's my implementation from our private project:

type Person = (string | {
  name: string;
  email?: string;
  url?: string;
})

Thanks!

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.