Format: MAJOR.MINOR.PATCH
| Component | Description | Example |
|---|---|---|
| MAJOR | Breaking changes | 1.0.0 → 2.0.0 |
| MINOR | New features (compatible) | 1.0.0 → 1.1.0 |
| PATCH | Bug fixes (compatible) | 1.0.0 → 1.0.1 |
Minor and patch updates.
^1.2.3 = >=1.2.3, <2.0.0
^0.2.3 = >=0.2.3, <0.3.0
Patch updates only.
~1.2.3 = >=1.2.3, <1.3.0
| Operator | Example | Meaning |
|---|---|---|
= |
=1.2.3 |
Exact |
> |
>1.0.0 |
Greater than |
>= |
>=1.0.0 |
Greater or equal |
< |
<2.0.0 |
Less than |
<= |
<=2.0.0 |
Less or equal |
>=1.0.0, <2.0.0 # Any 1.x.x
>=1.2.0, <1.5.0 # 1.2.x to 1.4.x
MAI selects the highest matching version.
Example: ^1.2.0 with versions 1.0.0, 1.2.0, 1.9.9, 2.0.0
Resolved: 1.9.9
mai.lock pins exact versions.
Update:
mai update my-pack # Specific
mai update # All| Scenario | Recommendation |
|---|---|
| Stable library | ^1.2.3 |
| Critical dependency | ~1.2.3 or =1.2.3 |
| Early development | ^0.1.0 |
| Avoid bad version | >=1.0.0, !=1.2.3 |