GithubHelp home page GithubHelp logo

elastic / kibana-plugin-helpers Goto Github PK

View Code? Open in Web Editor NEW
18.0 343.0 15.0 196 KB

For Kibana versions prior to 6.3: Just some helpers for writing kibana plugins

License: Other

JavaScript 100.00%

kibana-plugin-helpers's Introduction

kibana-plugin-helpers

Note: the default branch on this repo is 7.x since the changes in master have moved to the kibana project

NOTE: Kibana now includes its own plugin helpers. You should use these if you are targeting Kibana 6.3+. See https://github.com/elastic/kibana/tree/master/packages/kbn-plugin-helpers for installation info.

Apache License CircleCI

Just some helpers for kibana plugin devs.

This simple CLI has several tasks that plugin devs can run from to easily debug, test, or package kibana plugins.

$ plugin-helpers help

  Usage: plugin-helpers [options] [command]

  Commands:

    start                       Start kibana and have it include this plugin
    build [options] [files...]  Build a distributable archive
    test                        Run the server and browser tests
    test:browser [options]      Run the browser tests in a real web browser
    test:server [files...]      Run the server tests using mocha

  Options:

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

Versions

Plugin Helpers Kibana
bundled plugin helpers 6.3+
7.x 4.6.x to 6.2 (node 6+ only)
6.x 4.6.x to 6.2
5.x 4.x

Configuration

plugin-helpers accepts a number of settings, which can be specified at runtime, or included in a .kibana-plugin-helpers.json file if you'd like to bundle those settings with your project.

It will also observe a .kibana-plugin-helpers.dev.json, much like Kibana does, which we encourage you to add to your .gitignore file and use for local settings that you don't intend to share. These "dev" settings will override any settings in the normal json config.

All configuration setting listed below can simply can be included in the json config files. If you intend to inline the command, you will need to convert the setting to snake case (ie. skipArchive becomes --skip-archive).

Global settings

Setting Description
kibanaRoot Path to your checkout of Kibana, relative paths are ok

Settings for start

Setting Description
includePlugins Intended to be used in a config file, an array of additional plugin paths to include, absolute or relative to the plugin root
* Any options/flags included will be passed unmodified to the Kibana binary

Settings for build

Setting Description
skipArchive Don't create the zip file, leave the build path alone
buildDestination Target path for the build output, absolute or relative to the plugin root
buildVersion Version for the build output
kibanaVersion Kibana version for the build output (added to package.json)

kibana-plugin-helpers's People

Contributors

epixa avatar kikketer avatar meganwalker-ibm avatar mkoertgen avatar spalger avatar w33ble avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kibana-plugin-helpers's Issues

Add a command to update the target Kibana version

As mentioned in this issue in the generator, when updating Kibana, the plugin's target Kibana version also needs to be updated.

It might be helpful, and super simple, to add a command to update the version or kibana.version in the plugin's package.json file. Once added, it could be integrated pretty easily into the template as well.

Build Fails 6.0.3

Hi,

You've added an OS check into your create_build.js for win_cmd but this errors when you run the build task on OSX.

#37

Error: BUILD ACTION FAILED: { Error: spawnSync yarn ENOENT

I've fixed this by changing the following lines, but you might want to change cmd back to 'npm' after the try.

try {
        // use yarn if yarn lockfile is found in the build
        cmd = winCmd('yarn');
        statSync(join(buildRoot, 'yarn.lock'));
        execFileSync(cmd, ['install', '--production'], options);
      } catch (e) {
        // use npm if there is no yarn lockfile in the build
        execFileSync('npm', ['install', '--production', '--no-bin-links'], options);
      }

I realise this works because I don't have a lock file yet and I've changed it back to 'npm'.. so it's not the solution..

maybe something like this in create_build.js would work:

} catch (e) {
// set cmd back to npm after try
        cmd = winCmd('npm');
        // use npm if there is no yarn lockfile in the build
        execFileSync(cmd, ['install', '--production', '--no-bin-links'], options);
      }

I don't have a windows machine to test any of this.

Anyone with this issue, rolling back to 6.0.2 fixed this for me.

V5.2.0 - Dependency Bundle

