![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@discoveryjs/cli
Advanced tools
CLI tools to serve & build projects based on Discovery.js
npm install @discoveryjs/cli
Usage:
discovery [config] [options]
Options:
--cache [dir] Enable data caching and specify path to store cache files (using a
working directory if dir is not set)
-c, --config <filename> Path to config (JavaScript or JSON file), if not specified then
looking for .discoveryrc.js, .discoveryrc.json, .discoveryrc or
"discovery" section in package.json in the listed order
--dev Enable developer mode
-h, --help Output usage information
-m, --model <name> Specify a model (multi-model mode only)
--no-warmup Disable warm up model data cache on server start
-p, --port <n> Listening port (default: 8123)
-v, --version Output version
Usage:
discovery-build [config] [options]
Options:
--cleanup Delete all files of output path before saving a result to it
-c, --config <filename> Path to config (JavaScript or JSON file), if not specified then
looking for .discoveryrc.js, .discoveryrc.json, .discoveryrc or
"discovery" section in package.json in the listed order
-h, --help Output usage information
-m, --model <name> Specify a model (multi-model mode only)
-o, --output <path> Path for a build result (`build` by default)
--pretty-data [indent] Pretty print of data.json
-s, --single-file Output a model build as a single file
-v, --version Output version
Discovery can work in following modes:
This mode has no any predefined configurations. However, you can upload any data by clicking "Load data" button, or drag'n'drop file right into the browser and discover it.
Most common If you want only one model, you should start discovery with --model %modelName%
. In this mode index page will represent your model default page.
In case you need that discovery powers more than one model at once, your can use multi-model mode. In this mode discovery will show model selection page as index page. Every model will have own route namespace (slug), and you can switch between models and index page at any time.
To configure discovery you should specify one of config files:
.discoveryrc.js
.discoveryrc.json
.discoveryrc
(the same as .discoveryrc.json
)Or you can add a section in your package.json
file with discovery
as a key.
Model config may consists of the following fields (all fields are optional):
name
– name of model (used in title)data
– function which returns any|Promise<any>
. Result of this function must be JSON serializableprepare
– path to a script with additional initialization logic (e.g. add cyclic links and relations, extensions for query engine etc)plugins
– list of plugins (paths to .js
and .css
files); relative paths or package name and path are supported; concating to parent's plugin listfavicon
– path to favicon image; inherits from parent config when not setviewport
– value for <meta name="viewport">
; inherits from parent config when not setview
– object with following fields:
basedir
– directory to resolve relative path in assets
and libs
libs
– path to libs, where key is a local name available in asset's scope and value is a path to library file or an array of files (.js
or .css
)assets
– array of path to .js
and .css
filesjs files has own scope (as modules) with a reference
discovery
that points to discovery instance
extendRouter
– function(router, modelConfig, options)
cache
cacheTtl
cacheBgUpdate
Example:
const path = require('path');
module.exports = {
name: 'Model config',
data: () => ({ hello: 'world' }),
prepare: path.join(__dirname, 'path/to/prepare.js'),
favicon: 'path/to/favicon.png',
plugins: [
'@discoveryjs/view-plugin-highcharts',
'@discoveryjs/view-plugin-highcharts/index.css',
'./relative-path-to-plugin.js'
],
view: {
basedir: __dirname,
assets: [
'ui/page/default.js',
'ui/view/model-custom-view.css',
'ui/view/model-custom-view.js',
'ui/sidebar.css',
'ui/sidebar.js'
]
}
};
Config should provide JSON or exports an object with following properties:
name
- name of discovery instance (used in page title)models
- object with model configurations, where for each entry the key used as a slug and the value as a configfavicon
– path to favicon imageviewport
– value for <meta name="viewport">
plugins
– a list of plugin files for every model; list is prepending to a list defined in a modelcache
Example:
module.exports = {
name: 'My cool dashboards',
models: {
one: 'path/to/model/config',
two: { /* model config */ }
},
favicon: 'path/to/favicon.png',
plugins: [
'@discoveryjs/view-plugin-highcharts',
'@discoveryjs/view-plugin-highcharts/index.css',
'./relative-path-to-plugin.js'
]
};
MIT
1.8.1 (23-04-2020)
--prebuild
option for server to not prebuild when option is not setFAQs
CLI tools to serve & build projects based on Discovery.js
The npm package @discoveryjs/cli receives a total of 55 weekly downloads. As such, @discoveryjs/cli popularity was classified as not popular.
We found that @discoveryjs/cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.