forestryio / create-static-site

Create static websites with no build configuration.
MIT License
135 stars 10 forks source link

Run npm build or npm start after initial setup? #35

Closed zivbk1 closed 6 years ago

zivbk1 commented 6 years ago

The init script tells the user to run npm build https://github.com/forestryio/create-static-site/blob/43c3eaf5a003e8ffd640746e3bd93a90d5ad3cc9/packages/static-scripts/scripts/init.js#L187

If you look at the ReadMe file, there is information about npm start and npm build. https://github.com/forestryio/create-static-site/blob/master/README.md#npm-start-or-yarn-start

If I run npm build, nothing happens and I get the following warning in return. npm WARN build 'npm build' called with no arguments. Did you mean to 'npm run-script build'?

If I run npm start, then the system builds and hosts the site as expected.

I would recommend changing line 187 linked above to npm start instead of build, or add the missing parameters that seem to be required to run the build process.

chrisdmacrae commented 6 years ago

@zivbk1 that should be npm run build.

create-static-site aliases the internal scripts to NPM commands.

npm start is just an alias for npm run start

zivbk1 commented 6 years ago

OK, @chrisdmacrae should I make a pull request for that change to line 187 in init.js? I assume it should be changed to: console.log(` ${chalk.cyan(`${displayedCommand} run build`)}`)

chrisdmacrae commented 6 years ago

@zivbk1 Yes please, because @ncphillips will have to re-publish the package!

ncphillips commented 6 years ago

@zivbk1 that's not quite the change we would be looking for in this case. The convention of yarn is to not use run. Instead it would look something like:

  console.log(chalk.cyan(`  ${displayedCommand} ${useYarn ? "" : "run "}build`))

As seen a few lines up

Open the PR and I'll attach it to the 0.1.2 release of static-scripts

ncphillips commented 6 years ago

this issue will be closed by #41