From 1033eef7c302e8393723018d7648a335808e2c09 Mon Sep 17 00:00:00 2001 From: Tyler van der Hoeven Date: Fri, 11 Aug 2023 12:38:57 -0400 Subject: [PATCH] Build/better gen (#132) * build: directly generate js libs to node_modules Roll back https://github.com/stellar/soroban-example-dapp/pull/122, but keep `crowdfund-contract` and `abundance-token` in `optionalDependencies`. As I worked with the old version in earnest, iterating on a local copy of the CLI and generating new JS libs over and over, the two-step generate-to-.soroban, then install-to-node_modules wasn't working very well. Probably because the new library wasn't being added until the `postinstall` step, and the dependencies are optional. Generating directly to `node_modules` feels dirty, but it works consistently. At least in this version, you can still see the dependencies listed in the `optionalDependencies` section, so they're not quite as surprising/mysterious. * build: try adding back optionalDeps * build: update node; use preinstall and local deps * Update package-lock.json * work around a bug in the binding gen --------- Co-authored-by: Chad Ostrowski <221614+chadoh@users.noreply.github.com> --- .gitattributes | 1 + .github/workflows/nodejs.yml | 2 +- .nvmrc | 2 +- components/molecules/form-pledge/index.tsx | 8 +- package-lock.json | 4143 ++------------------ package.json | 14 +- 6 files changed, 413 insertions(+), 3757 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..f3c54b5 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +package-lock.json linguist-generated=true -diff diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 0aacbff..5e10af2 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -26,7 +26,7 @@ jobs: - run: cargo install_soroban - uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 18.14.2 cache: 'npm' - run: | mkdir -p .soroban-example-dapp diff --git a/.nvmrc b/.nvmrc index 3c03207..bac88e3 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18 +>=18.14.2 diff --git a/components/molecules/form-pledge/index.tsx b/components/molecules/form-pledge/index.tsx index 22addf5..d38b368 100644 --- a/components/molecules/form-pledge/index.tsx +++ b/components/molecules/form-pledge/index.tsx @@ -29,14 +29,14 @@ function MintButton({ account, symbol, onComplete, decimals }: { decimals: numbe const [isSubmitting, setSubmitting] = useState(false) const displayAmount = 100 - const amount = BigInt(displayAmount * 10**decimals) + const amount = BigInt(displayAmount * 10 ** decimals) return (