@preventive/triage 1.0.0-alpha.29 → 1.0.0-alpha.30
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/common/bundle-commit.d.ts +1 -0
- package/common/bundle-commit.js +4 -0
- package/common/bundle-metadata.d.ts +1 -1
- package/common/bundle-metadata.js +4 -1
- package/out/client-managed.js +64 -64
- package/out/graph.js +7 -7
- package/out/view.css +1 -1
- package/out/view.js +166 -166
- package/package.json +10 -3
- package/server-managed/bundle-cache.ts +1 -1
- package/server-managed/bundle-summary-cache.ts +4 -3
- package/server-managed/http.ts +6 -4
- package/server-managed/storage-maintenance.ts +17 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function bundleCommitHash(value: unknown): string | null
|
|
@@ -7,4 +7,4 @@ export interface BundleMetadata extends Record<string, unknown> {
|
|
|
7
7
|
codeStats: { files: number; lines: number; bytes: number }
|
|
8
8
|
}
|
|
9
9
|
export function createBundleMetadata(details: BundleDetails): Promise<BundleMetadata>
|
|
10
|
-
export function createBundleSummary(details: BundleDetails, metadata?: BundleMetadata): { files: number; codeFiles: number; lines: number }
|
|
10
|
+
export function createBundleSummary(details: BundleDetails, metadata?: BundleMetadata): { files: number; codeFiles: number; lines: number; commit?: string }
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { bundleCodeStats } from './bundle-stats.js'
|
|
2
|
+
import { bundleCommitHash } from './bundle-commit.js'
|
|
2
3
|
import { Bundle } from '@exodus/stasis-core/bundle'
|
|
3
4
|
import { computeFileHash } from '@preventive/report'
|
|
4
5
|
import { utf8ByteLength } from './utf8.js'
|
|
@@ -104,8 +105,10 @@ export function createBundleSummary(details, metadata) {
|
|
|
104
105
|
const files = (metadata?.files ?? [...bundleFileSizes(details)]).filter(([, size]) => size !== null)
|
|
105
106
|
const formats = details.kind === 'stasis' ? details.bundle.formats : null
|
|
106
107
|
const lines = metadata?.codeStats.lines ?? [...bundleSourcesAsMap(details).values()].reduce((sum, source) => sum + bundleSourceLineCount(source), 0)
|
|
108
|
+
const commit = details.kind === 'stasis' ? bundleCommitHash(details.bundle.repo?.commit) : null
|
|
107
109
|
return { files: files.length, lines,
|
|
108
|
-
codeFiles: files.filter(([path]) => !['resource:base64', 'directory'].includes(formats?.get(path))).length
|
|
110
|
+
codeFiles: files.filter(([path]) => !['resource:base64', 'directory'].includes(formats?.get(path))).length,
|
|
111
|
+
...(commit ? { commit } : {}) }
|
|
109
112
|
}
|
|
110
113
|
|
|
111
114
|
// `stale` marks an index this version did not write: its hashes still
|