-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
58 lines (52 loc) · 1.87 KB
/
types.ts
File metadata and controls
58 lines (52 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
* @fileoverview Socket Registry ecosystem schema types — tags for
* packages and the manifest entries the registry build pipeline emits.
*
* - `CategoryString` — registry intent tag (cleanup/levelup/...)
* - `InteropString` — module-format tag (cjs/esm/browserify)
* - `ManifestEntryData` — per-package metadata (name/version + tags)
* - `ManifestEntry` — `[packageName, data]` tuple shape
* - `Manifest` — top-level map keyed by ecosystem
*
* Constants and PURL ecosystem identifiers live in `./purl`.
*/
import type { EcosystemString } from './purl'
/**
* Socket Registry category tag for packages.
*
* - `cleanup` — removes unused / unsafe code
* - `levelup` — adds capabilities (modern API surface, new features)
* - `speedup` — performance optimization
* - `tuneup` — quality/reliability tweaks
*/
export type CategoryString = 'cleanup' | 'levelup' | 'speedup' | 'tuneup'
/**
* Module-format interop tag for packages.
*
* - `browserify` — bundled for browser consumption (CJS + shims)
* - `cjs` — CommonJS
* - `esm` — ES modules
*/
export type InteropString = 'browserify' | 'cjs' | 'esm'
/**
* Per-package metadata emitted into the manifest. The `[key: string]`
* tail keeps the type open for ecosystem-specific extensions added by
* downstream tooling.
*/
export type ManifestEntryData = {
categories?: CategoryString[] | undefined
interop?: InteropString | undefined
license?: string | undefined
name: string
version: string
[key: string]: unknown
}
/**
* Single manifest entry as a `[name, data]` tuple — the on-disk shape
* used by the registry build pipeline.
*/
export type ManifestEntry = [packageName: string, data: ManifestEntryData]
/**
* Top-level manifest keyed by ecosystem (PURL slug).
*/
export type Manifest = Record<EcosystemString, ManifestEntry[]>