Skip to content
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

feat: streamline dfx new output #4073

Merged
merged 10 commits into from
Jan 23, 2025

Conversation

ericswanson-dfinity
Copy link
Member

@ericswanson-dfinity ericswanson-dfinity commented Jan 22, 2025

Description

Also fixes a bug: if passing --no-frontend and --extras frontend-tests, would write the base files before erroring out.

Before

$ dfx new h27 --type motoko --frontend react
Fetching manifest https://sdk.dfinity.org/manifest.json
  Installed dfx 0.24.3+rev52.6d2b777e9 to cache.
Creating new project "h27"...
⠤ Installing node dependencies...

added 106 packages, and audited 108 packages in 6s

20 packages are looking for funding
  run `npm fund` for details

  Done.
Initializing git repository...
===============================================================================
        Welcome to the internet computer developer community!

To learn more before you start coding, check out the developer docs and samples:

- Documentation: https://internetcomputer.org/docs/current/developer-docs
- Samples: https://internetcomputer.org/samples
===============================================================================

After

% dfx new h77 --type rust --frontend vue             
Created new project "h77"

After (verbose)

$ dfx new h78 --type rust --frontend vue -v
Gathering project templates
Writing base files
Writing files for project template: dfx_js_base
Writing files for project template: rust
Writing files for project template: vue
Running command: npm install --quiet --no-progress --workspaces --if-present
Checking if xcode is installed
Initializing git repository
Running command: cargo update
Created new project "h78"

After (more verbose)

$ dfx new h79 --type rust --frontend vue -vv 
Trace mode enabled. Lots of logs coming up.
Gathering project templates
Writing base files
CREATE       h79/dfx.json (179B)...
CREATE       h79/.gitignore (260B)...
CREATE       h79/README.md (2.44KiB)...
Writing files for project template: dfx_js_base
CREATE       h79/tsconfig.json (280B)...
CREATE       h79/package.json (468B)...
Writing files for project template: rust
CREATE       h79/src/h79_backend/src/lib.rs (86B)...
CREATE       h79/src/h79_backend/h79_backend.did (51B)...
CREATE       h79/src/h79_backend/Cargo.toml (329B)...
CREATE       h79/Cargo.toml (63B)...
Writing files for project template: vue
CREATE       h79/src/h79_frontend/src/vite-env.d.ts (38B)...
CREATE       h79/src/h79_frontend/src/main.js (172B)...
CREATE       h79/src/h79_frontend/src/index.scss (536B)...
CREATE       h79/src/h79_frontend/src/App.vue (739B)...
CREATE       h79/src/h79_frontend/tsconfig.json (578B)...
CREATE       h79/src/h79_frontend/package.json (811B)...
CREATE       h79/src/h79_frontend/public/logo2.svg (14.78KiB)...
CREATE       h79/src/h79_frontend/public/.ic-assets.json5 (834B)...
CREATE       h79/src/h79_frontend/public/favicon.ico (15.04KiB)...
CREATE       h79/src/h79_frontend/vite.config.js (929B)...
CREATE       h79/src/h79_frontend/index.html (733B)...
Running command: npm install --quiet --no-progress --workspaces --if-present
Checking if xcode is installed
Initializing git repository
Running command: cargo update
Created new project "h79"

Fixes https://dfinity.atlassian.net/browse/SDK-1940

How Has This Been Tested?

Tested manually. Added an e2e test for dfx new --no-frontend --extras frontend-tests

Checklist:

  • The title of this PR complies with Conventional Commits.
  • I have edited the CHANGELOG accordingly.
  • I have made corresponding changes to the documentation.

@ericswanson-dfinity ericswanson-dfinity marked this pull request as ready for review January 22, 2025 01:15
@ericswanson-dfinity ericswanson-dfinity requested a review from a team as a code owner January 22, 2025 01:15
lwshang
lwshang previously approved these changes Jan 22, 2025
check project template compatibility before writing anything
added some debug logs
@ericswanson-dfinity ericswanson-dfinity merged commit b04e931 into master Jan 23, 2025
300 checks passed
@ericswanson-dfinity ericswanson-dfinity deleted the ens/sdk-1940-dfx-new-streamline-output branch January 23, 2025 22:49
rikonor pushed a commit that referenced this pull request Feb 3, 2025
- add some spinners
- add some debug logs
- remove welcome message
- check project template compatibility before writing anything

Fixes: https://dfinity.atlassian.net/browse/SDK-1940
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants