JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 513
  • Score
    100M100P100Q69889F
  • License MIT

Generate fetch function from ZModel schema file of ZenStack with ofetch

Package Exports

  • @kiki.im.dev/zenstack-fetch
  • @kiki.im.dev/zenstack-fetch/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@kiki.im.dev/zenstack-fetch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ZenStack Fetch Plugin

ZenStack Fetch Plugin is a standard plugin of ZenStack to generate fetch from the ZModel schema with ofetch.

Example

TBD

Setup

npm i -D zenstack-fetch

add the plugin in your ZModel schema file

plugin fetch {
    provider = 'zenstack-fetch'
}

run zenstack generate

npx zenstack generate

you will see the schema.md generated in the same folder of your ZModel schema file.

Options

Name Type Description Required Default
output String Output file path (relative to the path of ZModel) No schema.md
disabled Boolean Whether to run this plugin No false

example:

plugin zenstackmd {
    provider = 'zenstack-fetch'
    output = 'docs/schema.md'
    disabled = true
}

You can also disable it using env variable

DISABLE_ZENSTACK_MD=true

Local Development

Install

npm install

Build

npm run build

After build, the plugin will be generated in dist folder. Then you can use it in your existing ZModel schema by setting the provider this dist folder

plugin zenstackmd {
    provider = '.../zenstack-fetch/dist'
}

provider could either by the absolute path or relative path to the running zenstack module.

Run Sample

simply run npm run dev to see a more complicated result schema.md generated from schema.zmodel