Skip to content
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

[WIP] [Lens] Expression rendering #36985

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
6d6f304
add nativerenderer component
flash1293 May 7, 2019
44894df
use native renderer in app and editor frame
flash1293 May 7, 2019
943fca8
remove prop types
flash1293 May 7, 2019
731e264
add unit test and fix linting issues
flash1293 May 8, 2019
cc1a0db
rename test suite
flash1293 May 8, 2019
18f9d83
rename prop and adjust shallow comparison function
flash1293 May 9, 2019
60cd891
add documentation
flash1293 May 9, 2019
0eb1f31
move native renderer to top level directory
flash1293 May 9, 2019
0f652c3
Merge remote-tracking branch 'upstream/feature/lens' into lens/native…
flash1293 May 10, 2019
a21b0ea
add test, fix linting error and improve shallow equal comparison
flash1293 May 10, 2019
34e9328
Merge remote-tracking branch 'upstream/feature/lens' into lens/native…
flash1293 May 10, 2019
b124f88
Merge branch 'feature/lens' into lens/native-renderer
flash1293 May 10, 2019
36de942
Implement basic editor frame state handling
wylieconlon May 3, 2019
7445372
Merge remote-tracking branch 'upstream/feature/lens' into lens/native…
flash1293 May 10, 2019
0395e9a
Merge branch 'feature/lens' into lens/editor-state
flash1293 May 10, 2019
8147aaa
fix linting errors
flash1293 May 10, 2019
4baf6b1
fix native renderer tests
flash1293 May 10, 2019
d33576e
Merge branch 'lens/native-renderer' into lens/editor-state
flash1293 May 10, 2019
033a632
re structure editor frame
flash1293 May 10, 2019
345e20f
fix tests
flash1293 May 10, 2019
48203dd
move layout to a separate component
flash1293 May 10, 2019
aa43ef3
chore(NA): add transpile with babel the typescript files on xpack whe…
mistic May 10, 2019
dece47f
Merge remote-tracking branch 'upstream/feature/lens' into lens/native…
flash1293 May 12, 2019
7469315
Merge branch 'lens/native-renderer' into lens/editor-state
flash1293 May 12, 2019
ee6fdbc
clean up and improve typings
flash1293 May 12, 2019
396cf1c
add tests for plugin itself
flash1293 May 12, 2019
5a21a43
Merge branch 'feature/lens' into lens/native-renderer
flash1293 May 12, 2019
c383c3e
Merge branch 'lens/native-renderer' into lens/editor-state
flash1293 May 12, 2019
6f8c295
start implementing suggestion control flow
flash1293 May 12, 2019
b61008c
refactor control flow and add visualization switch action dispatch
flash1293 May 12, 2019
cae9fe0
move mock builder into separate file and fix tests
flash1293 May 12, 2019
3f48c98
remove unused import
flash1293 May 13, 2019
7cdea68
add tests for suggestions
flash1293 May 13, 2019
d63d2f9
correct typo
flash1293 May 13, 2019
52cad4f
rework suggestion stuff
flash1293 May 14, 2019
d776b54
Merge branch 'feature/lens' into lens/editor-state
flash1293 May 20, 2019
3221830
Merge branch 'lens/editor-state' into lens/editor-state-2
flash1293 May 20, 2019
f05024b
resolve conflicts
flash1293 May 20, 2019
1c24cb5
Merge branch 'lens/editor-state' into lens/editor-state-2
flash1293 May 20, 2019
bc0c85a
start implementing drop fiel control flow
flash1293 May 20, 2019
fe1356e
Merge branch 'feature/lens' into lens/editor-state
flash1293 May 21, 2019
a562914
Merge branch 'feature/lens' into lens/editor-state
flash1293 May 21, 2019
3d055ee
adress review and restructure state
flash1293 May 21, 2019
7c3a2c8
align naming
flash1293 May 21, 2019
849f3a1
add comment
flash1293 May 21, 2019
ff5092b
Merge branch 'lens/editor-state' into lens/editor-state-2
flash1293 May 21, 2019
7540916
fix merge conflict
flash1293 May 21, 2019
97714c3
chore(NA): merge and solve conflicts with master.
mistic May 21, 2019
7b8c21a
refactor and add tests
flash1293 May 21, 2019
0c721a7
more refactoring
flash1293 May 21, 2019
21c8756
only save single visualization state
flash1293 May 21, 2019
b31032b
Merge branch 'lens/editor-state' into lens/editor-state-2
flash1293 May 21, 2019
fc47428
add comment
flash1293 May 21, 2019
370a6cc
chore(NA): fix the globs for public folders inside server paths
mistic May 21, 2019
a651377
docs(NA): add comments to explain globs.
mistic May 21, 2019
cd1fe8f
Merge branch 'master' into typescript-with-babel7-for-kbn-plugin-helpers
mistic May 21, 2019
eb8f2e8
start adding tests for suggestion helpers and improve mock typing
flash1293 May 21, 2019
b9ad51c
chore(NA): use pipeline instead of async pipeline promise from dev ut…
mistic May 21, 2019
878b695
chore(NA): merge and solve conflicts with master
mistic May 21, 2019
22f8278
chore(NA): apply documented way to use stream pipeline.
mistic May 21, 2019
e0be753
improve getSuggestions tests
flash1293 May 22, 2019
e464ce2
add i18n
flash1293 May 22, 2019
7f1d66d
use jest types
flash1293 May 22, 2019
0bfb2d3
Merge remote-tracking branch 'upstream/feature/lens' into lens/editor…
flash1293 May 22, 2019
3c74514
start work on expression executor service
flash1293 May 22, 2019
f687d3f
Merge branch 'master' into typescript-with-babel7-for-kbn-plugin-helpers
mistic May 22, 2019
af85958
add react component encapsulating the same thing
flash1293 May 22, 2019
ce2b313
Merge branch 'master' into typescript-with-babel7-for-kbn-plugin-helpers
mistic May 22, 2019
202c812
chore(NA): exclude test files from the build transpilation.
mistic May 22, 2019
0e6fd91
Merge branch 'feature/lens' into lens/editor-state-2
flash1293 May 23, 2019
935b008
add tests and improve typings and docs
flash1293 May 23, 2019
0d99f0a
add experimental notice
flash1293 May 23, 2019
ec93e44
Merge branch 'expression-executor-service' into lens/expression-rende…
flash1293 May 23, 2019
48017dd
start integration expression executor into lens
flash1293 May 23, 2019
37a6d55
add expression executor to data plugin setup type
flash1293 May 23, 2019
483efd7
Merge branch 'expression-executor-service' into lens/expression-rende…
flash1293 May 23, 2019
28f333a
Merge branch 'lens/editor-state-2' into lens/expression-rendering
flash1293 May 23, 2019
d60481b
introduce expression renderer in lens
flash1293 May 23, 2019
7aa8eb3
Merge remote-tracking branch 'mistic/typescript-with-babel7-for-kbn-p…
flash1293 May 23, 2019
895794d
switch to relative imports
flash1293 May 23, 2019
959051c
Merge branch 'feature/lens' into lens/expression-rendering
flash1293 May 24, 2019
8a8d5a0
adjust tests and types
flash1293 May 24, 2019
d5557d7
chore(NA): merge and solve conflicts with master.
mistic May 31, 2019
a2e1032
chore(NA): add ignore for eslint complexity warning
mistic May 31, 2019
5a0ab52
chore(na): fix bad added type files.
mistic May 31, 2019
1bb1d50
chore(NA): merge and solve conflicts with master.
mistic May 31, 2019
3512804
fix(NA): unused type exports
mistic May 31, 2019
aef883d
Merge branch 'feature/lens' into lens/expression-rendering
flash1293 May 31, 2019
94e0062
Merge remote-tracking branch 'mistic/typescript-with-babel7-for-kbn-p…
flash1293 May 31, 2019
9a3b6d6
resolve merge conflicts and fix typing problem
flash1293 May 31, 2019
87cc139
fix tests
flash1293 May 31, 2019
d257d4d
Merge remote-tracking branch 'upstream/master' into lens/expression-r…
flash1293 May 31, 2019
53cea69
fix tests
flash1293 May 31, 2019
440b4a6
Merge branch 'feature/lens' into lens/expression-rendering
flash1293 May 31, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/kbn-plugin-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
"author": "Spencer Alger <email@spalger.com>",
"license": "Apache-2.0",
"dependencies": {
"@babel/core": "^7.4.4",
"@kbn/babel-preset": "1.0.0",
"argv-split": "^2.0.1",
"commander": "^2.9.0",
"del": "^4.0.0",
"execa": "^1.0.0",
"gulp-rename": "1.4.0",
"globby": "^8.0.1",
"gulp-babel": "^8.0.0",
"gulp-rename": "1.4.0",
"gulp-zip": "4.1.0",
"inquirer": "^1.2.2",
"minimatch": "^3.0.4",
Expand Down
56 changes: 44 additions & 12 deletions packages/kbn-plugin-helpers/tasks/build/create_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@ const vfs = require('vinyl-fs');
const rename = require('gulp-rename');
const through = require('through2');
const minimatch = require('minimatch');
const gulpBabel = require('gulp-babel');
const { promisify } = require('util');
const { pipeline } = require('stream');

const rewritePackageJson = require('./rewrite_package_json');
const winCmd = require('../../lib/win_cmd');

const asyncPipeline = promisify(pipeline);

// `link:` dependencies create symlinks, but we don't want to include symlinks
// in the built zip file. Therefore we remove all symlinked dependencies, so we
// can re-create them when installing the plugin.
Expand Down Expand Up @@ -65,6 +70,31 @@ function parseTsconfig(pluginSourcePath, configPath) {
return config;
}

// transpile with babel
async function transpileWithBabel(srcGlobs, buildRoot, presets) {
await asyncPipeline(
vfs.src(
srcGlobs.concat([
'!**/*.d.ts',
'!**/*.{test,test.mocks,mock,mocks}.{ts,tsx}',
'!**/node_modules/**',
'!**/bower_components/**',
'!**/__tests__/**',
]),
{
cwd: buildRoot,
}
),

gulpBabel({
babelrc: false,
presets,
}),

vfs.dest(buildRoot)
);
}

module.exports = function createBuild(plugin, buildTarget, buildVersion, kibanaVersion, files) {
const buildSource = plugin.root;
const buildRoot = path.join(buildTarget, 'kibana', plugin.id);
Expand Down Expand Up @@ -122,19 +152,13 @@ module.exports = function createBuild(plugin, buildTarget, buildVersion, kibanaV

del.sync([path.join(buildRoot, '**', '*.s{a,c}ss')]);
})
.then(function() {
.then(async function() {
const buildConfigPath = path.join(buildRoot, 'tsconfig.json');

if (!existsSync(buildConfigPath)) {
return;
}

if (!plugin.pkg.devDependencies.typescript) {
throw new Error(
'Found tsconfig.json file in plugin but typescript is not a devDependency.'
);
}

// attempt to patch the extends path in the tsconfig file
const buildConfig = parseTsconfig(buildSource, buildConfigPath);

Expand All @@ -144,11 +168,19 @@ module.exports = function createBuild(plugin, buildTarget, buildVersion, kibanaV
writeFileSync(buildConfigPath, JSON.stringify(buildConfig));
}

execa.sync(
path.join(buildSource, 'node_modules', '.bin', winCmd('tsc')),
['--pretty', 'true'],
{ cwd: buildRoot }
);
// Transpile ts server code
//
// Include everything except content from public folders
await transpileWithBabel(['**/*.{ts,tsx}', '!**/public/**'], buildRoot, [
require.resolve('@kbn/babel-preset/node_preset'),
]);

// Transpile ts client code
//
// Include everything inside a public directory
await transpileWithBabel(['**/public/**/*.{ts,tsx}'], buildRoot, [
require.resolve('@kbn/babel-preset/webpack_preset'),
]);

del.sync([
path.join(buildRoot, '**', '*.{ts,tsx,d.ts}'),
Expand Down
Loading