Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@adonisjs/mrm-preset

adonisjs1.3kMIT5.0.3

MRM preset used by adonisjs for all core packages

mrm, mrm-tasks

readme

AdonisJS preset for mrm to keep the project configuration files in-sync and consistent across various projects.

Table of contents

What is MRM?

You might be curious to know what the heck is MRM?

MRM is a command line tool to scaffold new projects. But instead of just creating the initial set of files, it has powerful utilities to update them as well.

For better explanation, I recommend reading this article by the project author.

What is MRM Preset?

This module is a custom preset of tasks for MRM and is used by AdonisJS and many other projects I author.

You can also create a preset for your own needs. However, just go through the tasks once to see if they fit your needs and that way you can avoid creating your own tasks.

Getting started

Let's quickly learn how to use this preset, before we dig into the specifics of tasks.

npm i --save-dev mrm @adonisjs/mrm-preset

Add script to package.json file

{
 "scripts": {
   "mrm": "mrm --preset=@adonisjs/mrm-preset"
 }
}

and then run it as follows

## Initiate by creating config file
npm run mrm init
## Execute all tasks (for new projects)
npm run mrm all

Tasks

Let's focus on all the tasks supported by AdonisJS preset.

Appveyor

Appveyor tasks creates a configuration file (appveyor.yml) in the root of your project. The tasks depends on the config file config.json and requires following key/value pairs.

{
  "services": ["appveyor"],
  "minNodeVersion": "12.0.0"
}

To remove support for appveyor from your project, just npm run mrm appveyor task by removing the appveyor keyword from the services array.

{
  "services": []
}
npm run mrm appveyor

Circle CI

Circle CI tasks creates a configuration file (.circleci/config.yml) in the root of your project. The tasks depends on the config file config.json and requires following key/value pairs.

{
  "services": ["circleci"],
  "minNodeVersion": "12.0.0"
}

To remove support for circleci from your project, just npm run mrm circleci task by removing the circleci keyword from the services array.

{
  "services": []
}
npm run mrm circleci

Contributing.md template

Creates .github/CONTRIBUTING.md file. This file is shown by Github to users creating new issues.

The content of the template is pre-defined and is not customizable. If you want custom template, then it's better to create the file by hand.

  1. Template for Typescript The typescript template is used when ts=true inside the config file.

     {
       "ts": true
     }
  2. Otherwise the default template will be used.

    Editorconfig file

    Creates a .editorconfig file inside the project root. The editor config file is a way to keep the editor settings consistent regardless of the the editor you open the files in.

You may need a plugin for your editor to make editorconfig work.

The file is generated with settings defined inside the task file and again is not customizable.

Eslint

Installs eslint and eslint-plugin-adonis. Also it will remove tslint and it's related dependencies from the project.

Github templates

Creates issues and PR template for Github. The contents of these templates will be pre-filled anytime someone wants to create a new issue or PR.

  1. Issues template content
  2. PR template

Github Actions

Github actions tasks creates a configuration file (.github/workflows/test.yml) in the root of your project. The tasks depends on the config file config.json and requires following key/value pairs.

{
  "services": ["github-actions"],
  "minNodeVersion": "14.15.4"
}

To remove support for github-actions from your project, just npm run mrm github-actions task by removing the github-actions keyword from the services array.

{
  "services": []
}
npm run mrm github-actions

Gitignore template

Creates .gitignore file in the root of your project. Following files and folders are ignored by default. However, you can add more to the template.

node_modules
coverage
test/__app
.DS_STORE
.nyc_output
.idea
.vscode/
*.sublime-project
*.sublime-workspace
*.log
build
docs
dist
shrinkwrap.yaml

License template

Creates LICENSE.md file in the root of your project.

You can choose from one of the available licenses when running npm run init command or define it by hand inside config.json file.

{
  "license": "MIT"
}

If not defined, will fallback to package.json file or MIT.

Np release management

np is a sick (👌) tool to publish your npm packages by ensuring that your package is in healthy state for release.

We recommend reading their README too https://github.com/sindresorhus/np.

Package file generation

This tasks does lots of work to install handful of packages and update package.json file.

The list of operations is based on my personal learnings while maintaining open source projects.

Testing

The japa test runner is installed along side with japaFile.js.

Typescript setup

We create a tsconfig.json file and install following dependencies.

  1. @types/node
  2. typescript
  3. @adonisjs/require-ts

Scripts

The following scripts are defined inside the package.json file.

  1. clean to clean the build folder before starting the build. We also install del-cli npm package for this script to work
  2. compile to compile the TypeScript code to JavaScript
  3. build runs compile
  4. prePublishOnly to compile before publishing to npm.

Prettier

Installs prettier and eslint-plugin-prettier and eslint-config-prettier to setup prettier along side with eslint. Also the task will check, if .eslintrc.json file exists and then only performs the eslint specific setup

Probot applications

Configures certain probot application templates inside the .github directory. Currently, following apps are supported.

Readme file

Generates a Readme file using a pre-defined template. Feel free to change the contents of the file, since it's just a starting point.

Readme file TOC

