adonis-mrm is a preset of tasks for mrm which is a command line tool for scaffolding new projects and keeping their configurations in sync. We’ll be using it to scaffold the package.
adonis-mrm is a preset of tasks for mrm which is a command line tool for scaffolding new projects and keeping their configurations in sync. We’ll be using it to scaffold the package.
adonis-mrm is a preset of tasks for mrm which is a command line tool for scaffolding new projects and keeping their configurations in sync. We’ll be using it to scaffold the package.
Now, let's start building the package. We'll copy over the package implementation from the tutorial and register it with the AdonisJS IoC container.
In the lesson, we’ll be covering how to make the package configurable. That is, using node ace configure
.
Before we start using the package in an AdonisJS project, let’s add types for the package so it plays nicely with TypeScript.
Now, let's test what we have so far. Instead of having to first publish the package to npm, we will be using an npm package called Yalc, which allows us to test or use npm packages locally.
There are times we might want our package to make use of user-defined configurations. You might have seen that in most Adonis packages. In this lesson, we will cover how to do that.
In the last lesson, we saw how to work with template files using the automatic method. In this lesson, we are going to cover how to do the same thing and more using the manual method.
instructions.ts
to manually create template filesThere are times we might want to pass additional instructions or information after users might have installed and configured our package. We can achieve that using the instructions.md file and in this lesson, we’ll cover how to do just that.
The package is now feature complete. What’s left is making it available to the world by publishing it to npm.
To wrap up this course, I have put together a package development skeleton based off of this course for quickly scaffolding and building AdonisJS packages.
I’m a self-taught software developer based in Lagos, Nigeria, with over 8 years of experience. In the last couple of years, I've been doing more teaching because I enjoy sharing my knowledge so that others can benefit from it. Come along as I teach you all I know about AdonisJS, Node.js, and JavaScript at large!
No comments yet.