Only the main package.json dependencies are bundled with the zip and any nested dependencies are not included in the bundle.

for example, if you npm install --save charts.js it also installs it's nested dependencies from it's own package.json. But the package produced by plugin-helpers build only contains the main dependencies, so you must go through every nested dependency of charts.js and make sure they are also listed in your main package.json.

Just for charts.js I need to include the below:

"dependencies": {
    "chart.js": "^2.5.0",
    "chartjs-color": "^2.1.0",
    "chartjs-color-string": "^0.4.0",
    "chartsjs-plugin-data-labels": "^0.1.5",
    "color-convert": "^1.9.0",
    "color-name": "^1.1.2",
    "color-string": "^1.5.2",
    "is-arrayish": "^0.3.1",
    "lodash.defaults": "^4.2.0",
    "moment": "^2.17.1",
    "simple-swizzle": "^0.2.2"
  }

I'm not sure if it's a NPM issue or something that can be fixed in the bundle process to recursively check nested dependencies .

This results in it failing the Optimizing and caching browser bundle proccess, when installing in Kibana

ERROR in ./plugins/progress_dough/ ~ /chartjs-color/index.js
Module not found: Error: Cannot resolve module 'chartjs-color-string' in /usr/share/kibana/plugins/progress_dough/node_modules/chartjs-color
@ ./plugins/progress_dough/ ~ /chartjs-color/index.js 3:13-44

ERROR in ./plugins/progress_dough/ ~ /color-string/index.js
Module not found: Error: Cannot resolve module 'simple-swizzle' in /usr/share/kibana/plugins/progress_dough/node_modules/color-string
@ ./plugins/progress_dough/ ~ /color-string/index.js 3:14-39

Question: Kibana Plugin releasing best practices

Hey @spalger ๐Ÿ‘‹ Quick question

I'm having a bit of a headache managing the releasing of my plugin for each version. So for example - if a bug is found in version 6.7.1, I need to add and re-release all the way back to 5.6.x, where each version is branch based. I haven't really maintained a project like this before - it's like maintaining 40 different projects. Do you have any tips or recommendations?

Thanks! ๐Ÿ˜„

Trying to run test:browser fails due to badly constructed arguments

[megan@oc1557223677 myplugin]$ npm run test:browser

> [email protected] test:browser /home/megan/kibana-dev/myplugin
> plugin-helpers test:browser


> [email protected] test:dev /home/megan/kibana-dev/kibana
> grunt test:dev "--kbnServer.testsBundle.pluginId" "myplugin" "--kbnServer.plugin-path" "/home/megan/kibana-dev/myplugin"

Warning: Task "myplugin" not found. Use --force to continue.

Aborted due to warnings.

Looks like test_browser_action.js needs some adjustment as the pluginId value is being interpreted as a separate argument due to the quoting.

task 'test:server' failed after upgrade to Kibana 5.6.7

Hello,

Context: I'm migrating custom Kibana plugins from Kibana 5.2.2 to Kibana 5.6.7.
I updated my package.json, upgraded my code, tested with npm run start and everything is fine.
I'm using now "@elastic/plugin-helpers": "8.1.3" which seems to be the latest version compatible with my setup.
I did not run the "template-kibana-plugin" again to do this migration.

What's happening: npm run test:server fails with following error:

Error: Cannot find module 'D:\Users\xxxxxx\src\kibana\test\mocha_setup.js'

My understanding: the thing is that mocha_setup.js does not belong to Kibana 5.6.7 anymore. It seems that there were plans to move scripts (kibana#11095) with impacts on makelogs and mocha npm scripts (kibana #11665) which were backported to 5.x.
Plugin Helpers still reference this mocha_setup.js script in this version (link:

const mochaSetupJs = resolve(plugin.kibanaRoot, 'test/mocha_setup.js');

I think the test_server_action.js file needs a patch.

I know my setup is deprecated, but is there any chance that this gets fixed? Any idea of a workaround?

Can't test plugin

Hey,

I'm having a really tough time running the tests via the kibana plugin helpers for the kibana-prometheus-exporter:

โžœ  kibana-prometheus-exporter git:(release/6.4.0) npm run test:server

> [email protected] test:server /Users/pjh/Desktop/es660/kibana/kibana-6.6.0-darwin-x86_64/plugins/kibana-prometheus-exporter
> plugin-helpers test:server

child_process.js:658
    throw err;
    ^

Error: spawnSync /Users/pjh/Desktop/es660/kibana/kibana-6.6.0-darwin-x86_64/plugins/kibana/node_modules/.bin/mocha ENOENT
    at Object.spawnSync (internal/child_process.js:998:20)
    at spawnSync (child_process.js:622:24)
    at execFileSync (child_process.js:650:13)
    at module.exports (/Users/pjh/Desktop/es660/kibana/kibana-6.6.0-darwin-x86_64/plugins/kibana-prometheus-exporter/node_modules/@elastic/plugin-helpers/tasks/test/server/test_server_action.js:22:3)
    at run (/Users/pjh/Desktop/es660/kibana/kibana-6.6.0-darwin-x86_64/plugins/kibana-prometheus-exporter/node_modules/@elastic/plugin-helpers/lib/run.js:9:10)
    at /Users/pjh/Desktop/es660/kibana/kibana-6.6.0-darwin-x86_64/plugins/kibana-prometheus-exporter/node_modules/@elastic/plugin-helpers/cli.js:75:5
    at Command.actionWrapper (/Users/pjh/Desktop/es660/kibana/kibana-6.6.0-darwin-x86_64/plugins/kibana-prometheus-exporter/node_modules/@elastic/plugin-helpers/cli.js:12:8)
    at Command.listener (/Users/pjh/Desktop/es660/kibana/kibana-6.6.0-darwin-x86_64/plugins/kibana-prometheus-exporter/node_modules/commander/index.js:315:8)
    at Command.emit (events.js:197:13)
    at Command.parseArgs (/Users/pjh/Desktop/es660/kibana/kibana-6.6.0-darwin-x86_64/plugins/kibana-prometheus-exporter/node_modules/commander/index.js:651:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test:server: `plugin-helpers test:server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test:server script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/pjh/.npm/_logs/2019-02-14T15_27_41_342Z-debug.log

I want to start running these tests and building the artifact on the CircleCI rather than doing it all manually. Can anyone help with debugging this. The log mentioned at the end of the script isn't helpful at all - doesn't give any additional info.

start plugin

Hi,
I using windows, so when I want to start my plugin I typing:
"./bin/kibana --dev --plugin-path=../path/to/first_plugin"
and I get the next error:
"FATAL Error: Config schema already has key: first_plugin",

someone can help?

thanks

Improve README

Let's refine the README so it meets these goals:

  1. Provides context to the reader -- who is this tool for?
  2. Communicates the value prop of this tool -- what pain point(s) does it solve?
  3. Links out to relevant resources/tools, e.g. the plugin generator.
  4. Gives the reader immediate perspective over how to get started with the tool to accomplish some primary tasks.

Some suggestions on how to reach these goals:

  1. Fix the docs link.
  2. Add a very simple step-by-step guide on how to create a plugin, test it, and build a distributable.
  3. Cross-link to the generator and explain relationship between this tool and that one.

Key must be a buffer Error when installing plugins

I'm not sure if this is a plugin-helper issue or not. But when I package up my plugins and attempt to install them I get the following error:

Transferring 6792164 bytes....................
Transfer complete
Retrieving metadata from plugin archive
Extracting plugin archive
Extraction complete
Optimizing and caching browser bundles...
DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
Plugin installation was unsuccessful due to error "Key must be a buffer"

I'm debugging now, but right now it appears to be happening somewhere in the await kbnServer.ready(); in cli_plugin/kibana.js line 47.

Terminal doesn't recover after cmd-c

This is a minor issue. When I run npm run start inside a plugin (runs plugin-helpers start) and then I do a cmd-c to stop it awhile later. Anything I type into the terminal no longer appears.

I noticed that when I run npm run start in kibana and the same cmd-c it doesn't have this issue. Not sure if it's just a simple update of a dependency. I assume it's something related to the logger stopping normal output in the terminal.

build_action expects callback

The build_action.js file is now taking a second parameter as a callback. However the run.js that is calling it is doing an apply with the plugin and any other items from the Command library.
This results in having (plugin, command) being sent to that function and then throws a fit when the callback function (which was sent this command object) isn't a function.

I propose just using call in run.js (line 8):

action.call(null, idPlugin());

And if need-be a callback there, but not sure what purpose that would serve.

Test tasks fail when running on a windows environment

Running the test:browser and test:server tasks will fail on a windows environment with the following exception:

child_process.js:513
    throw err;
    ^

Error: spawnSync npm ENOENT
    at exports._errnoException (util.js:1022:11)
    at spawnSync (child_process.js:468:20)
    at execFileSync (child_process.js:505:13)
    at testBrowserAction (..

This seems to be an issue with how Node calls execFileSync. Changing the cmd variable from 'npm' to 'npm.cmd' in the actions:

  var cmd = 'npm';
  var args = ['run', 'test:dev', '--'].concat(kbnServerArgs);
  execFileSync(cmd, args, {
    cwd: plugin.kibanaRoot,
    stdio: 'inherit'
  })

fixes the issue.

Plugin install can't resolve module

So I have a symlink (or just a full copy) of a plugin that I'm working on inside the /plugins folder. For this example let's say it's https://github.com/Kikketer/generic-feedback-plugin.

Simply clone that plugin and place it along side /kibana (same parent). Then create a symlink in the /kibana/plugins directory called "generic-feedback-plugin" that points to the "generic-feedback-plugin" folder (the one you just cloned).

All is well, right up until you decide to install another plugin:

./bin/kibana-plugin install x-pack

After a bit I get this error:

    ERROR in ./optimize/bundles/status_page.entry.js
    Module not found: Error: Cannot resolve 'file' or 'directory' /Users/***/Documents/htdocs/kibana/plugins/generic-feedback-plugin/public/public/feedback in /Users/***/Documents/htdocs/kibana/optimize/bundles
     @ ./optimize/bundles/status_page.entry.js 35:0-58

(the *** mask my ID, still figuring out the compliance stuff)

Note the /public/public part in the folder. That seemed odd to me, so I removed /public from the hack in the index.js. But it then just said the same error with no /public folder in it at all. Smells like it's doing something odd there.

generated plugin not starting .

pasindu@pasindu:~/data/software/kibana/my-new-plugin$ npm start -- --elasticsearch.url 'http://localhost:9200'

[email protected] start /home/pasindu/data/software/kibana-6.1.3-linux-x86_64/my-new-plugin
plugin-helpers start "--elasticsearch.url" "http://localhost:9200"

child_process.js:496
throw err;
^

Error: spawnSync bin/kibana ENOENT
at exports._errnoException (util.js:1020:11)
at spawnSync (child_process.js:451:20)
at execFileSync (child_process.js:488:13)
at module.exports (/home/pasindu/data/software/kibana-6.1.3-linux-x86_64/my-new-plugin/node_modules/@elastic/plugin-helpers/tasks/start/start_action.js:13:3)
at run (/home/pasindu/data/software/kibana-6.1.3-linux-x86_64/my-new-plugin/node_modules/@elastic/plugin-helpers/lib/run.js:9:10)
at /home/pasindu/data/software/kibana-6.1.3-linux-x86_64/my-new-plugin/node_modules/@elastic/plugin-helpers/bin/plugin-helpers.js:27:7
at Command.actionWrapper (/home/pasindu/data/software/kibana-6.1.3-linux-x86_64/my-new-plugin/node_modules/@elastic/plugin-helpers/bin/plugin-helpers.js:14:8)
at Command.listener (/home/pasindu/data/software/kibana-6.1.3-linux-x86_64/my-new-plugin/node_modules/commander/index.js:315:8)
at emitTwo (events.js:106:13)
at Command.emit (events.js:191:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: plugin-helpers start "--elasticsearch.url" "http://localhost:9200"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/pasindu/.npm/_logs/2018-02-02T03_58_05_185Z-debug.log

"TypeError: Cannot read property 'unknownOptions' of undefined" and "Error: Cannot find module '../cli'" saga

Just do npm i @elastic/plugin-helpers@7 and then npm start

./node_modules/.bin/plugin-helpers start
Task "start" failed:

TypeError: Cannot read property 'unknownOptions' of undefined
    at program.command.description.on.action.createCommanderAction (/opt/dev/bitbucket.org/qaap-uniqcast/statia/kibana/plugins/uauth/node_modules/@elastic/plugin-helpers/cli.js:17:22)
    at Promise.resolve.then (/opt/dev/bitbucket.org/qaap-uniqcast/statia/kibana/plugins/uauth/node_modules/@elastic/plugin-helpers/lib/commander_action.js:7:33)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3

I have kibana source in a folder parallel to the plugin one where this is installed. It is a symlink folder.

If a plugin folder is not a symlink, then I get

[email protected] start /opt/dev/github.com/mkozjak/uauth                                                                                                                             
> plugin-helpers start                                                                                                                                                            
                                                                                                                                                                                  
module.js:549                                                                                                                                                                     
    throw err;
    ^

Error: Cannot find module '../cli'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/opt/dev/github.com/mkozjak/uauth/node_modules/.bin/plugin-helpers:9:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

"@elastic/plugin-helpers": "^7.1.7"

Unable to install @gulp-sourcemaps

I realize this may be out of your control but I've run into issues lately trying to get the helpers installed in projects. I narrowed it down to this dependency in the plugin.

npm install --save-dev @elastic/plugin-helpers --verbose

The output is insane but eventually dies here:

npm verb afterAdd /Users/myname/.npm/source-map/0.5.6/package/package.json written
npm info attempt registry request try #2 at 11:37:30 AM
npm http request GET https://registry.npm.js.org/@gulp-sourcemaps%2fmap-sources
npm info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND registry.npm.js.org registry.npm.js.org:443

The domain is the goofy bit. It's trying to get npm.js.org when it should be npmjs.org. Do you happen to know who's at fault here? Is there a way I can skip this?

The build task is broken in master / 5.0.1-pre3.

I suspect the recent refactoring in this task has caused some issues.

  • main() isn't being invoked when the build task is executed.
  • The buildId variable isn't declared in the build() signature, meaning all the arguments passed in are misassigned.

Fatal error: Cannot read property '5.0' of undefined

> [email protected] elasticsearch /usr/share/kibana
> grunt esvm:dev:keepalive

Running "esvm:dev:keepalive" (esvm) task
starting up "dev" cluster
Keeping elasticsearch alive, to shutdown press command/control+c
Fatal error: Cannot read property '5.0' of undefined

npm ERR! Linux 4.4.27-moby
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "elasticsearch"
npm ERR! node v6.7.0
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] elasticsearch: `grunt esvm:dev:keepalive`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] elasticsearch script 'grunt esvm:dev:keepalive'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the kibana package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     grunt esvm:dev:keepalive
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs kibana
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls kibana
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/share/kibana/npm-debug.log

Attempting Yarn when there isn't one

I discovered this issue when moving from version 6.0.2 to 6.0.3.
It seems my build process now suddenly thinks that I have a yarn.lock file and attempts to use yarn (which isn't installed).

With 6.0.3:

14-Apr-2017 15:36:34	> plugin-helpers build
14-Apr-2017 15:36:34	
14-Apr-2017 15:36:34	BUILD ACTION FAILED: { Error: spawnSync yarn ENOENT
14-Apr-2017 15:36:34	    at exports._errnoException (util.js:1012:11)
14-Apr-2017 15:36:34	    at spawnSync (child_process.js:453:20)
14-Apr-2017 15:36:34	    at execFileSync (child_process.js:490:13)
14-Apr-2017 15:36:34	    at /opt/lforge/atlassian_data/bamboo_home/xml-data/build-dir/ETSITOADA-DFP-ITR/node_modules/@elastic/plugin-helpers/tasks/build/create_build.js:51:9
14-Apr-2017 15:36:34	    at process._tickCallback (internal/process/next_tick.js:103:7)
14-Apr-2017 15:36:34	  code: 'ENOENT',
14-Apr-2017 15:36:34	  errno: 'ENOENT',
14-Apr-2017 15:36:34	  syscall: 'spawnSync yarn',
14-Apr-2017 15:36:34	  path: 'yarn',
14-Apr-2017 15:36:34	  spawnargs: [ 'install', '--production', '--no-bin-links' ],
14-Apr-2017 15:36:34	  file: 'yarn',
14-Apr-2017 15:36:34	  args: [ 'yarn', 'install', '--production', '--no-bin-links' ],
14-Apr-2017 15:36:34	  options: 

With 6.0.2 everything works fine. I checked out your code at https://github.com/elastic/kibana-plugin-helpers/blob/master/tasks/build/create_build.js#L45 and it seems like it would work (in saying there's no yarn.lock file). I'm not sure exactly what it's doing to think that the lock file exists.

Add translations folder when building

As Kibana is being internationalized, plugins may contain a translations folder.

This folder should be added during the build.

As a workaround, we modified our package.js for the build :

{
  "name": "XXX",
  "version": "1.0.0",
  "description": "XXX",
  "main": "index.js",
  "kibana": {
    "version": "5.5.0"
  },
  "scripts": {
    "lint": "eslint",
    "start": "plugin-helpers start",
    "test:server": "plugin-helpers test:server",
    "test:browser": "plugin-helpers test:browser",
    "build": "plugin-helpers build -- 'package.json' 'index.js' '{lib,public,server,webpackShims,translations}/**/*'",
    "postinstall": "plugin-helpers postinstall"
  },
  "devDependencies": {
    "@elastic/eslint-config-kibana": "0.0.2",
    "@elastic/plugin-helpers": "7.0.0",
    "babel-eslint": "4.1.8",
    "eslint": "1.10.3",
    "eslint-plugin-mocha": "1.1.0",
    "expect.js": "0.3.1"
  },
  "dependencies": {
    "lodash": "3.10.1"
  }
}

Error

Error: Cannot find module '../helper.js'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (E:\Gekko\gekko-develop\strategies\buyatsellat.js:3:14)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
RECEIVED ERROR IN GEKKO 0927221594944796
Child process has died.

npm start fail

 ERROR  Extra serve options "--dev" must have a value

undefined

And option "--dev" has been removed, from elastic/kibana#8394
but i still meet the problem when i use plugin-helpers from template-kibana-plugin.

the version of kibana,

kibana: 5.5.0

the version of template-kibana-plugin

  "devDependencies": {
    "@elastic/eslint-config-kibana": "^0.6.1",
    "@elastic/plugin-helpers": "^7.0.0",
    "babel-eslint": "^7.2.3",
    "eslint": "^3.19.0",
    "eslint-plugin-babel": "^4.1.1",
    "eslint-plugin-import": "^2.3.0",
    "eslint-plugin-mocha": "^4.9.0",
    "eslint-plugin-react": "^7.0.1",
    "expect.js": "^0.3.1"
  }

Build task does not include npm dependencies when there is only one

For some reason I can't get the build script to include a node module that is listed as a dependency in the generated zip.

Using [email protected] as a starting point for the plugin, and material-design-icons as an example I can reproduce this reliably with

mkdir test-plugin
cd test-plugin
yo kibana-plugin [accept defaults]
npm install --save material-design-icons
npm run build

If you then look in the zip that was generated the node_modules directory is not there, so the dependency wasn't packaged.

By annotating tasks/build/build_action.js with some logging (manually, and with the gulp-debug module) I can see the following
The files variable right before passing it into the vfs.src() is

["package.json","index.js","{lib,public,server,webpackShims}/**/*","node_modules/{material-design-icons}/**/*"]

So it's picked up that it should be including it.

But with gulp-debug I can see that the files that make it through into the stream are only

[15:31:36] gulp-debug: package.json
[15:31:36] gulp-debug: index.js
[15:31:36] gulp-debug: public/app.js
[15:31:36] gulp-debug: public/hack.js
[15:31:36] gulp-debug: public/less
[15:31:36] gulp-debug: public/templates
[15:31:36] gulp-debug: server/routes
[15:31:36] gulp-debug: public/less/main.less
[15:31:36] gulp-debug: public/templates/index.html
[15:31:36] gulp-debug: server/routes/example.js
[15:31:36] gulp-debug: 10 items

So for some reason it's not finding the installed module, though it is there in the directory structure.

I'm at a loss to explain why it's not managing to match the directory. I'm not overly familiar with the globbing syntax so not sure if the bug lies in the constructed files array.

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.