Skip to content

Commit

Permalink
dist/eui_charts_theme should be .js (elastic#2294)
Browse files Browse the repository at this point in the history
* output should be js

* generate .d.ts file

* CL
  • Loading branch information
thompsongl committed Sep 10, 2019
1 parent bf5f997 commit 81fadfe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Removed extra right side margin in `EuiSuperDatePicker` ([#2236](https://github.com/elastic/eui/pull/2236))
- Fixed incorrect `onClick` type for `EuiButtonEmpty` ([#2282](https://github.com/elastic/eui/pull/2282))
- Fixed compilation script to remove all TypeScript definition exports from built JS assets ([#2279](https://github.com/elastic/eui/pull/2279))
- Fixed output extension for `dist` charts theme module ([#2294](https://github.com/elastic/eui/pull/2294))

## [`13.7.0`](https://github.com/elastic/eui/tree/v13.7.0)

Expand Down
15 changes: 13 additions & 2 deletions scripts/compile-eui.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const chalk = require('chalk');
const shell = require('shelljs');
const path = require('path');
const glob = require('glob');
const dtsGenerator = require('dts-generator').default;

function compileLib() {
shell.mkdir(
Expand Down Expand Up @@ -43,7 +44,7 @@ function compileLib() {
stdio: 'inherit',
});
// validate the generated eui.d.ts doesn't contain errors
execSync(`tsc --noEmit -p tsconfig-builttypes.json`, { stdio: 'inherit' });
execSync('tsc --noEmit -p tsconfig-builttypes.json', { stdio: 'inherit' });
console.log(chalk.green('✔ Finished generating definitions'));

// Also copy over SVGs. Babel has a --copy-files option but that brings over
Expand Down Expand Up @@ -74,11 +75,21 @@ function compileBundle() {

console.log('Building chart theme module...');
execSync(
'webpack src/themes/charts/themes.ts -o dist/eui_charts_theme.ts --output-library-target="commonjs" --config=src/webpack.config.js',
'webpack src/themes/charts/themes.ts -o dist/eui_charts_theme.js --output-library-target="commonjs" --config=src/webpack.config.js',
{
stdio: 'inherit',
}
);
dtsGenerator({
name: '@elastic/eui/dist/eui_charts_theme',
out: 'dist/eui_charts_theme.d.ts',
baseDir: path.resolve(__dirname, '..', 'src/themes/charts/'),
files: ['themes.ts'],
resolveModuleId() {
return '@elastic/eui/dist/eui_charts_theme';
}
});
console.log(chalk.green('✔ Finished chart theme module'));
}

compileLib();
Expand Down

0 comments on commit 81fadfe

Please sign in to comment.