Open mcmire opened 5 months ago
In order to work on this ticket, we will probably have to parse the README using a Markdown parser. I am thinking remark
or markdown-it
, but there may be others. I might create a new research ticket for this if we feel the need.
Also note that there is some overlap between this ticket and #12, in that we already have a rule which looks for Node installation instructions in the README. We may want to tweak this rule, however, to account for whichever version is listed in .nvmrc
and/or lack of .nvmrc
.
For a given project, we want to ensure that:
README.md
. Past this, we want to ensure that:Install [Node ${version}](https://nodejs.org)
if.nvmrc
exists and is notlts/*
, otherwise it matchesInstall the current LTS version of [Node.js](https://nodejs.org)
.Install [Yarn Modern](https://yarnpkg.com/getting-started/install)
ifpackageManager
exists inpackage.json
and matchesyarn@<version>
and theversion
is >= 2; otherwise it matchesInstall [Yarn Classic](https://classic.yarnpkg.com/en/docs/install)
.Run `yarn setup` to install dependencies and run any required post-install scripts
ifpackage.json
has asetup
script; otherwiseRun `yarn install` to install dependencies and run any required post-install scripts
.package.json
contains either atest
script or alint
script.Run `yarn test` to run the tests once.
if thetest
script exists.To run tests on file changes, run `yarn test:watch`.
if thetest:watch
script exists.Run `yarn lint` to run the linter.
if thelint
script exists.Run `yarn lint:fix` to run the linter and fix any automatically fixable issues
if thelint
script exists.uses: MetaMask/action-npm-publish
,uses: MetaMask/action-publish-release
, anduses: MetaMask/action-create-release-pr
among the project's GitHub workflow files. The content of this should match the same section as in the module template. (We could make this smarter, but all of these workflows go together.)