Generates table of contents for the readme file. This tasks registers a git hook to automatically generate the TOC before every commit.

Under the hood npm package doctoc is used for generating the TOC, so make sure to read their readme file as well.

Validate commit

Configures a git hook to validate the commit messages. This is great, if you want to ensure that contributors to your project must form commit messages as per a given standard.

The default standard used is conventional-changelog and rules are defined inside this template, which is copied over to your project .github folder for readers reference.

changelog

2.4.0 (2020-07-18)

Bug Fixes

Features

2.3.7 (2020-07-05)

Bug Fixes

  • audit report should commit the html file (6b0d511)

2.3.6 (2020-07-03)

Bug Fixes

  • do not overwrite existing pre-commit hook (1177fca)

2.3.5 (2020-07-03)

Features

  • add task to generate npm audit report (6b05242)

2.3.4 (2020-06-28)

Bug Fixes

  • use tabs in editorconfig to be consistent with prettier settings (626467b)

2.3.3 (2020-06-28)

Features

  • Prettier: use tabs over spaces and increase line length (#12) (840561a)

2.3.2 (2020-06-24)

2.3.1 (2020-06-24)

Features

2.3.0 (2020-04-08)

2.2.4 (2020-02-06)

2.2.3 (2019-12-19)

Bug Fixes

  • eslint: set file extensions for the lint task (d4af279)

2.2.2 (2019-12-02)

Bug Fixes

  • readme-task: access packageName from values object (a172d00)

2.2.0 (2019-11-29)

Features

2.1.0 (2019-08-29)

2.0.3 (2019-05-17)

Bug Fixes

  • np: formatting of .npmrc file (96199d2)

2.0.2 (2019-05-14)

Features

  • np: add npmrc file with commit message standard (efd77d6)
  • package: define main and files array (55b4cab)

2.0.1 (2019-05-14)

Bug Fixes

  • commit-hook: use HUSKY_GIT_PARAMS over GIT_PARAMS (ea65852)

1.1.0 (2019-05-10)

Features

  • add support for np release management (611661d)

1.0.21 (2019-04-06)

Bug Fixes

  • circleci: fix yaml parsing errors (cd9d1e6)
  • init: use correct node version on prompt selection (22097a2)
  • services: return badge for circleci service (98b1902)

1.0.20 (2019-04-02)

Bug Fixes

  • package: get rid of bin path (9dc102f)

1.0.19 (2019-04-02)

Features

  • tslint: allow pascal-case and ignore regex from line length limit (7c9cc01)

1.0.18 (2019-04-02)

1.0.17 (2019-04-02)

Features

  • circleci: add circleci task (5b9a805)

1.0.16 (2019-01-17)

Reverts

  • tsconfig: remove test from excludes array (398d008)

1.0.15 (2019-01-16)

Bug Fixes

Features

  • readme-toc: add new task to generate readme file toc (2df5606)
  • tslint: add new rules (3df7de4)

1.0.14 (2018-10-03)

Bug Fixes

  • github: make correct url inside pr.md template (3737993)

Features

  • config: add validateCommit task to all tasks array (4fa127b)
  • task: add validateCommit task to keep commits consistent (ac73d37)

1.0.13 (2018-09-27)

Features

  • japa: adjust npm scripts as per japa@2 (a4d686e)

1.0.12 (2018-09-27)

Features

  • japa: create blueprint for japa 2 (0120ca9)

1.0.11 (2018-08-22)

1.0.10 (2018-07-23)

Features

  • gitignore: add package-lock.json file to task (785dbcc)

1.0.9 (2018-07-15)

Bug Fixes

  • package: fix test:win command (ce3e16d)

1.0.8 (2018-07-13)

Features

  • task: add typedoc task (400cf46)
  • tslint: add rule for max-line-length (d790704)

1.0.7 (2018-06-30)

Bug Fixes

  • github: fix github template for core bugs (6e05e2c)

1.0.6 (2018-06-30)

Bug Fixes

  • license: fix license task to pull github username (6e6f29d)

1.0.5 (2018-06-30)

Features

  • typescript: set nyc extensions to .ts (9b96a99)

1.0.4 (2018-06-29)

1.0.3 (2018-06-29)

Features

  • package: add pkg-ok script as prepublishOnly (2ce48f2)

1.0.2 (2018-06-29)

Bug Fixes

  • gitignore: ignore build directory for typescript (c54e414)

Features

  • aliases: add task aliases (79f568f)
  • appveyor: add task for appveyor (e536df9)
  • init: ask for git origin url (4e2c114)
  • package: add new scripts for typescript projects (3a5b7f4)
  • travis: add travis task (eeeeaa0)

1.0.1 (2018-06-26)

Bug Fixes

  • github: export instance of standardtemplate (37a7cd6)
  • test: use .js glob when using javascript as source (0cf978e)

1.0.0 (2018-06-19)

Features

  • initiate project with couple of tasks (5234a26)
  • contributing: add contributing task (b1552b7)
  • github: add github task (40a26be)
  • license: add task for the license file (fe9bf07)
  • package: add package task (1a15d81)
  • readme: add new readme task (a18be80)
  • task: add init task (9144015)