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: improve create-solana-dapp args handling #8

Merged
merged 10 commits into from
Nov 10, 2023
Merged

Conversation

beeman
Copy link
Collaborator

@beeman beeman commented Nov 9, 2023

Some improvements of how the args of create-solana-dapp are handled.

It now supports name as a positional argument, so npx create-solana-dapp@latest my-app instead of npx create-solana-dapp@latest --name my-app.

It's still optional so if it's not provided it will prompt the user.

image

The second change is that the --anchor flag now accepts none|counter|hello-world, merging the anchor and anchor-template flags.

Some other fixes:

  • We have unit tests with snapshots to ensure a certain parameter set yields the expected object.
  • The generated anchor project is now called anchor instead of program
  • Blank values will be prompted and validated.
  • The sync-schemas script passes additionalProperties: false to json-schema-to-typescript to prevent it from adding a [k: string]: unknown property to the schema.d.ts files.

The output is currently like this, we'll have to for in and customize some Nx scripts (or make changes upstream) to make the output of the workspace creation completely silent.

image

@beeman beeman force-pushed the beeman/cleaner-snapshots branch from 24b31a3 to f011912 Compare November 9, 2023 15:12
@beeman beeman force-pushed the beeman/args-handling branch 2 times, most recently from a60f42f to d0bdf3e Compare November 9, 2023 15:19
Base automatically changed from beeman/cleaner-snapshots to next November 9, 2023 16:13
@beeman beeman force-pushed the beeman/args-handling branch from d0bdf3e to 79500c0 Compare November 9, 2023 16:57
@beeman beeman marked this pull request as ready for review November 9, 2023 16:59
@beeman beeman marked this pull request as draft November 9, 2023 20:03
@beeman beeman force-pushed the beeman/args-handling branch 4 times, most recently from 97ef26e to 2e196ef Compare November 10, 2023 14:55
@beeman beeman marked this pull request as ready for review November 10, 2023 14:57
@beeman beeman requested a review from nickfrosty November 10, 2023 14:57
packages/create-solana-dapp/lib/get-args.ts Outdated Show resolved Hide resolved
return value
},
)
.option('--anchor-build', help(`Build the anchor project (default: false)`), false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This extra false was printing the extra line on the help menu.
Does not having it set here make the values to not be false by default? Do we need to use the anchor input normalizer to set this default=false?

packages/create-solana-dapp/lib/get-args.ts Outdated Show resolved Hide resolved
packages/create-solana-dapp/lib/get-args.ts Outdated Show resolved Hide resolved
packages/create-solana-dapp/lib/get-args.ts Outdated Show resolved Hide resolved
packages/create-solana-dapp/lib/get-args.ts Outdated Show resolved Hide resolved
@beeman beeman force-pushed the beeman/args-handling branch 2 times, most recently from 7e996a0 to a9a17ad Compare November 10, 2023 21:34
@beeman beeman force-pushed the beeman/args-handling branch from f07bcd8 to 8bb93ba Compare November 10, 2023 23:15
@beeman beeman force-pushed the beeman/args-handling branch from 8bb93ba to 1c22f3a Compare November 10, 2023 23:36
@beeman beeman merged commit 838a1cd into next Nov 10, 2023
5 checks passed
@beeman beeman deleted the beeman/args-handling branch November 10, 2023 23:41
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.

2 participants