@visulima/vis 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/LICENSE.md +862 -170
- package/README.md +1 -1
- package/dist/bin.js +1 -1
- package/dist/binx.js +2 -2
- package/dist/config/index.d.ts +1817 -1811
- package/dist/generate/index.d.ts +39 -39
- package/dist/packem_chunks/CONFIG_FILES.js +5 -5
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/cache-attestation.js +1 -1
- package/dist/packem_chunks/catalog.js +69 -67
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +150 -145
- package/dist/packem_chunks/detect.js +3 -3
- package/dist/packem_chunks/detect2.js +4 -4
- package/dist/packem_chunks/dispatch.js +3 -3
- package/dist/packem_chunks/doctor-probe.js +1 -1
- package/dist/packem_chunks/extra-files.js +3 -3
- package/dist/packem_chunks/fix.js +9 -9
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +5 -5
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +6 -6
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +2 -2
- package/dist/packem_chunks/handler21.js +2 -2
- package/dist/packem_chunks/handler22.js +10 -10
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler26.js +5 -5
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +3 -3
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler3.js +2 -3
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler31.js +2 -2
- package/dist/packem_chunks/handler35.js +3 -3
- package/dist/packem_chunks/handler4.js +4 -4
- package/dist/packem_chunks/handler40.js +10 -10
- package/dist/packem_chunks/handler42.js +3 -3
- package/dist/packem_chunks/handler43.js +3 -3
- package/dist/packem_chunks/handler5.js +5 -5
- package/dist/packem_chunks/handler50.js +5 -5
- package/dist/packem_chunks/handler51.js +13 -13
- package/dist/packem_chunks/handler52.js +3 -3
- package/dist/packem_chunks/handler53.js +1 -1
- package/dist/packem_chunks/handler54.js +2 -2
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler57.js +5 -5
- package/dist/packem_chunks/handler58.js +4 -4
- package/dist/packem_chunks/handler59.js +8 -8
- package/dist/packem_chunks/handler6.js +7 -7
- package/dist/packem_chunks/handler60.js +2 -2
- package/dist/packem_chunks/handler61.js +13 -13
- package/dist/packem_chunks/handler62.js +4 -4
- package/dist/packem_chunks/handler63.js +3 -3
- package/dist/packem_chunks/handler64.js +4 -4
- package/dist/packem_chunks/handler65.js +6 -6
- package/dist/packem_chunks/handler66.js +2 -2
- package/dist/packem_chunks/handler67.js +9 -9
- package/dist/packem_chunks/handler68.js +7 -7
- package/dist/packem_chunks/handler69.js +24 -24
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +6 -6
- package/dist/packem_chunks/handler71.js +14 -14
- package/dist/packem_chunks/handler72.js +47 -47
- package/dist/packem_chunks/handler73.js +9 -9
- package/dist/packem_chunks/handler74.js +27 -27
- package/dist/packem_chunks/handler75.js +3 -3
- package/dist/packem_chunks/handler76.js +8 -8
- package/dist/packem_chunks/handler77.js +63 -64
- package/dist/packem_chunks/handler78.js +25 -25
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +5 -5
- package/dist/packem_chunks/heal.js +8 -8
- package/dist/packem_chunks/help-command.js +46 -46
- package/dist/packem_chunks/index2.js +5 -5
- package/dist/packem_chunks/index3.js +3 -3
- package/dist/packem_chunks/index4.js +11 -11
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/lean.js +2 -2
- package/dist/packem_chunks/list.js +2 -2
- package/dist/packem_chunks/loader.js +4 -4
- package/dist/packem_chunks/orchestrator.js +14 -14
- package/dist/packem_chunks/pre-mode.js +2 -2
- package/dist/packem_chunks/prompts.js +3 -3
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/publish-guards.js +1 -1
- package/dist/packem_chunks/registry.js +17 -17
- package/dist/packem_chunks/resolveFormatter.js +5 -5
- package/dist/packem_chunks/shell-runner.js +1 -1
- package/dist/packem_chunks/snapshot.js +2 -2
- package/dist/packem_chunks/stage-publisher.js +1 -1
- package/dist/packem_chunks/staged-registry.js +2 -2
- package/dist/packem_chunks/state.js +3 -3
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tar.js +3 -3
- package/dist/packem_chunks/tripwire.js +2 -2
- package/dist/packem_chunks/ts-loader.js +9 -9
- package/dist/packem_chunks/verify-lockfile.js +2 -2
- package/dist/packem_chunks/workspace.js +2 -2
- package/dist/packem_shared/advisories-CCBGdU8U.js +1 -0
- package/dist/packem_shared/affected-selection-Dj-ymxhw.js +1 -0
- package/dist/packem_shared/affected-shas-PwkVbPch.js +1 -0
- package/dist/packem_shared/ai-analysis-bGCAc1jR.js +68 -0
- package/dist/packem_shared/{ai-fix-CLfWbyqY.js → ai-fix-DV5-dHBY.js} +9 -9
- package/dist/packem_shared/{augment-BVuj3ee7.js → augment-24KX2nkI.js} +4 -4
- package/dist/packem_shared/bin-CtzhnYMp.js +1 -0
- package/dist/packem_shared/build-scripts-w4SNeR7D.js +1 -0
- package/dist/packem_shared/{command-runtime-DTbo12cP.js → command-runtime-BLFPUYAT.js} +1 -1
- package/dist/packem_shared/cyclonedx-C4KaVTn1.js +4 -0
- package/dist/packem_shared/{dependency-scan-DZcSlSFp.js → dependency-scan-D_ona0Qm.js} +1 -1
- package/dist/packem_shared/{docker-69ybb6g7.js → docker-DaVs-9wK.js} +40 -40
- package/dist/packem_shared/{en-C26W78--.js → en-D3CfXlO7.js} +13 -13
- package/dist/packem_shared/failure-log-CTneNcio.js +2 -0
- package/dist/packem_shared/giget-CAxjpwew.js +2 -0
- package/dist/packem_shared/glob-BUjyjdE8-C4M8e02u.js +1 -0
- package/dist/packem_shared/index-BWl4DbMp.js +1 -0
- package/dist/packem_shared/index-CTMU29dI.js +1 -0
- package/dist/packem_shared/index-uBVnF4ji.js +35 -0
- package/dist/packem_shared/index.server-CusjRLCh.js +2 -0
- package/dist/packem_shared/{interface.d-B7VK2rcH.d.ts → interface.d-CRqRz4jt.d.ts} +39 -39
- package/dist/packem_shared/{interface.d-Cezzifoh.d.ts → interface.d-CrHOtJc1.d.ts} +37 -37
- package/dist/packem_shared/lifecycle-B8A2T3gx.js +2 -0
- package/dist/packem_shared/lockfile-Bccery3L.js +1 -0
- package/dist/packem_shared/main-D_cam4hv.js +1 -0
- package/dist/packem_shared/manifests-BDkwiVbh.js +1 -0
- package/dist/packem_shared/{min-release-age-hK604veF.js → min-release-age-OaYpLwux.js} +2 -2
- package/dist/packem_shared/missing-package-json-BqS-OnKd.js +1 -0
- package/dist/packem_shared/{native-config-sync-DDKjAy0i.js → native-config-sync-Ds1FtcrM.js} +7 -7
- package/dist/packem_shared/osv-bloom-pKp7urSB.js +2 -0
- package/dist/packem_shared/package-version-C47v64aB.js +4 -0
- package/dist/packem_shared/packument-HBVbyf7x.js +1 -0
- package/dist/packem_shared/pm-runner-C6eTANt1.js +1 -0
- package/dist/packem_shared/project-name-filter-CJ3XX2TI.js +7 -0
- package/dist/packem_shared/prompt-BSAy8SMH.js +1 -0
- package/dist/packem_shared/{provenance-CRBV9cko.js → provenance-D4Cza8cp.js} +1 -1
- package/dist/packem_shared/{readJsonSync-DuMMeB3s-B9cGBVbJ.js → readJsonSync-DweZd5ZA-0eZh9sGm.js} +1 -1
- package/dist/packem_shared/registry-keys-C0ez2VND.js +1 -0
- package/dist/packem_shared/{resolve-explicit-BX6aMYl-.js → resolve-explicit-BbT764KS.js} +1 -1
- package/dist/packem_shared/{resolve-runtime-COyiEML3.js → resolve-runtime-D_vZovbB.js} +1 -1
- package/dist/packem_shared/run-file-DyPFFN9U.js +1 -0
- package/dist/packem_shared/{runtime-check-fzDkedMW.js → runtime-check-D4um-yQq.js} +1 -1
- package/dist/packem_shared/s1ngularity-St6dhKiq.js +1 -0
- package/dist/packem_shared/scan-progress-q-N2JtIp.js +2 -0
- package/dist/packem_shared/selectors-Ce_6UAoY.js +3 -0
- package/dist/packem_shared/signatures-Dyeyg1q9.js +2 -0
- package/dist/packem_shared/subtree-DSm0QEoE.js +2 -0
- package/dist/packem_shared/target-merge-Cfy7c__2.js +11 -0
- package/dist/packem_shared/target-options-7XcbqGDe.js +1 -0
- package/dist/packem_shared/toolchain-C_pNMBM6.js +5 -0
- package/dist/packem_shared/typosquats-xzcAGPiM.js +1 -0
- package/dist/packem_shared/{use-measured-height-DfNxp6nf.js → use-measured-height-CBjN0fle.js} +1 -1
- package/dist/packem_shared/verify-Dve9PQj3.js +1 -0
- package/dist/packem_shared/{vis-update-app-De8JjZm0.js → vis-update-app-DMAC2pPf.js} +1 -1
- package/dist/packem_shared/vis-user-error-xmha3L4n.js +30 -0
- package/dist/packem_shared/watch-BXOOX7lx.js +1 -0
- package/dist/packem_shared/watch-loop-Q7UpkVbr.js +11 -0
- package/dist/release/core/package-managers/index.d.ts +2 -2
- package/dist/release/core/version-actions/index.d.ts +10 -10
- package/dist/release/index.d.ts +60 -60
- package/dist/release/plugin-sdk.d.ts +80 -80
- package/dist/release/presets.d.ts +148 -148
- package/dist/release/types.d.ts +840 -840
- package/dist/runtime/preload.js +1 -1
- package/index.d.ts +204 -204
- package/index.js +52 -52
- package/package.json +16 -16
- package/schemas/project.schema.json +4 -1
- package/schemas/vis-config.schema.json +9 -3
- package/dist/packem_shared/advisories-B76fBVL-.js +0 -1
- package/dist/packem_shared/affected-shas-BOeR4vEc.js +0 -1
- package/dist/packem_shared/ai-analysis-D7HOdUwd.js +0 -68
- package/dist/packem_shared/bin-CkfFJCAM.js +0 -1
- package/dist/packem_shared/build-scripts-CfAqHBlq.js +0 -1
- package/dist/packem_shared/cyclonedx--L7NbMBH.js +0 -4
- package/dist/packem_shared/failure-log-BZQqxffZ.js +0 -2
- package/dist/packem_shared/giget-DVTFJlbR.js +0 -2
- package/dist/packem_shared/glob-DMbPwGSj-D2Hk3lFG.js +0 -1
- package/dist/packem_shared/index-2LCHaVNX.js +0 -35
- package/dist/packem_shared/index-B0EsgdzO.js +0 -1
- package/dist/packem_shared/index-Bhzio2RB.js +0 -1
- package/dist/packem_shared/index-Bq6YEpiq.js +0 -28
- package/dist/packem_shared/index.server-qvZ-cy29.js +0 -2
- package/dist/packem_shared/lifecycle-BcCMt9wn.js +0 -2
- package/dist/packem_shared/lockfile-Cwt0Nwr0.js +0 -1
- package/dist/packem_shared/main-B3juSU5z.js +0 -1
- package/dist/packem_shared/manifests-BshBdSb-.js +0 -1
- package/dist/packem_shared/missing-package-json-Cu0iWMT2.js +0 -1
- package/dist/packem_shared/osv-bloom-DMhXP184.js +0 -2
- package/dist/packem_shared/package-version-TsxLc6w2.js +0 -4
- package/dist/packem_shared/packument-CtVAoNo7.js +0 -1
- package/dist/packem_shared/pm-runner-CfyxALPK.js +0 -1
- package/dist/packem_shared/prompt-DjXHVgYU.js +0 -1
- package/dist/packem_shared/registry-keys-Ci2keQNi.js +0 -1
- package/dist/packem_shared/run-file-CTJfIZ0I.js +0 -1
- package/dist/packem_shared/s1ngularity-Cq1cCSpU.js +0 -1
- package/dist/packem_shared/scan-progress-DQ9qIGzr.js +0 -2
- package/dist/packem_shared/selectors-B9dOMIMq.js +0 -3
- package/dist/packem_shared/signatures-DvD1E8Xa.js +0 -2
- package/dist/packem_shared/subtree-C7bZuiSQ.js +0 -2
- package/dist/packem_shared/target-merge-Dg25Izl5.js +0 -11
- package/dist/packem_shared/target-options-aPqByoww.js +0 -1
- package/dist/packem_shared/toolchain-CiaW3bx4.js +0 -5
- package/dist/packem_shared/typosquats-CRnvlYPw.js +0 -1
- package/dist/packem_shared/verify-23b6IfSg.js +0 -1
- package/dist/packem_shared/watch-B3P2dwoG.js +0 -1
- package/dist/packem_shared/watch-loop-B3_O8hF-.js +0 -11
package/dist/generate/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Type definitions for the `vis generate` template runtime.
|
|
3
|
-
*
|
|
4
|
-
* The shape intentionally echoes Bingo's `Template` so a future Bingo
|
|
5
|
-
* adapter (re-exporting `bingo` Templates through this runtime) is a
|
|
6
|
-
* one-pager. Authors do not depend on Bingo to write a vis generator.
|
|
7
|
-
*/
|
|
2
|
+
* Type definitions for the `vis generate` template runtime.
|
|
3
|
+
*
|
|
4
|
+
* The shape intentionally echoes Bingo's `Template` so a future Bingo
|
|
5
|
+
* adapter (re-exporting `bingo` Templates through this runtime) is a
|
|
6
|
+
* one-pager. Authors do not depend on Bingo to write a vis generator.
|
|
7
|
+
*/
|
|
8
8
|
type VariableType = "array" | "boolean" | "enum" | "number" | "string";
|
|
9
9
|
/** Common variable fields (all types). */
|
|
10
10
|
interface VariableBase {
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
* Default value when the user accepts the prompt without typing.
|
|
13
|
+
* For `boolean` this is `true|false`; for `enum` it must match `values`.
|
|
14
|
+
*/
|
|
15
15
|
default?: boolean | number | string | string[];
|
|
16
16
|
/** Hide from prompts; can still be set via CLI or `--defaults`. */
|
|
17
17
|
internal?: boolean;
|
|
@@ -53,18 +53,18 @@ interface CreationDirectory {
|
|
|
53
53
|
[key: string]: CreationDirectory | CreationFile;
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
|
-
* Script entry produced by `produce()`.
|
|
57
|
-
* - `string`: shell command, runs in the destination directory.
|
|
58
|
-
* - `object`: shell commands with optional phase ordering.
|
|
59
|
-
*/
|
|
56
|
+
* Script entry produced by `produce()`.
|
|
57
|
+
* - `string`: shell command, runs in the destination directory.
|
|
58
|
+
* - `object`: shell commands with optional phase ordering.
|
|
59
|
+
*/
|
|
60
60
|
type Script = ScriptObject | string;
|
|
61
61
|
interface ScriptObject {
|
|
62
62
|
/** Shell command(s) to run sequentially. */
|
|
63
63
|
commands: string[];
|
|
64
64
|
/**
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
* Phase ordering. Phases run in ascending order; scripts within
|
|
66
|
+
* the same phase are dispatched concurrently. Default: 0.
|
|
67
|
+
*/
|
|
68
68
|
phase?: number;
|
|
69
69
|
/** Suppress command output. Default: false. */
|
|
70
70
|
silent?: boolean;
|
|
@@ -74,12 +74,12 @@ interface Creation {
|
|
|
74
74
|
/** Recursive directory tree. Keys with `/` are auto-split. */
|
|
75
75
|
files?: CreationDirectory;
|
|
76
76
|
/**
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
* Per-file metadata keyed by the *flattened* destination path
|
|
78
|
+
* (e.g. `src/foo.ts`). Optional — native templates usually omit
|
|
79
|
+
* this; the moon adapter populates it from per-file frontmatter
|
|
80
|
+
* so `force: true` survives the trip to the runner without
|
|
81
|
+
* changing the shape of `files`.
|
|
82
|
+
*/
|
|
83
83
|
filesMeta?: Record<string, FileMeta>;
|
|
84
84
|
/** Shell scripts to run after files are written. */
|
|
85
85
|
scripts?: Script[];
|
|
@@ -88,9 +88,9 @@ interface Creation {
|
|
|
88
88
|
}
|
|
89
89
|
interface FileMeta {
|
|
90
90
|
/**
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
* Overwrite an existing file at this path without prompting or
|
|
92
|
+
* consulting the global `--force` flag.
|
|
93
|
+
*/
|
|
94
94
|
force?: boolean;
|
|
95
95
|
}
|
|
96
96
|
/** Context object passed to `produce()`. */
|
|
@@ -118,17 +118,17 @@ interface TemplateAbout {
|
|
|
118
118
|
name: string;
|
|
119
119
|
}
|
|
120
120
|
/**
|
|
121
|
-
* The author-facing template shape.
|
|
122
|
-
* Both native (`.vis/templates/<name>.ts`) and moon-adapter outputs
|
|
123
|
-
* normalize to this.
|
|
124
|
-
*/
|
|
121
|
+
* The author-facing template shape.
|
|
122
|
+
* Both native (`.vis/templates/<name>.ts`) and moon-adapter outputs
|
|
123
|
+
* normalize to this.
|
|
124
|
+
*/
|
|
125
125
|
interface Template {
|
|
126
126
|
about: TemplateAbout;
|
|
127
127
|
/**
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
128
|
+
* Default destination directory (relative to workspace root unless
|
|
129
|
+
* absolute or starting with `./`). Honored when the user does not
|
|
130
|
+
* pass `--to`. Maps to moon's `template.yml` `destination`.
|
|
131
|
+
*/
|
|
132
132
|
destination?: string;
|
|
133
133
|
/** Variable schema for prompts. */
|
|
134
134
|
options?: VariableMap;
|
|
@@ -136,9 +136,9 @@ interface Template {
|
|
|
136
136
|
produce: (context: TemplateContext) => Creation | Promise<Creation>;
|
|
137
137
|
}
|
|
138
138
|
/**
|
|
139
|
-
* Discovery record: a Template plus where it came from.
|
|
140
|
-
* Surfaced by `vis generate --list`.
|
|
141
|
-
*/
|
|
139
|
+
* Discovery record: a Template plus where it came from.
|
|
140
|
+
* Surfaced by `vis generate --list`.
|
|
141
|
+
*/
|
|
142
142
|
interface DiscoveredTemplate {
|
|
143
143
|
/** Lazy loader — invoke to materialize the Template. */
|
|
144
144
|
load: () => Promise<Template>;
|
|
@@ -150,8 +150,8 @@ interface DiscoveredTemplate {
|
|
|
150
150
|
source: "builtin" | "config" | "moon" | "native" | "remote";
|
|
151
151
|
}
|
|
152
152
|
/**
|
|
153
|
-
* Identity helper for type inference. Authors get autocomplete + checks
|
|
154
|
-
* without having to annotate the export.
|
|
155
|
-
*/
|
|
153
|
+
* Identity helper for type inference. Authors get autocomplete + checks
|
|
154
|
+
* without having to annotate the export.
|
|
155
|
+
*/
|
|
156
156
|
declare const createTemplate: (template: Template) => Template;
|
|
157
157
|
export { type ArrayVariable, type BooleanVariable, type BuiltinVars, type Creation, type CreationDirectory, type CreationFile, type DiscoveredTemplate, type EnumVariable, type FileMeta, type NumberVariable, type Options, type Script, type ScriptObject, type StringVariable, type Template, type TemplateAbout, type TemplateContext, type Variable, type VariableMap, type VariableType, createTemplate };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`),s),this.filePath=e,this.removedKeys=o}}class j extends
|
|
3
|
-
Chain: ${s.join(" → ")}`:"";super(`Failed to load ${e}: ${r}${n}`,s,{cause:o})}}const L=t=>t.join(" → ");class g extends
|
|
1
|
+
import{createRequire as F}from"node:module";import{F as _,m as P}from"../packem_shared/target-merge-Cfy7c__2.js";import{w as c,v as b,l as d,d as l,J as y,q as C}from"../packem_shared/index-uBVnF4ji.js";import{i as I}from"./ts-loader.js";import{otelPlugin as vt}from"../packem_shared/otelPlugin-DmKDBaPo.js";import{definePlugin as $t}from"../packem_shared/definePlugin-DoUcoYSy.js";import{a as O}from"../packem_shared/readJsonSync-DweZd5ZA-0eZh9sGm.js";let G;const V=t=>(G??=F(import.meta.url))(t),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=t=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[e,s]=p.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return p.getBuiltinModule(t)}return V(t)},{createHash:T}=k("node:crypto"),{readdirSync:$,readFileSync:q}=k("node:fs"),{createRequire:N}=k("node:module");class h extends Error{chain;constructor(e,s,o){super(e,o),this.name=this.constructor.name,this.chain=s}}class K extends h{constructor(e,s){const o=[...s,`${e} (re-enters)`].join(" → ");super(`Config cycle: ${o}`,s)}}class x extends h{filePath;removedKeys;constructor(e,s,o){const r=[`${e} uses removed keys.`,""];for(const n of o){const a=n.location?` (at ${n.location})`:"";r.push(` • ${n.name}${a} → renamed to \`${n.renamedTo}\``);for(const i of n.children??[])r.push(` ↳ ${i.name} → renamed to \`${i.renamedTo}\``)}r.push("","Run `vis migrate self` to auto-rewrite the config (use --dry-run to preview)."),super(r.join(`
|
|
2
|
+
`),s),this.filePath=e,this.removedKeys=o}}class j extends h{constructor(e,s,o){const r=o instanceof Error?o.message:String(o),n=s.length>0?`
|
|
3
|
+
Chain: ${s.join(" → ")}`:"";super(`Failed to load ${e}: ${r}${n}`,s,{cause:o})}}const L=t=>t.join(" → ");class g extends h{constructor(e,s,o){const r=s.length>0?s[s.length-1]:"<unknown>",n=o.length>0?`
|
|
4
4
|
Tried:
|
|
5
5
|
${o.join(`
|
|
6
6
|
`)}`:"";super(`Cannot resolve "${e}" extended from ${r}.${n}
|
|
7
|
-
Chain: ${L(s)}`,s)}}const
|
|
8
|
-
`);return e.digest("hex")},
|
|
7
|
+
Chain: ${L(s)}`,s)}}const M=t=>{const e=[];if(Object.hasOwn(t,"targetDefaults")&&e.push({name:"targetDefaults",renamedTo:"tasks"}),Object.hasOwn(t,"taskRunnerOptions")&&e.push({name:"taskRunnerOptions",renamedTo:"taskRunner"}),Object.hasOwn(t,"taskDefaults")){const{taskDefaults:s}=t,o=[];if(Array.isArray(s))for(const[r,n]of s.entries())n&&typeof n=="object"&&(Object.hasOwn(n,"scope")&&o.push({location:`taskDefaults[${r}].scope`,name:"scope",renamedTo:"match"}),Object.hasOwn(n,"targets")&&o.push({location:`taskDefaults[${r}].targets`,name:"targets",renamedTo:"tasks"}));e.push({children:o.length>0?o:void 0,name:"taskDefaults",renamedTo:"scopedTasks"})}else if(Array.isArray(t.scopedTasks))for(const[s,o]of t.scopedTasks.entries())o&&typeof o=="object"&&(Object.hasOwn(o,"scope")&&e.push({location:`scopedTasks[${s}].scope`,name:"scope",renamedTo:"match"}),Object.hasOwn(o,"targets")&&e.push({location:`scopedTasks[${s}].targets`,name:"targets",renamedTo:"tasks"}));return e},U=t=>Object.hasOwn(t,"targets")&&!Object.hasOwn(t,"tasks")?[{name:"targets",renamedTo:"tasks"}]:[],W=(t,e,s)=>{if(!s||typeof s!="object")return;const o=M(s);if(o.length>0)throw new x(t,e,o)},B=(t,e,s)=>{if(!s||typeof s!="object")return;const o=U(s);if(o.length>0)throw new x(t,e,o)},E=["vis.config.ts","vis.config.mts","vis.config.cts","vis.config.js","vis.config.mjs","vis.config.cjs"],J=new Set(E),R=["vis.task.ts","vis.task.mts","vis.task.cts","vis.task.js","vis.task.mjs","vis.task.cjs"],H=new Set(R),ht=2880,m={blockExoticSubdeps:!0,policies:{installScripts:{strict:!0},publisherChange:{ignoreAfter:43200,mode:"no-downgrade"}}},Y=t=>{if(!t)return{...m};const e=m.policies??{},s=t.policies??{},o={...e,...s};for(const r of Object.keys(e)){const n=e[r],a=s[r];n!==void 0&&a!==void 0&&(o[r]={...n,...a})}return{...m,...t,policies:o}},v=t=>({...t,security:Y(t.security),update:{security:!0,target:"minor",...t.update}}),z=t=>{let e;try{e=$(t)}catch{return}const s=new Set(e.filter(o=>J.has(o)));for(const o of E)if(s.has(o))return c(t,o)},Q=t=>{let e;try{e=$(t)}catch{return}const s=new Set(e.filter(o=>H.has(o)));for(const o of R)if(s.has(o))return c(t,o)},S=t=>T("sha256").update(q(t)).digest("hex"),X=t=>{const e=T("sha256"),s=[...t].sort();for(const o of s)e.update(o),e.update(":"),e.update(S(o)),e.update(`
|
|
8
|
+
`);return e.digest("hex")},Z=t=>{const e=c(t,"node_modules");if(d(e)){const o=c(e,".cache","vis");return l(o),c(o,"vis-config-cache.json")}const s=_("vis",{create:!0,cwd:t});return s?c(s,"vis-config-cache.json"):void 0},tt=(t,e)=>{if(d(t))try{const s=O(t);if(s.hash===e)return s.config}catch{}},et=(t,e,s)=>{try{l(y(t)),C(t,{config:s,hash:e})}catch{}},st=t=>t===void 0?[]:Array.isArray(t)?t:[t],ot=(t,e,s)=>{if(b(t))throw new g(t,[...s,e],["Absolute paths in `extends` are not supported. Use a relative path or an npm package name."]);const o=[];if(t.startsWith("./")||t.startsWith("../")){const r=y(e),n=c(r,t);if(o.push(n),d(n))return n;throw new g(t,[...s,e],o)}try{return N(e).resolve(t)}catch{throw o.push(`require.resolve("${t}") from ${e}`),new g(t,[...s,e],o)}},A=async(t,e)=>{let s;try{s=(await I(t)).default??{}}catch(o){throw new j(t,e,o)}try{return(typeof s=="function"?await s()??{}:s)??{}}catch(o){throw new j(t,e,o)}},nt=(t,e)=>{const s={...t,...e};if(t.tasks||e.tasks){const o=new Set([...Object.keys(t.tasks??{}),...Object.keys(e.tasks??{})]),r={};for(const n of o)r[n]=P(t.tasks?.[n],e.tasks?.[n]);s.tasks=r}if((t.scopedTasks||e.scopedTasks)&&(s.scopedTasks=[...t.scopedTasks??[],...e.scopedTasks??[]]),(t.fileGroups||e.fileGroups)&&(s.fileGroups={...t.fileGroups,...e.fileGroups}),(t.taskGroups||e.taskGroups)&&(s.taskGroups={...t.taskGroups,...e.taskGroups}),t.security||e.security){const o=t.security?.policies??{},r=e.security?.policies??{},n={...o,...r};for(const a of Object.keys(o)){const i=o[a],f=r[a];i!==void 0&&f!==void 0&&(n[a]={...i,...f})}s.security={...t.security,...e.security,acceptedRisks:{...t.security?.acceptedRisks,...e.security?.acceptedRisks},policies:n}}return(t.update||e.update)&&(s.update={...t.update,...e.update}),(t.taskRunner||e.taskRunner)&&(s.taskRunner={...t.taskRunner,...e.taskRunner}),delete s.extends,s},D=async(t,e,s,o,r)=>{if(s.has(t))throw new K(t,e);if(!o.has(t)){s.add(t);try{const n=await A(t,e);W(t,e,n);const a=st(n.extends);for(const i of a){const f=ot(i,t,e);await D(f,[...e,t],s,o,r)}o.set(t,n),r.push(t)}finally{s.delete(t)}}},gt=async(t,e)=>{let s;if(e?.explicitConfigPath){const u=b(e.explicitConfigPath)?e.explicitConfigPath:c(t,e.explicitConfigPath);if(!d(u))throw new Error(`Cannot find config file at ${u}`);s=u}else s=z(t);if(!s)return v({});const o=new Set,r=new Map,n=[];await D(s,[],o,r,n);const a=X(n),i=Z(t);if(i){const u=tt(i,a);if(u)return u}let f={};for(const u of n)f=nt(f,r.get(u));const w=v(f);return i&&et(i,a,w),w},rt=t=>t.replaceAll(/[^\w.-]+/g,"_"),at=(t,e)=>{const s=c(t,"node_modules"),o=rt(e);if(d(s)){const n=c(s,".cache","vis","task-configs");return l(n),c(n,`${o}.json`)}const r=_("vis",{create:!0,cwd:t});return r?c(r,"task-configs",`${o}.json`):void 0},it=(t,e)=>{if(d(t))try{const s=O(t);if(s.hash===e)return s.config}catch{}},ct=(t,e,s)=>{try{l(y(t)),C(t,{config:s,hash:e})}catch{}},mt=async(t,e,s)=>{const o=Q(e);if(!o)return;const r=S(o),n=at(t,s);if(n){const f=it(n,r);if(f)return f}const a=await A(o,[]);B(o,[],a);const i=a;return n&&ct(n,r,i),i},kt=t=>t,yt=t=>t;export{E as CONFIG_FILES,ht as DEFAULT_MIN_RELEASE_AGE_MINUTES,m as SECURITY_DEFAULTS,R as TASK_CONFIG_FILES,v as applyDefaults,yt as defineConfig,$t as definePlugin,kt as defineTaskConfig,z as findVisConfigFile,Q as findVisTaskConfigFile,gt as loadVisConfig,mt as loadVisTaskConfig,vt as otelPlugin};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as c,E as n,I as f}from"../packem_shared/index.server-
|
|
1
|
+
import{s as c,E as n,I as f}from"../packem_shared/index.server-CusjRLCh.js";import{p as i}from"./cli-main.js";import{g as l}from"../packem_shared/osv-bloom-pKp7urSB.js";const a=t=>{if(!t)return"never";const r=Date.parse(t);if(Number.isNaN(r))return t;const e=Date.now()-r;if(e<0)return t;const o=Math.floor(e/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const s=Math.floor(o/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`},m=t=>t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`,u=async({options:t,workspaceRoot:r})=>{if(!r)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const e=await l(r,t.cacheDir);if(t.format==="json"){process.stdout.write(`${JSON.stringify(e,void 0,2)}
|
|
2
2
|
`);return}if(i.info(`Cache: ${e.cacheDir}`),!e.present){i.warn(`No osv-bloom filter yet. Run ${c("vis advisories bloom sync")} to populate.`);return}if(e.manifest){const{manifest:o}=e;i.info(`Built: ${o.builtAtRfc3339} (${a(o.builtAtRfc3339)})`),i.info(`Fetch: ${e.fetchedAtIso??n("—")} (${a(e.fetchedAtIso)})`),i.info(`Filter: ${f(m(o.bloomByteLen))} m=${o.bloomMBits.toLocaleString()} bits k=${String(o.bloomKHashes)}`),i.info(`Set: ${o.entryCount.toLocaleString()} entries from ${o.advisoryCount.toLocaleString()} advisories (target FPR ${o.targetFpr})`),i.info(n(`Digest: ${o.setDigestSha256}`))}else i.warn("filter.bin present but manifest.json missing — `vis advisories bloom sync` will rewrite the cache.")},h=u;export{h as advisoriesBloomStatusExecute};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{E as m}from"../packem_shared/index.server-
|
|
1
|
+
import{E as m}from"../packem_shared/index.server-CusjRLCh.js";import{p as i}from"./cli-main.js";import{s as p}from"../packem_shared/scan-progress-q-N2JtIp.js";import{s as d,D}from"../packem_shared/osv-bloom-pKp7urSB.js";const b=o=>o?.security?.audit?.advisories?.bloom??{},u=o=>o>=1e3?`${(o/1e3).toFixed(1)}s`:`${Math.round(o)}ms`,y=o=>o<1024?`${o} B`:o<1024*1024?`${(o/1024).toFixed(1)} KB`:`${(o/(1024*1024)).toFixed(1)} MB`,h=async({options:o,visConfig:f,workspaceRoot:a})=>{if(!a)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const n=o.format==="json",c=b(f),l=o.source??c.source??D,s=p([{id:"bloom",label:"Sync osv-bloom prefilter"}],{live:!n});let e,t;try{s.start("bloom");const r=Date.now();e=await d({allowedHosts:c.allowedHosts,cacheDir:o.cacheDir,force:!!o.force,source:l,workspaceRoot:a}),e.upToDate?s.finish("bloom","ok",`up to date · ${u(Date.now()-r)}`):s.finish("bloom","ok",`${e.manifest.entryCount.toLocaleString()} entries · ${y(e.bytesOnDisk)} · ${u(e.durationMs)}`)}catch(r){t=r instanceof Error?r.message:String(r),s.finish("bloom","error",t)}finally{s.stop()}n?process.stdout.write(`${JSON.stringify({bytesOnDisk:e?.bytesOnDisk??0,cacheDir:e?.cacheDir??null,durationMs:e?.durationMs??0,error:t??null,manifest:e?.manifest??null,source:l,upToDate:e?.upToDate??!1},void 0,2)}
|
|
2
2
|
`):e&&(i.info(m(`Cache: ${e.cacheDir}`)),i.info(m(`Built: ${e.manifest.builtAtRfc3339}`)),t||i.success(e.upToDate?"osv-bloom prefilter up to date.":"osv-bloom prefilter synced.")),t&&(process.exitCode=1)},O=h;export{O as advisoriesBloomSyncExecute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as
|
|
1
|
+
import{createRequire as w}from"node:module";import{loadOptionalSigstore as g}from"./loader.js";let R;const I=e=>(R??=w(import.meta.url))(e),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=e=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[t,s]=c.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return c.getBuiltinModule(e)}return I(e)},{createHash:m}=_("node:crypto"),{createReadStream:v}=_("node:fs"),S="https://token.actions.githubusercontent.com",h=e=>e.replaceAll(/[$()*+.?[\\\]^{|}]/g,String.raw`\$&`),$=e=>{if("github"in e){const{ref:t,repo:s,workflow:r}=e.github;return{issuer:S,sanPattern:`^${h(`https://github.com/${s}/${r}@${t}`)}$`}}return"sanRegex"in e?{issuer:e.oidcIssuer,sanPattern:e.sanRegex}:{issuer:e.oidcIssuer,sanPattern:`^${h(e.san)}$`}},x=()=>process.env.CI==="true"||typeof process.env.ACTIONS_ID_TOKEN_REQUEST_URL=="string"||typeof process.env.SIGSTORE_ID_TOKEN=="string",y=e=>new Promise((t,s)=>{const r=m("sha256"),i=v(e);i.on("error",s),i.on("data",n=>r.update(n)),i.on("end",()=>{t(Buffer.from(r.digest("hex")))})}),b=1024,j=e=>{const{issuer:t,sanPattern:s}=$(e.expectedIdentity),r=new Map,i=(n,o)=>{let u;try{u=JSON.parse(o)}catch{return Promise.resolve(!1)}return(async()=>{let a;try{a=await y(n)}catch{return!1}const d=`${a.toString("utf8")}:${m("sha256").update(o).digest("hex")}`,p=r.get(d);if(p)return p;const l=(async()=>{try{return await(await g({workspaceRoot:e.workspaceRoot})).verify(u,a,{certificateIdentityURI:s,certificateIssuer:t}),!0}catch(f){return e.onVerifyFailure?.(f instanceof Error?f.message:String(f)),!1}})();return r.size>=b&&r.clear(),r.set(d,l),l})()};return{expectedIdentity:e.expectedIdentity,onReject:e.onReject,requireOnDownload:e.requireOnDownload??!1,signArtifact:async({archivePath:n})=>{if(!x())return null;const o=await g({workspaceRoot:e.workspaceRoot}),u=await y(n),a=await o.sign(u);return JSON.stringify(a)},verifyArtifact:({archivePath:n,attestation:o})=>i(n,o)}};export{j as buildCacheAttestationHooks,$ as normalizeExpectedIdentity};
|