-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⚡ feat: Make config loading in bundlers async (#469)
## Description Improve startup time peformance by loading configs async ## Testing Explain the quality checks that have been done on the code changes ## Additional Information - [ ] I read the [contributing docs](../docs/contributing.md) (if this is your first contribution) Your ENS/address: --------- Co-authored-by: Will Cory <[email protected]>
- Loading branch information
1 parent
e99fcd0
commit dbc2da6
Showing
15 changed files
with
516 additions
and
85 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
"@evmts/bundler": patch | ||
"@evmts/bun-plugin": patch | ||
"@evmts/config": patch | ||
"@evmts/esbuild-plugin": patch | ||
"@evmts/rollup-plugin": patch | ||
"@evmts/rspack-plugin": patch | ||
"@evmts/vite-plugin": patch | ||
"@evmts/webpack-plugin": patch | ||
--- | ||
|
||
Made @evmts/config loading async |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { fileExists } from './fileExists' | ||
import { constants } from 'fs' | ||
import { access } from 'fs/promises' | ||
import { type Mock, afterEach, describe, expect, it, vi } from 'vitest' | ||
|
||
vi.mock('fs/promises') | ||
|
||
describe('fileExists', () => { | ||
afterEach(() => { | ||
vi.clearAllMocks() | ||
}) | ||
|
||
const accessMock = access as Mock | ||
it('should return true if the file exists', async () => { | ||
accessMock.mockResolvedValueOnce(undefined) | ||
const result = await fileExists('path-to-existing-file.txt') | ||
expect(result).toBe(true) | ||
expect(access).toHaveBeenCalledWith( | ||
'path-to-existing-file.txt', | ||
constants.F_OK, | ||
) | ||
}) | ||
|
||
it('should return false if the file does not exist', async () => { | ||
const mockError = new Error('File does not exist') | ||
accessMock.mockRejectedValueOnce(mockError) | ||
const result = await fileExists('path-to-non-existing-file.txt') | ||
expect(result).toBe(false) | ||
expect(access).toHaveBeenCalledWith( | ||
'path-to-non-existing-file.txt', | ||
constants.F_OK, | ||
) | ||
}) | ||
}) |
Oops, something went wrong.
dbc2da6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
evmts-docs – ./
evmts.dev
evmts-docs-evmts.vercel.app
evmts-docs-git-main-evmts.vercel.app