@leverege/build-tools 2.104.0 → 2.105.1

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
@@ -17,6 +17,7 @@ Most tools assume the following are installed and configured:
17
17
  - `helm` (v3+)
18
18
  - `fzf` (for interactive pod selection in `k8x` and `klog`)
19
19
  - Node.js 22+ - prefer 24
20
+ - npm 11.10+
20
21
 
21
22
  ---
22
23
 
@@ -121,12 +122,14 @@ Secrets are defined as JSON files in `src/service-man/config/secrets/`. See the
121
122
  ### Docker Image Management
122
123
 
123
124
  **`docker-to-registry`** — Builds and pushes Docker images (Node.js/general) to GCP
124
- Artifact Registry with git tagging.
125
+ Artifact Registry with git tagging. Any non-semver version string (e.g. `latest`) is
126
+ treated as a beta build and skips git tagging.
125
127
  ```bash
126
- docker-to-registry <version> # e.g. docker-to-registry v1.2.3
127
- docker-to-registry latest # beta build — any non-semver version skips git tagging
128
+ docker-to-registry v1.2.3 # tagged release build
129
+ docker-to-registry latest # beta build — skips git tagging
128
130
  docker-to-registry v1.2.3 --dry-run # skip confirmation prompt
129
131
  docker-to-registry guide-me # print helm/registry migration guidance
132
+ docker-to-registry v1.2.3 --debug # enable debug logging
130
133
  ```
131
134
 
132
135
  **`build-cnpg-image`** — Builds a custom CloudNative PostgreSQL image with jsquery and
@@ -221,11 +224,20 @@ package releases. Runs automatically as the npm `prepare` lifecycle hook.
221
224
  prepack [--compile] [--manual-tag] [--force-tag] [--push-tag]
222
225
  ```
223
226
 
224
- **`refresh-npm-token`** — Refreshes the Leverege npm registry token from GCP Secret
225
- Manager, updating `.npmrc` / `.yarnrc.yml`. Skips refresh if the token is less than
226
- 24 hours old.
227
- ```bash
228
- refresh-npm-token [--project <id>] [--force] [--dry-run]
227
+ **`refresh-npm-token`** — Fetches the current npm token and rc file templates from GCP
228
+ Secret Manager and overwrites `~/.npmrc` and `~/.yarnrc.yml`. DevOps controls the full
229
+ content of both files via three secrets: `REFRESH_NPM_TOKEN` (raw token),
230
+ `REFRESH_NPM_NPMRC`, and `REFRESH_NPM_YARNRC` (templates with `${REFRESH_NPM_TOKEN}`
231
+ placeholder). Skips refresh if `~/.npmrc` is less than 24 hours old. On first run,
232
+ existing rc files are preserved as `.LEGACY` before being overwritten.
233
+ ```bash
234
+ refresh-npm-token # refresh if older than 24h
235
+ refresh-npm-token --force # always refresh
236
+ refresh-npm-token --beta # use _BETA template secrets (migration testing)
237
+ refresh-npm-token --dry-run # fetch and validate without writing files
238
+ refresh-npm-token --no-version-check # warn on version requirements but continue
239
+ refresh-npm-token --no-update-yarnrc # skip ~/.yarnrc.yml update
240
+ refresh-npm-token --npmrc-age 1h # custom age threshold
229
241
  ```
230
242
 
231
243
  **`repo-panopticon`** — Multi-repo health dashboard. Checks each repository against a suite
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.104.0",
3
+ "version": "2.105.1",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -71,8 +71,8 @@
71
71
  },
72
72
  "author": "Leverege Devs",
73
73
  "engines": {
74
- "node": "^22.11 || >=24",
75
- "npm": ">=10.2 || >=11.6"
74
+ "node": "^22.22 || >=24.15",
75
+ "npm": ">=11.10"
76
76
  },
77
77
  "license": "SEE LICENSE IN LICENSE.md",
