@meistrari/mise-en-place
v2.18.4
Published
Meistrari `mise-en-place` ---
Maintainers
Keywords
Readme
Meistrari mise-en-place
Before cooking anything, it's important to have your mise en place ready. This project helps you set up your development environment with essential configurations and tools.
Installation
Add mise-en-place postinstall to your project's package.json postinstall script to automatically set up the mise en place after installing dependencies:
{
"scripts": {
"postinstall": "mise-en-place postinstall"
}
}Then install the package as a development dependency and run the postinstall script:
bun i -D @meistrari/mise-en-place
bunx mise-en-place postinstallIt will also setup the initial mise-en-place in your project. Which includes:
- Updating an existing
Makefile, when present, to include useful commands. - Adding an
.editorconfigfile. - Adding ESLint configuration.
- Adding TypeScript configuration.
- Setting up
postinstallscript to keep all@meistrari/*packages up to date.
Features
Keep all @meistrari/* packages up to date
By adding the postinstall script to run mise-en-place postinstall, every time you run install your dependencies, it will check for the latest versions of all @meistrari/* packages in your project and update them if necessary.
This process will add a leading caret (^) to the version range if it is not already present. Which means that it will update to the latest minor and patch versions automatically but never the major version.
Configuration
You can customize the update behaviour through a miseEnPlace.updateMeistrariLibraries object in your package.json:
{
"miseEnPlace": {
"updateMeistrariLibraries": {
"enabled": true, // defaults to true. when false, the update is skipped
"exact": false, // defaults to false. when true, versions are written exact, without a range operator (^/~)
"packages": { // defaults to {}. unlisted @meistrari/* packages use "minor"
"@meistrari/package-1": "skip", // never touch this package's version
"@meistrari/package-2": "patch", // pin major and minor, update patch (~)
"@meistrari/package-3": "minor", // pin major, update minor and patch (^)
"@meistrari/package-4": "major" // update to the latest version, even across a major bump
}
}
}
}When exact is true, every updated package is written as an exact version: each package is still updated as far as its strategy allows, but the resulting version is written without a ^ or ~.
Makefile
The postinstall script does not create a Makefile automatically. To use the shared Makefile commands, create a Makefile and include this package's Makefile.
Commands with ## after the target are 'public' commands and are intended to be used by developers and will show up in the help message.
The other commands are 'hidden' and are intended to be used by automations or by other 'public' commands.
If you installed @meistrari/mise-en-place on a parent directory, you may need to set the MISE_EN_PLACE_INSTALL_DIR variable before including the Makefile:
MISE_EN_PLACE_INSTALL_DIR=.. # Parent directory
-include $(MISE_EN_PLACE_INSTALL_DIR)/node_modules/@meistrari/mise-en-place/Makefile
EditorConfig
Since the editorconfig file don't support extending from other files, the postinstall script will always copy the .editorconfig file from this project to your project root.
Eslint Config
Add the following code in your eslint.config.mjs to include this project's ESLint configuration:
export { default } from '@meistrari/mise-en-place/eslint'If some rules needs to be updated, you can update the rules in this project (preferrable) or customize them in your own configuration (not preferrable). You probably don't need to customize the configuration, since it is already designed to be a good starting point for most projects. Remember that customizing too much can make your project diverge from the standard and make it harder to maintain.
If you understand the risk and NEED to customize the configuration, you can import the default configuration and extend it:
import miseEnPlaceEslintConfig from '@meistrari/mise-en-place/eslint'
export default miseEnPlaceEslintConfig
.append({
rules: {
// your custom rules here
}
})TSConfig
Add the following code in your tsconfig.json to include this project's TypeScript configuration:
{
"extends": "./node_modules/@meistrari/mise-en-place/tsconfig.base.json"
}