@packtory/cli 0.0.21 → 0.0.23
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/command-line-interface/runner/failure-printing.js +19 -18
- package/command-line-interface/runner/failure-printing.js.map +1 -1
- package/command-line-interface/runner/pack-handler.js +41 -48
- package/command-line-interface/runner/pack-handler.js.map +1 -1
- package/command-line-interface/runner/preview-handler.js +5 -8
- package/command-line-interface/runner/preview-handler.js.map +1 -1
- package/command-line-interface/runner/release-diff-handler.js +2 -10
- package/command-line-interface/runner/release-diff-handler.js.map +1 -1
- package/command-line-interface/spinner/line-spinner-renderer.js +2 -1
- package/command-line-interface/spinner/line-spinner-renderer.js.map +1 -1
- package/command-line-interface/spinner/spinner-shared-state.js +117 -91
- package/command-line-interface/spinner/spinner-shared-state.js.map +1 -1
- package/command-line-interface/spinner/terminal-spinner-renderer.js +5 -1
- package/command-line-interface/spinner/terminal-spinner-renderer.js.map +1 -1
- package/common/path-tree.js +9 -4
- package/common/path-tree.js.map +1 -1
- package/package.json +3 -2
- package/report/html-renderer/artifact-tree-renderer.js +2 -1
- package/report/html-renderer/artifact-tree-renderer.js.map +1 -1
- package/report/html-renderer/diff-renderer.js +2 -4
- package/report/html-renderer/diff-renderer.js.map +1 -1
- package/report/html-renderer/html-renderer.js +1 -1
- package/report/html-renderer/html-renderer.js.map +1 -1
- package/report/html-renderer/html-styles.js +3 -1
- package/report/html-renderer/html-styles.js.map +1 -1
- package/report/preview/artifact-tree-builder.js +4 -4
- package/report/preview/artifact-tree-builder.js.map +1 -1
- package/report/preview/bundle-artifact-index.js +2 -1
- package/report/preview/bundle-artifact-index.js.map +1 -1
- package/report/preview/{preview-document-helpers.js → preview-document-state.js} +5 -7
- package/report/preview/preview-document-state.js.map +1 -0
- package/report/preview/preview-document.js +39 -16
- package/report/preview/preview-document.js.map +1 -1
- package/report/preview/preview-result-inspectors.js +25 -21
- package/report/preview/preview-result-inspectors.js.map +1 -1
- package/report/preview/preview-summary.js +19 -47
- package/report/preview/preview-summary.js.map +1 -1
- package/report/release-diff/release-diff-document.js +7 -3
- package/report/release-diff/release-diff-document.js.map +1 -1
- package/report/release-diff/release-diff-summary.js +3 -2
- package/report/release-diff/release-diff-summary.js.map +1 -1
- package/report/terminal-renderer/terminal-artifact-renderer.js +3 -1
- package/report/terminal-renderer/terminal-artifact-renderer.js.map +1 -1
- package/report/terminal-renderer/terminal-package-renderer.js +11 -14
- package/report/terminal-renderer/terminal-package-renderer.js.map +1 -1
- package/report/terminal-renderer/terminal-preview-renderer-shared.js +13 -10
- package/report/terminal-renderer/terminal-preview-renderer-shared.js.map +1 -1
- package/report/terminal-renderer/terminal-release-diff-package-renderer.js +72 -71
- package/report/terminal-renderer/terminal-release-diff-package-renderer.js.map +1 -1
- package/report/terminal-renderer/terminal-release-diff-renderer.js +22 -29
- package/report/terminal-renderer/terminal-release-diff-renderer.js.map +1 -1
- package/sbom.cdx.json +27 -10
- package/report/preview/changed-artifacts.js +0 -10
- package/report/preview/changed-artifacts.js.map +0 -1
- package/report/preview/preview-document-helpers.js.map +0 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { packageReleaseDiffState } from "packtory/report/release-diff/file-set-diff.js";
|
|
1
2
|
function classifyStateCounts(packages) {
|
|
2
3
|
let changedPackages = 0;
|
|
3
4
|
let firstPublishPackages = 0;
|
|
4
5
|
let unchangedPackages = 0;
|
|
5
6
|
for (const pkg of packages) {
|
|
6
|
-
if (pkg.state ===
|
|
7
|
+
if (pkg.state === packageReleaseDiffState.changed) {
|
|
7
8
|
changedPackages += 1;
|
|
8
9
|
}
|
|
9
|
-
else if (pkg.state ===
|
|
10
|
+
else if (pkg.state === packageReleaseDiffState.firstPublish) {
|
|
10
11
|
firstPublishPackages += 1;
|
|
11
12
|
}
|
|
12
13
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-diff-summary.js","sourceRoot":"","sources":["../../../../../source/report/release-diff/release-diff-summary.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"release-diff-summary.js","sourceRoot":"","sources":["../../../../../source/report/release-diff/release-diff-summary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAoC,MAAM,oBAAoB,CAAC;AAa/F,SAAS,mBAAmB,CAAC,QAAgD;IAKzE,IAAI,eAAe,GAAG,CAAC,CAAC;IACxB,IAAI,oBAAoB,GAAG,CAAC,CAAC;IAC7B,IAAI,iBAAiB,GAAG,CAAC,CAAC;IAC1B,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QACzB,IAAI,GAAG,CAAC,KAAK,KAAK,uBAAuB,CAAC,OAAO,EAAE,CAAC;YAChD,eAAe,IAAI,CAAC,CAAC;QACzB,CAAC;aAAM,IAAI,GAAG,CAAC,KAAK,KAAK,uBAAuB,CAAC,YAAY,EAAE,CAAC;YAC5D,oBAAoB,IAAI,CAAC,CAAC;QAC9B,CAAC;aAAM,CAAC;YACJ,iBAAiB,IAAI,CAAC,CAAC;QAC3B,CAAC;IACL,CAAC;IACD,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,CAAC;AACxE,CAAC;AAED,SAAS,mBAAmB,CAAC,QAAgD;IAKzE,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,IAAI,aAAa,GAAG,CAAC,CAAC;IACtB,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QACzB,UAAU,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;QACrC,YAAY,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QACzC,aAAa,IAAI,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;IAC/C,CAAC;IACD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,oBAAoB,CAChC,QAAgD,EAChD,cAAsB;IAEtB,MAAM,WAAW,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACjD,OAAO;QACH,aAAa,EAAE,QAAQ,CAAC,MAAM,GAAG,cAAc;QAC/C,GAAG,WAAW;QACd,cAAc;QACd,GAAG,UAAU;KAChB,CAAC;AACN,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
/* eslint-disable @stylistic/max-len, sonarjs/no-nested-template-literals, functional/prefer-tacit -- terminal rendering is intentionally linear and string-heavy */
|
|
2
|
+
import { pathTreeNodeType } from "../../common/path-tree.js";
|
|
1
3
|
import { artifactBadgeLabel, artifactStatusLabel } from "../preview/preview-document.js";
|
|
2
4
|
function formatBytes(bytes) {
|
|
3
5
|
return `${bytes} B`;
|
|
4
6
|
}
|
|
5
7
|
export function renderArtifactNode(node, colors) {
|
|
6
8
|
const indent = ` ${' '.repeat(node.depth)}`;
|
|
7
|
-
if (node.type ===
|
|
9
|
+
if (node.type === pathTreeNodeType.directory) {
|
|
8
10
|
return `${indent}${colors.bold(`▸ ${node.name}/`)}`;
|
|
9
11
|
}
|
|
10
12
|
const { artifact } = node;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal-artifact-renderer.js","sourceRoot":"","sources":["../../../../../source/report/terminal-renderer/terminal-artifact-renderer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"terminal-artifact-renderer.js","sourceRoot":"","sources":["../../../../../source/report/terminal-renderer/terminal-artifact-renderer.ts"],"names":[],"mappings":"AAAA,oKAAoK;AACpK,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAGzF,SAAS,WAAW,CAAC,KAAa;IAC9B,OAAO,GAAG,KAAK,IAAI,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAyB,EAAE,MAAc;IACxE,MAAM,MAAM,GAAG,KAAK,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;IAC9C,IAAI,IAAI,CAAC,IAAI,KAAK,gBAAgB,CAAC,SAAS,EAAE,CAAC;QAC3C,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;IACxD,CAAC;IACD,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAC1B,MAAM,UAAU,GAAG;QACf,mBAAmB,CAAC,QAAQ,CAAC,MAAM,CAAC;QACpC,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YAC7B,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC,CAAC;KACL,CAAC;IACF,OAAO,GAAG,MAAM,KAAK,QAAQ,CAAC,IAAI,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,IAAI,KAAK,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,CACvH,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAC/B,EAAE,CAAC,OAAO,EAAE,CAAC;AAClB,CAAC;AAED,OAAO,EAAE,WAAW,IAAI,mBAAmB,EAAE,CAAC"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-statements, complexity, sonarjs/no-nested-template-literals, unicorn/prefer-single-call -- terminal rendering is intentionally linear and string-heavy */
|
|
2
|
-
import { collectChangedArtifacts } from "../preview/changed-artifacts.js";
|
|
3
1
|
import { formatTerminalBytes, renderArtifactNode } from "./terminal-artifact-renderer.js";
|
|
4
2
|
import { renderDiffLine } from "./terminal-preview-renderer-shared.js";
|
|
5
3
|
export function renderPackage(pkg, colors) {
|
|
@@ -9,25 +7,24 @@ export function renderPackage(pkg, colors) {
|
|
|
9
7
|
if (pkg.failure !== undefined) {
|
|
10
8
|
lines.push(`${colors.red(' failure')} ${pkg.failure.stage}: ${pkg.failure.message}`);
|
|
11
9
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
10
|
+
for (const node of pkg.tree) {
|
|
11
|
+
lines.push(renderArtifactNode(node, colors));
|
|
12
|
+
}
|
|
15
13
|
if (pkg.eliminatedSourceFiles.length > 0) {
|
|
16
14
|
lines.push(` ${colors.bold('Eliminated source files')}`);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
15
|
+
for (const file of pkg.eliminatedSourceFiles) {
|
|
16
|
+
lines.push(` - ${file.path} ${colors.dim(`(${formatTerminalBytes(file.sourceBytes)})`)}`);
|
|
17
|
+
}
|
|
20
18
|
}
|
|
21
|
-
|
|
22
|
-
if (changedFiles.length > 0) {
|
|
19
|
+
if (pkg.changedArtifacts.length > 0) {
|
|
23
20
|
lines.push(` ${colors.bold('Diffs')}`);
|
|
24
|
-
for (const artifact of
|
|
21
|
+
for (const artifact of pkg.changedArtifacts) {
|
|
25
22
|
lines.push(` ${artifact.path}`);
|
|
26
23
|
for (const hunk of artifact.diff) {
|
|
27
24
|
lines.push(` ${colors.dim(hunk.header)}`);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
25
|
+
for (const line of hunk.lines) {
|
|
26
|
+
lines.push(` ${renderDiffLine(line, colors)}`);
|
|
27
|
+
}
|
|
31
28
|
}
|
|
32
29
|
}
|
|
33
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal-package-renderer.js","sourceRoot":"","sources":["../../../../../source/report/terminal-renderer/terminal-package-renderer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"terminal-package-renderer.js","sourceRoot":"","sources":["../../../../../source/report/terminal-renderer/terminal-package-render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AI,GAAG,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClC,KAAK,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACxC,KAAK,MAAM,QAAQ,IAAI,GAAG,CAAC,gBAAgB,EAAE,CAAC;YAC1C,KAAK,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;YACnC,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;gBAC/B,KAAK,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBAC/C,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;oBAC5B,KAAK,CAAC,IAAI,CAAC,SAAS,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;gBACxD,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { bold, dim, green, red, yellow } from 'yoctocolors';
|
|
2
|
+
import { previewResultType } from "packtory/packtory/packtory-results.js";
|
|
3
|
+
import { previewDiffLineType } from "packtory/report/preview/preview-document-diff.js";
|
|
2
4
|
const ansi = {
|
|
3
5
|
bold: { open: 1, close: 22 },
|
|
4
6
|
dim: { open: 2, close: 22 },
|
|
@@ -14,10 +16,8 @@ function withAnsi(openCode, closeCode) {
|
|
|
14
16
|
return `\u001B[${openCode}m${value}\u001B[${closeCode}m`;
|
|
15
17
|
};
|
|
16
18
|
}
|
|
19
|
+
const disabledColors = { bold: identity, dim: identity, green: identity, red: identity, yellow: identity };
|
|
17
20
|
export function createColors(enabled) {
|
|
18
|
-
if (enabled === false) {
|
|
19
|
-
return { bold: identity, dim: identity, green: identity, red: identity, yellow: identity };
|
|
20
|
-
}
|
|
21
21
|
if (enabled === true) {
|
|
22
22
|
return {
|
|
23
23
|
bold: withAnsi(ansi.bold.open, ansi.bold.close),
|
|
@@ -27,26 +27,29 @@ export function createColors(enabled) {
|
|
|
27
27
|
yellow: withAnsi(ansi.yellow.open, ansi.yellow.close)
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
if (enabled === undefined) {
|
|
31
|
+
return { bold, dim, green, red, yellow };
|
|
32
|
+
}
|
|
33
|
+
return disabledColors;
|
|
31
34
|
}
|
|
32
35
|
export function renderDiffLine(line, colors) {
|
|
33
|
-
if (line.type ===
|
|
36
|
+
if (line.type === previewDiffLineType.add) {
|
|
34
37
|
return colors.green(line.text);
|
|
35
38
|
}
|
|
36
|
-
if (line.type ===
|
|
39
|
+
if (line.type === previewDiffLineType.remove) {
|
|
37
40
|
return colors.red(line.text);
|
|
38
41
|
}
|
|
39
42
|
return line.text;
|
|
40
43
|
}
|
|
41
44
|
const resultTypeHeadings = {
|
|
42
|
-
config: 'Configuration issues',
|
|
43
|
-
checks: 'Check failures',
|
|
44
|
-
partial: 'Package failures'
|
|
45
|
+
[previewResultType.config]: 'Configuration issues',
|
|
46
|
+
[previewResultType.checks]: 'Check failures',
|
|
47
|
+
[previewResultType.partial]: 'Package failures'
|
|
45
48
|
};
|
|
46
49
|
export function renderFailureDocumentHeader(document, colors) {
|
|
47
50
|
const chip = `[${document.modeLabel}]`;
|
|
48
51
|
const lines = [`${colors.bold(document.title)} ${colors.yellow(chip)}`];
|
|
49
|
-
if (document.resultType !==
|
|
52
|
+
if (document.resultType !== previewResultType.success) {
|
|
50
53
|
lines.push(colors.red(resultTypeHeadings[document.resultType]));
|
|
51
54
|
}
|
|
52
55
|
lines.push(...document.issues.map((issue) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal-preview-renderer-shared.js","sourceRoot":"","sources":["../../../../../source/report/terminal-renderer/terminal-preview-renderer-shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"terminal-preview-renderer-shared.js","sourceRoot":"","sources":["../../../../../source/report/terminal-renderer/terminal-preview-renderer-shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAwB,MAAM,qCAAqC,CAAC;AAUhG,MAAM,IAAI,GAAG;IACT,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC5B,GAAG,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3B,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9B,GAAG,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;IAC5B,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;CACzB,CAAC;AAEX,SAAS,QAAQ,CAAC,KAAa;IAC3B,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,SAAS,QAAQ,CAAC,QAAgB,EAAE,SAAiB;IACjD,OAAO,CAAC,KAAK,EAAE,EAAE;QACb,OAAO,UAAU,QAAQ,IAAI,KAAK,UAAU,SAAS,GAAG,CAAC;IAC7D,CAAC,CAAC;AACN,CAAC;AAED,MAAM,cAAc,GAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,E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,kBAAkB,GAAG;IACvB,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,sBAAsB;IAClD,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,gBAAgB;IAC5C,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,kBAAkB;CACzC,CAAC;AAEX,MAAM,UAAU,2BAA2B,CAAC,QAA+B,EAAE,MAAc;IACvF,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,SAAS,GAAG,CAAC;IACvC,MAAM,KAAK,GAAG,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxE,IAAI,QAAQ,CAAC,UAAU,KAAK,iBAAiB,CAAC,OAAO,EAAE,CAAC;QACpD,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACpE,CAAC;IACD,KAAK,CAAC,IAAI,CACN,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAC7B,OAAO,KAAK,KAAK,EAAE,CAAC;IACxB,CAAC,CAAC,CACL,CAAC;IACF,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
|
@@ -1,89 +1,88 @@
|
|
|
1
1
|
/* eslint-disable sonarjs/no-nested-template-literals, @stylistic/max-len -- terminal rendering is intentionally linear and string-heavy */
|
|
2
|
-
import { buildPathTree } from "../../common/path-tree.js";
|
|
2
|
+
import { buildPathTree, pathTreeNodeType } from "../../common/path-tree.js";
|
|
3
|
+
import { modifiedFileContentChangeKind, packageReleaseDiffState } from "packtory/report/release-diff/file-set-diff.js";
|
|
3
4
|
import { formatTerminalBytes } from "./terminal-artifact-renderer.js";
|
|
4
5
|
import { renderDiffLine } from "./terminal-preview-renderer-shared.js";
|
|
5
6
|
const fileMarker = { added: '+', modified: '~', removed: '-' };
|
|
7
|
+
const modifiedAnnotationLabel = {
|
|
8
|
+
[modifiedFileContentChangeKind.binary]: ' (binary, no text diff)',
|
|
9
|
+
[modifiedFileContentChangeKind.modeOnly]: ' (mode only)',
|
|
10
|
+
[modifiedFileContentChangeKind.text]: ''
|
|
11
|
+
};
|
|
12
|
+
const hunkIndentDepthIncrement = 2;
|
|
6
13
|
function indent(depth) {
|
|
7
14
|
return ` ${' '.repeat(depth)}`;
|
|
8
15
|
}
|
|
9
16
|
function renderDirectoryLine(node, colors) {
|
|
10
17
|
return `${indent(node.depth)}${colors.bold(`▸ ${node.name}/`)}`;
|
|
11
18
|
}
|
|
12
|
-
function
|
|
13
|
-
return
|
|
19
|
+
function sizeLabel(sizeBytes, colors) {
|
|
20
|
+
return colors.dim(`(${formatTerminalBytes(sizeBytes)})`);
|
|
14
21
|
}
|
|
15
|
-
function
|
|
16
|
-
return `${indent(node.depth)}${
|
|
22
|
+
function renderSizedFileRow(node, marker, highlight, colors) {
|
|
23
|
+
return `${indent(node.depth)}${highlight(marker)} ${node.name} ${sizeLabel(node.item.sizeBytes, colors)}`;
|
|
17
24
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
const newMode = file.newIsExecutable ? '755' : '644';
|
|
21
|
-
return colors.yellow(` mode ${oldMode} -> ${newMode}`);
|
|
25
|
+
function unixModeFor(isExecutable) {
|
|
26
|
+
return isExecutable ? '755' : '644';
|
|
22
27
|
}
|
|
23
|
-
function
|
|
24
|
-
if (file.
|
|
25
|
-
return
|
|
26
|
-
}
|
|
27
|
-
if (file.contentChange.kind === 'mode-only') {
|
|
28
|
-
return colors.dim(' (mode only)');
|
|
28
|
+
function renderModeChangeSuffix(file, colors) {
|
|
29
|
+
if (file.oldIsExecutable === file.newIsExecutable) {
|
|
30
|
+
return '';
|
|
29
31
|
}
|
|
30
|
-
return
|
|
32
|
+
return colors.yellow(` mode ${unixModeFor(file.oldIsExecutable)} -> ${unixModeFor(file.newIsExecutable)}`);
|
|
33
|
+
}
|
|
34
|
+
function renderModifiedAnnotation(file, colors) {
|
|
35
|
+
const annotation = modifiedAnnotationLabel[file.contentChange.kind];
|
|
36
|
+
return colors.dim(annotation);
|
|
31
37
|
}
|
|
32
38
|
function renderModifiedHeading(node, colors) {
|
|
33
39
|
const file = node.item;
|
|
34
40
|
const sizeDelta = `${formatTerminalBytes(file.oldSizeBytes)} -> ${formatTerminalBytes(file.newSizeBytes)}`;
|
|
35
|
-
|
|
36
|
-
const annotation = modifiedAnnotation(file, colors);
|
|
37
|
-
return `${indent(node.depth)}${colors.yellow(fileMarker.modified)} ${node.name} ${colors.dim(`(${sizeDelta})`)}${modeSuffix}${annotation}`.trimEnd();
|
|
41
|
+
return `${indent(node.depth)}${colors.yellow(fileMarker.modified)} ${node.name} ${colors.dim(`(${sizeDelta})`)}${renderModeChangeSuffix(file, colors)}${renderModifiedAnnotation(file, colors)}`;
|
|
38
42
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
const hunkIndent = indent(node.depth + hunkIndentDepthIncrement);
|
|
46
|
-
const lines = [];
|
|
47
|
-
for (const hunk of file.contentChange.hunks) {
|
|
43
|
+
function hasRenderedHunks(contentChange) {
|
|
44
|
+
return 'hunks' in contentChange;
|
|
45
|
+
}
|
|
46
|
+
function appendTextDiffHunks(lines, hunks, hunkIndent, colors) {
|
|
47
|
+
for (const hunk of hunks) {
|
|
48
48
|
lines.push(`${hunkIndent}${colors.dim(hunk.header)}`);
|
|
49
49
|
for (const line of hunk.lines) {
|
|
50
50
|
lines.push(`${hunkIndent}${renderDiffLine(line, colors)}`);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
return lines;
|
|
54
53
|
}
|
|
55
|
-
function
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
function appendAddedFileLines(lines, node, colors) {
|
|
55
|
+
lines.push(renderSizedFileRow(node, fileMarker.added, colors.green, colors));
|
|
56
|
+
}
|
|
57
|
+
function appendRemovedFileLines(lines, node, colors) {
|
|
58
|
+
lines.push(renderSizedFileRow(node, fileMarker.removed, colors.red, colors));
|
|
59
|
+
}
|
|
60
|
+
function appendModifiedHunks(lines, node, colors) {
|
|
61
|
+
if (!hasRenderedHunks(node.item.contentChange)) {
|
|
62
|
+
return;
|
|
58
63
|
}
|
|
59
|
-
|
|
60
|
-
|
|
64
|
+
appendTextDiffHunks(lines, node.item.contentChange.hunks, indent(node.depth + hunkIndentDepthIncrement), colors);
|
|
65
|
+
}
|
|
66
|
+
function appendModifiedFileLines(lines, node, colors) {
|
|
67
|
+
lines.push(renderModifiedHeading(node, colors));
|
|
68
|
+
appendModifiedHunks(lines, node, colors);
|
|
69
|
+
}
|
|
70
|
+
function appendTreeGroup(lines, group, colors) {
|
|
71
|
+
if (group.files.length === 0) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
lines.push(` ${colors.bold(`${group.title} (${group.files.length})`)}`);
|
|
75
|
+
const tree = buildPathTree(group.files, (file) => {
|
|
61
76
|
return file.path;
|
|
62
77
|
});
|
|
63
78
|
for (const node of tree) {
|
|
64
|
-
if (node.type ===
|
|
79
|
+
if (node.type === pathTreeNodeType.directory) {
|
|
65
80
|
lines.push(renderDirectoryLine(node, colors));
|
|
66
81
|
}
|
|
67
82
|
else {
|
|
68
|
-
|
|
83
|
+
group.appendFileLines(lines, node, colors);
|
|
69
84
|
}
|
|
70
85
|
}
|
|
71
|
-
return lines;
|
|
72
|
-
}
|
|
73
|
-
function renderAddedGroup(files, colors) {
|
|
74
|
-
return renderTreeGroup('Added', files, (node, fileColors) => {
|
|
75
|
-
return [renderAddedRow(node, fileColors)];
|
|
76
|
-
}, colors);
|
|
77
|
-
}
|
|
78
|
-
function renderRemovedGroup(files, colors) {
|
|
79
|
-
return renderTreeGroup('Removed', files, (node, fileColors) => {
|
|
80
|
-
return [renderRemovedRow(node, fileColors)];
|
|
81
|
-
}, colors);
|
|
82
|
-
}
|
|
83
|
-
function renderModifiedGroup(files, colors) {
|
|
84
|
-
return renderTreeGroup('Modified', files, (node, fileColors) => {
|
|
85
|
-
return [renderModifiedHeading(node, fileColors), ...renderModifiedHunks(node, fileColors)];
|
|
86
|
-
}, colors);
|
|
87
86
|
}
|
|
88
87
|
function renderHeaderSummary(files, unchangedCount) {
|
|
89
88
|
const parts = [
|
|
@@ -97,29 +96,31 @@ function renderHeaderSummary(files, unchangedCount) {
|
|
|
97
96
|
function renderUnchangedPackage(pkg, colors) {
|
|
98
97
|
return colors.dim(`${colors.bold(pkg.name)} ${pkg.previousVersionLabel} · no changes`);
|
|
99
98
|
}
|
|
100
|
-
function
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const groups = renderAddedGroup(pkg.files.added, colors);
|
|
104
|
-
return [header, chip, ...groups].join('\n');
|
|
99
|
+
function appendFirstPublishPackageLines(lines, pkg, colors) {
|
|
100
|
+
lines.push(`${colors.bold(pkg.name)} ${colors.dim(pkg.versionTransition)}`, ` ${colors.yellow('[first publish]')} ${colors.dim('showing all bundled files as added')}`);
|
|
101
|
+
appendTreeGroup(lines, { title: 'Added', files: pkg.files.added, appendFileLines: appendAddedFileLines }, colors);
|
|
105
102
|
}
|
|
106
|
-
function
|
|
103
|
+
function appendChangedPackageLines(lines, pkg, colors) {
|
|
107
104
|
const summary = renderHeaderSummary(pkg.files, pkg.files.unchanged.length);
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
...renderModifiedGroup(pkg.files.modified, colors)
|
|
113
|
-
];
|
|
114
|
-
return [header, ...groups].join('\n');
|
|
105
|
+
lines.push(`${colors.bold(pkg.name)} ${colors.dim(pkg.versionTransition)} ${colors.dim(`· ${summary}`)}`);
|
|
106
|
+
appendTreeGroup(lines, { title: 'Added', files: pkg.files.added, appendFileLines: appendAddedFileLines }, colors);
|
|
107
|
+
appendTreeGroup(lines, { title: 'Removed', files: pkg.files.removed, appendFileLines: appendRemovedFileLines }, colors);
|
|
108
|
+
appendTreeGroup(lines, { title: 'Modified', files: pkg.files.modified, appendFileLines: appendModifiedFileLines }, colors);
|
|
115
109
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
110
|
+
function renderPackageLines(pkg, colors) {
|
|
111
|
+
const lines = [];
|
|
112
|
+
if (pkg.state === packageReleaseDiffState.unchanged) {
|
|
113
|
+
lines.push(renderUnchangedPackage(pkg, colors));
|
|
114
|
+
return lines;
|
|
119
115
|
}
|
|
120
|
-
if (pkg.state ===
|
|
121
|
-
|
|
116
|
+
if (pkg.state === packageReleaseDiffState.firstPublish) {
|
|
117
|
+
appendFirstPublishPackageLines(lines, pkg, colors);
|
|
118
|
+
return lines;
|
|
122
119
|
}
|
|
123
|
-
|
|
120
|
+
appendChangedPackageLines(lines, pkg, colors);
|
|
121
|
+
return lines;
|
|
122
|
+
}
|
|
123
|
+
export function renderReleaseDiffPackage(pkg, colors) {
|
|
124
|
+
return renderPackageLines(pkg, colors).join('\n');
|
|
124
125
|
}
|
|
125
126
|
//# sourceMappingURL=terminal-release-diff-package-renderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal-release-diff-package-renderer.js","sourceRoot":"","sources":["../../../../../source/report/terminal-renderer/terminal-release-diff-package-renderer.ts"],"names":[],"mappings":"AAAA,2IAA2I;AAC3I,OAAO,EAAE,aAAa,EAA4C,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"terminal-release-diff-package-renderer.js","sourceRoot":"","sources":["../../../../../source/report/terminal-renderer/terminal-release-diff-package-renderer.ts"],"names":[],"mappings":"AAAA,2IAA2I;AAC3I,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAA4C,MAAM,2BAA2B,CAAC;AACtH,OAAO,EACH,6BAA6B,EAC7B,uBAAuB,EAM1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,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AAK,EACL,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,eAAe,EAAE,uBAAuB,EAAE,EAC1F,MAAM,CACT,CAAC;AACN,CAAC;AAED,SAAS,kBAAkB,CAAC,GAAuB,EAAE,MAAc;IAC/D,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,IAAI,GAAG,CAAC,KAAK,KAAK,uBAAuB,CAAC,SAAS,EAAE,CAAC;QAClD,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;QAChD,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,IAAI,GAAG,CAAC,KAAK,KAAK,uBAAuB,CAAC,YAAY,EAAE,CAAC;QACrD,8BAA8B,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QACnD,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,yBAAyB,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IAC9C,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,GAAuB,EAAE,MAAc;IAC5E,OAAO,kBAAkB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import { renderReleaseDiffPackage } from "./terminal-release-diff-package-renderer.js";
|
|
2
2
|
import { createColors, renderFailureDocumentHeader } from "./terminal-preview-renderer-shared.js";
|
|
3
3
|
function renderDocumentSummary(document, colors) {
|
|
4
|
-
const packageLine =
|
|
5
|
-
`${document.summary.
|
|
6
|
-
`${document.summary.
|
|
7
|
-
`${document.summary.
|
|
8
|
-
`${document.summary.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
`${document.summary.addedFiles} files added`,
|
|
13
|
-
`${document.summary.removedFiles} removed`,
|
|
14
|
-
`${document.summary.modifiedFiles} modified`
|
|
15
|
-
].join(' · ');
|
|
4
|
+
const packageLine = `${document.summary.totalPackages} package(s) · ` +
|
|
5
|
+
`${document.summary.changedPackages} changed · ` +
|
|
6
|
+
`${document.summary.firstPublishPackages} first-publish · ` +
|
|
7
|
+
`${document.summary.unchangedPackages} unchanged · ` +
|
|
8
|
+
`${document.summary.failedPackages} failed`;
|
|
9
|
+
const fileLine = `${document.summary.addedFiles} files added · ` +
|
|
10
|
+
`${document.summary.removedFiles} removed · ` +
|
|
11
|
+
`${document.summary.modifiedFiles} modified`;
|
|
16
12
|
const indentedFileLine = ` · ${fileLine}`;
|
|
17
13
|
return `${colors.dim(packageLine)}\n${colors.dim(indentedFileLine)}`;
|
|
18
14
|
}
|
|
@@ -22,27 +18,24 @@ function renderDocumentHeader(document, colors) {
|
|
|
22
18
|
}
|
|
23
19
|
function renderIssuesSection(document, colors) {
|
|
24
20
|
if (document.issues.length === 0) {
|
|
25
|
-
return
|
|
21
|
+
return undefined;
|
|
26
22
|
}
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
.join('\n')}`
|
|
33
|
-
];
|
|
23
|
+
return `${colors.red('Issues')}\n${document.issues
|
|
24
|
+
.map((issue) => {
|
|
25
|
+
return `- ${issue}`;
|
|
26
|
+
})
|
|
27
|
+
.join('\n')}`;
|
|
34
28
|
}
|
|
35
29
|
export function renderTerminalReleaseDiff(document, options = {}) {
|
|
36
30
|
const colors = createColors(options.color);
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
];
|
|
31
|
+
const sections = [renderDocumentHeader(document, colors), renderDocumentSummary(document, colors)];
|
|
32
|
+
const issuesSection = renderIssuesSection(document, colors);
|
|
33
|
+
if (issuesSection !== undefined) {
|
|
34
|
+
sections.push(issuesSection);
|
|
35
|
+
}
|
|
36
|
+
for (const pkg of document.packages) {
|
|
37
|
+
sections.push(renderReleaseDiffPackage(pkg, colors));
|
|
38
|
+
}
|
|
46
39
|
return `${sections.join('\n\n')}\n`;
|
|
47
40
|
}
|
|
48
41
|
export function renderFailureOnlyTerminalReleaseDiff(document, options = {}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal-release-diff-renderer.js","sourceRoot":"","sources":["../../../../../source/report/terminal-renderer/terminal-release-diff-renderer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,2BAA2B,EAAe,MAAM,uCAAuC,CAAC;AAM/G,SAAS,qBAAqB,CAAC,QAA6B,EAAE,MAAc;IACxE,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"terminal-release-diff-renderer.js","sourceRoot":"","sources":["../../../../../source/report/terminal-renderer/terminal-release-diff-renderer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,2BAA2B,EAAe,MAAM,uCAAuC,CAAC;AAM/G,SAAS,qBAAqB,CAAC,QAA6B,EAAE,MAAc;IACxE,MAAM,WAAW,GACb,GAAG,QAAQ,CAAC,OAAO,CAAC,aAAa,gBAAgB;QACjD,GAAG,QAAQ,CAAC,OAAO,CAAC,eAAe,aAAa;QAChD,GAAG,QAAQ,CAAC,OAAO,CAAC,oBAAoB,mBAAmB;QAC3D,GAAG,QAAQ,CAAC,OAAO,CAAC,iBAAiB,eAAe;QACpD,GAAG,QAAQ,CAAC,OAAO,CAAC,cAAc,SAAS,CAAC;IAChD,MAAM,QAAQ,GACV,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,iBAAiB;QAC/C,GAAG,QAAQ,CAAC,OAAO,CAAC,YAAY,aAAa;QAC7C,GAAG,QAAQ,CAAC,OAAO,CAAC,aAAa,WAAW,CAAC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KAAK,MAAM,GAAG,IAAI,QAAQ,CAAC,QAAQ,EAAE,CAAC;QAClC,QAAQ,CAAC,IAAI,CAAC,wBAAwB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,oCAAoC,CAChD,QAA6B,EAC7B,UAA8C,EAAE;IAEhD,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC3C,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,2BAA2B,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IACxE,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACnC,CAAC"}
|
package/sbom.cdx.json
CHANGED
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
{
|
|
10
10
|
"type": "application",
|
|
11
11
|
"name": "packtory",
|
|
12
|
-
"version": "0.0.
|
|
12
|
+
"version": "0.0.22"
|
|
13
13
|
}
|
|
14
14
|
]
|
|
15
15
|
},
|
|
16
16
|
"component": {
|
|
17
17
|
"type": "library",
|
|
18
18
|
"name": "@packtory/cli",
|
|
19
|
-
"version": "0.0.
|
|
20
|
-
"bom-ref": "pkg:npm/@packtory/cli@0.0.
|
|
21
|
-
"purl": "pkg:npm/@packtory/cli@0.0.
|
|
19
|
+
"version": "0.0.23",
|
|
20
|
+
"bom-ref": "pkg:npm/@packtory/cli@0.0.23",
|
|
21
|
+
"purl": "pkg:npm/@packtory/cli@0.0.23"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"components": [
|
|
@@ -51,15 +51,15 @@
|
|
|
51
51
|
{
|
|
52
52
|
"type": "library",
|
|
53
53
|
"name": "packtory",
|
|
54
|
-
"version": "0.0.
|
|
55
|
-
"bom-ref": "pkg:npm/packtory@0.0.
|
|
54
|
+
"version": "0.0.23",
|
|
55
|
+
"bom-ref": "pkg:npm/packtory@0.0.23",
|
|
56
56
|
"scope": "required",
|
|
57
57
|
"licenses": [
|
|
58
58
|
{
|
|
59
59
|
"expression": "MIT"
|
|
60
60
|
}
|
|
61
61
|
],
|
|
62
|
-
"purl": "pkg:npm/packtory@0.0.
|
|
62
|
+
"purl": "pkg:npm/packtory@0.0.23"
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
"type": "library",
|
|
@@ -74,6 +74,19 @@
|
|
|
74
74
|
],
|
|
75
75
|
"purl": "pkg:npm/remeda@2.37.0"
|
|
76
76
|
},
|
|
77
|
+
{
|
|
78
|
+
"type": "library",
|
|
79
|
+
"name": "ts-pattern",
|
|
80
|
+
"version": "5.9.0",
|
|
81
|
+
"bom-ref": "pkg:npm/ts-pattern@5.9.0",
|
|
82
|
+
"scope": "required",
|
|
83
|
+
"licenses": [
|
|
84
|
+
{
|
|
85
|
+
"expression": "MIT"
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"purl": "pkg:npm/ts-pattern@5.9.0"
|
|
89
|
+
},
|
|
77
90
|
{
|
|
78
91
|
"type": "library",
|
|
79
92
|
"name": "yoctocolors",
|
|
@@ -90,12 +103,13 @@
|
|
|
90
103
|
],
|
|
91
104
|
"dependencies": [
|
|
92
105
|
{
|
|
93
|
-
"ref": "pkg:npm/@packtory/cli@0.0.
|
|
106
|
+
"ref": "pkg:npm/@packtory/cli@0.0.23",
|
|
94
107
|
"dependsOn": [
|
|
95
108
|
"pkg:npm/cmd-ts@0.15.0",
|
|
96
109
|
"pkg:npm/open@11.0.0",
|
|
97
|
-
"pkg:npm/packtory@0.0.
|
|
110
|
+
"pkg:npm/packtory@0.0.23",
|
|
98
111
|
"pkg:npm/remeda@2.37.0",
|
|
112
|
+
"pkg:npm/ts-pattern@5.9.0",
|
|
99
113
|
"pkg:npm/yoctocolors@2.1.2"
|
|
100
114
|
]
|
|
101
115
|
},
|
|
@@ -106,11 +120,14 @@
|
|
|
106
120
|
"ref": "pkg:npm/open@11.0.0"
|
|
107
121
|
},
|
|
108
122
|
{
|
|
109
|
-
"ref": "pkg:npm/packtory@0.0.
|
|
123
|
+
"ref": "pkg:npm/packtory@0.0.23"
|
|
110
124
|
},
|
|
111
125
|
{
|
|
112
126
|
"ref": "pkg:npm/remeda@2.37.0"
|
|
113
127
|
},
|
|
128
|
+
{
|
|
129
|
+
"ref": "pkg:npm/ts-pattern@5.9.0"
|
|
130
|
+
},
|
|
114
131
|
{
|
|
115
132
|
"ref": "pkg:npm/yoctocolors@2.1.2"
|
|
116
133
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export function collectChangedArtifacts(tree) {
|
|
2
|
-
return tree.flatMap((node) => {
|
|
3
|
-
if (node.type !== 'file') {
|
|
4
|
-
return [];
|
|
5
|
-
}
|
|
6
|
-
const { artifact } = node;
|
|
7
|
-
return artifact.diff === undefined ? [] : [{ ...artifact, diff: artifact.diff }];
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=changed-artifacts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"changed-artifacts.js","sourceRoot":"","sources":["../../../../../source/report/preview/changed-artifacts.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,uBAAuB,CAAC,IAAoC;IACxE,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACzB,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACvB,OAAO,EAAE,CAAC;QACd,CAAC;QACD,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAC1B,OAAO,QAAQ,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preview-document-helpers.js","sourceRoot":"","sources":["../../../../../source/report/preview/preview-document-helpers.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,sBAAsB,CAAC,aAA4B;IAC/D,MAAM,EAAE,OAAO,EAAE,GAAG,aAAa,CAAC,SAAS,CAAC;IAC5C,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,IAAI,OAAO,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;QACxC,OAAO,OAAO,CAAC,aAAa,CAAC;IACjC,CAAC;IACD,OAAO,GAAG,OAAO,CAAC,eAAe,OAAO,OAAO,CAAC,aAAa,EAAE,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,oBAAoB,CAChC,SAAqC,EACrC,qBAAsD;IAEtD,IAAI,qBAAqB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC/B,OAAO,QAAQ,CAAC,MAAM,KAAK,SAAS,CAAC;IACzC,CAAC,CAAC,CAAC;AACP,CAAC"}
|