78
78
  "dependencies": {
@@ -87,24 +87,24 @@
87
87
  "execa": "^9.6.1",
88
88
  "find-yarn-workspace-root": "^2.0.0",
89
89
  "glob": "^13.0.6",
90
- "googleapis": "^171.4.0",
90
+ "googleapis": "^172.0.0",
91
91
  "handlebars": "^4.7.9",
92
92
  "ignore": "^7.0.5",
93
- "inquirer": "^13.4.3",
93
+ "inquirer": "^14.0.0",
94
94
  "js-yaml": "^4.1.1",
95
95
  "jsdoc": "^4.0.5",
96
96
  "ms": "^2.1.3",
97
- "npm-registry-fetch": "^19.1.1",
97
+ "npm-registry-fetch": "^20.0.0",
98
98
  "ora": "^9.4.0",
99
99
  "p-limit": "^7.3.0",
100
100
  "package-up": "^5.0.0",
101
101
  "readline-sync": "^1.4.10",
102
- "semver": "^7.8.0",
103
- "shell-quote": "^1.8.3",
102
+ "semver": "^7.8.1",
103
+ "shell-quote": "^1.8.4",
104
104
  "simple-git": "^3.36.0",
105
105
  "sloc": "^0.3.2",
106
106
  "superstruct": "^2.0.2",
107
- "tmp": "^0.2.5",
107
+ "tmp": "^0.2.7",
108
108
  "toml": "^4.1.1",
109
109
  "yaml": "^2.9.0",
110
110
  "zx": "^8.8.5"
@@ -113,7 +113,7 @@
113
113
  "@leverege/eslint-config-leverege": "^9.0.1",
114
114
  "chai": "^6.2.2",
115
115
  "eslint": "^9",
116
- "mocha": "^11.7.5",
117
- "npm": "^11.14.1"
116
+ "mocha": "^11.7.6",
117
+ "npm": "^11.16.0"
118
118
  }
119
119
  }
package/src/Utils.mjs CHANGED
@@ -146,6 +146,35 @@ export const shellCmd = async ( cmd, opts = {} ) => {
146
146
  }
147
147
  }
148
148
 
149
+ export const versionChecks = async ( { node, npm, strict = true } = {} ) => {
150
+ const check = ( tool, raw, { min, preferred, hint } = {} ) => {
151
+ const current = semver.coerce( raw )
152
+ if ( !current ) {
153
+ warning( `could not parse ${tool} version: "${raw}"` )
154
+ return
155
+ }
156
+ debug( { tool, current : current.version, min, preferred, strict }, '<==versionChecks' )
157
+ const hintSuffix = hint ? ` — ${hint}` : ''
158
+ if ( min && semver.lt( current, min ) ) {
159
+ const msg = `${tool} ${min} or later is required (found ${current.version})${hintSuffix}`
160
+ if ( strict ) {
161
+ errorExit( `***ERROR: ${msg}` )
162
+ } else {
163
+ warning( `${msg} — continuing due to --no-version-check` )
164
+ }
165
+ }
166
+ if ( preferred && semver.lt( current, preferred ) ) {
167
+ warning( `${tool} ${preferred} or later is preferred (found ${current.version})` )
168
+ }
169
+ }
170
+
171
+ if ( node ) { check( 'node', process.version, node ) }
172
+ if ( npm ) {
173
+ const raw = ( await shellCmd( 'npm --version' ) ).trim()
174
+ check( 'npm', raw, npm )
175
+ }
176
+ }
177
+
149
178
  export const establishOauthAccess = async ( registryLocation = 'us-docker.pkg.dev' ) => {
150
179
  // gcloud auth print-access-token | helm registry login -u oauth2accesstoken \
151
180
  // -p ${password} https://us-docker.pkg.dev
package/src/bash-funcs CHANGED
@@ -270,7 +270,7 @@ function sendToSlack() {
270
270
  read -rd '' slackmsg<<EOSLACK
271
271
  --- $running by \`$account\` in \`$GCP_PROJECT_ID\` @ $dts
272
272
  \`$toPost\`
273
- node `node --version` / `build-tools --version` / helm `helm version --short`
273
+ node `node --version` / npm `npm --version` / `build-tools --version` / helm `helm version --short`
274
274
  EOSLACK
275
275
  send-to-slack --project ${REFRESH_NPM_PROJECT:-leverege-registry} \
276
276
  --config REFRESH_NPM_SLACK_CONFIG \