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

Remove src/test/* from type definitions file #3715

Merged
merged 7 commits into from
Jul 9, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
],
"dependencies": {
"@types/chroma-js": "^2.0.0",
"@types/enzyme": "^3.1.13",
"@types/lodash": "^4.14.116",
"@types/numeral": "^0.0.25",
"@types/react-beautiful-dnd": "^12.1.2",
Expand Down Expand Up @@ -91,6 +90,7 @@
"@svgr/core": "5.0.1",
"@svgr/plugin-svgo": "^4.0.3",
"@types/classnames": "^2.2.6",
"@types/enzyme": "^3.1.13",
"@types/highlight.js": "^9.12.3",
"@types/jest": "^24.0.6",
"@types/node": "^10.17.5",
Expand Down
21 changes: 21 additions & 0 deletions scripts/compile-eui.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,27 @@ function compileBundle() {
},
});

console.log('Building test utils .d.ts files...');
dtsGenerator({
name: '@elastic/eui/lib/test',
out: 'lib/test/index.d.ts',
baseDir: path.resolve(__dirname, '..', 'src/test/'),
files: ['index.ts'],
resolveModuleId({ currentModuleId }) {
return `@elastic/eui/lib/test${currentModuleId !== 'index' ? `/${currentModuleId}` : ''}`;
},
});
dtsGenerator({
name: '@elastic/eui/es/test',
out: 'es/test/index.d.ts',
baseDir: path.resolve(__dirname, '..', 'src/test/'),
files: ['index.ts'],
resolveModuleId({ currentModuleId }) {
return `@elastic/eui/es/test${currentModuleId !== 'index' ? `/${currentModuleId}` : ''}`;
},
});
console.log(chalk.green('✔ Finished test utils files'));

console.log('Building chart theme module...');
execSync(
'webpack src/themes/charts/themes.ts -o dist/eui_charts_theme.js --output-library-target="commonjs" --config=src/webpack.config.js',
Expand Down
1 change: 1 addition & 0 deletions scripts/dtsgenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const generator = dtsGenerator({
'**/*.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
],
resolveModuleId(params) {
if (
Expand Down