From 10e3ca958dfa0a7d287a09fb94d77eefee6db20a Mon Sep 17 00:00:00 2001 From: wighawag Date: Tue, 28 Nov 2023 12:32:42 +0000 Subject: [PATCH] tweaks --- contracts/.env | 11 ++++++++++- contracts/.gitignore | 2 ++ contracts/.prettierignore | 6 +++++- contracts/hardhat.config.cjs | 7 +++++++ contracts/package.json | 5 ++++- indexer/.prettierignore | 2 ++ web/.env | 5 +++-- web/.prettierignore | 2 ++ web/svelte.config.js | 2 +- web/tsconfig.json | 3 ++- 10 files changed, 38 insertions(+), 7 deletions(-) diff --git a/contracts/.env b/contracts/.env index a8a8a5d..bc9605d 100644 --- a/contracts/.env +++ b/contracts/.env @@ -1,9 +1,18 @@ # this let ldenv know to load the parent foler .env too (the child folder's vars takes precedence though) ENV_ROOT_FOLDER=.. +# this let ldenv know to load the parent foler .env too (the child folder's vars takes precedence though) +ENV_ROOT_FOLDER=.. + # if you want to deploy on a specific network and not expose your api key # you just create a .env.local (or .env..local) with the following # ETH_NODE_URI_= # MNEMONIC_=">" # you can also add the etherscan api key for verification -# ETHERSCAN_API_KEY= \ No newline at end of file +# ETHERSCAN_API_KEY= + +ETH_NODE_URI_localhost="http://127.0.0.1:8545" +MNEMONIC_localhost="test test test test test test test test test test test junk" + +ETH_NODE_URI_lan="http://ethereum.local:8545" +MNEMONIC_lan="test test test test test test test test test test test junk" diff --git a/contracts/.gitignore b/contracts/.gitignore index e505488..be88855 100644 --- a/contracts/.gitignore +++ b/contracts/.gitignore @@ -6,6 +6,8 @@ node_modules # rocketh generated deployments/localhost +deployments/lan +_metadata # hardhat /coverage diff --git a/contracts/.prettierignore b/contracts/.prettierignore index e315412..0ae8995 100644 --- a/contracts/.prettierignore +++ b/contracts/.prettierignore @@ -16,7 +16,11 @@ deployments/localhost /coverage-data.json cache artifacts + +docs +*.hbs + ############################################# deployments package.json -pnpm-lock.yaml \ No newline at end of file +pnpm-lock.yaml diff --git a/contracts/hardhat.config.cjs b/contracts/hardhat.config.cjs index 7d52bdd..3fc95c5 100644 --- a/contracts/hardhat.config.cjs +++ b/contracts/hardhat.config.cjs @@ -53,6 +53,13 @@ const config = { paths: { sources: 'src', }, + docgen: { + templates: 'docs_templates', + pages: 'files', + }, + mocha: { + require: 'named-logs-console', + }, }; module.exports = config; diff --git a/contracts/package.json b/contracts/package.json index 9bb4d16..edae697 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -39,7 +39,10 @@ "deploy": "ldenv hardhat --network @@MODE deploy @@", "deploy:watch": "as-soon -w generated -w deploy pnpm run deploy", "test": "vitest", - "coverage": "hardhat compile-for-coverage && vitest run --coverage && hardhat compile", + "coverage:compile": "hardhat compile-for-coverage", + "coverage:watch:compile": "as-soon -w src pnpm coverage:compile", + "coverage:watch": "pnpm coverage:compile && vitest --coverage --no-threads", + "coverage": "pnpm coverage:compile && vitest run --coverage || pnpm compile", "export": "rocketh-export", "start": "zellij --layout zellij.kdl a $npm_package_name || zellij --layout zellij.kdl -s $npm_package_name", "stop": "zellij kill-session $npm_package_name", diff --git a/indexer/.prettierignore b/indexer/.prettierignore index a2f7a9f..0fb83df 100644 --- a/indexer/.prettierignore +++ b/indexer/.prettierignore @@ -8,6 +8,8 @@ node_modules /dist /ethereum-indexer-data /src/contracts.ts +/indexed/ + ############################################# package.json pnpm-lock.yaml \ No newline at end of file diff --git a/web/.env b/web/.env index 8829aed..4ed8571 100644 --- a/web/.env +++ b/web/.env @@ -7,9 +7,10 @@ PUBLIC_DEV_NODE_URI=http://localhost:8545 # This set the fallback (centralised node) # Disabled by default: User need a wallet to read state -# PUBLIC_ETH_NODE_URI_LOCALHOST=${PUBLIC_DEV_NODE_URI} -PUBLIC_ETH_NODE_URI_LOCALHOST= PUBLIC_ETH_NODE_URI= +PUBLIC_ETH_NODE_URI_LOCALHOST= +# for localhost, you can also set it to be the same as PUBLIC_DEV_NODE_URI +# PUBLIC_ETH_NODE_URI_LOCALHOST=${PUBLIC_DEV_NODE_URI} # Can specify a block time for localhost PUBLIC_LOCALHOST_BLOCK_TIME=${BLOCK_TIME} diff --git a/web/.prettierignore b/web/.prettierignore index fb86714..a385ef9 100644 --- a/web/.prettierignore +++ b/web/.prettierignore @@ -26,6 +26,8 @@ static/robots.txt # generated from contracts src/data/contracts.ts +static/indexed-state-*.json + ############################################# package.json pnpm-lock.yaml diff --git a/web/svelte.config.js b/web/svelte.config.js index e1c8809..aaf854e 100644 --- a/web/svelte.config.js +++ b/web/svelte.config.js @@ -3,7 +3,7 @@ import adapter from '@sveltejs/adapter-static'; import {vitePreprocess} from '@sveltejs/kit/vite'; import {execSync} from 'child_process'; -function getVersion() { +export function getVersion() { try { return execSync('git rev-parse --short HEAD').toString().trim(); } catch { diff --git a/web/tsconfig.json b/web/tsconfig.json index 6ae0c8c..8719b8a 100644 --- a/web/tsconfig.json +++ b/web/tsconfig.json @@ -8,7 +8,8 @@ "resolveJsonModule": true, "skipLibCheck": true, "sourceMap": true, - "strict": true + "strict": true, + "outDir": "build" } // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias //