-
-
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.
♻️ chore(config): Convert to jsdoc explicit exports (#589)
## Description Converts @evmts/config to js with jsdoc. Makes public exports explicit Addresses #586 Addresses #517 ## 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
5b8dab6
commit 32c7f25
Showing
16 changed files
with
129 additions
and
166 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,5 @@ | ||
--- | ||
"@evmts/config": patch | ||
--- | ||
|
||
Converted @evmts/config to js with jsdoc and explicit exports |
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,21 @@ | ||
import { getDefaultSolcVersion } from './getDefaultSolcVersion.js' | ||
import { z } from 'zod' | ||
|
||
export const CompilerConfigValidator = z | ||
.strictObject({ | ||
name: z.literal('@evmts/ts-plugin').optional(), | ||
solcVersion: z.string().optional(), | ||
foundryProject: z.union([z.boolean(), z.string()]).optional(), | ||
libs: z.array(z.string()).optional(), | ||
remappings: z.record(z.string()).optional(), | ||
}) | ||
.describe('Configuration for EVMts') | ||
|
||
export const defaultConfig = { | ||
get solcVersion() { | ||
return getDefaultSolcVersion() | ||
}, | ||
foundryProject: false, | ||
remappings: {}, | ||
libs: [], | ||
} |
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,23 @@ | ||
import { constants } from 'fs' | ||
import { access } from 'fs/promises' | ||
|
||
/** | ||
* Checks if a file exists at the given path | ||
* @param {string} path - path to check | ||
* @returns {Promise<boolean>} true if the file exists, false otherwise | ||
* @example | ||
* ```typescript | ||
* import { fileExists } from '@eth-optimism/config' | ||
* await fileExists('./someFile.txt') | ||
* ``` | ||
*/ | ||
export const fileExists = async (path) => { | ||
try { | ||
// TODO not the most robust check for existence here | ||
await access(path, constants.F_OK) | ||
return true | ||
} catch (e) { | ||
// TODO should be inspecting the error here | ||
return false | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
config/src/getDefaultSolcVersion.ts → config/src/getDefaultSolcVersion.js
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,9 @@ | ||
/** | ||
* @typedef {import('./types.js').CompilerConfig} CompilerConfig | ||
* @typedef {import('./types.js').ResolvedCompilerConfig} ResolvedCompilerConfig | ||
*/ | ||
|
||
export { defaultConfig } from './Config.js' | ||
export { loadConfig } from './loadConfig.js' | ||
export { loadConfigAsync } from './loadConfigAsync.js' | ||
export { defineConfig } from './defineConfig.js' |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.
32c7f25
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-docs-evmts.vercel.app
evmts.dev
evmts-docs-git-main-evmts.vercel.app