heartraite 1.0.10 → 1.0.13

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.
@@ -11,15 +11,15 @@ export type Match = {
11
11
  advancedMatchStatus: AdvancedMatchStatus;
12
12
  advancedMatch?: AdvancedMatch;
13
13
  };
14
- interface StrengthOrWeakness {
15
- title: string;
16
- summary: string;
17
- }
18
14
  export type AdvancedMatch = {
19
15
  strengths: StrengthOrWeakness[];
20
16
  weaknesses: StrengthOrWeakness[];
21
17
  summary: string;
22
18
  };
19
+ interface StrengthOrWeakness {
20
+ title: string;
21
+ summary: string;
22
+ }
23
23
  export type UserData = {
24
24
  id: string;
25
25
  intro: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heartraite",
3
- "version": "1.0.10",
3
+ "version": "1.0.13",
4
4
  "description": "Heartraite npm package for common functionality",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,17 +13,17 @@ export type Match = {
13
13
  advancedMatch?: AdvancedMatch;
14
14
  };
15
15
 
16
- interface StrengthOrWeakness {
17
- title: string;
18
- summary: string;
19
- }
20
-
21
16
  export type AdvancedMatch = {
22
17
  strengths: StrengthOrWeakness[];
23
18
  weaknesses: StrengthOrWeakness[];
24
19
  summary: string;
25
20
  };
26
21
 
22
+ interface StrengthOrWeakness {
23
+ title: string;
24
+ summary: string;
25
+ }
26
+
27
27
  export type UserData = {
28
28
  id: string;
29
29
  intro: string;
package/version-bump.js CHANGED
@@ -6,7 +6,7 @@ try {
6
6
  const packageJson = JSON.parse(fs.readFileSync("package.json", "utf8"));
7
7
  const currentVersion = packageJson.version;
8
8
 
9
- // Fetch the latest version from the registry
9
+ // Fetch the latest version from the npm registry
10
10
  let latestVersion;
11
11
  try {
12
12
  latestVersion = execSync("npm show heartraite version", {
@@ -22,31 +22,25 @@ try {
22
22
  console.log(`Current version: ${currentVersion}`);
23
23
  console.log(`Latest published version: ${latestVersion}`);
24
24
 
25
- // Determine the base version to increment
26
- const baseVersion =
27
- compareVersions(currentVersion, latestVersion) >= 0
28
- ? currentVersion
29
- : latestVersion;
30
-
31
- // Increment the patch version
32
- const versionParts = baseVersion.split(".");
33
- versionParts[2] = (parseInt(versionParts[2], 10) + 1).toString();
34
- const newVersion = versionParts.join(".");
25
+ // Ensure we only bump the version if currentVersion <= latestVersion
26
+ if (compareVersions(currentVersion, latestVersion) <= 0) {
27
+ // Increment the patch version
28
+ const versionParts = latestVersion.split(".");
29
+ versionParts[2] = (parseInt(versionParts[2], 10) + 1).toString();
30
+ const newVersion = versionParts.join(".");
31
+
32
+ // Update package.json with the new version
33
+ packageJson.version = newVersion;
34
+ fs.writeFileSync(
35
+ "package.json",
36
+ JSON.stringify(packageJson, null, 2) + "\n",
37
+ "utf8"
38
+ );
35
39
 
36
- if (newVersion === currentVersion) {
37
- console.log("Version is already up-to-date. No changes made.");
38
- process.exit(0);
40
+ console.log(`Version bumped from ${currentVersion} to ${newVersion}`);
41
+ } else {
42
+ console.log("Version is already ahead of the registry. No changes made.");
39
43
  }
40
-
41
- // Update package.json with the new version
42
- packageJson.version = newVersion;
43
- fs.writeFileSync(
44
- "package.json",
45
- JSON.stringify(packageJson, null, 2) + "\n",
46
- "utf8"
47
- );
48
-
49
- console.log(`Version bumped from ${currentVersion} to ${newVersion}`);
50
44
  } catch (error) {
51
45
  console.error("Error bumping version:", error.message);
52
46
  process.exit(1);