Validate eui.d.ts after generating during build#1366
Merged
chandlerprall merged 2 commits intoelastic:masterfrom Dec 12, 2018
Merged
Validate eui.d.ts after generating during build#1366chandlerprall merged 2 commits intoelastic:masterfrom
chandlerprall merged 2 commits intoelastic:masterfrom
Conversation
chandlerprall
commented
Dec 11, 2018
| // Use `tsc` to emit typescript declaration files for .ts files | ||
| console.log('Generating typescript definitions file'); | ||
| execSync(`node ${path.resolve(__dirname, 'dtsgenerator.js')}`); | ||
| execSync(`node ${path.resolve(__dirname, 'dtsgenerator.js')}`, { stdio: 'inherit' }); |
Contributor
Author
There was a problem hiding this comment.
added stdio: 'inherit' here to give more visibility if any errors occur
chandlerprall
commented
Dec 11, 2018
| // the import target is a `.d.ts` file which means it is hand-crafted and already added to the right places, don't modify | ||
| return path.join('@elastic/eui', params.importedModuleId); | ||
| } else if (isModuleIndex) { | ||
| if (isModuleIndex) { |
Contributor
Author
There was a problem hiding this comment.
the fs.existsSync(importTargetDTs) was actually never hit, removed it
chandlerprall
commented
Dec 11, 2018
|
|
||
| // if importing an `index` file | ||
| const isModuleIndex = path.basename(params.importedModuleId) === 'index'; | ||
| let isModuleIndex = false; |
Contributor
Author
There was a problem hiding this comment.
our structure of
icon/
index.ts
icon.tsx
means that index.ts should import from icon and export into @elastic/eui, but anything pointing to icon or icon/index should import from @elastic/eui (as the index file's exports target that namespace). Previously, this only worked correctly for import { IconType } from '../icon/index' and this change adds support for import { IconType } from '../icon'
pugnascotia
approved these changes
Dec 12, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a step to
yarn buildthat validates the generated eui.d.ts file. This is prevent future regressions similar to #1359Checklist
- [ ] This was checked in mobile- [ ] This was checked in IE11- [ ] This was checked in dark mode- [ ] Any props added have proper autodocs- [ ] Documentation examples were added- [ ] A changelog entry exists and is marked appropriately- [ ] This was checked for breaking changes and labeled appropriately- [ ] Jest tests were updated or added to match the most common scenarios- [ ] This was checked against keyboard-only and screenreader scenarios- [ ] This required updates to Framer X components