@maycombhq/atticus 2.0.0-beta.24 → 2.0.0-beta.26
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/bin.js +3 -3
- package/dist/{chunk-YA2IJJ6N.js → chunk-2FTHLB2H.js} +5 -5
- package/dist/{chunk-QPLNB2BM.js → chunk-2GT47PWU.js} +4 -4
- package/dist/{chunk-25CUJJTP.js → chunk-2HDNOUJU.js} +56 -19
- package/dist/{chunk-IUBBEU6O.js → chunk-2IO6XH37.js} +11 -11
- package/dist/{chunk-SGYQORAD.js → chunk-2JT4QV3Q.js} +3 -3
- package/dist/{chunk-W4EG25TI.js → chunk-2SCZZQNQ.js} +7 -7
- package/dist/{chunk-NQDHRT2H.js → chunk-2XIIUXGX.js} +13 -13
- package/dist/{chunk-RSKMV3VC.js → chunk-3D74UADA.js} +1 -1
- package/dist/chunk-3FFIDQQB.js +42 -0
- package/dist/{chunk-X7HFXXTZ.js → chunk-3GEAUW62.js} +13 -13
- package/dist/{chunk-TXYMNKGM.js → chunk-3KIMLBGZ.js} +5 -5
- package/dist/{chunk-GKZDHXC2.js → chunk-3KP7OOJ4.js} +8 -8
- package/dist/{chunk-LBG4GMOR.js → chunk-43OWNS5N.js} +4 -4
- package/dist/{chunk-NTEPBOAF.js → chunk-4DHYXODN.js} +4 -4
- package/dist/chunk-4N5W7LYW.js +41 -0
- package/dist/{chunk-MUY5MAGM.js → chunk-4NWE2KY3.js} +12 -12
- package/dist/{chunk-5FUFVNXB.js → chunk-5A4RHEEL.js} +2 -2
- package/dist/{chunk-NTOPAOBY.js → chunk-5JGRF53S.js} +3 -3
- package/dist/{chunk-G3W7GNEP.js → chunk-5UIGGXA5.js} +18 -18
- package/dist/{chunk-QGBS4GMS.js → chunk-63572EFC.js} +13 -13
- package/dist/{chunk-BFQ5IKQA.js → chunk-64LSDT3D.js} +11 -11
- package/dist/{chunk-3VS7RNEB.js → chunk-6EMJ4XFC.js} +18 -18
- package/dist/{chunk-XERIHPBF.js → chunk-6P67IUET.js} +9 -9
- package/dist/{chunk-FDL2JOLB.js → chunk-6SIGGA37.js} +23 -23
- package/dist/{chunk-NC56V6KQ.js → chunk-6TZ4YRGJ.js} +5 -5
- package/dist/{chunk-ESJALLOK.js → chunk-6U65YB54.js} +3 -3
- package/dist/{chunk-GJVCBTSO.js → chunk-6ZDAEUKB.js} +798 -175
- package/dist/{chunk-5EIKOU7L.js → chunk-723OQZ3N.js} +5 -5
- package/dist/{chunk-XXRBAJ36.js → chunk-76AHTJVY.js} +13 -13
- package/dist/{chunk-BYKWWSXL.js → chunk-7AEB74KW.js} +6 -6
- package/dist/{chunk-JMH6TCZJ.js → chunk-7IWMRZRI.js} +21 -21
- package/dist/{chunk-JUHZBZPZ.js → chunk-7JZONWAA.js} +7 -7
- package/dist/chunk-7NVLGPER.js +45 -0
- package/dist/{chunk-ZCU2UY47.js → chunk-7ZBYRMWK.js} +23 -23
- package/dist/{chunk-6FIYEB7M.js → chunk-A6LGX56J.js} +23 -23
- package/dist/{chunk-UWJOM457.js → chunk-ACY3U2RD.js} +4 -4
- package/dist/chunk-AHACUPGL.js +46 -0
- package/dist/{chunk-YUJTOALL.js → chunk-ANFBBJEV.js} +19 -19
- package/dist/{chunk-D5CJEKZI.js → chunk-B3JHERXM.js} +3 -3
- package/dist/{chunk-MQFSEGTU.js → chunk-B7KGNEFI.js} +135 -31
- package/dist/{chunk-2ITYURTR.js → chunk-BABRMZET.js} +3 -3
- package/dist/{chunk-OYTSRNSZ.js → chunk-BD7HBZLP.js} +6 -6
- package/dist/{chunk-CCQZN6W3.js → chunk-BEEHCL5O.js} +34 -34
- package/dist/{chunk-JCG2EBNB.js → chunk-BGOAJFPB.js} +1 -1
- package/dist/{chunk-MVXMISNA.js → chunk-BIAQ6NQS.js} +7 -7
- package/dist/{chunk-GS7N3RFG.js → chunk-BIKMME4S.js} +30 -25
- package/dist/{chunk-4DCIUKIE.js → chunk-BIWNRS5I.js} +26 -14
- package/dist/{chunk-QOC3Q4UU.js → chunk-BSZII65X.js} +3 -3
- package/dist/{chunk-7U46TCRZ.js → chunk-BV2BZIUF.js} +19 -19
- package/dist/{chunk-FFDVAV56.js → chunk-C3TBDX7Y.js} +23 -23
- package/dist/{chunk-ASFRT33J.js → chunk-CFK6CFXM.js} +9 -9
- package/dist/{chunk-DF6DPCW2.js → chunk-CG6MG7SE.js} +11 -11
- package/dist/{chunk-M3RWF7MC.js → chunk-CNEOKSTO.js} +27 -27
- package/dist/{chunk-JFBVIMGY.js → chunk-CNT6T2JM.js} +13 -13
- package/dist/{chunk-MPATOMY5.js → chunk-CPE7HLIK.js} +15 -15
- package/dist/{chunk-WECCLSYY.js → chunk-CSHJZFOE.js} +229 -32
- package/dist/{chunk-XKNISZ6N.js → chunk-CUTMM4NY.js} +16 -16
- package/dist/{chunk-NOU5IBLM.js → chunk-CWLXVRFH.js} +5 -5
- package/dist/{chunk-MWN7CBVL.js → chunk-D4TW3PUO.js} +4 -4
- package/dist/{chunk-QJ3AYXVO.js → chunk-D5H3RZNE.js} +13 -13
- package/dist/{chunk-XPXOKHNZ.js → chunk-DARX3ATP.js} +11 -11
- package/dist/{chunk-L3PIN47C.js → chunk-DASVVML7.js} +5 -5
- package/dist/{chunk-37UTWGU4.js → chunk-DB3NWAU3.js} +4 -4
- package/dist/{chunk-DCQSPSXU.js → chunk-DB6TDJ4T.js} +19 -19
- package/dist/{chunk-CCQWQFOT.js → chunk-DG7KYZAL.js} +18 -18
- package/dist/{chunk-FL53R4SW.js → chunk-DHQXCP2X.js} +5 -2
- package/dist/{chunk-6UTD5RQH.js → chunk-DJBXXYYA.js} +11 -11
- package/dist/{chunk-PZBNDFZ7.js → chunk-DOU52XFZ.js} +40 -20
- package/dist/{chunk-BWYW533C.js → chunk-DPH4BS3F.js} +10 -10
- package/dist/{chunk-LAGZBQHK.js → chunk-DS5M2J2H.js} +13 -13
- package/dist/chunk-DWD6BKHG.js +52 -0
- package/dist/{chunk-2JHE75RW.js → chunk-DXBXZNKV.js} +10 -10
- package/dist/{chunk-HXFZX2BI.js → chunk-DXLWZ3BJ.js} +9 -9
- package/dist/{chunk-EUMXLSW5.js → chunk-E5NHFHGC.js} +5 -5
- package/dist/{chunk-U37ZOYJJ.js → chunk-EECFUQP3.js} +109 -15
- package/dist/{chunk-66DWUSNY.js → chunk-EEVSFGIU.js} +21 -21
- package/dist/{chunk-3XCCT2GR.js → chunk-ELR7DEQM.js} +156 -110
- package/dist/chunk-EN3N6LNU.js +52 -0
- package/dist/{chunk-FGW5TLGM.js → chunk-EQMNMG6X.js} +11 -11
- package/dist/{chunk-AWDCVZYO.js → chunk-ET7SPOBA.js} +6 -6
- package/dist/{chunk-ZIAYNHHE.js → chunk-EUTZTJIO.js} +32 -15
- package/dist/{chunk-4CS3PMIM.js → chunk-EVKDWJ5Y.js} +5 -5
- package/dist/{chunk-ANUMIPF6.js → chunk-EY3OVHNC.js} +21 -21
- package/dist/{chunk-UXO25YBN.js → chunk-F4EGHECF.js} +3 -3
- package/dist/{chunk-YHWX5LPT.js → chunk-F6GRBF5L.js} +22 -22
- package/dist/{chunk-KYO5HT4G.js → chunk-FIZ5LYL2.js} +13 -13
- package/dist/{chunk-JVMNEI7B.js → chunk-FOOU5OJE.js} +3 -3
- package/dist/{chunk-RQSUFGU2.js → chunk-FWQDH5NK.js} +25 -25
- package/dist/{chunk-IRXZKKCG.js → chunk-FYCN2Y5P.js} +16 -16
- package/dist/{chunk-BQXAHIZ6.js → chunk-GAJBMPWC.js} +8 -8
- package/dist/{chunk-ZJ2W2RDE.js → chunk-GFFTVQ7R.js} +6 -6
- package/dist/chunk-GHCFWIUW.js +38 -0
- package/dist/{chunk-4MNMOUU7.js → chunk-GHST3KAB.js} +4 -4
- package/dist/{chunk-UKRJ2ISN.js → chunk-GJSLO2E2.js} +4 -4
- package/dist/{chunk-XNW3EDCY.js → chunk-GNFZ227W.js} +3 -3
- package/dist/{chunk-CI4D6VSU.js → chunk-GSIJWDXH.js} +19 -19
- package/dist/{chunk-432FGEVB.js → chunk-GXJ2PSDW.js} +8 -8
- package/dist/{chunk-CKRPMRFQ.js → chunk-H26T2LQL.js} +26 -26
- package/dist/{chunk-G67GOK4S.js → chunk-H5BIVULF.js} +7 -7
- package/dist/{chunk-4RKIOUPA.js → chunk-H7CSCA73.js} +5 -5
- package/dist/{chunk-HYHV2P3G.js → chunk-HCC5547C.js} +12 -12
- package/dist/{chunk-SUAHNYNQ.js → chunk-HLDUWEO7.js} +16 -16
- package/dist/{chunk-HI7ADE4E.js → chunk-HNNMT5L2.js} +1 -1
- package/dist/{chunk-DIYNRYXW.js → chunk-HQMLY2R6.js} +2 -2
- package/dist/{chunk-RSHVSXPJ.js → chunk-HSJKYDHI.js} +5 -5
- package/dist/{chunk-SLGUSFOD.js → chunk-HV6PXXK7.js} +3 -3
- package/dist/{chunk-77AZRGWE.js → chunk-HVOE7ZW2.js} +16 -16
- package/dist/{chunk-B63NWU3P.js → chunk-HVWPN2RY.js} +13 -13
- package/dist/{chunk-CU7ZK7KP.js → chunk-HWPX3T55.js} +15 -15
- package/dist/{chunk-5FPAKAGE.js → chunk-I2EWY3MG.js} +3 -3
- package/dist/{chunk-OCU5S2XG.js → chunk-I72PEROE.js} +4 -4
- package/dist/{chunk-J4K4C4T5.js → chunk-IBIIKUC7.js} +14 -19
- package/dist/{chunk-LDKP7OWQ.js → chunk-IDRCBMJF.js} +29 -29
- package/dist/{chunk-L6Z6TMIK.js → chunk-IEIHVMM6.js} +15 -8
- package/dist/{chunk-ABDE5IRC.js → chunk-IERXBWQU.js} +17 -17
- package/dist/{chunk-D5ZC7IMC.js → chunk-IFQJ3YQE.js} +4 -4
- package/dist/{chunk-U66RQUFC.js → chunk-IH6BYFMH.js} +5 -5
- package/dist/{chunk-A53IYUCR.js → chunk-IJN5PSDU.js} +16 -16
- package/dist/{chunk-LTIXFLYE.js → chunk-IL7PVMUO.js} +6 -6
- package/dist/{chunk-ZSNNF26J.js → chunk-IP6ARMZU.js} +21 -21
- package/dist/{chunk-SUYC5NP6.js → chunk-ISCX25D7.js} +21 -21
- package/dist/{chunk-CFSBBLDD.js → chunk-IYEET4VM.js} +24 -24
- package/dist/{chunk-775FMPUB.js → chunk-IZIGZ7KY.js} +4 -4
- package/dist/{chunk-SWSGRRNO.js → chunk-JJEXMHNZ.js} +5 -5
- package/dist/{chunk-5QF5W5P2.js → chunk-JLTJAOO4.js} +5 -5
- package/dist/{chunk-3UMKLB6P.js → chunk-K2NQTROJ.js} +5 -5
- package/dist/{chunk-GXQYEIYM.js → chunk-K35VNKJH.js} +6 -6
- package/dist/{chunk-CZ75S2EZ.js → chunk-K3QKOVZN.js} +6 -6
- package/dist/{chunk-IK6LHW3E.js → chunk-KAWWXCPI.js} +3 -3
- package/dist/{chunk-T5NH5L7A.js → chunk-KFJMQUSK.js} +13 -13
- package/dist/{chunk-CFSHLQPK.js → chunk-KFZ5IXEZ.js} +25 -25
- package/dist/{chunk-3FGQFDS4.js → chunk-KJD4DLRZ.js} +19 -19
- package/dist/{chunk-3BEGKSDW.js → chunk-KL7UHAOR.js} +9 -9
- package/dist/{chunk-FFYOZ7PF.js → chunk-KS2IQYTZ.js} +9 -9
- package/dist/{chunk-H7KERB6Q.js → chunk-KUEG2Y7M.js} +6 -6
- package/dist/{chunk-532HDXMM.js → chunk-KZ4I5M2X.js} +7 -7
- package/dist/{chunk-PB3NCPRF.js → chunk-KZH5YV6J.js} +6 -6
- package/dist/{chunk-5ORLKITZ.js → chunk-LBBI5P5G.js} +22 -22
- package/dist/{chunk-HRYI22QU.js → chunk-LCRQPWTC.js} +16 -16
- package/dist/chunk-LH4WAJLC.js +45 -0
- package/dist/{chunk-BBZ6UKN3.js → chunk-LHN5UCXD.js} +3 -3
- package/dist/{chunk-PIPYJTIL.js → chunk-LTOBNBJ6.js} +24 -24
- package/dist/{chunk-R6CJOMPC.js → chunk-LY7DOYX2.js} +13 -13
- package/dist/{chunk-QFDPX6C4.js → chunk-LZFKJ2BR.js} +4 -0
- package/dist/chunk-M5IQUWJR.js +59 -0
- package/dist/{chunk-3TGX4SJ3.js → chunk-MCORC2LG.js} +5 -5
- package/dist/{chunk-G3ZFEHCX.js → chunk-MEMEO7YO.js} +88 -25
- package/dist/{chunk-VE2T5URA.js → chunk-MGNO4Q6V.js} +23 -23
- package/dist/{chunk-RRKM3GJA.js → chunk-MKUBDKE2.js} +24 -24
- package/dist/{chunk-Z5YDTIWQ.js → chunk-MM7JSMLW.js} +13 -13
- package/dist/{chunk-MZWM73S2.js → chunk-MQ6HP2TU.js} +6 -6
- package/dist/{chunk-QYFNVQLK.js → chunk-MTIRNHRJ.js} +1 -1
- package/dist/{chunk-5Z7L2TSR.js → chunk-MY3LDBMR.js} +3 -3
- package/dist/chunk-MZ6GOFRF.js +55 -0
- package/dist/{chunk-RQAMZVWW.js → chunk-MZXDSAKW.js} +9 -9
- package/dist/{chunk-RU5W7JJQ.js → chunk-N2AW2DHF.js} +24 -24
- package/dist/chunk-N35Y5HZO.js +47 -0
- package/dist/{chunk-OKSRK2LJ.js → chunk-NCZS2BN2.js} +18 -18
- package/dist/{chunk-ZX6RAGE6.js → chunk-NECDBPFP.js} +10 -10
- package/dist/{chunk-UI6KNLSO.js → chunk-NHFMLMLN.js} +12 -12
- package/dist/{chunk-O4ZWZZZT.js → chunk-NMCPIYTF.js} +5 -5
- package/dist/{chunk-TBQHBOFF.js → chunk-NMURRF5F.js} +9 -9
- package/dist/{chunk-BTS56NV7.js → chunk-NP3PG6OI.js} +37 -34
- package/dist/{chunk-EPQQ2XVM.js → chunk-NQDVD2YR.js} +10 -10
- package/dist/{chunk-OSWOIFRQ.js → chunk-NVVEVP5O.js} +5 -5
- package/dist/{chunk-A3NUZJFI.js → chunk-OH2OHNB5.js} +3 -3
- package/dist/{chunk-IOHRX4KF.js → chunk-OI32KTDM.js} +18 -14
- package/dist/{chunk-ZSD75FYI.js → chunk-OXCHO2QS.js} +19 -19
- package/dist/{chunk-LKUTBQ2Y.js → chunk-P6DM2EFI.js} +6 -6
- package/dist/{chunk-OYKNPZCV.js → chunk-P6EJNPFF.js} +224 -180
- package/dist/{chunk-HWNFFCGB.js → chunk-PBDIVTFL.js} +3 -3
- package/dist/chunk-PFWP624T.js +278 -0
- package/dist/{chunk-3XZRYQWU.js → chunk-PGDVJWCI.js} +32 -32
- package/dist/{chunk-DIXA74N7.js → chunk-PLSCWC2V.js} +4 -4
- package/dist/chunk-PR6Z5L7W.js +67 -0
- package/dist/{chunk-LOCJHNZI.js → chunk-PXDAGXQN.js} +9 -9
- package/dist/{chunk-JJ4SCGRJ.js → chunk-PZFZPHCT.js} +7 -7
- package/dist/{chunk-TKE6ZJMM.js → chunk-Q3RKXK5Z.js} +25 -25
- package/dist/{chunk-GFYVVTKH.js → chunk-QAFQLILX.js} +6 -6
- package/dist/{chunk-WWSCJBF6.js → chunk-QQAWI5LD.js} +13 -13
- package/dist/{chunk-ZRQHSMPK.js → chunk-QXCGRQGO.js} +5 -5
- package/dist/{chunk-EHF2MBGR.js → chunk-R2FUFBHW.js} +3 -3
- package/dist/{chunk-AM7PYKVP.js → chunk-RBO4A7TC.js} +11 -11
- package/dist/{chunk-ETQSQ2EC.js → chunk-RCLBIJRN.js} +5 -5
- package/dist/{chunk-HNPKCRCE.js → chunk-RK5P2DWD.js} +1375 -210
- package/dist/{chunk-WAAPMZWO.js → chunk-RO6BE7ZS.js} +5 -5
- package/dist/{chunk-YF6N45QN.js → chunk-RQM5Y3HJ.js} +1 -1
- package/dist/{chunk-QXXEO4TF.js → chunk-RTCZKKG7.js} +3 -3
- package/dist/{chunk-QIDSEHJA.js → chunk-SAPX3PVK.js} +8 -8
- package/dist/{chunk-5PSKLTBR.js → chunk-SDHGFMES.js} +3 -3
- package/dist/{chunk-GQFUEUC7.js → chunk-SRB54QGX.js} +17 -17
- package/dist/{chunk-UCFNHK5L.js → chunk-STBJ6SVJ.js} +21 -21
- package/dist/{chunk-MCE74XMF.js → chunk-SZDOBIWE.js} +6 -6
- package/dist/{chunk-F63F4NKT.js → chunk-TLBPTUFU.js} +17 -17
- package/dist/{chunk-JLYH2QOE.js → chunk-TPKJD42W.js} +6 -6
- package/dist/{chunk-3NS4RS3C.js → chunk-TQG2DDWH.js} +19 -19
- package/dist/{chunk-CNF2EZ6S.js → chunk-TYN5SG5H.js} +119 -119
- package/dist/{chunk-SYLXQNPC.js → chunk-U3JXMY56.js} +23 -23
- package/dist/chunk-U3RGBYXE.js +62 -0
- package/dist/{chunk-A4VDFIMR.js → chunk-UAYU6K24.js} +13 -13
- package/dist/{chunk-LIQWFDOZ.js → chunk-UBEFT3MQ.js} +5 -5
- package/dist/{chunk-IJQHBK76.js → chunk-UFIQ5FWY.js} +1 -1
- package/dist/{chunk-IWPO5AUT.js → chunk-UIYPX2BA.js} +24 -24
- package/dist/{chunk-XNH5ZWIA.js → chunk-UJ5ZJS4B.js} +19 -19
- package/dist/chunk-URZKIL37.js +42 -0
- package/dist/{chunk-5MKV4TV6.js → chunk-UTZMF5CV.js} +1 -1
- package/dist/{chunk-YB5AKYVQ.js → chunk-UWBPC5XH.js} +6 -6
- package/dist/{chunk-6OZAQPU5.js → chunk-UXVKFOMC.js} +29 -5
- package/dist/{chunk-HRHXTLUM.js → chunk-UZBLVNW6.js} +15 -15
- package/dist/{chunk-JYJMIAFS.js → chunk-V3M4VFUB.js} +5 -5
- package/dist/{chunk-DCRZ3OQ7.js → chunk-V5FT3MZG.js} +6 -6
- package/dist/{chunk-KIY2WCN7.js → chunk-V5ZKGBYL.js} +4 -4
- package/dist/{chunk-MMOMKHAX.js → chunk-VCXFMXMX.js} +5 -5
- package/dist/{chunk-YLZNTVZR.js → chunk-VGGSHDQU.js} +8 -8
- package/dist/{chunk-A6ZG3UOS.js → chunk-VIQHZA53.js} +6 -6
- package/dist/{chunk-MT3FNSXO.js → chunk-VJO7M34N.js} +2 -2
- package/dist/{chunk-4DX4DIND.js → chunk-VPQUFIE7.js} +8 -8
- package/dist/{chunk-TAR6T2RE.js → chunk-VTR4AC2U.js} +3 -3
- package/dist/{chunk-6TNQO76I.js → chunk-VUSYN4R4.js} +6 -6
- package/dist/{chunk-HGDBM3A5.js → chunk-W4SMKUAK.js} +2 -2
- package/dist/chunk-W7HNZDHB.js +71 -0
- package/dist/{chunk-U2JTTRKS.js → chunk-WH3ZFLXT.js} +7 -7
- package/dist/{chunk-IB66ZLDN.js → chunk-WLA2JZ2K.js} +5 -5
- package/dist/{chunk-H5EQOSTC.js → chunk-WM4EMP7T.js} +39 -39
- package/dist/{chunk-E7YDJH6B.js → chunk-WT6EXYEY.js} +10 -10
- package/dist/{chunk-JCEYOSST.js → chunk-WYO4L4NU.js} +4 -4
- package/dist/{chunk-GCMDDVIE.js → chunk-XDLMQL5A.js} +44 -11
- package/dist/{chunk-U57VLY6X.js → chunk-XEWFVHOT.js} +21 -21
- package/dist/{chunk-44QUCNPH.js → chunk-XI3GPYP4.js} +5 -5
- package/dist/{chunk-MDTAZ6NE.js → chunk-XIGVTH24.js} +12 -12
- package/dist/{chunk-OSZTENIA.js → chunk-XIJBQM45.js} +3 -3
- package/dist/{chunk-NN6AXKFX.js → chunk-XT3ZW7C7.js} +16 -16
- package/dist/{chunk-LELM7X5H.js → chunk-YEHSJY6B.js} +8 -8
- package/dist/{chunk-7HWCEDPX.js → chunk-YIOYKA4V.js} +5 -5
- package/dist/{chunk-ROWZYQOI.js → chunk-YJBD5NDV.js} +6 -6
- package/dist/{chunk-PUMNCWHJ.js → chunk-YLXPJWNO.js} +14 -14
- package/dist/{chunk-NX5IPHI3.js → chunk-YWQZ7CCW.js} +13 -13
- package/dist/{chunk-DH3EQMIA.js → chunk-YXKCE5BA.js} +4 -4
- package/dist/{chunk-D63NU53X.js → chunk-YYV276DM.js} +19 -19
- package/dist/{chunk-GQPP4P2E.js → chunk-YYZWSVIS.js} +17 -17
- package/dist/{chunk-RYY554OA.js → chunk-Z33UNTHI.js} +6 -6
- package/dist/{chunk-Q5QSWV2R.js → chunk-ZA2PWNR3.js} +13 -13
- package/dist/{chunk-T24TBI7F.js → chunk-ZAMSF2DF.js} +23 -23
- package/dist/{chunk-MOWUP33K.js → chunk-ZDA72732.js} +3 -3
- package/dist/{chunk-ENZ3PI7L.js → chunk-ZFEOIYK5.js} +3 -3
- package/dist/{chunk-YDDLVBQ4.js → chunk-ZFLBWL2G.js} +3 -3
- package/dist/{chunk-QK6CGRKK.js → chunk-ZLBUFK7L.js} +5 -5
- package/dist/{chunk-LIB6AUZS.js → chunk-ZNYSBQIA.js} +5 -5
- package/dist/{chunk-OTUBMKSG.js → chunk-ZQGFZJH5.js} +4 -4
- package/dist/{chunk-AAY6VPPO.js → chunk-ZWMHL346.js} +17 -17
- package/dist/{chunk-BLVFHN3C.js → chunk-ZYLGEWTC.js} +39 -39
- package/dist/files.json +551 -551
- package/dist/packages/sdk/npm/index.js +183 -30
- package/dist/packages/ui/dist/assets/{elk-api--rH6Kdl4.js → elk-api-BdXSPeBO.js} +2 -2
- package/dist/packages/ui/dist/assets/index-DRSUhpFi.css +1 -0
- package/dist/packages/ui/dist/assets/index-RZe5iotJ.js +63 -0
- package/dist/packages/ui/dist/index.html +2 -2
- package/package.json +3 -3
- package/dist/chunk-26AB2WNW.js +0 -62
- package/dist/chunk-C7BB6IQT.js +0 -147
- package/dist/chunk-DD2AXECF.js +0 -41
- package/dist/chunk-DYDNW4O6.js +0 -52
- package/dist/chunk-EEKQI3U4.js +0 -45
- package/dist/chunk-FYWLB7PO.js +0 -38
- package/dist/chunk-L27KUL5B.js +0 -38
- package/dist/chunk-MA6UK7GX.js +0 -42
- package/dist/chunk-NBZ7RKX3.js +0 -46
- package/dist/chunk-OYZ64UMQ.js +0 -67
- package/dist/chunk-PIPJZIJE.js +0 -47
- package/dist/chunk-Q2ULHBCJ.js +0 -59
- package/dist/chunk-QVF4KYIO.js +0 -71
- package/dist/chunk-T2HXLDY3.js +0 -55
- package/dist/chunk-TKEXS74L.js +0 -52
- package/dist/chunk-WQDJGNJQ.js +0 -45
- package/dist/packages/ui/dist/assets/index-Bf2immpE.css +0 -1
- package/dist/packages/ui/dist/assets/index-CH4nGIW3.js +0 -62
|
@@ -5,16 +5,18 @@ var __atticusUrl = (p) => new URL("./" + p, import.meta.url).href;
|
|
|
5
5
|
var __atticusPath = (p) => __atticusFileURLToPath(__atticusUrl(p));
|
|
6
6
|
import {
|
|
7
7
|
readOpenApiDocument
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-I2EWY3MG.js";
|
|
9
9
|
import {
|
|
10
10
|
globToRegExp
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-UFIQ5FWY.js";
|
|
12
12
|
import {
|
|
13
13
|
DECLARED_TOPIC,
|
|
14
14
|
Fact,
|
|
15
15
|
FactId,
|
|
16
16
|
JOINED_BY_AI,
|
|
17
17
|
JOINED_BY_BASE_PATH,
|
|
18
|
+
JOINED_BY_PATH,
|
|
19
|
+
JOINED_BY_PATH_OVERLAP,
|
|
18
20
|
JOINED_BY_PERSON,
|
|
19
21
|
JOINED_TO_SHARED_MAP,
|
|
20
22
|
JOIN_GUESS_FLAGS,
|
|
@@ -25,6 +27,8 @@ import {
|
|
|
25
27
|
citedFiles,
|
|
26
28
|
claimOnLines,
|
|
27
29
|
clusterServiceAddress,
|
|
30
|
+
configSecretField,
|
|
31
|
+
credentialLike,
|
|
28
32
|
decodeText,
|
|
29
33
|
dependencyLinkId,
|
|
30
34
|
factIdPart,
|
|
@@ -41,6 +45,7 @@ import {
|
|
|
41
45
|
noteProblem,
|
|
42
46
|
partsBuildWord,
|
|
43
47
|
partsNamePath,
|
|
48
|
+
placedComponentOf,
|
|
44
49
|
plainPathPrefix,
|
|
45
50
|
quoteHoldsSecret,
|
|
46
51
|
quoteMatches,
|
|
@@ -49,15 +54,16 @@ import {
|
|
|
49
54
|
staleCite,
|
|
50
55
|
toCanonicalYaml,
|
|
51
56
|
tokenUnits
|
|
52
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-6ZDAEUKB.js";
|
|
53
58
|
import {
|
|
54
59
|
DEFAULT_CONVENTIONS,
|
|
60
|
+
DEFAULT_GATEWAY_BUNDLE_FOLDERS,
|
|
55
61
|
NEVER_CHECKED_STEPS,
|
|
56
62
|
gatewayBundleTest,
|
|
57
63
|
normalizePath,
|
|
58
64
|
notDeviceName,
|
|
59
65
|
underFolders
|
|
60
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-LZFKJ2BR.js";
|
|
61
67
|
|
|
62
68
|
// packages/verify/dist/source.js
|
|
63
69
|
import { lstatSync, readFileSync, realpathSync, statSync } from "node:fs";
|
|
@@ -174,186 +180,870 @@ function tooBigToRead(source, path) {
|
|
|
174
180
|
}
|
|
175
181
|
|
|
176
182
|
// packages/verify/dist/build-coords.js
|
|
177
|
-
var POM = /(^|\/)pom\.xml$|\.pom$/i;
|
|
183
|
+
var POM = /(^|\/)([^/]*[-_.])?pom\.xml$|\.pom$/i;
|
|
184
|
+
var GENERATED_POM = /(^|\/)(dependency-reduced-pom\.xml|\.flattened-pom\.xml)$/i;
|
|
178
185
|
var GRADLE_BUILD = /(^|\/)build\.gradle(\.kts)?$/i;
|
|
179
186
|
var GRADLE_SETTINGS = /(^|\/)settings\.gradle(\.kts)?$/i;
|
|
180
|
-
var
|
|
181
|
-
var
|
|
187
|
+
var VERSION_CATALOG = /(^|\/)gradle\/([\w-]+)\.versions\.toml$/i;
|
|
188
|
+
var slash = (p) => p.replace(/\\/g, "/");
|
|
189
|
+
var isPomFile = (p) => POM.test(slash(p)) && !GENERATED_POM.test(slash(p));
|
|
190
|
+
var isGradleBuildFile = (p) => GRADLE_BUILD.test(slash(p));
|
|
191
|
+
var isGradleSettingsFile = (p) => GRADLE_SETTINGS.test(slash(p));
|
|
192
|
+
var isVersionCatalogFile = (p) => VERSION_CATALOG.test(slash(p));
|
|
193
|
+
var isGradleFile = (p) => isGradleBuildFile(p) || isGradleSettingsFile(p) || isVersionCatalogFile(p);
|
|
182
194
|
var isBuildFile = (p) => isPomFile(p) || isGradleFile(p);
|
|
183
|
-
var
|
|
195
|
+
var isPomFileIn = (p, named) => isPomFile(p) || !!named?.has(slash(p)) && !GENERATED_POM.test(slash(p));
|
|
196
|
+
var isBuildFileIn = (p, named) => isBuildFile(p) || isPomFileIn(p, named);
|
|
197
|
+
var COORDINATE = /^[A-Za-z0-9_][A-Za-z0-9._-]*$/;
|
|
198
|
+
function lineIndex(text) {
|
|
199
|
+
const starts = [0];
|
|
200
|
+
for (let i = 0; i < text.length; i++)
|
|
201
|
+
if (text.charCodeAt(i) === 10)
|
|
202
|
+
starts.push(i + 1);
|
|
203
|
+
return (offset) => {
|
|
204
|
+
let lo = 0;
|
|
205
|
+
let hi = starts.length - 1;
|
|
206
|
+
while (lo < hi) {
|
|
207
|
+
const mid = lo + hi + 1 >> 1;
|
|
208
|
+
if (starts[mid] <= offset)
|
|
209
|
+
lo = mid;
|
|
210
|
+
else
|
|
211
|
+
hi = mid - 1;
|
|
212
|
+
}
|
|
213
|
+
return lo + 1;
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
function xmlTokens(text) {
|
|
217
|
+
const lineAt = lineIndex(text);
|
|
218
|
+
const out = [];
|
|
219
|
+
const pushText = (from, to, value = text.slice(from, to)) => {
|
|
220
|
+
const lead = value.length - value.trimStart().length;
|
|
221
|
+
if (value.trim())
|
|
222
|
+
out.push({ type: "text", value: value.trim(), line: lineAt(from + lead) });
|
|
223
|
+
};
|
|
224
|
+
let i = 0;
|
|
225
|
+
let textFrom = 0;
|
|
226
|
+
while (i < text.length) {
|
|
227
|
+
const lt = text.indexOf("<", i);
|
|
228
|
+
if (lt < 0)
|
|
229
|
+
break;
|
|
230
|
+
if (text.startsWith("<!--", lt)) {
|
|
231
|
+
pushText(textFrom, lt);
|
|
232
|
+
const end = text.indexOf("-->", lt + 4);
|
|
233
|
+
i = textFrom = end < 0 ? text.length : end + 3;
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
if (text.startsWith("<![CDATA[", lt)) {
|
|
237
|
+
pushText(textFrom, lt);
|
|
238
|
+
const end = text.indexOf("]]>", lt + 9);
|
|
239
|
+
const stop = end < 0 ? text.length : end;
|
|
240
|
+
pushText(lt + 9, stop);
|
|
241
|
+
i = textFrom = end < 0 ? text.length : end + 3;
|
|
242
|
+
continue;
|
|
243
|
+
}
|
|
244
|
+
if (text.startsWith("<?", lt) || text.startsWith("<!", lt)) {
|
|
245
|
+
pushText(textFrom, lt);
|
|
246
|
+
const end = text.indexOf(text.startsWith("<?", lt) ? "?>" : ">", lt + 2);
|
|
247
|
+
i = textFrom = end < 0 ? text.length : end + (text.startsWith("<?", lt) ? 2 : 1);
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
const m = /^<(\/?)([A-Za-z_][\w.:-]*)/.exec(text.slice(lt, lt + 200));
|
|
251
|
+
if (!m) {
|
|
252
|
+
i = lt + 1;
|
|
253
|
+
continue;
|
|
254
|
+
}
|
|
255
|
+
let j = lt + m[0].length;
|
|
256
|
+
let quote = "";
|
|
257
|
+
for (; j < text.length; j++) {
|
|
258
|
+
const c = text[j];
|
|
259
|
+
if (quote) {
|
|
260
|
+
if (c === quote)
|
|
261
|
+
quote = "";
|
|
262
|
+
} else if (c === '"' || c === "'")
|
|
263
|
+
quote = c;
|
|
264
|
+
else if (c === ">")
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
pushText(textFrom, lt);
|
|
268
|
+
const close = m[1] === "/";
|
|
269
|
+
const self = !close && text[j - 1] === "/";
|
|
270
|
+
out.push({ type: close ? "close" : self ? "self" : "open", name: m[2], line: lineAt(lt) });
|
|
271
|
+
i = textFrom = j + 1;
|
|
272
|
+
}
|
|
273
|
+
pushText(textFrom, text.length);
|
|
274
|
+
return out;
|
|
275
|
+
}
|
|
276
|
+
var leaf = (frame, name) => frame.leaves.get(name);
|
|
184
277
|
function pomCoordinates(lines) {
|
|
185
|
-
const
|
|
278
|
+
const held = POMS.get(lines);
|
|
279
|
+
if (held)
|
|
280
|
+
return held;
|
|
281
|
+
const out = readPom(lines);
|
|
282
|
+
POMS.set(lines, out);
|
|
283
|
+
return out;
|
|
284
|
+
}
|
|
285
|
+
var POMS = /* @__PURE__ */ new WeakMap();
|
|
286
|
+
function readPom(lines) {
|
|
287
|
+
const out = { dependencies: [], modules: [], properties: /* @__PURE__ */ new Map() };
|
|
288
|
+
const text = lines.map((l, i) => {
|
|
289
|
+
const t = l.endsWith("\r") ? l.slice(0, -1) : l;
|
|
290
|
+
return i === 0 && t.charCodeAt(0) === 65279 ? t.slice(1) : t;
|
|
291
|
+
}).join("\n");
|
|
186
292
|
const stack = [];
|
|
187
|
-
let inComment = false;
|
|
188
293
|
const names = () => stack.map((f) => f.name);
|
|
189
|
-
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
294
|
+
for (const t of xmlTokens(text)) {
|
|
295
|
+
const top = stack[stack.length - 1];
|
|
296
|
+
if (t.type === "text") {
|
|
297
|
+
if (top && !top.text) {
|
|
298
|
+
top.text = t.value;
|
|
299
|
+
top.textLine = t.line;
|
|
300
|
+
}
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
303
|
+
if (t.type !== "close") {
|
|
304
|
+
if (top)
|
|
305
|
+
top.children = true;
|
|
306
|
+
if (t.type === "self") {
|
|
307
|
+
if (t.name === "relativePath" && top?.name === "parent")
|
|
308
|
+
top.leaves.set("relativePath", { value: "", line: t.line });
|
|
200
309
|
continue;
|
|
201
310
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
311
|
+
stack.push({ name: t.name, leaves: /* @__PURE__ */ new Map(), children: false, text: "", textLine: t.line });
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
const at = names().lastIndexOf(t.name);
|
|
315
|
+
if (at < 0)
|
|
316
|
+
continue;
|
|
317
|
+
while (stack.length > at + 1)
|
|
318
|
+
stack.pop();
|
|
319
|
+
const done = stack.pop();
|
|
320
|
+
const parent = stack[stack.length - 1];
|
|
321
|
+
const value = !done.children && done.text ? { value: done.text, line: done.textLine } : void 0;
|
|
322
|
+
if (value && parent)
|
|
323
|
+
parent.leaves.set(done.name, value);
|
|
324
|
+
const path = [...names(), done.name];
|
|
325
|
+
if (done.name === "dependency") {
|
|
326
|
+
const g = leaf(done, "groupId");
|
|
327
|
+
const a = leaf(done, "artifactId");
|
|
328
|
+
const v = leaf(done, "version");
|
|
329
|
+
const s = leaf(done, "scope");
|
|
330
|
+
out.dependencies.push({
|
|
331
|
+
...g ? { group: g } : {},
|
|
332
|
+
...a ? { artifact: a } : {},
|
|
333
|
+
...v ? { version: v } : {},
|
|
334
|
+
...s ? { scope: s } : {},
|
|
335
|
+
managed: path.includes("dependencyManagement"),
|
|
336
|
+
plugin: path.includes("plugin") || path.includes("extension")
|
|
337
|
+
});
|
|
338
|
+
} else if (done.name === "module" && value && path[0] === "project") {
|
|
339
|
+
const p = path.join("/");
|
|
340
|
+
if (p === "project/modules/module" || p === "project/profiles/profile/modules/module")
|
|
341
|
+
out.modules.push(value);
|
|
342
|
+
} else if (done.name === "properties" && path.length === 2 && path[0] === "project") {
|
|
343
|
+
for (const [k, v] of done.leaves)
|
|
344
|
+
out.properties.set(k, v);
|
|
345
|
+
} else if (done.name === "parent" && path.length === 2 && path[0] === "project") {
|
|
346
|
+
if (leaf(done, "groupId"))
|
|
347
|
+
out.parentGroup = leaf(done, "groupId");
|
|
348
|
+
if (leaf(done, "artifactId"))
|
|
349
|
+
out.parentArtifact = leaf(done, "artifactId");
|
|
350
|
+
if (leaf(done, "version"))
|
|
351
|
+
out.parentVersion = leaf(done, "version");
|
|
352
|
+
if (leaf(done, "relativePath"))
|
|
353
|
+
out.parentRelativePath = leaf(done, "relativePath");
|
|
354
|
+
} else if (done.name === "project" && path.length === 1) {
|
|
355
|
+
if (leaf(done, "groupId"))
|
|
356
|
+
out.group = leaf(done, "groupId");
|
|
357
|
+
if (leaf(done, "artifactId"))
|
|
358
|
+
out.artifact = leaf(done, "artifactId");
|
|
359
|
+
if (leaf(done, "version"))
|
|
360
|
+
out.version = leaf(done, "version");
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return out;
|
|
364
|
+
}
|
|
365
|
+
var PROPERTY = /^\$\{([^}]+)\}$/;
|
|
366
|
+
function resolvePomValue(at, pom, o = {}, depth = 0) {
|
|
367
|
+
const m = PROPERTY.exec(at.value.trim());
|
|
368
|
+
if (!m)
|
|
369
|
+
return { value: at.value, line: at.line };
|
|
370
|
+
const key = m[1].trim();
|
|
371
|
+
const own = {
|
|
372
|
+
"project.groupId": pom.group ?? pom.parentGroup,
|
|
373
|
+
"pom.groupId": pom.group ?? pom.parentGroup,
|
|
374
|
+
groupId: pom.group ?? pom.parentGroup,
|
|
375
|
+
"project.artifactId": pom.artifact,
|
|
376
|
+
"pom.artifactId": pom.artifact,
|
|
377
|
+
artifactId: pom.artifact,
|
|
378
|
+
"project.version": pom.version ?? pom.parentVersion,
|
|
379
|
+
"pom.version": pom.version ?? pom.parentVersion,
|
|
380
|
+
"project.parent.groupId": pom.parentGroup,
|
|
381
|
+
"parent.groupId": pom.parentGroup,
|
|
382
|
+
"project.parent.artifactId": pom.parentArtifact,
|
|
383
|
+
"parent.artifactId": pom.parentArtifact,
|
|
384
|
+
"project.parent.version": pom.parentVersion,
|
|
385
|
+
"parent.version": pom.parentVersion
|
|
386
|
+
};
|
|
387
|
+
const builtin = Object.hasOwn(own, key);
|
|
388
|
+
let to;
|
|
389
|
+
if (builtin) {
|
|
390
|
+
const b = own[key];
|
|
391
|
+
if (b)
|
|
392
|
+
to = { at: b, file: o.file ?? "" };
|
|
393
|
+
} else {
|
|
394
|
+
const mine = pom.properties.get(key);
|
|
395
|
+
if (mine)
|
|
396
|
+
to = { at: mine, file: o.file ?? "" };
|
|
397
|
+
else
|
|
398
|
+
for (const p of o.parents ?? []) {
|
|
399
|
+
const theirs = p.pom.properties.get(key);
|
|
400
|
+
if (theirs) {
|
|
401
|
+
to = { at: theirs, file: p.file };
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
206
404
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
405
|
+
}
|
|
406
|
+
if (!to || to.at === at || depth > 4)
|
|
407
|
+
return { missing: key };
|
|
408
|
+
const next = resolvePomValue(to.at, pom, o, depth + 1);
|
|
409
|
+
if ("missing" in next)
|
|
410
|
+
return next;
|
|
411
|
+
const via = [...builtin ? [] : [{ file: to.file, line: to.at.line }], ...next.via ?? []];
|
|
412
|
+
return { value: next.value, line: at.line, ...via.length ? { via } : {} };
|
|
413
|
+
}
|
|
414
|
+
function pomTarget(dir, rel) {
|
|
415
|
+
const to = joinDir(dir, rel.trim());
|
|
416
|
+
if (/\.(xml|pom)$/i.test(rel.trim()))
|
|
417
|
+
return to;
|
|
418
|
+
return to ? `${to}/pom.xml` : "pom.xml";
|
|
419
|
+
}
|
|
420
|
+
function pomFilesNamed(files, linesOf2) {
|
|
421
|
+
const held = NAMED.get(files);
|
|
422
|
+
if (held)
|
|
423
|
+
return held;
|
|
424
|
+
const all2 = new Set(files.map(slash));
|
|
425
|
+
const out = /* @__PURE__ */ new Set();
|
|
426
|
+
let next = files.map(slash).filter(isPomFile);
|
|
427
|
+
for (let round = 0; round < 5 && next.length; round++) {
|
|
428
|
+
const found = [];
|
|
429
|
+
for (const f of next) {
|
|
430
|
+
const lines = linesOf2(f);
|
|
431
|
+
const rel = lines ? pomCoordinates(lines).parentRelativePath?.value.trim() : void 0;
|
|
432
|
+
if (!rel)
|
|
433
|
+
continue;
|
|
434
|
+
const to = pomTarget(dirOf(f), rel);
|
|
435
|
+
if (all2.has(to) && !isPomFile(to) && !out.has(to) && !GENERATED_POM.test(to)) {
|
|
436
|
+
out.add(to);
|
|
437
|
+
found.push(to);
|
|
219
438
|
}
|
|
220
|
-
|
|
439
|
+
}
|
|
440
|
+
next = found;
|
|
441
|
+
}
|
|
442
|
+
NAMED.set(files, out);
|
|
443
|
+
return out;
|
|
444
|
+
}
|
|
445
|
+
var NAMED = /* @__PURE__ */ new WeakMap();
|
|
446
|
+
function moduleParentsOf(files, linesOf2) {
|
|
447
|
+
const held = LISTED.get(files);
|
|
448
|
+
if (held)
|
|
449
|
+
return held;
|
|
450
|
+
const named = pomFilesNamed(files, linesOf2);
|
|
451
|
+
const out = /* @__PURE__ */ new Map();
|
|
452
|
+
for (const f of files.map(slash).sort()) {
|
|
453
|
+
if (!isPomFileIn(f, named))
|
|
454
|
+
continue;
|
|
455
|
+
const lines = linesOf2(f);
|
|
456
|
+
if (!lines)
|
|
457
|
+
continue;
|
|
458
|
+
for (const m of pomCoordinates(lines).modules) {
|
|
459
|
+
const dir = dirOf(pomTarget(dirOf(f), m.value));
|
|
460
|
+
if (!out.has(dir))
|
|
461
|
+
out.set(dir, f);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
LISTED.set(files, out);
|
|
465
|
+
return out;
|
|
466
|
+
}
|
|
467
|
+
var LISTED = /* @__PURE__ */ new WeakMap();
|
|
468
|
+
function pomParents(file, linesOf2, files) {
|
|
469
|
+
const out = [];
|
|
470
|
+
const seen = /* @__PURE__ */ new Set([slash(file)]);
|
|
471
|
+
let at = slash(file);
|
|
472
|
+
let lines = linesOf2(at);
|
|
473
|
+
for (let n = 0; n < 6 && lines; n++) {
|
|
474
|
+
const pom = pomCoordinates(lines);
|
|
475
|
+
if (!pom.parentArtifact)
|
|
476
|
+
break;
|
|
477
|
+
const rel = pom.parentRelativePath?.value.trim();
|
|
478
|
+
if (rel === "")
|
|
479
|
+
break;
|
|
480
|
+
const dir = dirOf(at);
|
|
481
|
+
const candidates = rel ? [pomTarget(dir, rel)] : [
|
|
482
|
+
...files ? [moduleParentsOf(files, linesOf2).get(dir)] : [],
|
|
483
|
+
...dir ? [pomTarget(dir, "..")] : []
|
|
484
|
+
];
|
|
485
|
+
const want = pom.parentArtifact.value.trim();
|
|
486
|
+
let found;
|
|
487
|
+
for (const c of candidates) {
|
|
488
|
+
if (!c || seen.has(c))
|
|
221
489
|
continue;
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
if (!close) {
|
|
225
|
-
if (top2)
|
|
226
|
-
top2.children = true;
|
|
227
|
-
if (selfClosing)
|
|
228
|
-
continue;
|
|
229
|
-
stack.push({ name: m[2], leaves: /* @__PURE__ */ new Map(), children: false, text: "", textLine: n });
|
|
490
|
+
const ls = linesOf2(c);
|
|
491
|
+
if (!ls)
|
|
230
492
|
continue;
|
|
231
|
-
|
|
232
|
-
const
|
|
233
|
-
if (
|
|
493
|
+
const theirs = pomCoordinates(ls);
|
|
494
|
+
const name = theirs.artifact?.value.trim();
|
|
495
|
+
if (name !== void 0 && !PROPERTY.test(name) && !PROPERTY.test(want) && name !== want)
|
|
234
496
|
continue;
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
const done = stack.pop();
|
|
238
|
-
const parent = stack[stack.length - 1];
|
|
239
|
-
if (!done.children && done.text && parent)
|
|
240
|
-
parent.leaves.set(done.name, { value: done.text, line: done.textLine });
|
|
241
|
-
const path = [...names(), done.name];
|
|
242
|
-
if (done.name === "dependency") {
|
|
243
|
-
out.dependencies.push({
|
|
244
|
-
...done.leaves.get("groupId") ? { group: done.leaves.get("groupId") } : {},
|
|
245
|
-
...done.leaves.get("artifactId") ? { artifact: done.leaves.get("artifactId") } : {},
|
|
246
|
-
...done.leaves.get("version") ? { version: done.leaves.get("version") } : {},
|
|
247
|
-
...done.leaves.get("scope") ? { scope: done.leaves.get("scope") } : {},
|
|
248
|
-
managed: path.includes("dependencyManagement"),
|
|
249
|
-
plugin: path.includes("plugin") || path.includes("extension")
|
|
250
|
-
});
|
|
251
|
-
} else if (done.name === "parent" && path.length === 2 && path[0] === "project") {
|
|
252
|
-
if (done.leaves.get("groupId"))
|
|
253
|
-
out.parentGroup = done.leaves.get("groupId");
|
|
254
|
-
if (done.leaves.get("artifactId"))
|
|
255
|
-
out.parentArtifact = done.leaves.get("artifactId");
|
|
256
|
-
if (done.leaves.get("version"))
|
|
257
|
-
out.parentVersion = done.leaves.get("version");
|
|
258
|
-
} else if (done.name === "project" && path.length === 1) {
|
|
259
|
-
if (done.leaves.get("groupId"))
|
|
260
|
-
out.group = done.leaves.get("groupId");
|
|
261
|
-
if (done.leaves.get("artifactId"))
|
|
262
|
-
out.artifact = done.leaves.get("artifactId");
|
|
263
|
-
if (done.leaves.get("version"))
|
|
264
|
-
out.version = done.leaves.get("version");
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
const top = stack[stack.length - 1];
|
|
268
|
-
const tail = line.slice(last);
|
|
269
|
-
if (top && tail.trim() && !top.text) {
|
|
270
|
-
top.text = tail.trim();
|
|
271
|
-
top.textLine = n;
|
|
497
|
+
found = { file: c, pom: theirs };
|
|
498
|
+
break;
|
|
272
499
|
}
|
|
273
|
-
|
|
500
|
+
if (!found)
|
|
501
|
+
break;
|
|
502
|
+
out.push(found);
|
|
503
|
+
seen.add(found.file);
|
|
504
|
+
at = found.file;
|
|
505
|
+
lines = linesOf2(at);
|
|
506
|
+
}
|
|
274
507
|
return out;
|
|
275
508
|
}
|
|
276
|
-
var
|
|
277
|
-
var GRADLE_DEP = new RegExp(`^\\s
|
|
278
|
-
var GRADLE_MAP_DEP =
|
|
279
|
-
var NOT_A_CONFIGURATION = /* @__PURE__ */ new Set([
|
|
509
|
+
var CONFIGURATION = `(?:(["'])([A-Za-z]\\w*)\\1\\s*(?=\\()|([A-Za-z]\\w*))`;
|
|
510
|
+
var GRADLE_DEP = new RegExp(`^\\s*${CONFIGURATION}\\s*\\(?\\s*(?:(platform|enforcedPlatform)\\s*\\(\\s*)?(['"])([^'"\\s]+)\\5`);
|
|
511
|
+
var GRADLE_MAP_DEP = new RegExp(`^\\s*${CONFIGURATION}\\s*\\(?\\s*group\\s*[:=]\\s*(['"])([^'"]+)\\4\\s*,\\s*name\\s*[:=]\\s*(['"])([^'"]+)\\6(?:\\s*,\\s*version\\s*[:=]\\s*(['"])([^'"]+)\\8)?`);
|
|
512
|
+
var NOT_A_CONFIGURATION = /* @__PURE__ */ new Set([
|
|
513
|
+
"id",
|
|
514
|
+
"apply",
|
|
515
|
+
"plugin",
|
|
516
|
+
"include",
|
|
517
|
+
"includeBuild",
|
|
518
|
+
"classpath",
|
|
519
|
+
"group",
|
|
520
|
+
"version",
|
|
521
|
+
"url",
|
|
522
|
+
"uri",
|
|
523
|
+
"dependency",
|
|
524
|
+
"dependencySet",
|
|
525
|
+
"entry",
|
|
526
|
+
"mavenBom",
|
|
527
|
+
"imports",
|
|
528
|
+
"force",
|
|
529
|
+
"exclude",
|
|
530
|
+
"module",
|
|
531
|
+
"substitute",
|
|
532
|
+
"because",
|
|
533
|
+
"strictly",
|
|
534
|
+
"require",
|
|
535
|
+
"prefer",
|
|
536
|
+
"reject",
|
|
537
|
+
"alias",
|
|
538
|
+
"from",
|
|
539
|
+
"maven",
|
|
540
|
+
"mainClass",
|
|
541
|
+
"println",
|
|
542
|
+
"description"
|
|
543
|
+
]);
|
|
544
|
+
var TOOL_CONFIGURATIONS = /* @__PURE__ */ new Set([
|
|
545
|
+
"checkstyle",
|
|
546
|
+
"pmd",
|
|
547
|
+
"spotbugs",
|
|
548
|
+
"spotbugsPlugins",
|
|
549
|
+
"spotbugsSlf4j",
|
|
550
|
+
"jacocoAgent",
|
|
551
|
+
"jacocoAnt",
|
|
552
|
+
"detekt",
|
|
553
|
+
"detektPlugins",
|
|
554
|
+
"ktlint",
|
|
555
|
+
"ktlintRuleset",
|
|
556
|
+
"codenarc",
|
|
557
|
+
"errorprone",
|
|
558
|
+
"pitest"
|
|
559
|
+
]);
|
|
560
|
+
function gradleToolConfigurationOn(line) {
|
|
561
|
+
const c = /^\s*(["']?)([A-Za-z]\w*)\1\s*[\s(]/.exec(line)?.[2];
|
|
562
|
+
return c && TOOL_CONFIGURATIONS.has(c) ? c : void 0;
|
|
563
|
+
}
|
|
564
|
+
var TEST_CONFIGURATION = /^(test|testFixtures|\w+Test)(Implementation|Api|CompileOnly|RuntimeOnly|Compile|Runtime|AnnotationProcessor|CompileClasspath|RuntimeClasspath)$/;
|
|
280
565
|
function scopeOfConfiguration(c, platform) {
|
|
281
566
|
if (platform)
|
|
282
567
|
return "import";
|
|
283
|
-
if (
|
|
568
|
+
if (TEST_CONFIGURATION.test(c))
|
|
284
569
|
return "test";
|
|
285
|
-
if (/^(compileOnly|annotationProcessor|kapt|compileOnlyApi)
|
|
570
|
+
if (/^(compileOnly|annotationProcessor|kapt|ksp|compileOnlyApi|providedCompile|providedRuntime)$/.test(c))
|
|
286
571
|
return "provided";
|
|
287
|
-
if (/^runtimeOnly
|
|
572
|
+
if (/^(runtimeOnly|runtime|developmentOnly|testAndDevelopmentOnly)$/.test(c))
|
|
288
573
|
return "runtime";
|
|
289
574
|
return "compile";
|
|
290
575
|
}
|
|
291
576
|
function gradleDependencyOn(line) {
|
|
577
|
+
if (gradleToolConfigurationOn(line))
|
|
578
|
+
return void 0;
|
|
292
579
|
const map = GRADLE_MAP_DEP.exec(line);
|
|
293
|
-
|
|
580
|
+
const mapConf = map ? map[2] ?? map[3] : "";
|
|
581
|
+
if (map && !NOT_A_CONFIGURATION.has(mapConf)) {
|
|
582
|
+
if (!COORDINATE.test(map[5]) || !COORDINATE.test(map[7]))
|
|
583
|
+
return void 0;
|
|
294
584
|
return {
|
|
295
|
-
configuration:
|
|
296
|
-
group: map[
|
|
297
|
-
name: map[
|
|
298
|
-
...map[
|
|
299
|
-
scope: scopeOfConfiguration(
|
|
585
|
+
configuration: mapConf,
|
|
586
|
+
group: map[5],
|
|
587
|
+
name: map[7],
|
|
588
|
+
...map[9] ? { version: map[9] } : {},
|
|
589
|
+
scope: scopeOfConfiguration(mapConf, false)
|
|
300
590
|
};
|
|
591
|
+
}
|
|
301
592
|
const m = GRADLE_DEP.exec(line);
|
|
302
|
-
|
|
593
|
+
const conf = m ? m[2] ?? m[3] : "";
|
|
594
|
+
if (!m || NOT_A_CONFIGURATION.has(conf))
|
|
303
595
|
return void 0;
|
|
304
|
-
const parts = m[
|
|
305
|
-
if (parts.length < 2 || !parts[0] || !parts[1])
|
|
596
|
+
const parts = m[6].split(":");
|
|
597
|
+
if (parts.length < 2 || !COORDINATE.test(parts[0]) || !COORDINATE.test(parts[1]))
|
|
306
598
|
return void 0;
|
|
307
599
|
return {
|
|
308
|
-
configuration:
|
|
600
|
+
configuration: conf,
|
|
309
601
|
group: parts[0],
|
|
310
602
|
name: parts[1],
|
|
311
603
|
...parts[2] ? { version: parts[2] } : {},
|
|
312
|
-
scope: scopeOfConfiguration(
|
|
604
|
+
scope: scopeOfConfiguration(conf, !!m[4])
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
function gradleBlocks(lines) {
|
|
608
|
+
const held = BLOCKS.get(lines);
|
|
609
|
+
if (held)
|
|
610
|
+
return held;
|
|
611
|
+
const out = readBlocks(lines);
|
|
612
|
+
BLOCKS.set(lines, out);
|
|
613
|
+
return out;
|
|
614
|
+
}
|
|
615
|
+
var BLOCKS = /* @__PURE__ */ new WeakMap();
|
|
616
|
+
function readBlocks(lines) {
|
|
617
|
+
const out = [];
|
|
618
|
+
const stack = [];
|
|
619
|
+
let triple = "";
|
|
620
|
+
let block = false;
|
|
621
|
+
let previous = "";
|
|
622
|
+
for (const raw of lines) {
|
|
623
|
+
out.push([...stack]);
|
|
624
|
+
let code2 = "";
|
|
625
|
+
for (let i = 0; i < raw.length; i++) {
|
|
626
|
+
const c = raw[i];
|
|
627
|
+
if (block) {
|
|
628
|
+
if (raw.startsWith("*/", i)) {
|
|
629
|
+
block = false;
|
|
630
|
+
i++;
|
|
631
|
+
}
|
|
632
|
+
continue;
|
|
633
|
+
}
|
|
634
|
+
if (triple) {
|
|
635
|
+
if (raw.startsWith(triple, i)) {
|
|
636
|
+
code2 += triple;
|
|
637
|
+
i += 2;
|
|
638
|
+
triple = "";
|
|
639
|
+
}
|
|
640
|
+
continue;
|
|
641
|
+
}
|
|
642
|
+
if (raw.startsWith("//", i))
|
|
643
|
+
break;
|
|
644
|
+
if (raw.startsWith("/*", i)) {
|
|
645
|
+
block = true;
|
|
646
|
+
i++;
|
|
647
|
+
continue;
|
|
648
|
+
}
|
|
649
|
+
if (raw.startsWith("'''", i) || raw.startsWith('"""', i)) {
|
|
650
|
+
triple = raw.slice(i, i + 3);
|
|
651
|
+
code2 += triple;
|
|
652
|
+
i += 2;
|
|
653
|
+
continue;
|
|
654
|
+
}
|
|
655
|
+
if (c === "'" || c === '"') {
|
|
656
|
+
let j = i + 1;
|
|
657
|
+
for (; j < raw.length && raw[j] !== c; j++)
|
|
658
|
+
if (raw[j] === "\\")
|
|
659
|
+
j++;
|
|
660
|
+
code2 += raw.slice(i, j + 1).replace(/[{}]/g, " ");
|
|
661
|
+
i = j;
|
|
662
|
+
continue;
|
|
663
|
+
}
|
|
664
|
+
if (c === "{") {
|
|
665
|
+
const before = code2.trim() || previous;
|
|
666
|
+
const m = /([A-Za-z_][\w.]*)\s*(?:\(\s*([^()]*?)\s*\))?\s*(?:\w+\s*->\s*)?$/.exec(before);
|
|
667
|
+
const name = m?.[1] ?? "";
|
|
668
|
+
stack.push(name === "project" && m?.[2] ? `project(${m[2].replace(/['"]/g, "")})` : name);
|
|
669
|
+
code2 = "";
|
|
670
|
+
continue;
|
|
671
|
+
}
|
|
672
|
+
if (c === "}") {
|
|
673
|
+
stack.pop();
|
|
674
|
+
code2 = "";
|
|
675
|
+
continue;
|
|
676
|
+
}
|
|
677
|
+
code2 += c;
|
|
678
|
+
}
|
|
679
|
+
if (code2.trim())
|
|
680
|
+
previous = code2.trim();
|
|
681
|
+
}
|
|
682
|
+
return out;
|
|
683
|
+
}
|
|
684
|
+
var PROJECT_BLOCK = (b) => b === "subprojects" || b === "allprojects" || /^project\(:?[^)]*\)$/.test(b);
|
|
685
|
+
var projectOf = (b) => /^project\(:?([^)]*)\)$/.exec(b)?.[1];
|
|
686
|
+
function gradleDependencyAt(lines, line, blocks = gradleBlocks(lines)) {
|
|
687
|
+
const d = gradleDependencyOn(lines[line - 1] ?? "");
|
|
688
|
+
if (!d)
|
|
689
|
+
return void 0;
|
|
690
|
+
const at = projectDependenciesAt(blocks, line);
|
|
691
|
+
return "none" in at ? at : { dependency: d, ...at };
|
|
692
|
+
}
|
|
693
|
+
function projectDependenciesAt(blocks, line) {
|
|
694
|
+
const stack = blocks[line - 1] ?? [];
|
|
695
|
+
const outer = stack.slice(0, -1);
|
|
696
|
+
if (stack[stack.length - 1] !== "dependencies" || !outer.every(PROJECT_BLOCK)) {
|
|
697
|
+
const inside = stack.filter((b) => !PROJECT_BLOCK(b)).join(" { ");
|
|
698
|
+
return { none: inside ? `${inside} { }` : "no dependencies { } block" };
|
|
699
|
+
}
|
|
700
|
+
const proj = outer.map(projectOf).find((x) => x !== void 0);
|
|
701
|
+
return {
|
|
702
|
+
...proj !== void 0 ? { project: proj } : {},
|
|
703
|
+
...outer.some((b) => b === "subprojects" || b === "allprojects") ? { all: true } : {}
|
|
704
|
+
};
|
|
705
|
+
}
|
|
706
|
+
function catalogVersions(lines) {
|
|
707
|
+
const out = /* @__PURE__ */ new Map();
|
|
708
|
+
let section = "";
|
|
709
|
+
lines.forEach((raw, i) => {
|
|
710
|
+
const l = raw.replace(/\r$/, "");
|
|
711
|
+
const s = /^\s*\[\s*([^\]]+?)\s*\]\s*(#.*)?$/.exec(l);
|
|
712
|
+
if (s)
|
|
713
|
+
return void (section = s[1]);
|
|
714
|
+
if (section !== "versions")
|
|
715
|
+
return;
|
|
716
|
+
const m = /^\s*(["']?)([A-Za-z][\w.-]*)\1\s*=\s*(["'])([^"']+)\3\s*(#.*)?$/.exec(l);
|
|
717
|
+
if (m)
|
|
718
|
+
out.set(m[2], { value: m[4], line: i + 1 });
|
|
719
|
+
});
|
|
720
|
+
return out;
|
|
721
|
+
}
|
|
722
|
+
var catalogNameOf = (file) => VERSION_CATALOG.exec(slash(file))?.[2];
|
|
723
|
+
var accessorOf = (alias) => alias.replace(/[-_.]+/g, ".");
|
|
724
|
+
function catalogLibraryAt(lines, line) {
|
|
725
|
+
let section = "";
|
|
726
|
+
for (let i = 0; i < line && i < lines.length; i++) {
|
|
727
|
+
const m2 = /^\s*\[\s*([^\]]+?)\s*\]\s*(#.*)?$/.exec((lines[i] ?? "").replace(/\r$/, ""));
|
|
728
|
+
if (m2)
|
|
729
|
+
section = m2[1];
|
|
730
|
+
}
|
|
731
|
+
if (section !== "libraries")
|
|
732
|
+
return void 0;
|
|
733
|
+
const text = (lines[line - 1] ?? "").replace(/\r$/, "");
|
|
734
|
+
const m = /^\s*(["']?)([A-Za-z][\w.-]*)\1\s*=\s*(.+)$/.exec(text);
|
|
735
|
+
if (!m)
|
|
736
|
+
return void 0;
|
|
737
|
+
const alias = m[2];
|
|
738
|
+
const body = m[3].replace(/\s+#.*$/, "").trim();
|
|
739
|
+
const str = (key) => new RegExp(`(?:^|[{,\\s])${key.replace(".", "\\.")}\\s*=\\s*(["'])([^"']+)\\1`).exec(body)?.[2];
|
|
740
|
+
let group;
|
|
741
|
+
let name;
|
|
742
|
+
let version;
|
|
743
|
+
const whole = /^(["'])([^"']+)\1$/.exec(body);
|
|
744
|
+
if (whole)
|
|
745
|
+
[group, name, version] = whole[2].split(":");
|
|
746
|
+
else if (body.startsWith("{")) {
|
|
747
|
+
const module = str("module");
|
|
748
|
+
if (module)
|
|
749
|
+
[group, name] = module.split(":");
|
|
750
|
+
else {
|
|
751
|
+
group = str("group");
|
|
752
|
+
name = str("name");
|
|
753
|
+
}
|
|
754
|
+
version = str("version");
|
|
755
|
+
}
|
|
756
|
+
const versionRef = body.startsWith("{") ? str("version.ref") : void 0;
|
|
757
|
+
if (!group || !name || !COORDINATE.test(group) || !COORDINATE.test(name))
|
|
758
|
+
return void 0;
|
|
759
|
+
return {
|
|
760
|
+
alias,
|
|
761
|
+
accessor: accessorOf(alias),
|
|
762
|
+
group,
|
|
763
|
+
name,
|
|
764
|
+
...version ? { version } : {},
|
|
765
|
+
...versionRef ? { versionRef } : {}
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
function gradleCatalogUseOn(line) {
|
|
769
|
+
const m = new RegExp(`^\\s*${CONFIGURATION}\\s*\\(?\\s*(?:(platform|enforcedPlatform)\\s*\\(\\s*)?([A-Za-z]\\w*)\\.([A-Za-z][\\w.]*?)\\s*\\)?\\s*\\)?\\s*(?:\\{.*)?(?:\\/\\/.*)?\\r?$`).exec(line);
|
|
770
|
+
const conf = m ? m[2] ?? m[3] : "";
|
|
771
|
+
if (!m || NOT_A_CONFIGURATION.has(conf) || TOOL_CONFIGURATIONS.has(conf))
|
|
772
|
+
return void 0;
|
|
773
|
+
if (/^(bundles|plugins|versions)\./.test(m[6]) || m[5] === "project")
|
|
774
|
+
return void 0;
|
|
775
|
+
return {
|
|
776
|
+
configuration: conf,
|
|
777
|
+
catalog: m[5],
|
|
778
|
+
accessor: m[6],
|
|
779
|
+
scope: scopeOfConfiguration(conf, !!m[4])
|
|
313
780
|
};
|
|
314
781
|
}
|
|
315
782
|
function gradleGroupOn(line) {
|
|
316
|
-
return /^\s*(?:project\.)?group\s*=?\s*(['"])([^'"]+)\1\s*$/.exec(line)?.[2];
|
|
783
|
+
return /^\s*(?:(?:allprojects|subprojects)\s*\{\s*)?(?:project\.)?group\s*=?\s*(['"])([^'"]+)\1\s*\}?\s*$/.exec(line)?.[2];
|
|
317
784
|
}
|
|
318
785
|
function gradleNameOn(line) {
|
|
319
786
|
return /^\s*(?:rootProject\.name|archivesBaseName|(?:base\.)?archivesName(?:\.set)?)\s*[=(]?\s*(['"])([^'"]+)\1\s*\)?\s*$/.exec(line)?.[2];
|
|
320
787
|
}
|
|
321
|
-
|
|
788
|
+
function gradleProjectsOn(line) {
|
|
789
|
+
const rename = /^\s*project\s*\(\s*(['"]):?([^'"]+)\1\s*\)\.name\s*=\s*(['"])([^'"]+)\3\s*$/.exec(line);
|
|
790
|
+
if (rename)
|
|
791
|
+
return [{ path: rename[2], name: rename[4], renamed: true }];
|
|
792
|
+
const inc = /^\s*include\s*\(?\s*((?:(['"])[^'"]+\2\s*,?\s*)+)\)?\s*$/.exec(line);
|
|
793
|
+
if (!inc)
|
|
794
|
+
return [];
|
|
795
|
+
return [...inc[1].matchAll(/(['"]):?([^'"]+)\1/g)].map((m) => ({
|
|
796
|
+
path: m[2],
|
|
797
|
+
name: m[2].split(":").pop()
|
|
798
|
+
}));
|
|
799
|
+
}
|
|
800
|
+
function gradleProjects(lines) {
|
|
801
|
+
const held = PROJECTS.get(lines);
|
|
802
|
+
if (held)
|
|
803
|
+
return held;
|
|
804
|
+
const out = [];
|
|
805
|
+
let open = "";
|
|
806
|
+
const names = (text, line) => {
|
|
807
|
+
for (const m of text.matchAll(/(['"]):?([^'"]+)\1/g))
|
|
808
|
+
out.push({ path: m[2], name: m[2].split(":").pop(), line });
|
|
809
|
+
};
|
|
810
|
+
lines.forEach((raw, i) => {
|
|
811
|
+
const code2 = raw.replace(/\r$/, "").replace(/\s\/\/.*$|^\s*\/\/.*$/, "");
|
|
812
|
+
if (open) {
|
|
813
|
+
names(code2, i + 1);
|
|
814
|
+
if (open === "paren" ? code2.includes(")") : !/,\s*$/.test(code2))
|
|
815
|
+
open = "";
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
818
|
+
const rename = gradleProjectsOn(code2);
|
|
819
|
+
if (rename.length && rename[0].renamed)
|
|
820
|
+
return void out.push({ ...rename[0], line: i + 1 });
|
|
821
|
+
const inc = /^\s*include(?!\w)\s*(\(?)\s*(.*)$/.exec(code2);
|
|
822
|
+
if (!inc)
|
|
823
|
+
return;
|
|
824
|
+
names(inc[2], i + 1);
|
|
825
|
+
if (inc[1] === "(" && !inc[2].includes(")"))
|
|
826
|
+
open = "paren";
|
|
827
|
+
else if (inc[1] !== "(" && /,\s*$/.test(inc[2]))
|
|
828
|
+
open = "comma";
|
|
829
|
+
});
|
|
830
|
+
PROJECTS.set(lines, out);
|
|
831
|
+
return out;
|
|
832
|
+
}
|
|
833
|
+
var PROJECTS = /* @__PURE__ */ new WeakMap();
|
|
834
|
+
function projectDirs(settings) {
|
|
835
|
+
const dirs = /* @__PURE__ */ new Map();
|
|
836
|
+
for (const l of settings ?? []) {
|
|
837
|
+
const m = /^\s*project\s*\(\s*(['"]):?([^'"]+)\1\s*\)\.projectDir\s*=\s*(?:file\s*\(|new\s+File\s*\(\s*(?:settingsDir|rootDir)\s*,)\s*(['"])([^'"]+)\3\s*\)\s*$/.exec(l);
|
|
838
|
+
if (m)
|
|
839
|
+
dirs.set(m[2], normDir(m[4]));
|
|
840
|
+
}
|
|
841
|
+
return dirs;
|
|
842
|
+
}
|
|
843
|
+
var normDir = (p) => slash(p).replace(/^\.\//, "").replace(/\/(pom\.xml|build\.gradle(\.kts)?)$/i, "").replace(/\/+$/, "");
|
|
844
|
+
var dirOf = (file) => {
|
|
845
|
+
const f = slash(file);
|
|
846
|
+
return f.includes("/") ? f.slice(0, f.lastIndexOf("/")) : "";
|
|
847
|
+
};
|
|
848
|
+
var joinDir = (base2, rel) => {
|
|
849
|
+
const parts = base2 ? base2.split("/") : [];
|
|
850
|
+
for (const s of normDir(rel).split("/")) {
|
|
851
|
+
if (!s || s === ".")
|
|
852
|
+
continue;
|
|
853
|
+
if (s === "..")
|
|
854
|
+
parts.pop();
|
|
855
|
+
else
|
|
856
|
+
parts.push(s);
|
|
857
|
+
}
|
|
858
|
+
return parts.join("/");
|
|
859
|
+
};
|
|
860
|
+
var settingsOf = (linesOf2) => {
|
|
861
|
+
for (const f of ["settings.gradle", "settings.gradle.kts"]) {
|
|
862
|
+
const l = linesOf2(f);
|
|
863
|
+
if (l)
|
|
864
|
+
return { file: f, lines: l };
|
|
865
|
+
}
|
|
866
|
+
return void 0;
|
|
867
|
+
};
|
|
868
|
+
function buildLineOf(f) {
|
|
869
|
+
if (!isVersionCatalogFile(f.cite.file))
|
|
870
|
+
return f.cite;
|
|
871
|
+
return (f.cite.with ?? []).find((p) => isGradleBuildFile(p.file));
|
|
872
|
+
}
|
|
873
|
+
var ENVS = /* @__PURE__ */ new WeakMap();
|
|
874
|
+
function gradleEnvOf(linesOf2) {
|
|
875
|
+
const held = ENVS.get(linesOf2);
|
|
876
|
+
if (held)
|
|
877
|
+
return held;
|
|
878
|
+
const settings = settingsOf(linesOf2);
|
|
879
|
+
const env = {
|
|
880
|
+
...settings ? { settings } : {},
|
|
881
|
+
dirs: projectDirs(settings?.lines),
|
|
882
|
+
projects: settings ? gradleProjects(settings.lines) : []
|
|
883
|
+
};
|
|
884
|
+
ENVS.set(linesOf2, env);
|
|
885
|
+
return env;
|
|
886
|
+
}
|
|
887
|
+
var projectDirOf = (env, project) => env.dirs.get(project) ?? project.replace(/:/g, "/");
|
|
888
|
+
function gradleProjectOf(f, at, linesOf2) {
|
|
889
|
+
const lines = linesOf2(at.file);
|
|
890
|
+
if (!lines)
|
|
891
|
+
return void 0;
|
|
892
|
+
if (isGradleSettingsFile(at.file)) {
|
|
893
|
+
const ps = gradleProjects(lines).filter((p) => p.line === at.line);
|
|
894
|
+
return ps.find((p) => p.name === f.name)?.path ?? (ps.length === 1 ? ps[0].path : void 0);
|
|
895
|
+
}
|
|
896
|
+
if (f.kind === "dependency" && isGradleBuildFile(at.file)) {
|
|
897
|
+
const d = projectDependenciesAt(gradleBlocks(lines), at.line);
|
|
898
|
+
return "project" in d ? d.project : void 0;
|
|
899
|
+
}
|
|
900
|
+
return void 0;
|
|
901
|
+
}
|
|
902
|
+
function isBuildModuleDir(dir, linesOf2) {
|
|
903
|
+
const want = normDir(dir);
|
|
904
|
+
const pom = linesOf2("pom.xml");
|
|
905
|
+
if (pom && pomCoordinates(pom).modules.some((m) => normDir(m.value) === want))
|
|
906
|
+
return true;
|
|
907
|
+
for (const f of ["settings.gradle", "settings.gradle.kts"]) {
|
|
908
|
+
const lines = linesOf2(f);
|
|
909
|
+
if (!lines)
|
|
910
|
+
continue;
|
|
911
|
+
for (const p of gradleProjects(lines))
|
|
912
|
+
if (normDir(p.path.replace(/^:/, "").replace(/:/g, "/")) === want)
|
|
913
|
+
return true;
|
|
914
|
+
}
|
|
915
|
+
return false;
|
|
916
|
+
}
|
|
917
|
+
function buildModuleOf(f, linesOf2, modules = [], repoComponent) {
|
|
918
|
+
const listed2 = modules.map((m) => ({ path: normDir(m.path), component: m.component })).filter((m) => m.path).sort((a, b) => b.path.length - a.path.length);
|
|
919
|
+
const repo = () => repoComponent ? { path: "", component: repoComponent, names: [repoComponent], from: "repo" } : void 0;
|
|
920
|
+
const of = (dir) => {
|
|
921
|
+
const m = listed2.find((x) => dir === x.path || dir.startsWith(`${x.path}/`));
|
|
922
|
+
return m ? { path: m.path, component: m.component, names: [m.component], from: "manifest" } : repo();
|
|
923
|
+
};
|
|
924
|
+
const at = buildLineOf(f);
|
|
925
|
+
if (!at)
|
|
926
|
+
return repo();
|
|
927
|
+
if (!listed2.length)
|
|
928
|
+
return repo();
|
|
929
|
+
const env = gradleEnvOf(linesOf2);
|
|
930
|
+
if (f.kind === "dependency" && isGradleBuildFile(at.file) && dirOf(at.file) === "") {
|
|
931
|
+
const lines = linesOf2(at.file);
|
|
932
|
+
const stack = lines ? gradleBlocks(lines)[at.line - 1] ?? [] : [];
|
|
933
|
+
const sub = stack.includes("subprojects");
|
|
934
|
+
const all2 = stack.includes("allprojects");
|
|
935
|
+
if ((sub || all2) && !stack.some((b) => projectOf(b) !== void 0)) {
|
|
936
|
+
const dirs = env.projects.length ? env.projects.filter((p) => !p.renamed).map((p) => projectDirOf(env, p.path)) : listed2.map((m) => m.path);
|
|
937
|
+
const mods = [...all2 ? [""] : [], ...dirs].flatMap((d) => {
|
|
938
|
+
const m = of(d);
|
|
939
|
+
return m ? [m] : [];
|
|
940
|
+
});
|
|
941
|
+
const names = [...new Set(mods.map((m) => m.component))].sort();
|
|
942
|
+
if (names.length === 1)
|
|
943
|
+
return mods.find((m) => m.component === names[0]);
|
|
944
|
+
if (names.length > 1)
|
|
945
|
+
return { path: "", names, from: "manifest", every: true };
|
|
946
|
+
return repo();
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
const project = gradleProjectOf(f, at, linesOf2);
|
|
950
|
+
return of(project !== void 0 ? projectDirOf(env, project) : dirOf(at.file));
|
|
951
|
+
}
|
|
952
|
+
function buildModuleProblem(f, mod) {
|
|
953
|
+
if (!mod)
|
|
954
|
+
return void 0;
|
|
955
|
+
if (mod.every) {
|
|
956
|
+
const names = mod.names.join(", ");
|
|
957
|
+
if (f.component === void 0)
|
|
958
|
+
return `${f.kind} ${f.id} cites ${f.cite.file}:${f.cite.line}, a dependency every subproject's build takes (components ${names}): write one dependency fact for each, each naming its component`;
|
|
959
|
+
const c2 = factIdPart(f.component);
|
|
960
|
+
if (mod.names.some((n) => factIdPart(n) === c2))
|
|
961
|
+
return void 0;
|
|
962
|
+
return `${f.kind} ${f.id} names component "${f.component}", and ${f.cite.file}:${f.cite.line} is a dependency of every subproject (components ${names}): name one of them`;
|
|
963
|
+
}
|
|
964
|
+
if (f.component === void 0)
|
|
965
|
+
return void 0;
|
|
966
|
+
const c = factIdPart(f.component);
|
|
967
|
+
if (mod.names.some((n) => factIdPart(n) === c))
|
|
968
|
+
return void 0;
|
|
969
|
+
if (mod.from === "repo")
|
|
970
|
+
return `${f.kind} ${f.id} names component "${f.component}", and ${f.cite.file} is a build file of ${mod.component} (repos.manifest.yaml lists no module of the repo there, so it ships as ${mod.component}): a module is a component only when the manifest lists it; name ${mod.component}, or leave component out`;
|
|
971
|
+
return `${f.kind} ${f.id} names component "${f.component}", and ${f.cite.file} is the build file of module ${mod.component} (${mod.path}/, repos.manifest.yaml's modules): a dependency belongs to the module whose build file declares it; name ${mod.component}, or leave component out`;
|
|
972
|
+
}
|
|
322
973
|
var citedLine = (f, file, line) => f.cite.file === file && f.cite.line === line || (f.cite.with ?? []).some((p) => p.file === file && p.line === line);
|
|
323
|
-
function buildCoordinatesProblem(f, linesOf2) {
|
|
974
|
+
function buildCoordinatesProblem(f, linesOf2, files) {
|
|
324
975
|
const file = f.cite.file;
|
|
325
976
|
const label = `${f.kind} ${f.id}`;
|
|
326
977
|
const lines = linesOf2(file);
|
|
327
978
|
if (!lines)
|
|
328
979
|
return void 0;
|
|
329
980
|
const where = `${file}:${f.cite.line}`;
|
|
330
|
-
|
|
331
|
-
|
|
981
|
+
const named = files ? pomFilesNamed(files, linesOf2) : void 0;
|
|
982
|
+
if (isPomFileIn(file, named))
|
|
983
|
+
return pomProblem(f, label, where, {
|
|
984
|
+
file,
|
|
985
|
+
pom: pomCoordinates(lines),
|
|
986
|
+
parents: pomParents(file, linesOf2, files)
|
|
987
|
+
});
|
|
332
988
|
if (isGradleFile(file))
|
|
333
989
|
return gradleProblem(f, label, where, lines, linesOf2);
|
|
334
990
|
return `${label} cites ${file}, which is no build file Atticus reads coordinates from: cite the pom.xml, build.gradle or settings.gradle line that writes them`;
|
|
335
991
|
}
|
|
336
|
-
function
|
|
992
|
+
function pomValue(f, label, file, at, ctx, what) {
|
|
993
|
+
const r = resolvePomValue(at, ctx.pom, { file: ctx.file, parents: ctx.parents });
|
|
994
|
+
if ("missing" in r)
|
|
995
|
+
return {
|
|
996
|
+
problem: `${label}: ${what} at ${file}:${at.line} is \${${r.missing}}, which no <properties> entry or <parent> of ${file}${ctx.parents.length ? ` or of its parent poms (${ctx.parents.map((p) => p.file).join(", ")})` : ""} sets: Atticus can't say what it resolves to`
|
|
997
|
+
};
|
|
998
|
+
const uncited = (r.via ?? []).find((l) => !citedLine(f, l.file, l.line));
|
|
999
|
+
if (uncited !== void 0)
|
|
1000
|
+
return {
|
|
1001
|
+
problem: `${label}: ${what} at ${file}:${at.line} is ${at.value}, written as "${r.value}" through ${uncited.file}:${uncited.line}; cite that line in cite.with`
|
|
1002
|
+
};
|
|
1003
|
+
return { value: r.value };
|
|
1004
|
+
}
|
|
1005
|
+
var DEPS = /* @__PURE__ */ new WeakMap();
|
|
1006
|
+
function dependencyOnLine(pom, line) {
|
|
1007
|
+
let byLine = DEPS.get(pom);
|
|
1008
|
+
if (!byLine) {
|
|
1009
|
+
byLine = /* @__PURE__ */ new Map();
|
|
1010
|
+
for (const d of pom.dependencies)
|
|
1011
|
+
if (d.artifact && !byLine.has(d.artifact.line))
|
|
1012
|
+
byLine.set(d.artifact.line, d);
|
|
1013
|
+
DEPS.set(pom, byLine);
|
|
1014
|
+
}
|
|
1015
|
+
return byLine.get(line);
|
|
1016
|
+
}
|
|
1017
|
+
var pomScopeOf = (declared) => declared === void 0 ? "compile" : declared.trim() === "system" ? "provided" : declared.trim();
|
|
1018
|
+
function pomProblem(f, label, where, ctx) {
|
|
1019
|
+
const pom = ctx.pom;
|
|
337
1020
|
const line = f.cite.line;
|
|
338
1021
|
const file = f.cite.file;
|
|
339
1022
|
if (f.kind === "artifact") {
|
|
340
1023
|
if (pom.artifact?.line !== line) {
|
|
341
|
-
const dep2 = pom
|
|
1024
|
+
const dep2 = dependencyOnLine(pom, line);
|
|
342
1025
|
const what = dep2 ? `a dependency's <artifactId> (${dep2.artifact.value})` : pom.parentArtifact?.line === line ? `the <parent>'s <artifactId> (${pom.parentArtifact.value})` : "not the project's own <artifactId>";
|
|
343
1026
|
return `${label} says ${where} is the coordinates the build publishes, and that line is ${what}${pom.artifact ? `: the project's own is at line ${pom.artifact.line}` : ""}`;
|
|
344
1027
|
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
if (
|
|
1028
|
+
const name2 = pomValue(f, label, file, pom.artifact, ctx, "the project's <artifactId>");
|
|
1029
|
+
if ("problem" in name2)
|
|
1030
|
+
return name2.problem;
|
|
1031
|
+
if (name2.value !== f.name)
|
|
1032
|
+
return `${label} names "${f.name}", and ${where} writes the project's artifactId as "${name2.value}"`;
|
|
1033
|
+
const at = pom.group ?? pom.parentGroup;
|
|
1034
|
+
if (!at)
|
|
349
1035
|
return `${label} names group "${f.group}", and ${file} writes no groupId of the project or its <parent>`;
|
|
1036
|
+
const inherited = pom.group ? "" : " (the <parent>'s, which the project inherits)";
|
|
1037
|
+
const group2 = pomValue(f, label, file, at, ctx, `the group${inherited}`);
|
|
1038
|
+
if ("problem" in group2)
|
|
1039
|
+
return group2.problem;
|
|
350
1040
|
if (group2.value !== f.group)
|
|
351
|
-
return `${label} names group "${f.group}", and ${file}:${
|
|
352
|
-
if (!citedLine(f, file,
|
|
353
|
-
return `${label}: the group is written at ${file}:${
|
|
1041
|
+
return `${label} names group "${f.group}", and ${file}:${at.line} writes "${group2.value}"${inherited}`;
|
|
1042
|
+
if (!citedLine(f, file, at.line))
|
|
1043
|
+
return `${label}: the group is written at ${file}:${at.line}${pom.group ? "" : " (the <parent>'s)"}; cite that line in cite.with`;
|
|
354
1044
|
return void 0;
|
|
355
1045
|
}
|
|
356
|
-
const dep = pom
|
|
1046
|
+
const dep = dependencyOnLine(pom, line);
|
|
357
1047
|
if (!dep) {
|
|
358
1048
|
const what = pom.artifact?.line === line ? "the project's own <artifactId>" : pom.parentArtifact?.line === line ? "the <parent>'s <artifactId>" : "no dependency's <artifactId>";
|
|
359
1049
|
return `${label} says ${where} declares a dependency, and that line is ${what}: cite the <artifactId> line of the <dependency> in <dependencies>`;
|
|
@@ -362,51 +1052,137 @@ function pomProblem(f, label, where, pom) {
|
|
|
362
1052
|
return `${label} cites ${where}, a <dependencyManagement> entry, which only pins a version: cite the dependency where <dependencies> declares it`;
|
|
363
1053
|
if (dep.plugin)
|
|
364
1054
|
return `${label} cites ${where}, a dependency of a build plugin, not of the component: leave it out`;
|
|
365
|
-
|
|
366
|
-
|
|
1055
|
+
const name = pomValue(f, label, file, dep.artifact, ctx, "the dependency's <artifactId>");
|
|
1056
|
+
if ("problem" in name)
|
|
1057
|
+
return name.problem;
|
|
1058
|
+
if (name.value !== f.name)
|
|
1059
|
+
return `${label} names "${f.name}", and ${where} declares "${name.value}"`;
|
|
367
1060
|
if (!dep.group)
|
|
368
1061
|
return `${label}: the <dependency> at ${where} writes no <groupId>`;
|
|
369
|
-
const
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
1062
|
+
const group = pomValue(f, label, file, dep.group, ctx, "the dependency's <groupId>");
|
|
1063
|
+
if ("problem" in group)
|
|
1064
|
+
return group.problem;
|
|
1065
|
+
if (group.value !== f.group)
|
|
1066
|
+
return `${label} names group "${f.group}", and the <dependency> at ${where} writes "${dep.group.value}"${group.value !== dep.group.value ? ` (${group.value})` : ""}`;
|
|
373
1067
|
if (!citedLine(f, file, dep.group.line))
|
|
374
1068
|
return `${label}: the dependency's group is written at ${file}:${dep.group.line}; cite that line in cite.with`;
|
|
375
|
-
const declared = dep.scope?.value
|
|
1069
|
+
const declared = pomScopeOf(dep.scope?.value);
|
|
376
1070
|
if (declared !== (f.scope ?? "compile"))
|
|
377
|
-
return `${label} says scope ${f.scope ?? "compile"}, and the <dependency> at ${where} declares ${declared}${dep.scope ? ` (${file}:${dep.scope.line})` : ""}`;
|
|
1071
|
+
return `${label} says scope ${f.scope ?? "compile"}, and the <dependency> at ${where} declares ${dep.scope?.value.trim() === "system" ? "system, which is recorded as provided" : declared}${dep.scope ? ` (${file}:${dep.scope.line})` : ""}`;
|
|
378
1072
|
return void 0;
|
|
379
1073
|
}
|
|
380
1074
|
function gradleProblem(f, label, where, lines, linesOf2) {
|
|
381
1075
|
const text = lines[f.cite.line - 1] ?? "";
|
|
1076
|
+
const file = f.cite.file;
|
|
1077
|
+
if (f.kind === "dependency" && isVersionCatalogFile(file))
|
|
1078
|
+
return catalogProblem(f, label, where, lines, linesOf2);
|
|
382
1079
|
if (f.kind === "dependency") {
|
|
383
|
-
const
|
|
384
|
-
|
|
1080
|
+
const at = isGradleBuildFile(file) ? gradleDependencyAt(lines, f.cite.line) : void 0;
|
|
1081
|
+
const tool = gradleToolConfigurationOn(text);
|
|
1082
|
+
if (!at && tool)
|
|
1083
|
+
return `${label} cites ${where}, the ${tool} tool's own configuration: what it names runs the tool, and is no dependency of the component`;
|
|
1084
|
+
if (!at)
|
|
385
1085
|
return `${label} says ${where} declares a dependency, and that line declares none: cite the line in dependencies { } that names it`;
|
|
1086
|
+
if ("none" in at)
|
|
1087
|
+
return `${label} cites ${where}, which is in ${at.none}, not a project's dependencies { }: a version pinned, a constraint or the build's own class path is no dependency of the component`;
|
|
1088
|
+
const d = at.dependency;
|
|
386
1089
|
if (d.group !== f.group || d.name !== f.name)
|
|
387
1090
|
return `${label} names "${f.group}:${f.name}", and ${where} declares "${d.group}:${d.name}"`;
|
|
388
1091
|
if (d.scope !== (f.scope ?? "compile"))
|
|
389
1092
|
return `${label} says scope ${f.scope ?? "compile"}, and ${where} declares it with ${d.configuration} (${d.scope})`;
|
|
390
1093
|
return void 0;
|
|
391
1094
|
}
|
|
392
|
-
|
|
393
|
-
if (
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
1095
|
+
let project;
|
|
1096
|
+
if (isGradleSettingsFile(file)) {
|
|
1097
|
+
const root = gradleNameOn(text);
|
|
1098
|
+
if (root !== void 0) {
|
|
1099
|
+
if (root !== f.name)
|
|
1100
|
+
return `${label} names "${f.name}", and ${where} sets "${root}"`;
|
|
1101
|
+
} else {
|
|
1102
|
+
const all2 = gradleProjects(lines);
|
|
1103
|
+
const ps = all2.filter((x) => x.line === f.cite.line);
|
|
1104
|
+
if (!ps.length)
|
|
1105
|
+
return `${label} says ${where} is the coordinates the build publishes, and that line sets no project name: cite rootProject.name, an include, or a project(':x').name line`;
|
|
1106
|
+
const p = ps.find((x) => x.name === f.name);
|
|
1107
|
+
if (!p)
|
|
1108
|
+
return `${label} names "${f.name}", and ${where} names ${ps.map((x) => `"${x.name}"`).join(", ")}`;
|
|
1109
|
+
const renamed = all2.find((x) => x.renamed && x.path === p.path);
|
|
1110
|
+
if (!p.renamed && renamed)
|
|
1111
|
+
return `${label} names "${f.name}", and ${file}:${renamed.line} names that project "${renamed.name}": cite that line`;
|
|
1112
|
+
project = p.path;
|
|
1113
|
+
}
|
|
1114
|
+
} else {
|
|
1115
|
+
const name = gradleNameOn(text);
|
|
1116
|
+
if (name === void 0)
|
|
1117
|
+
return `${label} says ${where} is the coordinates the build publishes, and that line sets no project name: cite rootProject.name in settings.gradle, or archivesBaseName`;
|
|
1118
|
+
if (name !== f.name)
|
|
1119
|
+
return `${label} names "${f.name}", and ${where} sets "${name}"`;
|
|
1120
|
+
const dir = dirOf(file);
|
|
1121
|
+
if (dir) {
|
|
1122
|
+
const dirs2 = projectDirs(settingsOf(linesOf2)?.lines);
|
|
1123
|
+
project = [...dirs2].find(([, d]) => d === dir)?.[0] ?? dir.replace(/\//g, ":");
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
const dirs = projectDirs(settingsOf(linesOf2)?.lines);
|
|
1127
|
+
const ownDir = project === void 0 ? "" : dirs.get(project) ?? project.replace(/:/g, "/");
|
|
1128
|
+
const parts = [{ file, line: f.cite.line }, ...f.cite.with ?? []];
|
|
398
1129
|
const groups = parts.flatMap((p) => {
|
|
399
|
-
const
|
|
400
|
-
|
|
1130
|
+
const ls = linesOf2(p.file);
|
|
1131
|
+
const g2 = gradleGroupOn(ls?.[p.line - 1] ?? "");
|
|
1132
|
+
if (g2 === void 0 || !ls || !isGradleBuildFile(p.file))
|
|
1133
|
+
return [];
|
|
1134
|
+
const stack = gradleBlocks(ls)[p.line - 1] ?? [];
|
|
1135
|
+
const pDir = dirOf(p.file);
|
|
1136
|
+
const applies = pDir === ownDir && pDir !== "" ? stack.length === 0 : pDir === "" && (stack.length === 0 ? project === void 0 : stack.length === 1 && (stack[0] === "allprojects" || project !== void 0 && (stack[0] === "subprojects" || projectOf(stack[0]) === project)));
|
|
1137
|
+
return [{ ...p, group: g2, applies }];
|
|
401
1138
|
});
|
|
402
|
-
|
|
1139
|
+
const g = groups.find((x) => x.applies);
|
|
1140
|
+
if (!g) {
|
|
1141
|
+
const other = groups[0];
|
|
1142
|
+
if (other)
|
|
1143
|
+
return `${label}: ${other.file}:${other.line} sets the group of another project than ${f.name}; cite the line that sets ${f.name}'s (group = '${f.group}') in cite.with`;
|
|
403
1144
|
return `${label}: no line it cites sets the group; cite the build.gradle line that does (group = '${f.group}') in cite.with`;
|
|
404
|
-
|
|
1145
|
+
}
|
|
405
1146
|
if (g.group !== f.group)
|
|
406
1147
|
return `${label} names group "${f.group}", and ${g.file}:${g.line} sets "${g.group}"`;
|
|
407
1148
|
return void 0;
|
|
408
1149
|
}
|
|
409
|
-
function
|
|
1150
|
+
function catalogProblem(f, label, where, lines, linesOf2) {
|
|
1151
|
+
const lib = catalogLibraryAt(lines, f.cite.line);
|
|
1152
|
+
if (!lib)
|
|
1153
|
+
return `${label} cites ${where}, which is no [libraries] entry of the version catalog: cite the entry that gives its coordinates`;
|
|
1154
|
+
if (lib.group !== f.group || lib.name !== f.name)
|
|
1155
|
+
return `${label} names "${f.group}:${f.name}", and ${where} gives ${lib.alias} as "${lib.group}:${lib.name}"`;
|
|
1156
|
+
if (f.version !== void 0) {
|
|
1157
|
+
const v = lib.version ?? (lib.versionRef ? catalogVersions(lines).get(lib.versionRef)?.value : void 0);
|
|
1158
|
+
if (v !== f.version)
|
|
1159
|
+
return `${label} says version ${f.version}, and ${where} gives ${v === void 0 ? "no version Atticus can read" : `"${v}"`}${lib.versionRef ? ` (version.ref = "${lib.versionRef}")` : ""}`;
|
|
1160
|
+
}
|
|
1161
|
+
const catalog = catalogNameOf(f.cite.file);
|
|
1162
|
+
const use = `${catalog}.${lib.accessor}`;
|
|
1163
|
+
let problem;
|
|
1164
|
+
for (const p of f.cite.with ?? []) {
|
|
1165
|
+
if (!isGradleBuildFile(p.file))
|
|
1166
|
+
continue;
|
|
1167
|
+
const ls = linesOf2(p.file);
|
|
1168
|
+
const u = ls ? gradleCatalogUseOn(ls[p.line - 1] ?? "") : void 0;
|
|
1169
|
+
if (!ls || !u || u.catalog !== catalog || u.accessor !== lib.accessor)
|
|
1170
|
+
continue;
|
|
1171
|
+
const at = projectDependenciesAt(gradleBlocks(ls), p.line);
|
|
1172
|
+
if ("none" in at) {
|
|
1173
|
+
problem ??= `${label}: ${p.file}:${p.line} is in ${at.none}, not a project's dependencies { }: a version pinned, a constraint or the build's own class path is no dependency of the component`;
|
|
1174
|
+
continue;
|
|
1175
|
+
}
|
|
1176
|
+
if (u.scope !== (f.scope ?? "compile")) {
|
|
1177
|
+
problem ??= `${label} says scope ${f.scope ?? "compile"}, and ${p.file}:${p.line} declares it with ${u.configuration} (${u.scope})`;
|
|
1178
|
+
continue;
|
|
1179
|
+
}
|
|
1180
|
+
return void 0;
|
|
1181
|
+
}
|
|
1182
|
+
return problem ?? `${label}: ${where} is the catalog's entry, which only names the library; cite the build line in dependencies { } that declares it (${use}) in cite.with`;
|
|
1183
|
+
}
|
|
1184
|
+
function buildUnrecorded(files, linesOf2, kept, all2) {
|
|
1185
|
+
const named = all2 ? pomFilesNamed(all2, linesOf2) : void 0;
|
|
410
1186
|
const cited = new Set(kept.filter((f) => f.kind === "artifact" || f.kind === "dependency").map((f) => `${f.cite.file}:${f.cite.line}`));
|
|
411
1187
|
const out = [];
|
|
412
1188
|
const add = (file, line, kind, c) => {
|
|
@@ -417,19 +1193,26 @@ function buildUnrecorded(files, linesOf2, kept) {
|
|
|
417
1193
|
const lines = linesOf2(file);
|
|
418
1194
|
if (!lines)
|
|
419
1195
|
continue;
|
|
420
|
-
if (
|
|
1196
|
+
if (isPomFileIn(file, named)) {
|
|
421
1197
|
const pom = pomCoordinates(lines);
|
|
422
|
-
const
|
|
1198
|
+
const parents = pomParents(file, linesOf2, all2);
|
|
1199
|
+
const said = (at) => {
|
|
1200
|
+
if (!at)
|
|
1201
|
+
return "?";
|
|
1202
|
+
const r = resolvePomValue(at, pom, { file, parents });
|
|
1203
|
+
return "value" in r ? r.value : at.value;
|
|
1204
|
+
};
|
|
423
1205
|
if (pom.artifact)
|
|
424
|
-
add(file, pom.artifact.line, "artifact", `${group
|
|
1206
|
+
add(file, pom.artifact.line, "artifact", `${said(pom.group ?? pom.parentGroup)}:${said(pom.artifact)}`);
|
|
425
1207
|
for (const d of pom.dependencies)
|
|
426
1208
|
if (!d.managed && !d.plugin && d.artifact)
|
|
427
|
-
add(file, d.artifact.line, "dependency", `${d.group
|
|
428
|
-
} else if (
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
1209
|
+
add(file, d.artifact.line, "dependency", `${said(d.group)}:${said(d.artifact)}`);
|
|
1210
|
+
} else if (isGradleBuildFile(file)) {
|
|
1211
|
+
const blocks = gradleBlocks(lines);
|
|
1212
|
+
lines.forEach((_, i) => {
|
|
1213
|
+
const at = gradleDependencyAt(lines, i + 1, blocks);
|
|
1214
|
+
if (at && "dependency" in at && at.dependency.scope !== "import")
|
|
1215
|
+
add(file, i + 1, "dependency", `${at.dependency.group}:${at.dependency.name}`);
|
|
433
1216
|
});
|
|
434
1217
|
}
|
|
435
1218
|
}
|
|
@@ -694,6 +1477,7 @@ function rulesOf(c) {
|
|
|
694
1477
|
notProduct: underFolders(c.notProductFolders),
|
|
695
1478
|
notRead: notReadTest(c.notReadFolders),
|
|
696
1479
|
gatewayBundle: gatewayBundleTest(c.gatewayBundleFolders),
|
|
1480
|
+
gatewayBundleFolders: c.gatewayBundleFolders,
|
|
697
1481
|
frameworks: c.frameworks
|
|
698
1482
|
};
|
|
699
1483
|
}
|
|
@@ -851,7 +1635,8 @@ function correctionFor(f, all2) {
|
|
|
851
1635
|
const byCite = corrections.filter((c) => at(c) && c.target.value === f.cite.value);
|
|
852
1636
|
const edited = corrections.filter((c) => c.fact === f.id && c.action === "edit");
|
|
853
1637
|
const moved = edited.filter((c) => (c.line ?? c.target.line) === f.cite.line);
|
|
854
|
-
|
|
1638
|
+
const pos = new Map(all2.map((c, i) => [c, i]));
|
|
1639
|
+
return [.../* @__PURE__ */ new Set([...byId, ...byCite, ...moved])].sort((a, b) => a.at < b.at ? 1 : a.at > b.at ? -1 : pos.get(b) - pos.get(a))[0];
|
|
855
1640
|
}
|
|
856
1641
|
function outsidePairingFor(f, all2) {
|
|
857
1642
|
const newest = linksFor(f, all2)[0];
|
|
@@ -1811,6 +2596,7 @@ var PLACEHOLDER = /^(<[^>]*>|\*+|x{3,}|changeme|change-me|secret|password|todo|t
|
|
|
1811
2596
|
var KEY_VALUE = /^\s*(?:-\s+)?(?:export\s+)?["']?([A-Za-z0-9_.\-[\]]+)["']?\s*[:=]\s*(.*?)\s*,?\s*$/;
|
|
1812
2597
|
var XML_ELEMENT = /<([A-Za-z_][\w.-]*)>([^<]+)<\/\1>/g;
|
|
1813
2598
|
var XML_NAMED = /\b(?:key|name)\s*=\s*"([^"]+)"\s+value\s*=\s*"([^"]*)"/g;
|
|
2599
|
+
var XML_NAMED_AFTER = /\bvalue\s*=\s*"([^"]*)"\s+(?:key|name)\s*=\s*"([^"]+)"/g;
|
|
1814
2600
|
var CONNECTION_PAIR = /(?:^|[;"'])\s*([A-Za-z][A-Za-z0-9 _.-]*?)\s*=\s*([^;"'<>\s][^;"'<>]*)/g;
|
|
1815
2601
|
var TOKEN_VALUE_KEY = /^(value|val)$/i;
|
|
1816
2602
|
var TOKEN_NAME = /^\s*"(xpath|name|key)"\s*:\s*"([^"]+)"/;
|
|
@@ -1830,7 +2616,47 @@ function tokenKeyNear(lines, i) {
|
|
|
1830
2616
|
}
|
|
1831
2617
|
return void 0;
|
|
1832
2618
|
}
|
|
2619
|
+
function keyIsSecret(key) {
|
|
2620
|
+
if (hasSecretShape(key))
|
|
2621
|
+
return true;
|
|
2622
|
+
for (const run of key.match(/[0-9a-f]{24,}|[0-9A-F]{24,}/g) ?? [])
|
|
2623
|
+
if (/\d/.test(run) && /[a-f]/i.test(run))
|
|
2624
|
+
return true;
|
|
2625
|
+
const digitsAndLetters = /\d/.test(key) && /[A-Za-z]/.test(key);
|
|
2626
|
+
if (key.length >= 32 && /^[A-Za-z0-9+/=]+$/.test(key) && digitsAndLetters)
|
|
2627
|
+
return true;
|
|
2628
|
+
if (key.length >= 32 && /^[A-Za-z0-9_-]+$/.test(key) && /\d/.test(key) && /[a-z]/.test(key) && /[A-Z]/.test(key))
|
|
2629
|
+
return true;
|
|
2630
|
+
if (key.length < 16 || !/^[A-Za-z0-9+/=]+$/.test(key) || !/\d/.test(key))
|
|
2631
|
+
return false;
|
|
2632
|
+
const kind = (c) => /\d/.test(c) ? 0 : /[a-z]/.test(c) ? 1 : 2;
|
|
2633
|
+
let switches = 0;
|
|
2634
|
+
for (let i = 1; i < key.length; i++)
|
|
2635
|
+
if (kind(key[i]) !== kind(key[i - 1]))
|
|
2636
|
+
switches++;
|
|
2637
|
+
return switches >= key.length / 2;
|
|
2638
|
+
}
|
|
2639
|
+
function itemNameAbove(lines, i) {
|
|
2640
|
+
const col = /^\s*/.exec(lines[i])[0].length;
|
|
2641
|
+
for (let j = i - 1; j >= 0 && i - j <= 6; j--) {
|
|
2642
|
+
const l = lines[j];
|
|
2643
|
+
if (!l.trim())
|
|
2644
|
+
continue;
|
|
2645
|
+
const lead = /^\s*/.exec(l)[0].length;
|
|
2646
|
+
const item = /^(\s*)-\s+(.*)$/.exec(l);
|
|
2647
|
+
const keyCol = item ? item[1].length + (l.length - item[1].length - item[2].length) : lead;
|
|
2648
|
+
if (keyCol !== col)
|
|
2649
|
+
return void 0;
|
|
2650
|
+
const m = /^(?:\s*-\s+|\s*)(name|key)\s*:\s*["']?([^"'\s#]+)["']?\s*$/.exec(l);
|
|
2651
|
+
if (m)
|
|
2652
|
+
return m[2];
|
|
2653
|
+
if (item)
|
|
2654
|
+
return void 0;
|
|
2655
|
+
}
|
|
2656
|
+
return void 0;
|
|
2657
|
+
}
|
|
1833
2658
|
function liveSecretsIn(file, lines) {
|
|
2659
|
+
const shownKey = (key) => keyIsSecret(key) ? "" : key;
|
|
1834
2660
|
if (!isConfigFile(file))
|
|
1835
2661
|
return [];
|
|
1836
2662
|
const out = [];
|
|
@@ -1840,24 +2666,26 @@ function liveSecretsIn(file, lines) {
|
|
|
1840
2666
|
const pairs = [];
|
|
1841
2667
|
const kv = KEY_VALUE.exec(text);
|
|
1842
2668
|
if (kv) {
|
|
1843
|
-
const key = TOKEN_VALUE_KEY.test(kv[1]) ? tokenKeyNear(lines, i) ?? kv[1] : kv[1];
|
|
2669
|
+
const key = TOKEN_VALUE_KEY.test(kv[1]) ? tokenKeyNear(lines, i) ?? (/\.ya?ml$/i.test(file) ? itemNameAbove(lines, i) : void 0) ?? kv[1] : kv[1];
|
|
1844
2670
|
pairs.push({ key, value: unquote(kv[2]) });
|
|
1845
2671
|
}
|
|
1846
2672
|
for (const m of text.matchAll(XML_ELEMENT))
|
|
1847
2673
|
pairs.push({ key: m[1], value: m[2].trim() });
|
|
1848
2674
|
for (const m of text.matchAll(XML_NAMED))
|
|
1849
2675
|
pairs.push({ key: m[1], value: m[2].trim() });
|
|
2676
|
+
for (const m of text.matchAll(XML_NAMED_AFTER))
|
|
2677
|
+
pairs.push({ key: m[2], value: m[1].trim() });
|
|
1850
2678
|
if (text.includes(";"))
|
|
1851
2679
|
for (const m of text.matchAll(CONNECTION_PAIR))
|
|
1852
2680
|
pairs.push({ key: m[1].trim(), value: m[2].trim() });
|
|
1853
2681
|
const named = pairs.find(({ key, value }) => value && !PLACEHOLDER.test(value) && // a key with a nested map under it, or an encrypted value (`{cipher}…`), sets nothing here
|
|
1854
2682
|
!/^[{[]/.test(value) && !isReference(value) && looksLikeSecret(key, value));
|
|
1855
2683
|
if (named) {
|
|
1856
|
-
out.push({ file, line: i + 1, key: named.key });
|
|
2684
|
+
out.push({ file, line: i + 1, key: shownKey(named.key) });
|
|
1857
2685
|
return;
|
|
1858
2686
|
}
|
|
1859
2687
|
if (hasSecretShape(text))
|
|
1860
|
-
out.push({ file, line: i + 1, key: pairs[0]
|
|
2688
|
+
out.push({ file, line: i + 1, key: pairs[0] ? shownKey(pairs[0].key) : "(token)" });
|
|
1861
2689
|
});
|
|
1862
2690
|
return out;
|
|
1863
2691
|
}
|
|
@@ -1880,7 +2708,7 @@ var NOT_TOPIC_LAST = new Set("com org net io dev app ai co uk de fr in jp us eu
|
|
|
1880
2708
|
var NOT_TOPIC_FIRST = new Set("com org net io java javax jakarta android androidx kotlin kotlinx scala sun microsoft system google apache spring springframework management server logging hibernate jdk www".split(" "));
|
|
1881
2709
|
var DOTTED_TOPIC = /^[a-z][a-z0-9_-]*(\.[a-z][a-z0-9_-]*){2,}$/;
|
|
1882
2710
|
var SEPARATED_NAME = /^[A-Za-z][A-Za-z0-9_]*([._:-][A-Za-z0-9_]+)+$/;
|
|
1883
|
-
var
|
|
2711
|
+
var QUOTED = /(["'`])((?:\\.|(?!\1)[^\\\n])*)\1/g;
|
|
1884
2712
|
var KEY_VALUE2 = /^\s*-?\s*["']?([A-Za-z0-9_.\-[\]]+)["']?\s*[:=]\s*([^\s"'#]+)\s*$/;
|
|
1885
2713
|
var ELEMENT_TEXT = /<([A-Za-z][\w:.-]*)[^>]*>([^<\s]+)<\/\1>/g;
|
|
1886
2714
|
var wordsOf = (line) => line.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").toLowerCase().split(/[^a-z]+/).filter(Boolean);
|
|
@@ -1999,7 +2827,7 @@ function candidatesIn(path, lines) {
|
|
|
1999
2827
|
add("url", u);
|
|
2000
2828
|
urls.push(m[0]);
|
|
2001
2829
|
}
|
|
2002
|
-
const strings2 = [...code2.matchAll(
|
|
2830
|
+
const strings2 = [...code2.matchAll(QUOTED)].map((m) => ({
|
|
2003
2831
|
s: m[2],
|
|
2004
2832
|
before: code2.slice(0, m.index + 1)
|
|
2005
2833
|
}));
|
|
@@ -2142,6 +2970,7 @@ function reviewedHoldsOf(r, skipped) {
|
|
|
2142
2970
|
var SETTINGS_FILE = /\.(ya?ml|properties|json|xml|config|conf|ini|toml|cfg|env)$|(^|\/)\.env(\.[^/]*)?$/i;
|
|
2143
2971
|
var isSettingsFile = (path) => SETTINGS_FILE.test(path);
|
|
2144
2972
|
var isYaml = (path) => /\.ya?ml$/i.test(path);
|
|
2973
|
+
var DOC_FILE = /\.(md|markdown|mdx|adoc|asciidoc|txt|text|rst|html?|textile|org|rtf|wiki)$/i;
|
|
2145
2974
|
var isProperties = (path) => /\.properties$/i.test(path);
|
|
2146
2975
|
var escape = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2147
2976
|
var YAML_KEY = /^(["']?)([^\s"'#:{}[\],&*!|>][^"'#:]*?)\1\s*:(?:\s+(.*))?$/;
|
|
@@ -2169,7 +2998,8 @@ function yamlPathAt(lines, line) {
|
|
|
2169
2998
|
return void 0;
|
|
2170
2999
|
const path = [at.key];
|
|
2171
3000
|
let col = at.item ? at.lead : at.col;
|
|
2172
|
-
|
|
3001
|
+
let seq = at.item;
|
|
3002
|
+
for (let j = line - 2; j >= 0 && (col > 0 || seq); j--) {
|
|
2173
3003
|
const l = lines[j];
|
|
2174
3004
|
if (/^\s*(---|\.\.\.)\s*$/.test(l))
|
|
2175
3005
|
break;
|
|
@@ -2178,10 +3008,17 @@ function yamlPathAt(lines, line) {
|
|
|
2178
3008
|
continue;
|
|
2179
3009
|
if (y.item && y.col === col) {
|
|
2180
3010
|
col = y.lead;
|
|
3011
|
+
seq = true;
|
|
3012
|
+
continue;
|
|
3013
|
+
}
|
|
3014
|
+
if (seq && !y.item && y.col === col && y.key && !y.rest) {
|
|
3015
|
+
path.unshift(y.key);
|
|
3016
|
+
seq = false;
|
|
2181
3017
|
continue;
|
|
2182
3018
|
}
|
|
2183
3019
|
if (y.col >= col)
|
|
2184
3020
|
continue;
|
|
3021
|
+
seq = false;
|
|
2185
3022
|
if (!y.key || y.rest)
|
|
2186
3023
|
return void 0;
|
|
2187
3024
|
path.unshift(y.key);
|
|
@@ -2225,7 +3062,7 @@ var fieldNames = (seg) => [
|
|
|
2225
3062
|
];
|
|
2226
3063
|
var CONFIG_PROPS = /@ConfigurationProperties\s*\(\s*(?:(?:prefix|value)\s*=\s*)?"([^"]+)"/;
|
|
2227
3064
|
function helperBuildsKey(key, cite2, linesOf2) {
|
|
2228
|
-
if (isSettingsFile(cite2.file))
|
|
3065
|
+
if (isSettingsFile(cite2.file) || DOC_FILE.test(cite2.file))
|
|
2229
3066
|
return false;
|
|
2230
3067
|
const segs = keySegments(key);
|
|
2231
3068
|
if (segs.length < 2 || segs.join(".") !== key.trim())
|
|
@@ -2236,7 +3073,12 @@ function helperBuildsKey(key, cite2, linesOf2) {
|
|
|
2236
3073
|
if (line === void 0)
|
|
2237
3074
|
return false;
|
|
2238
3075
|
const code2 = isCommentLine(line) ? line : line.replace(/\/\*.*?\*\//g, "").replace(/(^|\s)\/\/.*$/, "");
|
|
2239
|
-
|
|
3076
|
+
const literals = [];
|
|
3077
|
+
const bare2 = code2.replace(/(["'`])((?:(?!\1)[^\\]|\\.)*)\1/g, (_all, _q, text) => {
|
|
3078
|
+
literals.push(text);
|
|
3079
|
+
return '""';
|
|
3080
|
+
});
|
|
3081
|
+
if (!literals.includes(last) && !new RegExp(`(^|[^A-Za-z0-9_$-])${escape(last)}($|[^A-Za-z0-9_$-])`).test(bare2))
|
|
2240
3082
|
return false;
|
|
2241
3083
|
const parts = cite2.with ?? [];
|
|
2242
3084
|
const files = [...new Set(parts.map((p) => p.file))];
|
|
@@ -2270,6 +3112,85 @@ function helperBuildsKey(key, cite2, linesOf2) {
|
|
|
2270
3112
|
});
|
|
2271
3113
|
}
|
|
2272
3114
|
var norm = (s) => s.replace(/[‘’‚'"“”„`]/g, "").replace(/\s+/g, " ").trim();
|
|
3115
|
+
function yamlScalar(rest) {
|
|
3116
|
+
const t = rest.trim().replace(/^!!?[\w/:.-]*\s+/, "");
|
|
3117
|
+
const q = /^(["'])((?:(?!\1).|\1\1)*)\1/.exec(t);
|
|
3118
|
+
if (q)
|
|
3119
|
+
return q[1] === "'" ? q[2].replace(/''/g, "'") : q[2];
|
|
3120
|
+
return t.replace(/\s+#.*$/, "").trim();
|
|
3121
|
+
}
|
|
3122
|
+
function propertiesValues(line, key, next = []) {
|
|
3123
|
+
let v = line.slice(line.indexOf(key) + key.length).replace(/^\s*[=:]?\s*/, "");
|
|
3124
|
+
for (let i = 0; /(^|[^\\])(\\\\)*\\$/.test(v) && i < next.length; i++)
|
|
3125
|
+
v = v.slice(0, -1) + next[i].replace(/^\s+/, "");
|
|
3126
|
+
return [v.trim(), decodeProperties(v)];
|
|
3127
|
+
}
|
|
3128
|
+
function decodeProperties(v) {
|
|
3129
|
+
return v.replace(/\\(u[0-9a-fA-F]{4}|.)/g, (_, c) => c.length === 5 ? String.fromCharCode(parseInt(c.slice(1), 16)) : c === "t" ? " " : c === "n" ? "\n" : c).trim();
|
|
3130
|
+
}
|
|
3131
|
+
function jsonValueOn(line) {
|
|
3132
|
+
const m = /"value"\s*:\s*("(?:[^"\\]|\\.)*"|[^,}\]\s]+)/.exec(line);
|
|
3133
|
+
if (!m)
|
|
3134
|
+
return void 0;
|
|
3135
|
+
if (!m[1].startsWith('"'))
|
|
3136
|
+
return m[1];
|
|
3137
|
+
try {
|
|
3138
|
+
return JSON.parse(m[1]);
|
|
3139
|
+
} catch {
|
|
3140
|
+
return m[1].slice(1, -1);
|
|
3141
|
+
}
|
|
3142
|
+
}
|
|
3143
|
+
function jsonFrames(lines) {
|
|
3144
|
+
const out = [];
|
|
3145
|
+
const stack = [];
|
|
3146
|
+
for (let ln = 0; ln < lines.length; ln++) {
|
|
3147
|
+
const l = lines[ln];
|
|
3148
|
+
for (let i = 0; i < l.length; i++) {
|
|
3149
|
+
const ch = l[i];
|
|
3150
|
+
const top = stack[stack.length - 1];
|
|
3151
|
+
if (ch === '"') {
|
|
3152
|
+
let j = i + 1;
|
|
3153
|
+
let text = "";
|
|
3154
|
+
for (; j < l.length && l[j] !== '"'; j++) {
|
|
3155
|
+
if (l[j] === "\\" && j + 1 < l.length)
|
|
3156
|
+
j++;
|
|
3157
|
+
text += l[j];
|
|
3158
|
+
}
|
|
3159
|
+
const isKey = top?.type === "{" && !top.afterColon && /^\s*:/.test(l.slice(j + 1));
|
|
3160
|
+
if (top?.type === "{") {
|
|
3161
|
+
if (isKey)
|
|
3162
|
+
top.pending = text;
|
|
3163
|
+
else if (top.afterColon && top.pending === "name" && top.name === void 0)
|
|
3164
|
+
top.name = text;
|
|
3165
|
+
}
|
|
3166
|
+
i = j;
|
|
3167
|
+
continue;
|
|
3168
|
+
}
|
|
3169
|
+
if (ch === ":" && top?.type === "{")
|
|
3170
|
+
top.afterColon = true;
|
|
3171
|
+
else if (ch === "," && top?.type === "{") {
|
|
3172
|
+
top.afterColon = false;
|
|
3173
|
+
top.pending = void 0;
|
|
3174
|
+
} else if (ch === "{" || ch === "[") {
|
|
3175
|
+
const under4 = top?.type === "{" ? top.pending : top?.under;
|
|
3176
|
+
stack.push({ type: ch, start: ln + 1, end: lines.length, ...under4 ? { under: under4 } : {} });
|
|
3177
|
+
} else if (ch === "}" || ch === "]") {
|
|
3178
|
+
const f = stack.pop();
|
|
3179
|
+
if (f) {
|
|
3180
|
+
out.push({
|
|
3181
|
+
type: f.type,
|
|
3182
|
+
start: f.start,
|
|
3183
|
+
end: ln + 1,
|
|
3184
|
+
...f.under ? { under: f.under } : {},
|
|
3185
|
+
...f.name !== void 0 ? { name: f.name } : {}
|
|
3186
|
+
});
|
|
3187
|
+
}
|
|
3188
|
+
}
|
|
3189
|
+
}
|
|
3190
|
+
}
|
|
3191
|
+
return out;
|
|
3192
|
+
}
|
|
3193
|
+
var noExt = (s) => s.trim().toLowerCase().replace(/\.[^.]*$/, "");
|
|
2273
3194
|
function enclosingObject(lines, line) {
|
|
2274
3195
|
let depth = 0;
|
|
2275
3196
|
let start = -1;
|
|
@@ -2302,7 +3223,7 @@ function enclosingObject(lines, line) {
|
|
|
2302
3223
|
}
|
|
2303
3224
|
return void 0;
|
|
2304
3225
|
}
|
|
2305
|
-
function configLineProblem(f, linesOf2, listed2) {
|
|
3226
|
+
function configLineProblem(f, linesOf2, listed2, bundleFolders = DEFAULT_GATEWAY_BUNDLE_FOLDERS) {
|
|
2306
3227
|
const lines = linesOf2(f.cite.file);
|
|
2307
3228
|
if (!lines)
|
|
2308
3229
|
return void 0;
|
|
@@ -2310,17 +3231,29 @@ function configLineProblem(f, linesOf2, listed2) {
|
|
|
2310
3231
|
const where = `${f.cite.file}:${f.cite.line}`;
|
|
2311
3232
|
const segs = keySegments(f.key);
|
|
2312
3233
|
const value = f.value === void 0 ? void 0 : norm(f.value);
|
|
3234
|
+
const same = (v) => value !== void 0 && v !== void 0 && norm(v) === value;
|
|
2313
3235
|
const has = (l) => value !== void 0 && norm(l).includes(value);
|
|
2314
3236
|
if (f.key.trim().startsWith("/") && /(^|\/)config\.json$/i.test(f.cite.file)) {
|
|
2315
3237
|
const dir = f.cite.file.replace(/[^/]*$/, "");
|
|
2316
|
-
if (!listed2().some((p) => p.startsWith(`${dir}
|
|
2317
|
-
return `config ${where} is a config.json beside no gateway bundle (no ${dir}
|
|
3238
|
+
if (!listed2().some((p) => bundleFolders.some((b) => p.startsWith(`${dir}${b}/`))))
|
|
3239
|
+
return `config ${where} is a config.json beside no gateway bundle (no ${bundleFolders.map((b) => `${dir}${b}/`).join(" or ")}); a token's setting is read only from the bundle's own`;
|
|
2318
3240
|
const obj = enclosingObject(lines, f.cite.line);
|
|
2319
3241
|
const xpathRe = new RegExp(`"xpath"\\s*:\\s*"${escape(f.key.trim())}"`);
|
|
2320
3242
|
if (!obj || !obj.some((l) => xpathRe.test(l)))
|
|
2321
3243
|
return `the token at ${where} has no "xpath" of ${f.key}`;
|
|
2322
|
-
if (value !== void 0 && !obj.some((l) =>
|
|
3244
|
+
if (value !== void 0 && !obj.some((l) => same(jsonValueOn(l))))
|
|
2323
3245
|
return `the token at ${where} sets no such value; cite the token whose "value" it is`;
|
|
3246
|
+
const around = jsonFrames(lines).filter((x) => x.type === "{" && x.start <= f.cite.line && x.end >= f.cite.line).sort((a, b) => b.start - a.start);
|
|
3247
|
+
if (f.target !== void 0) {
|
|
3248
|
+
const file = around.find((x) => /^(targets|policies|proxies)$/i.test(x.under ?? ""));
|
|
3249
|
+
if (!file?.name || noExt(file.name) !== noExt(f.target))
|
|
3250
|
+
return `the token at ${where} is ${file?.name ? `${file.name}'s` : "in no file's list"}, not ${f.target}'s; give the target the token's file is named`;
|
|
3251
|
+
}
|
|
3252
|
+
if (f.env !== void 0) {
|
|
3253
|
+
const conf = around.find((x) => /^configurations$/i.test(x.under ?? ""));
|
|
3254
|
+
if (!conf?.name || conf.name.trim() !== f.env.trim())
|
|
3255
|
+
return `the token at ${where} is in ${conf?.name ? `the ${conf.name} configuration` : "no named configuration"}, not ${f.env}; give the env its configuration is named`;
|
|
3256
|
+
}
|
|
2324
3257
|
return void 0;
|
|
2325
3258
|
}
|
|
2326
3259
|
if (isYaml(f.cite.file)) {
|
|
@@ -2331,7 +3264,7 @@ function configLineProblem(f, linesOf2, listed2) {
|
|
|
2331
3264
|
if (path.length < segs.length || !sameSegs(tail, segs))
|
|
2332
3265
|
return `${where} sets ${path.join(".")}, not ${f.key}: the key's parents are not the lines above it`;
|
|
2333
3266
|
if (value !== void 0 && y.rest && !/^[|>]/.test(y.rest)) {
|
|
2334
|
-
if (!
|
|
3267
|
+
if (!same(yamlScalar(y.rest)))
|
|
2335
3268
|
return `${where} sets ${y.key} to something other than the value claimed`;
|
|
2336
3269
|
return void 0;
|
|
2337
3270
|
}
|
|
@@ -2343,7 +3276,7 @@ function configLineProblem(f, linesOf2, listed2) {
|
|
|
2343
3276
|
if (k !== segs.join(".") && !k.endsWith(`.${segs.join(".")}`))
|
|
2344
3277
|
return `${where} sets ${k}, not ${f.key}`;
|
|
2345
3278
|
if (value !== void 0) {
|
|
2346
|
-
if (!
|
|
3279
|
+
if (!propertiesValues(at, k, lines.slice(f.cite.line)).some(same))
|
|
2347
3280
|
return `${where} sets ${k} to something other than the value claimed`;
|
|
2348
3281
|
return void 0;
|
|
2349
3282
|
}
|
|
@@ -2353,9 +3286,21 @@ function configLineProblem(f, linesOf2, listed2) {
|
|
|
2353
3286
|
return void 0;
|
|
2354
3287
|
const near = [f.cite.line - 1, f.cite.line, f.cite.line + 1].map((n) => lines[n - 1] ?? "");
|
|
2355
3288
|
const partLines = (f.cite.with ?? []).map((p) => linesOf2(p.file)?.[p.line - 1] ?? "");
|
|
2356
|
-
if (
|
|
2357
|
-
return
|
|
2358
|
-
|
|
3289
|
+
if ([...near, ...partLines].some(has))
|
|
3290
|
+
return void 0;
|
|
3291
|
+
const hp = /^([^\s:/]+):(\d{1,5})$/.exec(f.value.trim());
|
|
3292
|
+
if (hp) {
|
|
3293
|
+
const parts = f.cite.with ?? [];
|
|
3294
|
+
const written = (want) => parts.some((p) => {
|
|
3295
|
+
if (p.value.trim() !== want)
|
|
3296
|
+
return false;
|
|
3297
|
+
const l = linesOf2(p.file)?.[p.line - 1] ?? "";
|
|
3298
|
+
return new RegExp(`(^|[^A-Za-z0-9.-])${escape(want)}($|[^A-Za-z0-9.-])`).test(l);
|
|
3299
|
+
});
|
|
3300
|
+
if (written(hp[1]) && written(hp[2]))
|
|
3301
|
+
return void 0;
|
|
3302
|
+
}
|
|
3303
|
+
return `${where} (or the line either side) and its parts don't write the value claimed`;
|
|
2359
3304
|
}
|
|
2360
3305
|
|
|
2361
3306
|
// packages/verify/dist/reachable.js
|
|
@@ -2551,6 +3496,122 @@ function methodUnseenOf(f, lines, factOf) {
|
|
|
2551
3496
|
}
|
|
2552
3497
|
|
|
2553
3498
|
// packages/verify/dist/verify.js
|
|
3499
|
+
var LINE_KEY_VALUE = /^\s*(?:-\s+)?(?:export\s+)?["']?([A-Za-z0-9_.\-[\]]+)["']?\s*[:=]\s*(.*?)\s*,?\s*$/;
|
|
3500
|
+
var LINE_XML = [
|
|
3501
|
+
/<([A-Za-z_][\w.-]*)>([^<]+)<\/\1>/g,
|
|
3502
|
+
/\b(?:key|name)\s*=\s*"([^"]+)"\s+value\s*=\s*"([^"]*)"/g
|
|
3503
|
+
];
|
|
3504
|
+
var unquoted = (v) => v.replace(/^["'`]|["'`]$/g, "").trim();
|
|
3505
|
+
function pairsOf(t) {
|
|
3506
|
+
const out = [];
|
|
3507
|
+
const kv = LINE_KEY_VALUE.exec(t);
|
|
3508
|
+
if (kv)
|
|
3509
|
+
out.push({ key: kv[1], value: unquoted(kv[2]) });
|
|
3510
|
+
for (const re of LINE_XML)
|
|
3511
|
+
for (const m of t.matchAll(re))
|
|
3512
|
+
out.push({ key: m[1], value: unquoted(m[2]) });
|
|
3513
|
+
return out;
|
|
3514
|
+
}
|
|
3515
|
+
function lineSecrets(line) {
|
|
3516
|
+
const t = line.trim();
|
|
3517
|
+
if (!t)
|
|
3518
|
+
return [];
|
|
3519
|
+
const pairs = pairsOf(t);
|
|
3520
|
+
const words = t.split(/[\s"'`=:,;()<>{}[\]/@]+/).filter((w) => w.length >= 6 && credentialLike(w));
|
|
3521
|
+
const holds = redactSecrets(t) !== t || hasSecretShape(t) || quoteHoldsSecret(t) || words.length > 0 || pairs.some((p) => looksLikeSecret(p.key, "x") || p.value && credentialLike(p.value));
|
|
3522
|
+
if (!holds)
|
|
3523
|
+
return [];
|
|
3524
|
+
const literals = [...t.matchAll(/(["'`])((?:(?!\1).){3,})\1/g)].map((m) => m[2]);
|
|
3525
|
+
return [t, t.slice(0, 200), ...pairs.map((p) => p.value), ...literals, ...words].filter((s) => s.length >= 3);
|
|
3526
|
+
}
|
|
3527
|
+
function citesIn(x, out = []) {
|
|
3528
|
+
if (Array.isArray(x))
|
|
3529
|
+
for (const v of x)
|
|
3530
|
+
citesIn(v, out);
|
|
3531
|
+
else if (x && typeof x === "object") {
|
|
3532
|
+
const o = x;
|
|
3533
|
+
if (typeof o.file === "string" && typeof o.line === "number")
|
|
3534
|
+
out.push(o);
|
|
3535
|
+
for (const v of Object.values(o))
|
|
3536
|
+
if (v && typeof v === "object")
|
|
3537
|
+
citesIn(v, out);
|
|
3538
|
+
}
|
|
3539
|
+
return out;
|
|
3540
|
+
}
|
|
3541
|
+
function quietFact(f, lineAt) {
|
|
3542
|
+
if (f.kind !== "config")
|
|
3543
|
+
return false;
|
|
3544
|
+
if (looksLikeSecret(f.key, "x") || configSecretField(f))
|
|
3545
|
+
return true;
|
|
3546
|
+
if ([f.value, f.source, f.cite.quote, ...(f.cite.with ?? []).map((w) => w.value)].some((t) => t !== void 0 && (hasSecretShape(t) || credentialLike(t) || redactSecrets(t) !== t)))
|
|
3547
|
+
return true;
|
|
3548
|
+
return lineAt !== void 0 && [f.cite, ...f.cite.with ?? []].some((c) => lineSecrets(lineAt(c.file, c.line) ?? "").length);
|
|
3549
|
+
}
|
|
3550
|
+
function sanitised(f, message, lineAt, quiet) {
|
|
3551
|
+
let out = redactSecrets(message);
|
|
3552
|
+
const texts = /* @__PURE__ */ new Set();
|
|
3553
|
+
for (const c of citesIn(f))
|
|
3554
|
+
for (const n of [c.line - 1, c.line, c.line + 1])
|
|
3555
|
+
for (const s of lineSecrets(lineAt(c.file, n) ?? ""))
|
|
3556
|
+
texts.add(s);
|
|
3557
|
+
for (const t of [...texts].sort((a, b) => b.length - a.length))
|
|
3558
|
+
out = out.split(t).join("<redacted>");
|
|
3559
|
+
out = out.replace(/"([^"]*)"/g, (all2, inner) => lineSecrets(inner).length ? '"<redacted>"' : all2);
|
|
3560
|
+
return quiet ? scrubbed(f, out) : out;
|
|
3561
|
+
}
|
|
3562
|
+
function shownFact(f, quiet, lineAt) {
|
|
3563
|
+
if (quiet)
|
|
3564
|
+
return withoutSecret(f);
|
|
3565
|
+
const cites = citesIn(f).filter((c) => c.quote !== void 0);
|
|
3566
|
+
const bad = (c) => {
|
|
3567
|
+
const q = c.quote;
|
|
3568
|
+
if (lineSecrets(q).length)
|
|
3569
|
+
return true;
|
|
3570
|
+
return [c.line - 1, c.line, c.line + 1].some((n) => lineSecrets(lineAt(c.file, n) ?? "").some((s) => s !== "" && q.includes(s)));
|
|
3571
|
+
};
|
|
3572
|
+
if (!cites.some(bad))
|
|
3573
|
+
return f;
|
|
3574
|
+
const strip = (x) => {
|
|
3575
|
+
if (Array.isArray(x))
|
|
3576
|
+
return x.map(strip);
|
|
3577
|
+
if (!x || typeof x !== "object")
|
|
3578
|
+
return x;
|
|
3579
|
+
const o = Object.fromEntries(Object.entries(x).map(([k, v]) => [k, strip(v)]));
|
|
3580
|
+
const c = x;
|
|
3581
|
+
if (typeof c.file === "string" && typeof c.line === "number" && typeof c.quote === "string" && bad(c))
|
|
3582
|
+
delete o.quote;
|
|
3583
|
+
return o;
|
|
3584
|
+
};
|
|
3585
|
+
return strip(f);
|
|
3586
|
+
}
|
|
3587
|
+
function scrubbed(f, message) {
|
|
3588
|
+
if (f.kind !== "config")
|
|
3589
|
+
return message;
|
|
3590
|
+
const names = new Set([f.key, f.target, f.env, f.cite.file, ...(f.cite.with ?? []).map((w) => w.file)].filter((x) => x !== void 0));
|
|
3591
|
+
const texts = [f.value, f.source, f.cite.quote, ...(f.cite.with ?? []).map((w) => w.value)].flatMap((t) => t === void 0 ? [] : [t, t.trim()]).filter((t) => t.length >= 3 && !names.has(t)).sort((a, b) => b.length - a.length);
|
|
3592
|
+
let out = message;
|
|
3593
|
+
for (const t of texts)
|
|
3594
|
+
out = out.split(t).join("<redacted>");
|
|
3595
|
+
return out;
|
|
3596
|
+
}
|
|
3597
|
+
var asRead = /* @__PURE__ */ new WeakMap();
|
|
3598
|
+
function factAsRead(f) {
|
|
3599
|
+
return asRead.get(f) ?? f;
|
|
3600
|
+
}
|
|
3601
|
+
function withoutSecret(f) {
|
|
3602
|
+
if (f.kind !== "config")
|
|
3603
|
+
return f;
|
|
3604
|
+
const { quote: _q, ...cite2 } = f.cite;
|
|
3605
|
+
return {
|
|
3606
|
+
...f,
|
|
3607
|
+
...f.value !== void 0 ? { value: "<redacted>" } : {},
|
|
3608
|
+
...f.source !== void 0 ? { source: "<redacted>" } : {},
|
|
3609
|
+
cite: {
|
|
3610
|
+
...cite2,
|
|
3611
|
+
...f.cite.with ? { with: f.cite.with.map((w) => ({ ...w, value: "<redacted>" })) } : {}
|
|
3612
|
+
}
|
|
3613
|
+
};
|
|
3614
|
+
}
|
|
2554
3615
|
var FOLLOWED_TYPES = ["event-topic", "mq-queue", "rest", "grpc"];
|
|
2555
3616
|
function entriesNoFlowFollows(facts, rules = DEFAULT_READ_RULES) {
|
|
2556
3617
|
const started = new Set(facts.flatMap((f) => f.kind === "flow" ? [f.entry] : []));
|
|
@@ -2577,6 +3638,8 @@ var LINES_HELD = 64;
|
|
|
2577
3638
|
var SOURCE_EXT = /\.(java|kt|kts|scala|groovy|cs|vb|fs|ts|tsx|js|jsx|mjs|cjs|py|rb|go|rs|php|swift|m|mm|c|cc|cpp|h|hpp|sql|graphql|gql|proto|ya?ml|json|xml|properties|toml|ini|conf|tf|tfvars|hcl|bicep|sh|ps1|bat|cmd|gradle|html?|vue|svelte|cshtml|razor|aspx|jsp|ftl|hbs|cob|cbl|cpy|jcl|avsc|wsdl|xsd|csproj|sln|config)$/i;
|
|
2578
3639
|
var SOURCE_NAME = /(^|\/)(Dockerfile[^/]*|Makefile|Jenkinsfile|Procfile|Containerfile)$/;
|
|
2579
3640
|
var LOCKFILE = /(^|\/)(package-lock\.json|npm-shrinkwrap\.json|yarn\.lock|pnpm-lock\.yaml|composer\.lock|Gemfile\.lock|Cargo\.lock|poetry\.lock|go\.sum|packages\.lock\.json)$/;
|
|
3641
|
+
var ENV_FOLDER = /(^|\/)(env|envs|environments?|overlays|stages?)\/[^/]+(?=\/)/gi;
|
|
3642
|
+
var testFileOf = (rules, p) => rules.notProduct.test(p.replace(ENV_FOLDER, "$1$2/_"));
|
|
2580
3643
|
var NOT_PRODUCT = [
|
|
2581
3644
|
/(\.|_|-)(test|spec|tests|specs)\.[a-z0-9]+$/i,
|
|
2582
3645
|
/(Test|Tests|IT|Spec)\.(java|kt|scala|groovy|cs|vb)$/,
|
|
@@ -2631,8 +3694,9 @@ function claimsOf(f) {
|
|
|
2631
3694
|
// A call whose path is a setting's placeholder a helper puts together is checked apart
|
|
2632
3695
|
// (`helperBuildsKey`): its bare key is never a claim, or a settings line would be a call.
|
|
2633
3696
|
case "entry":
|
|
2634
|
-
case "call":
|
|
2635
3697
|
return [routeOrWord(f.path)];
|
|
3698
|
+
case "call":
|
|
3699
|
+
return f.path.trim() === "/" && /^[a-z][a-z0-9+.-]*:\/\/[^/\s?#]+\/?$/i.test(f.cite.value.trim()) ? [routeOrWord(f.path), { kind: "word", value: f.cite.value.trim() }] : [routeOrWord(f.path)];
|
|
2636
3700
|
case "store":
|
|
2637
3701
|
return [
|
|
2638
3702
|
{ kind: "word", value: f.name },
|
|
@@ -2784,7 +3848,8 @@ async function verifyFacts(o) {
|
|
|
2784
3848
|
return lines;
|
|
2785
3849
|
};
|
|
2786
3850
|
const deriveEnv = { lines: linesOf2, files: listed2 };
|
|
2787
|
-
const
|
|
3851
|
+
const lineAt = (file, n) => n >= 1 ? linesOf2(file)?.[n - 1] : void 0;
|
|
3852
|
+
const checkCite = (cite2, claims, label, withHint = true, alsoHolds, quiet = false) => {
|
|
2788
3853
|
const where = `${cite2.file}:${cite2.line}`;
|
|
2789
3854
|
if (!insideRepo(cite2.file))
|
|
2790
3855
|
return {
|
|
@@ -2837,7 +3902,7 @@ async function verifyFacts(o) {
|
|
|
2837
3902
|
!partsNamePath(near(ls, p.line), p.value))
|
|
2838
3903
|
return {
|
|
2839
3904
|
code: "claim-not-on-line",
|
|
2840
|
-
message: `${pl} says "${p.value}" is written at ${p.file}:${p.line} (or the line either side), and it isn't`
|
|
3905
|
+
message: quiet ? `${pl} is not written at ${p.file}:${p.line} (or the line either side); cite the line that writes it (its text is not repeated here: it may be a secret)` : `${pl} says "${p.value}" is written at ${p.file}:${p.line} (or the line either side), and it isn't`
|
|
2841
3906
|
};
|
|
2842
3907
|
partLines.push(...near(ls, p.line));
|
|
2843
3908
|
}
|
|
@@ -2873,7 +3938,7 @@ async function verifyFacts(o) {
|
|
|
2873
3938
|
if (!near2.some((l) => quoteMatches(l, cite2.quote)))
|
|
2874
3939
|
return {
|
|
2875
3940
|
code: "quote-mismatch",
|
|
2876
|
-
message: `${label} quotes "${cite2.quote}", but ${where} reads "${line.trim().slice(0, 200)}"`
|
|
3941
|
+
message: quiet ? `${label}'s quote is not what ${where} (or the line either side) reads; neither is repeated here, as either may hold a secret` : `${label} quotes "${cite2.quote}", but ${where} reads "${line.trim().slice(0, 200)}"`
|
|
2877
3942
|
};
|
|
2878
3943
|
}
|
|
2879
3944
|
return void 0;
|
|
@@ -2892,6 +3957,8 @@ async function verifyFacts(o) {
|
|
|
2892
3957
|
};
|
|
2893
3958
|
const estate = o.estate ? new Set(o.estate.components.map(factIdPart)) : void 0;
|
|
2894
3959
|
const serves2 = facts.some((f) => f.kind === "entry");
|
|
3960
|
+
const moduleOf = /* @__PURE__ */ new Map();
|
|
3961
|
+
const placedFrom = /* @__PURE__ */ new Map();
|
|
2895
3962
|
const repoComponents = new Map(Object.entries(o.estate?.repoComponents ?? {}).map(([r, cs]) => [factIdPart(r), new Set(cs.map(factIdPart))]));
|
|
2896
3963
|
for (const f of facts) {
|
|
2897
3964
|
const label = `${f.kind} ${f.id}`;
|
|
@@ -2910,12 +3977,17 @@ async function verifyFacts(o) {
|
|
|
2910
3977
|
// beta.24): a helper puts the key together (a `@ConfigurationProperties` prefix, a
|
|
2911
3978
|
// map field, the name passed to a lookup). The cited line is code naming the key's
|
|
2912
3979
|
// last segment, and one file among the parts proves the rest of the key nests so.
|
|
2913
|
-
f.kind === "call" && PLACEHOLDER_KEY.test(f.path.trim()) && helperBuildsKey(PLACEHOLDER_KEY.exec(f.path.trim())[1], f.cite, linesOf2) : void 0));
|
|
3980
|
+
f.kind === "call" && PLACEHOLDER_KEY.test(f.path.trim()) && helperBuildsKey(PLACEHOLDER_KEY.exec(f.path.trim())[1], f.cite, linesOf2) : void 0, quietFact(f, lineAt)));
|
|
2914
3981
|
if (f.kind === "config" && !found.has(f.id)) {
|
|
2915
|
-
const bad = configLineProblem(f, linesOf2, listed2);
|
|
3982
|
+
const bad = configLineProblem(f, linesOf2, listed2, rules.gatewayBundleFolders);
|
|
2916
3983
|
if (bad)
|
|
2917
3984
|
problem(f, "claim-not-on-line", `${label}: ${bad}`);
|
|
2918
3985
|
}
|
|
3986
|
+
if (f.kind === "config") {
|
|
3987
|
+
const field = configSecretField(f);
|
|
3988
|
+
if (field)
|
|
3989
|
+
problem(f, "secret-value", `${label}: "${f.key}" carries a secret in its ${field}; cite the line that names the setting and give its source (env:NAME, vault:path), never its value`);
|
|
3990
|
+
}
|
|
2919
3991
|
if (f.kind === "entry" && f.authCite)
|
|
2920
3992
|
add(f, checkCite({ ...f.authCite }, [{ kind: "word", value: f.authCite.value }], `${label} authCite${f.auth ? ` (auth ${f.auth})` : ""}`, false));
|
|
2921
3993
|
if (f.kind === "entry" && f.authCite && f.auth) {
|
|
@@ -3006,12 +4078,31 @@ async function verifyFacts(o) {
|
|
|
3006
4078
|
if (f.version !== void 0)
|
|
3007
4079
|
add(f, checkCite(f.cite, [{ kind: "word", value: f.version }], `${label} version`, false));
|
|
3008
4080
|
}
|
|
4081
|
+
const own = o.estate?.repoComponent?.[f.repo];
|
|
4082
|
+
if (own !== void 0 && o.estate) {
|
|
4083
|
+
const to = placedComponentOf(f, {
|
|
4084
|
+
component: own,
|
|
4085
|
+
modules: o.estate.modules?.[f.repo],
|
|
4086
|
+
components: o.estate.components,
|
|
4087
|
+
prototype: o.estate.prototypes?.includes(f.repo)
|
|
4088
|
+
});
|
|
4089
|
+
const top = f.cite?.file?.split("/")[0];
|
|
4090
|
+
if (to !== void 0 && top !== void 0 && isBuildModuleDir(top, linesOf2)) {
|
|
4091
|
+
moduleOf.set(f.id, to);
|
|
4092
|
+
placedFrom.set(f.id, f.component);
|
|
4093
|
+
}
|
|
4094
|
+
}
|
|
3009
4095
|
if ((f.kind === "artifact" || f.kind === "dependency") && !found.has(f.id)) {
|
|
3010
|
-
const
|
|
4096
|
+
const mod = buildModuleOf(f, linesOf2, o.estate?.modules?.[f.repo] ?? [], o.estate?.repoComponent?.[f.repo]);
|
|
4097
|
+
const bad = buildCoordinatesProblem(f, linesOf2, listed2()) ?? buildModuleProblem(f, mod);
|
|
3011
4098
|
if (bad)
|
|
3012
4099
|
problem(f, "build-coordinates", bad);
|
|
3013
|
-
else
|
|
3014
|
-
|
|
4100
|
+
else {
|
|
4101
|
+
if (mod?.from === "manifest" && mod.component && f.component === void 0)
|
|
4102
|
+
moduleOf.set(f.id, mod.component);
|
|
4103
|
+
if (f.version !== void 0 && !isVersionCatalogFile(f.cite.file))
|
|
4104
|
+
add(f, checkCite(f.cite, [{ kind: "word", value: f.version }], `${label} version`, false));
|
|
4105
|
+
}
|
|
3015
4106
|
}
|
|
3016
4107
|
if (f.kind === "flow") {
|
|
3017
4108
|
f.steps.forEach((s, i) => add(f, checkCite(s.cite, stepClaims(s.kind, s.cite.value), `${label} step ${i + 1}`)));
|
|
@@ -3058,11 +4149,17 @@ async function verifyFacts(o) {
|
|
|
3058
4149
|
}
|
|
3059
4150
|
const rejected = /* @__PURE__ */ new Map();
|
|
3060
4151
|
for (const f of facts) {
|
|
3061
|
-
|
|
4152
|
+
let ps = found.get(f.id);
|
|
3062
4153
|
if (!ps?.length)
|
|
3063
4154
|
continue;
|
|
3064
|
-
|
|
3065
|
-
|
|
4155
|
+
const isOther = other.has(f.id);
|
|
4156
|
+
const quiet = ps.some((p) => p.code === "secret-value") || quietFact(f, isOther ? void 0 : lineAt);
|
|
4157
|
+
ps = ps.map((p) => ({ ...p, message: sanitised(f, p.message, lineAt, quiet) }));
|
|
4158
|
+
const shown = isOther ? f.kind === "config" && configSecretField(f) || citesIn(f).some((c) => c.quote && lineSecrets(c.quote).length) ? withoutSecret(f) : f : shownFact(f, quiet, lineAt);
|
|
4159
|
+
if (isOther && shown !== f)
|
|
4160
|
+
asRead.set(shown, f);
|
|
4161
|
+
rejected.set(f.id, ps.length === 1 ? { fact: shown, ...ps[0] } : {
|
|
4162
|
+
fact: shown,
|
|
3066
4163
|
code: ps[0].code,
|
|
3067
4164
|
message: ps.map((p, i) => `(${i + 1}) ${p.message}`).join(" "),
|
|
3068
4165
|
problems: ps
|
|
@@ -3075,10 +4172,11 @@ async function verifyFacts(o) {
|
|
|
3075
4172
|
continue;
|
|
3076
4173
|
const r = refsOf(f).find((x) => rejected.has(x.id));
|
|
3077
4174
|
if (r) {
|
|
4175
|
+
const quiet = quietFact(f, lineAt);
|
|
3078
4176
|
rejected.set(f.id, {
|
|
3079
|
-
fact: f,
|
|
4177
|
+
fact: shownFact(f, quiet, lineAt),
|
|
3080
4178
|
code: "ref-rejected",
|
|
3081
|
-
message: `${f.kind} ${f.id} names ${r.field} "${r.id}", which was rejected (${rejected.get(r.id).code})
|
|
4179
|
+
message: sanitised(f, `${f.kind} ${f.id} names ${r.field} "${r.id}", which was rejected (${rejected.get(r.id).code})`, lineAt, quiet)
|
|
3082
4180
|
});
|
|
3083
4181
|
changed = true;
|
|
3084
4182
|
}
|
|
@@ -3112,7 +4210,13 @@ async function verifyFacts(o) {
|
|
|
3112
4210
|
const accepted = facts.filter((f) => !rejected.has(f.id)).map((f) => {
|
|
3113
4211
|
o.room?.();
|
|
3114
4212
|
const verified = f.by === "person" && f.verified !== "none" ? f.verified : "line";
|
|
3115
|
-
const
|
|
4213
|
+
const module = moduleOf.get(f.id);
|
|
4214
|
+
const base2 = {
|
|
4215
|
+
...f,
|
|
4216
|
+
...module !== void 0 ? { component: module } : {},
|
|
4217
|
+
verified,
|
|
4218
|
+
cite: fixQuote(f.cite)
|
|
4219
|
+
};
|
|
3116
4220
|
if (base2.kind === "entry" && base2.auth !== void 0 && !base2.authCite && f.by !== "person")
|
|
3117
4221
|
authUncited.push({
|
|
3118
4222
|
id: base2.id,
|
|
@@ -3137,7 +4241,7 @@ async function verifyFacts(o) {
|
|
|
3137
4241
|
for (const p of o.source.list()) {
|
|
3138
4242
|
o.room?.();
|
|
3139
4243
|
if (isSecretPath(p)) {
|
|
3140
|
-
if (insideRepo(p) && isConfigFile(p) && !rules
|
|
4244
|
+
if (insideRepo(p) && isConfigFile(p) && !testFileOf(rules, p) && !tooBigToRead(o.source, p)) {
|
|
3141
4245
|
const text = o.source.read(p);
|
|
3142
4246
|
const ls2 = text === void 0 ? void 0 : text.replace(/\r\n?/g, "\n").split("\n");
|
|
3143
4247
|
if (ls2 && !binaryLines(ls2))
|
|
@@ -3145,11 +4249,23 @@ async function verifyFacts(o) {
|
|
|
3145
4249
|
}
|
|
3146
4250
|
continue;
|
|
3147
4251
|
}
|
|
3148
|
-
|
|
4252
|
+
const scanOnly = () => {
|
|
4253
|
+
if (!insideRepo(p) || !isConfigFile(p) || LOCKFILE.test(p) || testFileOf(rules, p) || tooBigToRead(o.source, p))
|
|
4254
|
+
return;
|
|
4255
|
+
const ls2 = readLines(p);
|
|
4256
|
+
if (ls2 && !binaryLines(ls2))
|
|
4257
|
+
secrets.push(...liveSecretsIn(p, ls2));
|
|
4258
|
+
};
|
|
4259
|
+
if (!isSourceFile(p, "", void 0, rules) || tooBigToRead(o.source, p)) {
|
|
4260
|
+
scanOnly();
|
|
3149
4261
|
continue;
|
|
4262
|
+
}
|
|
3150
4263
|
const ls = readLines(p) ?? [""];
|
|
3151
|
-
if (!isSourceFile(p, ls[0] ?? "", ls, rules))
|
|
4264
|
+
if (!isSourceFile(p, ls[0] ?? "", ls, rules)) {
|
|
4265
|
+
if (isConfigFile(p) && !LOCKFILE.test(p) && !testFileOf(rules, p) && !binaryLines(ls))
|
|
4266
|
+
secrets.push(...liveSecretsIn(p, ls));
|
|
3152
4267
|
continue;
|
|
4268
|
+
}
|
|
3153
4269
|
if (excludeRes.some((re) => re.test(p)))
|
|
3154
4270
|
excluded.push(p);
|
|
3155
4271
|
else {
|
|
@@ -3256,7 +4372,14 @@ async function verifyFacts(o) {
|
|
|
3256
4372
|
const held = files.flatMap(skippedIn);
|
|
3257
4373
|
return held.length ? [reviewedHoldsOf(entry, held)] : [];
|
|
3258
4374
|
});
|
|
3259
|
-
const
|
|
4375
|
+
const namedPoms = [...touched].some((p) => isBuildFile(p)) ? pomFilesNamed(listed2(), linesOf2) : void 0;
|
|
4376
|
+
const placed = accepted.filter((f) => placedFrom.has(f.id)).map((f) => ({
|
|
4377
|
+
id: f.id,
|
|
4378
|
+
named: placedFrom.get(f.id),
|
|
4379
|
+
component: f.component,
|
|
4380
|
+
cite: `${f.cite.file}:${f.cite.line}`
|
|
4381
|
+
})).sort((a, b) => a.id < b.id ? -1 : a.id > b.id ? 1 : 0);
|
|
4382
|
+
const unrecorded = buildUnrecorded([...touched].filter((p) => isBuildFileIn(p, namedPoms) && insideRepo(p) && !isSecretPath(p)), (p) => linesOf2(p), accepted, listed2());
|
|
3260
4383
|
return {
|
|
3261
4384
|
accepted,
|
|
3262
4385
|
// a rejected fact goes back as it was read, at its own commit, even one that was carried
|
|
@@ -3284,12 +4407,13 @@ async function verifyFacts(o) {
|
|
|
3284
4407
|
reviewedHolds,
|
|
3285
4408
|
specOpsUncovered,
|
|
3286
4409
|
frameworkGaps: frameworkGaps(accepted, rules.frameworks),
|
|
3287
|
-
...unrecorded.length ? { buildUnrecorded: unrecorded } : {}
|
|
4410
|
+
...unrecorded.length ? { buildUnrecorded: unrecorded } : {},
|
|
4411
|
+
...placed.length ? { componentsPlaced: placed } : {}
|
|
3288
4412
|
};
|
|
3289
4413
|
}
|
|
3290
4414
|
|
|
3291
4415
|
// packages/verify/dist/batches.js
|
|
3292
|
-
var BUILD = /(^|\/)(pom\.xml|build\.gradle(\.kts)?|settings\.gradle(\.kts)?|package\.json|go\.mod|Cargo\.toml|pyproject\.toml|setup\.py|requirements[^/]*\.txt|Gemfile|[^/]+\.gemspec|composer\.json|[^/]+\.(csproj|sln|tf|tfvars|bicep|hcl)|Dockerfile[^/]*|Containerfile|Jenkinsfile|Makefile|Procfile|(docker-)?compose[^/]*\.ya?ml|Chart\.yaml|values[^/]*\.ya?ml|azure-pipelines[^/]*\.ya?ml|\.gitlab-ci\.yml|bitbucket-pipelines\.yml|serverless\.ya?ml|template\.ya?ml|manifest\.ya?ml)$/;
|
|
4416
|
+
var BUILD = /(^|\/)(pom\.xml|[^/]+[-_.]pom\.xml|[^/]+\.pom|gradle\/[\w-]+\.versions\.toml|build\.gradle(\.kts)?|settings\.gradle(\.kts)?|package\.json|go\.mod|Cargo\.toml|pyproject\.toml|setup\.py|requirements[^/]*\.txt|Gemfile|[^/]+\.gemspec|composer\.json|[^/]+\.(csproj|sln|tf|tfvars|bicep|hcl)|Dockerfile[^/]*|Containerfile|Jenkinsfile|Makefile|Procfile|(docker-)?compose[^/]*\.ya?ml|Chart\.yaml|values[^/]*\.ya?ml|azure-pipelines[^/]*\.ya?ml|\.gitlab-ci\.yml|bitbucket-pipelines\.yml|serverless\.ya?ml|template\.ya?ml|manifest\.ya?ml)$/;
|
|
3293
4417
|
var DEPLOY_DIR = /(^|\/)(\.github\/workflows|\.circleci|k8s|kubernetes|helm|charts|deploy|deployment|deployments|manifests|infra|terraform|pipelines?)\//;
|
|
3294
4418
|
var CONFIG = /(^|\/)((application|bootstrap)[^/]*\.(ya?ml|properties)|appsettings[^/]*\.json|[^/]+\.(properties|conf|ini|toml)|web\.config|config\/[^/]+\.(ya?ml|json))$/;
|
|
3295
4419
|
var ENTRY_NAME = /(^|[._-])(main|app|application|server|program|startup|index|lambda|handler|function|cli)$|(controller|resource|router|routes?|handlers?|listener|consumer|subscriber|endpoints?|api|job|scheduler|worker|webhook|servlet|page|screen|view)$/i;
|
|
@@ -3548,7 +4672,7 @@ var BUILD_FILE = /^(pom\.xml|build\.gradle(\.kts)?|settings\.gradle(\.kts)?|pack
|
|
|
3548
4672
|
var AGGREGATOR = /^(pom\.xml|settings\.gradle(\.kts)?|package\.json|pnpm-workspace\.yaml|lerna\.json|Cargo\.toml|go\.work)$/;
|
|
3549
4673
|
var byPath = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
3550
4674
|
var nameOf = (path) => path.slice(path.lastIndexOf("/") + 1);
|
|
3551
|
-
var
|
|
4675
|
+
var dirOf2 = (path) => path.includes("/") ? path.slice(0, path.lastIndexOf("/")) : "";
|
|
3552
4676
|
var under = (path, dir) => !dir || path.startsWith(`${dir}/`);
|
|
3553
4677
|
var quoted = (s) => [...s.matchAll(/["']([^"'\n]+)["']/g)].map((m) => m[1]);
|
|
3554
4678
|
var clean = (m) => m.trim().replace(/^\.\//, "").replace(/\/pom\.xml$/, "").replace(/\/+$/, "");
|
|
@@ -3562,7 +4686,7 @@ function json(text) {
|
|
|
3562
4686
|
var strings = (v) => Array.isArray(v) ? v.filter((x) => typeof x === "string") : [];
|
|
3563
4687
|
function buildModules(path, text) {
|
|
3564
4688
|
const name = nameOf(path);
|
|
3565
|
-
const dir =
|
|
4689
|
+
const dir = dirOf2(path);
|
|
3566
4690
|
let found = [];
|
|
3567
4691
|
if (name === "pom.xml")
|
|
3568
4692
|
found = [...text.matchAll(/<module>\s*([^<]+?)\s*<\/module>/g)].map((m) => m[1]);
|
|
@@ -3618,11 +4742,11 @@ function packageRoots(paths, inits, read) {
|
|
|
3618
4742
|
let readCount = 0;
|
|
3619
4743
|
for (const p of paths) {
|
|
3620
4744
|
if (/\.py$/i.test(p)) {
|
|
3621
|
-
let d =
|
|
4745
|
+
let d = dirOf2(p);
|
|
3622
4746
|
let top;
|
|
3623
4747
|
while (d && inits.has(d)) {
|
|
3624
4748
|
top = d;
|
|
3625
|
-
d =
|
|
4749
|
+
d = dirOf2(d);
|
|
3626
4750
|
}
|
|
3627
4751
|
if (top)
|
|
3628
4752
|
roots.add(nameOf(top).toLowerCase());
|
|
@@ -3641,7 +4765,7 @@ function vendoredProjects(all2, read) {
|
|
|
3641
4765
|
const licenses = /* @__PURE__ */ new Map();
|
|
3642
4766
|
const builds = /* @__PURE__ */ new Map();
|
|
3643
4767
|
for (const p of files) {
|
|
3644
|
-
const d =
|
|
4768
|
+
const d = dirOf2(p);
|
|
3645
4769
|
if (LICENSE_FILE.test(nameOf(p)) && !licenses.has(d))
|
|
3646
4770
|
licenses.set(d, p);
|
|
3647
4771
|
if (BUILD_FILE.test(nameOf(p)))
|
|
@@ -3652,7 +4776,7 @@ function vendoredProjects(all2, read) {
|
|
|
3652
4776
|
for (const p of files)
|
|
3653
4777
|
if (AGGREGATOR.test(nameOf(p)))
|
|
3654
4778
|
for (const m of buildModules(p, read(p) ?? ""))
|
|
3655
|
-
modules.push({ from:
|
|
4779
|
+
modules.push({ from: dirOf2(p), re: globToRegExp(m) });
|
|
3656
4780
|
}
|
|
3657
4781
|
const included = (dir) => modules.some((m) => m.from !== dir && under(dir, m.from) && m.re.test(dir));
|
|
3658
4782
|
const nested = [];
|
|
@@ -3672,7 +4796,7 @@ function vendoredProjects(all2, read) {
|
|
|
3672
4796
|
}
|
|
3673
4797
|
const out = [...nested];
|
|
3674
4798
|
if (copied.length) {
|
|
3675
|
-
const inits = new Set(files.filter((p) => nameOf(p) === "__init__.py").map(
|
|
4799
|
+
const inits = new Set(files.filter((p) => nameOf(p) === "__init__.py").map(dirOf2));
|
|
3676
4800
|
const apart = [...copied, ...nested.map((n) => n.dir)];
|
|
3677
4801
|
const text = read ?? (() => void 0);
|
|
3678
4802
|
const mine = packageRoots(files.filter((p) => !apart.some((d) => under(p, d))), inits, text);
|
|
@@ -3833,11 +4957,11 @@ function unitsOf(dir, fs, room) {
|
|
|
3833
4957
|
const children = /* @__PURE__ */ new Map();
|
|
3834
4958
|
for (const f of fs) {
|
|
3835
4959
|
const rest = f.path.slice(prefix.length);
|
|
3836
|
-
const
|
|
3837
|
-
if (
|
|
4960
|
+
const slash2 = rest.indexOf("/");
|
|
4961
|
+
if (slash2 < 0)
|
|
3838
4962
|
direct.push(f);
|
|
3839
4963
|
else {
|
|
3840
|
-
const child = prefix + rest.slice(0,
|
|
4964
|
+
const child = prefix + rest.slice(0, slash2);
|
|
3841
4965
|
children.set(child, [...children.get(child) ?? [], f]);
|
|
3842
4966
|
}
|
|
3843
4967
|
}
|
|
@@ -3854,11 +4978,11 @@ function groupUnits(dir, fs, room, holds) {
|
|
|
3854
4978
|
const children = /* @__PURE__ */ new Map();
|
|
3855
4979
|
for (const f of fs) {
|
|
3856
4980
|
const rest = f.path.slice(prefix.length);
|
|
3857
|
-
const
|
|
3858
|
-
if (
|
|
4981
|
+
const slash2 = rest.indexOf("/");
|
|
4982
|
+
if (slash2 < 0)
|
|
3859
4983
|
direct.push(f);
|
|
3860
4984
|
else {
|
|
3861
|
-
const child = prefix + rest.slice(0,
|
|
4985
|
+
const child = prefix + rest.slice(0, slash2);
|
|
3862
4986
|
children.set(child, [...children.get(child) ?? [], f]);
|
|
3863
4987
|
}
|
|
3864
4988
|
}
|
|
@@ -4486,7 +5610,8 @@ function lineLegend(marks) {
|
|
|
4486
5610
|
}
|
|
4487
5611
|
return "modify";
|
|
4488
5612
|
}
|
|
4489
|
-
function changeView(records2, change, flows, known = []) {
|
|
5613
|
+
function changeView(records2, change, flows, known = [], retired = []) {
|
|
5614
|
+
const gone = new Set(retired);
|
|
4490
5615
|
const c = new Catalog(records2);
|
|
4491
5616
|
const inSpecs = new Set(known);
|
|
4492
5617
|
const isKnown = (id) => c.components.has(id) || c.isSystem(id) || inSpecs.has(id);
|
|
@@ -4523,6 +5648,9 @@ function changeView(records2, change, flows, known = []) {
|
|
|
4523
5648
|
}
|
|
4524
5649
|
}
|
|
4525
5650
|
}
|
|
5651
|
+
for (const id of gone)
|
|
5652
|
+
if (comps.has(id))
|
|
5653
|
+
legends.set(id, "retire");
|
|
4526
5654
|
const withMark = (id) => {
|
|
4527
5655
|
const l = legends.get(id);
|
|
4528
5656
|
return l ? { legend: l } : {};
|
|
@@ -5130,13 +6258,22 @@ var HOW_OF_FLAG = {
|
|
|
5130
6258
|
// ADR 0160 (O3): answered by an entry of another team's shared map.
|
|
5131
6259
|
[JOINED_TO_SHARED_MAP]: "shared"
|
|
5132
6260
|
};
|
|
5133
|
-
var
|
|
6261
|
+
var NOT_VERIFYING_FLAGS = /* @__PURE__ */ new Set([
|
|
6262
|
+
...JOIN_GUESS_FLAGS,
|
|
6263
|
+
JOINED_BY_PERSON,
|
|
6264
|
+
JOINED_BY_AI,
|
|
6265
|
+
JOINED_BY_PATH_OVERLAP
|
|
6266
|
+
]);
|
|
6267
|
+
var ALSO_OF_FLAG = {
|
|
6268
|
+
...HOW_OF_FLAG,
|
|
6269
|
+
[JOINED_BY_PATH_OVERLAP]: "path"
|
|
6270
|
+
};
|
|
5134
6271
|
function joinHow(i) {
|
|
5135
6272
|
const flags = i.flags ?? [];
|
|
5136
6273
|
const topic = i.via === "event-bus" || i.via === "mq";
|
|
5137
6274
|
if (i.confidence === "verified") {
|
|
5138
6275
|
for (const f of flags)
|
|
5139
|
-
if (HOW_OF_FLAG[f] && !
|
|
6276
|
+
if (HOW_OF_FLAG[f] && !NOT_VERIFYING_FLAGS.has(f))
|
|
5140
6277
|
return HOW_OF_FLAG[f];
|
|
5141
6278
|
if (topic)
|
|
5142
6279
|
return "topic";
|
|
@@ -5148,12 +6285,17 @@ function joinHow(i) {
|
|
|
5148
6285
|
return "topic";
|
|
5149
6286
|
return "unknown";
|
|
5150
6287
|
}
|
|
5151
|
-
var GUESS_HOWS = new Set(
|
|
6288
|
+
var GUESS_HOWS = new Set([...NOT_VERIFYING_FLAGS].map((f) => HOW_OF_FLAG[f]).filter(Boolean));
|
|
5152
6289
|
function alsoOf(i, how) {
|
|
5153
6290
|
if (i.confidence !== "verified" || GUESS_HOWS.has(how))
|
|
5154
6291
|
return [];
|
|
6292
|
+
const flags = i.flags ?? [];
|
|
6293
|
+
const byBase = how !== "base-path" && flags.includes(JOINED_BY_BASE_PATH);
|
|
5155
6294
|
return [
|
|
5156
|
-
...new Set(
|
|
6295
|
+
...new Set(flags.flatMap((f) => {
|
|
6296
|
+
const also = byBase && f === JOINED_BY_PATH ? "base-path" : ALSO_OF_FLAG[f];
|
|
6297
|
+
return NOT_VERIFYING_FLAGS.has(f) && also && also !== how ? [also] : [];
|
|
6298
|
+
}))
|
|
5157
6299
|
];
|
|
5158
6300
|
}
|
|
5159
6301
|
function joinOf(i) {
|
|
@@ -5227,6 +6369,17 @@ var props = (o) => {
|
|
|
5227
6369
|
var all = (rs, k) => rs.filter((r) => r.kind === k).sort((a, b) => a.id < b.id ? -1 : a.id > b.id ? 1 : 0);
|
|
5228
6370
|
function dependencyJoin(l) {
|
|
5229
6371
|
const lines = (end) => end.lines.map((at) => ({ source: "code", repo: end.repo, at }));
|
|
6372
|
+
const facts = l.facts?.length ? l.facts : [l.from];
|
|
6373
|
+
const caller = [];
|
|
6374
|
+
for (const f of facts)
|
|
6375
|
+
for (const e of lines(f))
|
|
6376
|
+
if (!caller.some((x) => x.repo === e.repo && x.at === e.at))
|
|
6377
|
+
caller.push(e);
|
|
6378
|
+
const callee = [];
|
|
6379
|
+
for (const p of l.published?.length ? l.published : [l.to])
|
|
6380
|
+
for (const e of lines(p))
|
|
6381
|
+
if (!callee.some((x) => x.repo === e.repo && x.at === e.at))
|
|
6382
|
+
callee.push(e);
|
|
5230
6383
|
return {
|
|
5231
6384
|
interface: dependencyLinkId(l),
|
|
5232
6385
|
from: l.from.component,
|
|
@@ -5235,15 +6388,25 @@ function dependencyJoin(l) {
|
|
|
5235
6388
|
gateway: false,
|
|
5236
6389
|
// code at both ends, each claim checked on its line, and nobody had to guess
|
|
5237
6390
|
verified: true,
|
|
5238
|
-
caller
|
|
5239
|
-
callee
|
|
6391
|
+
caller,
|
|
6392
|
+
callee,
|
|
5240
6393
|
hops: [],
|
|
5241
6394
|
other: [],
|
|
5242
6395
|
dependency: {
|
|
5243
6396
|
group: l.group,
|
|
5244
6397
|
name: l.name,
|
|
5245
6398
|
...l.version ? { version: l.version } : {},
|
|
5246
|
-
...l.scope ? { scope: l.scope } : {}
|
|
6399
|
+
...l.scope ? { scope: l.scope } : {},
|
|
6400
|
+
facts: facts.map((f) => ({
|
|
6401
|
+
repo: f.repo,
|
|
6402
|
+
fact: f.fact,
|
|
6403
|
+
at: f.at,
|
|
6404
|
+
lines: f.lines,
|
|
6405
|
+
...f.group !== void 0 ? { group: f.group } : {},
|
|
6406
|
+
...f.name !== void 0 ? { name: f.name } : {},
|
|
6407
|
+
...f.version !== void 0 ? { version: f.version } : {},
|
|
6408
|
+
...f.scope !== void 0 ? { scope: f.scope } : {}
|
|
6409
|
+
}))
|
|
5247
6410
|
}
|
|
5248
6411
|
};
|
|
5249
6412
|
}
|
|
@@ -6781,6 +7944,7 @@ export {
|
|
|
6781
7944
|
frameworkGaps,
|
|
6782
7945
|
frameworksToLearn,
|
|
6783
7946
|
readRulesOf,
|
|
7947
|
+
keyIsSecret,
|
|
6784
7948
|
lineRangeOf,
|
|
6785
7949
|
parseReviewed,
|
|
6786
7950
|
readingRank,
|
|
@@ -6793,6 +7957,7 @@ export {
|
|
|
6793
7957
|
isEntryPointFile,
|
|
6794
7958
|
NOT_REACHED_WHY,
|
|
6795
7959
|
reachableModels,
|
|
7960
|
+
factAsRead,
|
|
6796
7961
|
sameCommit,
|
|
6797
7962
|
staleMessage,
|
|
6798
7963
|
verifyFacts,
|