@leverege/build-tools 2.111.0 → 2.112.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.112.0",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -103,12 +103,12 @@
|
|
|
103
103
|
"jsdoc": "^4.0.5",
|
|
104
104
|
"ms": "^2.1.3",
|
|
105
105
|
"npm-registry-fetch": "^20.0.1",
|
|
106
|
-
"ora": "^9.4.
|
|
106
|
+
"ora": "^9.4.1",
|
|
107
107
|
"p-limit": "^7.3.0",
|
|
108
108
|
"package-up": "^5.0.0",
|
|
109
109
|
"readline-sync": "^1.4.10",
|
|
110
|
-
"semver": "^7.8.
|
|
111
|
-
"shell-quote": "^1.
|
|
110
|
+
"semver": "^7.8.5",
|
|
111
|
+
"shell-quote": "^1.9.0",
|
|
112
112
|
"simple-git": "^3.36.0",
|
|
113
113
|
"sloc": "^0.3.2",
|
|
114
114
|
"superstruct": "^2.0.2",
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
warning,
|
|
19
19
|
} from '../Utils.mjs'
|
|
20
20
|
|
|
21
|
-
const ORB_VERSION = '2.
|
|
21
|
+
const ORB_VERSION = '2.2.0' // Keep this in sync with the versions in circle-npm.yml and circle-yarn.yml
|
|
22
22
|
const CIRCLE_DIR = '.circleci'
|
|
23
23
|
const CIRCLE_YML = `${CIRCLE_DIR}/config.yml`
|
|
24
24
|
const CIRCLE_NPM_TEMPLATE = path.join( BUILD_TOOLS_ROOT, 'circle-orb-it', 'circle-npm.yml' )
|
|
@@ -33,6 +33,7 @@ program
|
|
|
33
33
|
.description( chalk.green( 'Installs or updates CI and GitHub configuration files for a Leverege repository' ) )
|
|
34
34
|
.option( '--debug', 'Enable debug logging' )
|
|
35
35
|
.option( '--dry-run', 'Show what would be written without making changes' )
|
|
36
|
+
.option( '--version', 'Show the version of the latest leverege orb' )
|
|
36
37
|
.addHelpText( 'after', `
|
|
37
38
|
${chalk.yellow( 'Files managed:' )}
|
|
38
39
|
${chalk.green( CIRCLE_YML )} leverege orb v${ORB_VERSION}
|
|
@@ -51,6 +52,10 @@ ${chalk.yellow( 'Examples:' )}
|
|
|
51
52
|
|
|
52
53
|
const options = program.opts()
|
|
53
54
|
if ( options.debug ) { enableDebug() }
|
|
55
|
+
if ( options.version ) {
|
|
56
|
+
log( `${ORB_VERSION}` )
|
|
57
|
+
process.exit( 0 )
|
|
58
|
+
}
|
|
54
59
|
|
|
55
60
|
const gitRoot = await getGitRootDirectory()
|
|
56
61
|
if ( !gitRoot ) {
|
package/src/repo-panopticon.mjs
CHANGED
|
@@ -9,6 +9,7 @@ import { glob } from 'glob'
|
|
|
9
9
|
import ora from 'ora'
|
|
10
10
|
import pLimit from 'p-limit'
|
|
11
11
|
import simpleGit from 'simple-git'
|
|
12
|
+
import { $ } from 'zx'
|
|
12
13
|
|
|
13
14
|
import { clear, enableDebug, log, parseJsonFile } from './Utils.mjs'
|
|
14
15
|
|
|
@@ -21,6 +22,8 @@ const SYM_BAD = chalk.red( '✘' )
|
|
|
21
22
|
// Each check: { label: string, fn: ({ dir, pkg, isWorkspace }) => { value: string } }
|
|
22
23
|
// Add new checks here — the table expands automatically.
|
|
23
24
|
|
|
25
|
+
let latestOrbVersion = null
|
|
26
|
+
|
|
24
27
|
const CHECKS = [
|
|
25
28
|
{
|
|
26
29
|
label : 'cir',
|
|
@@ -29,12 +32,16 @@ const CHECKS = [
|
|
|
29
32
|
if ( !fs.existsSync( cfgPath ) ) return { value : SYM_BAD }
|
|
30
33
|
try {
|
|
31
34
|
const content = fs.readFileSync( cfgPath, 'utf8' )
|
|
32
|
-
const match = content.match( /leverege\/circle-nodejs-ci@(\d
|
|
33
|
-
if ( !match
|
|
34
|
-
const
|
|
35
|
+
const match = content.match( /leverege\/circle-nodejs-ci@(\d+\.\d+\.\d+)/ )
|
|
36
|
+
if ( !match ) return { value : chalk.hex( '#FFA500' )( 'L' ) }
|
|
37
|
+
const [ majorStr ] = match[1].split( '.' )
|
|
38
|
+
const major = parseInt( majorStr, 10 )
|
|
39
|
+
if ( major === 0 ) return { value : chalk.hex( '#FFA500' )( 'L' ) }
|
|
35
40
|
if ( major === 1 ) return { value : chalk.yellow( '1' ) }
|
|
41
|
+
const isLatest = !latestOrbVersion || match[1] === latestOrbVersion
|
|
42
|
+
const color = isLatest ? chalk.green : chalk.yellow
|
|
36
43
|
const hasGHA = fs.existsSync( path.join( dir, '.github', 'workflows', 'ci.yml' ) )
|
|
37
|
-
return { value : hasGHA ?
|
|
44
|
+
return { value : hasGHA ? color( '★' ) : color( `${major}` ) }
|
|
38
45
|
} catch {
|
|
39
46
|
return { value : chalk.hex( '#FFA500' )( 'L' ) }
|
|
40
47
|
}
|
|
@@ -329,7 +336,7 @@ ${chalk.yellow( 'Columns:' )}
|
|
|
329
336
|
${chalk.green( 'git' )} latest semver git tag (green=match, yellow=mismatch, red=untagged)
|
|
330
337
|
${chalk.green( 'name' )} orange if dirty: pull/fetch failed (regular repos) or local modifications present (workspace packages)
|
|
331
338
|
${chalk.green( 'scope' )} package scope: @org, PRVT, or PUBL
|
|
332
|
-
${chalk.green( 'cir' )} CI status: ✘=missing, L=legacy, 1=orb v1, 2
|
|
339
|
+
${chalk.green( 'cir' )} CI status: ✘=missing, L=legacy, 1=orb v1, green 2/★=orb v2 current, yellow 2/★=orb v2 stale
|
|
333
340
|
${chalk.green( 'ESM' )} "type": "module" in package.json
|
|
334
341
|
${chalk.green( 'har' )} .har directory present at repo root
|
|
335
342
|
${chalk.green( 'lnt' )} ESLint version from node_modules (✘=no lint script, ?=not installed, yellow=v8, green=v9+)
|
|
@@ -352,6 +359,10 @@ if ( options.debug ) { enableDebug() }
|
|
|
352
359
|
|
|
353
360
|
if ( options.clear ) { clear() }
|
|
354
361
|
|
|
362
|
+
try {
|
|
363
|
+
latestOrbVersion = ( await $`circle-orb-it --version` ).stdout.trim()
|
|
364
|
+
} catch { /* circle-orb-it not in PATH — degrade gracefully, all v2 shows green */ }
|
|
365
|
+
|
|
355
366
|
// Auto-expand workspace packages from any monorepo roots in the input.
|
|
356
367
|
// Supports both array and yarn-style { packages: [...] } workspaces fields.
|
|
357
368
|
async function expandWorkspaces( dir ) {
|