@visulima/vis 1.0.0-alpha.9 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1854 -3
- package/LICENSE.md +13515 -10
- package/README.md +215 -39
- package/bin/resolve-binary.mjs +85 -0
- package/bin/vis.mjs +76 -0
- package/dashboard/dist/index.html +152 -0
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +1 -2
- package/dist/binx.js +3 -0
- package/dist/config/index.d.ts +3276 -0
- package/dist/config/index.js +1 -0
- package/dist/generate/index.d.ts +1 -1
- package/dist/generate/index.js +1 -1
- package/dist/packem_chunks/CONFIG_FILES.js +8 -0
- package/dist/packem_chunks/DEFAULT_CLEAN_KEEP.js +1 -0
- package/dist/packem_chunks/agent-instructions.js +11 -0
- package/dist/packem_chunks/bloom-status.js +2 -0
- package/dist/packem_chunks/bloom-sync.js +2 -0
- package/dist/packem_chunks/cache-attestation.js +1 -0
- package/dist/packem_chunks/catalog-detector.js +1 -0
- package/dist/packem_chunks/catalog.js +114 -0
- package/dist/packem_chunks/cli-exec.js +1 -0
- package/dist/packem_chunks/cli-main.js +268 -0
- package/dist/packem_chunks/defineReleasePlugin.js +3 -0
- package/dist/packem_chunks/detect.js +3 -0
- package/dist/packem_chunks/detect2.js +8 -0
- package/dist/packem_chunks/devtools.js +4 -0
- package/dist/packem_chunks/discord.js +4 -0
- package/dist/packem_chunks/dispatch.js +4 -0
- package/dist/packem_chunks/doctor-probe.js +2 -0
- package/dist/packem_chunks/dynamic-import.js +1 -0
- package/dist/packem_chunks/extra-files.js +3 -0
- package/dist/packem_chunks/fix.js +11 -0
- package/dist/packem_chunks/git.js +3 -0
- package/dist/packem_chunks/group-tags.js +1 -0
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +5 -1
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +26 -152
- package/dist/packem_chunks/handler13.js +5 -1
- package/dist/packem_chunks/handler14.js +1 -3
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -2
- package/dist/packem_chunks/handler17.js +1 -7
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +5 -19
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +2 -428
- package/dist/packem_chunks/handler21.js +2 -22
- package/dist/packem_chunks/handler22.js +14 -3
- package/dist/packem_chunks/handler23.js +1 -5
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -20
- package/dist/packem_chunks/handler26.js +5 -1
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +3 -1
- package/dist/packem_chunks/handler29.js +1 -2
- package/dist/packem_chunks/handler3.js +4 -2
- package/dist/packem_chunks/handler30.js +1 -22
- package/dist/packem_chunks/handler31.js +2 -1
- package/dist/packem_chunks/handler32.js +2 -1
- package/dist/packem_chunks/handler33.js +2 -37
- package/dist/packem_chunks/handler34.js +3 -3
- package/dist/packem_chunks/handler35.js +6 -23
- package/dist/packem_chunks/handler36.js +1 -5
- package/dist/packem_chunks/handler37.js +36 -21
- package/dist/packem_chunks/handler38.js +8 -1
- package/dist/packem_chunks/handler39.js +9 -2
- package/dist/packem_chunks/handler4.js +4 -5
- package/dist/packem_chunks/handler40.js +75 -1
- package/dist/packem_chunks/handler41.js +5 -5
- package/dist/packem_chunks/handler42.js +4 -1
- package/dist/packem_chunks/handler43.js +3 -24
- package/dist/packem_chunks/handler44.js +2 -3
- package/dist/packem_chunks/handler45.js +1 -1
- package/dist/packem_chunks/handler46.js +1 -0
- package/dist/packem_chunks/handler47.js +1 -0
- package/dist/packem_chunks/handler48.js +3 -0
- package/dist/packem_chunks/handler49.js +1 -0
- package/dist/packem_chunks/handler5.js +6 -4
- package/dist/packem_chunks/handler50.js +7 -0
- package/dist/packem_chunks/handler51.js +33 -0
- package/dist/packem_chunks/handler52.js +3 -0
- package/dist/packem_chunks/handler53.js +8 -0
- package/dist/packem_chunks/handler54.js +4 -0
- package/dist/packem_chunks/handler55.js +1 -0
- package/dist/packem_chunks/handler56.js +12 -0
- package/dist/packem_chunks/handler57.js +11 -0
- package/dist/packem_chunks/handler58.js +5 -0
- package/dist/packem_chunks/handler59.js +11 -0
- package/dist/packem_chunks/handler6.js +8 -2
- package/dist/packem_chunks/handler60.js +3 -0
- package/dist/packem_chunks/handler61.js +22 -0
- package/dist/packem_chunks/handler62.js +61 -0
- package/dist/packem_chunks/handler63.js +3 -0
- package/dist/packem_chunks/handler64.js +6 -0
- package/dist/packem_chunks/handler65.js +9 -0
- package/dist/packem_chunks/handler66.js +2 -0
- package/dist/packem_chunks/handler67.js +24 -0
- package/dist/packem_chunks/handler68.js +25 -0
- package/dist/packem_chunks/handler69.js +153 -0
- package/dist/packem_chunks/handler7.js +1 -24
- package/dist/packem_chunks/handler70.js +10 -0
- package/dist/packem_chunks/handler71.js +23 -0
- package/dist/packem_chunks/handler72.js +322 -0
- package/dist/packem_chunks/handler73.js +708 -0
- package/dist/packem_chunks/handler74.js +48 -0
- package/dist/packem_chunks/handler75.js +27 -0
- package/dist/packem_chunks/handler76.js +3 -0
- package/dist/packem_chunks/handler77.js +190 -0
- package/dist/packem_chunks/handler78.js +38 -0
- package/dist/packem_chunks/handler8.js +1 -6
- package/dist/packem_chunks/handler9.js +1 -8
- package/dist/packem_chunks/heal-accept.js +10 -0
- package/dist/packem_chunks/heal.js +14 -0
- package/dist/packem_chunks/help-command.js +31 -0
- package/dist/packem_chunks/index.js +1 -7
- package/dist/packem_chunks/index2.js +802 -0
- package/dist/packem_chunks/index3.js +7 -0
- package/dist/packem_chunks/index4.js +135 -0
- package/dist/packem_chunks/index5.js +73 -0
- package/dist/packem_chunks/interface.js +2 -0
- package/dist/packem_chunks/keys-refresh.js +4 -0
- package/dist/packem_chunks/lean.js +4 -0
- package/dist/packem_chunks/list.js +3 -0
- package/dist/packem_chunks/loader.js +4 -1
- package/dist/packem_chunks/loader2.js +1 -0
- package/dist/packem_chunks/orchestrator.js +42 -0
- package/dist/packem_chunks/pre-mode.js +2 -0
- package/dist/packem_chunks/print-config.js +2 -0
- package/dist/packem_chunks/prompts.js +7 -0
- package/dist/packem_chunks/prune.js +3 -0
- package/dist/packem_chunks/publish-guards.js +1 -0
- package/dist/packem_chunks/registry.js +48 -0
- package/dist/packem_chunks/resolveFormatter.js +9 -0
- package/dist/packem_chunks/run.js +1 -0
- package/dist/packem_chunks/security.js +1 -0
- package/dist/packem_chunks/shell-runner.js +1 -0
- package/dist/packem_chunks/slack.js +2 -0
- package/dist/packem_chunks/snapshot.js +2 -0
- package/dist/packem_chunks/stage-publisher.js +1 -0
- package/dist/packem_chunks/staged-registry.js +2 -0
- package/dist/packem_chunks/state.js +3 -0
- package/dist/packem_chunks/status.js +2 -0
- package/dist/packem_chunks/success-walk.js +8 -0
- package/dist/packem_chunks/sync.js +2 -0
- package/dist/packem_chunks/sync2.js +2 -0
- package/dist/packem_chunks/tar.js +3 -0
- package/dist/packem_chunks/tripwire.js +2 -0
- package/dist/packem_chunks/ts-loader.js +22 -0
- package/dist/packem_chunks/verify-lockfile.js +2 -0
- package/dist/packem_chunks/version-resolver.js +2 -0
- package/dist/packem_chunks/webhook.js +1 -0
- package/dist/packem_chunks/workflow-templates.js +167 -0
- package/dist/packem_chunks/workspace.js +2 -0
- package/dist/packem_shared/AfterAllProjectsVersioned-CAKI2nWf.js +1 -0
- package/dist/packem_shared/MultiSpinner-B9U0-aE3-B-gIXhFk.js +3 -0
- package/dist/packem_shared/ReleaseClient-BY4OZNCK.js +1 -0
- package/dist/packem_shared/Table-BGIHvenQ-D2oJtNQj.js +34 -0
- package/dist/packem_shared/VisReleaseError-DMGRBTNO.js +1 -0
- package/dist/packem_shared/_commonjsHelpers-B5Y90VFO.js +1 -0
- package/dist/packem_shared/advisories-CaP4uNhD.js +1 -0
- package/dist/packem_shared/affected-shas-BfO3PDJq.js +1 -0
- package/dist/packem_shared/ai-analysis-CO7No4rt.js +68 -0
- package/dist/packem_shared/ai-fix-B4u2zlVG.js +43 -0
- package/dist/packem_shared/anolilab-text-CAM_E6uK.js +13 -0
- package/dist/packem_shared/api.d-BPftyU9r.d.ts +27 -0
- package/dist/packem_shared/augment-8z86AwtF.js +4 -0
- package/dist/packem_shared/bin-Cv8vsMEo.js +1 -0
- package/dist/packem_shared/build-scripts-D477Ou-x.js +1 -0
- package/dist/packem_shared/command-runtime-EWjmSxPj.js +1 -0
- package/dist/packem_shared/compile-cache-B_Vf_WxT.js +3 -0
- package/dist/packem_shared/createAdapter-bU4DIP3F.js +1 -0
- package/dist/packem_shared/createVersionActions-BK43SNDH.js +1 -0
- package/dist/packem_shared/cyclonedx-CDWHbD9s.js +4 -0
- package/dist/packem_shared/defineFormatter-D5dCp6Kv.js +1 -0
- package/dist/packem_shared/definePlugin-DoUcoYSy.js +1 -0
- package/dist/packem_shared/dependency-scan-P52jY0pU.js +1 -0
- package/dist/packem_shared/docker-CD7o1D1o.js +59 -0
- package/dist/packem_shared/env-Cpxa_7UE.js +27 -0
- package/dist/packem_shared/failure-log-MOhz-TBv.js +2 -0
- package/dist/packem_shared/giget-DVTFJlbR.js +2 -0
- package/dist/packem_shared/glob-DMbPwGSj-uzODoE-1.js +1 -0
- package/dist/packem_shared/index-B0EsgdzO.js +1 -0
- package/dist/packem_shared/index-BAUIIRZJ.js +1 -0
- package/dist/packem_shared/index-BVuCxe14.js +22 -0
- package/dist/packem_shared/index-CdTXvj-V.js +1 -0
- package/dist/packem_shared/index-CgXLAAVI.js +28 -0
- package/dist/packem_shared/index-DjTWo3sH.js +1 -0
- package/dist/packem_shared/index.server-J83sowC4.js +2 -0
- package/dist/packem_shared/interface.d-B7VK2rcH.d.ts +148 -0
- package/dist/packem_shared/interface.d-Cezzifoh.d.ts +106 -0
- package/dist/packem_shared/license-t5KnNX6v.js +1 -0
- package/dist/packem_shared/lifecycle-hzwghh5a.js +2 -0
- package/dist/packem_shared/lockfile-CWcVTdRc.js +1 -0
- package/dist/packem_shared/main-B3juSU5z.js +1 -0
- package/dist/packem_shared/manifests-CaPqgQxW.js +1 -0
- package/dist/packem_shared/min-release-age-skpcnlpk.js +34 -0
- package/dist/packem_shared/missing-package-json-_hOp4AW5.js +1 -0
- package/dist/packem_shared/native-config-sync-CFi1iQNG.js +21 -0
- package/dist/packem_shared/osv-bloom-BAyJUnRx.js +2 -0
- package/dist/packem_shared/otelPlugin-DmKDBaPo.js +1 -0
- package/dist/packem_shared/packument-CYxvm590.js +1 -0
- package/dist/packem_shared/peer-warnings-BXAzXqY3.js +1 -0
- package/dist/packem_shared/plugins.d-ND23R9I3.d.ts +4 -0
- package/dist/packem_shared/pm-runner-mVFjedM6.js +1 -0
- package/dist/packem_shared/prompt-DjXHVgYU.js +1 -0
- package/dist/packem_shared/provenance-CI_WQx7G.js +1 -0
- package/dist/packem_shared/public-api-WqUCiyIe.js +131 -0
- package/dist/packem_shared/readJsonSync-DuMMeB3s-Cx08VBQg.js +1 -0
- package/dist/packem_shared/registry-keys-AGlSEY6R.js +1 -0
- package/dist/packem_shared/resolve-explicit-DVE9cfkm.js +5 -0
- package/dist/packem_shared/resolve-runtime-CGHf-wHz.js +1 -0
- package/dist/packem_shared/run-file-Bs_E9O6O.js +1 -0
- package/dist/packem_shared/runtime-check-pS2XH4BO.js +1 -0
- package/dist/packem_shared/runtime-process-Dmz0vCJy-DUwTvH1J.js +1 -0
- package/dist/packem_shared/s1ngularity-xmrq5T5r.js +1 -0
- package/dist/packem_shared/scan-progress-DQ4TMXcb.js +2 -0
- package/dist/packem_shared/selectors-CRgS4bU9.js +3 -0
- package/dist/packem_shared/signatures-Dp3th1DB.js +2 -0
- package/dist/packem_shared/slug-DoueYuLo.js +1 -0
- package/dist/packem_shared/spinner-DuJJvFTl.js +1 -0
- package/dist/packem_shared/sticky-comment-D6_7-w8T.js +1 -0
- package/dist/packem_shared/subtree-C7bZuiSQ.js +2 -0
- package/dist/packem_shared/symbols-DPTlrJ3B.js +1 -0
- package/dist/packem_shared/tabs-CgxCvjCY.js +1 -0
- package/dist/packem_shared/target-merge-D2eTghgd.js +11 -0
- package/dist/packem_shared/target-options-TM6ETDAS.js +1 -0
- package/dist/packem_shared/toolchain-B5KwUZfq.js +5 -0
- package/dist/packem_shared/typosquats-C0layQsP.js +1 -0
- package/dist/packem_shared/use-measured-height-Drobr4fe.js +1 -0
- package/dist/packem_shared/utils-CRueU43T.js +1 -0
- package/dist/packem_shared/verify-Cjo4EBFZ.js +1 -0
- package/dist/packem_shared/vis-update-app-qIkyvrd1.js +1 -0
- package/dist/packem_shared/watch-BnE1TzYn.js +1 -0
- package/dist/packem_shared/watch-loop-Irf3Pm-1.js +11 -0
- package/dist/release/core/changelog/index.d.ts +5 -0
- package/dist/release/core/changelog/index.js +1 -0
- package/dist/release/core/package-managers/index.d.ts +6 -0
- package/dist/release/core/package-managers/index.js +1 -0
- package/dist/release/core/version-actions/index.d.ts +14 -0
- package/dist/release/core/version-actions/index.js +1 -0
- package/dist/release/index.d.ts +233 -0
- package/dist/release/index.js +1 -0
- package/dist/release/plugin-sdk.d.ts +128 -0
- package/dist/release/plugin-sdk.js +1 -0
- package/dist/release/presets.d.ts +225 -0
- package/dist/release/presets.js +1 -0
- package/dist/release/types.d.ts +1493 -0
- package/dist/release/types.js +1 -0
- package/dist/runtime/preload.d.ts +1 -0
- package/dist/runtime/preload.js +1 -0
- package/index.d.ts +450 -0
- package/index.js +663 -556
- package/package.json +105 -62
- package/schemas/project.schema.json +872 -225
- package/schemas/vis-config.schema.json +6309 -264
- package/schemas/vis-release-config.schema.json +1423 -0
- package/skills/vis/SKILL.md +96 -0
- package/templates/buildkite-ci/.buildkite/pipeline.yml.tera +85 -0
- package/templates/buildkite-ci/template.yml +20 -0
- package/dist/config.d.ts +0 -1087
- package/dist/config.js +0 -1
- package/dist/packem_shared/VisUpdateApp-BBx3idMI.js +0 -1
- package/dist/packem_shared/ai-analysis-DDqXRFxY.js +0 -67
- package/dist/packem_shared/bin-BaZZ32BK.js +0 -93
- package/dist/packem_shared/cache-directory-DL8hfXeG.js +0 -1
- package/dist/packem_shared/catalog-CuSpuB_R.js +0 -12
- package/dist/packem_shared/dependency-scan-BoLG2Fez.js +0 -1
- package/dist/packem_shared/docker-BcfqH4Av.js +0 -2
- package/dist/packem_shared/flakiness-DSIHZGBT.js +0 -1
- package/dist/packem_shared/otelPlugin-DxyvBcXO.js +0 -1
- package/dist/packem_shared/runtime-check-CGHal8SO.js +0 -1
- package/dist/packem_shared/selectors-CfH9ZY08.js +0 -3
- package/dist/packem_shared/symbols-CIMw60-G.js +0 -1
- package/dist/packem_shared/toolchain-C3ZG0o_X.js +0 -5
- package/dist/packem_shared/typosquats-Bpq4zcWL.js +0 -1
- package/dist/packem_shared/utils-DrNg0XTR.js +0 -1
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
`));return}throw new Error(`Unknown subcommand: "${n}". Expected scaffold or prune.`)},"execute");export{P as default};
|
|
1
|
+
import{h as m,S as p}from"../packem_shared/pm-runner-mVFjedM6.js";import{r as g,a as d}from"../packem_shared/command-runtime-EWjmSxPj.js";const u=async({argument:s,logger:e,options:r,visConfig:o,workspaceRoot:t})=>{const c=s?.[0]??null,n=t??process.cwd(),i=g({logger:e,options:r,visConfig:o},n),l=m(n,{backend:d(i),configBackend:o?.install?.backend,configCorepack:o?.install?.corepack}),a=p(l,c,n,e);a!==0&&(process.exitCode=a)};export{u as default};
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
${C("VIS DOCTOR")} — project health check
|
|
3
|
-
`),e(` ${p(!0)} Detected ${n.name} v${n.version}`);const l=E(i);l.length>0&&e(` ${p(!0)} ${String(l.length)} workspace package${l.length===1?"":"s"}`);const u=ce(i);if(u.length===0)e(` ${p(!0)} Runtime: Node.js ${process.versions.node} ${x("✓")}`);else{for(const r of u){const f=r.severity==="error"?J:T;e(` ${p(!1)} Runtime: ${f(r.message)}`)}j(` Run ${x("vis toolchain install")} to install pinned versions, or ${x("vis toolchain status")} for the per-tool breakdown.`)}e(`
|
|
4
|
-
Scanning...`);const t=await ue(i,w,!!a.fix);let k=0,h=0,g=0,$=0;for(const r of t.optimizations)switch(r.category){case"micro-utility":{g++;break}case"native":{k++;break}case"preferred":{h++;break}case"socket":{$++;break}}if(a.format==="json"||a.json){process.stdout.write(`${JSON.stringify({dependencies:{duplicates:t.duplicates.length,installed:t.installedCount,outdated:t.outdated.length},optimizations:{microUtilities:g,native:k,preferred:h,socket:$,total:t.optimizations.length},packageManager:n.name,security:{alerts:t.socketIssues.alerts,lowScorePackages:t.socketIssues.lowScore,vulnerabilities:t.vulnCount},workspaces:t.workspaceCount},void 0,2)}
|
|
5
|
-
`),a.exitCode&&(t.vulnCount>0||t.socketIssues.alerts>0)&&(process.exitCode=1);return}if(pe(t),a.fix&&t.optimizations.length>0){e(""),e(`Applying fixes...
|
|
6
|
-
`);const r=t.optimizations.filter(o=>o.category==="socket"&&o.overrideSpec).map(o=>({original:o.packageName,spec:o.overrideSpec}));if(r.length>0){const o=re(i,N(i,"package.json"),r,n);o.added.length>0&&b(` Added ${String(o.added.length)} security override${o.added.length===1?"":"s"}.`),o.updated.length>0&&b(` Updated ${String(o.updated.length)} override${o.updated.length===1?"":"s"}.`)}const f=t.optimizations.filter(o=>o.category!=="socket"&&o.hasCodemod);for(const o of f){const v=await le(i,o.packageName);v.filesChanged>0&&b(` ${o.packageName}: ${String(v.filesChanged)} file${v.filesChanged===1?"":"s"} updated`)}r.length>0&&(e(`
|
|
7
|
-
Running ${n.name} install to update lockfile...`),se(n,{dev:!1,filter:[],force:!1,frozenLockfile:!1,ignoreScripts:!1,lockfileOnly:!1,noOptional:!1,offline:!1,prod:!1,recursive:!1,silent:!1,workspaceRoot:!1},i,s)),e(""),b("Fixes applied.")}else ge(t);a.exitCode&&(a.strict?t.vulnCount>0||t.socketIssues.alerts>0||t.outdated.length>0||t.duplicates.length>0:t.vulnCount>0||t.socketIssues.alerts>0)&&(process.exitCode=1)},"execute");export{Ce as default};
|
|
1
|
+
import{h as f,U as k}from"../packem_shared/pm-runner-mVFjedM6.js";import{r as h,a as w}from"../packem_shared/command-runtime-EWjmSxPj.js";const C=async({argument:c,logger:a,options:t,rawUnknown:l,visConfig:n,workspaceRoot:p})=>{const o=c;if(!o||o.length===0)throw new Error("No subcommand specified. Available: cache, publish, audit, list, view, config, whoami, login, logout, pack, owner, dist-tag, search, fund, ping, token, deprecate, rebuild, prune, plugin");const[d,...i]=o,s=l??[],g=s[0]==="--"?i:[...i,...s],e=p??process.cwd(),u=h({logger:a,options:t,visConfig:n},e),m=f(e,{backend:w(u),configBackend:n?.install?.backend,configCorepack:n?.install?.corepack}),r=k(m,d,g,e,a);r!==0&&(process.exitCode=r)};export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{h as f,E as g}from"../packem_shared/pm-runner-mVFjedM6.js";import{r as k,a as m}from"../packem_shared/command-runtime-EWjmSxPj.js";import{c as v,i as d}from"../packem_shared/utils-CRueU43T.js";const b=async({argument:c,logger:a,options:e,rawUnknown:t,visConfig:o,workspaceRoot:r})=>{const n=v(c,t);if(n.length===0)throw new Error("No packages specified. Usage: vis remove <packages...>");const s=process.cwd(),l=k({logger:a,options:e,visConfig:o},r??s),p=f(r??s,{backend:m(l),configBackend:o?.install?.backend,configCorepack:o?.install?.corepack}),i=g(p,{filter:d(e.filter),global:e.global||!1,packages:n,recursive:e.recursive||!1,saveDev:e.saveDev||!1,workspaceRoot:e.workspaceRoot||!1},s,a);i!==0&&(process.exitCode=i)};export{b as default};
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
`)
|
|
3
|
-
`)}
|
|
4
|
-
|
|
5
|
-
`)}},
|
|
6
|
-
`);for(const[o,a]of r.entries()){const n=b(S(` ${String(o+1)}.`)),i=s.includes(a)?l(" (default)"):"";process.stderr.write(`${n} ${a}${i}
|
|
7
|
-
`)}for(;;){const o=await B(t,`
|
|
8
|
-
${l("Enter choices:")} `);if(o===""&&s.length>0)return s;const a=o.split(",").map(n=>Number.parseInt(n.trim(),10)).filter(n=>Number.isInteger(n)&&n>=1&&n<=r.length);if(a.length>0)return a.map(n=>r[n-1]);process.stderr.write(` ${l("Invalid choice. Try again.")}
|
|
9
|
-
`)}},"selectMany"),Ie=h(t=>` ${l(`${t}:`)} `,"promptText"),Pe=h((t,e)=>e.prompt??t,"variableLabel"),De=h(t=>Object.entries(t).sort(([e,r],[s,o])=>{const a=r.order??0,n=o.order??0;return a!==n?a-n:e.localeCompare(s)}),"sortVariables"),K=h((t,e)=>{switch(t.type){case"array":return e.split(",").map(r=>r.trim()).filter(Boolean);case"boolean":return e==="true"||e==="1"||e==="yes"||e==="y";case"enum":return t.multiple?e.split(",").map(r=>r.trim()).filter(Boolean):e;case"number":{const r=Number(e);if(Number.isNaN(r))throw new TypeError(`Expected a number, got "${e}"`);return r}default:return e}},"parseValue"),F=h((t,e,r)=>{if(e.type==="enum"){const s=Array.isArray(r)?r:[r];for(const o of s)if(typeof o!="string"||!e.values.includes(o))throw new Error(`Variable "${t}" must be one of: ${e.values.join(", ")} (got "${String(o)}")`)}},"validateValue"),Be=h(async t=>{const{defaults:e,interactive:r,overrides:s,variables:o}=t,a={},n=r?he({input:process.stdin,output:process.stderr}):null;try{for(const[i,c]of De(o)){if(Object.hasOwn(s,i)){const m=K(c,s[i]??"");F(i,c,m),a[i]=m;continue}if(e||!r||c.internal){if(c.default!==void 0){F(i,c,c.default),a[i]=c.default;continue}if(c.required)throw new Error(`Required variable "${i}" not provided. Pass --${i}=<value> or remove --defaults.`);continue}const d=Pe(i,c);let f;if(c.type==="boolean")f=await je(n,d,!!(c.default??!1));else if(c.type==="enum")if(c.multiple){const m=Array.isArray(c.default)?c.default:[];f=await _e(n,d,c.values,m)}else{const m=typeof c.default=="string"?c.default:void 0;f=await xe(n,d,c.values,m)}else{const m=c.default===void 0?"":` (${String(c.default)})`,$=await B(n,Ie(`${d}${m}`));if($===""&&c.default!==void 0)f=c.default;else if($===""){if(c.required)throw new Error(`Variable "${i}" is required`);continue}else f=K(c,$)}F(i,c,f),a[i]=f}return a}finally{n?.close()}},"collectOptions");var We=Object.defineProperty,C=v((t,e)=>We(t,"name",{value:e,configurable:!0}),"o");const Ae=["git://","npm://","https://","github:","gitlab:","bitbucket:","sourcehut:"],Me=C(t=>Ae.some(e=>t.startsWith(e)),"isRemoteSource"),qe=C(async(t,e={})=>{const r=e.targetDirectory===void 0,s=e.targetDirectory??ge(O(we(),"vis-generate-")),o=C(()=>{if(r)try{$e(s,{force:!0,recursive:!0})}catch{}},"cleanup");y(`Downloading ${t}…`);try{const a=await ye(t,{auth:e.auth||process.env.GIGET_AUTH||process.env.GITHUB_TOKEN||process.env.GH_TOKEN||void 0,dir:s,force:!0,preferOffline:e.preferOffline});return{cleanup:o,directory:a.dir}}catch(a){o();const n=a instanceof Error?a.message:String(a);throw j(`Failed to download template: ${n}`),a}},"fetchRemoteTemplate");var Fe=Object.defineProperty,T=v((t,e)=>Fe(t,"name",{value:e,configurable:!0}),"a");const re=T((t,e="")=>{const r=[];for(const[s,o]of Object.entries(t)){const a=e?`${e}/${s}`:s;typeof o=="string"||Buffer.isBuffer(o)?r.push({content:o,path:a}):o&&typeof o=="object"&&r.push(...re(o,a))}return r},"flattenTree"),Ve=T(t=>t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`,"formatSize"),Ce=T((t,e)=>{if(V(e))throw new Error(`Refusing to write outside destination: template produced absolute path "${e}".`);const r=O(t,e),s=z(t,r);if(s===".."||s.startsWith(`..${pe}`)||V(s))throw new Error(`Refusing to write outside destination: "${e}" resolves to "${r}" which escapes "${t}".`);return r},"safeJoinDestination"),Le=T((t,e)=>{Q(ue(t)),me(t,e)},"writeOne"),Ge=T((t,e,r=!1)=>{const s=typeof t=="string"?[t]:t.commands,o=typeof t=="string"?r:t.silent??r;for(const a of s){o||y(`$ ${a}`);const n=ve(a,{cwd:e,shell:!0,stdio:o?"ignore":"inherit"});if(n.status!==0)return j(`Script failed (exit ${String(n.status)}): ${a}`),!1}return!0},"runScript"),Ue=T(t=>{const e=new Map;for(const r of t){const s=typeof r=="string"?0:r.phase??0,o=e.get(s);o?o.push(r):e.set(s,[r])}return[...e.entries()].sort(([r],[s])=>r-s)},"groupByPhase"),Ye=T(async(t,e)=>{const r={builtins:{dest_dir:e.destination,dest_rel_dir:z(e.workspaceRoot,e.destination)||".",working_dir:e.cwd,workspace_root:e.workspaceRoot},options:e.options},s=await t.produce(r),o=s.files?re(s.files):[],a=s.filesMeta??{},n=[];for(const i of o){const c=Ce(e.destination,i.path);n.push({file:i,meta:a[i.path]??{},target:c})}if(e.dryRun){y(`${b(S("Plan"))} ${l("(dry-run, no files written)")}`);for(const i of n){const c=Buffer.isBuffer(i.file.content)?i.file.content.length:Buffer.byteLength(i.file.content,"utf8");process.stderr.write(` ${l("write")} ${i.file.path} ${l(`(${Ve(c)})`)}
|
|
10
|
-
`)}}else{Q(e.destination);let i=0,c=0;for(const d of n){const{file:f,meta:m,target:$}=d,A=P($),w=e.force||m.force===!0;if(A&&!w){j(`Skipped existing file: ${f.path} (use --force or set frontmatter force: true to overwrite)`),c+=1;continue}Le($,f.content),i+=1}X(`Wrote ${String(i)} file${i===1?"":"s"}${c>0?`, skipped ${String(c)}`:""}`)}if(!e.dryRun&&!e.skipScripts&&s.scripts&&s.scripts.length>0){const i=Ue(s.scripts);y(`Running ${String(s.scripts.length)} script${s.scripts.length===1?"":"s"} across ${String(i.length)} phase${i.length===1?"":"s"}…`);for(const[,c]of i)if((await Promise.all(c.map(d=>Promise.resolve(Ge(d,e.destination))))).includes(!1))throw new Error("Script failed — aborting.")}if(s.suggestions&&s.suggestions.length>0){process.stderr.write(`
|
|
11
|
-
`),Z("Next steps:");for(const i of s.suggestions)process.stderr.write(` ${l("•")} ${i}
|
|
12
|
-
`)}},"runTemplate");var He=Object.defineProperty,W=v((t,e)=>He(t,"name",{value:e,configurable:!0}),"u");const Ke=W(t=>{if(t.length===0){y("No templates found."),Z("Create one at .vis/templates/<name>.ts (programmatic) or .vis/templates/<name>/ (moon-format with template.yml).");return}y("Available templates:");for(const e of t){const r=l(`(${e.source})`);process.stderr.write(` ${b(S(e.name))} ${r}
|
|
13
|
-
`)}},"printList"),ze=W(t=>{const e={},r=[];for(const s of t){if(!s.startsWith("--")){r.push(s);continue}const o=s.indexOf("=");if(o===-1){const i=s.slice(2);i.startsWith("no-")?e[i.slice(3)]="false":e[i]="true";continue}const a=s.slice(2,o),n=s.slice(o+1);e[a]=n}return{overrides:e,remaining:r}},"parsePassthroughOverrides"),Je=W(async t=>{const{createInterface:e}=await import("node:readline"),r=e({input:process.stdin,output:process.stderr});try{process.stderr.write(` ${b(S("vis generate"))} ${l("— pick a template")}
|
|
14
|
-
|
|
15
|
-
`);for(const[s,o]of t.entries()){const a=b(S(` ${String(s+1)}.`));process.stderr.write(`${a} ${o.name} ${l(`(${o.source})`)}
|
|
16
|
-
`)}return new Promise((s,o)=>{r.question(`
|
|
17
|
-
${l(`Enter choice (1-${String(t.length)}):`)} `,a=>{const n=Number.parseInt(a.trim(),10);Number.isInteger(n)&&n>=1&&n<=t.length?s(t[n-1].name):o(new Error("Invalid choice."))})})}finally{r.close()}},"pickInteractive"),st=W(async({argument:t,options:e,rawUnknown:r,visConfig:s,workspaceRoot:o})=>{const a=e.cwd||o||process.cwd(),n=o??a,i=s?.generator,c=Array.isArray(t)?t:t?[t]:[];if(e.list){const p=q({extraDirectories:i?.templates??[],onWarning:j,workspaceRoot:n});Ke(p);return}let d=[...r??[]];if(d.length===0){const p=process.argv.slice(2),u=p.indexOf("--");u!==-1&&(d=p.slice(u+1))}const f=c.indexOf("--"),m=f===-1?[]:c.slice(f+1),$=f===-1?c:c.slice(0,f),{overrides:A}=ze([...m,...d]);let w,x,_;const k=$[0];let I;if(k&&Me(k)){const p=await qe(k,{auth:i?.auth,preferOffline:!!e.preferOffline||i?.preferOffline});I=p.cleanup;try{const u=q({extraDirectories:[p.directory],workspaceRoot:n}).find(E=>E.path.startsWith(p.directory));if(!u)throw new Error(`Downloaded template at ${p.directory} contains no template.yml or *.ts entrypoint.`);w=await u.load(),x=u.name,_=w.destination}catch(u){throw I(),I=void 0,u}}else{const p=q({extraDirectories:i?.templates??[],onWarning:j,workspaceRoot:n});if(p.length===0)throw new Error("No templates found. Create one at .vis/templates/<name>.ts or .vis/templates/<name>/template.yml.");let u;if(k)u=k;else{if(e.noInteractive||!process.stdin.isTTY)throw new Error("No template specified. Pass a template name (see `vis generate --list`) or run interactively in a terminal.");u=await Je(p)}const E=p.find(ae=>ae.name===u);if(!E)throw new Error(`Template "${u}" not found. Run 'vis generate --list' to see available templates.`);w=await E.load(),x=E.name,_=w.destination}const L=e.to,G=!!e.dryRun,se=!!e.force,U=!!e.defaults,oe=!!e.skipScripts,ne=!e.noInteractive&&!!process.stdin.isTTY&&!U;let R;L?R=L:_?R=_:R=".";const Y=V(R)?R:de(a,R);y(`Template: ${b(S(x))}`),y(`Target: ${l(Y)}`),process.stderr.write(`
|
|
18
|
-
`);const ie=await Be({defaults:U,interactive:ne,overrides:A,variables:w.options??{}});try{await Ye(w,{cwd:a,destination:Y,dryRun:G,force:se,options:ie,skipScripts:oe,workspaceRoot:n}),G||(process.stderr.write(`
|
|
19
|
-
`),X(`Template '${x}' applied.`))}finally{I?.()}},"execute");export{st as default};
|
|
1
|
+
import{readLastRunSummary as k,getLastRunSummaryPath as g}from"@visulima/task-runner";import{p as m,l as S,r as x}from"./cli-main.js";import{c as h,d as p}from"../packem_shared/env-Cpxa_7UE.js";const I=new Set(["json","table"]),v=(t,a)=>t??a,c=t=>t===void 0?"-":t<1e3?`${String(t)}ms`:`${(t/1e3).toFixed(2)}s`,$=t=>t.exitCode===void 0?t.cacheStatus:t.exitCode===0?t.cacheStatus==="MISS"?"OK":t.cacheStatus:`FAIL(${String(t.exitCode)})`,r=(t,a)=>t.length>=a?t:t+" ".repeat(a-t.length),w=t=>t.exitCode!==void 0&&t.exitCode!==0,l=(t,a)=>{a.info(`Run ${t.id}`),a.info(` start: ${t.startTime}`),a.info(` end: ${t.endTime}`),a.info(` duration: ${c(t.duration)}`),a.info(` totals: ${String(t.stats.total)} total · ${String(t.stats.succeeded)} ok · ${String(t.stats.cached)} cached · ${String(t.stats.skipped)} skipped · ${String(t.stats.failed)} failed`),a.info(` env: node ${t.environment.nodeVersion} · ${t.environment.platform}/${t.environment.arch}`),a.info("")},y=(t,a)=>{if(t.length===0){a.info("(no tasks match the current filter)");return}const e=t.map(s=>({duration:c(s.duration),hash:s.hash?s.hash.slice(0,12):"-",status:$(s),taskId:s.taskId})),i={duration:Math.max(8,...e.map(s=>s.duration.length)),hash:Math.max(4,...e.map(s=>s.hash.length)),status:Math.max(6,...e.map(s=>s.status.length)),taskId:Math.max(4,...e.map(s=>s.taskId.length))};a.info(` ${r("task",i.taskId)} ${r("status",i.status)} ${r("duration",i.duration)} ${r("hash",i.hash)}`),a.info(` ${"-".repeat(i.taskId)} ${"-".repeat(i.status)} ${"-".repeat(i.duration)} ${"-".repeat(i.hash)}`);for(const s of e)a.info(` ${r(s.taskId,i.taskId)} ${r(s.status,i.status)} ${r(s.duration,i.duration)} ${r(s.hash,i.hash)}`)},C=(t,a,e)=>{l(t,e),e.info(`Task ${a.taskId}`),e.info(` status: ${$(a)}`),e.info(` cache: ${a.cacheStatus}`),e.info(` duration: ${c(a.duration)}`),e.info(` exit: ${a.exitCode===void 0?"-":String(a.exitCode)}`),e.info(` hash: ${a.hash??"(none)"}`),e.info(` start: ${a.startTime??"-"}`),e.info(` end: ${a.endTime??"-"}`),a.dependencies.length>0&&e.info(` deps: ${a.dependencies.join(", ")}`),e.info(""),m.info(`Drill into hash inputs with: vis cache why ${a.taskId} --run ${t.id}`)},R=t=>{process.stdout.write(`${JSON.stringify(t.map(a=>({id:a.id,mtime:new Date(a.mtimeMs).toISOString(),path:a.path})),void 0,2)}
|
|
2
|
+
`)},T=(t,a,e)=>{if(t.length===0){m.info(`No recorded runs found in ${p(a)}/. Run with --summarize to record a run.`);return}const i={id:Math.max(2,...t.map(s=>s.id.length)),mtime:24};e.info(` ${r("id",i.id)} ${r("mtime",i.mtime)}`),e.info(` ${"-".repeat(i.id)} ${"-".repeat(i.mtime)}`);for(const s of t)e.info(` ${r(s.id,i.id)} ${new Date(s.mtimeMs).toISOString()}`)},D=(t,a)=>{let{tasks:e}=t;return a.task!==void 0&&(e=e.filter(i=>i.taskId===a.task)),a.failed&&(e=e.filter(i=>w(i))),e},M=async(t,a)=>{const{failed:e,format:i,runId:s,task:o,workspaceRoot:d}=t,n=s===void 0?await k(d,{dataDirectory:h(d)}):await x(d,s);if(!n){if(i==="json"){process.stdout.write(`${JSON.stringify({error:"no-summary",runId:s??null},void 0,2)}
|
|
3
|
+
`),process.exitCode=1;return}s===void 0?m.error(`No previous run summary found. Run a task first to populate \`${g(d,{dataDirectory:h(d)})}\`.`):m.error(`Run summary "${s}" not found in ${p(d)}/.`),process.exitCode=1;return}const f=D(n,{failed:e,task:o});if(o!==void 0&&f.length===0){if(i==="json"){process.stdout.write(`${JSON.stringify({error:"task-not-in-summary",runId:n.id,taskId:o},void 0,2)}
|
|
4
|
+
`),process.exitCode=1;return}m.error(`Task "${o}" was not part of run ${n.id}.`),process.exitCode=1;return}if(n.stats.failed>0&&(process.exitCode=1),i==="json"){process.stdout.write(`${JSON.stringify({duration:n.duration,endTime:n.endTime,environment:n.environment,runId:n.id,startTime:n.startTime,stats:n.stats,tasks:f.map(u=>({cacheStatus:u.cacheStatus,dependencies:u.dependencies,duration:u.duration,endTime:u.endTime,exitCode:u.exitCode,hash:u.hash??null,startTime:u.startTime,taskId:u.taskId}))},void 0,2)}
|
|
5
|
+
`);return}if(o!==void 0){C(n,f[0],a);return}l(n,a),y(f,a)},b=async({logger:t,options:a,process:e,workspaceRoot:i})=>{const s=v(i,e.cwd),o=a.format??"table";if(!I.has(o)){m.error(`Invalid --format: ${o}. Expected "table" or "json".`),process.exitCode=1;return}if(a.list===!0){const d=await S(s);if(o==="json"){R(d);return}T(d,s,t);return}await M({failed:a.failed===!0,format:o,runId:a.run,task:a.task,workspaceRoot:s},t)};export{b as default,b as replayExecute,M as runReplay};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{createTaskGraph as v}from"@visulima/task-runner";import{b as y,O as b}from"./catalog.js";import{r as E,f as R}from"../packem_shared/selectors-CRgS4bU9.js";const C=(p,o,a)=>{const n=[],t=new Set,c=(e,l)=>{if(t.has(e))return;t.add(e);const m=o[e]??[];for(const g of m)c(g,l+1);const r=a[e],d=" ".repeat(l);n.push(`${d}${e}${r?.cache===!1?" (no-cache)":""}`)};for(const e of p)c(e,0);return n},S=(p,o,a)=>({roots:p,tasks:Object.fromEntries(Object.entries(a).map(([n,t])=>[n,{cache:t.cache,dependsOn:o[n]??[],outputs:t.outputs,parallelism:t.parallelism,projectRoot:t.projectRoot,target:t.target}]))}),J=async({argument:p,logger:o,options:a,process:n,visConfig:t,workspaceRoot:c})=>{const e=p[0];if(!e)throw new Error("Missing selector. Usage: vis action-graph <selector>");if(!c)throw new Error("Could not determine workspace root. Run inside a monorepo.");const{config:l,packageJsons:m,workspace:r}=y(c,t),d=b(c,r,m),g=await E(e,r,n.cwd,c),{target:f}=g;let h=g.projects;a.query&&(h=R(h,r,a.query));const j=h.filter(i=>r.projects[i]?.targets?.[f]!==void 0);if(j.length===0){o.info(`No projects have a "${f}" target.`);return}const w=j.map(i=>{const k=r.projects[i],u=k.targets?.[f],$={project:i,target:f};return{cache:u?.cache,id:`${i}:${f}`,outputs:u?.outputs??[],overrides:{command:u?.command},parallelism:u?.parallelism,projectRoot:k.root,target:$}}),s=v(w,{projectGraph:d,targetDefaults:l.tasks,workspace:r});if(a.json){o.info(JSON.stringify(S(s.roots,s.dependencies,s.tasks),null,2));return}const O=C(s.roots,s.dependencies,s.tasks);o.info(`Execution plan (${Object.keys(s.tasks).length} task(s), ${s.roots.length} root(s)):`),o.info("");for(const i of O)o.info(i)};export{J as default};
|