Coder Social home page Coder Social logo

supermodel / supermodel-cli Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 1.0 1.45 MB

Boring data modeling

Home Page: http://supermodel.io

License: MIT License

JavaScript 96.96% TypeScript 2.33% Shell 0.71%
avro avro-schema graphql json json-ld json-schema openapi swagger

supermodel-cli's Introduction

Supermodel npm packages CircleCI

Collection of npm packages supporting supermodel.io

Table of Contents

Introduction

TODO

Packages

@supermodel/cli README Version

Main package used for installing system wide binary supermodel for manipulating schemas

@supermodel/lib README Version

Collection of utils on top of json schema. Used in @supermodel/cli and on supermodel.io

@supermodel/file README Version

Utils for manipulating json schema on file system. Used in @supermodel/cli

Contributing

We are using lerna for managing all packages together

Installation

  1. yarn global add [email protected] (npm i -g [email protected]) - to install orchstrating tool lerna

  2. yarn bootstrap - resolves and install root and packages dependencies

    • ⚠️ use this instead of yarn [install]
    • ensures presence of global installation of lerna and install it for you when missing
  3. 🤔 optional When developing against local supermodel.io instance setup .env for CLI. Choose symlink or copy:

    • symlink: ln -s ./packages/cli/.env.development ./packages/cli/.env
    • copy: cp ./packages/cli/.env.development ./packages/cli/.env and change variables for your needs

Usage

  • yarn build:watch
    • should be running while you want to use ./packages/cli/bin/supermodel or supermodel after yarn local:install
  • yarn test:watch - watch tests in all packages at once
  • yarn build - make production builds
  • yarn test - run lint, type checks and run tests in all packages at once
    • yarn test:lint - code linting
    • yarn test:types - type checks
    • yarn test:unit - unit tests

Local linking

To try @supermodel/cli locally with simple supermodel command we need to link all packages. There is shortcut to link all packages

  • yarn local:install
  • yarn local:uninstall

Principes

Every new module which manipulates with schemas (conversion, resolving, transforming etc.) or helps to work with schemas and environment around should be placed inside @supermodel/lib. Exposed modules for outside usage should return a value, or throw an error. Or promise analogy (resolve, reject) for async modules.

TODO

Publishing

lerna publish

  • useses lerna publish
  • It is most streightforward way to publish. It compile typescript with yarn build command, tag changed packages with new versions and publish it to npm

A Good API Project

supermodel.io, and supermodel CLI are Good API non-profit projects, aimed at promoting modern, reusable, and sustainable data modeling.

License

The MIT License (MIT) 2020 Good API

supermodel-cli's People

Contributors

schovi avatar zdne avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

amzani

supermodel-cli's Issues

Command `model create` failed

I'm following https://github.com/supermodel/supermodel-cli#getting-started. Everything went well till supermodel model create MyModel. It throw an error:

/usr/local/lib/node_modules/@supermodel/cli/build/src/commands/model/create.js:35
    var modelFileName = superlib.camelize(basename);
                                 ^

TypeError: superlib.camelize is not a function
    at runCreate (/usr/local/lib/node_modules/@supermodel/cli/build/src/commands/model/create.js:35:34)
    at Command.<anonymous> (/usr/local/lib/node_modules/@supermodel/cli/build/src/commands/model/cli.js:11:38)
    at Command.listener (/usr/local/lib/node_modules/@supermodel/cli/node_modules/commander/index.js:315:8)
    at Command.emit (events.js:182:13)
    at Command.parseArgs (/usr/local/lib/node_modules/@supermodel/cli/node_modules/commander/index.js:654:12)
    at Command.parse (/usr/local/lib/node_modules/@supermodel/cli/node_modules/commander/index.js:474:21)
    at Object.<anonymous> (/usr/local/lib/node_modules/@supermodel/cli/build/src/commands/model/cli.js:17:6)
    at Module._compile (internal/modules/cjs/loader.js:722:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
Petr-MacBook-Pro-2:MyApp padak$ 

Is it bug or something on my side?

Creating of nested models

I would like to call supermodel model create User/Bio

Now it fails.

~/w/s/s/david ▶︎︎ ../../supermodel-cli/bin/supermodel model create User/Bio
fs.js:667
  return binding.open(pathModule.toNamespacedPath(path),
                 ^

Error: ENOENT: no such file or directory, open '/Users/schovi/work/supermodel/supermodel/david/User/Bio.yaml'

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.