@exodus/stasis 1.0.0-beta.14 → 1.0.0-beta.15
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/README.md +1 -0
- package/bin/stasis.js +84 -14
- package/package.json +17 -5
- package/src/audit.js +222 -51
- package/src/cmd/build.js +53 -29
- package/src/cmd/bundle-options.js +10 -7
- package/src/cmd/bundle.js +255 -116
- package/src/cmd/github-bundle.js +7 -8
- package/src/cmd/tokens.js +12 -6
- package/src/define.js +5 -0
- package/src/flow.js +24 -4
- package/src/metro-assets.js +4 -354
- package/src/metro-resolver.js +75 -124
- package/src/parse.js +3 -0
- package/src/resolve-fields.js +107 -372
- package/src/resolve-typescript.js +99 -27
- package/src/scan.js +19 -14
- package/src/sixel.js +333 -0
- package/src/table.js +66 -13
- package/src/validate-notes.d.ts +18 -0
- package/src/validate-notes.js +66 -0
- package/src/validate.d.ts +132 -0
- package/src/validate.js +221 -113
- package/src/vfs-bundle/github.js +3 -1
- package/src/vfs-bundle/prisma.js +102 -29
- package/src/why.js +9 -7
package/src/table.js
CHANGED
|
@@ -13,36 +13,89 @@ const cell = (v) => String(v ?? '').replace(/[\r\n\u2028\u2029]+/gu, ' ')
|
|
|
13
13
|
const cellLines = (v, multiline) =>
|
|
14
14
|
multiline ? String(v ?? '').split('\n').map((s) => cell(s)) : [cell(v)]
|
|
15
15
|
|
|
16
|
+
// The longest of `items` by `lengthOf` (a string's or an array's length), 0 for none: a fold, as a column
|
|
17
|
+
// (a --why cell of 2000 chains, say) may hold more lines and words than one call takes arguments.
|
|
18
|
+
const longest = (items, lengthOf = (item) => item.length) => items.reduce((max, item) => Math.max(max, lengthOf(item)), 0)
|
|
19
|
+
|
|
20
|
+
// A column that wraps narrows no further than its header, and its longest word up to this, so that only
|
|
21
|
+
// a longer word is ever cut.
|
|
22
|
+
const MAX_WHOLE_WORD = 20
|
|
23
|
+
|
|
24
|
+
// What a `multiline` column's entry wrapped starts its further lines with.
|
|
25
|
+
const INDENT = ' '
|
|
26
|
+
|
|
27
|
+
// `text` cut into lines of at most `width`, at spaces where it has them, a word wider than a line cut where
|
|
28
|
+
// it must be; each line after the first starts with `indent`.
|
|
29
|
+
function wrapLine(text, width, indent = '') {
|
|
30
|
+
const lines = []
|
|
31
|
+
let rest = text
|
|
32
|
+
let prefix = ''
|
|
33
|
+
while (prefix.length + rest.length > width) {
|
|
34
|
+
const room = width - prefix.length
|
|
35
|
+
const space = rest.lastIndexOf(' ', room)
|
|
36
|
+
const at = space > 0 ? space : room
|
|
37
|
+
lines.push(prefix + rest.slice(0, at).trimEnd())
|
|
38
|
+
rest = rest.slice(at).trimStart()
|
|
39
|
+
prefix = indent
|
|
40
|
+
}
|
|
41
|
+
if (rest !== '' || lines.length === 0) lines.push(prefix + rest)
|
|
42
|
+
return lines
|
|
43
|
+
}
|
|
44
|
+
|
|
16
45
|
// `rows` as a boxed table of `columns`, its header their names. `paint(text, column, row)`, where
|
|
17
|
-
// given, styles the text of each cell of a row (with colour, say), its padding after, unstyled
|
|
18
|
-
|
|
46
|
+
// given, styles the text of each cell of a row (with colour, say), its padding after, unstyled;
|
|
47
|
+
// `paintHeader(text, column)` each name in the header, and `paintFrame(text)` the box drawn around them.
|
|
48
|
+
// Where `width` is given and the table is wider, the `wrap` columns narrow, the widest first, to fit it
|
|
49
|
+
// where they can (see MAX_WHOLE_WORD), their text wrapped (see wrapLine); a `multiline` column's further
|
|
50
|
+
// lines of an entry indented, so they don't read as entries of their own.
|
|
51
|
+
export function formatTable(rows, columns, { multiline = [], paint, paintHeader, paintFrame, width, wrap = [] } = {}) {
|
|
19
52
|
if (rows.length === 0) return ''
|
|
20
53
|
const ml = new Set(multiline)
|
|
21
54
|
const linesOf = (obj) => columns.map((c) => cellLines(obj[c], ml.has(c)))
|
|
22
55
|
const header = columns.map((c) => [c])
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
Math.max(c.length,
|
|
56
|
+
let body = rows.map((r) => linesOf(r))
|
|
57
|
+
const measure = () => columns.map((c, i) =>
|
|
58
|
+
Math.max(c.length, longest(body, (cells) => longest(cells[i])))
|
|
26
59
|
)
|
|
27
|
-
|
|
60
|
+
let widths = measure()
|
|
61
|
+
// Each column's text, a space either side, and a border after it; one more border before the first.
|
|
62
|
+
const total = () => widths.reduce((sum, w) => sum + w + 3, 1)
|
|
63
|
+
const wrapping = columns.flatMap((c, i) => (wrap.includes(c) ? [i] : []))
|
|
64
|
+
if (width !== undefined && wrapping.length > 0 && total() > width) {
|
|
65
|
+
const indent = (i) => (ml.has(columns[i]) ? INDENT : '')
|
|
66
|
+
const longestWord = (i) => longest(body, (cells) => longest(cells[i], (line) => longest(line.split(' '))))
|
|
67
|
+
const floors = new Map(wrapping.map((i) => [i, Math.max(columns[i].length, indent(i).length + Math.min(MAX_WHOLE_WORD, longestWord(i)))]))
|
|
68
|
+
while (total() > width) {
|
|
69
|
+
const widest = wrapping.filter((i) => widths[i] > floors.get(i)).toSorted((a, b) => widths[b] - widths[a])[0]
|
|
70
|
+
if (widest === undefined) break
|
|
71
|
+
widths[widest]--
|
|
72
|
+
}
|
|
73
|
+
const narrowed = widths
|
|
74
|
+
body = body.map((cells) => cells.map((lines, i) =>
|
|
75
|
+
wrapping.includes(i) ? lines.flatMap((l) => wrapLine(l, narrowed[i], indent(i))) : lines))
|
|
76
|
+
widths = measure()
|
|
77
|
+
}
|
|
78
|
+
const frame = (text) => (paintFrame ? paintFrame(text) : text)
|
|
79
|
+
const bar = frame('│')
|
|
80
|
+
const line = (l, m, r, fill) => frame(l + widths.map((w) => fill.repeat(w + 2)).join(m) + r)
|
|
28
81
|
// A row spans as many physical lines as its tallest cell; shorter cells pad
|
|
29
82
|
// out with blanks so the borders stay aligned.
|
|
30
|
-
const render = (cells,
|
|
31
|
-
const height =
|
|
83
|
+
const render = (cells, style) => {
|
|
84
|
+
const height = longest(cells)
|
|
32
85
|
const out = []
|
|
33
86
|
for (let i = 0; i < height; i++) {
|
|
34
|
-
out.push(
|
|
87
|
+
out.push(`${bar} ${cells.map((c, j) => {
|
|
35
88
|
const text = c[i] ?? ''
|
|
36
|
-
return (
|
|
37
|
-
}).join(
|
|
89
|
+
return (style && text !== '' ? style(text, columns[j]) : text) + ' '.repeat(widths[j] - text.length)
|
|
90
|
+
}).join(` ${bar} `)} ${bar}`)
|
|
38
91
|
}
|
|
39
92
|
return out.join('\n')
|
|
40
93
|
}
|
|
41
94
|
return [
|
|
42
95
|
line('┌', '┬', '┐', '─'),
|
|
43
|
-
render(header),
|
|
96
|
+
render(header, paintHeader),
|
|
44
97
|
line('├', '┼', '┤', '─'),
|
|
45
|
-
...body.map((cells, at) => render(cells, rows[at])),
|
|
98
|
+
...body.map((cells, at) => render(cells, paint && ((text, column) => paint(text, column, rows[at])))),
|
|
46
99
|
line('└', '┴', '┘', '─'),
|
|
47
100
|
].join('\n')
|
|
48
101
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Types of `@exodus/stasis/validate-notes` (validate-notes.js), whose comments tell what each does.
|
|
2
|
+
|
|
3
|
+
export const OWN_REASONS: Readonly<Record<string, string>>
|
|
4
|
+
export const PACKAGE_REASONS: Readonly<Record<string, string>>
|
|
5
|
+
export const PATCH_ERRORS: Readonly<Record<string, string>>
|
|
6
|
+
export const FILE_REASONS: Readonly<Record<string, string>>
|
|
7
|
+
export const LOCKFILE_ERRORS: Readonly<Record<string, string>>
|
|
8
|
+
|
|
9
|
+
// A package as a report tells it, as much as its note reads.
|
|
10
|
+
export interface NotedPackage {
|
|
11
|
+
reason?: string
|
|
12
|
+
at?: string
|
|
13
|
+
directory?: string
|
|
14
|
+
patch?: { path?: string; from?: string; error?: string; verified?: boolean; applied?: boolean }
|
|
15
|
+
}
|
|
16
|
+
export type NotePart = string | { path: string }
|
|
17
|
+
export function noteOf(pkg: NotedPackage): NotePart[]
|
|
18
|
+
export function noteText(pkg: NotedPackage): string
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// What a validation's report (validate.js's) tells, in words: why own code, a package or a file
|
|
2
|
+
// wasn't checked or is as it is, why no lockfile was held to, and a package's note beside its status.
|
|
3
|
+
// Of no module, for a browser too (`@exodus/stasis/validate-notes`), as printValidationReport tells it.
|
|
4
|
+
|
|
5
|
+
// Why own code wasn't checked, by `own.reason`.
|
|
6
|
+
export const OWN_REASONS = {
|
|
7
|
+
skipped: 'skipped (--only-deps): its dependencies alone validated',
|
|
8
|
+
'no-repository': 'no repository to read it of',
|
|
9
|
+
'no-commit': 'no commit to read it at',
|
|
10
|
+
'commit-not-in-history': 'its commit is in the history of no branch or tag of its repository (a fork\'s, say)',
|
|
11
|
+
'history-unread': 'its commit is at no tag or branch head, nor in its default branch\'s history, and not every other branch was compared',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// A package's reason, unverified (the first) or failing its lockfile (the last four).
|
|
15
|
+
export const PACKAGE_REASONS = {
|
|
16
|
+
local: 'installed from a directory of the repository, which isn\'t read',
|
|
17
|
+
'patch-unverified': 'as patched by the bundle\'s patch, which isn\'t verified against the repository',
|
|
18
|
+
git: 'locked from git, not a registry',
|
|
19
|
+
'not-registry': 'locked from elsewhere than its registry',
|
|
20
|
+
'no-integrity': 'locked with no sha512 to hold its tarball to',
|
|
21
|
+
unsupported: 'no upstream package for its ecosystem',
|
|
22
|
+
unnamed: 'no name or version recorded',
|
|
23
|
+
'not-published': 'not published',
|
|
24
|
+
unreadable: 'its registry refused it',
|
|
25
|
+
timeout: 'not reached in time',
|
|
26
|
+
failed: 'could not be fetched',
|
|
27
|
+
'alias-unverified': 'installed under another name, an alias no lockfile read tells of',
|
|
28
|
+
misplaced: 'installed where its path or its lockfile names another package or version',
|
|
29
|
+
'not-locked': 'not locked by the lockfile',
|
|
30
|
+
'integrity-mismatch': 'its registry\'s tarball is not the one the lockfile locks',
|
|
31
|
+
'integrity-conflict': 'locked with two integrities',
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Why a patch wasn't applied, told after `its patch` and its path.
|
|
35
|
+
export const PATCH_ERRORS = {
|
|
36
|
+
'patch-not-in-repository': 'is the bundle\'s, not the repository\'s',
|
|
37
|
+
'patch-not-found': 'is in no file of its hash (the bundle\'s, or the patches directory\'s)',
|
|
38
|
+
'patch-mismatch': 'is not of the hash its lockfile locks',
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Why a file is as it is, by a problem's `reason`.
|
|
42
|
+
export const FILE_REASONS = { symlink: 'a symlink in the repository', submodule: 'in a submodule', 'tree-cut': 'the repository\'s tree was too large to list whole' }
|
|
43
|
+
|
|
44
|
+
// Why the dependencies were held to no lockfile, by a report's `lockfileError` (a ValidateError's code).
|
|
45
|
+
export const LOCKFILE_ERRORS = {
|
|
46
|
+
'no-lockfile': 'no lockfile of its repository locks them',
|
|
47
|
+
'lockfile-ambiguous': 'more than one package manager\'s lockfile installs it',
|
|
48
|
+
'lockfile-unreadable': 'its lockfile couldn\'t be read',
|
|
49
|
+
'lockfile-unsupported': 'its lockfile is of a kind validate doesn\'t read',
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// What a report tells of a package beside its status, as parts: text, and the paths in it as `{ path }`,
|
|
53
|
+
// for a caller to set apart: why it is unverified or fails its lockfile, its patch, or the directory
|
|
54
|
+
// it is held to; none where nothing more.
|
|
55
|
+
export function noteOf(pkg) {
|
|
56
|
+
const { patch } = pkg
|
|
57
|
+
if (pkg.reason) return [PACKAGE_REASONS[pkg.reason] ?? pkg.reason, ...(pkg.at ? [': ', { path: pkg.at }] : [])]
|
|
58
|
+
if (patch?.error) return ['its patch', ...(patch.path ? [' ', { path: patch.path }] : []), ` ${PATCH_ERRORS[patch.error] ?? `could not be applied (${patch.error})`}`]
|
|
59
|
+
// A patch the bundle holds, as checked against the repository.
|
|
60
|
+
const whose = patch?.from !== 'bundle' ? [] : [patch.verified ? ' (the bundle\'s, as the repository has it)' : ' (the bundle\'s, not verified against the repository)']
|
|
61
|
+
if (patch) return [patch.applied === false ? 'locked patched, bundled as published' : 'patched', ...(patch.path ? [' by ', { path: patch.path }, ...whose] : [])]
|
|
62
|
+
return pkg.directory ? ['held to ', { path: pkg.directory }, ' of the repository'] : []
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// A package's note as text: '' where nothing more.
|
|
66
|
+
export const noteText = (pkg) => noteOf(pkg).map((part) => (typeof part === 'string' ? part : part.path)).join('')
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// Types of `@exodus/stasis/validate` (validate.js), whose comments tell what each does.
|
|
2
|
+
import type { Client, RepoDirEntry } from '@preventive/upstream/github.js'
|
|
3
|
+
|
|
4
|
+
export { HttpError } from '@preventive/upstream/npm.js'
|
|
5
|
+
|
|
6
|
+
export const MAX_TOLD: number
|
|
7
|
+
export const FETCHED: ReadonlySet<string>
|
|
8
|
+
|
|
9
|
+
export class PatchError extends Error {
|
|
10
|
+
constructor(code: string)
|
|
11
|
+
code: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type ValidateErrorCode = 'not-a-bundle' | 'no-repository' | 'no-commit' | 'commit-not-in-history' | 'history-unread'
|
|
15
|
+
| 'no-lockfile' | 'lockfile-ambiguous' | 'lockfile-unsupported' | 'lockfile-unreadable'
|
|
16
|
+
export class ValidateError extends Error {
|
|
17
|
+
constructor(code: ValidateErrorCode, message: string)
|
|
18
|
+
code: ValidateErrorCode
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// What validation checks of a bundle (validationPlan).
|
|
22
|
+
export interface PlanFile { path: string; dir: string; rel: string; format?: string; bytes(): Uint8Array }
|
|
23
|
+
export interface PlanPackage { ecosystem: string; name: string; version: string; files: PlanFile[] }
|
|
24
|
+
export interface ValidationPlan { files: number; own: PlanFile[]; packages: PlanPackage[]; patches: Map<string, string> }
|
|
25
|
+
// A parsed bundle (Bundle.parse's, or parseFileWithKind's artifact).
|
|
26
|
+
export interface PlannedBundle {
|
|
27
|
+
modules: Map<string, { name?: string; version?: string; ecosystem?: string; files: Record<string, unknown> }>
|
|
28
|
+
formats?: Map<string, string>
|
|
29
|
+
}
|
|
30
|
+
export function validationPlan(bundle: PlannedBundle): ValidationPlan
|
|
31
|
+
|
|
32
|
+
export function gitBlobId(bytes: Uint8Array): string
|
|
33
|
+
export function tarballFiles(tarball: Uint8Array): Promise<Map<string, Uint8Array | { symlink: string }>>
|
|
34
|
+
|
|
35
|
+
// A version's files by their paths; a crate's with its sha256 in hex.
|
|
36
|
+
export type PackageFiles = Map<string, Uint8Array> & { checksum?: string }
|
|
37
|
+
export type Fetch = (ecosystem: string, name: string, version: string, integrity?: string) => Promise<PackageFiles>
|
|
38
|
+
export const fetchPackage: Fetch
|
|
39
|
+
export function fetchFailure(error: unknown): 'not-published' | 'unreadable' | 'integrity-mismatch' | 'failed'
|
|
40
|
+
|
|
41
|
+
export interface PatchFile { path: string; from?: string; deleted?: true; created?: true; hunks: unknown[] }
|
|
42
|
+
export function isPatchOf(text: string, hash: string): boolean
|
|
43
|
+
export function parsePatch(patch: string): PatchFile[]
|
|
44
|
+
export function patchedFiles(files: Map<string, Uint8Array>, patch: PatchFile[]): Map<string, Uint8Array>
|
|
45
|
+
|
|
46
|
+
// A file of the repository: its bytes, git's blob id, a symlink, or in a submodule.
|
|
47
|
+
export type RepositoryEntry = { data: Uint8Array } | { sha: string } | { symlink: string } | { submodule: true }
|
|
48
|
+
export type Ref = { branch: string } | { tag: string }
|
|
49
|
+
interface Where { repository: string; movedFrom?: string; commit: string; ref?: Ref; directory: string }
|
|
50
|
+
// Own code as validateBundle takes it: read, or not and why.
|
|
51
|
+
export type OwnCode = (Where & { entries: Map<string, RepositoryEntry>; cut?: boolean })
|
|
52
|
+
| (Partial<Where> & { reason: string; entries?: Map<string, RepositoryEntry> })
|
|
53
|
+
|
|
54
|
+
export interface Lock { from: 'registry' | 'git' | 'elsewhere' | 'local'; integrity?: string; conflict?: true; directories?: string[] }
|
|
55
|
+
export interface Lockfile {
|
|
56
|
+
path: string
|
|
57
|
+
text: string
|
|
58
|
+
from?: 'repository' | 'local'
|
|
59
|
+
read?: (path: string) => string | Promise<string>
|
|
60
|
+
tree?: (dir: string) => Promise<Map<string, Uint8Array>>
|
|
61
|
+
patches?: string[]
|
|
62
|
+
root?: string
|
|
63
|
+
}
|
|
64
|
+
// A patch pnpm's lockfile names for a version: by its path, or by its hash alone, in a file of one of
|
|
65
|
+
// `names` in a patches directory (locate).
|
|
66
|
+
export type LockedPatch = { hash: string; path: string } | { hash: string; names: string[] }
|
|
67
|
+
export interface Locked {
|
|
68
|
+
lockfiles: string[]
|
|
69
|
+
locks(ecosystem: string): boolean
|
|
70
|
+
lock(ecosystem: string, name: string, version: string): Lock | null | undefined
|
|
71
|
+
of(name: string, version: string): LockedPatch | null | undefined
|
|
72
|
+
locate(patch: { hash: string; names?: string[] }): Promise<{ path: string; text: string } | null>
|
|
73
|
+
installed(dir: string): string | null | undefined
|
|
74
|
+
aliased(as: string, named: string): boolean | undefined
|
|
75
|
+
from?: 'repository' | 'local'
|
|
76
|
+
tree?: (dir: string) => Promise<Map<string, Uint8Array>>
|
|
77
|
+
read(path: string): Promise<string>
|
|
78
|
+
}
|
|
79
|
+
export function lockedBy(lockfiles: Lockfile[]): Locked
|
|
80
|
+
|
|
81
|
+
export interface Problem { path: string; kind: 'differs' | 'unexpected' | 'unverified'; of: string; reason?: string }
|
|
82
|
+
export interface PackageReport {
|
|
83
|
+
ecosystem: string
|
|
84
|
+
name: string
|
|
85
|
+
version: string
|
|
86
|
+
files: number
|
|
87
|
+
status: 'valid' | 'invalid' | 'unverified'
|
|
88
|
+
reason?: string
|
|
89
|
+
at?: string
|
|
90
|
+
directory?: string
|
|
91
|
+
patch?: { hash?: string; path?: string; from?: 'repository' | 'local' | 'bundle'; error?: string; applied?: boolean }
|
|
92
|
+
}
|
|
93
|
+
export interface BundleValidation {
|
|
94
|
+
validatedAt: number
|
|
95
|
+
status: 'valid' | 'invalid' | 'incomplete'
|
|
96
|
+
own: (Where & { checked: true; cut?: true }) | { checked: false; reason: string; patches?: number }
|
|
97
|
+
lockfiles: string[] | null
|
|
98
|
+
counts: Record<'files' | 'own' | 'dependencies' | 'matched' | 'eol' | 'differs' | 'unexpected' | 'unverified' | 'skipped' | 'packages' | 'validPackages' | 'lockFailures' | 'misplaced', number>
|
|
99
|
+
problems: Problem[]
|
|
100
|
+
moreProblems: number
|
|
101
|
+
packages: PackageReport[]
|
|
102
|
+
// validateRepository's, `strict` false: why no lockfile was held to.
|
|
103
|
+
lockfileError?: ValidateErrorCode
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function validateBundle(plan: ValidationPlan, own: OwnCode | Promise<OwnCode>,
|
|
107
|
+
options?: { fetch?: Fetch; locked?: Locked | null; deadline?: number; now?: () => number }): Promise<BundleValidation>
|
|
108
|
+
export function exitCodeOf(report: BundleValidation, options?: { allowUnverified?: boolean }): 0 | 1 | 2
|
|
109
|
+
|
|
110
|
+
type Read = 'getRepoTreeId' | 'getRepoTreeTarball' | 'listRepoDir' | 'getRepoFile' | 'getRepoHead' | 'listRepoTags' | 'listRepoBranches' | 'compareCommits'
|
|
111
|
+
// The reads of upstream's client followingMoves wraps, and getRepo, which it follows a move by.
|
|
112
|
+
type Reads = Pick<Client, Read | 'getRepo'>
|
|
113
|
+
// A repository's reads (followingMoves's), where it has moved too.
|
|
114
|
+
export type Repository = { name(): string } & { [M in Read]: (options: Omit<Parameters<Client[M]>[0], 'repo'>) => ReturnType<Client[M]> }
|
|
115
|
+
export function followingMoves(client: Reads, github: string): Repository
|
|
116
|
+
export function historyOf(repository: Repository, commit: string, options?: { maxCompared?: number; deadline?: number; now?: () => number }): Promise<Ref | null>
|
|
117
|
+
|
|
118
|
+
export function repositoryFiles(repository: Repository, where: { github?: string; commit: string; directory?: string }): Promise<Map<string, RepositoryEntry>>
|
|
119
|
+
export function repositoryLockfiles(options: { directory?: string; ecosystems: Set<string>; list: (dir: string) => Promise<string[]>; read: (path: string) => Promise<string> })
|
|
120
|
+
: Promise<{ path: string; text: string }[]>
|
|
121
|
+
|
|
122
|
+
interface Options { own?: boolean; fetch?: Fetch; deadline?: number }
|
|
123
|
+
export function validateRepository(plan: ValidationPlan, where: { repository?: Repository | null; commit?: string; directory?: string }, options?: Options & {
|
|
124
|
+
lockfile?: boolean | Lockfile[]
|
|
125
|
+
// A listing of the commit's tree, as upstream's listRepoTree gives it, for these paths.
|
|
126
|
+
listTree?: (paths: string[]) => Promise<{ entries: RepoDirEntry[]; cut?: boolean }>
|
|
127
|
+
strict?: boolean
|
|
128
|
+
}): Promise<BundleValidation>
|
|
129
|
+
export function validate(file: string, options?: Options & { client?: Reads; github?: string; sha?: string; directory?: string; lockfile?: boolean | string[] }): Promise<BundleValidation>
|
|
130
|
+
|
|
131
|
+
type Stream = { write(chunk: string): unknown }
|
|
132
|
+
export function printValidationReport(report: BundleValidation, options?: { out?: Stream; err?: Stream; showValid?: boolean; colors?: boolean }): void
|