@meistrari/mise-en-place 2.9.0 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/Makefile +2 -1
  2. package/README.md +31 -11
  3. package/package.json +1 -1
package/Makefile CHANGED
@@ -2,6 +2,7 @@
2
2
  default: help
3
3
 
4
4
  _MISE_EN_PLACE_PACKAGE_NAME = @meistrari/mise-en-place
5
+ MISE_EN_PLACE_INSTALL_DIR ?= .
5
6
 
6
7
  # region Public commands
7
8
 
@@ -21,7 +22,7 @@ mise-en-place: .editorconfig ## Setup the mise en place to start cooking
21
22
  .PHONY: help
22
23
  help:
23
24
  @echo "Make tasks:"
24
- @grep -hE '^[%a-zA-Z_-]+:.*?## .*$$' Makefile ./node_modules/$(_MISE_EN_PLACE_PACKAGE_NAME)/Makefile | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-17s\033[0m %s\n", $$1, $$2}'
25
+ @grep -hE '^[%a-zA-Z_-]+:.*?## .*$$' Makefile $(MISE_EN_PLACE_INSTALL_DIR)/node_modules/$(_MISE_EN_PLACE_PACKAGE_NAME)/Makefile | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-17s\033[0m %s\n", $$1, $$2}'
25
26
  @echo ""
26
27
 
27
28
  # endregion
package/README.md CHANGED
@@ -15,30 +15,33 @@ Add `mise-en-place postinstall` to your project's `package.json` `postinstall` s
15
15
  }
16
16
  ```
17
17
 
18
- Then install the package as a development dependency:
18
+ Then install the package as a development dependency and run the postinstall script:
19
19
  ```sh
20
- npm i -D @meistrari/mise-en-place
20
+ bun i -D @meistrari/mise-en-place
21
+ bunx mise-en-place postinstall
21
22
  ```
22
23
 
23
- After installing, it will create a `Makefile` in your project if one does not already exist.
24
- If you already have a `Makefile`, you can manually include this project's Makefile by adding the following line to your existing `Makefile`:
25
- ```makefile
26
- include ./node_modules/@meistrari/mise-en-place/Makefile
27
- ```
28
-
29
- It will also setup the initial _mise-en-place_ in your project.
24
+ It will also setup the initial _mise-en-place_ in your project. Which includes:
25
+ - Adding a `Makefile` with useful commands.
26
+ - Adding an `.editorconfig` file.
27
+ - Adding ESLint configuration.
28
+ - Adding TypeScript configuration.
29
+ - Setting up `postinstall` script to keep all `@meistrari/*` packages up to date.
30
30
 
31
31
  # Features
32
32
 
33
33
  ## Keep all @meistrari/* packages up to date
34
- By adding the `postinstall` script, every time you run `npm install`, it will check for the latest versions of all `@meistrari/*` packages in your project and update them if necessary.
34
+ 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.
35
+
36
+ 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.
35
37
 
36
38
  ## Makefile
37
39
  Commands with `##` after the target are 'public' commands and are intended to be used by developers and will show up in the help message.
40
+
38
41
  The other commands are 'hidden' and are intended to be used by automations or by other 'public' commands.
39
42
 
40
43
  ## EditorConfig
41
- Run `make .editorconfig` to copy this project's `.editorconfig` to your project.
44
+ Since the editorconfig file [don't support extending from other files](https://github.com/editorconfig/editorconfig/issues/236), the postinstall script will always copy the `.editorconfig` file from this project to your project root.
42
45
 
43
46
  ## Eslint Config
44
47
  Add the following code in your `eslint.config.mjs` to include this project's ESLint configuration:
@@ -47,6 +50,23 @@ Add the following code in your `eslint.config.mjs` to include this project's ESL
47
50
  export { default } from '@meistrari/mise-en-place/eslint'
48
51
  ```
49
52
 
53
+ > 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).
54
+ > You probably don't need to customize the configuration, since it is already designed to be a good starting point for most projects.
55
+ > Remember that customizing too much can make your project diverge from the standard and make it harder to maintain.
56
+
57
+ If you understand the risk and NEED to customize the configuration, you can import the default configuration and extend it:
58
+
59
+ ```ts
60
+ import miseEnPlaceEslintConfig from '@meistrari/mise-en-place/eslint'
61
+
62
+ export default miseEnPlaceEslintConfig
63
+ .append({
64
+ rules: {
65
+ // your custom rules here
66
+ }
67
+ })
68
+ ```
69
+
50
70
  ## TSConfig
51
71
 
52
72
  Add the following code in your `tsconfig.json` to include this project's TypeScript configuration:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/mise-en-place",
3
- "version": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",