Open ghost opened 5 years ago
I see what you're trying clarify here, but I don't think this is right way.
yarn build
is the bash command you use to call the build
script which is specified in any project's package.json file. The contents of the package.json build
script can be anything and ultimately is specified by the theme, not Slate. For example, if someone wanted to do something else to their theme before running slate-tools build
, they could modify the build
script to run another script before, e.g. build: 'node my-custom-script.js && slate-tools build
or even do something completely different like gulp build
.
slate-tools build
is the bash command made available in the node_modules/.bin
folder of your project when slate-tools
is installed as a dependency. It calls Slate's build script and does what we talk about in this doc. It can be called by referencing it directly in a package.json
file, like you see in Starter Theme, or via npx slate-tools build
when called in the same directory as your theme.
What I think this doc might need is something in the introduction explaining how these commands are typically used, aka 'within a package.json file of a Slate theme', and maybe an example and link to Shopify Starter Theme's package.json?
Here is my opinion on how to structure it... Currently, the Commands page inside Getting Started focuses on the commands of the behind-the-scenes slate-tools
package. In the Getting Started section I would make the assumption that the commands would cover the default commands in the package.json file and how to add flags.
yarn start
yarn watch
yarn build
yarn deploy
yarn zip
yarn lint
yarn lint-json
yarn format
Having documentation for slate-tools
commands is still important for developers customizing their Slate implementation. I would expect to find those specific details in the Reference section, along with basic examples pointing to the package.json
file.
What are you trying to accomplish with this PR?
Please provide a link to the associated GitHub issue.
Checklist
For contributors:
For maintainers: