Skip to content

Commit

Permalink
Revert "Remove unused chart theme code (opensearch-project#657)"
Browse files Browse the repository at this point in the history
This reverts commit e9a63af.
  • Loading branch information
AMoo-Miki committed Jun 29, 2023
1 parent a938432 commit 4708c40
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 0 deletions.
49 changes: 49 additions & 0 deletions scripts/compile-oui.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,55 @@ function compileBundle() {
}
});
console.log(chalk.green('✔ Finished test utils files'));

console.log('Building chart theme module...');
execSync(
'webpack src/themes/charts/themes.ts -o dist/oui_charts_theme.js --output-library-target="commonjs" --config=src/webpack.config.js',
{
stdio: 'inherit',
}
);
dtsGenerator({
prefix: '',
out: 'dist/oui_charts_theme.d.ts',
baseDir: path.resolve(__dirname, '..', 'src/themes/charts/'),
files: ['themes.ts'],
resolveModuleId() {
return '@opensearch-project/oui/dist/oui_charts_theme';
},
resolveModuleImport(params) {
if (params.importedModuleId === '../../components/common') {
return '@opensearch-project/oui/src/components/common';
}
return null;
}
});

/* OUI -> EUI Aliases */
execSync(
'webpack src/themes/charts/themes.ts -o dist/eui_charts_theme.js --output-library-target="commonjs" --config=src/webpack.config.js',
{
stdio: 'inherit',
}
);
dtsGenerator({
prefix: '',
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';
},
resolveModuleImport(params) {
if (params.importedModuleId === '../../components/common') {
return '@elastic/eui/src/components/common';
}
return null;
}
});
/* End of Aliases */

console.log(chalk.green('✔ Finished chart theme module'));
}

/* OUI -> EUI Aliases */
Expand Down
1 change: 1 addition & 0 deletions scripts/dtsgenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const generator = dtsGenerator({
'**/*.test.tsx',
'**/*.testenv.ts',
'**/*.testenv.tsx',
'src/themes/charts/*', // A separate d.ts file is generated for the charts theme file
'src/test/*', // A separate d.ts file is generated for test utils
'src-docs/**/*', // Don't include src-docs
],
Expand Down
1 change: 1 addition & 0 deletions src-docs/src/theme_dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@

// Elastic charts
@import '~@elastic/charts/dist/theme';
@import '../../src/themes/charts/theme';
1 change: 1 addition & 0 deletions src-docs/src/theme_light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@

// Elastic charts
@import '~@elastic/charts/dist/theme';
@import '../../src/themes/charts/theme';
1 change: 1 addition & 0 deletions src-docs/src/theme_next_dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@

// Elastic charts
@import '~@elastic/charts/dist/theme';
@import '../../src/themes/charts/theme';
1 change: 1 addition & 0 deletions src-docs/src/theme_next_light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@

// Elastic charts
@import '~@elastic/charts/dist/theme';
@import '../../src/themes/charts/theme';

0 comments on commit 4708c40

Please sign in to comment.