diff --git a/CHANGELOG.md b/CHANGELOG.md index d94b270350e..cea4cdffe20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## [`master`](https://github.com/elastic/eui/tree/master) -No public interface changes since `27.0.0`. +- Removed `src/test` and `@types/enzyme` references from `eui.d.ts` ([#3715](https://github.com/elastic/eui/pull/3715)) +- Added `index.d.ts` file to `lib/test` and `es/test` ([#3715](https://github.com/elastic/eui/pull/3715)) ## [`27.0.0`](https://github.com/elastic/eui/tree/v27.0.0) - Added `paddingSize` prop to `EuiCard` ([#3638](https://github.com/elastic/eui/pull/3638)) @@ -23,7 +24,7 @@ No public interface changes since `27.0.0`. - Added `listId` to `EuiSelectableSearch` - `options` passed into `EuiSelectable` cannot have an `id` - Requires an `onChange` to be passed into `EuiSelectableSearch` - + ## [`26.3.1`](https://github.com/elastic/eui/tree/v26.3.1) **Note: this release is a backport containing changes originally made in `27.0.0`** diff --git a/package.json b/package.json index bacd482abf5..f31ab9419d5 100644 --- a/package.json +++ b/package.json @@ -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", @@ -93,6 +92,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", diff --git a/scripts/compile-eui.js b/scripts/compile-eui.js index c48fddefbc2..0fbee381674 100755 --- a/scripts/compile-eui.js +++ b/scripts/compile-eui.js @@ -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', diff --git a/scripts/dtsgenerator.js b/scripts/dtsgenerator.js index cbf0771f9a6..48ee9deff7b 100644 --- a/scripts/dtsgenerator.js +++ b/scripts/dtsgenerator.js @@ -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 (