@simple-reporting/base 1.0.10 → 1.0.11

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.
package/dev/package.json CHANGED
@@ -19,7 +19,7 @@
19
19
  "postinstall": "npx srl prepare"
20
20
  },
21
21
  "dependencies": {
22
- "@simple-reporting/base": "^1.0.10",
22
+ "@simple-reporting/base": "^1.0.11",
23
23
  "axios": "^1.9.0",
24
24
  "chalk": "^5.4.1",
25
25
  "exceljs": "^4.4.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simple-reporting/base",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "Manage srl templates, build and publish",
5
5
  "bin": {
6
6
  "srl": "cli.js"
@@ -3,6 +3,16 @@ import { preparePublish } from './preparePublish.js';
3
3
  import { packageName } from './config.js';
4
4
  import { getPackageVersion } from './utils.js';
5
5
 
6
+ function isVersionGreater(v1, v2) {
7
+ const a = v1.split('.').map(Number);
8
+ const b = v2.split('.').map(Number);
9
+ for (let i = 0; i < 3; i++) {
10
+ if (a[i] > b[i]) return true;
11
+ if (a[i] < b[i]) return false;
12
+ }
13
+ return false;
14
+ }
15
+
6
16
  export async function doPublish(version = null) {
7
17
  try {
8
18
  const publishVersion = await preparePublish(version);
@@ -13,7 +23,7 @@ export async function doPublish(version = null) {
13
23
 
14
24
  const latest = await getPackageVersion(packageName);
15
25
 
16
- if (publishVersion > latest) {
26
+ if (isVersionGreater(publishVersion, latest)) {
17
27
  await execSync(
18
28
  `npm dist-tag add ${packageName}@${publishVersion} latest`,
19
29
  {