superfluid-finance / widget

https://checkout-builder.superfluid.finance
MIT License
15 stars 9 forks source link

Fix typescript configuration to allow development environment to setup and build successfully #243

Closed MidnightLightning closed 1 day ago

MidnightLightning commented 4 days ago

Overview

What? The current devcontainer configuration in the master branch does not set up properly. Using Visual Studio Code, with the Dev Containers plugin properly detects the container config and attempts to set up a developer environment. The initial install succeeds, but then the build fails. This should be corrected to allow additional developers to contribute easily to the project.

The pnpm install command completes successfully, but with a few warnings:

 WARN  35 deprecated subdependencies found: @ensdomains/ens@0.4.5, @ensdomains/resolver@0.2.4, @motionone/vue@10.16.4, @truffle/abi-utils@1.0.3, @truffle/blockchain-utils@0.1.9, @truffle/codec@0.17.3, @truffle/compile-common@0.9.8, @truffle/contract-schema@3.4.16, @truffle/contract@4.6.31, @truffle/debug-utils@6.0.57, @truffle/error@0.2.2, @truffle/interface-adapter@0.5.37, abab@2.0.6, cids@0.7.5, cids@0.8.3, domexception@4.0.0, ethereumjs-common@1.5.2, ethereumjs-tx@2.1.2, fstream@1.0.12, glob@7.2.0, glob@7.2.3, har-validator@5.1.5, loupe@2.3.6, mkdirp-promise@5.0.1, multiaddr@7.5.0, multibase@0.6.1, multibase@0.7.0, multibase@1.0.1, multicodec@0.5.7, multicodec@1.0.4, request@2.88.2, rimraf@2.7.1, testrpc@0.0.1, uuid@2.0.1, uuid@3.4.0
Already up to date
Progress: resolved 2062, reused 1923, downloaded 15, added 0, done
. prepare$ husky install
│ fatal: detected dubious ownership in repository at '/workspaces/superfluid-widget'
│ To add an exception for this directory, call:
│  Runnigit config --global --add safe.directory /workspaces/superfluid-widget
│ husky - git command not found, skipping install
└─ Done in 99ms
 WARN  Issues with peer dependencies found
packages/widget
└─┬ @superfluid-finance/ethereum-contracts 1.9.1
  ├── ✕ unmet peer ethers@^5.7.2: found 6.10.0
  ├─┬ @decentral.ee/web3-helpers 0.5.3
  │ └── ✕ missing peer @openzeppelin/test-helpers@^0.5.10
  └─┬ @nomiclabs/hardhat-ethers 2.2.3
    └── ✕ unmet peer ethers@^5.0.0: found 6.10.0
Peer dependencies that should be installed:
  @openzeppelin/test-helpers@^0.5.10  

tests
└─┬ @synthetixio/synpress 4.0.0-alpha.7
  ├── ✕ unmet peer @playwright/test@1.44.0: found 1.44.1
  ├─┬ @synthetixio/ethereum-wallet-mock 0.0.1-alpha.7
  │ ├── ✕ unmet peer @playwright/test@1.44.0: found 1.44.1
  │ └─┬ @synthetixio/synpress-core 0.0.1-alpha.7
  │   └── ✕ unmet peer @playwright/test@1.44.0: found 1.44.1
  ├─┬ @synthetixio/synpress-metamask 0.0.1-alpha.7
  │ └── ✕ unmet peer @playwright/test@1.44.0: found 1.44.1
  └─┬ @synthetixio/synpress-cache 0.0.1-alpha.7
    └── ✕ unmet peer playwright-core@1.44.0: found 1.44.1

The pnpm build command fails due to the Typescript configuration

> superfluid-checkout@0.0.0 build /workspaces/superfluid-widget
> turbo run build

• Packages in scope: @superfluid-finance/b2b-service-demo, @superfluid-finance/donation-demo, @superfluid-finance/gated-community-demo, @superfluid-finance/hosted-widget, @superfluid-finance/widget, @superfluid-finance/widget-builder, eslint-config-custom, tests, tsconfig, widget-vite-react-rainbowkit, widget-vite-react-web3modal, widget-webcomponent-example
• Running build in 12 packages
• Remote caching disabled
tests:build: cache miss, executing 6204dc46aac3e79e
tests:build: 
@superfluid-finance/widget:build: cache miss, executing a3ab2b2764a02ba5
@superfluid-finance/widget:build: 
tests:build: 
tests:build: > tests@0.0.3 build /workspaces/superfluid-widget/tests
tests:build: > tsc --incremental -p ./tsconfig.json
tests:build: 
@superfluid-finance/widget:build: 
@superfluid-finance/widget:build: > @superfluid-finance/widget@0.5.0 build /workspaces/superfluid-widget/packages/widget
@superfluid-finance/widget:build: > cp ../../README.md . && tsc -p ./tsconfig.build.json
@superfluid-finance/widget:build: 
tests:build: tsconfig.json:35:35 - error TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.
tests:build: 
tests:build: 35     "allowImportingTsExtensions": true,               /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
tests:build:                                      ~~~~
tests:build: 
tests:build: 
tests:build: Found 1 error in tsconfig.json:35
tests:build: 
tests:build:  ELIFECYCLE  Command failed with exit code 2.
tests:build: ERROR: command finished with error: command (/workspaces/superfluid-widget/tests) /usr/local/share/npm-global/bin/pnpm run build exited (2)
tests#build: command (/workspaces/superfluid-widget/tests) /usr/local/share/npm-global/bin/pnpm run build exited (2)

 Tasks:    0 successful, 2 total
Cached:    0 cached, 2 total
  Time:    35.25s 
Failed:    tests#build

 ERROR  run failed: command  exited (2)
 ELIFECYCLE  Command failed with exit code 2.

How? Update the Typescript configuration to be able to build with a pnpm build call.

Why?

Deadline:

UI/UX Design:

Acceptance criteria

Links/Resources

Readiness criteria

kasparkallas commented 1 day ago

Hey, thanks for reporting! Should have been fixed by: https://github.com/superfluid-finance/widget/pull/244

Is your curiousity into the development to update to wagmi v2?

MidnightLightning commented 11 hours ago

@kasparkallas Thanks! Yes, the Superfluid Widget module being on wagmi v1 is the last third-party dependency keeping our application from upgrading to wagmi v2, so my aim was to help see if I could contribute that #236 feature request.