* build immutable bundles for new platform plugins * only inspect workers if configured to do so * [navigation] use an index.scss file * add yarn.lock symlink * set pluginScanDirs in test so fixtures stay consistent * cleanup helpers a little * fix type error * support KBN_OPTIMIZER_MAX_WORKERS for limiting workers via env * test support for KBN_OPTIMIZER_MAX_WORKERS * expand the available memory for workers when only running one or two * add docs about KBN_OPTIMIZER_MAX_WORKERS environment variable * fix README link * update kbn/pm dist * implement bundle caching/reuse * update kbn/pm dist * don't check for cache if --no-cache is passed * update renovate config * standardize on index.scss, move console styles over * add support for --no-cache to cli * include worker config vars in optimizer version * ignore concatenated modules * update integration test * add safari to browserslist to avoid user-agent warnings in dev * update docs, clean up optimizer message/misc naming * always handle initialized messages, don't ignore states that are attached to specific events * reword caching docs, add environment var to disable caching * tweak logging and don't use optimizer.useBundleCache as that's disabled in dev * handle change notifications * batch changes for 1 second * rename CompilerState type to CompilerMsg * getChanges() no longer needs to assign changes to dirs * remove unused deps * split up run_worker.ts and share cacheKey generation logic * add a couple docs * update tests and remove unused imports * specify files when creating bundle cache key * remove one more unused import * match existing dev cli output more closely * update kbn/pm dist * set KBN_NP_PLUGINS_BUILT to avoid warning in CI * avoid extending global window type * add note to keep pluginScanDirs in sync * pass browserslistEnv in workerConfig so it is used for cache key * load commons.bundle.js in parallel too * emit initialized+success states if all bundles are cached * load bootstraps as quickly as possible * skip flaky suite * bump * update jest snapshots * remove hashing from cache key generation * remove unnecessary non-null assertion * improve docs and break up Optimizer#run() * remove unused import * refactor kbn/optimizer to break up observable logic, implement more helpful cache invalidation logic with logging * fix tests * add initializing phase * avoid rxjs observable constructor * remove unnecessary rxjs helper, add tests for bundle cache * update consumers of optimizer * update readme with new call style * replace "new platform" with "kibana platform" * fix a couple more renames * add support for several plain-text file formats * fix naming of OptimizerMsg => OptimizerUpdate, use "store" naming too * one more OptimizerMsg update * ensure bundles are not cached when cache config is false * test for initializing states and bundle cache events * remove unnecessary timeout change * Remove unnecessary helpers * Add tests for BundleCache class * Add tests for Bundle class * test summarizeEvent$ * missing paths are no longer listed in mtimes map * add tests for optimizer/cache_keys * Add some extra docs * Remove labeled loop * add integration test for kbn-optimizer watcher components * querystring-browser removed * tweak logging a smidge, improve info and final message * remove unused imports * remove duplication of getModuleCount() method * move type annotation that validates things * clear up the build completion message Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> |
||
---|---|---|
.. | ||
integration_tests | ||
sao_template | ||
index.js | ||
index.js.d.ts | ||
package.json | ||
README.md | ||
tsconfig.json | ||
yarn.lock |
Kibana Plugin Generator
This package can be used to generate a Kibana plugin from the Kibana repo.
Setup
Before you can use this plugin generator you must setup your Kibana development environment. If you can successfully run yarn kbn bootstrap
then you are ready to generate plugins!
Compatibility
The plugin generator became a part of the Kibana project as of Kibana 6.3. If you are targeting versions before Kibana 6.3 then use the Kibana plugin sao template.
If you are targeting Kibana 6.3 or greater then checkout the corresponding Kibana branch and run the plugin generator.
Quick Start
To target the current development version of Kibana just use the default master
branch.
node scripts/generate_plugin my_plugin_name
# generates a plugin in `plugins/my_plugin_name`
To target 6.3, use the 6.x
branch (until the 6.3
branch is created).
git checkout 6.x
yarn kbn bootstrap # always bootstrap when switching branches
node scripts/generate_plugin my_plugin_name
# generates a plugin for Kibana 6.3 in `../kibana-extra/my_plugin_name`
The generate script supports a few flags; run it with the --help
flag to learn more.
node scripts/generate_plugin --help
Updating
Since the Plugin Generator is now a part of the Kibana repo, when you update your local checkout of the Kibana repository and bootstrap
everything should be up to date!
NOTE: These commands should be run from the Kibana repo, and
upstream
is our convention for the git remote that references https://github.com/elastic/kibana.git, unless you added this remote you might need to useorigin
.
git pull upstream master
yarn kbn bootstrap
Plugin Development Scripts
Generated plugins receive a handful of scripts that can be used during development. Those scripts are detailed in the README.md file in each newly generated plugin, and expose the scripts provided by the Kibana plugin helpers, but here is a quick reference in case you need it:
NOTE: All of these scripts should be run from the generated plugin.
-
yarn kbn bootstrap
Install dependencies and crosslink Kibana and all projects/plugins.
IMPORTANT: Use this script instead of
yarn
to install dependencies when switching branches, and re-run it whenever your dependencies change. -
yarn start
Start kibana and have it include this plugin. You can pass any arguments that you would normally send to
bin/kibana
yarn start --elasticsearch.hosts http://localhost:9220
-
yarn build
Build a distributable archive of your plugin.
-
yarn test:browser
Run the browser tests in a real web browser.
-
yarn test:mocha
Run the server tests using mocha.
For more information about any of these commands run yarn ${task} --help
. For a full list of tasks run yarn run
or take a look in the package.json
file.