Skip to content

Commit

Permalink
Fix shareable_runtime and storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
Corey Robertson committed May 5, 2020
1 parent 6f3d94a commit 3996dd5
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/canvas/.storybook/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function loadStories() {
// Only gather and require CSS files related to Canvas. The other CSS files
// are built into the DLL.
const css = require.context(
'../../../../../built_assets/css',
'../../../../built_assets/css',
true,
/plugins\/(?=canvas).*light\.css/
);
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/canvas/.storybook/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
const path = require('path');

const DLL_NAME = 'canvas_storybook_dll';
const KIBANA_ROOT = path.resolve(__dirname, '../../../../..');
const KIBANA_ROOT = path.resolve(__dirname, '../../../..');
const BUILT_ASSETS = path.resolve(KIBANA_ROOT, 'built_assets');
const DLL_OUTPUT = path.resolve(BUILT_ASSETS, DLL_NAME);

Expand Down
10 changes: 3 additions & 7 deletions x-pack/plugins/canvas/.storybook/dll_contexts.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// Pull in the built CSS produced by the Kibana server, but not
// the Canvas CSS-- we want that in the HMR service.
const css = require.context(
'../../../../../built_assets/css',
'../../../../built_assets/css',
true,
/\.\/plugins\/(?!canvas).*light\.css/
);
Expand All @@ -21,15 +21,11 @@ css.keys().forEach(filename => {

// Include Legacy styles
const uiStyles = require.context(
'../../../../../src/legacy/ui/public/styles',
'../../../../src/legacy/ui/public/styles',
false,
/[\/\\](?!mixins|variables|_|\.|bootstrap_(light|dark))[^\/\\]+\.less/
);
uiStyles.keys().forEach(key => uiStyles(key));

const json = require.context(
'../shareable_runtime/test/workpads',
false,
/\.json$/
);
const json = require.context('../shareable_runtime/test/workpads', false, /\.json$/);
json.keys().forEach(key => json(key));
6 changes: 3 additions & 3 deletions x-pack/plugins/canvas/scripts/storybook.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ run(

// Ensure SASS dependencies have been built before doing anything.
execa.sync(process.execPath, ['scripts/build_sass'], {
cwd: path.resolve(__dirname, '../../../../..'),
cwd: path.resolve(__dirname, '../../../..'),
...options,
});

Expand All @@ -58,7 +58,7 @@ run(
'false',
],
{
cwd: path.resolve(__dirname, '../../../../..'),
cwd: path.resolve(__dirname, '../../../..'),
stdio: ['ignore', 'inherit', 'inherit'],
buffer: false,
}
Expand Down Expand Up @@ -96,7 +96,7 @@ run(

// Watch the SASS sheets for changes
execa(process.execPath, ['scripts/build_sass', '--watch'], {
cwd: path.resolve(__dirname, '../../../../..'),
cwd: path.resolve(__dirname, '../../../..'),
...options,
});

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/canvas/shareable_runtime/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
const path = require('path');
const { LIBRARY_NAME, SHAREABLE_RUNTIME_NAME } = require('./constants_static');

const KIBANA_ROOT_PATH = '../../../../..';
const KIBANA_ROOT_PATH = '../../../..';
const CANVAS_ROOT_PATH = 'x-pack/plugins/canvas';
const SHAREABLE_RUNTIME_PATH = 'shareable_runtime';
const SHAREABLE_RUNTIME_OUTPUT_PATH = 'shareable_runtime/build';
Expand Down
6 changes: 3 additions & 3 deletions x-pack/plugins/canvas/shareable_runtime/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
*/

export * from './api';
import '../../../../../built_assets/css/plugins/kibana/index.light.css';
import '../../../../built_assets/css/plugins/kibana/index.light.css';
import '../public/style/index.scss';
import '@elastic/eui/dist/eui_theme_light.css';
import '@kbn/ui-framework/dist/kui_light.css';

const css = require.context(
'../../../../../built_assets/css',
'../../../../built_assets/css',
true,
/\.\/plugins\/(?!canvas).*light\.css/
);
Expand All @@ -20,7 +20,7 @@ css.keys().forEach(filename => {
});

const uiStyles = require.context(
'../../../../../src/legacy/ui/public/styles',
'../../../../src/legacy/ui/public/styles',
false,
/[\/\\](?!mixins|variables|_|\.|bootstrap_(light|dark))[^\/\\]+\.less/
);
Expand Down

0 comments on commit 3996dd5

Please sign in to comment.