@helpers4/version 2.0.0-alpha.1 → 2.0.0-alpha.10

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.
@@ -0,0 +1,90 @@
1
+ {
2
+ "category": "version",
3
+ "functions": [
4
+ {
5
+ "name": "compare",
6
+ "examples": [
7
+ {
8
+ "title": "Compare two semver versions",
9
+ "description": "Returns -1, 0, or 1 based on SemVer ordering.",
10
+ "code": "compare('1.0.0', '2.0.0') // => -1\ncompare('1.0.0', '1.0.0') // => 0\ncompare('2.0.0', '1.0.0') // => 1"
11
+ },
12
+ {
13
+ "title": "Prerelease is lower than release",
14
+ "description": "A prerelease version is always less than the release.",
15
+ "code": "compare('1.0.0-alpha', '1.0.0')\n// => -1"
16
+ }
17
+ ]
18
+ },
19
+ {
20
+ "name": "increment",
21
+ "examples": [
22
+ {
23
+ "title": "Increment the patch version",
24
+ "description": "Bumps the patch number while keeping major and minor.",
25
+ "code": "increment('1.2.3', 'patch')\n// => '1.2.4'"
26
+ },
27
+ {
28
+ "title": "Increment the minor version",
29
+ "description": "Bumps the minor number and resets patch to 0.",
30
+ "code": "increment('1.2.3', 'minor')\n// => '1.3.0'"
31
+ },
32
+ {
33
+ "title": "Preserve the v prefix",
34
+ "description": "The v prefix is preserved if present in the input.",
35
+ "code": "increment('v1.0.0', 'major')\n// => 'v2.0.0'"
36
+ }
37
+ ]
38
+ },
39
+ {
40
+ "name": "parse",
41
+ "examples": [
42
+ {
43
+ "title": "Parse a semver string",
44
+ "description": "Breaks a semantic version string into its components.",
45
+ "code": "parse('1.2.3')\n// => { major: 1, minor: 2, patch: 3, prerelease: [], build: [] }"
46
+ },
47
+ {
48
+ "title": "Parse a prerelease version",
49
+ "description": "Handles prerelease identifiers and optional v prefix.",
50
+ "code": "parse('v2.0.0-alpha.1')\n// => { major: 2, minor: 0, patch: 0, prerelease: ['alpha', '1'], build: [] }"
51
+ }
52
+ ]
53
+ },
54
+ {
55
+ "name": "satisfiesRange",
56
+ "examples": [
57
+ {
58
+ "title": "Check caret range",
59
+ "description": "Caret (^) allows patch and minor updates within the same major.",
60
+ "code": "satisfiesRange('1.2.3', '^1.0.0')\n// => true"
61
+ },
62
+ {
63
+ "title": "Check greater-than-or-equal range",
64
+ "description": "The >= operator checks if the version is at least the specified value.",
65
+ "code": "satisfiesRange('2.0.0', '>=1.5.0')\n// => true"
66
+ },
67
+ {
68
+ "title": "Out of range",
69
+ "description": "Returns false when the version does not satisfy the range.",
70
+ "code": "satisfiesRange('0.9.0', '>=1.0.0')\n// => false"
71
+ }
72
+ ]
73
+ },
74
+ {
75
+ "name": "stripV",
76
+ "examples": [
77
+ {
78
+ "title": "Remove v prefix from a version string",
79
+ "description": "Strips the leading \"v\" from a git tag-style version string.",
80
+ "code": "stripV('v1.2.3')\n// => '1.2.3'"
81
+ },
82
+ {
83
+ "title": "No-op when there is no v prefix",
84
+ "description": "Returns the string unchanged when it does not start with \"v\".",
85
+ "code": "stripV('1.2.3')\n// => '1.2.3'"
86
+ }
87
+ ]
88
+ }
89
+ ]
90
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "category": "version",
3
+ "dependencies": []
4
+ }
package/package.json CHANGED
@@ -1,36 +1,47 @@
1
1
  {
2
2
  "name": "@helpers4/version",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-alpha.10",
4
4
  "description": "A set of helpers in TS/JS, compatible with tree-shaking, for version.",
5
5
  "author": "baxyz <baxy@etik.com>",
6
- "license": "AGPL-3.0",
6
+ "license": "LGPL-3.0",
7
+ "homepage": "https://helpers4.dev/typescript/categories/version/",
7
8
  "repository": {
8
9
  "type": "git",
9
- "url": "git+https://github.com/helpers4/helpers4.git"
10
+ "url": "git+https://github.com/helpers4/typescript.git"
10
11
  },
11
12
  "type": "module",
13
+ "sideEffects": false,
12
14
  "main": "lib/index.js",
13
15
  "types": "lib/index.d.ts",
14
16
  "exports": {
15
17
  ".": {
16
18
  "types": "./lib/index.d.ts",
17
19
  "import": "./lib/index.js"
18
- }
20
+ },
21
+ "./meta/api.json": "./meta/api.json",
22
+ "./meta/examples.json": "./meta/examples.json",
23
+ "./meta/licenses.json": "./meta/licenses.json",
24
+ "./package.json": "./package.json"
19
25
  },
20
26
  "keywords": [
21
27
  "helpers",
22
28
  "version",
23
29
  "compare",
24
- "stripV",
30
+ "increment",
31
+ "parse",
25
32
  "satisfiesRange",
26
- "increment"
33
+ "stripV"
27
34
  ],
28
35
  "files": [
29
36
  "lib/index.js",
30
37
  "lib/index.d.ts",
31
38
  "lib/index.js.map",
39
+ "meta/",
32
40
  "LICENSE.md",
33
41
  "package.json",
34
42
  "README.md"
35
- ]
43
+ ],
44
+ "engines": {
45
+ "node": ">=18.0.0"
46
+ }
36
47
  }