Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
3d2b2986
Commit
3d2b2986
authored
Dec 16, 2021
by
indeavr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Slight improvement to the console output
parent
23920658
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
15 deletions
+17
-15
package.json
packages/contracts/package.json
+4
-2
validate-output.ts
packages/contracts/tasks/validate-output.ts
+13
-13
No files found.
packages/contracts/package.json
View file @
3d2b2986
...
...
@@ -42,7 +42,8 @@
"postpublish"
:
"rimraf chugsplash L1 L2 libraries standards"
,
"prepack"
:
"yarn prepublishOnly"
,
"postpack"
:
"yarn postpublish"
,
"pre-commit"
:
"lint-staged"
"pre-commit"
:
"lint-staged"
,
"docify"
:
"ts-node scripts/generate-docs.ts"
},
"keywords"
:
[
"optimism"
,
...
...
@@ -62,7 +63,8 @@
"@ethersproject/abstract-provider"
:
"^5.4.1"
,
"@ethersproject/abstract-signer"
:
"^5.4.1"
,
"@ethersproject/hardware-wallets"
:
"^5.4.0"
,
"@primitivefi/hardhat-dodoc"
:
"^0.1.3"
"@primitivefi/hardhat-dodoc"
:
"^0.1.3"
,
"chalk"
:
"^4.1.2"
},
"devDependencies"
:
{
"@codechecks/client"
:
"^0.1.11"
,
...
...
packages/contracts/tasks/validate-output.ts
View file @
3d2b2986
...
...
@@ -2,6 +2,7 @@
import
{
task
}
from
'
hardhat/config
'
import
{
CompilerOutputContractWithDocumentation
}
from
'
@primitivefi/hardhat-dodoc/dist/src/dodocTypes
'
import
{
TASK_COMPILE
}
from
'
hardhat/builtin-tasks/task-names
'
import
chalk
from
"
chalk
"
;
// import { CompilerOutputContractWithDocumentation, Doc } from './dodocTypes';
// import { decodeAbi } from './abiDecoder';
...
...
@@ -63,7 +64,7 @@ const setupErrors =
}
}
return
`Error
in
${
fileName
}
at path:
${
fileSource
}
\n --->
${
typeToMessage
()}
`
return
`Error
:
${
typeToMessage
()}
\n @
${
fileName
}
\n -->
${
fileSource
}
\n
`
}
type
CompilerOutputWithDocsAndPath
=
CompilerOutputContractWithDocumentation
&
{
...
...
@@ -88,16 +89,7 @@ task(TASK_COMPILE, async (args, hre, runSuper) => {
// return;
// }
console
.
log
(
'
<<< Starting Output Checks >>>
'
)
const
allContracts
=
await
hre
.
artifacts
.
getAllFullyQualifiedNames
()
// console.log("allContracts", allContracts);
const
qualifiedNames
=
allContracts
.
filter
((
str
)
=>
str
.
startsWith
(
'
contracts
'
)
)
console
.
log
(
'
qualifiedNames
'
,
qualifiedNames
)
// Loops through all the qualified names to get all the compiled contracts
const
getBuildInfo
=
async
(
qualifiedName
:
string
):
Promise
<
CompilerOutputWithDocsAndPath
|
undefined
>
=>
{
...
...
@@ -217,6 +209,15 @@ task(TASK_COMPILE, async (args, hre, runSuper) => {
return
foundErrors
}
console
.
log
(
'
<<< Starting Output Checks >>>
'
)
const
allContracts
=
await
hre
.
artifacts
.
getAllFullyQualifiedNames
()
// console.log("allContracts", allContracts);
const
qualifiedNames
=
allContracts
.
filter
((
str
)
=>
str
.
startsWith
(
'
contracts
'
)
)
console
.
log
(
'
qualifiedNames
'
,
qualifiedNames
)
// 1. Setup
const
buildInfo
:
CompilerOutputWithDocsAndPath
[]
=
(
await
Promise
.
all
(
qualifiedNames
.
map
(
getBuildInfo
))
...
...
@@ -225,7 +226,6 @@ task(TASK_COMPILE, async (args, hre, runSuper) => {
// 2. Check
const
errors
=
buildInfo
.
reduce
((
foundErrors
,
info
)
=>
{
const
docErrors
=
checkForErrors
(
info
)
console
.
log
(
'
DOC ERRORS:
'
,
docErrors
)
if
(
docErrors
&&
docErrors
.
length
>
0
)
{
foundErrors
[
info
.
filePath
]
=
docErrors
...
...
@@ -242,9 +242,9 @@ task(TASK_COMPILE, async (args, hre, runSuper) => {
if
(
errorsInfo
&&
errorsInfo
.
length
>
0
)
{
;(
errorsInfo
as
ErrorInfo
[]).
forEach
((
erIn
)
=>
{
if
((
level
===
'
error
'
))
{
console
.
error
(
erIn
.
text
)
console
.
error
(
chalk
.
red
(
erIn
.
text
)
)
}
else
{
console
.
warn
(
erIn
.
text
)
console
.
warn
(
chalk
.
yellow
(
erIn
.
text
)
)
}
})
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment