dfinity / sdk

IC SDK: a Software Development Kit for creating and managing canister smart contracts on the ICP blockchain.
https://internetcomputer.org/developers
Apache License 2.0
176 stars 85 forks source link

chore: update log related to dfx generate #4004

Closed lwshang closed 5 days ago

lwshang commented 5 days ago

SDK-1897 SDK-1902

Description

Running dfx deploy in a project containing frontend and backend canisters results in verbose output:

dfx deploy
Deploying all canisters.
All canisters have already been created.
Building canisters...
Building frontend...
WARN: Building canisters before generate for Motoko
Generating type declarations for canister hello1_frontend:
  /home/dfxtester/workspaces/hello1/src/declarations/hello1_frontend/hello1_frontend.did.d.ts
  /home/dfxtester/workspaces/hello1/src/declarations/hello1_frontend/hello1_frontend.did.js
  /home/dfxtester/workspaces/hello1/src/declarations/hello1_frontend/hello1_frontend.did
Generating type declarations for canister hello1_backend:
  /home/dfxtester/workspaces/hello1/src/declarations/hello1_backend/hello1_backend.did.d.ts
  /home/dfxtester/workspaces/hello1/src/declarations/hello1_backend/hello1_backend.did.js
  /home/dfxtester/workspaces/hello1/src/declarations/hello1_backend/hello1_backend.did
DEPRECATION WARNING: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.

More info:[ https://sass-lang.com/d/legacy-js-api](https://sass-lang.com/d/legacy-js-api)

Installing canisters...
...

The lines after Building frontend... before Installing canisters... are from the steps to build the frontend canister.

ISSUE

The frontend build step runs npm run build. Once it succeed, it logs the stderr as a WARN which caused confusion. It contains npm warnings.

FIX

change the log level from warn to debug so that it doesn't display unless in verbose mode.

ISSUE

npm run build invokes dfx generate, it print all the files path which is very verbose.

FIX

change it from eprintln! to trace log so that it doesn't display unless in verbose mode.