Skip to content

Conversation

@jthegedus
Copy link
Contributor

@jthegedus jthegedus commented Mar 13, 2018

Use npx and yarn create to run create-next-app for each example in examples/.

This:

  • requires no additional install from the user as these both come with their respective package managers (npx with Node ^8.x.x)
  • skips an additional command, reducing the "getting-started" friction
  • keeps global install of create-next-app up to date (not sure if npx actually pulls the latest)

    Installs create-<starter-kit-package> globally, or update the package to the latest version if it already exists - yarn docs

For those interested, this was done by:

  1. removing the npm i -g ... line with:
for d in *
do
    ( cd $d && sed -i '/npm i -g create-next-app/d' README.md )
done
  1. prepending npx to the execution command with VSCode
    Find: create-next-app --example
    Replace: npx create-next-app --example
  2. adding the Yarn command with:
for d in *
do
    ( cd $d && sed -i "/npx create-next-app --example/a # or\nyarn create next-app --example $d $d-app" README.md )
done

This would have been easier had I learned sed properly prior to step 1. or 2. and just written a single command. Interesting nonetheless.

@jthegedus
Copy link
Contributor Author

jthegedus commented Mar 13, 2018

If this is not desired to be merged, please at least cherry-pick these commits:

  • 0b0b18f - add bash to shell snippets
  • 435b3a1 - change READMEs to use UPPERCASE

@timneutkens
Copy link
Member

Looks great 👍 cc @fouad

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants