@leverege/build-tools 2.115.0 → 2.115.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.115.
|
|
3
|
+
"version": "2.115.2",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"generate-docs": "src/generate-docs.mjs",
|
|
39
39
|
"getfbcfg": "src/getfbcfg.mjs",
|
|
40
40
|
"getjson": "src/getjson.mjs",
|
|
41
|
+
"gh-audit-log": "src/gh-audit-log.mjs",
|
|
41
42
|
"git-tar": "src/git-tar.sh",
|
|
42
43
|
"github-actions-it": "src/github-actions-it.mjs",
|
|
43
44
|
"helm-audit": "src/helm-audit.mjs",
|
|
@@ -89,7 +90,7 @@
|
|
|
89
90
|
}
|
|
90
91
|
},
|
|
91
92
|
"dependencies": {
|
|
92
|
-
"@kubernetes/client-node": "^
|
|
93
|
+
"@kubernetes/client-node": "^2.0.0",
|
|
93
94
|
"@leverege/jsdoc-template": "^1.0.1",
|
|
94
95
|
"chalk": "^6.0.0",
|
|
95
96
|
"command-line-args": "^6.0.2",
|
|
@@ -100,10 +101,10 @@
|
|
|
100
101
|
"execa": "^10.0.1",
|
|
101
102
|
"find-yarn-workspace-root": "^2.0.0",
|
|
102
103
|
"glob": "^13.0.6",
|
|
103
|
-
"googleapis": "^
|
|
104
|
+
"googleapis": "^176.0.0",
|
|
104
105
|
"handlebars": "^4.7.9",
|
|
105
106
|
"ignore": "^7.0.6",
|
|
106
|
-
"inquirer": "^14.0
|
|
107
|
+
"inquirer": "^14.1.0",
|
|
107
108
|
"js-yaml": "^4.2.0",
|
|
108
109
|
"jsdoc": "^4.0.5",
|
|
109
110
|
"ms": "^2.1.3",
|
|
@@ -124,6 +124,29 @@ SKIP_CNPG_SA_CREATION
|
|
|
124
124
|
gsutil ubla set on $BARMAN_BUCKET # uniform bucket access
|
|
125
125
|
fi
|
|
126
126
|
|
|
127
|
+
# Apply WAL lifecycle policy idempotently: Coldline after 7 days, delete after 30.
|
|
128
|
+
# Matches the 21-day snapshot retention window with buffer.
|
|
129
|
+
if gsutil lifecycle get $BARMAN_BUCKET 2>/dev/null | grep -q "COLDLINE"; then
|
|
130
|
+
printf "\nBarman bucket lifecycle already configured - skipping\n"
|
|
131
|
+
else
|
|
132
|
+
printf "\nApplying lifecycle policy to barman bucket `color g $BARMAN_BUCKET`\n"
|
|
133
|
+
cat<<LIFECYCLE | gsutil lifecycle set /dev/stdin $BARMAN_BUCKET
|
|
134
|
+
{
|
|
135
|
+
"rule": [
|
|
136
|
+
{
|
|
137
|
+
"action": {"type": "SetStorageClass", "storageClass": "COLDLINE"},
|
|
138
|
+
"condition": {"age": 7}
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"action": {"type": "Delete"},
|
|
142
|
+
"condition": {"age": 30}
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
LIFECYCLE
|
|
147
|
+
exitOnError $? "Failed to set lifecycle policy on $BARMAN_BUCKET"
|
|
148
|
+
fi
|
|
149
|
+
|
|
127
150
|
# define the snapshot storage class
|
|
128
151
|
printf "\nApplying the CNPG VolumeSnapshotClass `color g cnpg-snapshotclass` definition\n"
|
|
129
152
|
cat<<EOSNAPSC | kubectl apply -f -
|
package/src/helmup.sh
CHANGED
|
@@ -59,7 +59,7 @@ for arg in "$@"; do
|
|
|
59
59
|
export BUILD_TOOLS_DEBUG=1
|
|
60
60
|
;;
|
|
61
61
|
--dry-run)
|
|
62
|
-
export HELM_WHAT="--dry-run --debug"
|
|
62
|
+
export HELM_WHAT="--dry-run=client --debug"
|
|
63
63
|
export K8S_WHAT="--dry-run=server -o yaml"
|
|
64
64
|
;;
|
|
65
65
|
*)
|
|
@@ -741,7 +741,7 @@ function doInstall() {
|
|
|
741
741
|
[ ! -z "$CHARTVER" ] && CHARTVER="--version $CHARTVER"
|
|
742
742
|
|
|
743
743
|
# set the dry-run flag on what
|
|
744
|
-
[ "$INVOKED_AS" == "helmwhat" ] && HELM_WHAT="--dry-run --debug" && K8S_WHAT="--dry-run=server -o yaml"
|
|
744
|
+
[ "$INVOKED_AS" == "helmwhat" ] && HELM_WHAT="--dry-run=client --debug" && K8S_WHAT="--dry-run=server -o yaml"
|
|
745
745
|
|
|
746
746
|
# helminit is used to redeploy an existing service
|
|
747
747
|
if [[ "$INVOKED_AS" == "helminit" ]] && isLeveregeService $SERVICE;
|
package/src/overwhelm.mjs
CHANGED
|
@@ -400,6 +400,9 @@ log( `\n\nExecuting: ${chalk.bold.yellow( cmd )}\n\n` )
|
|
|
400
400
|
try {
|
|
401
401
|
await shellCmd( cmd )
|
|
402
402
|
} catch ( error ) {
|
|
403
|
-
|
|
403
|
+
if ( error.stderr ) {
|
|
404
|
+
err( chalk.red( error.stderr ) )
|
|
405
|
+
}
|
|
406
|
+
err( chalk.red( '\n***ERROR: failed to fetch the Kubernetes context\n' ) )
|
|
404
407
|
process.exit( 1 )
|
|
405
408
|
}
|
package/src/prepack.mjs
CHANGED
|
@@ -18,15 +18,20 @@ const { compile, 'manual-tag' : manualTag, 'force-tag' : forceTag, 'push-tag' :
|
|
|
18
18
|
boolean : [ 'compile', 'manual-tag', 'force-tag', 'push-tag' ]
|
|
19
19
|
} )
|
|
20
20
|
|
|
21
|
-
try {
|
|
22
|
-
await $`git diff --exit-code --quiet`
|
|
23
|
-
} catch ( err ) {
|
|
24
|
-
console.log( chalk.redBright( 'Your git index is not clean. Stage and/or commit all changes before attempting to publish a version to npm.' ) )
|
|
25
|
-
process.exit( err.exitCode )
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const isYarn = ( await fs.exists( path.join( process.cwd(), 'yarn.lock' ) ) ) || ( await fs.exists( path.join( process.cwd(), '.yarn' ) ) )
|
|
29
21
|
const packageJson = await fs.readJSON( path.join( process.cwd(), 'package.json' ) )
|
|
22
|
+
const isYarn = ( await fs.exists( path.join( process.cwd(), 'yarn.lock' ) ) ) || ( await fs.exists( path.join( process.cwd(), '.yarn' ) ) )
|
|
23
|
+
const version = packageJson.version
|
|
24
|
+
const semanticVersion = semverParse( version )
|
|
25
|
+
const isPrerelease = semanticVersion.prerelease.length > 0
|
|
26
|
+
|
|
27
|
+
if ( !isPrerelease ) {
|
|
28
|
+
try {
|
|
29
|
+
await $`git diff --exit-code --quiet`
|
|
30
|
+
} catch ( err ) {
|
|
31
|
+
console.log( chalk.redBright( 'Your git index is not clean. Stage and/or commit all changes before attempting to publish a version to npm.' ) )
|
|
32
|
+
process.exit( err.exitCode )
|
|
33
|
+
}
|
|
34
|
+
}
|
|
30
35
|
|
|
31
36
|
if ( compile && packageJson.scripts?.compile != null ) {
|
|
32
37
|
try {
|
|
@@ -38,10 +43,6 @@ if ( compile && packageJson.scripts?.compile != null ) {
|
|
|
38
43
|
}
|
|
39
44
|
}
|
|
40
45
|
|
|
41
|
-
const version = packageJson.version
|
|
42
|
-
const semanticVersion = semverParse( version )
|
|
43
|
-
const isPrerelease = semanticVersion.prerelease.length > 0
|
|
44
|
-
|
|
45
46
|
if ( !isPrerelease || forceTag ) {
|
|
46
47
|
const name = packageJson.name.replace( /^@leverege\//, '' )
|
|
47
48
|
const isWorkspace = await isInWorkspace( process.cwd() )
|
|
@@ -66,7 +67,7 @@ if ( !isPrerelease || forceTag ) {
|
|
|
66
67
|
try {
|
|
67
68
|
await $( {
|
|
68
69
|
quiet : true
|
|
69
|
-
} )`git push
|
|
70
|
+
} )`git push origin ${tagName}`
|
|
70
71
|
} catch ( error ) {
|
|
71
72
|
process.stderr.write( chalk.redBright( 'Failed to push git tag with error:\n' ) )
|
|
72
73
|
process.stderr.write( error.text() )
|
|
@@ -90,14 +91,14 @@ function compileCmd( { isYarn } ) {
|
|
|
90
91
|
async function isInWorkspace( dir ) {
|
|
91
92
|
const parent = path.dirname( dir )
|
|
92
93
|
if ( parent === dir ) {
|
|
93
|
-
return false
|
|
94
|
+
return false
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
const parentPkgPath = path.join( parent, 'package.json' )
|
|
97
98
|
if ( await fs.exists( parentPkgPath ) ) {
|
|
98
99
|
const pkg = JSON.parse( await fs.readFile( parentPkgPath, 'utf8' ) )
|
|
99
100
|
if ( pkg.workspaces ) {
|
|
100
|
-
return true
|
|
101
|
+
return true
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
|
package/src/repo-panopticon.mjs
CHANGED
|
@@ -29,7 +29,10 @@ const CHECKS = [
|
|
|
29
29
|
label : 'cir',
|
|
30
30
|
fn : ( { gitRoot } ) => {
|
|
31
31
|
const cfgPath = path.join( gitRoot, '.circleci', 'config.yml' )
|
|
32
|
-
if ( !fs.existsSync( cfgPath ) )
|
|
32
|
+
if ( !fs.existsSync( cfgPath ) ) {
|
|
33
|
+
const hasGHA = fs.existsSync( path.join( gitRoot, '.github', 'workflows', 'ci.yml' ) )
|
|
34
|
+
return { value : hasGHA ? chalk.cyan( '★' ) : SYM_BAD }
|
|
35
|
+
}
|
|
33
36
|
try {
|
|
34
37
|
const content = fs.readFileSync( cfgPath, 'utf8' )
|
|
35
38
|
const match = content.match( /leverege\/circle-nodejs-ci@(\d+\.\d+\.\d+)/ )
|
|
@@ -339,7 +342,7 @@ ${chalk.yellow( 'Columns:' )}
|
|
|
339
342
|
${chalk.green( 'tag' )} latest semver git tag (green=match, yellow=mismatch, red=untagged)
|
|
340
343
|
${chalk.green( 'name' )} orange if dirty: pull/fetch failed (regular repos) or local modifications present (workspace packages)
|
|
341
344
|
${chalk.green( 'scope' )} package scope: @org, PRVT, or PUBL
|
|
342
|
-
${chalk.green( 'cir' )} CI status: ✘=missing, L=legacy, 1=orb v1, green 2/★=orb v2 current, yellow 2/★=orb v2 stale
|
|
345
|
+
${chalk.green( 'cir' )} CI status: ✘=missing, cyan ★=fully on GHA, L=legacy, 1=orb v1, green 2/★=orb v2 current, yellow 2/★=orb v2 stale
|
|
343
346
|
${chalk.green( 'ESM' )} "type": "module" in package.json
|
|
344
347
|
${chalk.green( 'har' )} .har directory present at repo root
|
|
345
348
|
${chalk.green( 'lnt' )} ESLint version from node_modules (✘=no lint script, ?=not installed, yellow=v8, green=v9+)
|