-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore default solidity contract tests when using extensions #158
Conversation
Ohh just noticed an error while doing : yarn cli ../test-erc-20 -s hardhat -e erc-20 I get the below error: Error formatting because `No matches found: "./test/**/*.ts"`create-eth on ignore-contract-tests-extensions [$] is 📦 v0.0.61 via v22.11.0
❯ yarn cli ../test-erc-20 -s hardhat -e erc-20
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Create Scaffold-ETH 2 app |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
✔ 📁 Create project directory /Users/shivbhonde/Desktop/github/test-erc-20
✔ 🚀 Creating a new Scaffold-ETH 2 app in ../test-erc-20 with the scaffold-eth/create-eth-extensions:erc-20 extension
✔ 📦 Installing dependencies with yarn, this could take a while
✖ Failed to create directory
◼ 📡 Initializing Git repository
ERROR Error occurred Error: Failed to create directory
at prettierFormat (file:///Users/shivbhonde/Desktop/github/create-eth/dist/cli.js:538:15)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Task.run (file:///Users/shivbhonde/Desktop/github/create-eth/node_modules/listr2/dist/index.js:2056:11) {
[cause]: Error: Command failed with exit code 1: yarn format
No matches found: "./test/**/*.ts"
.eslintrc.json 14ms (unchanged)
.prettierrc.js 9ms
app/blockexplorer/_components/AddressCodeTab.tsx 15ms (unchanged)
app/blockexplorer/_components/AddressComponent.tsx 8ms (unchanged)
app/blockexplorer/_components/AddressLogsTab.tsx 5ms (unchanged)
app/blockexplorer/_components/AddressStorageTab.tsx 10ms (unchanged)
app/blockexplorer/_components/BackButton.tsx 2ms (unchanged)
app/blockexplorer/_components/ContractTabs.tsx 11ms (unchanged)
app/blockexplorer/_components/index.tsx 1ms (unchanged)
app/blockexplorer/_components/PaginationButton.tsx 4ms (unchanged)
app/blockexplorer/_components/SearchBar.tsx 4ms (unchanged)
app/blockexplorer/_components/TransactionHash.tsx 4ms (unchanged)
app/blockexplorer/_components/TransactionsTable.tsx 7ms (unchanged)
app/blockexplorer/address/[address]/page.tsx 8ms
app/blockexplorer/layout.tsx 3ms (unchanged)
app/blockexplorer/page.tsx 6ms (unchanged)
app/blockexplorer/transaction/_components/TransactionComp.tsx 9ms (unchanged)
app/blockexplorer/transaction/[txHash]/page.tsx 2ms (unchanged)
app/debug/_components/contract/ContractInput.tsx 6ms (unchanged)
app/debug/_components/contract/ContractReadMethods.tsx 4ms (unchanged)
app/debug/_components/contract/ContractUI.tsx 4ms (unchanged)
app/debug/_components/contract/ContractVariables.tsx 3ms (unchanged)
app/debug/_components/contract/ContractWriteMethods.tsx 3ms (unchanged)
app/debug/_components/contract/DisplayVariable.tsx 3ms (unchanged)
app/debug/_components/contract/index.tsx 1ms (unchanged)
app/debug/_components/contract/InheritanceTooltip.tsx 1ms (unchanged)
app/debug/_components/contract/ReadOnlyFunctionForm.tsx 4ms (unchanged)
app/debug/_components/contract/Tuple.tsx 4ms (unchanged)
app/debug/_components/contract/TupleArray.tsx 8ms (unchanged)
app/debug/_components/contract/TxReceipt.tsx 3ms (unchanged)
app/debug/_components/contract/utilsContract.tsx 7ms (unchanged)
app/debug/_components/contract/utilsDisplay.tsx 5ms (unchanged)
app/debug/_components/contract/WriteOnlyFunctionForm.tsx 6ms (unchanged)
app/debug/_components/DebugContracts.tsx 3ms (unchanged)
app/debug/page.tsx 2ms (unchanged)
app/erc20/page.tsx 5ms (unchanged)
app/layout.tsx 1ms
app/page.tsx 2ms
components/assets/BuidlGuidlLogo.tsx 0ms (unchanged)
components/Footer.tsx 4ms (unchanged)
components/Header.tsx 4ms
components/scaffold-eth/Address/Address.tsx 7ms (unchanged)
components/scaffold-eth/Address/AddressCopyIcon.tsx 1ms (unchanged)
components/scaffold-eth/Address/AddressLinkWrapper.tsx 1ms (unchanged)
components/scaffold-eth/Balance.tsx 3ms (unchanged)
components/scaffold-eth/BlockieAvatar.tsx 1ms (unchanged)
components/scaffold-eth/Faucet.tsx 5ms (unchanged)
components/scaffold-eth/FaucetButton.tsx 3ms (unchanged)
components/scaffold-eth/index.tsx 0ms (unchanged)
components/scaffold-eth/Input/AddressInput.tsx 4ms (unchanged)
components/scaffold-eth/Input/Bytes32Input.tsx 1ms (unchanged)
components/scaffold-eth/Input/BytesInput.tsx 1ms (unchanged)
components/scaffold-eth/Input/EtherInput.tsx 4ms (unchanged)
components/scaffold-eth/Input/index.ts 0ms (unchanged)
components/scaffold-eth/Input/InputBase.tsx 3ms (unchanged)
components/scaffold-eth/Input/IntegerInput.tsx 2ms (unchanged)
components/scaffold-eth/Input/utils.ts 3ms (unchanged)
components/scaffold-eth/RainbowKitCustomConnectButton/AddressInfoDropdown.tsx 5ms (unchanged)
components/scaffold-eth/RainbowKitCustomConnectButton/AddressQRCodeModal.tsx 2ms (unchanged)
components/scaffold-eth/RainbowKitCustomConnectButton/index.tsx 2ms (unchanged)
components/scaffold-eth/RainbowKitCustomConnectButton/NetworkOptions.tsx 2ms (unchanged)
components/scaffold-eth/RainbowKitCustomConnectButton/WrongNetworkDropdown.tsx 1ms (unchanged)
components/ScaffoldEthAppWithProviders.tsx 2ms
components/SwitchTheme.tsx 2ms (unchanged)
components/ThemeProvider.tsx 1ms (unchanged)
hooks/scaffold-eth/index.ts 1ms (unchanged)
hooks/scaffold-eth/useAnimationConfig.ts 1ms (unchanged)
hooks/scaffold-eth/useContractLogs.ts 2ms (unchanged)
hooks/scaffold-eth/useDeployedContractInfo.ts 2ms (unchanged)
hooks/scaffold-eth/useDisplayUsdMode.ts 1ms (unchanged)
hooks/scaffold-eth/useFetchBlocks.ts 6ms (unchanged)
hooks/scaffold-eth/useInitializeNativeCurrencyPrice.ts 1ms (unchanged)
hooks/scaffold-eth/useNetworkColor.ts 1ms (unchanged)
hooks/scaffold-eth/useOutsideClick.ts 1ms (unchanged)
hooks/scaffold-eth/useScaffoldContract.ts 2ms (unchanged)
hooks/scaffold-eth/useScaffoldEventHistory.ts 6ms (unchanged)
hooks/scaffold-eth/useScaffoldReadContract.ts 3ms (unchanged)
hooks/scaffold-eth/useScaffoldWatchContractEvent.ts 2ms (unchanged)
hooks/scaffold-eth/useScaffoldWriteContract.ts 5ms (unchanged)
hooks/scaffold-eth/useTargetNetwork.ts 3ms (unchanged)
hooks/scaffold-eth/useTransactor.tsx 5ms (unchanged)
hooks/scaffold-eth/useWatchBalance.ts 2ms (unchanged)
next-env.d.ts 1ms (unchanged)
next.config.js 2ms
package.json 1ms (unchanged)
postcss.config.js 0ms (unchanged)
public/manifest.json 1ms (unchanged)
scaffold.config.ts 1ms (unchanged)
services/store/store.ts 2ms (unchanged)
services/web3/wagmiConfig.tsx 2ms (unchanged)
services/web3/wagmiConnectors.tsx 2ms (unchanged)
styles/globals.css 9ms (unchanged)
tailwind.config.js 2ms
tsconfig.json 0ms (unchanged)
types/abitype/abi.d.ts 2ms (unchanged)
types/react-copy-to-clipboard/react-copy-to-clipboard.d.ts 2ms (unchanged)
utils/scaffold-eth/block.ts 1ms (unchanged)
utils/scaffold-eth/common.ts 1ms (unchanged)
utils/scaffold-eth/contract.ts 11ms (unchanged)
utils/scaffold-eth/contractsData.ts 1ms (unchanged)
utils/scaffold-eth/decodeTxData.ts 4ms (unchanged)
utils/scaffold-eth/fetchPriceFromUniswap.ts 3ms (unchanged)
utils/scaffold-eth/getMetadata.ts 2ms (unchanged)
utils/scaffold-eth/getParsedError.ts 2ms (unchanged)
utils/scaffold-eth/index.ts 1ms (unchanged)
utils/scaffold-eth/networks.ts 5ms (unchanged)
utils/scaffold-eth/notification.tsx 4ms (unchanged)
vercel.json 1ms (unchanged)
at makeError (file:///Users/shivbhonde/Desktop/github/create-eth/node_modules/execa/lib/error.js:59:11)
at handlePromise (file:///Users/shivbhonde/Desktop/github/create-eth/node_modules/execa/index.js:124:26)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async prettierFormat (file:///Users/shivbhonde/Desktop/github/create-eth/dist/cli.js:532:24)
at async Task.run (file:///Users/shivbhonde/Desktop/github/create-eth/node_modules/listr2/dist/index.js:2056:11) {
shortMessage: 'Command failed with exit code 1: yarn format',
command: 'yarn format',
escapedCommand: 'yarn format',
exitCode: 1,
signal: undefined,
signalDescription: undefined,
stdout: '.eslintrc.json 14ms (unchanged)\n' +
'.prettierrc.js 9ms\n' +
'app/blockexplorer/_components/AddressCodeTab.tsx 15ms (unchanged)\n' +
'app/blockexplorer/_components/AddressComponent.tsx 8ms (unchanged)\n' +
'app/blockexplorer/_components/AddressLogsTab.tsx 5ms (unchanged)\n' +
'app/blockexplorer/_components/AddressStorageTab.tsx 10ms (unchanged)\n' +
'app/blockexplorer/_components/BackButton.tsx 2ms (unchanged)\n' +
'app/blockexplorer/_components/ContractTabs.tsx 11ms (unchanged)\n' +
'app/blockexplorer/_components/index.tsx 1ms (unchanged)\n' +
'app/blockexplorer/_components/PaginationButton.tsx 4ms (unchanged)\n' +
'app/blockexplorer/_components/SearchBar.tsx 4ms (unchanged)\n' +
'app/blockexplorer/_components/TransactionHash.tsx 4ms (unchanged)\n' +
'app/blockexplorer/_components/TransactionsTable.tsx 7ms (unchanged)\n' +
'app/blockexplorer/address/[address]/page.tsx 8ms\n' +
'app/blockexplorer/layout.tsx 3ms (unchanged)\n' +
'app/blockexplorer/page.tsx 6ms (unchanged)\n' +
'app/blockexplorer/transaction/_components/TransactionComp.tsx 9ms (unchanged)\n' +
'app/blockexplorer/transaction/[txHash]/page.tsx 2ms (unchanged)\n' +
'app/debug/_components/contract/ContractInput.tsx 6ms (unchanged)\n' +
'app/debug/_components/contract/ContractReadMethods.tsx 4ms (unchanged)\n' +
'app/debug/_components/contract/ContractUI.tsx 4ms (unchanged)\n' +
'app/debug/_components/contract/ContractVariables.tsx 3ms (unchanged)\n' +
'app/debug/_components/contract/ContractWriteMethods.tsx 3ms (unchanged)\n' +
'app/debug/_components/contract/DisplayVariable.tsx 3ms (unchanged)\n' +
'app/debug/_components/contract/index.tsx 1ms (unchanged)\n' +
'app/debug/_components/contract/InheritanceTooltip.tsx 1ms (unchanged)\n' +
'app/debug/_components/contract/ReadOnlyFunctionForm.tsx 4ms (unchanged)\n' +
'app/debug/_components/contract/Tuple.tsx 4ms (unchanged)\n' +
'app/debug/_components/contract/TupleArray.tsx 8ms (unchanged)\n' +
'app/debug/_components/contract/TxReceipt.tsx 3ms (unchanged)\n' +
'app/debug/_components/contract/utilsContract.tsx 7ms (unchanged)\n' +
'app/debug/_components/contract/utilsDisplay.tsx 5ms (unchanged)\n' +
'app/debug/_components/contract/WriteOnlyFunctionForm.tsx 6ms (unchanged)\n' +
'app/debug/_components/DebugContracts.tsx 3ms (unchanged)\n' +
'app/debug/page.tsx 2ms (unchanged)\n' +
'app/erc20/page.tsx 5ms (unchanged)\n' +
'app/layout.tsx 1ms\n' +
'app/page.tsx 2ms\n' +
'components/assets/BuidlGuidlLogo.tsx 0ms (unchanged)\n' +
'components/Footer.tsx 4ms (unchanged)\n' +
'components/Header.tsx 4ms\n' +
'components/scaffold-eth/Address/Address.tsx 7ms (unchanged)\n' +
'components/scaffold-eth/Address/AddressCopyIcon.tsx 1ms (unchanged)\n' +
'components/scaffold-eth/Address/AddressLinkWrapper.tsx 1ms (unchanged)\n' +
'components/scaffold-eth/Balance.tsx 3ms (unchanged)\n' +
'components/scaffold-eth/BlockieAvatar.tsx 1ms (unchanged)\n' +
'components/scaffold-eth/Faucet.tsx 5ms (unchanged)\n' +
'components/scaffold-eth/FaucetButton.tsx 3ms (unchanged)\n' +
'components/scaffold-eth/index.tsx 0ms (unchanged)\n' +
'components/scaffold-eth/Input/AddressInput.tsx 4ms (unchanged)\n' +
'components/scaffold-eth/Input/Bytes32Input.tsx 1ms (unchanged)\n' +
'components/scaffold-eth/Input/BytesInput.tsx 1ms (unchanged)\n' +
'components/scaffold-eth/Input/EtherInput.tsx 4ms (unchanged)\n' +
'components/scaffold-eth/Input/index.ts 0ms (unchanged)\n' +
'components/scaffold-eth/Input/InputBase.tsx 3ms (unchanged)\n' +
'components/scaffold-eth/Input/IntegerInput.tsx 2ms (unchanged)\n' +
'components/scaffold-eth/Input/utils.ts 3ms (unchanged)\n' +
'components/scaffold-eth/RainbowKitCustomConnectButton/AddressInfoDropdown.tsx 5ms (unchanged)\n' +
'components/scaffold-eth/RainbowKitCustomConnectButton/AddressQRCodeModal.tsx 2ms (unchanged)\n' +
'components/scaffold-eth/RainbowKitCustomConnectButton/index.tsx 2ms (unchanged)\n' +
'components/scaffold-eth/RainbowKitCustomConnectButton/NetworkOptions.tsx 2ms (unchanged)\n' +
'components/scaffold-eth/RainbowKitCustomConnectButton/WrongNetworkDropdown.tsx 1ms (unchanged)\n' +
'components/ScaffoldEthAppWithProviders.tsx 2ms\n' +
'components/SwitchTheme.tsx 2ms (unchanged)\n' +
'components/ThemeProvider.tsx 1ms (unchanged)\n' +
'hooks/scaffold-eth/index.ts 1ms (unchanged)\n' +
'hooks/scaffold-eth/useAnimationConfig.ts 1ms (unchanged)\n' +
'hooks/scaffold-eth/useContractLogs.ts 2ms (unchanged)\n' +
'hooks/scaffold-eth/useDeployedContractInfo.ts 2ms (unchanged)\n' +
'hooks/scaffold-eth/useDisplayUsdMode.ts 1ms (unchanged)\n' +
'hooks/scaffold-eth/useFetchBlocks.ts 6ms (unchanged)\n' +
'hooks/scaffold-eth/useInitializeNativeCurrencyPrice.ts 1ms (unchanged)\n' +
'hooks/scaffold-eth/useNetworkColor.ts 1ms (unchanged)\n' +
'hooks/scaffold-eth/useOutsideClick.ts 1ms (unchanged)\n' +
'hooks/scaffold-eth/useScaffoldContract.ts 2ms (unchanged)\n' +
'hooks/scaffold-eth/useScaffoldEventHistory.ts 6ms (unchanged)\n' +
'hooks/scaffold-eth/useScaffoldReadContract.ts 3ms (unchanged)\n' +
'hooks/scaffold-eth/useScaffoldWatchContractEvent.ts 2ms (unchanged)\n' +
'hooks/scaffold-eth/useScaffoldWriteContract.ts 5ms (unchanged)\n' +
'hooks/scaffold-eth/useTargetNetwork.ts 3ms (unchanged)\n' +
'hooks/scaffold-eth/useTransactor.tsx 5ms (unchanged)\n' +
'hooks/scaffold-eth/useWatchBalance.ts 2ms (unchanged)\n' +
'next-env.d.ts 1ms (unchanged)\n' +
'next.config.js 2ms\n' +
'package.json 1ms (unchanged)\n' +
'postcss.config.js 0ms (unchanged)\n' +
'public/manifest.json 1ms (unchanged)\n' +
'scaffold.config.ts 1ms (unchanged)\n' +
'services/store/store.ts 2ms (unchanged)\n' +
'services/web3/wagmiConfig.tsx 2ms (unchanged)\n' +
'services/web3/wagmiConnectors.tsx 2ms (unchanged)\n' +
'styles/globals.css 9ms (unchanged)\n' +
'tailwind.config.js 2ms\n' +
'tsconfig.json 0ms (unchanged)\n' +
'types/abitype/abi.d.ts 2ms (unchanged)\n' +
'types/react-copy-to-clipboard/react-copy-to-clipboard.d.ts 2ms (unchanged)\n' +
'utils/scaffold-eth/block.ts 1ms (unchanged)\n' +
'utils/scaffold-eth/common.ts 1ms (unchanged)\n' +
'utils/scaffold-eth/contract.ts 11ms (unchanged)\n' +
'utils/scaffold-eth/contractsData.ts 1ms (unchanged)\n' +
'utils/scaffold-eth/decodeTxData.ts 4ms (unchanged)\n' +
'utils/scaffold-eth/fetchPriceFromUniswap.ts 3ms (unchanged)\n' +
'utils/scaffold-eth/getMetadata.ts 2ms (unchanged)\n' +
'utils/scaffold-eth/getParsedError.ts 2ms (unchanged)\n' +
'utils/scaffold-eth/index.ts 1ms (unchanged)\n' +
'utils/scaffold-eth/networks.ts 5ms (unchanged)\n' +
'utils/scaffold-eth/notification.tsx 4ms (unchanged)\n' +
'vercel.json 1ms (unchanged)',
stderr: 'No matches found: "./test/**/*.ts"',
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}
}
Uh oh! 😕 Sorry about that! Exiting...
The reason for above error since there is no file in There is --no-error-on-unmatched-pattern flag since we have hardcoded Just created a https://github.com/scaffold-eth/scaffold-eth-2/pull/994/files to solve this. Once that is merged. Will backmerge it here 🙌 |
GJ! For me it also works except the case when there's is a contract but not test. Will retest when mentioned PR will be merged here |
Ohh yeah just merged |
It works great now! One nit (not critical at all): Thank you for fixing this! |
yeah lol I felt the same but it felt like simplest and minimal path. we could have explicit logic in cli working it self but maybe not worth it I feel and |
Description:
We no longer copy test directory when extension being used has
contracts
dir.Helpful for scaffold-eth/create-eth-extensions#29 (comment).
So there will be 3 cases:
contracts
+test
dir:test
dir from extension and we don't copy defaulttest/YourContract.ts
since we wantyarn test
running out of the box.contract
dir but don't provide anytest
directory (eg: erc-20 extensions)test
directory with (.gitkeep
) file so that person using extension know where to add test file for his contracts.contract
dir:contracts
dir andtest/YourContract.ts
in final instance.