-
Notifications
You must be signed in to change notification settings - Fork 8.5k
move canvas interpreter to OSS #26066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
ppisljar
wants to merge
19
commits into
elastic:master
from
spalger:implement/open-source-expression-interpreter
Closed
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
073bb86
moving files
ppisljar 1245ff4
updating license headers
ppisljar 863e520
updating references
ppisljar 05b8b2d
eslint
ppisljar b942ef9
creating package and plugin
ppisljar c84f2c5
plugin loading
ppisljar 24b0823
workaround for mocha tests
ppisljar 42259f2
Ensure kbn-interpreter tests get run by jest.
lukeelmers 05fab93
Add unit tests for kbn-interpreter PathsRegistry.
lukeelmers d592e97
review feedback
ppisljar 607a4df
fixing based on marcos review
ppisljar eda6dc3
this should actually be in package not in plugin
ppisljar 7ab6dcc
fix(NA): deadlock on init canvas in node 10.
mistic 51bcf08
refact(NA): move kbn interpretor to a trully package.
mistic d85b8f1
docs(NA): correct description for babel register. fix(NA): make canva…
mistic 8963f9c
fix(NA): make canvas still static analyzable when isolate kbn interpr…
mistic d907057
chore(NA): fix eslint ignore.
mistic 3c95b45
Merge branch 'ref/canvasInterpreter2OSS' of github.com:ppisljar/kibana
cd53cf1
Merge branch 'fix-canvas-deadlock-on-node10' of github.com:mistic/kibana
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "presets": ["@kbn/babel-preset/webpack_preset"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| common | ||
| plugin | ||
| public | ||
| server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "name": "@kbn/interpreter", | ||
| "version": "1.0.0", | ||
| "license": "Apache-2.0", | ||
| "main": "./index.js", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can delete this! It was dead code left here. |
||
| "scripts": { | ||
| "build": "babel src --out-dir . --ignore 'src/plugin/**/*' && node tasks/build.js", | ||
| "canvas:peg": "pegjs common/lib/grammar.peg", | ||
| "kbn:bootstrap": "yarn build" | ||
| }, | ||
| "devDependencies": { | ||
| "@kbn/babel-preset": "1.0.0", | ||
| "babel-cli": "^6.26.0" | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
packages/kbn-interpreter/src/common/interpreter/create_error.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* | ||
| * Licensed to Elasticsearch B.V. under one or more contributor | ||
| * license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright | ||
| * ownership. Elasticsearch B.V. licenses this file to you under | ||
| * the Apache License, Version 2.0 (the "License"); you may | ||
| * not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| export const createError = err => ({ | ||
| type: 'error', | ||
| error: { | ||
| stack: process.env.NODE_ENV === 'production' ? undefined : err.stack, | ||
| message: typeof err === 'string' ? err : err.message, | ||
| }, | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| /* | ||
| * Licensed to Elasticsearch B.V. under one or more contributor | ||
| * license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright | ||
| * ownership. Elasticsearch B.V. licenses this file to you under | ||
| * the Apache License, Version 2.0 (the "License"); you may | ||
| * not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| import { includes } from 'lodash'; | ||
|
|
||
| export function Arg(config) { | ||
| if (config.name === '_') throw Error('Arg names must not be _. Use it in aliases instead.'); | ||
| this.name = config.name; | ||
| this.required = config.required || false; | ||
| this.help = config.help || ''; | ||
| this.types = config.types || []; | ||
| this.default = config.default; | ||
| this.aliases = config.aliases || []; | ||
| this.multi = config.multi == null ? false : config.multi; | ||
| this.resolve = config.resolve == null ? true : config.resolve; | ||
| this.options = config.options || []; | ||
| this.accepts = type => { | ||
| if (!this.types.length) return true; | ||
| return includes(config.types, type); | ||
| }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| /* | ||
| * Licensed to Elasticsearch B.V. under one or more contributor | ||
| * license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright | ||
| * ownership. Elasticsearch B.V. licenses this file to you under | ||
| * the Apache License, Version 2.0 (the "License"); you may | ||
| * not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| import { Arg } from './arg'; | ||
|
|
||
| describe('Arg', () => { | ||
| it('sets required to false by default', () => { | ||
| const isOptional = new Arg({ | ||
| name: 'optional_me', | ||
| }); | ||
| expect(isOptional.required).toBe(false); | ||
|
|
||
| const isRequired = new Arg({ | ||
| name: 'require_me', | ||
| required: true, | ||
| }); | ||
| expect(isRequired.required).toBe(true); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should ignore {common, plugin, public, server, src/common/lib/grammar.js}