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

Update "g secret" docs for yarn v3 #4933

Merged
merged 2 commits into from
Mar 26, 2022

Conversation

Tobbe
Copy link
Member

@Tobbe Tobbe commented Mar 25, 2022

The command to append a secret key to your .env file is this, for yarn v1:

echo "SESSION_SECRET=$(yarn --silent rw g secret --raw)" >> .env

For yarn v3 they have removed the --silent flag, and if you try to add it you get 50+ lines of "help"

$ yarn --silent rw g secret
Unknown Syntax Error: Command not found; did you mean one of:

  0. yarn cache clean [--mirror] [--all]
  1. yarn cache clean [--mirror] [--all]
  2. yarn config get [--json] [--no-redacted] <name>
  3. yarn config set [--json] [-H,--home] <name> <value>
  4. yarn config unset [-H,--home] <name>
  5. yarn set resolution [-s,--save] <descriptor> <resolution>
  6. yarn set version from sources [--path #0] [--repository #0] [--branch #0] [--plugin #0] [--no-minify] [-f,--force] [--skip-plugins]
  7. yarn set version [--only-if-needed] <version>
  8. yarn workspaces list [--since] [-R,--recursive] [-v,--verbose] [--json]
  9. yarn --clipanion=definitions
 10. yarn help
 11. yarn help
 12. yarn help
 13. yarn <leadingArgument> ...
 14. yarn -v
 15. yarn -v
 16. yarn bin [-v,--verbose] [--json] [name]
 17. yarn config [-v,--verbose] [--why] [--json]
 18. yarn dedupe [-s,--strategy #0] [-c,--check] [--json] [--mode #0] ...
 19. yarn exec <commandName> ...
 20. yarn explain peer-requirements [hash]
 21. yarn explain [--json] [code]
 22. yarn info [-A,--all] [-R,--recursive] [-X,--extra #0] [--cache] [--dependents] [--manifest] [--name-only] [--virtuals] [--json] ...
 23. yarn install [--json] [--immutable] [--immutable-cache] [--check-cache] [--inline-builds] [--mode #0]
 24. yarn link [-A,--all] [-p,--private] [-r,--relative] <destination>
 25. yarn unlink [-A,--all] ...
 26. yarn node ...
 27. yarn plugin import from sources [--path #0] [--repository #0] [--branch #0] [--no-minify] [-f,--force] <name>
 28. yarn plugin import <name>
 29. yarn plugin remove <name>
 30. yarn plugin list [--json]
 31. yarn plugin runtime [--json]
 32. yarn rebuild ...
 33. yarn remove [-A,--all] [--mode #0] ...
 34. yarn run
 35. yarn up [-i,--interactive] [-E,--exact] [-T,--tilde] [-C,--caret] [-R,--recursive] [--mode #0] ...
 36. yarn why [-R,--recursive] [--json] [--peers] <package>
 37. yarn workspace <workspaceName> <commandName> ...
 38. yarn create [-p,--package #0] [-q,--quiet] <command> ...
 39. yarn dlx [-p,--package #0] [-q,--quiet] <command> ...
 40. yarn init [-p,--private] [-w,--workspace] [-i,--install]
 41. yarn npm audit [-A,--all] [-R,--recursive] [--environment #0] [--json] [--severity #0]
 42. yarn npm info [-f,--fields #0] [--json] ...
 43. yarn npm login [-s,--scope #0] [--publish]
 44. yarn npm logout [-s,--scope #0] [--publish] [-A,--all]
 45. yarn npm publish [--access #0] [--tag #0] [--tolerate-republish] [--otp #0]
 46. yarn npm tag add <package> <tag>
 47. yarn npm tag list [--json] [package]
 48. yarn npm tag remove <package> <tag>
 49. yarn npm whoami [-s,--scope #0] [--publish]
 50. yarn pack [--install-if-needed] [-n,--dry-run] [--json] [-o,--out #0]
 51. yarn patch-commit [-s,--save] <patchFolder>
 52. yarn patch [--json] <package>
 53. yarn unplug [-A,--all] [-R,--recursive] [--json] ...

While running --silent rw g secret

Thankfully yarn3's default behavior is what you used to get with --silent. So we can just skip the flag

echo "SESSION_SECRET=$(yarn rw g secret --raw)" >> .env

This PR mentions both the yarn1 and yarn3 variants. We can remove the v1 version when/if we decide to only support yarn v3

@netlify
Copy link

netlify bot commented Mar 25, 2022

Deploy Preview for redwoodjs-docs ready!

Name Link
🔨 Latest commit 7d3b728
🔍 Latest deploy log https://app.netlify.com/sites/redwoodjs-docs/deploys/623e69286015160009cf3627
😎 Deploy Preview https://deploy-preview-4933--redwoodjs-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@Tobbe Tobbe requested a review from jtoar March 25, 2022 19:06
@Tobbe Tobbe added the release:fix This PR is a fix label Mar 25, 2022
@thedavidprice thedavidprice merged commit 7aa4fa3 into redwoodjs:main Mar 26, 2022
@jtoar jtoar added this to the next-release milestone Mar 26, 2022
@Tobbe Tobbe deleted the tobbe-doc-secret-silent branch March 26, 2022 07:49
@Tobbe Tobbe changed the title Update docs for yarn v3 Update "g secret" docs for yarn v3 Mar 26, 2022
@thedavidprice thedavidprice modified the milestones: next-release, v1.1.0 Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix This PR is a fix
Projects
No open projects
Status: Archived
Development

Successfully merging this pull request may close these issues.

3 participants