Skip to content

Latest commit

 

History

History
79 lines (55 loc) · 1.41 KB

File metadata and controls

79 lines (55 loc) · 1.41 KB

Versioning

Semantic Versioning

Format: MAJOR.MINOR.PATCH

Component Description Example
MAJOR Breaking changes 1.0.02.0.0
MINOR New features (compatible) 1.0.01.1.0
PATCH Bug fixes (compatible) 1.0.01.0.1

Version Ranges

Caret (^) — Compatible

Minor and patch updates.

^1.2.3 = >=1.2.3, <2.0.0
^0.2.3 = >=0.2.3, <0.3.0

Tilde (~) — Patch-level

Patch updates only.

~1.2.3 = >=1.2.3, <1.3.0

Comparison Operators

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

Comma-Separated Ranges

>=1.0.0, <2.0.0    # Any 1.x.x
>=1.2.0, <1.5.0    # 1.2.x to 1.4.x

Resolution

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


Lock File

mai.lock pins exact versions.

Update:

mai update my-pack    # Specific
mai update            # All

Best Practices

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