@karma.run/editor
Administrative editor for karma.data.
Last updated 2 years ago by perplex .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @karma.run/editor 
SYNC missed versions from official npm registry.

@karma.run/editor

License NPM Package

Administrative editor for karma.data.

Preview

Install

npm install -g @karma.run/editor

Basic Usage

$ karma-editor --help

  Usage: karma-editor [options] [command]

  Options:

    -V, --version     output the version number
    -h, --help        output usage information

  Commands:

    server [options]  Run editor server.
    build [options]   Pre-build editor client.
    clean [options]   Clean client cache.

Configuration Files

Configuration files allow the usage of plugins and advanced customization of the editor, they can be written in JavaScript or TypeScript.

The CLI will automatically search for editor.client.config.{js,ts,tsx} and editor.server.config.{js,ts,tsx} upwards from the current working directory, if you'd rather be specific you can always set the config path manually via CLI option --server-config-path and --client-config-path.

Example configurations can be found here

NOTICE: It's recommended to have both configuration files in the same directory

Client Configuration

The client configuration file will be compiled directly into the client bundle via webpack, so no real Node environment is available in this config file.

{
  // List of client plugins.
  plugins?: ClientPlugins[]
}

Server Configuration

{
  // Port the server runs on, can be overriden by 'PORT' environment variable or CLI option '--port'.
  port?: number

  // karma.data URL, can be overriden by 'KARMA_DATA_URL' environment variable or CLI option '--karma-data-url'.
  karmaDataURL?: string

  // List of server plugins.
  plugins?: ServerPlugin[]

  // Customize editor contexts based on user roles.
  editorContexts?: (roles: string[], tagMap: ReadonlyMap<string, Ref>) => EditorContext[]

  // Customize view contexts based on user roles.
  viewContexts?: (roles: string[], tagMap: ReadonlyMap<string, Ref>) => ViewContext[];
}

Editor Context

{
  name: string
  modelGroups: ModelGroup[]
}

Model Group

{
  name: string
  models: (string | Ref)[]
}

View Context

{
  model: string | Ref
  name?: string
  description?: string
  slug?: string
  color?: string
  field?: Field
  displayKeyPaths?: string[][]
}

Current Tags

  • 0.14.3                                ...           latest (2 years ago)
  • 0.12.14                                ...           latest-0.12.x (3 months ago)

27 Versions

  • 0.12.14                                ...           3 months ago
  • 0.12.13                                ...           6 months ago
  • 0.12.12                                ...           a year ago
  • 0.12.11                                ...           2 years ago
  • 0.12.10                                ...           2 years ago
  • 0.14.3                                ...           2 years ago
  • 0.14.2                                ...           2 years ago
  • 0.14.1                                ...           2 years ago
  • 0.12.9                                ...           2 years ago
  • 0.12.8                                ...           2 years ago
  • 0.12.7                                ...           2 years ago
  • 0.12.6                                ...           2 years ago
  • 0.14.0                                ...           2 years ago
  • 0.12.5                                ...           2 years ago
  • 0.12.4                                ...           2 years ago
  • 0.13.4                                ...           2 years ago
  • 0.13.3                                ...           2 years ago
  • 0.13.2                                ...           2 years ago
  • 0.13.1                                ...           2 years ago
  • 0.13.0                                ...           2 years ago
  • 0.12.3                                ...           2 years ago
  • 0.12.2                                ...           2 years ago
  • 0.12.1                                ...           2 years ago
  • 0.12.0                                ...           2 years ago
  • 0.12.0-beta.4                                ...           2 years ago
  • 0.12.0-beta.3                                ...           2 years ago
  • 0.12.0-beta.1                                ...           2 years ago
Maintainers (2)
Downloads
Today 0
This Week 27
This Month 27
Last Day 27
Last Week 0
Last Month 2
Dependencies (15)
Dev Dependencies (10)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |