@mnci/cli 1.19.1 → 1.19.3
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/dist/cli.js +9 -9
- package/dist/cli.js.map +1 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -1763,7 +1763,7 @@ var FLUTTER_TOOL_PATH_PRELUDE = `const fs=require('node:fs'),path=require('node:
|
|
|
1763
1763
|
var FLUTTER_TOOL_PATH_AZURE = `node -e "${FLUTTER_TOOL_PATH_PRELUDE}console.log('##vso[task.prependpath]'+bin)"`;
|
|
1764
1764
|
var FLUTTER_TOOL_PATH_GITHUB = `node -e "${FLUTTER_TOOL_PATH_PRELUDE}if(!process.env.GITHUB_PATH){console.log('Not running in GitHub Actions - skipping.');process.exit(0)}fs.appendFileSync(process.env.GITHUB_PATH,bin+${String.raw`'\n'`})"`;
|
|
1765
1765
|
var FLUTTER_PUB_GET_GUARD = `node -e "const fs=require('node:fs');if(!fs.existsSync('pubspec.yaml')){console.log('No Flutter projects - skipping.');process.exit(0)}process.exit(require('node:child_process').spawnSync('flutter',['pub','get'],{stdio:'inherit',shell:process.platform==='win32'}).status ?? 1)"`;
|
|
1766
|
-
var NPM_AUDIT_STEP = "npm audit
|
|
1766
|
+
var NPM_AUDIT_STEP = `node -e "const cp=require('node:child_process');const r=cp.spawnSync('npm',['audit','--json'],{encoding:'utf8',shell:process.platform==='win32',maxBuffer:33554432});let d;try{d=JSON.parse(r.stdout)}catch{console.log('npm audit produced no JSON (exit '+r.status+') - not blocking on a broken audit.');process.exit(0)}const all=Object.values(d.vulnerabilities||{});const BLOCK=['critical','high','moderate'];const act=all.filter(v=>v.fixAvailable&&BLOCK.includes(v.severity));const rest=all.filter(v=>!act.includes(v));for(const v of rest)console.log(' note ['+v.severity+'] '+v.name+(v.fixAvailable?' - fix available, below the blocking threshold':' - NO fix available upstream, nothing to do here'));if(act.length===0){console.log('npm audit - '+all.length+' advisory(ies), none actionable at moderate or above.');process.exit(0)}for(const v of act)console.log(' BLOCKING ['+v.severity+'] '+v.name+' - fix available'+(v.fixAvailable&&v.fixAvailable.isSemVerMajor?' (semver-major)':''));console.log('Each has a published fix. Add a targeted overrides entry in package.json rather than npm audit fix --force.');process.exit(1)"`;
|
|
1767
1767
|
var VERIFY_TARGETS = "lint,typecheck,test,build";
|
|
1768
1768
|
var AFFECTED_OR_ALL_GUARD = `node -e "const cp=require('node:child_process');const T='${VERIFY_TARGETS}';const all=()=>process.exit(cp.spawnSync('npx nx run-many -t '+T,{stdio:'inherit',shell:true}).status ?? 1);const ref=process.env.GITHUB_BASE_REF||process.env.SYSTEM_PULLREQUEST_TARGETBRANCH||'';if(!ref){console.log('Not a pull request - verifying EVERY project.');all()}const target=ref.replace('refs/heads/','');const mergeBase=r=>{const o=cp.spawnSync('git',['merge-base',r,'HEAD'],{encoding:'utf8'});return o.status===0?o.stdout.trim():''};let base=mergeBase('origin/'+target);if(!base){console.log('No origin/'+target+' ref - fetching it to resolve a merge-base.');cp.spawnSync('git',['fetch','--no-tags','origin',target],{stdio:'inherit'});base=mergeBase('FETCH_HEAD')}if(!base){console.log('Could not resolve a merge-base with '+target+' - verifying EVERY project.');all()}console.log('Pull request against '+target+' - verifying projects affected since '+base);process.exit(cp.spawnSync('npx nx affected -t '+T+' --base='+base,{stdio:'inherit',shell:true}).status ?? 1)"`;
|
|
1769
1769
|
var PACK_APPS_GUARD = `node -e "const fs=require('node:fs');fs.mkdirSync('dist/drop',{recursive:true});if(fs.globSync('apps/*/project.json').length===0){console.log('No apps to pack - skipping.');process.exit(0)}process.exit(require('node:child_process').spawnSync('npx nx run-many -t package',{stdio:'inherit',shell:true}).status ?? 1)"`;
|
|
@@ -1866,11 +1866,11 @@ steps:
|
|
|
1866
1866
|
env:
|
|
1867
1867
|
${npmAuthName}: ${npmAuthValue}
|
|
1868
1868
|
|
|
1869
|
-
#
|
|
1870
|
-
#
|
|
1871
|
-
#
|
|
1869
|
+
# Fails ONLY on an advisory that has a published fix, at moderate or above;
|
|
1870
|
+
# anything upstream has not fixed is printed and passes. See NPM_AUDIT_STEP's
|
|
1871
|
+
# remarks for why that split replaced a warn-only step.
|
|
1872
1872
|
- script: ${NPM_AUDIT_STEP}
|
|
1873
|
-
displayName: npm audit (
|
|
1873
|
+
displayName: npm audit (fails on an actionable advisory)
|
|
1874
1874
|
|
|
1875
1875
|
# Installs the fixed Python toolchain (ruff, pytest, build, twine, pip-audit)
|
|
1876
1876
|
# \u2014 written by 'mnci add' to requirements-dev.txt on the first Python
|
|
@@ -2066,11 +2066,11 @@ jobs:
|
|
|
2066
2066
|
env:
|
|
2067
2067
|
${npmAuthName}: ${npmAuthValue}
|
|
2068
2068
|
|
|
2069
|
-
#
|
|
2070
|
-
#
|
|
2071
|
-
#
|
|
2069
|
+
# Fails ONLY on an advisory that has a published fix, at moderate or
|
|
2070
|
+
# above; anything upstream has not fixed is printed and passes. See
|
|
2071
|
+
# NPM_AUDIT_STEP's remarks for why that split replaced a warn-only step.
|
|
2072
2072
|
- run: ${NPM_AUDIT_STEP}
|
|
2073
|
-
name: npm audit (
|
|
2073
|
+
name: npm audit (fails on an actionable advisory)
|
|
2074
2074
|
|
|
2075
2075
|
# Installs the fixed Python toolchain (ruff, pytest, build, twine,
|
|
2076
2076
|
# pip-audit) \u2014 written by 'mnci add' to requirements-dev.txt on the
|