@sudoplatform/sudo-common 8.5.0 → 8.5.2

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/README.md CHANGED
@@ -6,3 +6,8 @@ This project provides tools and libraries to help with creating new Web SDK's an
6
6
 
7
7
  #### `yarn build`
8
8
 
9
+ ## Automatic Dependency Updates
10
+
11
+ In this project [Renovate](https://gitlab.tools.anonyome.com/platform/renovate) is used for scheduled dependency updates, where MRs will be created on the First Sunday of the Month.
12
+
13
+ For more information on the Renovate Dependency Update schedule, see [GC Platform Renovate Configuration](https://gitlab.tools.anonyome.com/platform/gc-platform-renovate-config).
@@ -1,5 +1,9 @@
1
1
  #!/bin/sh
2
2
 
3
+ ###
4
+ # This script is duplicated in platform-common. Any updates to this script here should also be adjusted in the platform-common repository.
5
+ ###
6
+
3
7
  set -e
4
8
  d="$(dirname "$0")"
5
9
 
@@ -48,6 +52,35 @@ suppression_from_diff_type() {
48
52
  esac
49
53
  }
50
54
 
55
+ #
56
+ # This function will determine whether a new outdated dependency will cause the script to fail.
57
+ # It compares the publish date of the wanted version and only populates 'new' when the publish date is outside 'stability_days'.
58
+ #
59
+ classify_outdated_dependency() {
60
+ dependency_name=$1
61
+ wanted_version=$2
62
+ # Get the publish date of the version that matches 'wanted', returning YYYY-MM-DD
63
+ publish_date=$(yarn info "$dependency_name" time --json | jq -r '.data | to_entries[] | select(.key == "'"$wanted_version"'") | .value | split("T") | .[0]')
64
+
65
+ # Convert the 'publish_date' variable to epoch
66
+ if [ -z "$CI" ]; then
67
+ # CI_COMMIT_BRANCH is undefined, running locally, use mac environment
68
+ publish_date_epoch=$(date -j -f '%Y-%m-%d' "$publish_date" '+%s')
69
+ else
70
+ # CI_COMMIT_BRANCH is defined, running in CI context, use busybox environment
71
+ publish_date_epoch=$(date -d "$publish_date" +%s)
72
+ fi
73
+
74
+ # Calculate the difference in days
75
+ diff_days=$(((current_epoch - publish_date_epoch) / 86400))
76
+
77
+ # Check if the difference in days is greater than or equal to 3, and set a new outdated dependency if it was not published in the last 3 days
78
+ if [ $diff_days -ge $stability_days ]; then
79
+ # The date is more than 3 days away from the current date, populate 'new' to return fail later
80
+ new=1
81
+ fi
82
+ }
83
+
51
84
  # Number of days to suppress if accepting or refreshing and cadence to run if --last specified
52
85
  cadence=30
53
86
 
@@ -63,6 +96,12 @@ refresh=""
63
96
  # timestamp is found
64
97
  last=""
65
98
 
99
+ # Define the number of days an outdated dependency exists for before it returns a fail. For example, if this is set to 3, it includes today, yesterday, and the day before.
100
+ stability_days=3
101
+
102
+ # Get the current date in epoch, this is used with stability_days and each outdated dependency's publish date to determine when the script should fail.
103
+ current_epoch=$(date +%s)
104
+
66
105
  while [ -n "${1}" ]; do
67
106
  case "${1}" in
68
107
  --cadence)
@@ -175,7 +214,8 @@ yarn outdated --json | jq -r -s -c 'map(select(.type == "table").data.body) | .[
175
214
  "${suppress_outdated}" --suppression "${cadence}" --"${latest_diff_type}" "${package_name}"
176
215
  else
177
216
  echo "${package_name}: current: ${current} wanted: ${wanted} latest: ${latest} [${outdated_diff_type} outdated]"
178
- new=1
217
+ classify_outdated_dependency "$package_name" "$wanted"
218
+
179
219
  fi
180
220
  elif [ -n "${accept}${refresh}" ]; then
181
221
  echo "${package_name}: current: ${current} wanted: ${wanted} latest: ${latest} [${suppression_type} suppression refreshed]"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sudoplatform/sudo-common",
3
- "version": "8.5.0",
3
+ "version": "8.5.2",
4
4
  "author": "Anonyome Labs, Inc.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -51,34 +51,34 @@
51
51
  "resolutions": {
52
52
  "**/apollo-cache-inmemory": "^1.6.6",
53
53
  "**/apollo-client": "^2.6.10",
54
- "json5": "^1.0.2"
54
+ "xml2js": "^0.6.0"
55
55
  },
56
56
  "dependencies": {
57
- "@aws-sdk/client-s3": "3.295.0",
57
+ "@aws-sdk/client-s3": "^3.342.0",
58
58
  "apollo-client": "^2.6.10",
59
59
  "asn1js": "^3.0.5",
60
60
  "browser-bunyan": "^1.8.0",
61
- "fflate": "^0.7.4",
61
+ "fflate": "^0.8.0",
62
62
  "graphql": "^15.8.0",
63
63
  "pkijs": "^3.0.14",
64
- "tslib": "^2.5.0"
64
+ "tslib": "^2.5.2"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "io-ts": "^2.2.16"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@types/jest": "^27.5.2",
71
- "@types/node": "^16.18.18",
72
- "@typescript-eslint/eslint-plugin": "^5.56.0",
73
- "@typescript-eslint/parser": "^5.56.0",
71
+ "@types/node": "16.18.34",
72
+ "@typescript-eslint/eslint-plugin": "^5.59.8",
73
+ "@typescript-eslint/parser": "^5.59.8",
74
74
  "aws-sdk-mock": "^5.8.0",
75
- "concurrently": "^7.6.0",
76
- "eslint": "^8.36.0",
75
+ "concurrently": "^8.1.0",
76
+ "eslint": "^8.41.0",
77
77
  "eslint-config-prettier": "^8.8.0",
78
78
  "eslint-plugin-import": "^2.27.5",
79
79
  "eslint-plugin-prettier": "^4.2.1",
80
80
  "eslint-plugin-tree-shaking": "^1.10.0",
81
- "fp-ts": "^2.13.1",
81
+ "fp-ts": "^2.16.0",
82
82
  "io-ts": "^2.2.20",
83
83
  "io-ts-types": "^0.5.19",
84
84
  "isomorphic-fetch": "^3.0.0",
@@ -86,23 +86,22 @@
86
86
  "jest": "^27.5.1",
87
87
  "monocle-ts": "^2.3.13",
88
88
  "newtype-ts": "^0.3.5",
89
- "prettier": "^2.8.5",
90
- "rimraf": "^4.4.0",
89
+ "prettier": "^2.8.8",
90
+ "rimraf": "^5.0.1",
91
91
  "ts-jest": "^27.1.5",
92
92
  "ts-mockito": "^2.6.1",
93
93
  "ts-node": "^10.9.1",
94
- "typedoc": "^0.23.28",
94
+ "typedoc": "^0.24.7",
95
95
  "typescript": "^4.9.5"
96
96
  },
97
97
  "outdatedSuppressions": {
98
98
  "major": {
99
- "@types/jest": 1681893993,
100
- "@types/node": 1681893993,
101
- "graphql": 1681893994,
102
- "jest": 1681893994,
103
- "ts-jest": 1681893994,
104
- "typescript": 1681893994,
105
- "json5": 1681893994
99
+ "@types/jest": 1684846723,
100
+ "@types/node": 1684846723,
101
+ "graphql": 1684846723,
102
+ "jest": 1684846723,
103
+ "ts-jest": 1684846723,
104
+ "typescript": 1684846723
106
105
  }
107
106
  }
108
107
  }