DEVPROD-11621: Use subpath exports for lib#1338
Draft
sophstad wants to merge 8 commits intoevergreen-ci:mainfrom
Draft
DEVPROD-11621: Use subpath exports for lib#1338sophstad wants to merge 8 commits intoevergreen-ci:mainfrom
sophstad wants to merge 8 commits intoevergreen-ci:mainfrom
Conversation
- Phase 1: Fix intermediate barrels - utils/request: export streamedFetch, StreamedFetchOptions, post - utils/string: export trimSeverity, getSeverityMapping, mapLogLevelToColor from logs - utils/observability: export AttributeStore type - Phase 2: Add src/index.ts root barrel exporting all production code - Phase 3: test_utils barrel now exports types, snapshotSerializer, RenderFakeToastContext - Phase 4: Add package.json exports field for . and ./test_utils Consumers can use @evg-ui/lib and @evg-ui/lib/test_utils. Import migration (phase 5) is separate.
- Add subpath barrels: analytics, components, constants, context, hooks, types, utils - Remove root export (.) and delete src/index.ts - Export beta-features GQL from hooks only (useBetaFeatures) - Add usePagination to hooks barrel - Simplify package.json exports (shorthand, no "types" condition) Consumers must use subpaths, e.g. @evg-ui/lib/components, @evg-ui/lib/hooks.
- Update all fungi imports to subpaths (@evg-ui/lib/components, .constants, .test_utils) - Remove @evg-ui/lib/* from fungi tsconfig.compilerOptions.paths - In lib: add triple-slash reference to vite-env.d.ts from components and hooks barrels so consumers get .graphql/.svg declarations without per-app tsconfig include
…fig path - Update email import to @evg-ui/lib/utils (was utils/string) - Remove @evg-ui/lib/* from deploy-utils tsconfig.compilerOptions.paths - In lib: add vite-env.d.ts reference to utils barrel for Window.AttributeStore
- Update all @evg-ui/lib imports to use subpath barrels (components, hooks, utils, constants, analytics, types, test_utils) instead of deep paths - Convert default Icon/Accordion/Popconfirm/LoginPage etc. to named imports - Source GQL beta feature types and operations from @evg-ui/lib/hooks - Remove @evg-ui/lib/* path mapping from apps/parsley/tsconfig.json - Export WithToastContext from lib test_utils, TextInputWithGlyph from lib components for parsley Storybook and SearchBar - Consolidate duplicate imports and fix import order for eslint
- Use barrel imports (e.g. @evg-ui/lib/components, @evg-ui/lib/hooks) instead of deep paths; use named imports instead of default - Remove @evg-ui/lib/* path mapping from apps/spruce/tsconfig.json - Fix stray commas and duplicate test_utils imports in test files - Normalize multi-line imports (alphabetical, single statement per module) - Fix parsley sort-imports for staged lib imports
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.
DEVPROD-11621
Description
Although there are tons of files changed, this PR is very boring; it simply reorganizes the export/import patterns of
@evg-ui/lib. Doing so will allow us to more easily use absolute imports in lib since we no longer rely on tsconfig paths. I'll open a second PR since this is huge enough.@evg-ui/libfrom the tsconfig'scompilerOptions.pathsfield. These changes are visible in commits 2-6sideEffects: falsein lib's package.json to improve tree shaking