@visulima/vis 3.0.0 → 3.0.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/CHANGELOG.md +8 -0
- package/LICENSE.md +5307 -4249
- package/dist/bin.js +1 -1
- package/dist/binx.js +2 -2
- package/dist/config/index.js +1 -1
- package/dist/packem_chunks/CONFIG_FILES.js +6 -6
- package/dist/packem_chunks/DEFAULT_CLEAN_KEEP.js +1 -1
- package/dist/packem_chunks/agent-instructions.js +7 -7
- package/dist/packem_chunks/bloom-status.js +2 -2
- package/dist/packem_chunks/bloom-sync.js +2 -2
- package/dist/packem_chunks/cache-attestation.js +1 -1
- package/dist/packem_chunks/catalog-detector.js +1 -1
- package/dist/packem_chunks/catalog.js +87 -111
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +192 -217
- package/dist/packem_chunks/defineReleasePlugin.js +3 -3
- package/dist/packem_chunks/detect.js +8 -3
- package/dist/packem_chunks/devtools.js +1 -1
- package/dist/packem_chunks/discord.js +4 -4
- package/dist/packem_chunks/dispatch.js +4 -4
- package/dist/packem_chunks/doctor-probe.js +2 -2
- package/dist/packem_chunks/extra-files.js +3 -3
- package/dist/packem_chunks/fix.js +11 -11
- package/dist/packem_chunks/git.js +3 -3
- package/dist/packem_chunks/group-tags.js +1 -1
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +5 -5
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +16 -16
- package/dist/packem_chunks/handler13.js +5 -5
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +5 -5
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +2 -2
- package/dist/packem_chunks/handler21.js +2 -2
- package/dist/packem_chunks/handler22.js +8 -8
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler26.js +5 -5
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +3 -3
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler3.js +2 -2
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler31.js +2 -2
- package/dist/packem_chunks/handler32.js +2 -2
- package/dist/packem_chunks/handler33.js +2 -2
- package/dist/packem_chunks/handler34.js +3 -3
- package/dist/packem_chunks/handler35.js +5 -5
- package/dist/packem_chunks/handler36.js +1 -1
- package/dist/packem_chunks/handler37.js +2 -2
- package/dist/packem_chunks/handler38.js +6 -6
- package/dist/packem_chunks/handler39.js +8 -8
- package/dist/packem_chunks/handler4.js +4 -4
- package/dist/packem_chunks/handler40.js +34 -34
- package/dist/packem_chunks/handler41.js +5 -5
- package/dist/packem_chunks/handler42.js +4 -4
- package/dist/packem_chunks/handler43.js +3 -3
- package/dist/packem_chunks/handler44.js +2 -2
- package/dist/packem_chunks/handler45.js +1 -1
- package/dist/packem_chunks/handler46.js +1 -1
- package/dist/packem_chunks/handler47.js +1 -1
- package/dist/packem_chunks/handler48.js +3 -3
- package/dist/packem_chunks/handler49.js +1 -1
- package/dist/packem_chunks/handler5.js +6 -6
- package/dist/packem_chunks/handler50.js +6 -6
- package/dist/packem_chunks/handler51.js +13 -13
- package/dist/packem_chunks/handler52.js +3 -3
- package/dist/packem_chunks/handler53.js +5 -5
- package/dist/packem_chunks/handler54.js +2 -2
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler56.js +4 -4
- package/dist/packem_chunks/handler57.js +5 -5
- package/dist/packem_chunks/handler58.js +5 -5
- package/dist/packem_chunks/handler59.js +8 -8
- package/dist/packem_chunks/handler6.js +7 -7
- package/dist/packem_chunks/handler60.js +3 -3
- package/dist/packem_chunks/handler61.js +21 -21
- package/dist/packem_chunks/handler62.js +12 -12
- package/dist/packem_chunks/handler63.js +3 -3
- package/dist/packem_chunks/handler64.js +5 -5
- package/dist/packem_chunks/handler65.js +8 -8
- package/dist/packem_chunks/handler66.js +2 -2
- package/dist/packem_chunks/handler67.js +21 -21
- package/dist/packem_chunks/handler68.js +21 -21
- package/dist/packem_chunks/handler69.js +30 -30
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +9 -9
- package/dist/packem_chunks/handler71.js +17 -17
- package/dist/packem_chunks/handler72.js +104 -104
- package/dist/packem_chunks/handler73.js +20 -20
- package/dist/packem_chunks/handler74.js +45 -45
- package/dist/packem_chunks/handler75.js +27 -3
- package/dist/packem_chunks/handler76.js +3 -27
- package/dist/packem_chunks/handler77.js +68 -68
- package/dist/packem_chunks/handler78.js +30 -30
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +9 -9
- package/dist/packem_chunks/heal.js +11 -11
- package/dist/packem_chunks/help-command.js +7 -63
- package/dist/packem_chunks/index.js +1 -1
- package/dist/packem_chunks/index2.js +48 -804
- package/dist/packem_chunks/index3.js +3 -7
- package/dist/packem_chunks/index4.js +803 -134
- package/dist/packem_chunks/index5.js +7 -73
- package/dist/packem_chunks/index6.js +73 -0
- package/dist/packem_chunks/index7.js +135 -0
- package/dist/packem_chunks/interface.js +2 -2
- package/dist/packem_chunks/keys-refresh.js +4 -4
- package/dist/packem_chunks/lean.js +3 -3
- package/dist/packem_chunks/list.js +3 -3
- package/dist/packem_chunks/loader.js +4 -4
- package/dist/packem_chunks/loader2.js +1 -1
- package/dist/packem_chunks/orchestrator.js +27 -27
- package/dist/packem_chunks/pre-mode.js +2 -2
- package/dist/packem_chunks/print-config.js +1 -1
- package/dist/packem_chunks/prompts.js +7 -7
- package/dist/packem_chunks/prune.js +3 -3
- package/dist/packem_chunks/publish-guards.js +1 -1
- package/dist/packem_chunks/resolveFormatter.js +5 -5
- package/dist/packem_chunks/run.js +1 -1
- package/dist/packem_chunks/security.js +1 -1
- package/dist/packem_chunks/shell-runner.js +1 -1
- package/dist/packem_chunks/slack.js +2 -2
- package/dist/packem_chunks/snapshot.js +2 -2
- package/dist/packem_chunks/stage-publisher.js +1 -1
- package/dist/packem_chunks/staged-registry.js +2 -2
- package/dist/packem_chunks/state.js +3 -3
- package/dist/packem_chunks/status.js +2 -2
- package/dist/packem_chunks/success-walk.js +4 -4
- package/dist/packem_chunks/sync.js +2 -2
- package/dist/packem_chunks/sync2.js +2 -2
- package/dist/packem_chunks/tar.js +3 -3
- package/dist/packem_chunks/tripwire.js +2 -2
- package/dist/packem_chunks/ts-loader.js +5 -9
- package/dist/packem_chunks/verify-lockfile.js +2 -2
- package/dist/packem_chunks/version-resolver.js +2 -2
- package/dist/packem_chunks/webhook.js +1 -1
- package/dist/packem_chunks/workflow-templates.js +5 -5
- package/dist/packem_chunks/workspace.js +2 -2
- package/dist/packem_shared/ReleaseClient-DAvbxCdo.js +1 -0
- package/dist/packem_shared/Table-DyORjLji-CC9cYgCG.js +11 -0
- package/dist/packem_shared/{VisReleaseError-DMGRBTNO.js → VisReleaseError-DZtgcKf8.js} +1 -1
- package/dist/packem_shared/_commonjsHelpers-DTfxOvZk.js +1 -0
- package/dist/packem_shared/advisories-CyDqzi5j.js +1 -0
- package/dist/packem_shared/affected-selection-DPQR-Bd3.js +1 -0
- package/dist/packem_shared/affected-shas-Dd0P7fGD.js +1 -0
- package/dist/packem_shared/ai-analysis-DSQQDFU9.js +68 -0
- package/dist/packem_shared/ai-fix-6nXZbecQ.js +43 -0
- package/dist/packem_shared/augment-COAiXSIx.js +4 -0
- package/dist/packem_shared/bin-wafzkjaB.js +1 -0
- package/dist/packem_shared/build-scripts-pdVmqXRm.js +1 -0
- package/dist/packem_shared/clean-DRiLimTx.js +1 -0
- package/dist/packem_shared/command-runtime-CiLVo4ED.js +1 -0
- package/dist/packem_shared/{compile-cache-B_Vf_WxT.js → compile-cache-DoMHRsRZ.js} +1 -1
- package/dist/packem_shared/createAdapter-F7GidOzU.js +1 -0
- package/dist/packem_shared/createVersionActions-ByaJ1Nbv.js +1 -0
- package/dist/packem_shared/cyclonedx-C_ezHg8b.js +4 -0
- package/dist/packem_shared/dependency-scan-DBH2Qo4I.js +1 -0
- package/dist/packem_shared/docker-Br_iFmI-.js +59 -0
- package/dist/packem_shared/failure-log-D92tM0ie.js +2 -0
- package/dist/packem_shared/formatBytes-BHAzNIrn-DFIppnY0.js +4 -0
- package/dist/packem_shared/getRandomSpinner-4ZEcbTYv-DCyIuj19.js +1 -0
- package/dist/packem_shared/giget-CVyyR7x8.js +2 -0
- package/dist/packem_shared/glob-Cyk1H9ZL-ox19CSsT.js +1 -0
- package/dist/packem_shared/index-B4AjSxHU.js +1 -0
- package/dist/packem_shared/index-BisalDCf.js +39 -0
- package/dist/packem_shared/{index-BWl4DbMp.js → index-BjdW45xX.js} +1 -1
- package/dist/packem_shared/index-DHD8wb6Z.js +22 -0
- package/dist/packem_shared/index-DXPSWMbG.js +1 -0
- package/dist/packem_shared/index.server-CwSgbeN7.js +2 -0
- package/dist/packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js +1 -0
- package/dist/packem_shared/license-DvlYdo6T.js +1 -0
- package/dist/packem_shared/lifecycle-CfTZQHOG.js +2 -0
- package/dist/packem_shared/lockfile-35RFsJDs.js +1 -0
- package/dist/packem_shared/lockfile-DhHAaHN5.js +1 -0
- package/dist/packem_shared/main-BjJN8kWj.js +1 -0
- package/dist/packem_shared/manifests-BNSmpPF_.js +1 -0
- package/dist/packem_shared/min-release-age-ChzTC7_I.js +34 -0
- package/dist/packem_shared/missing-package-json-C0keIt78.js +1 -0
- package/dist/packem_shared/native-config-sync-BSzU4qUO.js +21 -0
- package/dist/packem_shared/osv-bloom-5wDAoZ1e.js +2 -0
- package/dist/packem_shared/otelPlugin-D8LL2-4L.js +1 -0
- package/dist/packem_shared/package-version-BJkg7-6H.js +4 -0
- package/dist/packem_shared/packument-C55kVxcQ.js +1 -0
- package/dist/packem_shared/{peer-warnings-BXAzXqY3.js → peer-warnings-CmYSxvql.js} +1 -1
- package/dist/packem_shared/pm-runner-de-jCq8q.js +1 -0
- package/dist/packem_shared/project-name-filter-BeREbPMI.js +7 -0
- package/dist/packem_shared/{prompt-BSAy8SMH.js → prompt-DMzaQEVa.js} +1 -1
- package/dist/packem_shared/provenance-CvfQEJPQ.js +1 -0
- package/dist/packem_shared/readJsonSync-CbryXYxN-B2aSeDpC.js +1 -0
- package/dist/packem_shared/registry-keys-DmBrAlhg.js +1 -0
- package/dist/packem_shared/resolve-explicit-COmP7eqr.js +5 -0
- package/dist/packem_shared/resolve-runtime-C7NBCA1C.js +1 -0
- package/dist/packem_shared/run-file-jMngGQhs.js +1 -0
- package/dist/packem_shared/runtime-check-BklgEMkC.js +1 -0
- package/dist/packem_shared/s1ngularity-RZOHbGrE.js +1 -0
- package/dist/packem_shared/scan-progress-C9nMDLis.js +2 -0
- package/dist/packem_shared/selectors-B7lSFz7l.js +3 -0
- package/dist/packem_shared/signatures-oZ_2IneN.js +2 -0
- package/dist/packem_shared/{slug-DoueYuLo.js → slug-OBHcH7wV.js} +1 -1
- package/dist/packem_shared/spinner-CbJfWYwB.js +1 -0
- package/dist/packem_shared/sticky-comment-DjhyCIZt.js +1 -0
- package/dist/packem_shared/subtree-DtmcKAJK.js +2 -0
- package/dist/packem_shared/symbols-BXDZ_sKt.js +1 -0
- package/dist/packem_shared/tabs-BilwonkM.js +1 -0
- package/dist/packem_shared/target-merge-D1xbylFw.js +4 -0
- package/dist/packem_shared/target-options-d_rIrLyq.js +1 -0
- package/dist/packem_shared/toolchain-DY11tPCw.js +5 -0
- package/dist/packem_shared/typosquats-D8ppc5kr.js +1 -0
- package/dist/packem_shared/use-measured-height-BPQg2q_p.js +1 -0
- package/dist/packem_shared/utils-DQFHJn72.js +1 -0
- package/dist/packem_shared/verify-D8wYvB85.js +1 -0
- package/dist/packem_shared/vis-update-app-ngwL2mRv.js +1 -0
- package/dist/packem_shared/vis-user-error-jhNwmkZp.js +30 -0
- package/dist/packem_shared/watch-Dswvj6Zp.js +1 -0
- package/dist/packem_shared/watch-loop-COWvvSbR.js +11 -0
- package/dist/packem_shared/writeFileSync-DJoHk3Ks-CgQ-VNNT.js +1 -0
- package/dist/release/core/changelog/index.d.ts +62 -2
- package/dist/release/core/package-managers/index.d.ts +25 -1
- package/dist/release/core/package-managers/index.js +1 -1
- package/dist/release/core/version-actions/index.d.ts +47 -2
- package/dist/release/core/version-actions/index.js +1 -1
- package/dist/release/index.d.ts +100 -1
- package/dist/release/index.js +1 -1
- package/dist/release/plugin-sdk.d.ts +16 -1
- package/dist/release/plugin-sdk.js +1 -1
- package/dist/release/presets.js +1 -1
- package/dist/release/types.js +1 -1
- package/dist/runtime/preload.js +1 -1
- package/index.js +26 -26
- package/package.json +9 -9
- package/dist/packem_chunks/detect2.js +0 -8
- package/dist/packem_chunks/registry.js +0 -48
- package/dist/packem_shared/ReleaseClient-BY4OZNCK.js +0 -1
- package/dist/packem_shared/_commonjsHelpers-B5Y90VFO.js +0 -1
- package/dist/packem_shared/advisories-DsXRmIA5.js +0 -1
- package/dist/packem_shared/affected-selection-BE6VFCDV.js +0 -1
- package/dist/packem_shared/affected-shas-BKEu4RZc.js +0 -1
- package/dist/packem_shared/ai-analysis-DikAj6rX.js +0 -68
- package/dist/packem_shared/ai-fix-bfWo0cZX.js +0 -43
- package/dist/packem_shared/augment-BkJxi_GW.js +0 -4
- package/dist/packem_shared/bin-B-TytgzW.js +0 -1
- package/dist/packem_shared/build-scripts-DWypBQ--.js +0 -1
- package/dist/packem_shared/clean-DWjQl14S.js +0 -1
- package/dist/packem_shared/command-runtime-DQ7ZpLYL.js +0 -1
- package/dist/packem_shared/createAdapter-bU4DIP3F.js +0 -1
- package/dist/packem_shared/createVersionActions-BK43SNDH.js +0 -1
- package/dist/packem_shared/cyclonedx-DLBi65MV.js +0 -4
- package/dist/packem_shared/dependency-scan-ZLOuLkGN.js +0 -1
- package/dist/packem_shared/docker-B4zAZCZG.js +0 -59
- package/dist/packem_shared/en-BDYMmM2_.js +0 -27
- package/dist/packem_shared/failure-log-DyhWPqno.js +0 -2
- package/dist/packem_shared/giget-CAxjpwew.js +0 -2
- package/dist/packem_shared/glob-BUjyjdE8-Dp_QcayW.js +0 -1
- package/dist/packem_shared/index-BAe6e0XE.js +0 -1
- package/dist/packem_shared/index-BLtnel38.js +0 -35
- package/dist/packem_shared/index-CuKDxOCI.js +0 -1
- package/dist/packem_shared/index-tNFGWxc0.js +0 -39
- package/dist/packem_shared/index.server-CusjRLCh.js +0 -2
- package/dist/packem_shared/license-t5KnNX6v.js +0 -1
- package/dist/packem_shared/lifecycle-KY9umOg6.js +0 -2
- package/dist/packem_shared/lockfile-YAuZf1gh.js +0 -1
- package/dist/packem_shared/main-D_cam4hv.js +0 -1
- package/dist/packem_shared/manifests-BwTn_1ad.js +0 -1
- package/dist/packem_shared/min-release-age-6avfn81h.js +0 -34
- package/dist/packem_shared/missing-package-json-Cl0vdz6K.js +0 -1
- package/dist/packem_shared/native-config-sync-CHMCJx7H.js +0 -21
- package/dist/packem_shared/osv-bloom-DdqDnLCt.js +0 -2
- package/dist/packem_shared/otelPlugin-DmKDBaPo.js +0 -1
- package/dist/packem_shared/package-version-BNRJ3o9C.js +0 -4
- package/dist/packem_shared/packument-B9-WqReu.js +0 -1
- package/dist/packem_shared/pm-runner-DRybtzOV.js +0 -1
- package/dist/packem_shared/project-name-filter-Dw0fC6IO.js +0 -7
- package/dist/packem_shared/provenance-CLxuqCfL.js +0 -1
- package/dist/packem_shared/readJsonSync-DweZd5ZA-CtrDlqpb.js +0 -1
- package/dist/packem_shared/registry-keys-cTN24144.js +0 -1
- package/dist/packem_shared/resolve-explicit-Uw6WQl9R.js +0 -5
- package/dist/packem_shared/resolve-runtime-DztanwkZ.js +0 -1
- package/dist/packem_shared/run-file-CaE5_xBY.js +0 -1
- package/dist/packem_shared/runtime-check-C32yE57I.js +0 -1
- package/dist/packem_shared/s1ngularity-BIYhg82u.js +0 -1
- package/dist/packem_shared/scan-progress-DWfY4zkp.js +0 -2
- package/dist/packem_shared/selectors-D2j4M9Ul.js +0 -3
- package/dist/packem_shared/signatures-C8iQ5fUq.js +0 -2
- package/dist/packem_shared/sticky-comment-D6_7-w8T.js +0 -1
- package/dist/packem_shared/subtree-DSm0QEoE.js +0 -2
- package/dist/packem_shared/symbols-DPTlrJ3B.js +0 -1
- package/dist/packem_shared/target-merge-DLxJTcxn.js +0 -11
- package/dist/packem_shared/target-options-3t4-2F-F.js +0 -1
- package/dist/packem_shared/toolchain-BPzbahcQ.js +0 -5
- package/dist/packem_shared/typosquats-BWrmhh36.js +0 -1
- package/dist/packem_shared/use-measured-height-BwAwGHjw.js +0 -1
- package/dist/packem_shared/utils-CRueU43T.js +0 -1
- package/dist/packem_shared/verify-CzUPT6Uk.js +0 -1
- package/dist/packem_shared/vis-update-app-D6Wq8ZHM.js +0 -1
- package/dist/packem_shared/vis-user-error-CfM4_ORo.js +0 -30
- package/dist/packem_shared/watch-D_oAxW_Z.js +0 -1
- package/dist/packem_shared/watch-loop-BrjblOz5.js +0 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as _}from"node:module";let
|
|
1
|
+
import{createRequire as _}from"node:module";let E;const x=e=>(E??=_(import.meta.url))(e),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=e=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[t,s]=p.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return p.getBuiltinModule(e)}return x(e)},{createHash:b}=h("node:crypto"),{createReadStream:j}=h("node:fs"),{lstat:R,realpath:T,stat:A}=h("node:fs/promises"),{resolve:g,isAbsolute:P,join:v,sep:w}=h("node:path"),y=(e,t)=>{const s=g(e),i=g(t),r=s.endsWith(w)?s:`${s}${w}`;return i===s||i.startsWith(r)},G=e=>{const t=Array.isArray(e)?e[0]:e;if(t===null||typeof t!="object")return;const{files:s}=t;if(!Array.isArray(s))return;const i=[];for(const r of s)r&&typeof r.path=="string"&&i.push(r.path);return i},L=["**/*.test.*","**/__tests__/**","**/__fixtures__/**"],D=async e=>{const t=[];let s;try{({scanFiles:s}=await import("@visulima/secret-scanner"))}catch{return{findings:[{hint:"pnpm add -D @visulima/secret-scanner, or set publish.guards.packSecretScan: false.",id:"packSecretScan:dep-missing",message:"publish.guards.packSecretScan is enabled but @visulima/secret-scanner is not installed."}],gate:"packSecretScan",passed:!1}}const i=[];for(const o of e.files){const a=P(o)?o:v(e.pkgDir,o);y(e.pkgDir,a)&&i.push(a)}const r=e.ignore??L,n=await s(i,{walk:{excludePatterns:[...r]}});for(const o of n)t.push({hint:"Add the file to .npmignore / package.json#files, or rotate the credential.",id:`packSecretScan:${o.ruleId}:${o.file}`,message:`${o.ruleId} match in ${o.file} (line ${o.startLine}, ${o.confidence} confidence).`});return{findings:t,gate:"packSecretScan",passed:t.length===0}},I=e=>typeof e=="string",m=(e,t,s)=>{if(e!==null){if(I(e)){s.push({keyPath:t,target:e});return}if(Array.isArray(e)){for(const[i,r]of e.entries())m(r,`${t}[${i}]`,s);return}if(typeof e=="object")for(const[i,r]of Object.entries(e))m(r,t===""?i:`${t}.${i}`,s)}},M=async(e,t)=>{if(!t.startsWith("./"))return!0;const s=t.replace(/^\.\//,""),i=s.includes("*"),r=i?s.split("*",1)[0].replace(/\/$/,""):s,n=v(e,r);if(!y(e,n))return!1;try{const o=await R(n);if(o.isSymbolicLink()){const a=await T(n);if(!y(e,a))return!1;const c=await A(a);return i?c.isDirectory():!0}return i?o.isDirectory():!0}catch{return!1}},O=async(e,t)=>{const s=[],i=[];for(const r of["main","module","types","typings","browser"]){const n=t[r];typeof n=="string"&&i.push({keyPath:r,target:n})}if(typeof t.bin=="string")i.push({keyPath:"bin",target:t.bin});else if(t.bin&&typeof t.bin=="object")for(const[r,n]of Object.entries(t.bin))typeof n=="string"&&i.push({keyPath:`bin.${r}`,target:n});t.exports!==void 0&&m(t.exports,"exports",i);for(const{keyPath:r,target:n}of i)await M(e,n)||s.push({hint:"Run the build before publishing, or remove the dangling export.",id:`exportsExist:${r}:${n}`,message:`Manifest field \`${r}\` points at \`${n}\` which does not exist in the pack root.`});return{findings:s,gate:"exportsExist",passed:s.length===0}},F=["preinstall","install","postinstall"],C=e=>e===void 0||e==="off"?{allow:{},mode:"off"}:typeof e=="string"?{allow:{},mode:e}:{allow:e.allow??{},mode:e.mode},N=(e,t)=>{const s=[],i=C(t);if(i.mode==="off")return{findings:s,gate:"lifecycleScripts",passed:!0};const r=e.scripts??{};for(const n of F){const o=r[n];o===void 0||i.allow[n]===o||s.push({hint:`Add to publish.guards.lifecycleScripts.allow.${n}, or set the gate to "warn"/"off".`,id:`lifecycleScripts:${n}`,message:`Lifecycle script \`${n}\` is set to \`${o}\` but is not in the allow-list.`})}return{findings:s,gate:"lifecycleScripts",passed:s.length===0}},$={critical:4,high:3,low:1,moderate:2},k=9e4,W=async(e,t,s)=>{const i=[];if(s===void 0||s==="off")return{findings:i,gate:"audit",passed:!0};const r=$[s]??4,n=Symbol("audit-timeout");let o;const a=new Promise(u=>{o=setTimeout(u,k,n)});let c;try{const u=await Promise.race([t.run("npm",["audit","--omit=dev","--json"],{cwd:e,silent:!0}),a]);if(u===n)return{findings:[{hint:'Network or registry outage — re-run later, or set publish.guards.audit: "off".',id:"audit:timeout",message:`\`npm audit\` exceeded ${k}ms and was aborted.`}],gate:"audit",passed:!1};c=u}finally{o&&clearTimeout(o)}let d;try{d=JSON.parse(c.stdout)}catch{return{findings:[{hint:c.stderr.trim()||"Re-run npm audit manually to inspect.",id:"audit:parse",message:`Could not parse \`npm audit\` output for ${e}.`}],gate:"audit",passed:!1}}const l=d.metadata?.vulnerabilities??{};for(const[u,f]of Object.entries(l)){if(f<=0)continue;const S=$[u];S!==void 0&&S>=r&&i.push({hint:"npm audit fix --omit=dev, or raise the threshold via publish.guards.audit.",id:`audit:${u}`,message:`${f} runtime ${u}-severity advisory(s) reported by npm audit.`})}return{findings:i,gate:"audit",passed:i.length===0}},U=async e=>{const t=g(e),s=b("sha256"),i=b("sha512");let r=0;return await new Promise((n,o)=>{const a=j(t);a.on("data",c=>{s.update(c),i.update(c),r+=c.length}),a.on("end",()=>{n()}),a.on("error",o)}),{path:t,sha256:s.digest("hex"),sha512:i.digest("hex"),size:r}},Y=async e=>{const t=e.config??{},s=[],i=(l,u)=>u.catch(f=>({findings:[{hint:"Re-run with --debug to capture the stack, or disable this gate.",id:`${l}:internal-error`,message:`Guard "${l}" threw: ${f instanceof Error?f.message:String(f)}`}],gate:l,passed:!1}));if(t.packSecretScan){const l=typeof t.packSecretScan=="object"?t.packSecretScan.ignore:void 0;s.push(i("packSecretScan",D({files:e.packFiles,ignore:l,pkgDir:e.pkgDir})))}t.exportsExist&&s.push(i("exportsExist",O(e.pkgDir,e.manifest))),t.audit&&t.audit!=="off"&&s.push(i("audit",W(e.pkgDir,e.runner,t.audit)));const r=await Promise.all(s),n=N(e.sourceManifest??e.manifest,t.lifecycleScripts),o=[...r];n.gate&&t.lifecycleScripts!==void 0&&t.lifecycleScripts!=="off"&&o.push(n);const a=typeof t.lifecycleScripts=="string"?t.lifecycleScripts:t.lifecycleScripts?.mode??"off",c=[],d=[];for(const l of o)l.passed||(l.gate==="lifecycleScripts"&&a==="warn"?d.push(l):c.push(l));return{blockers:c,results:o,warnings:d}};export{G as extractPackFilesFromRaw,U as hashTarball,O as runExportsExist,N as runLifecycleScripts,D as runPackSecretScan,Y as runPublishGuards,W as runRuntimeAudit};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{createRequire as
|
|
1
|
+
import{createRequire as k}from"node:module";import{createShellRunner as G}from"./shell-runner.js";let B;const S=e=>(B??=k(import.meta.url))(e),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=e=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[n,t]=g.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return g.getBuiltinModule(e)}return S(e)},{pathToFileURL:I}=T("node:url"),P=[{section:"Breaking Changes",type:"breaking"},{section:"Features",type:"feat"},{section:"Bug Fixes",type:"fix"},{section:"Performance Improvements",type:"perf"},{section:"Reverts",type:"revert"},{section:"Documentation",type:"docs"},{hidden:!0,section:"Styles",type:"style"},{hidden:!0,section:"Code Refactoring",type:"refactor"},{hidden:!0,section:"Tests",type:"test"},{hidden:!0,section:"Build System",type:"build"},{hidden:!0,section:"Continuous Integration",type:"ci"},{hidden:!0,section:"Miscellaneous Chores",type:"chore"}],V=/^(?<type>[a-z]+)(?:\([^)]+\))?!?:\s+/,j=/^(?:[\p{Emoji_Presentation}\p{Extended_Pictographic}]|:\w+:)\s+/u,L=e=>{const n=e.replace(j,""),t=V.exec(n);if(t?.groups?.type)return n.includes("!:")&&n.split("!:")[0]?.match(/^[a-z]+(?:\([^)]+\))?$/)?"breaking":t.groups.type},D=e=>`(${e.startsWith("@")?e:`@${e}`})`,N=(e,n)=>{for(const t of n){const o=t.line.startsWith("-")||t.line.startsWith("*")?t.line:`- ${t.line}`;e.push(`${o}${t.suffix}`)}},W=(e,n,t)=>{const o=new Map;for(const c of n){const r=c.type??"other",u=o.get(r)??[];u.push({line:c.line,suffix:c.suffix}),o.set(r,u)}for(const c of t){const r=o.get(c.type);if(c.hidden){o.delete(c.type);continue}if(!(!r||r.length===0)){e.push(`### ${c.section}`),e.push("");for(const u of r){const d=u.line.startsWith("-")||u.line.startsWith("*")?u.line:`- ${u.line}`;e.push(`${d}${u.suffix}`)}e.push(""),o.delete(c.type)}}if(!t.some(c=>c.type==="other"&&c.hidden)&&o.size>0){e.push("### Miscellaneous"),e.push("");for(const c of o.values())for(const r of c){const u=r.line.startsWith("-")||r.line.startsWith("*")?r.line:`- ${r.line}`;e.push(`${u}${r.suffix}`)}}},E=(e={})=>n=>{const{changeFiles:t,date:o,release:s,target:c}=n,r=[];c!=="github-release"&&(r.push(`## ${s.newVersion}`),r.push(`<sub>${o}</sub>`),r.push(""));const u=[];for(const a of t){const i=a.body.trim();if(!i)continue;const f=e.authorCredit?a.meta?.author:void 0,h=f?` ${D(f)}`:"";for(const m of i.split(/\r?\n/)){const p=m.trim();p&&u.push({line:p,suffix:h,type:L(p)})}}const d=e.sections===void 0?void 0:e.sections.length===0?P:e.sections;if(d?W(r,u,d):N(r,u),s.isCascadeBump||s.isGroupBump)for(const a of s.sources){const i=s.isCascadeBump?"Cascade from":"Group bump with";r.push(`- ${i} ${a.name}@${a.newVersion}`)}else if(s.isDependencyBump&&t.length===0)for(const a of s.sources)a.newVersion===""?r.push(`- Removed dependency ${a.name}`):r.push(`- Updated dependency ${a.name}@${a.newVersion}`);return r.join(`
|
|
2
2
|
`).replaceAll(/\n{3,}/g,`
|
|
3
3
|
|
|
4
|
-
`).trim()},
|
|
5
|
-
`)[0]?.trim()||void 0},
|
|
6
|
-
`)}},F=["Added","Changed","Deprecated","Removed","Fixed","Security"],
|
|
4
|
+
`).trim()},M=E(),O={includeCommitLink:!0,internalAuthors:[],thankContributors:!0},z=async(e,n,t)=>{if(e)return e;const{createRemoteClient:o,detectRemoteProvider:s}=await import("./detect.js"),c=await s(t,n,void 0);return o(c).detectRepoSlug(t,n)},U=async(e,n,t)=>{const o=await e.run("git",["log","--diff-filter=A","--pretty=format:%aN%n%aE","--",t],{cwd:n,silent:!0});return o.exitCode!==0?void 0:o.stdout.split(`
|
|
5
|
+
`)[0]?.trim()||void 0},H=(e,n)=>n?e.replaceAll(/(?<!\[)#(\d+)/g,(t,o)=>`[#${o}](https://github.com/${n}/issues/${o})`):e,x=(e={})=>{const n={...O,...e},t=e.runner??G();let o;return async c=>{const{changeFiles:r,date:u,release:d,target:a}=c,i=[],f=new Set,h=process.cwd();o||(o=z(e.repo,t,h));const m=await o;a!=="github-release"&&(i.push(`## ${d.newVersion}`),i.push(`<sub>${u}</sub>`),i.push(""));for(const p of r){const C=p.body.trim(),l=p.meta??{},$=l.author??await U(t,h,p.path);$&&n.thankContributors&&!n.internalAuthors.includes($.replace(/^@/,""))&&f.add($.startsWith("@")?$:`@${$}`);const y=[];if(l.pr&&m?y.push(`[#${l.pr}](https://github.com/${m}/pull/${l.pr})`):l.pr&&y.push(`#${l.pr}`),l.commit&&n.includeCommitLink&&m){const v=l.commit.slice(0,7);y.push(`[\`${v}\`](https://github.com/${m}/commit/${l.commit})`)}const w=y.length>0?` (${y.join(", ")})`:"";if(C)for(const v of C.split(/\r?\n/)){const b=v.trim();if(!b)continue;const _=H(b,m);b.startsWith("-")||b.startsWith("*")?i.push(`${_}${w}`):i.push(`- ${_}${w}`)}}if(d.isCascadeBump||d.isGroupBump)for(const p of d.sources){const C=d.isCascadeBump?"Cascade from":"Group bump with";i.push(`- ${C} ${p.name}@${p.newVersion}`)}else if(d.isDependencyBump&&r.length===0)for(const p of d.sources)p.newVersion===""?i.push(`- Removed dependency ${p.name}`):i.push(`- Updated dependency ${p.name}@${p.newVersion}`);return n.thankContributors&&f.size>0&&(i.push(""),i.push(`Thanks ${[...f].join(", ")}!`)),i.join(`
|
|
6
|
+
`)}},F=["Added","Changed","Deprecated","Removed","Fixed","Security"],X=e=>{const n=e.toLowerCase();return F.find(t=>t.toLowerCase()===n)},q={add:"Added",bugfix:"Fixed",change:"Changed",changed:"Changed",chore:"Changed",deprecate:"Deprecated",deprecated:"Deprecated",feat:"Added",feature:"Added",fix:"Fixed",perf:"Changed",refactor:"Changed",remove:"Removed",removed:"Removed",sec:"Security",security:"Security"},K=/^\s*\[(added|changed|deprecated|removed|fixed|security)\]\s*:?\s*(.*)$/i,J=e=>e.replace(/^[-*]\s+/,"").trim(),Y=e=>{const n=/^([a-z]+)(?:\([^)]+\))?!?\s*:\s*(.*)$/i.exec(e.trim());if(!n)return;const t=n[1].toLowerCase(),o=q[t];if(o)return{rest:n[2].trim(),section:o}},Q=e=>e==="major"?"Changed":e==="minor"?"Added":"Fixed",R=(e,n)=>/\bBREAKING(?:\s+CHANGE)?\b/.test(e)||/^\s*[a-z]+(?:\([^)]+\))?!\s*:/i.test(e)||n==="major",Z=(e,n,t,o)=>{const s=J(e);if(!s)return;const c=K.exec(s);if(c){const u=X(c[1]);if(u){t[u].push(`- ${c[2].trim()}`);return}}const r=Y(s);if(r){R(s,n)&&o.push(`- ${r.rest||s}`),t[r.section].push(`- ${r.rest||s}`);return}R(s,n)&&o.push(`- ${s}`),t[Q(n)].push(`- ${s}`)},ee=(e,n,t,o,s)=>{if(n)return`${n}/compare/${o}...${s}`;if(e)return`https://github.com/${e}/compare/${o}...${s}`},A=(e={})=>n=>{const{changeFiles:t,date:o,release:s,target:c}=n,r={Added:[],Changed:[],Deprecated:[],Fixed:[],Removed:[],Security:[]},u=[],d=s.type;for(const i of t)for(const f of i.body.trim().split(/\r?\n/))f.trim()&&Z(f,d,r,u);if(s.isCascadeBump||s.isGroupBump)for(const i of s.sources){const f=s.isCascadeBump?"Cascade from":"Group bump with";r.Changed.push(`- ${f} \`${i.name}\`@${i.newVersion}`)}else if(s.isDependencyBump&&t.length===0)for(const i of s.sources)i.newVersion===""?r.Removed.push(`- Removed dependency \`${i.name}\``):r.Changed.push(`- Updated dependency \`${i.name}\`@${i.newVersion}`);const a=[];if(c!=="github-release"&&(a.push(`## [${s.newVersion}] - ${o}`),a.push("")),u.length>0){a.push("### ⚠ BREAKING CHANGES"),a.push("");for(const i of u)a.push(i);a.push("")}for(const i of F){const f=r[i];if(f.length!==0){a.push(`### ${i}`),a.push("");for(const h of f)a.push(h);a.push("")}}if(c!=="github-release"){const i=`${s.name}@${s.oldVersion}`,f=`${s.name}@${s.newVersion}`,h=ee(e.repo,e.compareUrlPrefix,s.name,i,f);h&&a.push(`[${s.newVersion}]: ${h}`)}return a.join(`
|
|
7
7
|
`).replaceAll(/\n{3,}/g,`
|
|
8
8
|
|
|
9
|
-
`).trimEnd()},se=async(e,n)=>{if(e===!1)return()=>"";if(e===void 0||e==="default")return
|
|
9
|
+
`).trimEnd()},se=async(e,n)=>{if(e===!1)return()=>"";if(e===void 0||e==="default")return M;if(e==="github")return x();if(e==="keep-a-changelog"||e==="keepachangelog")return A();let t,o={};if(Array.isArray(e)?[t,o={}]=e:t=e,t==="default")return E(o);if(t==="github")return x(o);if(t==="keep-a-changelog"||t==="keepachangelog")return A(o);const s=t.startsWith(".")?`${n}/${t}`:t,c=I(s).href,{dynamicEsmImport:r}=await import("./dynamic-import.js"),u=await r(c),d=typeof u=="function"?u:u.default;if(typeof d!="function")throw new TypeError(`Custom changelog formatter at ${t} did not export a default function or a callable module.`);if(Array.isArray(e))try{const a=d(o);if(typeof a=="function")return a}catch{}return d};export{se as resolveFormatter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as s,f as a,g as p}from"./cli-main.js";const f=({options:t,visConfig:i,workspaceRoot:c})=>{const r=c??process.cwd(),l=i?.security?.policies?.installScripts?.allow??{},e=Object.entries(l).filter(([,o])=>o).map(([o])=>o);e.length===0&&!t.rootOnly&&(s.warn("No approved packages in security.policies.installScripts.allow — nothing to run."),!t.withRoot)||(t.rootOnly||a(r,e),(t.withRoot||t.rootOnly)&&p(r))};export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import l from"./index.js";import{VisReleaseError as o}from"../packem_shared/VisReleaseError-DZtgcKf8.js";const c=/^(?:@[a-z0-9-]{1,39}\/)?[a-z0-9._-]{1,214}$/,n=e=>typeof e!="string"||e.length===0||e.length>214||e.startsWith(".")||e.startsWith("_")?!1:c.test(e),d=e=>{if(!n(e))throw new o({code:"CONFIG_INVALID",message:`Invalid package name: ${JSON.stringify(e)}. Must match ^(@scope/)?[a-z0-9._-]+$ and be ≤ 214 chars (npm spec).`,packageName:typeof e=="string"?e:void 0})},g=e=>`'${e.replaceAll("'",String.raw`'\''`)}'`,i=e=>`"${e.replaceAll('"','""')}"`,a=(e,t=process.platform==="win32")=>t?i(e):g(e),A=(e,t)=>{const r=t.allowCustomCommands;return r===void 0||r===!1?!1:r===!0?!0:Array.isArray(r)?r.some(s=>e===s||l(s,e)):!1},f=(e,t,r=process.platform==="win32")=>e.replaceAll("{{name}}",a(t.name,r)).replaceAll("{{version}}",a(t.version,r)).replaceAll("{{tag}}",a(t.tag??"",r)).replaceAll("{{registry}}",a(t.registry??"",r)),p=[/\bnpm_[A-Za-z0-9]{20,}/g,/\bghp_[A-Za-z0-9]{20,}/g,/\bgho_[A-Za-z0-9]{20,}/g,/\bghs_[A-Za-z0-9]{20,}/g,/\bghu_[A-Za-z0-9]{20,}/g,/\bgithub_pat_\w{70,}/g,/\bglpat-[\w-]{20,}/g,/\bAKIA[0-9A-Z]{16}\b/g,/\bASIA[0-9A-Z]{16}\b/g,/\bcio[A-Za-z0-9]{40,}/g,/\bpypi-AgEIcHlwaS5vcmcCJ[\w-]+/g,/ACTIONS_ID_TOKEN_REQUEST_TOKEN=\S+/g,/\b_authToken=\S+/g,/\bBasic\s+[A-Za-z0-9+/=]{16,}/g,/--otp[= ]\S+/g,/\bone[- ]time password:?\s*\d{6,}/gi,/\bEOTP\s+\d{6,}/g,/Bearer (?!\[REDACTED\])[^\s"']+/g],h=e=>{let t=e;for(const r of p)t=t.replaceAll(r,"[REDACTED]");return t},m={"&":"&","<":"<",">":">"},_=e=>{let t=e.replaceAll(/[<>&]/g,r=>m[r]??r);return t=t.replaceAll("`","\\`"),t},C=(e,t,r)=>A(e,r)?{buildCommand:t.buildCommand,checkPublished:t.checkPublished,publishCommand:t.publishCommand}:{};export{d as assertValidPackageName,i as cmdq,_ as escapeMarkdown,f as interpolateCommand,A as isCustomCommandAllowed,n as isValidPackageName,h as redactTokens,C as resolveCustomCommands,a as shellQuote,g as sq};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{R as i}from"../packem_shared/main-BjJN8kWj.js";import{redactTokens as s}from"./security.js";const f=()=>({run:async(o,t,r)=>{try{const e=await i(o,[...t],{nodeOptions:{cwd:r.cwd,env:{...process.env,COREPACK_ENABLE_DOWNLOAD_PROMPT:"0",...r.env},stdio:r.silent?["ignore","pipe","pipe"]:"inherit"},throwOnError:!1});return{exitCode:typeof e.exitCode=="number"?e.exitCode:-1,stderr:s(e.stderr??""),stdout:s(e.stdout??"")}}catch(e){return{exitCode:-1,stderr:s(e.message),stdout:""}}}}),m=()=>new a;class a{handlers=[];on(t,r,e){this.handlers.push({argsPrefix:r,command:t,respond:e})}async run(t,r,e){for(const n of this.handlers){if(n.command!==t||r.length<n.argsPrefix.length)continue;if(n.argsPrefix.every((d,c)=>d===r[c]))return n.respond(e.cwd)}return{exitCode:0,stderr:"",stdout:""}}}export{a as MockRunner,m as createMockRunner,f as createShellRunner};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{expandNotificationTemplate as
|
|
2
|
-
`),type:"mrkdwn"},type:"section"});const
|
|
1
|
+
import{expandNotificationTemplate as c}from"./interface.js";const l=i=>i.url?`• <${i.url}|${i.name}@${i.version}>`:`• ${i.name}@${i.version}`;class f{constructor(e){this.config=e,this.id=e.id?`slack:${e.id}`:"slack"}config;id;async send(e){const r=this.config.title?c(this.config.title,e):`🚀 Released ${e.published.length} package${e.published.length===1?"":"s"}`,s=[{text:{text:r,type:"plain_text"},type:"header"}];e.published.length>0&&s.push({text:{text:e.published.map(t=>l(t)).join(`
|
|
2
|
+
`),type:"mrkdwn"},type:"section"});const n=[];e.channel&&n.push(`channel: \`${e.channel}\``),e.repo&&n.push(`<https://github.com/${e.repo}|${e.repo}>`);const a=Date.parse(e.completedAt);Number.isFinite(a)?n.push(`<!date^${Math.floor(a/1e3)}^{date_short_pretty} at {time}|${e.completedAt}>`):n.push(e.completedAt),s.push({elements:[{text:n.join(" • "),type:"mrkdwn"}],type:"context"}),e.skipped.length>0&&this.config.includeSkipped!==!1&&(s.push({type:"divider"}),s.push({text:{text:`*Skipped (${e.skipped.length}):* ${e.skipped.map(t=>`\`${t.name}\` (${t.reason})`).join(", ")}`,type:"mrkdwn"},type:"section"}));const h={blocks:s,text:r,...this.config.channelOverride?{channel:this.config.channelOverride}:{},...this.config.username?{username:this.config.username}:{},...this.config.iconEmoji?{icon_emoji:this.config.iconEmoji}:{}};let o;try{o=await fetch(this.config.webhook,{body:JSON.stringify(h),headers:{"Content-Type":"application/json"},method:"POST"})}catch(t){const p=t instanceof Error?t.name:"NetworkError";throw new Error(`Slack webhook fetch failed (${p})`,{cause:t})}if(!o.ok){const t=await o.text().catch(()=>"");throw new Error(`Slack webhook returned ${o.status} ${o.statusText}${t?`: ${t.slice(0,200)}`:""}`)}}}export{f as SlackNotificationChannel};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as O}from"node:module";import{DEFAULT_CHANGES_DIR as
|
|
2
|
-
`);const{mkdtempSync:E}=await import("node:fs"),{tmpdir:
|
|
1
|
+
import{createRequire as O}from"node:module";import{DEFAULT_CHANGES_DIR as Y}from"./DEFAULT_CLEAN_KEEP.js";import{p as $,r as z,c as G,a as Q}from"./index2.js";import{getCurrentSha as X,getShortSha as Z}from"./git.js";import{N as ee}from"./index3.js";let U;const V=s=>(U??=O(import.meta.url))(s),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,K=s=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[e,n]=u.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return u.getBuiltinModule(s)}return V(s)},{readFile:W,writeFile:C}=K("node:fs/promises"),te=(s,e)=>s.replaceAll("{tag}",e.tag).replaceAll("{sha}",e.sha).replaceAll("{shortSha}",e.shortSha).replaceAll("{branch}",e.branch??"").replaceAll("{pr}",e.pr??"").replaceAll("{timestamp}",e.timestamp),le=async s=>{const{context:e,dryRun:n=!1,registry:g,tag:o}=s,{createShellRunner:c}=await import("./shell-runner.js"),r=s.runner??c(),l=await X({cwd:e.cwd,runner:r}),i=await Z({cwd:e.cwd,runner:r});if(!l||!i)throw new Error("Could not resolve git HEAD. Snapshot requires a git workspace.");const w=e.config.snapshot?.versionTemplate??"0.0.0-{tag}-{shortSha}",y=new Date().toISOString().replaceAll(/[:.]/g,"").slice(0,14),f=e.config.snapshot?.tags??[],p=await r.run("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:e.cwd,silent:!0}).then(t=>t.exitCode===0?t.stdout.trim():void 0).catch(()=>{}),A=process.env.VIS_PR_NUMBER??process.env.PR_NUMBER,D=[o];for(const t of f){let a;switch(t){case"branch":{a=p&&p!=="HEAD"?p:void 0;break}case"pr":{a=A?`pr-${A}`:void 0;break}case"sha":{a=l;break}case"short-sha":{a=i;break}default:a=void 0}a&&a!==o&&!D.includes(a)&&D.push(a)}let m=e.packages;if(s.filter){const{default:t}=await import("./index.js"),a=s.filter.split(",").map(d=>d.trim()).filter(Boolean);m=m.filter(d=>a.some(v=>d.name===v||t(v,d.name)))}m=m.filter(t=>!t.private);const h=te(w,{branch:p&&p!=="HEAD"?p:void 0,pr:A,sha:l,shortSha:i,tag:o,timestamp:y}),N=new Map;for(const t of m)N.set(t.name,{...t.manifest,version:h});const q=$(await e.pm.readCatalogYaml(e.cwd)),x=new ee(r),b=[],k=[],_=[],P=e.config.changesDir??Y,{acquireLock:F,releaseLock:M}=await import("./state.js");let j=!1;if(!n)try{await F(e.cwd,P),j=!0}catch(t){return _.push({name:"_lock",reason:t.message}),{failed:_,published:b,skipped:k,snapshotVersion:h,tag:o}}try{for(const t of m){const a=ae(t,N),d=z(a,q),v=G(d,e.config.publish?.cleanPackageJson);if(n){b.push({name:t.name,version:h});continue}let R;try{R=await W(t.manifestPath,"utf8"),await C(t.manifestPath,`${JSON.stringify(v,null,4)}
|
|
2
|
+
`);const{mkdtempSync:E}=await import("node:fs"),{tmpdir:T}=await import("node:os"),{join:B}=await import("node:path"),H=E(B(T(),"vis-snapshot-")),I=await e.pm.pack({cwd:t.dir,destination:H});let S;for(const L of D){const J=await x.publish({access:"public",extraArgs:["--no-git-checks"],registry:g,tag:L,tarball:I.tarball});S??=J}S?.published?b.push({name:t.name,version:h}):S?.alreadyPublished?k.push({name:t.name,reason:"already-published"}):k.push({name:t.name,reason:S?.output??"unknown"})}catch(E){_.push({name:t.name,reason:E.message})}finally{if(R!==void 0)try{await C(t.manifestPath,R)}catch{}}}}finally{j&&await M(e.cwd,P)}return{failed:_,published:b,skipped:k,snapshotVersion:h,tag:o}},se=["dependencies","devDependencies","peerDependencies","optionalDependencies"],ae=(s,e)=>{const n=e.get(s.name)??s.manifest,g={...n};for(const o of se){const c=n[o];if(!c||typeof c!="object")continue;const r={...c};for(const[l,i]of Object.entries(c)){const w=e.get(l);if(w&&i.startsWith("workspace:")){const y=i.slice(10),f=Q(y==="*"?"*":i,w.version);r[l]=f.startsWith("workspace:")?f.slice(10):f}}g[o]=r}return g};export{le as runSnapshot};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as
|
|
1
|
+
import{createRequire as o}from"node:module";import{VisReleaseError as p}from"../packem_shared/VisReleaseError-DZtgcKf8.js";let c;const u=e=>(c??=o(import.meta.url))(e),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=e=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[t,s]=i.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return i.getBuiltinModule(e)}return u(e)},{setTimeout:l}=d("node:timers/promises"),g=async e=>{const t=Date.now(),s=r=>{const n=r.trim();if(!n)return!1;try{return typeof JSON.parse(n).id=="string"}catch{return!1}};for(;Date.now()-t<e.timeoutMs;){const r=await e.runner.run("npm",["stage","view",e.stageId,"--json"],{cwd:e.cwd,silent:!0});if(!(r.exitCode===0&&s(r.stdout))){const a=await e.runner.run("npm",["view",`${e.packageName}@${e.version}`,"dist.tarball","--silent"],{cwd:e.cwd,silent:!0});return a.exitCode===0&&a.stdout.trim()?"approved":"rejected"}e.onProgress?.(Date.now()-t),await l(e.pollIntervalMs)}return"timeout"},m=(e,t=process.env)=>{const s=e==="restricted",r=!!t.ACTIONS_ID_TOKEN_REQUEST_URL&&!t.NPM_TOKEN;if(s&&r)throw new p({code:"CONFIG_INVALID",hint:"Either set publish.stage: false, or fall back to NPM_TOKEN authentication (export NPM_TOKEN; trusted publishing on restricted packages is tracked for a future release).",message:"publish.stage with OIDC trusted publishing is not supported for restricted-access packages in v1."})};export{m as refuseRestrictedOidc,g as waitForStageDecision};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`;return await
|
|
1
|
+
import{createRequire as y}from"node:module";import{VisReleaseError as c}from"../packem_shared/VisReleaseError-DZtgcKf8.js";let w;const _=e=>(w??=y(import.meta.url))(e),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,p=e=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[n,r]=i.versions.node.split(".").map(Number);if(n>22||n===22&&r>=3||n===20&&r>=16)return i.getBuiltinModule(e)}return _(e)},{readFile:h,unlink:E,mkdir:v,writeFile:N}=p("node:fs/promises"),{join:R,dirname:T}=p("node:path"),m=(e,n)=>R(e,n,"staged.json"),O=()=>({pending:[],recentlyNotified:[],recentlyWalked:[],updatedAt:new Date().toISOString(),version:1}),u=100,A=720*60*60*1e3,f=(e,n=Date.now())=>{if(!e||e.length===0)return[];const r=n-A,t=e.filter(a=>{const o=Date.parse(a.at);return Number.isFinite(o)&&o>=r});return t.length<=u?t:[...t].sort((a,o)=>Date.parse(o.at)-Date.parse(a.at)).slice(0,u)},j=async(e,n)=>{const r=m(e,n);let t;try{t=await h(r,"utf8")}catch(o){if(o.code==="ENOENT")return O();throw new c({cause:o,code:"STATE_FILE_CORRUPT",message:`Failed to read staged registry at ${r}: ${o.message}`})}let a;try{a=JSON.parse(t)}catch(o){throw new c({cause:o,code:"STATE_FILE_CORRUPT",message:`Staged registry at ${r} is not valid JSON: ${o.message}. Remove the file or fix it manually.`})}if(a.version!==1)throw new c({code:"STATE_FILE_CORRUPT",message:`Staged registry at ${r} reports unknown version ${a.version}. Upgrade vis or remove the file.`});if(!Array.isArray(a.pending))throw new c({code:"STATE_FILE_CORRUPT",message:`Staged registry at ${r} is missing the "pending" array.`});return a},C=async(e,n,r)=>{const t=m(e,n);let a;try{const d=await h(t,"utf8");a=JSON.parse(d)}catch{a=void 0}const o=f(r.recentlyNotified),s=f(r.recentlyWalked),l={...r,recentlyNotified:o,recentlyWalked:s};if(l.pending.length===0&&o.length===0&&s.length===0){if(a===void 0)return{changed:!1,path:t,removed:!1};try{await E(t)}catch(d){if(d.code!=="ENOENT")throw d}return{changed:!0,path:t,removed:!0}}if(a&&k(a,l))return{changed:!1,path:t,removed:!1};await v(T(t),{recursive:!0});const S=`${JSON.stringify({...l,updatedAt:new Date().toISOString()},null,2)}
|
|
2
|
+
`;return await N(t,S),{changed:!0,path:t,removed:!1}},F=(e,n,r=new Date().toISOString())=>{if(n.length===0)return e;const t=e.recentlyNotified??[],a=new Set(t.map(s=>s.key)),o=n.filter(s=>!a.has(s)).map(s=>({at:r,key:s}));return o.length===0?e:{...e,recentlyNotified:[...t,...o],updatedAt:r}},M=(e,n,r=new Date().toISOString())=>{if(n.length===0)return e;const t=e.recentlyWalked??[],a=new Set(t.map(s=>s.key)),o=n.filter(s=>!a.has(s)).map(s=>({at:r,key:s}));return o.length===0?e:{...e,recentlyWalked:[...t,...o],updatedAt:r}},$=(e,n)=>{if(n.length===0)return e;const r=new Map(e.pending.map(t=>[t.id,t]));for(const t of n)r.set(t.id,t);return{...e,pending:[...r.values()],updatedAt:new Date().toISOString()}},q=(e,n)=>{if(n.length===0||e.pending.length===0)return e;const r=new Set(n),t=e.pending.filter(a=>!r.has(a.id));return t.length===e.pending.length?e:{...e,pending:t,updatedAt:new Date().toISOString()}},x=(e,n)=>{if(e.pending.length===0||n.length===0)return[];const r=new Set(n);return e.pending.filter(t=>r.has(t.name))},g=(e,n)=>{const r=e??[],t=n??[];if(r.length!==t.length)return!1;if(r.length===0)return!0;const a=new Map(r.map(o=>[o.key,o]));for(const o of t)if(a.get(o.key)?.at!==o.at)return!1;return!0},k=(e,n)=>I(e.pending,n.pending)&&g(e.recentlyNotified,n.recentlyNotified)&&g(e.recentlyWalked,n.recentlyWalked),I=(e,n)=>{if(e.length!==n.length)return!1;if(e.length===0)return!0;const r=new Map(e.map(t=>[t.id,t]));for(const t of n){const a=r.get(t.id);if(!a||a.name!==t.name||a.version!==t.version||a.reason!==t.reason||(a.tag??"latest")!==(t.tag??"latest"))return!1}return!0};export{x as findConflictingPendingStages,I as pendingSetsEqual,f as pruneOldEntries,j as readStagedRegistry,F as recordRecentlyNotified,M as recordRecentlyWalked,k as registryContentsEqual,q as removePendingStages,m as stagedRegistryPath,$ as upsertPendingStages,C as writeStagedRegistry};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as S}from"node:module";import{VisReleaseError as i}from"../packem_shared/VisReleaseError-
|
|
2
|
-
`)},
|
|
3
|
-
`,h=async()=>{try{const
|
|
1
|
+
import{createRequire as S}from"node:module";import{VisReleaseError as i}from"../packem_shared/VisReleaseError-DZtgcKf8.js";let g;const O=e=>(g??=S(import.meta.url))(e),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=e=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[t,s]=c.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return c.getBuiltinModule(e)}return O(e)},{constants:d}=u("node:fs"),{mkdir:w,readFile:m,unlink:f,writeFile:R,open:L}=u("node:fs/promises"),{platform:A,hostname:p}=u("node:os"),{dirname:_,join:y}=u("node:path"),$=".state.json",v="publish-lock.json",l=(e,t,s=!1)=>y(e,t,s?v:$),j=async(e,t,s=!1)=>{try{const a=await m(l(e,t,s),"utf8"),r=JSON.parse(a);if(r.version!==1)throw new i({code:"STATE_FILE_CORRUPT",message:`Unknown state file version: ${r.version}. Delete ${l(e,t,s)} to start fresh.`});return r}catch(a){if(a.code==="ENOENT")return;throw a instanceof i?a:new i({cause:a,code:"STATE_FILE_CORRUPT",message:`Failed to read state file: ${a.message}`})}},q=async(e,t,s,a=!1)=>{const r=l(e,t,a);await w(_(r),{recursive:!0}),await R(r,`${JSON.stringify(s,null,2)}
|
|
2
|
+
`)},I=async(e,t,s=!1)=>{try{await f(l(e,t,s))}catch(a){if(a.code!=="ENOENT")throw new i({cause:a,code:"STATE_FILE_CORRUPT",message:`Could not clear state file at ${l(e,t,s)}: ${a.message}. Remove it manually before the next run.`})}},M=(e,t)=>({applied:[],channel:e,notified:[],plan:[...t],published:[],pushed:!1,startedAt:new Date().toISOString(),tagged:[],version:1,walked:[]}),U=(e,t)=>{const s=new Set(t.published);return e.filter(a=>!s.has(`${a.name}@${a.newVersion}`))},C=3600*1e3,T=(e,t)=>y(e,t,".lock"),F=e=>{try{return process.kill(e,0),!0}catch{return!1}},D=async(e,t)=>{const s=T(e,t);await w(_(s),{recursive:!0});const a={acquiredAt:new Date().toISOString(),hostname:p(),pid:process.pid,platform:A()},r=`${JSON.stringify(a,null,2)}
|
|
3
|
+
`,h=async()=>{try{const n=await L(s,d.O_WRONLY|d.O_CREAT|d.O_EXCL,384);try{await n.writeFile(r)}finally{await n.close()}return!0}catch(n){if(n.code==="EEXIST")return!1;throw n}};if(await h())return s;let o;try{o=JSON.parse(await m(s,"utf8"))}catch{}if(o){const n=Date.now()-new Date(o.acquiredAt).getTime();if((!o.hostname||o.hostname===p())&&F(o.pid)&&n<C){const E=o.hostname?`${o.hostname}:${o.pid}`:`PID ${o.pid}`;throw new i({code:"STATE_FILE_CORRUPT",message:`Release lock held by ${E} (acquired ${Math.round(n/1e3)}s ago). Wait for the other run, or remove ${s} if you're sure it's stale.`})}}try{await f(s)}catch{}if(await h())return s;throw new i({code:"STATE_FILE_CORRUPT",message:`Could not acquire release lock at ${s} after clearing a stale entry. Another process took it. Retry in a few seconds.`})},J=async(e,t)=>{try{await f(T(e,t))}catch{}};export{D as acquireLock,I as clearState,U as filterPlanByState,T as lockFilePath,M as newState,j as readState,J as releaseLock,l as stateFilePath,q as writeState};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`);return}if(a.info(`DB: ${
|
|
1
|
+
import{r as d,F as i,J as l}from"../packem_shared/index.server-CwSgbeN7.js";import{p as a}from"./cli-main.js";import{r as y,g}from"../packem_shared/advisories-CyDqzi5j.js";const h=n=>{if(n===0)return"0 B";const r=["B","KB","MB","GB"],o=Math.min(Math.floor(Math.log(n)/Math.log(1024)),r.length-1),s=n/1024**o;return`${s.toFixed(s<10&&o>0?1:0)} ${r[o]}`},v=n=>{if(!n)return"never";const r=Date.parse(n);if(Number.isNaN(r))return n;const o=Date.now()-r;if(o<0)return n;const s=Math.floor(o/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const t=Math.floor(s/60);return t<24?`${t}h ago`:`${Math.floor(t/24)}d ago`},$=async({logger:n,options:r,workspaceRoot:o})=>{if(!o)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const s=r.db??y(o),t=await g(o,s);if(r.format==="json"){process.stdout.write(`${JSON.stringify({dbPath:s,ecosystems:t.ecosystems.map(e=>({advisoryCount:e.advisoryCount,lastSyncIso:e.lastSyncIso,manifestEtag:e.manifestEtag??null,name:e.name})),exists:t.exists,schemaVersion:t.schemaVersion,sizeBytes:t.sizeBytes},void 0,2)}
|
|
2
|
+
`);return}if(a.info(`DB: ${s}`),!t.exists){a.warn(`No advisory DB yet. Run ${d("vis advisories sync")} to populate.`);return}if(a.info(`Schema: v${t.schemaVersion} Size: ${h(t.sizeBytes)}`),t.ecosystems.length===0){a.warn("DB exists but contains no ecosystems. Run `vis advisories sync`.");return}a.info(""),a.info("Ecosystem Advisories Last sync ETag"),a.info(i("────────── ────────── ───────────────── ──────"));for(const e of t.ecosystems){const c=e.name.padEnd(10),u=e.advisoryCount.toLocaleString().padStart(10),m=`${e.lastSyncIso||"never"} (${v(e.lastSyncIso)})`.padEnd(19),f=e.manifestEtag??i("—");a.info(`${l(c)} ${u} ${m} ${f}`)}},E=$;export{E as advisoriesStatusExecute};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
1
|
+
const d="<!-- vis-release-success -->",S=["released"],R=`${d}
|
|
2
2
|
:tada: This issue has been resolved in version {version} :tada:
|
|
3
3
|
|
|
4
4
|
The release is available on [GitHub release]({url}).
|
|
5
5
|
|
|
6
|
-
Your **[vis](https://github.com/visulima/visulima)** release pipeline shipped this. :rocket:`,C=(s,e)=>{const
|
|
7
|
-
`);for(const c of C(
|
|
8
|
-
${
|
|
6
|
+
Your **[vis](https://github.com/visulima/visulima)** release pipeline shipped this. :rocket:`,C=(s,e)=>{const n=new Set,r=/(?:^|[\s(,;:!?])#(\d+)/g;let t;for(;(t=r.exec(s))!==null;){const a=Number.parseInt(t[1],10);Number.isFinite(a)&&a>0&&n.add(a)}const o=/\bgh-(\d+)/gi;for(;(t=o.exec(s))!==null;){const a=Number.parseInt(t[1],10);Number.isFinite(a)&&a>0&&n.add(a)}const u=/https?:\/\/([^\s/]+)\/([^\s)]*?)\/(?:pull|issues|merge_requests)\/(\d+)/gi;for(;(t=u.exec(s))!==null;){const a=Number.parseInt(t[3],10);if(Number.isFinite(a)&&a>0){if(e){const i=(t[2]??"").replaceAll(/^\/+|\/+$/g,"").replace(/\/-$/,""),f=e.replaceAll(/^\/+|\/+$/g,"");if(i.toLowerCase()!==f.toLowerCase())continue}n.add(a)}}return[...n].sort((a,i)=>a-i)},L=(s,e)=>{let n=s;if(e.url)n=n.replaceAll("{url}",e.url);else{const r=`${e.name}@${e.version}`;n=n.replaceAll(/\[[^\]]*\]\(\{url\}\)/g,r),n=n.replaceAll("{url}",r)}return n.replaceAll("{version}",e.version).replaceAll("{name}",e.name).replaceAll("{tag}",e.tag)},$=s=>{const e=s.config.successWalk??{};return{commentBody:e.commentBody??R,enabled:e.enabled!==!1,labels:e.labels??S,skipPrerelease:e.skipPrerelease!==!1}},v=async(s,e,n,r)=>{const t=new Set,o=new Map,u=new Date().toISOString().slice(0,10);for(const a of e.published){const i=s.plan.releases.find(c=>c.name===a.name);if(!i)continue;let f;try{f=await n({changeFiles:i.changeFiles,date:u,release:i,target:"github-release"})}catch{continue}const b=[f,...i.changeFiles.map(c=>c.body)].join(`
|
|
7
|
+
`);for(const c of C(b,r))o.has(c)||o.set(c,i),t.add(c)}return{firstReleaseByRef:o,refs:[...t].sort((a,i)=>a-i)}},N=(s,e)=>s?e.published.find(r=>r.name===s.name)?.url??"":"",F=s=>{let e=0;const n=[],r=()=>{if(e>=s)return;const t=n.shift();t&&(e+=1,t())};return t=>new Promise((o,u)=>{const a=()=>{e-=1,r()},i=()=>{t().then(o,u).finally(a)};n.push(i),r()})},W=s=>new Promise(e=>{setTimeout(e,s)}),_=s=>{if(!s||typeof s!="object")return!1;const e=s;return typeof e.status=="number"&&e.status===429||typeof e.statusCode=="number"&&e.statusCode===429?!0:typeof e.message=="string"?/\b429\b|rate[- ]?limit/i.test(e.message):!1},B=(s,e)=>{if(!s||typeof s!="object")return e;const n=s;if(typeof n.retryAfter=="number"&&Number.isFinite(n.retryAfter)&&n.retryAfter>=0)return Math.round(n.retryAfter*1e3);if(typeof n.message=="string"){const r=/Retry-After:\s*(\d+)/i.exec(n.message);if(r){const t=Number.parseInt(r[1],10);if(Number.isFinite(t)&&t>=0)return t*1e3}}return e},g=async(s,e=5e3)=>{try{return await s()}catch(n){if(!_(n))throw n;const r=B(n,e);return await W(r),s()}},E=async(s,e,n,r)=>{const t={commented:[],labeled:[],warnings:[]};if(s.config.successWalk===void 0)return t;const o=$(s);if(!o.enabled)return t;const u=!!s.channel?.prerelease||e.published.some(l=>l.version.includes("-"));if(o.skipPrerelease&&u||!r.repo)return t;const{firstReleaseByRef:a,refs:i}=await v(s,e,r.formatter,r.repo);if(i.length===0)return t;const f=s.channel?.tag??"",b=F(4),c=i.map(l=>b(async()=>{const m=a.get(l),y=m?.newVersion??e.published[0]?.version??"",w=m?.name??e.published[0]?.name??"",A=N(m,e),h=L(o.commentBody,{name:w,tag:f,url:A,version:y}),k=h.includes(d)?h:`${d}
|
|
8
|
+
${h}`;try{if(await g(()=>r.client.upsertStickyComment(n,{body:k,cwd:s.cwd,issueNumber:l,marker:d,repo:r.repo})))t.commented.push(l);else{t.warnings.push(`successWalk: upsertStickyComment returned undefined for #${l}; skipping label step.`);return}}catch(p){t.warnings.push(`successWalk: failed to comment on #${l}: ${p.message}`);return}if(o.labels.length!==0)try{await g(()=>r.client.addLabels(n,{cwd:s.cwd,issueNumber:l,labels:o.labels,repo:r.repo}))?t.labeled.push(l):t.warnings.push(`successWalk: addLabels returned false for #${l}; the labels may not have been applied.`)}catch(p){t.warnings.push(`successWalk: failed to label #${l}: ${p.message}`)}}));return await Promise.all(c),t.commented.sort((l,m)=>l-m),t.labeled.sort((l,m)=>l-m),t};export{R as DEFAULT_SUCCESS_WALK_COMMENT,S as DEFAULT_SUCCESS_WALK_LABELS,d as SUCCESS_WALK_MARKER,C as extractReferences,F as pLimit,E as walkSuccessfulRelease,g as withRateLimitRetry};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)}else{const s=i.filter(
|
|
1
|
+
import{F as p}from"../packem_shared/index.server-CwSgbeN7.js";import{p as c}from"./cli-main.js";import{s as v}from"../packem_shared/scan-progress-C9nMDLis.js";import{D as $,s as D}from"../packem_shared/advisories-CyDqzi5j.js";const S=o=>o?.security?.audit?.advisories??{},w=o=>o?o.split(",").map(r=>r.trim()).filter(r=>r.length>0):["npm"],b=async({logger:o,options:r,visConfig:y,workspaceRoot:l})=>{if(!l)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const d=r.format==="json",u=S(y),f=r.source??u.source??$,m=w(r.ecosystem),h=m.map(s=>({id:s,label:`Sync ${s} advisories`})),a=v(h,{live:!d}),i=[];try{for(const s of m){a.start(s);const e=Date.now();try{const t=await D({allowedHosts:u.allowedHosts,dbPath:r.db,ecosystem:s,force:!!r.force,source:f,workspaceRoot:l});i.push({ecosystem:s,result:t}),t.upToDate?a.finish(s,"ok",`up to date · ${g(Date.now()-e)}`):a.finish(s,"ok",`${t.advisoriesIngested.toLocaleString()} advisories · ${g(t.durationMs)}`)}catch(t){const n=t instanceof Error?t.message:String(t);i.push({ecosystem:s,error:n}),a.finish(s,"error",n)}}}finally{a.stop()}if(d){const s={ecosystems:i.map(e=>({advisoriesIngested:e.result?.advisoriesIngested??0,dbPath:e.result?.dbPath??null,durationMs:e.result?.durationMs??0,ecosystem:e.ecosystem,error:e.error??null,upToDate:e.result?.upToDate??!1})),source:f};process.stdout.write(`${JSON.stringify(s,void 0,2)}
|
|
2
|
+
`)}else{const s=i.filter(n=>n.error),e=i.filter(n=>n.result),t=e[0];t?.result?.dbPath&&c.info(p(`DB: ${t.result.dbPath}`)),s.length===0?c.success(`Synced ${e.length} ecosystem${e.length===1?"":"s"}.`):c.error(`${s.length} ecosystem${s.length===1?"":"s"} failed to sync.`)}i.some(s=>s.error)&&(process.exitCode=1)},g=o=>o>=1e3?`${(o/1e3).toFixed(1)}s`:`${Math.round(o)}ms`,C=b;export{C as advisoriesSyncExecute};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as
|
|
2
|
-
`);for(const o of
|
|
1
|
+
import{p as n}from"./cli-main.js";import{d as u}from"../packem_shared/pm-runner-de-jCq8q.js";import{s as p}from"../packem_shared/native-config-sync-BSzU4qUO.js";import{s as g}from"../packem_shared/min-release-age-ChzTC7_I.js";const y=new Set(["bun","npm","pnpm","yarn"]),S=({options:c,visConfig:a,workspaceRoot:l})=>{const i=l??process.cwd(),e=u(i);if(!y.has(e.name)){n.warn(`Package manager '${e.name}' has no native security config to sync.`);return}if(!a?.security){n.warn("vis.config has no `security` block — nothing to sync.");return}const t=a.security.policies??{},r=Object.fromEntries(Object.entries(t.installScripts?.allow??{}).filter(([,o])=>o)),f=t.firstSeen?.minutes,m=t.firstSeen?.exclude??[],s=[];if(Object.keys(r).length>0&&!c.skipAllowBuilds&&s.push(...p(e.name,i,r)),c.skipMinReleaseAge||s.push(...g(e.name,i,f,m)),s.length===0){n.success("Nothing to sync — vis.config and native PM config are aligned.");return}n.info(`Syncing vis.config security settings to ${e.name} native config…
|
|
2
|
+
`);for(const o of s)n.success(` ${o}`)};export{S as default};
|